CN108243155B - Method and device for sending communication information - Google Patents

Method and device for sending communication information Download PDF

Info

Publication number
CN108243155B
CN108243155B CN201611218239.1A CN201611218239A CN108243155B CN 108243155 B CN108243155 B CN 108243155B CN 201611218239 A CN201611218239 A CN 201611218239A CN 108243155 B CN108243155 B CN 108243155B
Authority
CN
China
Prior art keywords
account
notification
information
notified
queue
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
CN201611218239.1A
Other languages
Chinese (zh)
Other versions
CN108243155A (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 Yunzhong Rongxin Network Technology Co ltd
Original Assignee
Beijing Yunzhong Rongxin 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 Yunzhong Rongxin Network Technology Co ltd filed Critical Beijing Yunzhong Rongxin Network Technology Co ltd
Priority to CN201611218239.1A priority Critical patent/CN108243155B/en
Publication of CN108243155A publication Critical patent/CN108243155A/en
Application granted granted Critical
Publication of CN108243155B publication Critical patent/CN108243155B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/80Responding to QoS
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/52User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail for supporting social networking services

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computing Systems (AREA)
  • Multimedia (AREA)
  • Telephonic Communication Services (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The invention discloses a method and a device for sending communication information, and belongs to the technical field of computers. The method comprises the following steps: adding each account in the target live broadcast room into a notification account queue; according to a preset notification period and the sequencing of the accounts in the notification account queue, sending information pull notifications to the terminals logged in by the accounts in the notification account queue one by one; and when an information pulling request with a time stamp sent by a first terminal is received, acquiring the communication information of which the release time is after the time stamp in the target live broadcast room, and sending the communication information to the first terminal. The invention can reduce the occupation of processing resources and transmission resources of the server.

Description

Method and device for sending communication information
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for sending communication information.
Background
With the development of video technology and internet technology, live webcasting has been rapidly popularized. The live broadcast room of the network live broadcast is generally provided with a chat function, a certain user publishes a piece of communication information in the live broadcast room, and other users in the live broadcast room can see the communication information.
During the process of publishing the communication information, the server generally adopts a "notification-pull" mechanism. Specifically, each time the server receives a piece of communication information issued by an account in the live broadcast room, the server sends an information pulling notification to terminals logged in by all other accounts in the live broadcast room, after receiving the information pulling notification, the terminals send an information pulling request to the server, and then the server sends corresponding communication information to the terminals.
In the process of implementing the invention, the inventor finds that the prior art has at least the following problems:
generally, the amount of users in the live broadcast room is large, and the users speak frequently, so that the processing resources and transmission resources of the server are excessively occupied according to the processing mechanism.
Disclosure of Invention
In order to solve the problems in the prior art, embodiments of the present invention provide a method and an apparatus for sending communication information. The technical scheme is as follows:
in a first aspect, a method for sending communication information is provided, including:
adding each account in the target live broadcast room into a notification account queue;
according to a preset notification period and the sequencing of the accounts in the notification account queue, sending information pull notifications to the terminals logged in by the accounts in the notification account queue one by one;
And when an information pulling request with a time stamp sent by a first terminal is received, acquiring the communication information of which the release time is after the time stamp in the target live broadcast room, and sending the communication information to the first terminal.
Optionally, the sending, according to a preset notification period and the ranking of the accounts in the notification account queue, information pull notifications one by one to the terminal where the accounts in the notification account queue log in includes:
determining accounts to be notified according to the sequence of the accounts in the notification account queue when a preset notification period is reached;
if the account to be notified meets any notification condition, sending an information pulling notification to a terminal logged in by the account to be notified, wherein the notification condition comprises:
after sending an information pulling notification to the terminal logged in by the account to be notified last time, receiving an information pulling request sent by the terminal logged in by the account to be notified;
after the account to be notified is added into the target live broadcast room, an information pulling notification is not sent to a terminal logged in by the account to be notified;
and the time difference between the time of sending the information pulling notification to the terminal logged in by the account to be notified last time and the current time is larger than a preset threshold value.
Thus, the utilization rate of system transmission resources can be improved.
Optionally, the notification condition further includes: the account to be notified is in an offline state.
Optionally, the method further includes:
when the heartbeat message of a first account is not received according to a preset heartbeat cycle, recording that the first account enters an offline state;
when the first account is in an offline state, if an information pulling notice sent by a terminal logged in by the first account is received, recording that the first account enters an online state;
and when the time length of the first account in the offline state reaches a preset time length threshold value, or the number of times of continuously sending an information pulling notification to the terminal logged in by the first account after the first account enters the offline state reaches a preset number threshold value, and an information pulling request sent by the terminal logged in by the first account is not received, removing the first account from the target live broadcast room.
Therefore, the account of the on-hook can be kicked out of the live broadcast room, and the load pressure of the server is reduced.
Optionally, the adding each account in the target live broadcast room to the notification account queue includes: adding accounts which are not in the notification account queue in the target live broadcast room to the tail of the notification account queue when a communication message is received;
When the preset notification period is reached, determining the accounts to be notified according to the sequence of the accounts in the notification account queue, including: determining the account at the head of the notification account queue as an account to be notified each time a preset notification period is reached;
the method further comprises the following steps: and after each account to be notified is determined, removing the account to be notified from the notification account queue.
Therefore, system resources occupied by the server for sending the information pulling notification can be reduced.
Optionally, the method further includes:
when the occupancy rate of the processor or the occupancy rate of the memory is detected to be greater than a first preset threshold value, increasing the notification period from a first period value to a second period value;
and when the occupancy rate of the processor and the occupancy rate of the memory are both smaller than a second preset threshold value, reducing the notification period from the second period value to the first period value, wherein the second preset threshold value is smaller than the first preset threshold value.
In this way, the load condition of the server can be adjusted in real time.
Optionally, the adding each account in the target live broadcast room to the notification account queue includes:
And respectively adding each account in the target live broadcast room into a corresponding notification account queue according to a pre-stored corresponding relation between the account in the target live broadcast room and the notification account queue.
In this way, different accounts may be assigned to corresponding notification account queues.
In a second aspect, an apparatus for sending communication information is provided, including:
the adding module is used for adding each account in the target live broadcast room into the notification account queue;
the notification module is used for sending information pull notifications to the terminals logged in by the accounts in the notification account queue one by one according to a preset notification period and the sequence of the accounts in the notification account queue;
and the sending module is used for acquiring the communication information of which the release time is after the time stamp in the target live broadcast room when receiving an information pulling request which is sent by a first terminal and carries the time stamp, and sending the communication information to the first terminal.
Optionally, the notification module is configured to:
determining accounts to be notified according to the sequence of the accounts in the notification account queue when a preset notification period is reached;
if the account to be notified meets any notification condition, sending an information pulling notification to a terminal logged in by the account to be notified, wherein the notification condition comprises:
After sending an information pulling notification to the terminal logged in by the account to be notified last time, receiving an information pulling request sent by the terminal logged in by the account to be notified;
after the account to be notified is added into the target live broadcast room, an information pulling notification is not sent to a terminal logged in by the account to be notified;
and the time difference between the time of sending the information pulling notification to the terminal logged in by the account to be notified last time and the current time is larger than a preset threshold value.
Optionally, the notification condition further includes: the account to be notified is in an offline state.
Optionally, the apparatus further includes a state management module, configured to:
when the heartbeat message of a first account is not received according to a preset heartbeat cycle, recording that the first account enters an offline state;
when the first account is in an offline state, if an information pulling notice sent by a terminal logged in by the first account is received, recording that the first account enters an online state;
and when the time length of the first account in the offline state reaches a preset time length threshold value, or the number of times of continuously sending an information pulling notification to the terminal logged in by the first account after the first account enters the offline state reaches a preset number threshold value, and an information pulling request sent by the terminal logged in by the first account is not received, removing the first account from the target live broadcast room.
Optionally, the adding module is configured to: adding accounts which are not in the notification account queue in the target live broadcast room to the tail of the notification account queue when a communication message is received;
the notification module is configured to: determining the account at the head of the notification account queue as an account to be notified each time a preset notification period is reached;
the notification module is further configured to: and after each account to be notified is determined, removing the account to be notified from the notification account queue.
Optionally, the apparatus further includes an adjusting module, configured to:
when the occupancy rate of the processor or the occupancy rate of the memory is detected to be greater than a first preset threshold value, increasing the notification period from a first period value to a second period value;
and when the occupancy rate of the processor and the occupancy rate of the memory are both smaller than a second preset threshold value, reducing the notification period from the second period value to the first period value, wherein the second preset threshold value is smaller than the first preset threshold value.
Optionally, the adding module is configured to:
and respectively adding each account in the target live broadcast room into a corresponding notification account queue according to a pre-stored corresponding relation between the account in the target live broadcast room and the notification account queue.
The technical scheme provided by the embodiment of the invention has the following beneficial effects:
in the embodiment of the invention, each account in the target live broadcast room is added into the notification account queue, the information pulling notification is sent to the terminals logged by the accounts in the notification account queue one by one according to the preset notification period and the sequence of the accounts in the notification account queue, and when an information pulling request which is sent by a first terminal and carries a time stamp is received, the communication information of which the release time is after the time stamp in the target live broadcast room is obtained and sent to the first terminal. Therefore, the server carries out queue type notification, the terminal can pull a plurality of pieces of communication information at one time, and based on the setting of the notification period, the sending quantity of the information pulling notification and the receiving quantity of the information pulling request can be greatly reduced, so that the occupation of processing resources and transmission resources of the server can be reduced.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic diagram of a system framework provided by an embodiment of the invention;
fig. 2 is a flowchart illustrating a method for sending a communication message according to an embodiment of the present invention;
3a and 3b are schematic diagrams illustrating operations performed on a notification account queue according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an apparatus for sending a communication message according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a server according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
The embodiment of the invention provides a method for sending communication information, which can be realized by a server. The server can be a background server of a live webcast website or a live webcast application program, and the server can maintain the operation of a large number of live webcasts. During operation, the server receives a large amount of communication information (namely chat information) issued by the account in each live broadcast room. Meanwhile, the server notifies the account in each live broadcast room to pull the communication information by the server based on the notification mechanism provided by the embodiment of the invention. A corresponding system framework diagram may be as shown in fig. 1.
The server may include a processor, memory, transceiver, etc. The processor, which may be a Central Processing Unit (CPU), may be configured to add each account in the target live broadcast to a notification account queue, determine an account to be notified according to a ranking of the accounts in the notification account queue each time a preset notification period is reached, send an information pull notification to the account to be notified if the account to be notified satisfies a certain condition, and perform other Processing. The Memory may be a RAM (Random Access Memory), a Flash Memory, and the like, and may be configured to store received data, data required by the processing procedure, data generated in the processing procedure, and the like, such as a notification period, a notification account queue, communication information, and the like. The transceiver may be used for data transmission with a terminal or other servers (e.g., a positioning server), for example, sending an information pull notification to the terminal, receiving an information pull request sent by the terminal, and sending communication information to the terminal, and may include an antenna, a matching circuit, a modem, and the like.
As shown in fig. 2, the processing flow of the method may include the following steps:
Step 201, adding each account in the target live broadcast room into a notification account queue.
The notification account queue is a queue which is established by the server for accounts in the live broadcast room and used for queuing and sending information pull notifications. The server may establish one notification account queue for each live broadcast room, or may establish multiple notification account queues for each live broadcast room, for example, the number of notification account queues for each live broadcast room may be the same as the number of CPUs of the server.
In implementations, the manner in which the server maintains the notification account queue may vary. For example, the server may add an account that joined the target live broadcast room to the notification account queue and keep the account in the notification account queue all the time until the account leaves the live broadcast room, or may add the account to the notification account queue only when there is newly released communication information. When the account is added into the notification account queue, the adding sequence can be set arbitrarily according to the requirement, for example, the adding sequence can be based on the order of the account added into the live broadcast, and can also be a random order.
Optionally, for a case that each live broadcast room has multiple notification account queues, a notification account queue may be allocated to each account in the live broadcast room based on a load balancing principle, and the corresponding processing may be as follows: and respectively adding each account in the target live broadcast room into the corresponding notification account queue according to the pre-stored corresponding relation between the account in the target live broadcast room and the notification account queue.
In implementation, after the target live broadcast room is started, the server may establish a plurality of notification account queues for the target live broadcast room, and the number of the notification account queues may be the same as the number of the CPUs. Meanwhile, the server may assign a number to each notification account queue, which may be a non-negative integer starting from 0. When an account is added into the target live broadcast room, the server may allocate a corresponding notification account queue to the account according to a preset load balancing processing manner, store the identification of the account corresponding to the number of the notification account queue, and establish a corresponding relationship between the account and the notification account queue, as shown in table 1 below. The load balancing processing manner may be various, for example, a polling manner may be adopted, or a hash value of the identifier of the account may be calculated, an absolute value is taken for the hash value, then the absolute value is divided by the number of notification account queues, a remainder is taken, and then the notification account queue numbered as the remainder may be allocated to the account.
TABLE 1
Notification account queue Account
0 A、B、C、D……
1 E、F、G、H……
2 I、J、K、L……
Step 202, according to a preset notification period and the sequence of the accounts in the notification account queue, sending information pull notifications one by one to the terminals logged in by the accounts in the notification account queue.
In implementation, a technician may preset a notification period, where the notification period is a time interval between two previous and subsequent sending of information pull notifications, and the notification period may be set based on the processing capability of the server, a server with a stronger processing capability may set a shorter notification period, and a server with a weaker processing capability may set a longer notification period. The server may send an information pull notification to an account every other notification period according to the sorting of the accounts in the notification account queue, and specifically, the information pull notification may be sent to a terminal where the account logs in. If the target live broadcast room has multiple notification account queues, the process can be performed separately for each notification account queue.
Optionally, the information pull notification may be sent only when the account satisfies a certain condition, and correspondingly, the processing of step 202 may be as follows: determining accounts to be notified according to the sequence of the accounts in the notification account queue when a preset notification period is reached; and if the account to be notified meets any notification condition, sending an information pulling notification to the terminal logged in by the account to be notified.
The information pull notification is used for triggering the terminal to send an information pull request to the server after receiving the information pull notification. And the information pulling request is used for triggering the server to send corresponding communication information to the terminal after receiving the information pulling request.
In implementation, as shown in fig. 3a, each time a preset notification period is reached, the account notifying the head of the account queue may be determined as the account to be notified. Further, it may be determined whether or not the account satisfies the notification condition, and if any notification condition is satisfied, the information pull notification may be transmitted to the terminal to which the account is registered, and if all notification conditions are not satisfied, the information pull notification may not be transmitted to the terminal to which the account is registered.
In addition, as shown in fig. 3a, for the above processing situation, after each account to be notified is determined, the account to be notified is removed from the notification account queue. Specifically, the account to be notified may be removed from the notification account queue after the information pull notification is sent or it is determined not to send the information pull notification. After removal, in the notification account queue, the account behind the account becomes the account at the head of the queue.
In addition, for the above processing case, the processing of step 201 may be: every time a communication message is received, adding an account which is not in the notification account queue in the target live broadcast room to the tail of the notification account queue, as shown in fig. 3 b. In the actual operation process, after receiving the first piece of communication information, the server adds all the accounts into the notification account queue, in the process of notifying the accounts one by one, the server may receive a second piece of communication information, at this time, a part of the accounts may be notified and removed from the notification account queue, while a part of the accounts are not notified yet, and are queued in the notification account queue for waiting, at this time, the server receives the second piece of communication information, so that the accounts which are not in the notification account queue are added into the notification account queue again and placed at the tail of the queue. In this way, these accounts can be prevented from missing the second communication.
In this embodiment, the notification condition may include:
the method comprises the steps that under the condition one, after an information pulling notice is sent to a terminal logged in by an account to be notified last time, an information pulling request sent by the terminal logged in by the account to be notified is received.
And secondly, after the account to be notified is added into the target live broadcast room, the information pulling notification is not sent to the terminal logged in by the account to be notified.
And thirdly, under the condition that the time difference between the time of sending the information pulling notification to the terminal logged in by the account to be notified last time and the current time is larger than a preset threshold (for example, 1 second).
In implementation, the fact that the account to be notified satisfies the first condition means that the server receives an information pull request replied by the account after sending the information pull notification to the account last time. On the contrary, if the account does not reply to the server with the information pulling request last time and the account does not satisfy other notification conditions, the server does not send the information pulling notification to the account this time. And the account to be notified meets the condition two, which means that the account is the account newly added to the target live broadcast room. The account to be notified satisfies the third condition, which means that although the account does not reply after the server sends the information pull notification to the account last time, it may be considered to send the information pull notification to the account again after a certain time has elapsed since the information pull notification is sent to the account, so as to prevent the account from being notified all the time.
Optionally, the notification condition further includes: and fourthly, the account to be notified is in an offline state.
In an implementation, based on condition four, an account in an offline state may continue to be sent information pull notifications to determine whether it remains offline for a long period of time.
Optionally, it may be determined that the account enters an offline state, and the account that remains offline for a long time is removed from the live broadcast room, and the corresponding processing may be as follows: when the heartbeat message of the first account is not received according to a preset heartbeat cycle, recording that the first account enters an offline state; when the first account is in an off-line state, if an information pulling notice sent by a terminal logged in by the first account is received, recording that the first account enters the on-line state; and when the time length of the first account in the offline state reaches a preset time length threshold value, or the number of times of continuously sending an information pulling notification to the terminal logged in the first account after the first account enters the offline state reaches a preset number threshold value, and an information pulling request sent by the terminal logged in the first account is not received, removing the first account from the target live broadcast room.
In implementation, after a terminal logs in a live webcast application program or a live webcast website, a heartbeat message is sent to a server according to a preset heartbeat cycle, the server detects whether the heartbeat message of an account is received or not according to the heartbeat cycle for each logged account, if the heartbeat message is received, the account is recorded to enter an offline state, and if the heartbeat message is received, the account is determined to be still in the online state. For the account in the offline state, based on the fourth condition, the server normally sends the information pulling notification to the account, and if the number of times of continuously sending the information pulling notification reaches the preset number threshold, or the duration of continuously sending the information pulling notification reaches the preset duration threshold, and no corresponding reply is received, the account is determined to be kept offline for a long time, and the account is removed from the target live broadcast room. If the server receives an information pulling notice sent by the terminal logged in by the account in the process, the account is recorded to enter the online state.
Step 203, when receiving an information pulling request with a time stamp sent by the first terminal, obtaining communication information with a release time after the time stamp in the target live broadcast room, and sending the communication information to the first terminal.
The timestamp is the release time of the latest communication information received by the terminal before the terminal sends the information pulling request.
In implementation, after receiving the information pull notification, the terminal may check the release time of the latest communication information of the target live broadcast received locally, add the release time as a timestamp to the information pull request, and send the timestamp to the server. After receiving the information pulling request sent by the terminal, the server can obtain the timestamp in the information pulling request, searches the communication information with the release time after the timestamp in all the communication information of the target live broadcast room, and sends the communication information to the terminal.
Optionally, the server may adjust the notification period based on the load condition, and the corresponding processing may be as follows: when the occupancy rate of the processor or the occupancy rate of the memory is detected to be greater than a first preset threshold value, increasing the notification period from a first period value to a second period value; and when the occupancy rate of the processor and the occupancy rate of the memory are both smaller than a second preset threshold value, reducing the notification period from the second period value to the first period value, wherein the second preset threshold value is smaller than the first preset threshold value.
In an implementation, the first period value and the second period value may both be previously set by a skilled person. In the initial state, the server may use a shorter first period value as the notification period. When one of the processor or the memory is overloaded, the server may set the notification period to a longer second period value. In this way, processor and memory stress may be relieved. Then, in the process that the server operates based on the longer notification period, when the loads of the processor and the memory are lower, the notification period can be set to the shorter first period value again. Therefore, the sending frequency of the information pulling notice can be improved, and the communication information is prevented from being missed by the terminal.
In the embodiment of the invention, each account in the target live broadcast room is added into the notification account queue, the information pulling notification is sent to the terminals logged by the accounts in the notification account queue one by one according to the preset notification period and the sequence of the accounts in the notification account queue, and when an information pulling request which is sent by a first terminal and carries a time stamp is received, the communication information of which the release time is after the time stamp in the target live broadcast room is obtained and sent to the first terminal. Therefore, the server carries out queue type notification, the terminal can pull a plurality of pieces of communication information at one time, and based on the setting of the notification period, the sending quantity of the information pulling notification and the receiving quantity of the information pulling request can be greatly reduced, so that the occupation of processing resources and transmission resources of the server can be reduced.
Based on the same technical concept, an embodiment of the present invention further provides an apparatus for sending communication information, which may be a server in the foregoing embodiment, and is configured to execute the method for sending communication information in the foregoing embodiment, as shown in fig. 4, the apparatus includes:
an adding module 410, configured to add each account in the target live broadcast room to the notification account queue;
a notification module 420, configured to send information pull notifications one by one to terminals logged in by accounts in the notification account queue according to a preset notification period and the ordering of the accounts in the notification account queue;
the sending module 430 is configured to, when receiving an information pulling request with a time stamp sent by a first terminal, obtain communication information with an issue time after the time stamp in the target live broadcast room, and send the communication information to the first terminal.
Optionally, the notifying module 420 is configured to:
determining accounts to be notified according to the sequence of the accounts in the notification account queue when a preset notification period is reached;
if the account to be notified meets any notification condition, sending an information pulling notification to a terminal logged in by the account to be notified, wherein the notification condition comprises:
After sending an information pulling notification to the terminal logged in by the account to be notified last time, receiving an information pulling request sent by the terminal logged in by the account to be notified;
after the account to be notified is added into the target live broadcast room, an information pulling notification is not sent to a terminal logged in by the account to be notified;
and the time difference between the time of sending the information pulling notification to the terminal logged in by the account to be notified last time and the current time is larger than a preset threshold value.
Optionally, the notification condition further includes: the account to be notified is in an offline state.
Optionally, the apparatus further includes a state management module, configured to:
when the heartbeat message of a first account is not received according to a preset heartbeat cycle, recording that the first account enters an offline state;
when the first account is in an offline state, if an information pulling notice sent by a terminal logged in by the first account is received, recording that the first account enters an online state;
and when the time length of the first account in the offline state reaches a preset time length threshold value, or the number of times of continuously sending an information pulling notification to the terminal logged in by the first account after the first account enters the offline state reaches a preset number threshold value, and an information pulling request sent by the terminal logged in by the first account is not received, removing the first account from the target live broadcast room.
Optionally, the adding module 410 is configured to: adding accounts which are not in the notification account queue in the target live broadcast room to the tail of the notification account queue when a communication message is received;
the notification module 420 is configured to: determining the account at the head of the notification account queue as an account to be notified each time a preset notification period is reached;
the notification module 420 is further configured to: and after each account to be notified is determined, removing the account to be notified from the notification account queue.
Optionally, the apparatus further includes an adjusting module, configured to:
when the occupancy rate of the processor or the occupancy rate of the memory is detected to be greater than a first preset threshold value, increasing the notification period from a first period value to a second period value;
and when the occupancy rate of the processor and the occupancy rate of the memory are both smaller than a second preset threshold value, reducing the notification period from the second period value to the first period value, wherein the second preset threshold value is smaller than the first preset threshold value.
Optionally, the adding module 410 is configured to:
and respectively adding each account in the target live broadcast room into a corresponding notification account queue according to a pre-stored corresponding relation between the account in the target live broadcast room and the notification account queue.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
In the embodiment of the invention, each account in the target live broadcast room is added into the notification account queue, the information pulling notification is sent to the terminals logged by the accounts in the notification account queue one by one according to the preset notification period and the sequence of the accounts in the notification account queue, and when an information pulling request which is sent by a first terminal and carries a time stamp is received, the communication information of which the release time is after the time stamp in the target live broadcast room is obtained and sent to the first terminal. Therefore, the server carries out queue type notification, the terminal can pull a plurality of pieces of communication information at one time, and based on the setting of the notification period, the sending quantity of the information pulling notification and the receiving quantity of the information pulling request can be greatly reduced, so that the occupation of processing resources and transmission resources of the server can be reduced.
It should be noted that: in the device for sending communication information according to the above embodiment, when sending communication information, only the division of the above functional modules is taken as an example, and in practical applications, the above function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the above described functions. In addition, the apparatus for sending communication information and the method for sending communication information provided by the above embodiments belong to the same concept, and specific implementation processes thereof are detailed in the method embodiments and are not described herein again.
Fig. 5 is a schematic structural diagram of a server according to an embodiment of the present invention. The server 1900 may vary widely by configuration or performance and may include one or more Central Processing Units (CPUs) 1922 (e.g., one or more processors) and memory 1932, one or more storage media 1930 (e.g., one or more mass storage devices) storing applications 1942 or data 1944. Memory 1932 and storage medium 1930 can be, among other things, transient or persistent storage. The program stored in the storage medium 1930 may include one or more modules (not shown), each of which may include a series of instructions operating on a server. Still further, a central processor 1922 may be provided in communication with the storage medium 1930 to execute a series of instruction operations in the storage medium 1930 on the server 1900.
The server 1900 may also include one or more power supplies 1926, one or more wired or wireless network interfaces 1950, one or more input-output interfaces 1958, one or more keyboards 1956, and/or one or more operating systems 1941, such as Windows Server, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
Server 1900 may include memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors include instructions for:
adding each account in the target live broadcast room into a notification account queue;
according to a preset notification period and the sequencing of the accounts in the notification account queue, sending information pull notifications to the terminals logged in by the accounts in the notification account queue one by one;
and when an information pulling request with a time stamp sent by a first terminal is received, acquiring the communication information of which the release time is after the time stamp in the target live broadcast room, and sending the communication information to the first terminal.
Optionally, the sending, according to a preset notification period and the ranking of the accounts in the notification account queue, information pull notifications one by one to the terminal where the accounts in the notification account queue log in includes:
determining accounts to be notified according to the sequence of the accounts in the notification account queue when a preset notification period is reached;
If the account to be notified meets any notification condition, sending an information pulling notification to a terminal logged in by the account to be notified, wherein the notification condition comprises:
after sending an information pulling notification to the terminal logged in by the account to be notified last time, receiving an information pulling request sent by the terminal logged in by the account to be notified;
after the account to be notified is added into the target live broadcast room, an information pulling notification is not sent to a terminal logged in by the account to be notified;
and the time difference between the time of sending the information pulling notification to the terminal logged in by the account to be notified last time and the current time is larger than a preset threshold value.
Thus, the utilization rate of system transmission resources can be improved.
Optionally, the notification condition further includes: the account to be notified is in an offline state.
Optionally, the method further includes:
when the heartbeat message of a first account is not received according to a preset heartbeat cycle, recording that the first account enters an offline state;
when the first account is in an offline state, if an information pulling notice sent by a terminal logged in by the first account is received, recording that the first account enters an online state;
And when the time length of the first account in the offline state reaches a preset time length threshold value, or the number of times of continuously sending an information pulling notification to the terminal logged in by the first account after the first account enters the offline state reaches a preset number threshold value, and an information pulling request sent by the terminal logged in by the first account is not received, removing the first account from the target live broadcast room.
Therefore, the account of the on-hook can be kicked out of the live broadcast room, and the load pressure of the server is reduced.
Optionally, the adding each account in the target live broadcast room to the notification account queue includes: adding accounts which are not in the notification account queue in the target live broadcast room to the tail of the notification account queue when a communication message is received;
when the preset notification period is reached, determining the accounts to be notified according to the sequence of the accounts in the notification account queue, including: determining the account at the head of the notification account queue as an account to be notified each time a preset notification period is reached;
the method further comprises the following steps: and after each account to be notified is determined, removing the account to be notified from the notification account queue.
Therefore, system resources occupied by the server for sending the information pulling notification can be reduced.
Optionally, the method further includes:
when the occupancy rate of the processor or the occupancy rate of the memory is detected to be greater than a first preset threshold value, increasing the notification period from a first period value to a second period value;
and when the occupancy rate of the processor and the occupancy rate of the memory are both smaller than a second preset threshold value, reducing the notification period from the second period value to the first period value, wherein the second preset threshold value is smaller than the first preset threshold value.
In this way, the load condition of the server can be adjusted in real time.
Optionally, the adding each account in the target live broadcast room to the notification account queue includes:
and respectively adding each account in the target live broadcast room into a corresponding notification account queue according to a pre-stored corresponding relation between the account in the target live broadcast room and the notification account queue.
In this way, different accounts may be assigned to corresponding notification account queues.
In the embodiment of the invention, each account in the target live broadcast room is added into the notification account queue, the information pulling notification is sent to the terminals logged by the accounts in the notification account queue one by one according to the preset notification period and the sequence of the accounts in the notification account queue, and when an information pulling request which is sent by a first terminal and carries a time stamp is received, the communication information of which the release time is after the time stamp in the target live broadcast room is obtained and sent to the first terminal. Thus, the sending quantity of the information pulling notice and the receiving quantity of the information pulling request can be greatly reduced, and the occupation of the processing resource and the transmission resource of the server can be reduced.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (9)

1. A method for transmitting communication information, comprising:
when newly issued communication information exists in a target live broadcast room, adding all accounts except the account issuing the communication information in the target live broadcast room into a notification account queue;
determining accounts to be notified according to the sequence of the accounts in the notification account queue when a preset notification period is reached;
if the account to be notified meets any notification condition, sending an information pulling notification to a terminal logged in by the account to be notified, wherein the notification condition comprises: after sending an information pulling notification to the terminal logged in by the account to be notified last time, receiving an information pulling request sent by the terminal logged in by the account to be notified; or, the time difference between the time of sending the information pulling notification to the terminal logged in by the account to be notified last time and the current time is greater than a preset threshold; or, the account to be notified is in an offline state;
When an information pulling request with a time stamp sent by a first terminal is received, the information pulling request is triggered by the first terminal based on the received information pulling notification, communication information with the release time after the time stamp in the target live broadcasting room is obtained and sent to the first terminal, and the time stamp is the release time of the latest communication information received by the first terminal before the information pulling request is sent.
2. The method of claim 1, further comprising:
when the heartbeat message of a first account is not received according to a preset heartbeat cycle, recording that the first account enters an offline state;
when the first account is in an offline state, if an information pulling notice sent by a terminal logged in by the first account is received, recording that the first account enters an online state;
and when the time length of the first account in the offline state reaches a preset time length threshold value, or the number of times of continuously sending an information pulling notification to the terminal logged in by the first account after the first account enters the offline state reaches a preset number threshold value, and an information pulling request sent by the terminal logged in by the first account is not received, removing the first account from the target live broadcast room.
3. The method of claim 1, wherein adding each account in the target live broadcast room to a notification account queue comprises: adding accounts which are not in the notification account queue in the target live broadcast room to the tail of the notification account queue when a communication message is received;
when the preset notification period is reached, determining the accounts to be notified according to the sequence of the accounts in the notification account queue, including: determining the account at the head of the notification account queue as an account to be notified each time a preset notification period is reached;
the method further comprises the following steps: and after each account to be notified is determined, removing the account to be notified from the notification account queue.
4. The method according to any one of claims 1-3, further comprising:
when the occupancy rate of the processor or the occupancy rate of the memory is detected to be greater than a first preset threshold value, increasing the notification period from a first period value to a second period value;
and when the occupancy rate of the processor and the occupancy rate of the memory are both smaller than a second preset threshold value, reducing the notification period from the second period value to the first period value, wherein the second preset threshold value is smaller than the first preset threshold value.
5. The method of any of claims 1-3, wherein adding each account in the target live broadcast room to a notification account queue comprises:
and respectively adding each account in the target live broadcast room into a corresponding notification account queue according to a pre-stored corresponding relation between the account in the target live broadcast room and the notification account queue.
6. An apparatus for transmitting communication information, comprising:
the adding module is used for adding all accounts except the account for publishing the communication information in the target live broadcast room into a notification account queue when newly published communication information exists in the target live broadcast room;
the notification module is used for determining accounts to be notified according to the sequencing of the accounts in the notification account queue when a preset notification period is reached; if the account to be notified meets any notification condition, sending an information pulling notification to a terminal logged in by the account to be notified, wherein the notification condition comprises: after sending an information pulling notification to the terminal logged in by the account to be notified last time, receiving an information pulling request sent by the terminal logged in by the account to be notified; or, the time difference between the time of sending the information pulling notification to the terminal logged in by the account to be notified last time and the current time is greater than a preset threshold; or, the account to be notified is in an offline state;
The sending module is used for obtaining the communication information of which the release time is after the time stamp in the target live broadcasting room and sending the communication information to the first terminal when receiving an information pulling request which is sent by the first terminal and carries the time stamp, wherein the information pulling request is triggered by the first terminal based on the received information pulling notification, and the time stamp is the release time of the latest communication information received by the first terminal before the information pulling request is sent.
7. The device according to claim 6, further comprising a state management module, configured to record that the first account enters an offline state when a heartbeat message of the first account is not received according to a preset heartbeat cycle; when the first account is in an offline state, if an information pulling notice sent by a terminal logged in by the first account is received, recording that the first account enters an online state; and when the time length of the first account in the offline state reaches a preset time length threshold value, or the number of times of continuously sending an information pulling notification to the terminal logged in by the first account after the first account enters the offline state reaches a preset number threshold value, and an information pulling request sent by the terminal logged in by the first account is not received, removing the first account from the target live broadcast room.
8. A server, comprising one or more processors and one or more memories having stored therein at least one instruction, the at least one instruction being loaded and executed by the one or more processors to perform operations performed by a method of sending a communication according to any one of claims 1 to 5.
9. A non-transitory computer-readable storage medium having stored therein at least one instruction, which is loaded and executed by a processor to perform operations performed by a method of sending a communication according to any one of claims 1 to 5.
CN201611218239.1A 2016-12-26 2016-12-26 Method and device for sending communication information Active CN108243155B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611218239.1A CN108243155B (en) 2016-12-26 2016-12-26 Method and device for sending communication information

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611218239.1A CN108243155B (en) 2016-12-26 2016-12-26 Method and device for sending communication information

Publications (2)

Publication Number Publication Date
CN108243155A CN108243155A (en) 2018-07-03
CN108243155B true CN108243155B (en) 2021-09-28

Family

ID=62701420

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611218239.1A Active CN108243155B (en) 2016-12-26 2016-12-26 Method and device for sending communication information

Country Status (1)

Country Link
CN (1) CN108243155B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110351572B (en) * 2019-07-10 2022-05-20 广州虎牙科技有限公司 Method, device and equipment for updating live broadcast room information and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101572725A (en) * 2009-05-11 2009-11-04 卓望数码技术(深圳)有限公司 Method for pushing data to mobile terminal, system and mobile terminal
CN103516585A (en) * 2012-06-29 2014-01-15 北京奇虎科技有限公司 Method and system for distributing messages according to priorities
CN104301203A (en) * 2014-09-10 2015-01-21 腾讯科技(深圳)有限公司 Message pushing method and equipment
CN105323205A (en) * 2014-05-30 2016-02-10 中兴通讯股份有限公司 Message pushing processing method, message pushing processing device, pushing server and application server

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8621026B2 (en) * 2011-09-11 2013-12-31 Microsoft Corporation Batching notifications to optimize for battery life

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101572725A (en) * 2009-05-11 2009-11-04 卓望数码技术(深圳)有限公司 Method for pushing data to mobile terminal, system and mobile terminal
CN103516585A (en) * 2012-06-29 2014-01-15 北京奇虎科技有限公司 Method and system for distributing messages according to priorities
CN105323205A (en) * 2014-05-30 2016-02-10 中兴通讯股份有限公司 Message pushing processing method, message pushing processing device, pushing server and application server
CN104301203A (en) * 2014-09-10 2015-01-21 腾讯科技(深圳)有限公司 Message pushing method and equipment

Also Published As

Publication number Publication date
CN108243155A (en) 2018-07-03

Similar Documents

Publication Publication Date Title
CN107689988B (en) Message pushing method and device, electronic equipment and terminal equipment
CN108418743B (en) Chat room message distribution method and device and electronic equipment
WO2021237433A1 (en) Message pushing method and apparatus, and electronic device and computer-readable medium
CN107872396B (en) Communication method with timeout control, processing device, terminal device and server
CN110324680B (en) Video pushing method and device, server, client and storage medium
CN110808922A (en) Message processing method and device, storage medium and electronic equipment
CN111541762B (en) Data processing method, management server, device and storage medium
CN104980472A (en) Network traffic control method and device
CN108650667A (en) Terminal scheduling method and apparatus
WO2017185615A1 (en) Method for determining service status of service processing device and scheduling device
CN111541555A (en) Group chat optimization method and related product
CN114928758A (en) Live broadcast abnormity detection processing method and device
CN113064740A (en) Message processing method and device
CN113747186A (en) Data processing method, device, terminal and storage medium
CN111177513B (en) Determination method and device of abnormal access address, electronic equipment and storage medium
CN108243155B (en) Method and device for sending communication information
CN116320011A (en) Request processing method and device
CN111538572A (en) Task processing method, device, scheduling server and medium
CN114006946A (en) Method, device and equipment for processing homogeneous resource request and storage medium
CN108429703B (en) DHCP client-side online method and device
CN110839061B (en) Data distribution method, device and storage medium
CN109905459B (en) Data transmission method and device
CN110597631A (en) Resource management method, monitoring server, proxy server, and storage medium
CN111111216A (en) Matching method, device, server and storage medium
CN114827281B (en) Method, system and device for sending and receiving network request

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant