Communication information sending method and device

A technology for communicating information and sending information, which is applied in the computer field and can solve problems such as frequent speeches by users and large occupation of processing resources and transmission resources of the server, and achieve the effect of reducing the occupation of processing resources and transmission resources and reducing the amount of transmission

Active Publication Date: 2018-07-03
北京云中融信网络科技有限公司
5 Cites 2 Cited by

AI-Extracted Technical Summary

Problems solved by technology

[0005] Generally, the number of users in the live broadcast room is relatively large, and users speak frequently. Therefore, ...
View more

Method used

[0143] Like this, the account that hangs up can be kicked out of the live broadcast room, reducing the load pressure on the server.
[0155] In the embodiment of the present invention, each account in the target live broadcast room is added to the notification account queue, and according to the preset notification cycle and the ordering of accounts in the notification account queue, the accounts logged in to the notification account queue The terminal sends information pull notificatio...
View more

Abstract

The invention discloses a communication information sending method and device and belongs to the technical field of a computer. The method comprises the following steps: adding all accounts in a target direct broadcasting room to a notification account queue; according to a preset notification period and order of the accounts in the notification account queue, sending an information pull notification to terminals logged on by the accounts in the notification account queue one by one; and when receiving an information pull request carrying a time stamp and sent by a first terminal, obtaining communication information, the release time of which is after the time stamp, in the target direct broadcasting room, and sending the communication information to the first terminal. The communication information sending method and device can reduce occupation of processing resources and transmission resources of a server.

Application Domain

Data switching networks

Technology Topic

Release timeReal-time computing +2

Image

  • Communication information sending method and device
  • Communication information sending method and device
  • Communication information sending method and device

Examples

  • Experimental program(1)

Example Embodiment

[0066] In order to make the objectives, technical solutions, and advantages of the present invention clearer, the embodiments of the present invention will be described in further detail below in conjunction with the accompanying drawings.
[0067] The embodiment of the present invention provides a method for sending communication information, and the method can be implemented by a server. Among them, the server may be a background server of a webcast website or a webcast application, and the server may maintain the operation of a large number of live broadcast rooms. During the operation process, the server will receive a large amount of communication information (ie chat information) released by the account in each live broadcast room. At the same time, based on the notification mechanism provided in the embodiment of the present invention, the server notifies the account in each live broadcast room to pull communication information from the server. The corresponding system frame diagram can be as figure 1 Shown.
[0068] The server may include components such as a processor, a memory, and a transceiver. The processor, which can be a CPU (Central Processing Unit, central processing unit), etc., can be used to add each account in the target live broadcast room to the notification account queue, and each time the preset notification period is reached, according to the notification account queue The order of the accounts determines the account to be notified, and if the account to be notified meets certain conditions, a notification of information pull is sent to the account to be notified, and so on. The memory can be RAM (Random Access Memory, Random Access Memory), Flash (flash memory), etc., which can be used to store received data, data required for processing, data generated during processing, etc., such as notification cycle, Notify account queue, communication information, etc. The transceiver can be used for data transmission with the terminal or other servers (such as 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. The transceiver may include an antenna , Matching circuit, modem, etc.
[0069] Such as figure 2 As shown, the processing flow of the method may include the following steps:
[0070] Step 201: Add each account in the target live broadcast room to the notification account queue.
[0071] Among them, the notification account queue is a queue established by the server for the accounts in the live broadcast room to queue up and send information pull notifications. The server may establish a 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 in each live broadcast room may be the same as the number of CPUs of the server.
[0072] In implementation, the server can maintain the notification account queue in various ways. For example, the server can add the account that joins the target live broadcast room to the notification account queue, and always keep the account in the notification account queue until the account leaves the live broadcast room, or it can also add the account only when there is newly released communication information. The account is added to the notification account queue. When adding an account to the notification account queue, the order of joining can be set arbitrarily according to requirements, for example, it can be based on the order in which the account is added to the live broadcast room, or in a random order.
[0073] Optionally, for the situation where there are multiple notification account queues in each live room, the notification account queue can be allocated to each account in the live room based on the principle of load balancing. The corresponding processing can be as follows: According to the pre-stored target live room The corresponding relationship between the account and the notification account queue in, add each account in the target live broadcast room to the corresponding notification account queue.
[0074] In implementation, after the target live room starts broadcasting, the server may establish multiple notification account queues for the target live room, and the number of notification account queues may be the same as the number of CPUs. At the same time, the server can assign a number to each notification account queue, and the number can be a non-negative integer starting from 0. Whenever an account is added to the target live broadcast room, the server can allocate the corresponding notification account queue for the account according to the preset load balancing processing method, store the account ID and the notification account queue number corresponding to the account, and establish the account and the notification account The corresponding relationship of the queues is shown in Table 1 below. Load balancing processing methods can be varied, for example, polling can be used, or the hash value of the account's identity can be calculated, the hash value can be taken as an absolute value, and then divided by the number of notification account queues, and the remainder can be taken. Furthermore, the notification account queue numbered as the remainder can be allocated to the account.
[0075] Table 1
[0076] Notification account queue
[0077] Step 202: According to the preset notification period and the sorting of the accounts in the notification account queue, the information pull notification is sent to the terminals logged in to the accounts in the notification account queue one by one.
[0078] In the implementation, the technician can set a notification period in advance. The notification period is the time interval between sending the information pull notification twice. The notification period can be set based on the processing capability of the server, and the server with stronger processing capability can be set For a shorter notification period, servers with weaker processing capabilities can set a longer notification period. The server may send an information pull notification to an account according to the order of the accounts in the notification account queue, and every other notification period, the information pull notification may be sent to the terminal where the account is logged in. If there are multiple notification account queues in the target live broadcast room, this process can be performed separately for each notification account queue.
[0079] Optionally, the information pull notification can be sent to the account only when certain conditions are met. Correspondingly, the processing of step 202 can be as follows: Whenever the preset notification period is reached, according to the status of the account in the notification account queue Sort to determine the account to be notified; if the account to be notified meets any notification condition, the information pull notification is sent to the terminal where the account to be notified is logged in.
[0080] Among them, the information pull notification is used to trigger the terminal to send an information pull request to the server after receiving the information pull notification. The information pull request is used to trigger the server to send corresponding communication information to the terminal after receiving the information pull request.
[0081] In the implementation, such as Figure 3a As shown, whenever the preset notification period is reached, the account at the head of the notification account queue can be determined as the account to be notified. Furthermore, it can be determined whether the account meets the notification conditions. If any of the notification conditions is met, an information pull notification can be sent to the terminal where the account is logged in. If all notification conditions are not met, the account is not sent to the terminal where the account is logged in. Information pull notification.
[0082] In addition, such as Figure 3a As shown, 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, after sending the information pull notification or determining not to send the information pull notification, the account to be notified may be removed from the notification account queue. After removal, in the notification account queue, the account behind the account will become the account at the head of the queue.
[0083] In addition, for the above processing situation, the processing of step 201 may be: whenever a communication message is received, the accounts in the target live room that are not in the notification account queue are added to the end of the notification account queue, such as Figure 3b Shown. In the actual operation process, after the server receives the first communication message, it adds all accounts to the notification account queue. In the process of notifying the accounts one by one, it may receive the second communication message. It is possible that some accounts have been notified and removed from the notification account queue, while some accounts have not yet been notified and are still waiting in the notification account queue. At this time, the server has received the second communication message, so Accounts that are not in the notification account queue will be added to the notification account queue again and placed at the end of the queue. In this way, you can prevent these accounts from missing the second piece of communication information.
[0084] In this embodiment, the aforementioned notification conditions may include:
[0085] Condition 1: After sending an information pull notification to the terminal logged in to the account to be notified last time, the information pull request sent from the terminal logged in to the account to be notified is received.
[0086] Condition 2: After the account to be notified joins the target live broadcast room, no information pull notification is sent to the terminal logged in to the account to be notified.
[0087] Condition 3: The time difference between the last time the information pull notification is sent to the terminal logged in to the account to be notified and the current time is greater than a preset threshold (for example, 1 second).
[0088] In implementation, the account to be notified satisfies condition 1, which means that after the server sent the information pull notification to the account last time, it received the information pull request replies from the account. Conversely, if the account did not reply to the server for the information pull request last time, and the account does not meet other notification conditions, the server will not send an information pull notification to the account this time. The account to be notified meets the second condition, which means that the account is a newly added account in the target live broadcast room. The account to be notified meets condition three, which means that although the account did not reply after the last time the server sent the information pull notification to the account, it has been a period of time since the information pull notification, so you can consider sending it again Information pull notification to prevent the account from not being notified.
[0089] Optionally, the notification condition also includes: condition four, the account to be notified is offline.
[0090] In implementation, based on condition four, you can continue to send information pull notifications to offline accounts to determine whether they remain offline for a long time.
[0091] Optionally, the following methods can be used to determine that the account has entered the offline state, and the account that has been kept offline for a long time is removed from the live broadcast room. The corresponding processing can be as follows: When the heartbeat message of the first account is not received according to the preset heartbeat cycle , Record that the first account enters the offline state; when the first account is offline, if it receives the information pull notification sent by the terminal logged in to the first account, record the first account enters the online state; when the first account is offline When the duration of the first account reaches the preset duration threshold, or the number of times of continuously sending information pull notifications to the terminal logged in to the first account after the first account enters the offline state reaches the preset threshold, and the terminal logged in to the first account is not received When sending the information pull request, remove the first account from the target live broadcast room.
[0092] In the implementation, after the terminal logs into the webcast application or webcast website, it will send a heartbeat message to the server according to the preset heartbeat cycle. The server will detect whether the account's heartbeat is received according to the heartbeat cycle for each logged-in account Message, if a heartbeat message is received, the record account enters the offline state, and if a heartbeat message is received, it is determined that the account is still online. For offline accounts, based on the above condition 4, the server will normally send information pull notifications to it. If the number of continuous information pull notifications reaches the preset threshold, or the duration of continuous information pull notifications reaches the preset duration Threshold value, and no corresponding response is received, it is determined that the account remains offline for a long time, and the account is removed from the target live broadcast room. If during this process, the server receives the information pull notification sent by the terminal to which the account is logged in, it records that the account is online.
[0093] Step 203: When receiving the information pull request carrying the time stamp sent by the first terminal, obtain the communication information in the target live broadcast room whose publishing time is after the time stamp, and send it to the first terminal.
[0094] The time stamp is the release time of the latest communication information received by the terminal before sending the information pull request.
[0095] In implementation, after receiving the information pull notification, the terminal can view the release time of the latest communication information of the target live broadcast room received locally, add the release time as a timestamp to the information pull request, and send it to the server . After the server receives the information pull request sent by the terminal, it can obtain the timestamp therein, find the communication information with the publication time after the timestamp among all the communication information in the target live broadcast room, and send it to the terminal.
[0096] Optionally, the server may adjust the above notification period based on the load situation, and the corresponding processing may be as follows: When it is detected that the occupancy rate of the processor or the occupancy rate of the memory is greater than the first preset threshold, the notification period is changed from the first The period value is increased to the second period value; when it is detected that the occupancy rate of the processor and the occupancy rate of the memory are both less than the second preset threshold, the notification period is reduced from the second period value to the first period value, where The second preset threshold is less than the first preset threshold.
[0097] In implementation, both the first period value and the second period value may be originally set by a technician. In the initial state, the server can use the shorter first period value as the notification period. When either the processor or the memory is overloaded, the server can set the notification period to a longer second period value. In this way, the pressure on the processor and memory can be relieved. Then, when the server is running based on a longer notification period, when the processor and memory loads are relatively low, the notification period can be set to a shorter first period value. In this way, the sending frequency of the information pull notification can be increased, and the terminal can prevent the communication information from being missed.
[0098] In the embodiment of the present invention, each account in the target live broadcast room is added to the notification account queue, and according to the preset notification cycle and the order of the accounts in the notification account queue, the terminals logged in to the accounts in the notification account queue are sent one by one. Sending an information pull notification, when receiving an information pull request carrying a timestamp sent by the first terminal, obtain the communication information published in the target live broadcast room after the timestamp, and send it to the first terminal. In this way, the server performs queue notification, and the terminal can pull multiple pieces of communication information at a time. Based on the setting of the notification period, the amount of information pull notifications sent and the amount of information pull requests received can be greatly reduced, thereby reducing the number of requests to the server. The occupation of processing resources and transmission resources.
[0099] Based on the same technical concept, an embodiment of the present invention also provides a device for sending communication information. The device may be the server in the above-mentioned embodiment and used to execute the method for sending communication information in the above-mentioned embodiment, such as Figure 4 As shown, the device includes:
[0100] The adding module 410 is used to add each account in the target live broadcast room to the notification account queue;
[0101] The notification module 420 is configured to send information pull notifications one by one to the terminals logged in to the accounts in the notification account queue according to the preset notification period and the order of the accounts in the notification account queue;
[0102] The sending module 430 is configured to, when receiving an information pull request carrying a timestamp sent by the first terminal, obtain the communication information in the target live broadcast room whose publishing time is after the timestamp, and send it to the first terminal. terminal.
[0103] Optionally, the notification module 420 is configured to:
[0104] Whenever the preset notification period is reached, the account to be notified is determined according to the order of the accounts in the notification account queue;
[0105] If the account to be notified satisfies any notification condition, an information pull notification is sent to the terminal to which the account to be notified is logged in, where the notification condition includes:
[0106] After sending an information pull notification to the terminal logged in to the account to be notified last time, receiving an information pull request sent by the terminal logged in to the account to be notified;
[0107] After the account to be notified joins the target live broadcast room, no information pull notification is sent to the terminal logged in to the account to be notified;
[0108] The time difference between the last time the information pull notification is sent to the terminal logged in to the account to be notified and the current time is greater than a preset threshold.
[0109] Optionally, the notification condition further includes: the account to be notified is offline.
[0110] Optionally, the device further includes a state management module for:
[0111] When the heartbeat message of the first account is not received according to the preset heartbeat period, record that the first account enters an offline state;
[0112] When the first account is in an offline state, if receiving an information pull notification sent by the terminal logged in by the first account, record that the first account enters the online state;
[0113] When the length of time the first account is offline reaches a preset time threshold, or the number of times that the first account is offline after the first account enters the offline state continuously sends information pull notifications to the terminal logged in to the first account reaches the preset number of times Threshold value, and when the information pull request sent by the terminal logged in by the first account is not received, the first account is removed from the target live broadcast room.
[0114] Optionally, the adding module 410 is configured to add accounts that are not in the notification account queue in the target live broadcast room to the end of the notification account queue whenever a piece of communication information is received;
[0115] The notification module 420 is configured to determine the account at the head of the notification account queue as the account to be notified whenever a preset notification period is reached;
[0116] The notification module 420 is further configured to: after each account to be notified is determined, remove the account to be notified from the notification account queue.
[0117] Optionally, the device further includes an adjustment module for:
[0118] When it is detected that the occupancy rate of the processor or the occupancy rate of the memory is greater than the first preset threshold, increasing the notification period from the first period value to the second period value;
[0119] When it is detected that the occupancy rate of the processor and the occupancy rate of the memory are both less than the second preset threshold, the notification period is reduced from the second period value to the first period value, where the second period value is The preset threshold is less than the first preset threshold.
[0120] Optionally, the adding module 410 is configured to:
[0121] According to the pre-stored corresponding relationship between the account in the target live broadcast room and the notification account queue, each account in the target live broadcast room is added to the corresponding notification account queue.
[0122] Regarding the device in the foregoing embodiment, the specific manner in which each module performs operation has been described in detail in the embodiment of the method, and detailed description will not be given here.
[0123] In the embodiment of the present invention, each account in the target live broadcast room is added to the notification account queue, and according to the preset notification cycle and the order of the accounts in the notification account queue, the terminals logged in to the accounts in the notification account queue are sent one by one. Sending an information pull notification, when receiving an information pull request carrying a timestamp sent by the first terminal, obtain the communication information published in the target live broadcast room after the timestamp, and send it to the first terminal. In this way, the server performs queue notification, and the terminal can pull multiple pieces of communication information at a time. Based on the setting of the notification period, the amount of information pull notifications sent and the amount of information pull requests received can be greatly reduced, thereby reducing the number of requests to the server. The occupation of processing resources and transmission resources.
[0124] It should be noted that when the device for sending communication information provided in the above embodiment sends communication information, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be allocated to different functional modules according to needs. Complete, that is, divide the internal structure of the device into different functional modules to complete all or part of the functions described above. In addition, the device for sending communication information provided in the above-mentioned embodiment and the embodiment of the method for sending communication information belong to the same concept. For the specific implementation process, please refer to the method embodiment, which will not be repeated here.
[0125] Figure 5 It is a schematic structural diagram of a server provided by an embodiment of the present invention. The server 1900 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 1922 (for example, one or more processors) and a memory 1932, one or more A storage medium 1930 (for example, one or a storage device with a large amount of storage) for storing application programs 1942 or data 1944. Among them, the memory 1932 and the storage medium 1930 may be short-term storage or persistent storage. The program stored in the storage medium 1930 may include one or more modules (not shown in the figure), and each module may include a series of command operations on the server. Furthermore, the central processing unit 1922 may be configured to communicate with the storage medium 1930, and execute a series of instruction operations in the storage medium 1930 on the server 1900.
[0126] 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 and output interfaces 1958, one or more keyboards 1956, and/or, one or more operating systems 1941 , Such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM and so on.
[0127] The server 1900 may include a memory and one or more programs, where one or more programs are stored in the memory and configured to be executed by one or more processors, including the following: Operation instructions:
[0128] Add each account in the target live broadcast room to the notification account queue;
[0129] According to the preset notification cycle and the order of the accounts in the notification account queue, sending information pull notifications to the terminals logged in to the accounts in the notification account queue one by one;
[0130] When receiving the information pull request carrying the timestamp sent by the first terminal, obtain the communication information in the target live broadcast room whose publishing time is after the timestamp, and send it to the first terminal.
[0131] Optionally, according to a preset notification period and the ordering of accounts in the notification account queue, sending information pull notifications to terminals logged in to accounts in the notification account queue one by one includes:
[0132] Whenever the preset notification period is reached, the account to be notified is determined according to the order of the accounts in the notification account queue;
[0133] If the account to be notified satisfies any notification condition, an information pull notification is sent to the terminal to which the account to be notified is logged in, where the notification condition includes:
[0134] After sending an information pull notification to the terminal logged in to the account to be notified last time, receiving an information pull request sent by the terminal logged in to the account to be notified;
[0135] After the account to be notified joins the target live broadcast room, no information pull notification is sent to the terminal logged in to the account to be notified;
[0136] The time difference between the last time the information pull notification is sent to the terminal logged in to the account to be notified and the current time is greater than a preset threshold.
[0137] In this way, the utilization of system transmission resources can be improved.
[0138] Optionally, the notification condition further includes: the account to be notified is offline.
[0139] Optionally, the method further includes:
[0140] When the heartbeat message of the first account is not received according to the preset heartbeat period, record that the first account enters an offline state;
[0141] When the first account is in an offline state, if receiving an information pull notification sent by the terminal logged in by the first account, record that the first account enters the online state;
[0142] When the length of time the first account is offline reaches a preset time threshold, or the number of times that the first account is offline after the first account enters the offline state continuously sends information pull notifications to the terminal logged in to the first account reaches the preset number of times Threshold value, and when the information pull request sent by the terminal logged in by the first account is not received, the first account is removed from the target live broadcast room.
[0143] In this way, accounts that are hanging up can be kicked out of the live broadcast room, reducing the load pressure on the server.
[0144] Optionally, the adding each account in the target live room to the notification account queue includes: each time a communication message is received, adding accounts in the target live room that are not in the notification account queue to the Notify the end of the account queue;
[0145] Whenever the preset notification period is reached, determining the account to be notified according to the order of the accounts in the notification account queue includes: each time the preset notification period is reached, the first part of the notification account queue Account, determined as the account to be notified;
[0146] The method further includes: after each account to be notified is determined, removing the account to be notified from the notification account queue.
[0147] In this way, the system resources occupied by the server for sending information pull notifications can be reduced.
[0148] Optionally, the method further includes:
[0149] When it is detected that the occupancy rate of the processor or the occupancy rate of the memory is greater than the first preset threshold, increasing the notification period from the first period value to the second period value;
[0150] When it is detected that the occupancy rate of the processor and the occupancy rate of the memory are both less than the second preset threshold, the notification period is reduced from the second period value to the first period value, where the second period value is The preset threshold is less than the first preset threshold.
[0151] In this way, the load situation of the server can be adjusted in real time.
[0152] Optionally, adding each account in the target live broadcast room to the notification account queue includes:
[0153] According to the pre-stored corresponding relationship between the account in the target live broadcast room and the notification account queue, each account in the target live broadcast room is added to the corresponding notification account queue.
[0154] In this way, different accounts can be assigned to corresponding notification account queues.
[0155] In the embodiment of the present invention, each account in the target live broadcast room is added to the notification account queue, and according to the preset notification cycle and the order of the accounts in the notification account queue, the terminals logged in to the accounts in the notification account queue are sent one by one. Sending an information pull notification, when receiving an information pull request carrying a timestamp sent by the first terminal, obtain the communication information published in the target live broadcast room after the timestamp, and send it to the first terminal. In this way, the sending volume of information pull notifications and the receiving volume of information pull requests can be greatly reduced, thereby reducing the occupation of processing resources and transmission resources of the server.
[0156] Those of ordinary skill in the art can understand that all or part of the steps in the foregoing embodiments can be implemented by hardware, or by a program instructing related hardware to be completed. The program can be stored in a computer-readable storage medium. The storage medium mentioned can be a read-only memory, a magnetic disk or an optical disk, etc.
[0157] The above descriptions are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection of the present invention. Within range.

PUM

no PUM

Description & Claims & Application Information

We can also present the details of the Description, Claims and Application information to help users get a comprehensive understanding of the technical details of the patent, such as background art, summary of invention, brief description of drawings, description of embodiments, and other original content. On the other hand, users can also determine the specific scope of protection of the technology through the list of claims; as well as understand the changes in the life cycle of the technology with the presentation of the patent timeline. Login to view more.

Similar technology patents

Serial port DLT645 batch setting method based on intelligent electric meter

PendingCN112114846Asend lessreduce complexity
Owner:上海汉枫电子科技有限公司

Method, device and system for combining personal networks (PN)

InactiveCN102546320ASend lessSave transmission resources
Owner:ZTE CORP

Data transmission method and device based on queues and communication system

InactiveCN104052831Asend lessImprove bandwidth utilization
Owner:HUAWEI TECH CO LTD

Medical data transmission method and device

PendingCN110491456Areduce loadSend less
Owner:CENT SOUTH UNIV

Radio link control status report optimized transmission method and system

ActiveCN113473532Areduce overheadSend less
Owner:WUHAN HONGXIN TELECOMM TECH CO LTD

Classification and recommendation of technical efficacy words

  • Send less

Improved directed diffusion routing protocol based on network coding

InactiveCN103078793ASend lessNarrow down the scope of forwarding
Owner:HOHAI UNIV

Method for intelligently acquiring physiological information in body sensor network

InactiveCN102068239ASend lessReduce efficient collection
Owner:ZHEJIANG UNIV

Data transmission method and device based on queues and communication system

InactiveCN104052831Asend lessImprove bandwidth utilization
Owner:HUAWEI TECH CO LTD

Radio link control status report optimized transmission method and system

ActiveCN113473532Areduce overheadSend less
Owner:WUHAN HONGXIN TELECOMM TECH CO LTD

Serial port DLT645 batch setting method based on intelligent electric meter

PendingCN112114846Asend lessreduce complexity
Owner:上海汉枫电子科技有限公司
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products