WO2021082584A1 - 消息交互方法、装置、可读介质及电子设备 - Google Patents

消息交互方法、装置、可读介质及电子设备 Download PDF

Info

Publication number
WO2021082584A1
WO2021082584A1 PCT/CN2020/106907 CN2020106907W WO2021082584A1 WO 2021082584 A1 WO2021082584 A1 WO 2021082584A1 CN 2020106907 W CN2020106907 W CN 2020106907W WO 2021082584 A1 WO2021082584 A1 WO 2021082584A1
Authority
WO
WIPO (PCT)
Prior art keywords
message
identifier
index table
client
live broadcast
Prior art date
Application number
PCT/CN2020/106907
Other languages
English (en)
French (fr)
Inventor
杨武
Original Assignee
北京字节跳动网络技术有限公司
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 北京字节跳动网络技术有限公司 filed Critical 北京字节跳动网络技术有限公司
Publication of WO2021082584A1 publication Critical patent/WO2021082584A1/zh

Links

Images

Classifications

    • 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/04Real-time or near real-time messaging, e.g. instant messaging [IM]
    • H04L51/046Interoperability with other network applications or services
    • 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/04Real-time or near real-time messaging, e.g. instant messaging [IM]
    • H04L51/043Real-time or near real-time messaging, e.g. instant messaging [IM] using or handling presence information
    • 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/07User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail characterised by the inclusion of specific contents
    • H04L51/10Multimedia information
    • 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/21Monitoring or handling of messages
    • H04L51/214Monitoring or handling of messages using selective forwarding
    • 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

Definitions

  • the present disclosure relates to the field of communication technologies, and in particular, to a message interaction method, device, readable medium, and electronic equipment.
  • the present disclosure provides a message interaction method applied to a server.
  • the server stores a plurality of index tables, and each index table reflects the message identifiers of all messages in a live broadcast room and all messages in the live broadcast room.
  • the corresponding relationship between the storage locations of, the method includes:
  • Target index table is an index table corresponding to the live broadcast room identifier
  • the present disclosure provides a message exchange method, which is applied to a client, and the method includes:
  • the present disclosure provides a message interaction device applied to a server.
  • the server stores a plurality of index tables, and each index table reflects the message identifiers of all messages in a live broadcast room and all messages in the live broadcast room.
  • the corresponding relationship of the storage location includes:
  • a reading request receiving module configured to receive a reading request sent by a client, the reading request including a message identifier and a live broadcast room identifier;
  • a target index table obtaining module configured to obtain a target index table according to the live broadcast room identifier, where the target index table is an index table corresponding to the live broadcast room identifier;
  • a message set reading module configured to read a message set according to the message identifier and the target index table
  • the message set sending module is used to send the message set to the client.
  • the present disclosure provides a message interaction device, which is applied to a client, and includes:
  • a read request sending module configured to send a read request to the server, where the read request includes a message identifier and a live broadcast room identifier;
  • the message collection receiving module is configured to receive and display a message collection sent by the server, the message collection being read by the server according to the message identifier and a target index table, and the target index table is related to the live broadcast The corresponding index table is identified between.
  • the present disclosure provides a computer-readable medium on which a computer program is stored, and when the program is executed by a processing device, the steps of the method described in the first aspect and the second aspect are implemented.
  • the present disclosure provides an electronic device applied to a server, including:
  • a storage device on which a computer program is stored
  • the processing device is configured to execute the computer program in the storage device to implement the steps of the method described in the first aspect.
  • the present disclosure provides an electronic device applied to a client, including:
  • a storage device on which a computer program is stored
  • the processing device is configured to execute the computer program in the storage device to implement the steps of the method described in the second aspect.
  • the technical solution provided by the present disclosure adopts a pull model when the client and the server exchange messages. That is, the client actively queries the server and obtains the message by sending a read request including the message identifier and the live broadcast room identifier.
  • this model it can be In the live broadcast scenario where large-scale users are online at the same time, users can obtain the latest news in a timely and without loss, and improve the live interactive experience.
  • Fig. 1 is a flow chart showing a method for message exchange according to an embodiment.
  • Fig. 2 is a schematic diagram of the relationship between a live broadcast room, a circular linked list, and an index table in an embodiment.
  • Fig. 3 is a flow chart showing another message exchange method according to another embodiment.
  • Fig. 4 is a block diagram of a message interaction device according to an embodiment.
  • Fig. 5 is a block diagram showing another message interaction device according to another embodiment.
  • Fig. 6 is a block diagram showing an electronic device according to an embodiment.
  • An embodiment of the present disclosure provides a message interaction method.
  • the message interaction method is applied to a server, and the server stores a plurality of index tables, and each of the index tables reflects the correspondence between the message identifiers of all messages in a live broadcast room and the storage locations of all messages in the live broadcast room.
  • Fig. 1 is a flow chart showing a method for message exchange according to an embodiment of the present disclosure. As shown in Figure 1, the method includes the following steps:
  • Step S11 Receive a read request sent by the client, where the read request includes a message identifier and a live broadcast room identifier.
  • the message identifier is a unique identifier of the message, and the message identifier corresponds to the message one-to-one.
  • the live broadcast room identifier is the unique identifier of the live broadcast room, and the live broadcast room identifier corresponds to the live broadcast room one-to-one.
  • the live broadcast room is the live broadcast room of the live broadcast platform.
  • Step S13 Obtain a target index table according to the live broadcast room identifier, where the target index table is an index table corresponding to the live broadcast room identifier.
  • Each index table is used to find messages in each live broadcast room, and the index table corresponds to the live broadcast room one-to-one. Therefore, the index table has a one-to-one correspondence with the live broadcast room identifier, and the index table corresponding to the live broadcast room identifier can be obtained through the live broadcast room identifier, that is, the target index table can be obtained according to the live broadcast room identifier.
  • Step S15 Read a message set according to the message identifier and the target index table.
  • Step S17 Send the message set to the client.
  • the client and the server adopt the pull model for message interaction, that is, the client actively queries the server and obtains the message by sending a read request including the message identifier and the live broadcast room identifier.
  • this model can meet the needs of large groups.
  • users can obtain the latest news in a timely and without loss, improving the live interactive experience.
  • the message identifier in the read request is the message identifier of the last message in the message set that the client read from the server last time
  • step S15 specifically includes: The target index table obtains the storage location of the message corresponding to the message identifier, reads the messages stored in the storage location within a first preset number after the storage location, to obtain the message set.
  • the method further includes: sending the message identifier of the last message in the read message set to the client, so that the client initiates the next read request according to the message identifier.
  • the message identifier in the read request is the message identifier of the last message in the message set that the client read from the server last time
  • the message identifier in the read request and the target index table A message ID is the same.
  • the target index table reflects the correspondence between the message identifiers of all messages in the live broadcast room accessed by the client and the storage locations of all messages in the live broadcast room, and then the target index table and the message identifiers in the read request can be used. Obtain the storage location of the message corresponding to the message identifier in the read request.
  • the first preset number may be sent when the client sends a read request, that is, the read request also includes the first preset number; it may also be set in the server, and the server receives in this embodiment
  • the message identifier returns the messages stored in the storage location within the first preset number after the storage location according to the preset rule.
  • the message corresponding to the message identifier in this read request may already be a newer message among the existing messages in the live broadcast room, starting from the message corresponding to the message identifier in this read request (not including the message in this read request) (Identify the corresponding message) until the latest messages stored in the live broadcast room are less than the first preset number, then read the messages after the message corresponding to the message identifier in this read request (then the number is less than the first preset number) , Get the message set.
  • the client initiates a read request according to the message identifier of the latest message in the message set that was read from the server last time, and obtains the latest message from the server (which is later than the latest).
  • the message is still new) a message set of the first preset number of messages, and the message identifier of the latest message in the message set is obtained, and the message identifier of the latest message in the message set can be used to initiate a read request in the next read request.
  • This repeated execution can actively obtain the updated message of the live broadcast room from the server without repetition and loss.
  • step S15 specifically includes: obtaining, according to the target index table, the storage location of the message corresponding to the last message identifier in the target index table , Read the messages stored in the storage location and the storage locations within the second preset number before, to obtain the message set.
  • the method further includes: sending the message identifier of the last message in the read message set to the client, so that the client initiates the next read request according to the message identifier.
  • step S15 may indicate that when the client enters the live broadcast room for the first time, the server returns the latest message in the existing news in the live broadcast room and the messages within the second preset number before the latest message as a message set to the live broadcast room.
  • the second preset number may be sent when the client sends a read request, that is, the read request further includes the second preset number; it may also be set in the server, and the server is in this embodiment.
  • the message stored in the storage position within the second preset number before the storage position of the message corresponding to the last message identifier in the target index table is returned according to a preset rule.
  • the number of existing messages in the live broadcast room is less than or equal to the second preset number, read the message corresponding to the last message identifier in the target index table and all messages before the message (less than the second preset number) , Get the message set.
  • the message corresponding to the last message identifier in the target index table and the second preset number of messages before the message are read to obtain the message set .
  • the last message in the message set is the latest message in the message set, and is the message corresponding to the last message identifier in the target index table at this time.
  • the client when the client enters the live broadcast room for the first time, the client initiates a read request with the message identifier empty, and obtains the latest news and the latest news from the existing messages in the live broadcast room from the server.
  • the previous message set composed of messages within the second preset number, and the message identifier of the latest message in the existing messages in the live room is obtained, and the latest message in the existing messages in the live room can be used in the next read request. Identifies the initiation of a read request for repeated execution.
  • the above technical solution realizes that when the client enters the live broadcast room for the first time, it obtains a message set composed of messages in the live broadcast room for the most recent period of time (the latest second preset number plus less than 1), and At this time, the message ID of the latest message in the live broadcast room, and the next read request will be initiated according to the message ID of the latest message in the live room at the time of the next read request, so that the live broadcast can be actively obtained from the server without repetition and loss. Updated news during the time.
  • the message identifier in the read request is different from any message identifier in the target index table
  • step S15 specifically includes: obtaining data in the target index table according to the target index table.
  • the last message identifies the storage location of the corresponding message, reads the messages stored in the storage location and the storage location within the second preset number before it, to obtain the message set.
  • the method further includes: sending the message identifier of the last message in the read message set to the client, so that the client initiates the next read request according to the message identifier.
  • the message identifier in the read request is different from any message identifier in the target index table, it may be that the message identifier in the read request sent by the client is wrong; it may also be in the read request sent by the client.
  • the message identifier of is the message identifier of the earlier message in the live broadcast room. The earlier message has not been stored due to being overwritten by new messages or its message identifier is not stored in the target index table corresponding to the live broadcast room. . Since in this embodiment, the server receives the message identifier in the read request and is different from any message identifier in the target index table, the processing method is the same as the processing method after the server receives the message identifier in the read request as empty, then I will not repeat them here.
  • the client when the message identifier in the read request sent by the client is wrong or when the message identifier in the read request sent is the message identifier of the earlier message in the live broadcast room, the client can not be repeated or lost. Actively obtain the updated news of the live broadcast room from the server.
  • the method further includes: after receiving the read request sent by the client, sending a request interval time to the client, where the request interval time is the next time the client sends a read request and The interval between sending the read request this time.
  • the server can control the interval time for the client to send the read request through the request interval time. Therefore, when the server perceives excessive pressure, such as the server CPU is too high and the network card traffic is too large, appropriately increase the request interval time sent to multiple clients, thereby reducing the number of concurrent client requests to a certain extent.
  • the amount of messages is very large, and the request interval is slightly longer, and some users may not perceive it, which will not affect the user experience, and at the same time protects the stability of the system.
  • the server's perceived pressure is small or unchanged, the interval between requests sent to the client can be appropriately reduced or not changed.
  • the method before the step of sending the request interval time to the client, the method further includes: increasing the request interval time when the perceived pressure is greater than a preset value.
  • the server's perceived pressure can be determined by the server's CPU, network card traffic, etc.
  • the preset value is also determined according to the server's method of sensing the pressure. For example, whether the server's perceived pressure is greater than a preset value is determined by determining whether the server CPU is greater than a preset value.
  • the preset value can be set based on experience or by the user, and there is no limitation here. When the server perceives too much pressure, appropriately increase the request interval time sent to the client, thereby reducing the number of concurrent requests from the client to a certain extent. Because of the large amount of messages in the live broadcast scenario, the request interval is slightly longer Some users may not perceive it, will not affect the user experience, and at the same time protect the stability of the system.
  • the method further includes: receiving a write request sent by the client, where the write request includes the written message and the live broadcast room identifier.
  • the identification information of the message is generated according to the time when the write request is received.
  • the identification information and storage location of the message are stored in the target index table, and the storage location points to a specific element of the target circular linked list storing the message.
  • Each circular linked list is used to store the message of a live broadcast room, and the circular linked list corresponds to the live broadcast room one-to-one.
  • the message identifiers and storage locations of the messages stored in each circular linked list are stored in an index table, and the circular linked list corresponds to the index table one-to-one.
  • FIG. 2 is used as an example for description.
  • room1 represents the first live room
  • RingBuffer1 represents the circular linked list corresponding to the first live room
  • each grid in RingBuffer1 represents the element of the circular linked list, which is used to store a message, for example, in RingBuffer1 in Figure 2
  • msg1, msg2, msg3...msg1000 represent the messages stored in the RingBuffer1, and also the messages stored in the first live room in sequence
  • the arrow pointing to RingBuffer1 represents the pointer, which initially points to the starting element of RingBuffer1, that is, to RingBuffer1
  • the server After receiving the write request sent by the client, the server writes a message included in the write request into the first cell of RingBuffer1, the pointer points to the second cell of RingBuffer1, and so on, the pointer follows the message The writing of is sequentially moved from pointing to the starting element to pointing to the end element (end grid), when it points to the end element, the next move will point to the starting element (at this time, when the pointer points to
  • the storage location points to the specific element of RingBuffer1 that stores the message.
  • msg_id1 in msg_index1 in Figure 2 represents the message identifier of the message msg1 in RingBuffer1, which is located in msg_index1.
  • pos1 represents the storage location of the message msg1 in RingBuffer1, and pos1 in msg_index1 points to the first cell (starting element) of RingBuffer1.
  • room2 represents the second live room
  • RingBuffer2 represents the circular linked list corresponding to the second live room
  • each grid in RingBuffer2 represents the element of the circular linked list, which is used to store a message, for example, msg1 in RingBuffer2 in Figure 2 ', msg2', msg3'...msg1000' represents the message stored in the RingBuffer2, and also represents the message stored in the second live room in sequence
  • the arrow pointing to RingBuffer2 represents the pointer, which initially points to the starting element of RingBuffer2, That is, it points to the first cell of RingBuffer2.
  • the server After the server receives a write request sent by the client and writes a message included in the write request into the first cell of RingBuffer2, the pointer points to the second cell of RingBuffer2, and so on.
  • the pointer moves from pointing to the beginning element to the end element (end grid) in sequence with the writing of the message.
  • the next time it moves and then points to the beginning element at this time, when the pointer points to the end element
  • the message newly written to the start element will overwrite the original message in the start element);
  • msg_index2 represents the index table corresponding to the second live broadcast room, on which each stored in RingBuffer2 is stored The corresponding relationship between the message identifier of the message and the storage location of the message.
  • the storage location points to the specific element of RingBuffer2 that stores the message.
  • msg_id1' in msg_index2 in Figure 2 represents the message identifier of the message msg1' in RingBuffer2
  • Pos1' in msg_index2 indicates the storage location of the message msg1' in RingBuffer2
  • pos1' in msg_index2 points to the first cell (starting element) of RingBuffer2.
  • the data structure of a circular linked list is defined, and the messages of each live broadcast room are stored in a circular linked list, and indexed by the corresponding index table, and the message reading performance is better.
  • the circular linked list is an array including 1000 elements. That is, for messages in a live broadcast room, only the most recent 1,000 messages can be stored, and the 1,000 earlier messages will be overwritten, saving memory.
  • FIG. 3 is a flow chart showing a method for message interaction according to an embodiment of the present disclosure. As shown in Figure 3, the method includes the following steps:
  • Step S31 Send a read request to the server, where the read request includes the message identifier and the live broadcast room identifier.
  • Step S33 receiving and displaying the message set sent by the server, the message set being read by the server according to the message identifier and target index table, and the target index table is corresponding to the live broadcast room identifier direction chart.
  • the client and the server adopt the pull model for message interaction, that is, the client actively queries the server and obtains the message by sending a read request including the message identifier and the live broadcast room identifier.
  • this model can meet the needs of large groups.
  • users can obtain the latest news in a timely and without loss, improving the live interactive experience.
  • the message identifier in the read request is the message identifier of the last message in the message set that the client read from the server last time
  • the message set in step S33 Identify messages stored in storage locations within a first preset number after the storage location of the corresponding message for the message.
  • the method further includes: receiving the message identifier of the last message in the message set sent by the server, and updating the message identifier in the read request according to the message identifier, so as to initiate the next read request according to the message identifier .
  • the client initiates a read request according to the message identifier of the latest message in the message set (the last message in the message set) read from the server last time, from The server obtains the message set of the first preset number of messages after the latest message (newer than the latest message), and obtains the message identifier of the latest message in the message set, and can use the message set in the next read request
  • the message identifier of the latest message in the media initiates a read request for repeated execution, so that the updated message of the live broadcast room can be actively obtained from the server without repetition and loss.
  • the message identifier in the read request is empty, and the message set in step S33 is the storage location of the message corresponding to the last message identifier in the target index table and the second before it. Messages stored in storage locations within a preset number.
  • the method further includes: receiving the message identifier of the last message in the message set sent by the server, and updating the message identifier in the read request according to the message identifier, so as to initiate the next read request according to the message identifier .
  • the client when the client enters the live broadcast room for the first time, the client initiates a read request with an empty message identifier, and obtains the latest information from the existing messages in the live broadcast room from the server (the target The last message identifier in the index table corresponds to the message) and the message set formed by the second preset number of messages before the latest message, and the message identifier of the latest message in the existing messages in the live broadcast room is obtained.
  • the message identifier of the latest message in the existing messages in the live broadcast room can be used to initiate a read request, thereby repeating the execution.
  • the above technical solution realizes that when the client enters the live broadcast room for the first time, it obtains a message set composed of messages in the live broadcast room for the most recent period of time (the latest second preset number plus less than 1), and At this time, the message ID of the latest message in the live broadcast room, and the next read request will be initiated according to the message ID of the latest message in the live room at the time of the next read request, so that the live broadcast can be actively obtained from the server without repetition and loss. Updated news during the time.
  • the message identifier in the read request is different from any message identifier in the target index table
  • the message set in step S33 is the last message identifier in the target index table
  • the method further includes: receiving the message identifier of the last message in the message set sent by the server, and updating the message identifier in the read request according to the message identifier, so as to initiate the next read request according to the message identifier .
  • the client when the message identifier in the read request sent by the client is wrong or when the message identifier in the read request sent is the message identifier of the earlier message in the live broadcast room, the client can not be repeated or lost. Actively obtain the updated news of the live broadcast room from the server.
  • the method further includes: receiving a request interval time sent by the server, where the request interval time is an interval time between the next time the client sends a read request and this time the read request is sent.
  • the interval time for the client to send read requests can be controlled by the server through the request interval time. Therefore, when the server perceives excessive pressure, such as the server CPU is too high and the network card traffic is too large, appropriately increase the request interval time sent to multiple clients, thereby reducing the number of concurrent client requests to a certain extent.
  • the amount of messages is very large, and the request interval is slightly longer, and some users may not perceive it, which will not affect the user experience, and at the same time protects the stability of the system.
  • the server's perceived pressure is small or unchanged, the interval between requests sent to the client can be appropriately reduced or not changed.
  • another embodiment of the present disclosure further provides a message interaction device for implementing the steps of the message interaction method applied to the server.
  • the message interaction device can implement part or all of the server through software, hardware or a combination of the two. As shown in Figure 4, the message interaction device includes:
  • the reading request receiving module 11 is configured to receive a reading request sent by a client, and the reading request includes a message identifier and a live broadcast room identifier.
  • the target index table obtaining module 13 is configured to obtain a target index table according to the live broadcast room identifier, and the target index table is an index table corresponding to the live broadcast room identifier.
  • the message set reading module 15 is configured to read a message set according to the message identifier and the target index table.
  • the message set sending module 17 is configured to send the message set to the client.
  • the client and the message interaction device adopt the pull model when they exchange messages, that is, the client actively queries the message interaction device and obtains the message by sending a read request including the message identifier and the live broadcast room identifier.
  • the client actively queries the message interaction device and obtains the message by sending a read request including the message identifier and the live broadcast room identifier.
  • this model Can meet the live broadcast scene where large-scale users are online at the same time, users can get the latest news in time and without loss, and improve the live interactive experience.
  • the message identifier in the read request is the message identifier of the last message in the message set that the client read from the server last time
  • the message set reading module 15 It is specifically used to: obtain the storage location of the message corresponding to the message identifier according to the target index table, read the messages stored in the storage location within the first preset number after the storage location, to obtain the message set.
  • the message interaction device further includes: a message identification sending module.
  • the message identification sending module is configured to send the message identification of the last message in the read message set to the client, so that the client initiates the next read request according to the message identification.
  • the client initiates a read request according to the message identifier of the latest message in the message set obtained from the message interaction device last time, and obtains the latest message from the message interaction device. (Newer than the latest message)
  • a message set of the first preset number of messages, and the message ID of the latest message in the message set is obtained, and the message ID of the latest message in the message set can be used to initiate the next read request
  • the read request is repeatedly executed, so that the updated message of the live broadcast room can be actively obtained from the message interaction device without repetition and loss.
  • the message identifier in the read request is empty
  • the message set reading module 15 is specifically configured to: obtain the last message identifier corresponding to the last message identifier in the target index table according to the target index table
  • the storage location of the message read the messages stored in the storage location and the storage location within the second preset number before, to obtain the message set.
  • the message interaction device further includes: a message identification sending module.
  • the message identification sending module is configured to send the message identification of the last message in the read message set to the client, so that the client initiates the next read request according to the message identification.
  • the client when the client enters the live broadcast room for the first time, the client initiates a read request with a message identifier empty, and obtains the latest message and the latest message in the existing news in the live broadcast room from the message interaction device.
  • a message set composed of messages within the second preset number before the latest news, and the message identifier of the latest news in the existing news in the live room is obtained, and the latest news in the existing news in the live room can be used in the next read request Initiate a read request with the message identifier of, so as to repeat the execution.
  • the above technical solution realizes that when the client enters the live broadcast room for the first time, it obtains a message set composed of messages in the live broadcast room for the most recent period of time (the latest second preset number plus less than 1), and At this time, the message identifier of the latest message in the live broadcast room, and the next read request is initiated according to the message identifier of the latest message in the live broadcast room at the time of the next read request, so that it can be actively obtained from the message interaction device without repetition and loss.
  • the news updated in this live broadcast room when the client enters the live broadcast room for the first time, it obtains a message set composed of messages in the live broadcast room for the most recent period of time (the latest second preset number plus less than 1), and At this time, the message identifier of the latest message in the live broadcast room, and the next read request is initiated according to the message identifier of the latest message in the live broadcast room at the time of the next read request, so that it can be actively obtained from the message interaction device without repetition and loss.
  • the message identifier in the read request is different from any message identifier in the target index table
  • the message set reading module 15 is specifically configured to: obtain all messages according to the target index table.
  • the message storage location corresponding to the last message identifier in the target index table is read, and the messages stored in the storage location and the storage location within the second preset number before it are read to obtain the message set.
  • the message interaction device further includes: a message identification sending module.
  • the message identification sending module is configured to send the message identification of the last message in the read message set to the client, so that the client initiates the next read request according to the message identification.
  • the client can not be repeated or lost. Actively obtain the updated message of the live broadcast room from the message interaction device.
  • the message interaction apparatus further includes a request interval sending module.
  • the request interval sending module is configured to send the request interval time to the client after receiving the read request sent by the client, and the request interval time is the next time the client sends the read request and the current time. The interval time for sending the read request.
  • the message interaction device can control the interval time for the client to send the read request through the request interval time. Therefore, when the message interaction device perceives that the server pressure is too high, such as the server CPU is too high and the network card traffic is too large, appropriately increase the request interval time sent to multiple clients, thereby reducing the number of concurrent client requests to a certain extent. Since the amount of messages is very large in the live broadcast scenario, some users may not perceive the request interval for a little longer, which will not affect the user experience, and at the same time protects the stability of the system. In addition, when the perceived server pressure is small or unchanged, the interval between requests sent to the client can be appropriately reduced or unchanged.
  • the message interaction apparatus further includes a request interval control module.
  • the request interval control module is configured to increase the request interval time when the perceived pressure is greater than a preset value.
  • the message interaction device senses pressure through the server CPU, network card traffic, etc.
  • the preset value is also determined according to the way of sensing the server pressure. For example, when sensing whether the server pressure is greater than a preset value is determined by judging whether the server CPU is greater than a preset value, the preset value can be set based on experience or by the user, and there is no limitation here. When feeling the server pressure is too high, appropriately increase the request interval time sent to the client, thereby reducing the number of concurrent requests from the client to a certain extent. Because of the large amount of messages in the live broadcast scenario, the request interval is slightly longer Some users may not perceive it, will not affect the user experience, and at the same time protect the stability of the system.
  • the message interaction apparatus further includes:
  • the write request receiving module is used to receive the write request sent by the client, the write request including the written message and the live broadcast room identifier.
  • the message storage module is configured to write the message into an element pointed to by a pointer of a target circular linked list according to the live broadcast room identifier, the target circular linked list is a circular linked list corresponding to the live broadcast room identifier, and the circular linked list is An array that includes multiple elements, each of which is used to store a message.
  • the pointer of the circular linked list moves from pointing to the starting element to pointing to the end element in sequence with the writing of the message. When pointing to the end element, the next This movement again points to the starting element.
  • the identification information generating module is configured to generate the identification information of the message according to the time when the write request is received.
  • the target index table generating module is configured to store the identification information and storage location of the message in the target index table, and the storage location points to a specific element of the target circular linked list storing the message.
  • the data structure of a circular linked list is defined, and the messages of each live broadcast room are stored in a circular linked list, and indexed by the corresponding index table, and the message reading performance is better.
  • the circular linked list is an array including 1000 elements. That is, for messages in a live broadcast room, only the most recent 1,000 messages can be stored, and the 1,000 earlier messages will be overwritten, saving memory.
  • another embodiment of the present disclosure also provides a message interaction device for implementing the steps of the message interaction method applied to the client.
  • the message interaction device can implement part or all of the client through software, hardware or a combination of the two. As shown in Figure 5, the message interaction device includes:
  • the read request sending module 31 is configured to send a read request to the server, where the read request includes a message identifier and a live broadcast room identifier.
  • the message set receiving module 33 is configured to receive and display a message set sent by the server, the message set being read by the server according to the message identifier and a target index table, and the target index table is related to the The index table corresponding to the live broadcast room identifier.
  • the message interaction device and the server adopt the pull model when performing message interaction, that is, the message interaction device actively queries the server and obtains the message by sending a read request including the message identifier and the live broadcast room identifier.
  • the message interaction device actively queries the server and obtains the message by sending a read request including the message identifier and the live broadcast room identifier.
  • the message identifier in the read request is the message identifier of the last message in the message set that the client reads from the server last time
  • the message set receiving module 33 The message set of is the message stored in the storage location within the first preset number after the storage location of the message corresponding to the message identifier.
  • the message interaction device also includes a message identification receiving module.
  • the message identifier receiving module is configured to receive the message identifier of the last message in the message set sent by the server, and update the message identifier in the read request according to the message identifier, so as to initiate the next time based on the message identifier Read request.
  • the message interaction device initiates a read request according to the message identifier of the latest message in the message set (the last message in the message set) that was read from the server last time,
  • the message identifier of the latest message in the collection initiates a read request to repeat the execution, so that the updated message of the live broadcast room can be actively obtained from the server without repetition and loss.
  • the message identifier in the read request is empty, and the message set in the message set receiving module 33 is the storage location and storage location of the message corresponding to the last message identifier in the target index table. Messages stored in storage locations within the second preset number before.
  • the message interaction device also includes a message identification receiving module.
  • the message identifier receiving module is configured to receive the message identifier of the last message in the message set sent by the server, and update the message identifier in the read request according to the message identifier, so as to initiate the next time based on the message identifier Read request.
  • the message interaction device initiates a read request with a message identifier empty, and obtains the latest news in the existing messages in the live broadcast room from the server (the said The message set corresponding to the last message identifier in the target index table) and the message set formed by the second preset number of messages before the latest message, and the message identifier of the latest message in the existing messages in the live broadcast room.
  • the message identifier of the latest message in the existing messages in the live broadcast room can be used to initiate a read request, thereby repeating the execution.
  • the above technical solution realizes that when the client enters the live broadcast room for the first time, it obtains a message set composed of messages in the live broadcast room for the most recent period of time (the latest second preset number plus less than 1), and At this time, the message ID of the latest message in the live broadcast room, and the next read request will be initiated according to the message ID of the latest message in the live room at the time of the next read request, so that the live broadcast can be actively obtained from the server without repetition and loss. Updated news during the time.
  • the message identifier in the read request is different from any message identifier in the target index table, and the message set in the message set receiving module 33 is the last one in the target index table.
  • the message identifier corresponds to the storage location of the message and the messages stored in the storage location within the second preset number before.
  • the message interaction device also includes a message identification receiving module.
  • the message identifier receiving module is configured to receive the message identifier of the last message in the message set sent by the server, and update the message identifier in the read request according to the message identifier, so as to initiate the next time based on the message identifier Read request.
  • the client when the message identifier in the read request sent by the client is wrong or when the message identifier in the read request sent is the message identifier of the earlier message in the live broadcast room, the client can not be repeated or lost. Actively obtain the updated news of the live broadcast room from the server.
  • the message interaction apparatus further includes a request interval receiving module.
  • the request interval receiving module is configured to receive the request interval time sent by the server, and the request interval time is the interval time between the next time the client sends a read request and the current time to send the read request.
  • the interval time for the client to send read requests can be controlled by the server through the request interval time. Therefore, when the server perceives excessive pressure, such as the server CPU is too high and the network card traffic is too large, appropriately increase the request interval time sent to multiple clients, thereby reducing the number of concurrent client requests to a certain extent.
  • the amount of messages is very large, and the request interval is slightly longer, and some users may not perceive it, which will not affect the user experience, and at the same time protects the stability of the system.
  • the server's perceived pressure is small or unchanged, the interval between requests sent to the client can be appropriately reduced or not changed.
  • the embodiments of the present disclosure also provide a computer-readable medium on which a computer program is stored.
  • the program When the program is executed by a processing device, it can execute the steps of the message interaction method applied to the server or the message interaction method applied to the client.
  • FIG. 6 shows a schematic structural diagram of an electronic device 600 suitable for implementing the embodiments of the present disclosure.
  • the electronic device may be applied to a server or a client.
  • the electronic device shown in FIG. 6 is only an example, and should not bring any limitation to the function and scope of use of the embodiments of the present disclosure.
  • the electronic device 600 may include a processing device (such as a central processing unit, a graphics processor, etc.) 601, which may be loaded into a random access device according to a program stored in a read-only memory (ROM) 602 or from a storage device 608.
  • the program in the memory (RAM) 603 executes various appropriate actions and processing.
  • various programs and data required for the operation of the electronic device 600 are also stored.
  • the processing device 601, the ROM 602, and the RAM 603 are connected to each other through a bus 604.
  • An input/output (I/O) interface 605 is also connected to the bus 604.
  • the following devices can be connected to the I/O interface 605: including input devices 606 such as touch screens, touch pads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; including, for example, liquid crystal displays (LCD), speakers, vibration An output device 607 such as a device; a storage device 608 such as a tape, a hard disk, etc.; and a communication device 609.
  • the communication device 609 may allow the electronic device 600 to perform wireless or wired communication with other devices to exchange data.
  • FIG. 6 shows an electronic device 600 having various devices, it should be understood that it is not required to implement or have all of the illustrated devices. It may alternatively be implemented or provided with more or fewer devices.
  • the process described above with reference to the flowchart can be implemented as a computer software program.
  • the embodiments of the present disclosure include a computer program product, which includes a computer program carried on a non-transitory computer readable medium, and the computer program contains program code for executing the method shown in the flowchart.
  • the computer program may be downloaded and installed from the network through the communication device 609, or installed from the storage device 608, or installed from the ROM 602.
  • the processing device 601 the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
  • the aforementioned computer-readable medium in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two.
  • the computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or a combination of any of the above. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable Programmable read only memory (EPROM or flash memory), optical fiber, portable compact disk read only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
  • a computer-readable storage medium may be any tangible medium that contains or stores a program, and the program may be used by or in combination with an instruction execution system, apparatus, or device.
  • a computer-readable signal medium may include a data signal propagated in a baseband or as a part of a carrier wave, and a computer-readable program code is carried therein. This propagated data signal can take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • the computer-readable signal medium may also be any computer-readable medium other than the computer-readable storage medium.
  • the computer-readable signal medium may send, propagate or transmit the program for use by or in combination with the instruction execution system, apparatus, or device .
  • the program code contained on the computer-readable medium can be transmitted by any suitable medium, including but not limited to: wire, optical cable, RF (Radio Frequency), etc., or any suitable combination of the above.
  • the client and server can communicate with any currently known or future-developed network protocol such as HTTP (HyperText Transfer Protocol), and can communicate with digital data in any form or medium.
  • Communication e.g., communication network
  • Examples of communication networks include local area networks (“LAN”), wide area networks (“WAN”), the Internet (for example, the Internet), and end-to-end networks (for example, ad hoc end-to-end networks), as well as any currently known or future research and development network of.
  • the above-mentioned computer-readable medium may be included in the above-mentioned electronic device; or it may exist alone without being assembled into the electronic device.
  • the above-mentioned computer-readable medium carries one or more programs.
  • the electronic device When the above-mentioned one or more programs are executed by the electronic device, the electronic device is caused to receive a read request sent by the client.
  • the read request includes a message identifier and a live broadcast room. Identification; obtain a target index table according to the live broadcast room identifier, the target index table is an index table corresponding to the live broadcast room identifier; read a message set according to the message identifier and the target index table; The message set is sent to the client.
  • the computer-readable medium above carries one or more programs, and when the above one or more programs are executed by the electronic device, the electronic device is caused to send a read request to the server, and the read request includes the message identifier and the live broadcast room. Identification; receiving and displaying the message set sent by the server, the message set being read by the server according to the message identification and target index table, the target index table being an index corresponding to the live broadcast room identification table.
  • the computer program code used to perform the operations of the present disclosure can be written in one or more programming languages or a combination thereof.
  • the above-mentioned programming languages include but are not limited to object-oriented programming languages such as Java, Smalltalk, C++, and Including conventional procedural programming languages-such as "C" language or similar programming languages.
  • the program code can be executed entirely on the user's computer, partly on the user's computer, executed as an independent software package, partly on the user's computer and partly executed on a remote computer, or entirely executed on the remote computer or server.
  • the remote computer can be connected to the user’s computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (for example, using an Internet service provider to Connect via the Internet).
  • LAN local area network
  • WAN wide area network
  • each block in the flowchart or block diagram may represent a module, program segment, or part of code, and the module, program segment, or part of code contains one or more for realizing the specified logical function Executable instructions.
  • the functions marked in the block may also occur in a different order from the order marked in the drawings. For example, two blocks shown in succession can actually be executed substantially in parallel, and they can sometimes be executed in the reverse order, depending on the functions involved.
  • each block in the block diagram and/or flowchart, and the combination of the blocks in the block diagram and/or flowchart can be implemented by a dedicated hardware-based system that performs the specified functions or operations Or it can be realized by a combination of dedicated hardware and computer instructions.
  • a read request receiving module can also be described as "a module that receives a read request sent by a client".
  • exemplary types of hardware logic components include: Field Programmable Gate Array (FPGA), Application Specific Integrated Circuit (ASIC), Application Specific Standard Product (ASSP), System on Chip (SOC), Complex Programmable Logical device (CPLD) and so on.
  • FPGA Field Programmable Gate Array
  • ASIC Application Specific Integrated Circuit
  • ASSP Application Specific Standard Product
  • SOC System on Chip
  • CPLD Complex Programmable Logical device
  • a machine-readable medium may be a tangible medium, which may contain or store a program for use by the instruction execution system, apparatus, or device or in combination with the instruction execution system, apparatus, or device.
  • the machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium.
  • the machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any suitable combination of the foregoing.
  • machine-readable storage media would include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the foregoing.
  • RAM random access memory
  • ROM read-only memory
  • EPROM or flash memory erasable programmable read-only memory
  • CD-ROM compact disk read only memory
  • magnetic storage device or any suitable combination of the foregoing.
  • Example 1 provides a message interaction method, which is applied to a server, and the server stores a plurality of index tables, and each of the index tables reflects the messages of all messages in a live broadcast room.
  • the corresponding relationship between the identifier and the storage location of all messages in the live broadcast room, the method includes: receiving a read request sent by a client, the read request including a message identifier and a live broadcast room identifier; and obtain a target index table according to the live broadcast room identifier
  • the target index table is an index table corresponding to the live broadcast room identifier; according to the message identifier and the target index table, a message set is read; and the message set is sent to the client.
  • Example 2 provides the method of Example 1.
  • the message identifier in the read request is the last message in the message set that the client reads from the server last time
  • the step of reading a message set includes: obtaining the storage location of the message corresponding to the message identifier according to the target index table, and reading the storage location of the message corresponding to the message identifier according to the target index table.
  • Example 3 provides the method of Example 1.
  • the message identifier in the read request is empty or the message identifier in the read request is identical to any message identifier in the target index table.
  • the step of reading a message set according to the message identifier and the target index table includes: obtaining the message corresponding to the last message identifier in the target index table according to the target index table Read the messages stored in the storage location and the storage location within the second preset number before it, to obtain the message set; the method further includes: the most read message set The message identifier of the last message is sent to the client, so that the client initiates the next read request according to the message identifier.
  • Example 4 provides the method according to any one of Examples 1 to 3, and the method further includes: after receiving the read request sent by the client, sending a request interval time To the client, the request interval time is the interval between the next time the client sends a read request and this time the read request is sent.
  • Example 5 provides the method of Example 4. Before the step of sending the request interval to the client, the method further includes: when the perceived pressure is greater than a preset value, Increase the request interval time.
  • Example 6 provides the method according to any one of Examples 1 to 3, and the method further includes: receiving a write request sent by the client, the write request including the written message and The live broadcast room identifier; according to the live broadcast room identifier, the message is written into the element pointed to by the pointer of the target circular linked list, the target circular linked list is a circular linked list corresponding to the live broadcast room identifier, and the circular linked list includes multiple An array of elements, each of which is used to store a message. The pointer of the circular linked list moves from pointing to the starting element to pointing to the end element in sequence with the writing of the message.
  • Example 7 provides a message interaction method applied to a client, the method includes: sending a read request to the server, the read request including a message identifier and a live broadcast room identifier; receiving The message set sent by the server is displayed, and the message set is read by the server according to the message identifier and a target index table, and the target index table is an index table corresponding to the live broadcast room identifier.
  • Example 8 provides a message interaction device applied to a server.
  • the server stores a plurality of index tables, and each of the index tables reflects the messages of all messages in a live broadcast room.
  • the corresponding relationship between the identifier and the storage location of all messages in the live broadcast room includes: a read request receiving module for receiving a read request sent by a client, the read request including a message identifier and a live broadcast room identifier; a target index table acquisition module, Is used to obtain a target index table according to the live broadcast room identifier, where the target index table is an index table corresponding to the live broadcast room identifier; a message set reading module is used to obtain a target index table according to the message identifier and the target index table, Read a message set; a message set sending module is used to send the message set to the client.
  • Example 9 provides a message interaction device, which is applied to a client, and includes: a read request sending module, configured to send a read request to the server, the read request includes a message identifier and a live broadcast
  • the message set receiving module is used to receive and display the message set sent by the server.
  • the message set is read by the server according to the message identifier and the target index table, and the target index table is and The index table corresponding to the live broadcast room identifier.
  • Example 10 provides a computer-readable medium on which a computer program is stored, and when the program is executed by a processing device, the steps of the method described in any one of Examples 1 to 7 are implemented.
  • Example 11 provides an electronic device applied to a server, including: a storage device on which a computer program is stored; and a processing device for executing the A computer program to implement the steps of the method described in any one of Examples 1 to 6.
  • Example 12 provides an electronic device applied to a client, including: a storage device on which a computer program is stored; and a processing device for executing all of the storage devices.
  • the computer program is described to implement the steps of the method described in Example 7.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computing Systems (AREA)
  • Multimedia (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

本公开涉及一种消息交互方法、装置、可读介质及电子设备。消息交互方法应用于服务器时,服务器存储有多个索引表,每一该索引表反映一直播间内所有消息的消息标识与存储位置的对应关系,该方法包括:接收客户端发送的包括消息标识和直播间标识的读请求;根据直播间标识获取目标索引表,目标索引表为与该直播间标识对应的索引表;根据消息标识和目标索引表读取一消息集合;将消息集合发送至客户端。本公开提供的技术方案,客户端和服务器进行消息交互时采用拉模型,即客户端通过发送包括消息标识和直播间标识的读请求主动到服务器查询并获取消息,能够满足大规模用户同时在线的直播场景下,用户及时、不丢失地获取到最新消息,提升直播交互体验。

Description

消息交互方法、装置、可读介质及电子设备
相关申请的交叉引用
本申请要求于2019年10月30日提交的,申请号为201911046890.9、发明名称为“消息交互方法、装置、可读介质及电子设备”的中国专利申请的优先权,该申请的全文通过引用结合在本申请中。
技术领域
本公开涉及通讯技术领域,具体地,涉及一种消息交互方法、装置、可读介质及电子设备。
背景技术
传统的基于紧密关系聊天群组的即时通讯技术方案一般采用推模型。但是推模型对于像直播这种基于松散的聊天群组(用户可随时进出)、大规模用户同时在一聊天群组(直播房间)的场景,适用性较差,其无法满足及时获取消息、不丢失消息的要求。
发明内容
提供该发明内容部分以便以简要的形式介绍构思,这些构思将在后面的具体实施方式部分被详细描述。该发明内容部分并不旨在标识要求保护的技术方案的关键特征或必要特征,也不旨在用于限制所要求的保护的技术方案的范围。
第一方面,本公开提供一种消息交互方法,应用于服务器,所述服务器存储有多个索引表,每一所述索引表反映一直播间内所有消息的消息标识与该直播间内所有消息的存储位置的对应关系,所述方法包括:
接收客户端发送的读请求,所述读请求包括消息标识和直播间标 识;
根据所述直播间标识获取目标索引表,所述目标索引表为与所述直播间标识对应的索引表;
根据所述消息标识和所述目标索引表,读取一消息集合;
将所述消息集合发送至所述客户端。
第二方面,本公开提供一种消息交互方法,应用于客户端,所述方法包括:
向服务器发送读请求,所述读请求包括消息标识和直播间标识;
接收并显示所述服务器发送的消息集合,所述消息集合为所述服务器根据所述消息标识和目标索引表读取到的,所述目标索引表为与所述直播间标识对应的索引表。
第三方面,本公开提供一种消息交互装置,应用于服务器,所述服务器存储有多个索引表,每一所述索引表反映一直播间内所有消息的消息标识与该直播间内所有消息的存储位置的对应关系,包括:
读请求接收模块,用于接收客户端发送的读请求,所述读请求包括消息标识和直播间标识;
目标索引表获取模块,用于根据所述直播间标识获取目标索引表,所述目标索引表为与所述直播间标识对应的索引表;
消息集合读取模块,用于根据所述消息标识和所述目标索引表,读取一消息集合;
消息集合发送模块,用于将所述消息集合发送至所述客户端。
第四方面,本公开提供一种消息交互装置,应用于客户端,包括:
读请求发送模块,用于向服务器发送读请求,所述读请求包括消息标识和直播间标识;
消息集合接收模块,用于接收并显示所述服务器发送的消息集合,所述消息集合为所述服务器根据所述消息标识和目标索引表读取到的,所述目标索引表为与所述直播间标识对应的索引表。
第五方面,本公开提供一种计算机可读介质,其上存储有计算机程序,该程序被处理装置执行时实现第一方面和第二方面所述方法的步骤。
第六方面,本公开提供一电子设备,应用于服务器,包括:
存储装置,其上存储有计算机程序;
处理装置,用于执行所述存储装置中的所述计算机程序,以实现第一方面所述方法的步骤。
第七方面,本公开提供一电子设备,应用于客户端,包括:
存储装置,其上存储有计算机程序;
处理装置,用于执行所述存储装置中的所述计算机程序,以实现第二方面所述方法的步骤。
本公开提供的技术方案,客户端和服务器进行消息交互时采用拉模型,即客户端通过发送包括消息标识和直播间标识的读请求主动到服务器查询并获取消息,使用该模型的情况下,能够满足大规模用户同时在线的直播场景下,用户及时、不丢失地获取到最新消息,提升直播交互体验。
本公开的其他特征和优点将在随后的具体实施方式部分予以详细说明。
附图说明
结合附图并参考以下具体实施方式,本公开各实施例的上述和其他特征、优点及方面将变得更加明显。贯穿附图中,相同或相似的附图标记表示相同或相似的元素。应当理解附图是示意性的,原件和元素不一定按照比例绘制。在附图中:
图1是根据一实施例示出的一种消息交互方法的流程图。
图2是一实施方式中直播间、循环链表和索引表的关系示意图。
图3是根据另一实施例示出的另一种消息交互方法的流程图。
图4是根据一实施例示出的一种消息交互装置的框图。
图5是根据另一实施例示出的另一种消息交互装置的框图。
图6是根据一实施例示出的一种电子设备的框图。
具体实施方式
下面将参照附图更详细地描述本公开的实施例。虽然附图中显示了 本公开的某些实施例,然而应当理解的是,本公开可以通过各种形式来实现,而且不应该被解释为限于这里阐述的实施例,相反提供这些实施例是为了更加透彻和完整地理解本公开。应当理解的是,本公开的附图及实施例仅用于示例性作用,并非用于限制本公开的保护范围。
应当理解,本公开的方法实施方式中记载的各个步骤可以按照不同的顺序执行,和/或并行执行。此外,方法实施方式可以包括附加的步骤和/或省略执行示出的步骤。本公开的范围在此方面不受限制。
本文使用的术语“包括”及其变形是开放性包括,即“包括但不限于”。术语“基于”是“至少部分地基于”。术语“一实施例”表示“至少一个实施例”;术语“另一实施例”表示“至少一个另外的实施例”;术语“一些实施例”表示“至少一些实施例”。其他术语的相关定义将在下文描述中给出。
需要注意,本公开中提及的“第一”、“第二”等概念仅用于对不同的装置、模块或单元进行区分,并非用于限定这些装置、模块或单元所执行的功能的顺序或者相互依存关系。
需要注意,本公开中提及的“一个”、“多个”的修饰是示意性而非限制性的,本领域技术人员应当理解,除非在上下文另有明确指出,否则应该理解为“一个或多个”。
本公开实施方式中的多个装置之间所交互的消息或者信息的名称仅用于说明性的目的,而并不是用于对这些消息或信息的范围进行限制。
本公开一实施例提供一种消息交互方法。该消息交互方法应用于服务器,所述服务器存储有多个索引表,每一所述索引表反映一直播间内所有消息的消息标识与该直播间内所有消息的存储位置的对应关系。图1是根据本公开一实施例示出的一种消息交互方法的流程图。如图1所示,该方法包括以下步骤:
步骤S11,接收客户端发送的读请求,所述读请求包括消息标识和直播间标识。
其中,所述消息标识为消息的唯一标识,消息标识与消息一一对应。直播间标识为直播间的唯一标识,直播间标识与直播间一一对应。直播间为直播平台的直播房间。
步骤S13,根据所述直播间标识获取目标索引表,所述目标索引表为与所述直播间标识对应的索引表。
每一索引表用于查找每一直播间的消息,索引表与直播间一一对应。因而,索引表与直播间标识一一对应,通过直播间标识即可获取与所述直播间标识对应的索引表,即根据所述直播间标识可以获取目标索引表。
步骤S15,根据所述消息标识和所述目标索引表,读取一消息集合。
根据所述消息标识的内容与预设规则的关系,及根据所述目标索引表读取到与所述直播间标识对应的直播间的一消息集合。
步骤S17,将所述消息集合发送至所述客户端。
通过上述技术方案,客户端和服务器进行消息交互时采用拉模型,即客户端通过发送包括消息标识和直播间标识的读请求主动到服务器查询并获取消息,使用该模型的情况下,能够满足大规模用户同时在线的直播场景下,用户及时、不丢失地获取到最新消息,提升直播交互体验。
可选地,在一实施方式中,所述读请求中的消息标识为所述客户端上次从所述服务器读取得到的消息集合中的最末尾消息的消息标识,步骤S15具体包括:根据所述目标索引表获取所述消息标识对应的消息的存储位置,读取在该存储位置之后的第一预设数目个以内的存储位置存储的消息,得到所述消息集合。所述方法还包括:将读取到的所述消息集合中最末尾的消息的消息标识发送至所述客户端,以便所述客户端根据该消息标识发起下一次读请求。
所述读请求中的消息标识为所述客户端上次从所述服务器读取得到的消息集合中的最末尾消息的消息标识时,所述读请求中的消息标识与所述目标索引表中一消息标识相同。所述目标索引表中反映了客户端所访问的直播间内所有消息的消息标识与该直播间内所有消息的存储位置的对应关系,则根据目标索引表和该读请求中的消息标识就可以获取该读请求中的消息标识对应的消息的存储位置。第一预设数目可以是客户端发送读请求时发送的,即所述读请求还包括第一预设数目;也可以是在服务器中设定的,及所述服务器在本实施方式中接收到所述消息标识,按预设规则返回在该存储位置之后第一预设数目个以内存储位置存储的消息。本次的读请求中消息标识对应的消息可能已经是该直播间已有的消 息中较新的消息,从本次的读请求中消息标识对应的消息起(不包括本次的读请求中消息标识对应的消息)至该直播间已存储的最新消息不足第一预设数目个时,则读取本次的读请求中消息标识对应的消息之后的消息(则小于第一预设数目个),得到所述消息集合。当从本次的读请求中消息标识对应的消息起(不包括本次的读请求中消息标识对应的消息)至该直播间已存储的最新消息不少于第一预设数目个时,则读取本次的读请求中消息标识对应的消息之后第一预设数目个消息,得到所述消息集合。所述消息集合中最末尾的消息为所述消息集合中的最新消息。
通过上述技术方案,对于一直播间的消息,客户端根据上次从所述服务器读取得到的消息集合中的最新消息的消息标识发起读请求,从服务器获取该最新消息之后的(比该最新消息还新的)第一预设数目个消息的消息集合,及获取该消息集合中最新消息的消息标识,在下次读请求时即可利用该消息集合中最新消息的消息标识发起读请求,以此重复执行,从而可以不重复、不丢失地主动从服务器获取该直播间更新的消息。
可选地,在一实施方式中,所述读请求中的消息标识为空,步骤S15具体包括:根据所述目标索引表获取所述目标索引表中最末尾的消息标识对应的消息的存储位置,读取在该存储位置及其之前第二预设数目个以内的存储位置存储的消息,得到所述消息集合。所述方法还包括:将读取到的所述消息集合中最末尾的消息的消息标识发送至所述客户端,以便所述客户端根据该消息标识发起下一次读请求。
当所述读请求中的消息标识为空时,例如,该客户端第一次进入该直播间。与该直播间对应的目标索引表中最末尾的消息标识即为该直播间已有消息中最新消息对应的消息标识。则步骤S15可以表示,在客户端第一次进入该直播间时,服务器将该直播间已有消息中最新消息及该最新消息之前的第二预设数目个以内的消息作为消息集合返回至所述客户端。其中,第二预设数目可以是客户端发送读请求时发送的,即所述读请求还包括第二预设数目;也可以是在服务器中设定的,及所述服务器在本实施方式中接收到为空的消息标识时,按预设规则返回所述目标索引表中最末尾的消息标识对应的消息的存储位置之前第二预设数目个以内存储位置存储的消息。当该直播间已有的消息数目小于或等于第二预设数 目时,读取所述目标索引表中最末尾的消息标识对应的消息及该消息之前所有消息(小于第二预设数目个),得到所述消息集合。当该直播间已有的消息数目大于第二预设数目时,读取所述目标索引表中最末尾的消息标识对应的消息及该消息之前第二预设数目个消息,得到所述消息集合。所述消息集合中最末尾的消息为所述消息集合中的最新消息,且为此时所述目标索引表中最末尾的消息标识对应的消息。
通过上述技术方案,对于一直播间的消息,客户端第一次进入该直播间时,客户端发起消息标识为空的读请求,从服务器获取该直播间已有消息中最新消息及该最新消息之前的第二预设数目个以内的消息构成的消息集合,及获取该直播间已有消息中最新消息的消息标识,在下次读请求时即可利用该直播间已有消息中最新消息的消息标识发起读请求,以此重复执行。因此,上述技术方案实现了客户端第一次进入该直播间时,获取此时该直播间内最近一段时间内(最新的第二预设数目加1个以内)的消息构成的消息集合,及此时该直播间的最新消息的消息标识,并在下一次读请求时根据此时该直播间的最新消息的消息标识发起下一次读请求,从而可以不重复、不丢失地主动从服务器获取该直播间更新的消息。
可选地,在一实施方式中,所述读请求中的消息标识与所述目标索引表中任一消息标识均不同,步骤S15具体包括:根据所述目标索引表获取所述目标索引表中最末尾的消息标识对应的消息的存储位置,读取在该存储位置及其之前第二预设数目个以内的存储位置存储的消息,得到所述消息集合。所述方法还包括:将读取到的所述消息集合中最末尾的消息的消息标识发送至所述客户端,以便所述客户端根据该消息标识发起下一次读请求。
当所述读请求中的消息标识与所述目标索引表中任一消息标识均不同时,可能是该客户端发送的读请求中的消息标识错误;也可能是该客户端发送的读请求中的消息标识为该直播间较早以前的消息的消息标识,该较早以前的消息已经由于被新消息覆盖等原因没有存储或其消息标识没有存储在与该直播间对应的目标索引表中了。由于该实施方式中服务器接收到读请求中的消息标识与所述目标索引表中任一消息标识均不同后的处理方式与服务器接收到读请求中的消息标识为空后的处理方式相 同,则在此不作赘述。
通过上述技术方案,使得客户端在发送的读请求中的消息标识错误时或在发送的读请求中的消息标识为该直播间较早以前的消息的消息标识时,可以不重复、不丢失地主动从服务器获取该直播间更新的消息。
可选地,所述方法还包括:在接收到所述客户端发送的读请求后,还发送请求间隔时间至所述客户端,所述请求间隔时间为所述客户端下次发送读请求与本次发送所述读请求的间隔时间。
通过上述技术方案,服务器可以通过请求间隔时间控制客户端发送读请求的间隔时间。从而,在服务器感知压力过大时,如服务器CPU过高、网卡流量过大,适当增大发送给多个客户端的请求间隔时间,从而在一定程度上降低客户端请求的并发数,由于对于直播场景下,消息量是很大的,请求间隔时间稍微长一些用户可能感知不到,不会影响用户体验,同时保护了系统运行的稳定。另外,当服务器感知压力较小或不变时,可以适当减小或不改变发送给客户端的请求间隔时间。
可选地,在所述发送请求间隔时间至所述客户端的步骤之前,所述方法还包括:在感知压力大于预设值时,增大所述请求间隔时间。
其中,服务器感知压力可以通过服务器CPU、网卡流量等方式,对应地,预设值也根据服务器感知压力的方式来确定。例如,服务器感知压力是否大于预设值是通过判断服务器CPU是否大于预设值时,该预设值可以根据经验或者用户自行设定,在此不作限制。在服务器感知压力过大时,适当增大发送给客户端的请求间隔时间,从而在一定程度上降低客户端请求的并发数,由于对于直播场景下,消息量是很大的,请求间隔时间稍微长一些用户可能感知不到,不会影响用户体验,同时保护了系统运行的稳定。
可选地,所述方法还包括:接收客户端发送的写请求,所述写请求包括写入的消息和直播间标识。根据所述直播间标识将所述消息写入目标循环链表的指针指向的元素内,所述目标循环链表为与所述直播间标识对应的循环链表,所述循环链表为包括多个元素的数组,每个所述元素用于存储一个消息,所述循环链表的指针随消息的写入顺次从指向起始元素向指向末尾元素移动,当指向所述末尾元素后下次移动又指向所述起 始元素。根据接收到所述写请求的时间生成所述消息的标识信息。将所述消息的标识信息和存储位置存储至所述目标索引表,所述存储位置指向存储所述消息的目标循环链表的具体元素。
每一循环链表用于存储一直播间的消息,循环链表与直播间一一对应。每一循环链表中存储的消息的消息标识及存储位置存储在一索引表中,循环链表与索引表一一对应。为了更清楚的解释说明上述技术方案,以图2示例性地进行说明。图2中,room1表示第一直播间;RingBuffer1表示第一直播间对应的循环链表;RingBuffer1中的每一格子表示该循环链表的元素,用于存储一个消息,例如,图2中位于RingBuffer1中的msg1、msg2、msg3…msg1000表示存储在该RingBuffer1的消息,也表示依次存储的第一直播间的消息;指向RingBuffer1中的箭头表示指针,该指针在最初时指向RingBuffer1的起始元素,即指向RingBuffer1的第一格,服务器在接收客户端发送的写请求后将所述写请求包括的一消息写入RingBuffer1的第一格后,该指针指向RingBuffer1的第二格,以此类推,该指针随消息的写入顺次从指向起始元素向指向末尾元素(末尾格)移动,当指向所述末尾元素后下次移动又指向所述起始元素(此时,当该指针又指向所述起始元素时,新写入所述起始元素的消息会覆盖原来在所述起始元素的消息);msg_index1表示第一直播间对应的索引表,其上存储有RingBuffer1中存储的每一消息的消息标识与该消息的存储位置的对应关系,所述存储位置指向存储所述消息的RingBuffer1的具体元素,例如,图2中位于msg_index1中的msg_id1表示RingBuffer1中的消息msg1的消息标识,位于msg_index1中的pos1表示RingBuffer1中的消息msg1的存储位置,msg_index1中的pos1指向RingBuffer1的第一格(起始元素)。同理,room2表示第二直播间;RingBuffer2表示第二直播间对应的循环链表;RingBuffer2中的每一格子表示该循环链表的元素,用于存储一个消息,例如,图2中位于RingBuffer2中的msg1’、msg2’、msg3’…msg1000’表示存储在该RingBuffer2的消息,也表示依次存储的第二直播间的消息;指向RingBuffer2中的箭头表示指针,该指针在最初时指向RingBuffer2的起始元素,即指向RingBuffer2的第一格,服务器在接收客户端发送的写请求后将所述写请求包括的一消息写入RingBuffer2的第一 格后,该指针指向RingBuffer2的第二格,以此类推,该指针随消息的写入顺次从指向起始元素向指向末尾元素(末尾格)移动,当指向所述末尾元素后下次移动又指向所述起始元素(此时,当该指针又指向所述起始元素时,新写入所述起始元素的消息会覆盖原来在所述起始元素的消息);msg_index2表示第二直播间对应的索引表,其上存储有RingBuffer2中存储的每一消息的消息标识与该消息的存储位置的对应关系,所述存储位置指向存储所述消息的RingBuffer2的具体元素,例如,图2中位于msg_index2中的msg_id1’表示RingBuffer2中的消息msg1’的消息标识,位于msg_index2中的pos1’表示RingBuffer2中的消息msg1’的存储位置,msg_index2中的pos1’指向RingBuffer2的第一格(起始元素)。
通过上述技术方案,定义了循环链表这种数据结构,将每一直播间的消息存储于一循环链表中,并通过对应的索引表进行索引,消息读取性能较好。
可选地,在一实施方式中,所述循环链表为包括1000个元素的数组。即,对于一直播间的消息,只能存储最近的1000条消息,较这1000条更早的消息会被覆盖,节约内存。
基于上述发明构思,本公开另一实施例还提供一种消息交互方法,该消息交互方法应用于客户端。图3是根据本公开一实施例示出的一种消息交互方法的流程图。如图3所示,该方法包括以下步骤:
步骤S31,向服务器发送读请求,所述读请求包括消息标识和直播间标识。
步骤S33,接收并显示所述服务器发送的消息集合,所述消息集合为所述服务器根据所述消息标识和目标索引表读取到的,所述目标索引表为与所述直播间标识对应的索引表。
通过上述技术方案,客户端和服务器进行消息交互时采用拉模型,即客户端通过发送包括消息标识和直播间标识的读请求主动到服务器查询并获取消息,使用该模型的情况下,能够满足大规模用户同时在线的直播场景下,用户及时、不丢失地获取到最新消息,提升直播交互体验。
可选地,在一实施方式中,所述读请求中的消息标识为所述客户端上次从所述服务器读取得到的消息集合中的最末尾消息的消息标识,步骤 S33中的消息集合为所述消息标识对应的消息的存储位置之后的第一预设数目个以内的存储位置存储的消息。所述方法还包括:接收所述服务器发送的所述消息集合中最末尾的消息的消息标识,并根据该消息标识更新所述读请求中的消息标识,以便根据该消息标识发起下一次读请求。
通过上述技术方案,对于一直播间的消息,客户端根据上次从所述服务器读取得到的消息集合中的最新消息(所述消息集合中最末尾的消息)的消息标识发起读请求,从服务器获取该最新消息之后的(比该最新消息还新的)第一预设数目个消息的消息集合,及获取该消息集合中最新消息的消息标识,在下次读请求时即可利用该消息集合中最新消息的消息标识发起读请求,以此重复执行,从而可以不重复、不丢失地主动从服务器获取该直播间更新的消息。
可选地,在一实施方式中,所述读请求中的消息标识为空,步骤S33中的消息集合为所述目标索引表中最末尾的消息标识对应的消息的存储位置及其之前第二预设数目个以内的存储位置存储的消息。所述方法还包括:接收所述服务器发送的所述消息集合中最末尾的消息的消息标识,并根据该消息标识更新所述读请求中的消息标识,以便根据该消息标识发起下一次读请求。
通过上述技术方案,对于一直播间的消息,客户端第一次进入该直播间时,客户端发起消息标识为空的读请求,从服务器获取该直播间已有消息中最新消息(所述目标索引表中最末尾的消息标识对应的消息)及该最新消息之前的第二预设数目个以内的消息构成的消息集合,及获取该直播间已有消息中最新消息的消息标识,在下次读请求时即可利用该直播间已有消息中最新消息的消息标识发起读请求,以此重复执行。因此,上述技术方案实现了客户端第一次进入该直播间时,获取此时该直播间内最近一段时间内(最新的第二预设数目加1个以内)的消息构成的消息集合,及此时该直播间的最新消息的消息标识,并在下一次读请求时根据此时该直播间的最新消息的消息标识发起下一次读请求,从而可以不重复、不丢失地主动从服务器获取该直播间更新的消息。
可选地,在一实施方式中,所述读请求中的消息标识与所述目标索引表中任一消息标识均不同,步骤S33中的消息集合为所述目标索引表中 最末尾的消息标识对应的消息的存储位置及其之前第二预设数目个以内的存储位置存储的消息。所述方法还包括:接收所述服务器发送的所述消息集合中最末尾的消息的消息标识,并根据该消息标识更新所述读请求中的消息标识,以便根据该消息标识发起下一次读请求。
通过上述技术方案,使得客户端在发送的读请求中的消息标识错误时或在发送的读请求中的消息标识为该直播间较早以前的消息的消息标识时,可以不重复、不丢失地主动从服务器获取该直播间更新的消息。
可选地,所述方法还包括:接收所述服务器发送的请求间隔时间,所述请求间隔时间为所述客户端下次发送读请求与本次发送所述读请求的间隔时间。
通过上述技术方案,客户端发送读请求的间隔时间可以通过请求间隔时间被服务器控制。从而,在服务器感知压力过大时,如服务器CPU过高、网卡流量过大,适当增大发送给多个客户端的请求间隔时间,从而在一定程度上降低客户端请求的并发数,由于对于直播场景下,消息量是很大的,请求间隔时间稍微长一些用户可能感知不到,不会影响用户体验,同时保护了系统运行的稳定。另外,当服务器感知压力较小或不变时,可以适当减小或不改变发送给客户端的请求间隔时间。
需要说明的是,所属本领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述应用于客户端的信息交互方法中的步骤可以参考上述描述应用于服务器的信息交互方法中的对应步骤,在此不再赘述。
基于上述发明构思,本公开另一实施例还提供一种消息交互装置,用于实施应用于服务器的消息交互方法的步骤。该消息交互装置可以通过软件、硬件或者两者相结合的方式实现服务器的部分或全部。如图4所示,所述消息交互装置包括:
读请求接收模块11,用于接收客户端发送的读请求,所述读请求包括消息标识和直播间标识。
目标索引表获取模块13,用于根据所述直播间标识获取目标索引表,所述目标索引表为与所述直播间标识对应的索引表。
消息集合读取模块15,用于根据所述消息标识和所述目标索引表,读取一消息集合。
消息集合发送模块17,用于将所述消息集合发送至所述客户端。
通过上述技术方案,客户端和消息交互装置进行消息交互时采用拉模型,即客户端通过发送包括消息标识和直播间标识的读请求主动到消息交互装置查询并获取消息,使用该模型的情况下,能够满足大规模用户同时在线的直播场景下,用户及时、不丢失地获取到最新消息,提升直播交互体验。
可选地,在一实施方式中,所述读请求中的消息标识为所述客户端上次从所述服务器读取得到的消息集合中的最末尾消息的消息标识,消息集合读取模块15具体用于:根据所述目标索引表获取所述消息标识对应的消息的存储位置,读取在该存储位置之后的第一预设数目个以内的存储位置存储的消息,得到所述消息集合。所述消息交互装置还包括:消息标识发送模块。所述消息标识发送模块,用于将读取到的所述消息集合中最末尾的消息的消息标识发送至所述客户端,以便所述客户端根据该消息标识发起下一次读请求。
通过上述技术方案,对于一直播间的消息,客户端根据上次从所述消息交互装置读取得到的消息集合中的最新消息的消息标识发起读请求,从消息交互装置获取该最新消息之后的(比该最新消息还新的)第一预设数目个消息的消息集合,及获取该消息集合中最新消息的消息标识,在下次读请求时即可利用该消息集合中最新消息的消息标识发起读请求,以此重复执行,从而可以不重复、不丢失地主动从消息交互装置获取该直播间更新的消息。
可选地,在一实施方式中,所述读请求中的消息标识为空,消息集合读取模块15具体用于:根据所述目标索引表获取所述目标索引表中最末尾的消息标识对应的消息的存储位置,读取在该存储位置及其之前第二预设数目个以内的存储位置存储的消息,得到所述消息集合。所述消息交互装置还包括:消息标识发送模块。所述消息标识发送模块,用于将读取到的所述消息集合中最末尾的消息的消息标识发送至所述客户端,以便所述客户端根据该消息标识发起下一次读请求。
通过上述技术方案,对于一直播间的消息,客户端第一次进入该直播间时,客户端发起消息标识为空的读请求,从消息交互装置获取该直播间 已有消息中最新消息及该最新消息之前的第二预设数目个以内的消息构成的消息集合,及获取该直播间已有消息中最新消息的消息标识,在下次读请求时即可利用该直播间已有消息中最新消息的消息标识发起读请求,以此重复执行。因此,上述技术方案实现了客户端第一次进入该直播间时,获取此时该直播间内最近一段时间内(最新的第二预设数目加1个以内)的消息构成的消息集合,及此时该直播间的最新消息的消息标识,并在下一次读请求时根据此时该直播间的最新消息的消息标识发起下一次读请求,从而可以不重复、不丢失地主动从消息交互装置获取该直播间更新的消息。
可选地,在一实施方式中,所述读请求中的消息标识与所述目标索引表中任一消息标识均不同,消息集合读取模块15具体用于:根据所述目标索引表获取所述目标索引表中最末尾的消息标识对应的消息的存储位置,读取在该存储位置及其之前第二预设数目个以内的存储位置存储的消息,得到所述消息集合。所述消息交互装置还包括:消息标识发送模块。所述消息标识发送模块,用于将读取到的所述消息集合中最末尾的消息的消息标识发送至所述客户端,以便所述客户端根据该消息标识发起下一次读请求。
通过上述技术方案,使得客户端在发送的读请求中的消息标识错误时或在发送的读请求中的消息标识为该直播间较早以前的消息的消息标识时,可以不重复、不丢失地主动从消息交互装置获取该直播间更新的消息。
可选地,所述消息交互装置还包括请求间隔发送模块。所述请求间隔发送模块用于在接收到所述客户端发送的读请求后,还发送请求间隔时间至所述客户端,所述请求间隔时间为所述客户端下次发送读请求与本次发送所述读请求的间隔时间。
通过上述技术方案,消息交互装置可以通过请求间隔时间控制客户端发送读请求的间隔时间。从而,在消息交互装置感知服务器压力过大时,如服务器CPU过高、网卡流量过大,适当增大发送给多个客户端的请求间隔时间,从而在一定程度上降低客户端请求的并发数,由于对于直播场景下,消息量是很大的,请求间隔时间稍微长一些用户可能感知不到,不 会影响用户体验,同时保护了系统运行的稳定。另外,当感知服务器压力较小或不变时,可以适当减小或不改变发送给客户端的请求间隔时间。
可选地,所述消息交互装置还包括请求间隔控制模块。所述请求间隔控制模块用于在感知压力大于预设值时,增大所述请求间隔时间。
其中,消息交互装置感知压力可以通过服务器CPU、网卡流量等方式,对应地,预设值也根据感知服务器压力的方式来确定。例如,感知服务器压力是否大于预设值是通过判断服务器CPU是否大于预设值时,该预设值可以根据经验或者用户自行设定,在此不作限制。在感知服务器压力过大时,适当增大发送给客户端的请求间隔时间,从而在一定程度上降低客户端请求的并发数,由于对于直播场景下,消息量是很大的,请求间隔时间稍微长一些用户可能感知不到,不会影响用户体验,同时保护了系统运行的稳定。
可选地,所述消息交互装置还包括:
写请求接收模块,用于接收客户端发送的写请求,所述写请求包括写入的消息和直播间标识。
消息存储模块,用于根据所述直播间标识将所述消息写入目标循环链表的指针指向的元素内,所述目标循环链表为与所述直播间标识对应的循环链表,所述循环链表为包括多个元素的数组,每个所述元素用于存储一个消息,所述循环链表的指针随消息的写入顺次从指向起始元素向指向末尾元素移动,当指向所述末尾元素后下次移动又指向所述起始元素。
标识信息生成模块,用于根据接收到所述写请求的时间生成所述消息的标识信息。
目标索引表生成模块,用于将所述消息的标识信息和存储位置存储至所述目标索引表,所述存储位置指向存储所述消息的目标循环链表的具体元素。
通过上述技术方案,定义了循环链表这种数据结构,将每一直播间的消息存储于一循环链表中,并通过对应的索引表进行索引,消息读取性能较好。
可选地,在一实施方式中,所述循环链表为包括1000个元素的数组。 即,对于一直播间的消息,只能存储最近的1000条消息,较这1000条更早的消息会被覆盖,节约内存。
需要说明的是,所属本领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的装置的具体工作过程和描述,可以参考前述方法实施例中的对应过程,在此不再赘述。
基于上述发明构思,本公开另一实施例还提供一种消息交互装置,用于实施应用于客户端的消息交互方法的步骤。该消息交互装置可以通过软件、硬件或者两者相结合的方式实现客户端的部分或全部。如图5所示,所述消息交互装置包括:
读请求发送模块31,用于向服务器发送读请求,所述读请求包括消息标识和直播间标识。
消息集合接收模块33,用于接收并显示所述服务器发送的消息集合,所述消息集合为所述服务器根据所述消息标识和目标索引表读取到的,所述目标索引表为与所述直播间标识对应的索引表。
通过上述技术方案,消息交互装置和服务器进行消息交互时采用拉模型,即消息交互装置通过发送包括消息标识和直播间标识的读请求主动到服务器查询并获取消息,使用该模型的情况下,能够满足大规模用户同时在线的直播场景下,用户及时、不丢失地获取到最新消息,提升直播交互体验。
可选地,在一实施方式中,所述读请求中的消息标识为所述客户端上次从所述服务器读取得到的消息集合中的最末尾消息的消息标识,消息集合接收模块33中的消息集合为所述消息标识对应的消息的存储位置之后的第一预设数目个以内的存储位置存储的消息。所述消息交互装置还包括消息标识接收模块。所述消息标识接收模块用于接收所述服务器发送的所述消息集合中最末尾的消息的消息标识,并根据该消息标识更新所述读请求中的消息标识,以便根据该消息标识发起下一次读请求。
通过上述技术方案,对于一直播间的消息,消息交互装置根据上次从所述服务器读取得到的消息集合中的最新消息(所述消息集合中最末尾的消息)的消息标识发起读请求,从服务器获取该最新消息之后的(比该最新消息还新的)第一预设数目个消息的消息集合,及获取该消息集合中 最新消息的消息标识,在下次读请求时即可利用该消息集合中最新消息的消息标识发起读请求,以此重复执行,从而可以不重复、不丢失地主动从服务器获取该直播间更新的消息。
可选地,在一实施方式中,所述读请求中的消息标识为空,消息集合接收模块33中的消息集合为所述目标索引表中最末尾的消息标识对应的消息的存储位置及其之前第二预设数目个以内的存储位置存储的消息。所述消息交互装置还包括消息标识接收模块。所述消息标识接收模块用于接收所述服务器发送的所述消息集合中最末尾的消息的消息标识,并根据该消息标识更新所述读请求中的消息标识,以便根据该消息标识发起下一次读请求。
通过上述技术方案,对于一直播间的消息,客户端第一次进入该直播间时,消息交互装置发起消息标识为空的读请求,从服务器获取该直播间已有消息中最新消息(所述目标索引表中最末尾的消息标识对应的消息)及该最新消息之前的第二预设数目个以内的消息构成的消息集合,及获取该直播间已有消息中最新消息的消息标识,在下次读请求时即可利用该直播间已有消息中最新消息的消息标识发起读请求,以此重复执行。因此,上述技术方案实现了客户端第一次进入该直播间时,获取此时该直播间内最近一段时间内(最新的第二预设数目加1个以内)的消息构成的消息集合,及此时该直播间的最新消息的消息标识,并在下一次读请求时根据此时该直播间的最新消息的消息标识发起下一次读请求,从而可以不重复、不丢失地主动从服务器获取该直播间更新的消息。
可选地,在一实施方式中,所述读请求中的消息标识与所述目标索引表中任一消息标识均不同,消息集合接收模块33中的消息集合为所述目标索引表中最末尾的消息标识对应的消息的存储位置及其之前第二预设数目个以内的存储位置存储的消息。所述消息交互装置还包括消息标识接收模块。所述消息标识接收模块用于接收所述服务器发送的所述消息集合中最末尾的消息的消息标识,并根据该消息标识更新所述读请求中的消息标识,以便根据该消息标识发起下一次读请求。
通过上述技术方案,使得客户端在发送的读请求中的消息标识错误时或在发送的读请求中的消息标识为该直播间较早以前的消息的消息标 识时,可以不重复、不丢失地主动从服务器获取该直播间更新的消息。
可选地,所述消息交互装置还包括请求间隔接收模块。所述请求间隔接收模块,用于接收所述服务器发送的请求间隔时间,所述请求间隔时间为所述客户端下次发送读请求与本次发送所述读请求的间隔时间。
通过上述技术方案,客户端发送读请求的间隔时间可以通过请求间隔时间被服务器控制。从而,在服务器感知压力过大时,如服务器CPU过高、网卡流量过大,适当增大发送给多个客户端的请求间隔时间,从而在一定程度上降低客户端请求的并发数,由于对于直播场景下,消息量是很大的,请求间隔时间稍微长一些用户可能感知不到,不会影响用户体验,同时保护了系统运行的稳定。另外,当服务器感知压力较小或不变时,可以适当减小或不改变发送给客户端的请求间隔时间。
需要说明的是,所属本领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的装置的具体工作过程和描述,可以参考前述方法实施例中的对应过程,在此不再赘述。
本公开实施例还提供一种计算机可读介质,其上存储有计算机程序,该程序被处理装置执行时可以执行上述应用于服务器的消息交互方法或执行上述应用于客户端的消息交互方法的步骤。
下面参考图6,其示出了适于用来实现本公开实施例的电子设备600的结构示意图,该电子设备可以应用于服务器或客户端。图6示出的电子设备仅仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。
如图6所示,电子设备600可以包括处理装置(例如中央处理器、图形处理器等)601,其可以根据存储在只读存储器(ROM)602中的程序或者从存储装置608加载到随机访问存储器(RAM)603中的程序而执行各种适当的动作和处理。在RAM 603中,还存储有电子设备600操作所需的各种程序和数据。处理装置601、ROM 602以及RAM 603通过总线604彼此相连。输入/输出(I/O)接口605也连接至总线604。
通常,以下装置可以连接至I/O接口605:包括例如触摸屏、触摸板、键盘、鼠标、摄像头、麦克风、加速度计、陀螺仪等的输入装置606;包括例如液晶显示器(LCD)、扬声器、振动器等的输出装置607;包括例 如磁带、硬盘等的存储装置608;以及通信装置609。通信装置609可以允许电子设备600与其他设备进行无线或有线通信以交换数据。虽然图6示出了具有各种装置的电子设备600,但是应理解的是,并不要求实施或具备所有示出的装置。可以替代地实施或具备更多或更少的装置。
特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在非暂态计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信装置609从网络上被下载和安装,或者从存储装置608被安装,或者从ROM 602被安装。在该计算机程序被处理装置601执行时,执行本公开实施例的方法中限定的上述功能。
需要说明的是,本公开上述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、RF(射频)等等,或者上述的任意合适的组合。
在一些实施方式中,客户端、服务器可以利用诸如HTTP(HyperText  Transfer Protocol,超文本传输协议)之类的任何当前已知或未来研发的网络协议进行通信,并且可以与任意形式或介质的数字数据通信(例如,通信网络)互连。通信网络的示例包括局域网(“LAN”),广域网(“WAN”),网际网(例如,互联网)以及端对端网络(例如,ad hoc端对端网络),以及任何当前已知或未来研发的网络。
上述计算机可读介质可以是上述电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。
上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该电子设备执行时,使得该电子设备:接收客户端发送的读请求,所述读请求包括消息标识和直播间标识;根据所述直播间标识获取目标索引表,所述目标索引表为与所述直播间标识对应的索引表;根据所述消息标识和所述目标索引表,读取一消息集合;将所述消息集合发送至所述客户端。
或者,上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该电子设备执行时,使得该电子设备:向服务器发送读请求,所述读请求包括消息标识和直播间标识;接收并显示所述服务器发送的消息集合,所述消息集合为所述服务器根据所述消息标识和目标索引表读取到的,所述目标索引表为与所述直播间标识对应的索引表。
可以以一种或多种程序设计语言或其组合来编写用于执行本公开的操作的计算机程序代码,上述程序设计语言包括但不限于面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言——诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)——连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。
附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程 图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
描述于本公开实施例中所涉及到的模块可以通过软件的方式实现,也可以通过硬件的方式来实现。其中,模块的名称在某种情况下并不构成对该模块本身的限定,例如,读请求接收模块还可以被描述为“接收客户端发送的读请求的模块”。
本文中以上描述的功能可以至少部分地由一个或多个硬件逻辑部件来执行。例如,非限制性地,可以使用的示范类型的硬件逻辑部件包括:现场可编程门阵列(FPGA)、专用集成电路(ASIC)、专用标准产品(ASSP)、片上系统(SOC)、复杂可编程逻辑设备(CPLD)等等。
在本公开的上下文中,机器可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。机器可读介质可以是机器可读信号介质或机器可读储存介质。机器可读介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。机器可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或快闪存储器)、光纤、便捷式紧凑盘只读存储器(CD-ROM)、光学储存设备、磁储存设备、或上述内容的任何合适组合。
根据本公开的一个或多个实施例,示例一提供了一种消息交互方法,应用于服务器,所述服务器存储有多个索引表,每一所述索引表反映一直播间内所有消息的消息标识与该直播间内所有消息的存储位置的对应关 系,所述方法包括:接收客户端发送的读请求,所述读请求包括消息标识和直播间标识;根据所述直播间标识获取目标索引表,所述目标索引表为与所述直播间标识对应的索引表;根据所述消息标识和所述目标索引表,读取一消息集合;将所述消息集合发送至所述客户端。
根据本公开的一个或多个实施例,示例二提供了示例一的方法,所述读请求中的消息标识为所述客户端上次从所述服务器读取得到的消息集合中的最末尾消息的消息标识,所述根据所述消息标识和所述目标索引表,读取一消息集合的步骤包括:根据所述目标索引表获取所述消息标识对应的消息的存储位置,读取在该存储位置之后的第一预设数目个以内的存储位置存储的消息,得到所述消息集合;所述方法还包括:将读取到的所述消息集合中最末尾的消息的消息标识发送至所述客户端,以便所述客户端根据该消息标识发起下一次读请求。
根据本公开的一个或多个实施例,示例三提供了示例一的方法,所述读请求中的消息标识为空或所述读请求中的消息标识与所述目标索引表中任一消息标识均不同的情况下,所述根据所述消息标识和所述目标索引表,读取一消息集合的步骤包括:根据所述目标索引表获取所述目标索引表中最末尾的消息标识对应的消息的存储位置,读取在该存储位置及其之前第二预设数目个以内的存储位置存储的消息,得到所述消息集合;所述方法还包括:将读取到的所述消息集合中最末尾的消息的消息标识发送至所述客户端,以便所述客户端根据该消息标识发起下一次读请求。
根据本公开的一个或多个实施例,示例四提供了示例一至三任一项所述的方法,所述方法还包括:在接收到所述客户端发送的读请求后,还发送请求间隔时间至所述客户端,所述请求间隔时间为所述客户端下次发送读请求与本次发送所述读请求的间隔时间。
根据本公开的一个或多个实施例,示例五提供了示例四的方法,在所述发送请求间隔时间至所述客户端的步骤之前,所述方法还包括:在感知压力大于预设值时,增大所述请求间隔时间。
根据本公开的一个或多个实施例,示例六提供了示例一至三任一项所述的方法,所述方法还包括:接收客户端发送的写请求,所述写请求包括写入的消息和直播间标识;根据所述直播间标识将所述消息写入目标 循环链表的指针指向的元素内,所述目标循环链表为与所述直播间标识对应的循环链表,所述循环链表为包括多个元素的数组,每个所述元素用于存储一个消息,所述循环链表的指针随消息的写入顺次从指向起始元素向指向末尾元素移动,当指向所述末尾元素后下次移动又指向所述起始元素;根据接收到所述写请求的时间生成所述消息的标识信息;将所述消息的标识信息和存储位置存储至所述目标索引表,所述存储位置指向存储所述消息的目标循环链表的具体元素。
根据本公开的一个或多个实施例,示例七提供了一种消息交互方法,应用于客户端,所述方法包括:向服务器发送读请求,所述读请求包括消息标识和直播间标识;接收并显示所述服务器发送的消息集合,所述消息集合为所述服务器根据所述消息标识和目标索引表读取到的,所述目标索引表为与所述直播间标识对应的索引表。
根据本公开的一个或多个实施例,示例八提供了一种消息交互装置,应用于服务器,所述服务器存储有多个索引表,每一所述索引表反映一直播间内所有消息的消息标识与该直播间内所有消息的存储位置的对应关系,包括:读请求接收模块,用于接收客户端发送的读请求,所述读请求包括消息标识和直播间标识;目标索引表获取模块,用于根据所述直播间标识获取目标索引表,所述目标索引表为与所述直播间标识对应的索引表;消息集合读取模块,用于根据所述消息标识和所述目标索引表,读取一消息集合;消息集合发送模块,用于将所述消息集合发送至所述客户端。
根据本公开的一个或多个实施例,示例九提供了一种消息交互装置,应用于客户端,包括:读请求发送模块,用于向服务器发送读请求,所述读请求包括消息标识和直播间标识;消息集合接收模块,用于接收并显示所述服务器发送的消息集合,所述消息集合为所述服务器根据所述消息标识和目标索引表读取到的,所述目标索引表为与所述直播间标识对应的索引表。
根据本公开的一个或多个实施例,示例十提供了一种计算机可读介质,其上存储有计算机程序,该程序被处理装置执行时实现示例一至七中任一项所述方法的步骤。
根据本公开的一个或多个实施例,示例十一提供了一种电子设备应 用于服务器,包括:存储装置,其上存储有计算机程序;处理装置,用于执行所述存储装置中的所述计算机程序,以实现示例一至六中任一项所述方法的步骤。
根据本公开的一个或多个实施例,示例十二提供了一种电子设备应用于客户端,包括:存储装置,其上存储有计算机程序;处理装置,用于执行所述存储装置中的所述计算机程序,以实现示例七所述方法的步骤。
以上描述仅为本公开的较佳实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本公开中所涉及的公开范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离上述公开构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本公开中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。
此外,虽然采用特定次序描绘了各操作,但是这不应当理解为要求这些操作以所示出的特定次序或以顺序次序执行来执行。在一定环境下,多任务和并行处理可能是有利的。同样地,虽然在上面论述中包含了若干具体实现细节,但是这些不应当被解释为对本公开的范围的限制。在单独的实施例的上下文中描述的某些特征还可以组合地实现在单个实施例中。相反地,在单个实施例的上下文中描述的各种特征也可以单独地或以任何合适的子组合的方式实现在多个实施例中。
尽管已经采用特定于结构特征和/或方法逻辑动作的语言描述了本主题,但是应当理解所附权利要求书中所限定的主题未必局限于上面描述的特定特征或动作。相反,上面所描述的特定特征和动作仅仅是实现权利要求书的示例形式。关于上述实施例中的装置,其中各个模块执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。

Claims (12)

  1. 一种消息交互方法,其特征在于,应用于服务器,所述服务器存储有多个索引表,每一所述索引表反映一直播间内所有消息的消息标识与该直播间内所有消息的存储位置的对应关系,所述方法包括:
    接收客户端发送的读请求,所述读请求包括消息标识和直播间标识;
    根据所述直播间标识获取目标索引表,所述目标索引表为与所述直播间标识对应的索引表;
    根据所述消息标识和所述目标索引表,读取一消息集合;
    将所述消息集合发送至所述客户端。
  2. 根据权利要求1所述的方法,其特征在于,所述读请求中的消息标识为所述客户端上次从所述服务器读取得到的消息集合中的最末尾消息的消息标识,所述根据所述消息标识和所述目标索引表,读取一消息集合的步骤包括:
    根据所述目标索引表获取所述消息标识对应的消息的存储位置,读取在该存储位置之后的第一预设数目个以内的存储位置存储的消息,得到所述消息集合;
    所述方法还包括:将读取到的所述消息集合中最末尾的消息的消息标识发送至所述客户端,以便所述客户端根据该消息标识发起下一次读请求。
  3. 根据权利要求1所述的方法,其特征在于,所述读请求中的消息标识为空或所述读请求中的消息标识与所述目标索引表中任一消息标识均不同的情况下,所述根据所述消息标识和所述目标索引表,读取一消息集合的步骤包括:
    根据所述目标索引表获取所述目标索引表中最末尾的消息标识对应的消息的存储位置,读取在该存储位置及其之前第二预设数目个以内的存储位置存储的消息,得到所述消息集合;
    所述方法还包括:将读取到的所述消息集合中最末尾的消息的消息标识发送至所述客户端,以便所述客户端根据该消息标识发起下一次读请求。
  4. 根据权利要求1-3中任一项所述的方法,其特征在于,所述方法还包括:
    在接收到所述客户端发送的读请求后,还发送请求间隔时间至所述客户端,所述请求间隔时间为所述客户端下次发送读请求与本次发送所述读请求的间隔时间。
  5. 根据权利要求4所述的方法,其特征在于,在所述发送请求间隔时间至所述客户端的步骤之前,所述方法还包括:
    在感知压力大于预设值时,增大所述请求间隔时间。
  6. 根据权利要求1-3任一项所述的方法,其特征在于,所述方法还包括:
    接收客户端发送的写请求,所述写请求包括写入的消息和直播间标识;
    根据所述直播间标识将所述消息写入目标循环链表的指针指向的元素内,所述目标循环链表为与所述直播间标识对应的循环链表,所述循环链表为包括多个元素的数组,每个所述元素用于存储一个消息,所述循环链表的指针随消息的写入顺次从指向起始元素向指向末尾元素移动,当指向所述末尾元素后下次移动又指向所述起始元素;
    根据接收到所述写请求的时间生成所述消息的标识信息;
    将所述消息的标识信息和存储位置存储至所述目标索引表,所述存储位置指向存储所述消息的目标循环链表的具体元素。
  7. 一种消息交互方法,其特征在于,应用于客户端,所述方法包括:
    向服务器发送读请求,所述读请求包括消息标识和直播间标识;
    接收并显示所述服务器发送的消息集合,所述消息集合为所述服 务器根据所述消息标识和目标索引表读取到的,所述目标索引表为与所述直播间标识对应的索引表。
  8. 一种消息交互装置,其特征在于,应用于服务器,所述服务器存储有多个索引表,每一所述索引表反映一直播间内所有消息的消息标识与该直播间内所有消息的存储位置的对应关系,包括:
    读请求接收模块,用于接收客户端发送的读请求,所述读请求包括消息标识和直播间标识;
    目标索引表获取模块,用于根据所述直播间标识获取目标索引表,所述目标索引表为与所述直播间标识对应的索引表;
    消息集合读取模块,用于根据所述消息标识和所述目标索引表,读取一消息集合;
    消息集合发送模块,用于将所述消息集合发送至所述客户端。
  9. 一种消息交互装置,其特征在于,应用于客户端,包括:
    读请求发送模块,用于向服务器发送读请求,所述读请求包括消息标识和直播间标识;
    消息集合接收模块,用于接收并显示所述服务器发送的消息集合,所述消息集合为所述服务器根据所述消息标识和目标索引表读取到的,所述目标索引表为与所述直播间标识对应的索引表。
  10. 一种计算机可读介质,其上存储有计算机程序,其特征在于,该程序被处理装置执行时实现权利要求1-7中任一项所述方法的步骤。
  11. 一种电子设备,其特征在于,应用于服务器,包括:
    存储装置,其上存储有计算机程序;
    处理装置,用于执行所述存储装置中的所述计算机程序,以实现权利要求1-6中任一项所述方法的步骤。
  12. 一种电子设备,其特征在于,应用于客户端,包括:
    存储装置,其上存储有计算机程序;
    处理装置,用于执行所述存储装置中的所述计算机程序,以实现权利要求7所述方法的步骤。
PCT/CN2020/106907 2019-10-30 2020-08-04 消息交互方法、装置、可读介质及电子设备 WO2021082584A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911046890.9A CN110708237A (zh) 2019-10-30 2019-10-30 消息交互方法、装置、可读介质及电子设备
CN201911046890.9 2019-10-30

Publications (1)

Publication Number Publication Date
WO2021082584A1 true WO2021082584A1 (zh) 2021-05-06

Family

ID=69202918

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/106907 WO2021082584A1 (zh) 2019-10-30 2020-08-04 消息交互方法、装置、可读介质及电子设备

Country Status (2)

Country Link
CN (1) CN110708237A (zh)
WO (1) WO2021082584A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113259704A (zh) * 2021-05-19 2021-08-13 杭州米络星科技(集团)有限公司 直播间初始化方法、装置、设备及存储介质
CN115065721A (zh) * 2022-04-21 2022-09-16 北京达佳互联信息技术有限公司 消息处理方法、装置、电子设备及存储介质

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110708237A (zh) * 2019-10-30 2020-01-17 北京字节跳动网络技术有限公司 消息交互方法、装置、可读介质及电子设备
CN111277847B (zh) * 2020-01-21 2022-02-25 卓米私人有限公司 直播中聊天消息的展示方法、装置、服务器及系统
CN111405323B (zh) * 2020-03-12 2021-03-05 北京字节跳动网络技术有限公司 拉取消息记录的采样方法、装置、电子设备及介质
CN111444018B (zh) * 2020-03-30 2023-08-08 北京字节跳动网络技术有限公司 请求处理方法以及装置
CN111464820B (zh) * 2020-03-31 2022-05-10 北京字节跳动网络技术有限公司 拉取消息记录的采样方法、装置、电子设备及存储介质
CN112040328B (zh) * 2020-08-04 2023-03-10 北京字节跳动网络技术有限公司 数据交互方法、装置和电子设备
CN114189565B (zh) * 2020-08-31 2023-10-20 华为技术有限公司 一种头域还原系统、方法及相关设备
CN114554129B (zh) * 2020-11-25 2023-10-31 北京字节跳动网络技术有限公司 一种连麦系统、方法、装置、设备及存储介质
CN113037608B (zh) * 2021-02-23 2023-03-28 北京百度网讯科技有限公司 消息回复方法、装置、电子设备及可读存储介质
CN114124863B (zh) * 2021-09-14 2023-11-14 微梦创科网络科技(中国)有限公司 一种消息连续性识别方法、装置和系统

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105933213A (zh) * 2016-06-24 2016-09-07 腾讯科技(深圳)有限公司 一种聊天消息的处理方法、相关设备和系统
CN106604043A (zh) * 2016-12-30 2017-04-26 Ut斯达康(深圳)技术有限公司 一种互联网直播方法及直播服务器
US20170285881A1 (en) * 2016-03-31 2017-10-05 Atlassian Pty Ltd Systems and methods for providing external content in a messaging interface
CN109067910A (zh) * 2018-09-13 2018-12-21 乐蜜有限公司 一种消息拉取的方法及装置
CN109275042A (zh) * 2018-10-17 2019-01-25 武汉斗鱼网络科技有限公司 一种弹幕消息的分发方法、装置、终端和存储介质
CN109600678A (zh) * 2018-12-19 2019-04-09 北京达佳互联信息技术有限公司 信息展示方法、装置及系统、服务器、终端、存储介质
CN110708237A (zh) * 2019-10-30 2020-01-17 北京字节跳动网络技术有限公司 消息交互方法、装置、可读介质及电子设备

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160014477A1 (en) * 2014-02-11 2016-01-14 Benjamin J. Siders Systems and Methods for Synchronized Playback of Social Networking Content
CN109006678A (zh) * 2018-08-10 2018-12-18 肇庆市高新区甜慕新能源技术有限公司 一种无线监控种蛋孵化的系统

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170285881A1 (en) * 2016-03-31 2017-10-05 Atlassian Pty Ltd Systems and methods for providing external content in a messaging interface
CN105933213A (zh) * 2016-06-24 2016-09-07 腾讯科技(深圳)有限公司 一种聊天消息的处理方法、相关设备和系统
CN106604043A (zh) * 2016-12-30 2017-04-26 Ut斯达康(深圳)技术有限公司 一种互联网直播方法及直播服务器
CN109067910A (zh) * 2018-09-13 2018-12-21 乐蜜有限公司 一种消息拉取的方法及装置
CN109275042A (zh) * 2018-10-17 2019-01-25 武汉斗鱼网络科技有限公司 一种弹幕消息的分发方法、装置、终端和存储介质
CN109600678A (zh) * 2018-12-19 2019-04-09 北京达佳互联信息技术有限公司 信息展示方法、装置及系统、服务器、终端、存储介质
CN110708237A (zh) * 2019-10-30 2020-01-17 北京字节跳动网络技术有限公司 消息交互方法、装置、可读介质及电子设备

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113259704A (zh) * 2021-05-19 2021-08-13 杭州米络星科技(集团)有限公司 直播间初始化方法、装置、设备及存储介质
CN113259704B (zh) * 2021-05-19 2023-06-09 杭州米络星科技(集团)有限公司 直播间初始化方法、装置、设备及存储介质
CN115065721A (zh) * 2022-04-21 2022-09-16 北京达佳互联信息技术有限公司 消息处理方法、装置、电子设备及存储介质

Also Published As

Publication number Publication date
CN110708237A (zh) 2020-01-17

Similar Documents

Publication Publication Date Title
WO2021082584A1 (zh) 消息交互方法、装置、可读介质及电子设备
WO2020151599A1 (zh) 视频同步发布方法、装置、电子设备及可读存储介质
US11936924B2 (en) Live room setup method and apparatus, electronic device, and storage medium
EP4152757A1 (en) Video playback method and apparatus, storage medium, and electronic device
CN110909521B (zh) 在线文档信息的同步处理方法、装置及电子设备
CN113395353B (zh) 文件下载方法、装置、存储介质及电子设备
WO2021082649A1 (zh) 榜单更新方法、装置、可读介质和电子设备
EP4319135A1 (en) Image fusion method and apparatus, electronic device, and storage medium
EP4297416A1 (en) Angle-of-view switching method, apparatus and system for free angle-of-view video, and device and medium
CN112015816A (zh) 数据同步方法、装置、介质及电子设备
US20240143649A1 (en) Multimedia information processing method, apparatus, electronic device, and medium
JP2023520446A (ja) ビデオ特殊効果構成ファイルの生成方法、ビデオレンダリング方法及び装置
WO2024022403A1 (zh) 任务的处理方法、装置、设备及存储介质
CN111163336B (zh) 视频资源推送方法、装置、电子设备及计算机可读介质
CN112256733A (zh) 数据缓存方法、装置、电子设备及计算机可读存储介质
CN113521728A (zh) 云应用的实现方法、装置、电子设备和存储介质
CN111818383A (zh) 视频数据的生成方法、系统、装置、电子设备及存储介质
CN109635131B (zh) 多媒体内容榜单显示方法、推送方法,装置及存储介质
WO2024022179A1 (zh) 媒体内容的显示方法、装置、电子设备和存储介质
CN111225255B (zh) 目标视频推送播放方法、装置、电子设备及存储介质
US20230319325A1 (en) Information interaction method, apparatus and device
WO2023104007A1 (zh) 视频特效包的生成方法、装置、设备及存储介质
CN110134905B (zh) 一种页面更新显示方法、装置、设备及存储介质
CN112148744A (zh) 页面展示方法、装置、电子设备和计算机可读介质
CN112040328B (zh) 数据交互方法、装置和电子设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20880678

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20880678

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 31/08/2022)

122 Ep: pct application non-entry in european phase

Ref document number: 20880678

Country of ref document: EP

Kind code of ref document: A1