WO2019136862A1 - Live streaming microphone connection method and apparatus - Google Patents

Live streaming microphone connection method and apparatus Download PDF

Info

Publication number
WO2019136862A1
WO2019136862A1 PCT/CN2018/082506 CN2018082506W WO2019136862A1 WO 2019136862 A1 WO2019136862 A1 WO 2019136862A1 CN 2018082506 W CN2018082506 W CN 2018082506W WO 2019136862 A1 WO2019136862 A1 WO 2019136862A1
Authority
WO
WIPO (PCT)
Prior art keywords
anchor
user
anchor user
client
connection
Prior art date
Application number
PCT/CN2018/082506
Other languages
French (fr)
Chinese (zh)
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 WO2019136862A1 publication Critical patent/WO2019136862A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/239Interfacing the upstream path of the transmission network, e.g. prioritizing client content requests
    • H04N21/2393Interfacing the upstream path of the transmission network, e.g. prioritizing client content requests involving handling client requests
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/24Monitoring of processes or resources, e.g. monitoring of server load, available bandwidth, upstream requests
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/24Monitoring of processes or resources, e.g. monitoring of server load, available bandwidth, upstream requests
    • H04N21/2408Monitoring of the upstream path of the transmission network, e.g. client requests
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/25Management operations performed by the server for facilitating the content distribution or administrating data related to end-users or client devices, e.g. end-user or client device authentication, learning user preferences for recommending movies
    • H04N21/254Management at additional data server, e.g. shopping server, rights management server
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/25Management operations performed by the server for facilitating the content distribution or administrating data related to end-users or client devices, e.g. end-user or client device authentication, learning user preferences for recommending movies
    • H04N21/258Client or end-user data management, e.g. managing client capabilities, user preferences or demographics, processing of multiple end-users preferences to derive collaborative data
    • H04N21/25866Management of end-user data
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/478Supplemental services, e.g. displaying phone caller identification, shopping application
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/488Data services, e.g. news ticker
    • H04N21/4882Data services, e.g. news ticker for displaying messages, e.g. warnings, reminders

Definitions

  • the present invention relates to the field of webcasting, and in particular to a method and apparatus for live broadcast.
  • the most common form of live broadcast is that the anchor broadcasts to its own fans in their live broadcasts.
  • the more interactive live broadcast mode is that the two anchor users are connected to each other, and the two pictures of the two anchor users are put together in one window, so that the two anchor users can simultaneously watch the live broadcast of the two anchor users. Screen, two anchor users can interact.
  • the embodiment of the invention solves the technical problem that the anchor of the prior art is not highly reliable in the prior art by providing a method and a device for live broadcast.
  • an embodiment of the present invention provides a live broadcast method, which is applied to a connected server, and the method includes:
  • first anchor user and the second anchor user match successfully, establishing a connection service between the first anchor client and the second anchor client where the second anchor user is located, so that the first An anchor user enters a continuous state with the second anchor user.
  • the matching the second anchor user to the first anchor user in the connected pool of the connected pools of the connected server includes:
  • the matching the second anchor user to the first anchor user in the connected pool of the connected pools of the connected server includes:
  • the first anchor user After the querying whether there is an anchor user waiting for the connection in the connected pool, if the anchor user waiting for the connection is not present in the connected pool, the first anchor user is added to the office. Determining a candidate pool of the wheat, and recording a timestamp when the first anchor user is added to the pool of candidate pools;
  • the first anchor user and the second anchor user are successfully matched, and from the pool of candidate pools Deleting the first anchor user;
  • the method further includes:
  • connection status data that represents the connection status between the first anchor user and the second anchor user, and storing the data to the connected status established by the connected server.
  • the method further includes:
  • the method further includes:
  • the ending connection request is from the first anchor client or the second anchor client, and the ending connection request carries the user ID of the first anchor user and the User ID of the second anchor user;
  • the method further includes:
  • the first anchor client Receiving, by the first anchor client, a first heartbeat message sent according to a preset heartbeat time interval, and a second heartbeat message sent by the second anchor client according to the preset heartbeat time interval, the first heartbeat message And the second heartbeat message carries the user ID of the first anchor user and the user ID of the second anchor user;
  • an embodiment of the present invention provides a server, including:
  • a continuous request receiving unit configured to receive a random connection request from the first anchor client where the first anchor user is located
  • An anchor user matching unit configured to match the second anchor user to the first anchor user in the connected pool candidate pool established by the connected server
  • connection between the first anchor user and the second anchor client where the second anchor user is located if the first anchor user and the second anchor user match successfully.
  • the connection between the first anchor user and the second anchor user is in a continuous state.
  • the anchor user matching unit includes:
  • a querying sub-unit in the pool configured to query, in the connection of the random connection request from the first anchor client, whether there is an anchor user waiting for a connection in the connected pool;
  • Selecting a subunit configured to: if there is an anchor user waiting for the connection in the candidate pool, select an anchor user waiting for the connection from the pool of candidate pools, and determine the second anchor user;
  • a first matching subunit configured to successfully match the first anchor user and the second anchor user
  • a first deleting subunit configured to delete the second anchor user from the connected pool of candidate pools.
  • the anchor user matching unit further includes:
  • Adding a subunit configured to: after the querying the connected candidate pool, whether there is an anchor user waiting for the connection, if there is no anchor user waiting for the connection in the connected pool, the first An anchor user joins the pool of candidate pools, and records a timestamp when the first anchor user is added to the pool of candidate pools;
  • a waiting subunit configured to keep the first anchor user in the connected pool of candidate pools within a preset duration that starts with the timestamp
  • a second matching subunit configured to match the first anchor user and the second anchor user successfully if a random connection request initiated by the second anchor user is received within the preset duration Deleting the first anchor user from the connected pool of candidate pools;
  • a second deletion subunit configured to delete the first anchor user from the connected pool of candidate pools if the duration of the first anchor user remaining in the connected pool of candidate pools exceeds the preset duration Sending a matching failure message to the first anchor client.
  • the connected server further includes:
  • a success message sending unit configured to send a matching success message to the first anchor client and the second live client after the first anchor user and the second anchor user successfully match, the matching succeeds
  • the message is used to indicate that the first anchor client and the second anchor client each hide a matching waiting interface
  • a status data unit configured to acquire the connected status data that represents the connected status between the first anchor user and the second anchor user, and store the data in the connected status established by the connected server.
  • the connected server further includes:
  • De-linking the processing unit after the first anchor user is added to the connected pool, and before the first anchor user and the second anchor user are successfully matched, if the source is received Deleting the first anchor user of the first anchor client, deleting the first anchor user from the connected pool, and sending a delete success message to the first anchor client where the first anchor user is located.
  • the connected server further includes:
  • connection request unit configured to receive the end of the connection request after the establishing the connection between the first anchor client and the second anchor client where the second anchor user is located, Ending the connection request from the first anchor client or the second anchor client, the ending connection request carries the user ID of the first anchor user and the user ID of the second anchor user;
  • a data construction unit configured to construct target query data according to the user ID of the first anchor user and the user ID of the second anchor user;
  • a data query unit configured to query, in the connected session, whether the target query data exists
  • the error message sending unit is configured to return an error message to the anchor client that initiates the end of the connection request if the target query data does not exist in the connected session.
  • the connected server further includes:
  • a heartbeat message receiving unit configured to receive, after the establishing the connection between the first anchor client and the second anchor client where the second anchor user is located, from the first anchor client a first heartbeat message sent by the preset heartbeat time interval and a second heartbeat message sent by the second anchor client according to the preset heartbeat time interval, where both the first heartbeat message and the second heartbeat message are carried Having the user ID of the first anchor user and the user ID of the second anchor user;
  • a timestamp updating unit configured to update a keepalive timestamp of the first anchor user in the connected session when receiving the first heartbeat message, when receiving the second heartbeat message, Updating the keepalive time stamp of the second anchor user in the connected session;
  • a first disconnection processing unit configured to end the connection between the first anchor client and the second anchor client if the first heartbeat message is not received after the preset check duration is exceeded, and Sending an anchor loss message to the second anchor client;
  • a second disconnection processing unit configured to end the connection between the first anchor client and the second anchor client if the second heartbeat message is not received after the preset check duration is exceeded, and Sending an anchor loss message to the first anchor client.
  • an embodiment of the present invention provides a computer readable storage medium having stored thereon a computer program, the program being executed by a processor to implement the steps described in any of the possible implementations of the first aspect.
  • an embodiment of the present invention provides a computer device, including a memory, a processor, and a computer program stored on the memory and operable on the processor, where the processor implements the first aspect when executing the program A possible implementation of the steps described.
  • the embodiment of the present invention also improves the interest of the anchor, thereby greatly improving the activity of the continuous wheat, thereby enhancing the interaction between the platform anchors.
  • FIG. 1 is a schematic diagram of a network architecture of a live broadcast method according to an embodiment of the present invention
  • FIG. 2 is a schematic flowchart of a live broadcast method according to an embodiment of the present invention.
  • connection server 3 is a schematic flowchart of a connection server according to an embodiment of the present invention.
  • FIG. 4 is a schematic structural diagram of a computer readable storage medium according to an embodiment of the present disclosure.
  • FIG. 5 is a schematic structural diagram of a computer device according to an embodiment of the present invention.
  • the live broadcast method is provided in the embodiment of the present invention, and is applied to the connection server, and the connection between the connection server and the respective anchor clients is established through the communication network, and the connection server 10 can receive the initiation of each anchor client in the live broadcast process. Random random wheat request.
  • FIG. 1 shows a network architecture according to an embodiment of the present invention.
  • the network architecture includes a connected server 10, and a connected pool candidate pool 101 is established in the connected server 10, and is maintained by the connected server 10
  • the contiguous candidate pool 101 further includes a plurality of anchor clients 20, each of which has an anchor user logged in, and each of the anchor clients 20 establishes a data connection with the mai server 10, and each anchor client 20 can all initiate a random connection request to the connected server 10, and add another anchor client that does not immediately match the anchor client 20 but waits for the random connection after initiating the random connection request 101. 20.
  • the live broadcast method provided by the embodiment of the present invention applies the connected server, and includes the following steps:
  • step S101 is performed: the connected server receives the random connection request from the first anchor client where the first anchor user is located.
  • the first anchor client may initiate a random connection request. Specifically, after the first anchor client starts and the first anchor user logs in to the first anchor client, if the first anchor user clicks the random link button, the first anchor client responds to the first anchor user pair randomly. The click operation of the link button sends a random connection request to the connected server, so that the connection server receives the random connection request from the first anchor client where the first anchor user is located.
  • the first anchor user does not specifically refer to an anchor user, and in any of the anchor users in the network architecture, the first anchor client is any anchor client that the first anchor user can log in.
  • the random connection request carries a random connection message, for example, it can be named AP_RandomPhoneStart, and is displayed on the first anchor client when the first anchor user sends a random connection request to the Lianmai server. Matching the waiting interface until the first anchor client receives the canceled connection indication generated by the click operation of the first anchor user to cancel the link button, or receives the random connection initiated by the first anchor client from the connected server.
  • the response message of the request specifically, the response message of the connection server may be a matching failure message when the first anchor user fails to match the second anchor user, or may be the first anchor user matches the success of the second anchor user. Match the success message.
  • step S102 the connected server matches the second anchor user for the first anchor user in the connected pool of the candidate pool established by the connected server.
  • the connected server establishes and maintains a pool of candidate pools, for example, may be named RandomPhonePool, and there is an anchor user waiting for the connection in the candidate pool.
  • the second anchor user does not specifically refer to one of the anchor users, but the random connection server randomly matches the candidate pool in the candidate pool when receiving the random connection request of the first anchor client.
  • An anchor user in this embodiment, as long as there is an anchor user waiting for the connection in the candidate pool, the first anchor user and the only one anchor user in the candidate pool that is waiting for the connection are matched. Success, so in this implementation mode, there is always only one anchor user waiting for the connection in the candidate pool or there is no anchor user waiting for the connection.
  • the second anchor user is: when the connection server receives the random connection request of the first anchor client, the connection server selects a certain condition from the anchor user waiting for the connection An anchor user is determined to be the second anchor user. In this embodiment, there may be multiple anchor users waiting for the connection in the candidate pool.
  • the following method may be used to select an anchor user for the first anchor user from the pool of candidate pools:
  • Manner 1 Select one anchor user from the one or more anchor users existing in the candidate pool, and determine that the number of consecutive wheats in the preset time period is less than the preset number of consecutive times, and determine the second anchor user.
  • Manner 2 Select one anchor user whose current viewing user quantity is greater than a preset viewing user quantity threshold from one or more anchor users existing in the contiguous candidate pool, and determine the second anchor user.
  • the third method randomly selects one anchor user in the same geographical area from one or more anchor users existing in the candidate pool, and determines to be the second anchor user.
  • Manner 4 Select one anchor user whose current user quantity is greater than the preset attention user quantity from one or more anchor users existing in the candidate pool, and determine the second anchor user.
  • step S102 in order to improve the probability of matching success of the random connection, whether the first anchor user randomly matches one anchor user in the candidate pool, or the anchor user waiting for the connection in the candidate pool Selecting an anchor user that meets certain conditions, the specific implementation process of step S102 may include the following steps:
  • step S1021 is performed: when the connected server receives the random connection request from the first anchor client, the connection server queries whether there is an anchor user waiting for the connection in the candidate pool, if the existing candidate pool exists Waiting for the anchor user of the connection, the connection server sequentially performs steps S1022 to S1024. If there is no anchor user waiting for the connection in the candidate pool, the connection server sequentially performs steps S1022' to S1024'.
  • connection server when the connection server receives the random connection request of the first anchor client, the connection server queries the local maintenance candidate pool.
  • steps S1022 to S1024 is specifically as follows:
  • the connected server selects an anchor user that is waiting for continuous connection from the pool of candidate pools as the second anchor user;
  • step S1023 the connected server successfully matches the first anchor user and the second anchor user;
  • step S1024 the connected server deletes the second anchor user from the connected pool.
  • steps S1022' to S1024' is specifically as follows:
  • Step S1022' is performed: the first anchor user is added to the connected pool, and the timestamp when the first anchor user is added to the connected pool is recorded.
  • the query result of S1021 is that there is no anchor user waiting for the connection in the candidate pool, it indicates that the candidate pool is empty, indicating that none of the current candidate users in the candidate pool is waiting for the connection.
  • the first anchor user that initiates the random connection request is added to the candidate pool, and the timestamp when the first anchor user joins the candidate pool is recorded. For example, it may be named RandomWaitTimestamp.
  • step S1023' the connected server maintains the first anchor user in the pool of candidate pools within a preset duration of time starting from the time stamp.
  • the preset duration can be set according to actual needs, for example, it can be set to 28 seconds, or 28 seconds, or 30 seconds or other similar values.
  • step S1024′ is performed: if the random connection request initiated by the second anchor user is received within the preset duration, the first anchor user is successfully matched with the second anchor user, and the first candidate is deleted from the connected pool. If the duration of the first anchor user is kept in the pool of the candidate pool, the first anchor user is deleted from the pool of candidate pools, and the matching failure message is sent to the first anchor client.
  • the duration of the first anchor user remaining in the candidate pool may exceed the preset duration.
  • the connected server polls the candidate pool of the connected wheat every 1 second through the timer, and checks the timestamp and the current time of the first anchor user to join the candidate pool in each polling. If the check result is that the time difference between the current time and the timestamp is greater than the preset duration, it indicates that the duration of the first anchor user staying in the candidate pool has exceeded the preset duration, and then the connection server is the first anchor user.
  • the candidate pool is deleted and the matching timeout message is sent to the first anchor client where the first anchor user is located, which can be named AP_RandomPhoneTimeout. After the first anchor client receives the matching timeout message, the matching waiting interface of the first anchor client is hidden, and the first anchor client outputs information for prompting the first anchor user to match the timeout.
  • the first anchor user and the second anchor user in the step S1023 are successfully matched, or after the first anchor user and the second anchor user in the step S1024′ are successfully matched, the first anchor user and the first anchor user are The second anchor user is successfully matched, and the following steps S1025 to S1026 are also included:
  • connection server sends a match success message to the first anchor client and the second live client, where the match success message carries the user ID (Identity) of the first anchor user and the second anchor user. User ID.
  • the matching success message is used to indicate that the first anchor client and the second anchor client each hide the matching waiting interface.
  • the matching success message may also be used to indicate that the first anchor client and the second anchor client each output prompt information for prompting the first anchor user and the second anchor user to enter the connected state.
  • connection server obtains the connection status data indicating the connection between the first anchor user and the second anchor user, and stores the data in the connection status of the connection between the first anchor user and the second anchor user.
  • the link state data is a Map data structure, that is, a dictionary or an associated data structure
  • the Map data structure is used to store data having a mapping relationship
  • the Map data structure stores two sets of data: a key and a value, wherein a set of data KEY
  • the type is std::pair ⁇ int, int>, and the pair value is combined using the two user IDs of the first anchor user and the second anchor user, and the user ID is larger in the front.
  • step S103 is performed: if the first anchor user and the second anchor user match successfully, the connection server establishes a connection service between the first anchor client and the second anchor client where the second anchor user is located, The first anchor user and the second anchor user are brought into the connected state.
  • the method further includes the following steps: before the first anchor user and the second anchor user match successfully, if the cancellation is received from the first anchor client.
  • the MG request removes the first anchor user from the pool of candidate pools and sends a delete success message to the first anchor client where the first anchor user is located.
  • Step A1 After establishing a connection service between the first anchor client and the second anchor client where the second anchor user is located, the connection server receives the end connection request from the first anchor client or the second anchor client.
  • the end of the connection request carries the user ID of the first anchor user and the user ID of the second anchor user.
  • step A1 after the first anchor user and the second anchor user enter the connected state, both the first anchor user and the second anchor user can click the end button to end the connection at any time.
  • the first anchor client receives the click operation of the first anchor user to end the link button
  • the first anchor client sends a request to the connected server
  • the second anchor client receives the click operation of the second anchor user to end the link button.
  • the end of the connection request is sent to the connected server. Therefore, step A2 is performed regardless of whether the connection server receives the end of the connection request from the first anchor client or the end of the connection request from the second anchor client.
  • the instruction to display the end of the continuous button is displayed, indicating the first anchor.
  • the client and the second anchor client display the End of Link button. In this way, malicious malt can be avoided.
  • the end of the connection request carries the end of the connection message AP_RandomPhoneOver
  • the end of the continuous connection message carries the user ID of the first anchor user and the user ID of the second anchor user.
  • Step A2 If the connected server receives the end of the connection request, the connected server constructs the target query data according to the user ID of the first anchor user and the user ID of the second anchor user.
  • the target query data is the KEY data in the Map data structure, and the type of the KEY data is specifically std::pair ⁇ int, int>, which is the same as the type of the KEY data of the connected state data in the connected session.
  • the target query data includes the user ID of the first anchor user and the user ID of the second anchor user.
  • step A3 the connection server queries whether there is target query data in the connection session; if there is target query data in the connection session, step A4 is performed, and if there is no target query data in the connection session, step A5 is performed.
  • Step A4 is specifically: the connection server terminates the connection between the first anchor client and the first anchor client, and deletes the connection between the first anchor user and the second anchor user. And connecting the wheat status data to the first anchor client and the second anchor client to send a connection notification message;
  • Step A5 is specifically as follows: the connection server returns an error message to the anchor client that initiates the connection request.
  • the anchor client that initiates the end of the connection request may be the first anchor client or the second anchor client.
  • any one of the anchor users in the continuous wheat state can end the continuous wheat as needed, thereby improving the flexibility of the continuous wheat.
  • Step B1 The first heartbeat message sent by the first anchor client according to the preset heartbeat interval and the second heartbeat message sent by the second anchor client according to the preset heartbeat interval, the first heartbeat message and the first The two heartbeat messages carry the user ID of the first anchor user and the user ID of the second anchor user.
  • the keepalive timestamp of the first anchor user is updated in the connected session
  • the second heartbeat message is received, the keepalive timestamp of the second anchor user is updated in the connected session.
  • the preset heartbeat interval is set according to actual requirements.
  • the preset heartbeat interval can be set to any one of 1 to 10 seconds, and the preset heartbeat interval is 5 seconds.
  • the first anchor client sends a first heartbeat message to the connected server of the connected server every 5 seconds. It can be named as AP_RandomPhoneHeartbeat, and the first heartbeat message carries the user ID of the first anchor user and the user ID of the second anchor user.
  • the connected server of the connected server updates the keepalive time stamp of the first anchor user in the connected session.
  • the second anchor client sends a second heartbeat message to the connected server of the connected server every 5 seconds, which can be named AP_RandomPhoneHeartbeat, and the second heartbeat message carries the user ID and the first anchor of the second anchor user. User's user ID.
  • the connected service of the connected server updates the keepalive time stamp of the second anchor user in the connected session.
  • Step B2 The connection server checks whether the first heartbeat message is received according to the preset check interval, and checks whether the second heartbeat message is received according to the preset check interval. If the first heartbeat is not received after the preset check duration is exceeded, If the message does not receive the second heartbeat message, the process proceeds to step B3.
  • the preset check interval and the preset check duration can be set according to actual requirements.
  • the preset check interval can be set to any value of 1-3 seconds, and the preset check duration can be set to any of 10-15.
  • a value For example, if the preset check interval is set to 1 second, the server will check the keepalive time stamp of all the anchor users in the connected state every 1 second through the timer, including the first The keepalive timestamp of the anchor user in the connected session and the keepalive timestamp of the second anchor user in the connected session. If the anchor client does not receive the heartbeat message for more than 15 seconds, the corresponding anchor user is considered to be disconnected. .
  • Step B3 The connection server ends the connection service between the first anchor client and the second anchor client, and sends an anchor loss message to the second anchor client.
  • Step B4 The connection server ends the connection service between the first anchor client and the second anchor client, and sends an anchor loss message to the first anchor client.
  • the live broadcast method provides an interaction embodiment based on the anchor client A, the anchor client B, and the connected server.
  • the anchor client A has the anchor user X and the anchor client.
  • the host user Y is logged in on B to understand the present invention:
  • Anchor client A The anchor user X starts the anchor client A and logs in based on the user ID, clicks the random link button, then the anchor client A initiates a random connection request, and displays the matching waiting interface on the anchor client A until the anchor User X clicks the Cancel Random Link button to cancel the random connection or receive the response message from the connected server.
  • connection status data of the anchor user X and the anchor user Y is stored in the connected session, and the anchor client B and the anchor client A receive the matching success message, and then hide the matching waiting interface, prompting the anchor user Y and the anchor user X to enter.
  • the Lianmai server polls the candidate pool every 1 second, and checks the timestamp and current time of the anchor user X joining the candidate pool. If the host X waits for more than 30 seconds, the anchor user is used. X is deleted from the candidate pool and sends a matching timeout message to the anchor client A.
  • Anchor client A After receiving the timeout message, the matching match waiting interface is hidden, prompting the anchor user X to time out.
  • Anchor client A After the anchor initiates a random connection request, it can wait up to 30 seconds. Before the match is successful, the anchor user X can click the Cancel button to cancel the random connection. The anchor client A will cancel the connection request to the Lianmai server.
  • connection service user X After receiving the request to cancel the connection, the connection service user X deletes the anchor user X from the candidate pool and responds with the deletion success message.
  • the anchor client A After the anchor user X and the anchor user Y are randomly matched, the anchor user X and the anchor user Y enter the connected state, and the anchor user X can click the end button to end the link at any time.
  • the anchor client A sends a request to the connected server to terminate the connection request, and the message ending the connection request carries the user ID of the anchor user X and the user ID of the anchor user Y.
  • the anchor client B After the anchor user X and the anchor user Y are randomly matched, the anchor user X and the anchor user Y enter the connection state, and the anchor user Y can click the end button to end the connection at any time.
  • the anchor client B sends a request to the connected server, and the message ending with the connection request carries the user ID of the anchor user X and the user ID of the anchor user Y.
  • Connected Mai server Receive the end of the connection request, according to the user ID of the anchor user X and the user ID of the anchor user Y to construct the KEY, according to the KEY in the Lianmai session to query, if the constructed structure KEY is not found, the anchor The connection between the user X and the anchor user Y does not exist, and the client returns an error message. If the constructed KEY is found, the connection between the anchor user X and the anchor user Y is terminated, and the corresponding connected wheat status data is deleted from the connected pool candidate pool, and sent to the anchor client B and the anchor client A. Lian Mai ended the notification message.
  • the anchor client A After the anchor user X and the anchor user Y are randomly matched and successfully enter the connected state, the heartbeat message is sent to the connected server every 5 seconds.
  • the anchor client B After the anchor user X and the anchor user Y are randomly matched and successfully enter the connected state, the heartbeat message is sent to the connected server every 5 seconds.
  • Lianmai server Update the keepalive timestamp of each anchor user X in the connected session. At the same time, the keepalive time of all the anchor users (including the anchor user X and the anchor user Y) in the connected state is checked every 1 second. If the server is connected to the server for more than 15 seconds, the heartbeat message of the anchor client A is not received. Then, the anchor user X is considered to be disconnected. At this time, the connection between the anchor user X and the anchor user Y is ended, and the anchor client B is sent a message that the anchor user X is disconnected.
  • the anchor user Y is considered to be disconnected, and the connection between the anchor user X and the anchor user Y is terminated.
  • the anchor client A sends the message. The message that the anchor user Y is lost.
  • the anchor client A After receiving the message that the anchor user Y is disconnected, the output prompts the information that the anchor user Y is disconnected, and disconnects the connection.
  • the anchor client B after receiving the message that the anchor user X is disconnected, outputs a message indicating that the anchor user X is disconnected, and disconnects the connection.
  • an embodiment of the present invention provides a connected server, as shown in FIG. 3, including:
  • the connection request unit 201 is configured to receive a random connection request from the first anchor client where the first anchor user is located;
  • the anchor user matching unit 202 is configured to match the first anchor user to the second anchor user in the connected pool candidate pool established by the connected server;
  • the connected service enables the first anchor user to enter the connected state with the second anchor user.
  • the anchor user matching unit 202 includes:
  • a querying sub-unit in the pool configured to query, in the connection of the random connection request from the first anchor client, whether there is an anchor user waiting for a connection in the connected pool;
  • Selecting a subunit configured to: if there is an anchor user waiting for the connection in the candidate pool, select an anchor user waiting for the connection from the pool of candidate pools, and determine the second anchor user;
  • a first matching subunit configured to successfully match the first anchor user and the second anchor user
  • a first deleting subunit configured to delete the second anchor user from the connected pool of candidate pools.
  • the anchor user matching unit 202 further includes:
  • Adding a subunit configured to: after the querying the connected candidate pool, whether there is an anchor user waiting for the connection, if there is no anchor user waiting for the connection in the connected pool, the first An anchor user joins the pool of candidate pools, and records a timestamp when the first anchor user is added to the pool of candidate pools;
  • a waiting subunit configured to keep the first anchor user in the connected pool of candidate pools within a preset duration of time starting from the time stamp;
  • a second matching subunit configured to match the first anchor user and the second anchor user successfully if a random connection request initiated by the second anchor user is received within the preset duration Deleting the first anchor user from the connected pool of candidate pools;
  • a second deletion subunit configured to delete the first anchor user from the connected pool of candidate pools if the duration of the first anchor user remaining in the connected pool of candidate pools exceeds the preset duration Sending a matching failure message to the first anchor client.
  • the connected server further includes:
  • a success message sending unit configured to send a matching success message to the first anchor client and the second live client after the first anchor user and the second anchor user successfully match, the matching succeeds
  • the message is used to indicate that the first anchor client and the second anchor client each hide a matching waiting interface
  • a status data unit configured to acquire the connected status data that represents the connected status between the first anchor user and the second anchor user, and store the data in the connected status established by the connected server.
  • the connected server further includes:
  • De-linking the processing unit after the first anchor user is added to the connected pool, and before the first anchor user and the second anchor user are successfully matched, if the source is received Deleting the first anchor user of the first anchor client, deleting the first anchor user from the connected pool, and sending a delete success message to the first anchor client where the first anchor user is located.
  • the connected server further includes:
  • connection request unit configured to receive the end of the connection request after the establishing the connection between the first anchor client and the second anchor client where the second anchor user is located, Ending the connection request from the first anchor client or the second anchor client, the ending connection request carries the user ID of the first anchor user and the user ID of the second anchor user:
  • a data construction unit configured to construct target query data according to the user ID of the first anchor user and the user ID of the second anchor user;
  • a data query unit configured to query, in the connected session, whether the target query data exists
  • the error message sending unit is configured to return an error message to the anchor client that initiates the end of the connection request if the target query data does not exist in the connected session.
  • the connected server further includes:
  • a heartbeat message receiving unit configured to receive, after the establishing the connection between the first anchor client and the second anchor client where the second anchor user is located, from the first anchor client a first heartbeat message sent by the preset heartbeat time interval and a second heartbeat message sent by the second anchor client according to the preset heartbeat time interval, where both the first heartbeat message and the second heartbeat message are carried Having the user ID of the first anchor user and the user ID of the second anchor user;
  • a timestamp updating unit configured to update a keepalive timestamp of the first anchor user in the connected session when receiving the first heartbeat message, when receiving the second heartbeat message, Updating the keepalive time stamp of the second anchor user in the connected session;
  • a first disconnection processing unit configured to end the connection between the first anchor client and the second anchor client if the first heartbeat message is not received after the preset check duration is exceeded, and Sending an anchor loss message to the second anchor client;
  • a second disconnection processing unit configured to end the connection between the first anchor client and the second anchor client if the second heartbeat message is not received after the preset check duration is exceeded, and Sending an anchor loss message to the first anchor client.
  • an embodiment of the present invention provides a computer readable storage medium 401.
  • a computer program 402 is stored thereon, and the program 402 is implemented by the processor to implement the foregoing live broadcast method. The steps described in any of the embodiments.
  • an embodiment of the present invention provides a computer device 500, including a memory 510, a processor 530, and a computer program 520 stored on the memory 510 and operable on the processor 530, as shown in FIG.
  • the processor 530 executes the program 520, the steps described in any one of the foregoing embodiments of the live broadcast method are implemented.
  • the server, the storage medium, and the computer device are the same as those used in the embodiments of the present invention. Therefore, those skilled in the art can understand the server based on the live broadcast method described in the embodiment of the present invention.
  • the specific embodiments of the storage medium and the computer device, and various changes thereof, are not described in detail herein for how the server, the storage medium, and the computer device implement the live broadcast method in the embodiment of the present invention.
  • the server, the storage medium, and the computer device used by the person skilled in the art to implement the live broadcast method in the embodiment of the present invention are all within the scope of the present invention.
  • the embodiment of the present invention also improves the interest of the anchor, thereby greatly improving the activity of the continuous wheat, thereby enhancing the interaction between the platform anchors.
  • embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
  • computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Databases & Information Systems (AREA)
  • Computer Graphics (AREA)
  • Information Transfer Between Computers (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The present invention is applied to the field of network live streaming. Disclosed in the present invention are a live streaming microphone connection method and apparatus. The method comprises: receiving a random microphone connection request from a first streamer client where a first streamer user is located; matching a second streamer user with the first streamer user in a microphone connection candidate pool built by a microphone connection server; if the first streamer user is successfully matched with the second streamer user, establishing a microphone connection service between the first streamer client and a second streamer client where the second streamer user is located, thereby allowing the first streamer user and the second streamer user to enter a microphone connection state. According to the present invention, interestingness and playability of microphone connection of streamers are improved.

Description

一种直播连麦方法及装置Method and device for broadcasting live wheat 技术领域Technical field
本发明涉及网络直播领域,尤其涉及一种直播连麦方法及装置。The present invention relates to the field of webcasting, and in particular to a method and apparatus for live broadcast.
背景技术Background technique
现在视频直播行业正处于互联网风口,目前直播最常见的形式是主播在自己直播间面向自己的粉丝进行直播。更具互动性的直播方式是,两个主播用户之间进行连麦,把两个主播用户的双方画面拼在一个窗口,让两个主播用户的观看用户可以同时看到两个主播用户的直播画面,两个主播用户可以进行互动。Now the video live broadcast industry is in the air of the Internet. The most common form of live broadcast is that the anchor broadcasts to its own fans in their live broadcasts. The more interactive live broadcast mode is that the two anchor users are connected to each other, and the two pictures of the two anchor users are put together in one window, so that the two anchor users can simultaneously watch the live broadcast of the two anchor users. Screen, two anchor users can interact.
就目前的主播连麦统计数据来看,一些主播用户由于人气不高,连麦对象太少,连麦时存在局限性,因此,这部分主播的连麦成功性不高,而一些人气较高的主播会存在连麦排队,可见,现有技术中主播连麦可靠性不高。According to the statistics of the current anchors, some anchor users are not popular, and there are too few wheat objects. Even the wheat has limitations. Therefore, the success of this part of the anchor is not high, and some people are more popular. The anchor will exist in the line of the wheat line. It can be seen that the reliability of the anchor in the prior art is not high.
发明内容Summary of the invention
本发明实施例通过提供一种直播连麦方法及装置,解决了现有技术中主播连麦可靠性不高的技术问题。The embodiment of the invention solves the technical problem that the anchor of the prior art is not highly reliable in the prior art by providing a method and a device for live broadcast.
第一方面,本发明实施例提供一种直播连麦方法,应用于连麦服务器,所述方法包括:In a first aspect, an embodiment of the present invention provides a live broadcast method, which is applied to a connected server, and the method includes:
接收来自于第一主播用户所在的第一主播客户端的随机连麦请求;Receiving a random connection request from the first anchor client where the first anchor user is located;
在所述连麦服务器所建立的连麦候选池中为所述第一主播用户匹配第二主播用户;Matching the first anchor user to the second anchor user in the connected pool candidate pool established by the connected server;
如果所述第一主播用户与所述第二主播用户匹配成功,建立所述第一主播客户端与所述第二主播用户所在的第二主播客户端之间的连麦服务,使得所述第一主播用户与所述第二主播用户之间进入连麦状态。If the first anchor user and the second anchor user match successfully, establishing a connection service between the first anchor client and the second anchor client where the second anchor user is located, so that the first An anchor user enters a continuous state with the second anchor user.
可选的,所述在所述连麦服务器所建立的连麦候选池中为所述第一主播用户匹配第二主播用户,包括:Optionally, the matching the second anchor user to the first anchor user in the connected pool of the connected pools of the connected server includes:
在接收到来自所述第一主播客户端的所述随机连麦请求时,查询所述连麦候选池中是否存在正在等待连麦的主播用户;When receiving the random connection request from the first anchor client, querying whether there is an anchor user waiting for the connection in the connected pool;
如果所述连麦候选池中存在正在等待连麦的主播用户,从所述连麦候选池中选择一个正在等待连麦的主播用户,确定为所述第二主播用户;And if there is an anchor user waiting for the connection in the candidate pool, selecting an anchor user waiting for the connection from the pool of candidate pools, and determining to be the second anchor user;
将所述第一主播用户和所述第二主播用户匹配成功;Matching the first anchor user and the second anchor user successfully;
从所述连麦候选池中删除所述第二主播用户。And deleting the second anchor user from the connected pool of candidate pools.
可选的,所述在所述连麦服务器所建立的连麦候选池中为所述第一主播用户匹配第二主播用户,还包括:Optionally, the matching the second anchor user to the first anchor user in the connected pool of the connected pools of the connected server includes:
在所述查询所述连麦候选池中是否存在正在等待连麦的主播用户之后,如果所述连麦候选池中不存在正在等待连麦的主播用户,将所述第一主播用户加入至所述连麦候选池,并记录所述第一主播用户被加入所述连麦候选池时的时间戳;After the querying whether there is an anchor user waiting for the connection in the connected pool, if the anchor user waiting for the connection is not present in the connected pool, the first anchor user is added to the office. Determining a candidate pool of the wheat, and recording a timestamp when the first anchor user is added to the pool of candidate pools;
将所述第一主播用户在以所述时间戳为起始时刻的预设时长内保持在所述连麦候选池中;And maintaining the first anchor user in the connected pool of candidate pools within a preset duration that starts with the time stamp;
如果在所述预设时长内接收到来自所述第二主播用户发起的随机连麦请求,将所述第一主播用户与所述第二主播用户匹配成功,并且从所述连麦候选池中删除所述第一主播用户;If the random connection request initiated by the second anchor user is received within the preset duration, the first anchor user and the second anchor user are successfully matched, and from the pool of candidate pools Deleting the first anchor user;
如果所述第一主播用户保持在所述连麦候选池中的时长超过所述预设时长,从所述连麦候选池中删除所述第一主播用户,并且向所述第一主播客户端下发匹配失败消息。If the duration of the first anchor user remaining in the connected pool candidate pool exceeds the preset duration, deleting the first anchor user from the connected pool candidate pool, and to the first anchor client A matching failure message is sent.
可选的,在所述第一主播用户与所述第二主播用户匹配成功之后,所述方法还包括:Optionally, after the first anchor user and the second anchor user are successfully matched, the method further includes:
向所述第一主播客户端和所述第二直播客户端发送匹配成功消息,所述匹配成功消息用于指示所述第一主播客户端和所述第二主播客户端各自隐藏匹配等待界面;Sending a matching success message to the first anchor client and the second live client, where the matching success message is used to indicate that the first anchor client and the second anchor client each hide a matching waiting interface;
获取表征所述第一主播用户与所述第二主播用户之间连麦状态的连麦状态数据,存储至所述连麦服务器所建立的连麦会话中。Obtaining the connection status data that represents the connection status between the first anchor user and the second anchor user, and storing the data to the connected status established by the connected server.
可选的,在将所述第一主播用户加入至所述连麦候选池之后,并且在所述第一主播用户与所述第二主播用户匹配成功之前,所述方法还包括:Optionally, after the first anchor user is added to the connected pool, and before the first anchor user and the second anchor user are successfully matched, the method further includes:
如果接收到来自所述第一主播客户端的取消连麦请求,从所述连麦候选池中删除所述第一主播用户,并且向所述第一主播用户所在的所述第一主播客户端发送删除成功消息。And deleting the first anchor user from the connected pool of candidate pools, and sending the first anchor user to the first anchor client where the first anchor user is located, if receiving the canceled connection request from the first anchor client Delete the success message.
可选的,在所述建立所述第一主播客户端与所述第二主播用户所在的第二主播客户端之间的连麦服务之后,所述方法还包括:Optionally, after the establishing the connection between the first anchor client and the second anchor client where the second anchor user is located, the method further includes:
接收结束连麦请求,所述结束连麦请求来自所述第一主播客户端或者所述第二主播客户端,所述结束连麦请求中携带有所述第一主播用户的用户ID和所述第二主播用户的用户ID;Receiving a connection request, the ending connection request is from the first anchor client or the second anchor client, and the ending connection request carries the user ID of the first anchor user and the User ID of the second anchor user;
根据所述第一主播用户的用户ID和所述第二主播用户的用户ID构建目标查询数据;Constructing target query data according to the user ID of the first anchor user and the user ID of the second anchor user;
在所述连麦会话中进行查询是否存在所述目标查询数据;Querying whether there is the target query data in the connected session;
如果所述连麦会话中存在所述目标查询数据,结束所述第一主播客户端与所述第一主播客户端之间的连麦服务,并且从所述连麦会话中删除表征所述第一主播用户与所述第二主播用户之间连麦状态的连麦状态数据,还向所述第一主播客户端和所述第二主播客户端发送连麦结束通知消息;If the target query data exists in the connected session, ending the connection service between the first anchor client and the first anchor client, and deleting the representation from the connected session And transmitting, to the first anchor client and the second anchor client, a connection notification message to the first anchor client and the second anchor client;
如果所述连麦会话中不存在所述目标查询数据,向发起所述结束连麦请求的主播客户端返回错误消息。If the target query data does not exist in the connected session, an error message is returned to the anchor client that initiates the end of the connection request.
可选的,在所述建立所述第一主播客户端与所述第二主播用户所在的第二主播客户端之间的连麦服务之后,所述方法还包括:Optionally, after the establishing the connection between the first anchor client and the second anchor client where the second anchor user is located, the method further includes:
接收来自所述第一主播客户端按照预设心跳时间间隔发送的第一心跳消息和所述第二主播客户端按照所述预设心跳时间间隔发送的第二心跳消息,所述第一心跳消息和所述第二心跳消息中均携带有所述第一主播用户的用户ID和所述第二主播用户的用户ID;Receiving, by the first anchor client, a first heartbeat message sent according to a preset heartbeat time interval, and a second heartbeat message sent by the second anchor client according to the preset heartbeat time interval, the first heartbeat message And the second heartbeat message carries the user ID of the first anchor user and the user ID of the second anchor user;
在接收到所述第一心跳消息时,在所述连麦会话中更新所述第一主播用户的保活时间戳,在接收到所述第二心跳消息时,在所述连麦会话中更新所述第二主播用户的保活时间戳;Updating the keepalive timestamp of the first anchor user in the connected session, and updating in the connected session when receiving the second heartbeat message when receiving the first heartbeat message The keepalive time stamp of the second anchor user;
如果超过预设检查时长没有接收到所述第一心跳消息,则结束所述第一主播客户端与所述第二主播客户端之间的连麦服务,并且向所述第二主播客户端发送主播失连消息;If the first heartbeat message is not received after the preset check duration is exceeded, ending the connection service between the first anchor client and the second anchor client, and sending the connection to the second anchor client The anchor loses the message;
如果超过预设检查时长没有接收到所述第二心跳消息,则结束所述第一主播客户端与所述第二主播客户端之间的连麦服务,并且向所述第一主播客户端发送主播失连消息。If the second heartbeat message is not received after the preset check duration is exceeded, ending the connection service between the first anchor client and the second anchor client, and sending the connection to the first anchor client The anchor lost the message.
第二方面,本发明实施例提供一种连麦服务器,包括:In a second aspect, an embodiment of the present invention provides a server, including:
连麦请求接收单元,用于接收来自于第一主播用户所在的第一主播客户端的随机连麦请求;a continuous request receiving unit, configured to receive a random connection request from the first anchor client where the first anchor user is located;
主播用户匹配单元,用于在所述连麦服务器所建立的连麦候选池中为所述第一主播用户匹配第二主播用户;An anchor user matching unit, configured to match the second anchor user to the first anchor user in the connected pool candidate pool established by the connected server;
连麦服务建立单元,用于如果所述第一主播用户与所述第二主播用户匹配成功,建立所述第一主播客户端与所述第二主播用户所在的第二主播客户端之间的连麦服务,使得所述第一主播用户与所述第二主播用户之间进入连麦状态。a connection between the first anchor user and the second anchor client where the second anchor user is located, if the first anchor user and the second anchor user match successfully. The connection between the first anchor user and the second anchor user is in a continuous state.
可选的,所述主播用户匹配单元,包括:Optionally, the anchor user matching unit includes:
池中查询子单元,用于在接收到来自所述第一主播客户端的所述随机连麦请求时,查询所述连麦候选池中是否存在正在等待连麦的主播用户;a querying sub-unit in the pool, configured to query, in the connection of the random connection request from the first anchor client, whether there is an anchor user waiting for a connection in the connected pool;
选择子单元,用于如果所述连麦候选池中存在正在等待连麦的主播用户,从所述连麦候选池中选择一个正在等待连麦的主播用户,确定为所述第二主播用户;Selecting a subunit, configured to: if there is an anchor user waiting for the connection in the candidate pool, select an anchor user waiting for the connection from the pool of candidate pools, and determine the second anchor user;
第一匹配子单元,用于将所述第一主播用户和所述第二主播用户匹配成功;a first matching subunit, configured to successfully match the first anchor user and the second anchor user;
第一删除子单元,用于从所述连麦候选池中删除所述第二主播用户。a first deleting subunit, configured to delete the second anchor user from the connected pool of candidate pools.
可选的,所述主播用户匹配单元,还包括:Optionally, the anchor user matching unit further includes:
加入子单元,用于在所述查询所述连麦候选池中是否存在正在等待连麦的主播用户之后,如果所述连麦候选池中不存在正在等待连麦的主播用户,将所述第一主播用户加入至所述连麦候选池,并记录所述第一主播用户被加入所述连麦候选池时的时间戳;Adding a subunit, configured to: after the querying the connected candidate pool, whether there is an anchor user waiting for the connection, if there is no anchor user waiting for the connection in the connected pool, the first An anchor user joins the pool of candidate pools, and records a timestamp when the first anchor user is added to the pool of candidate pools;
等待子单元,用于将所述第一主播用户在以所述时间戳为起始时刻的预设时长内保持在所述连麦候选池中;a waiting subunit, configured to keep the first anchor user in the connected pool of candidate pools within a preset duration that starts with the timestamp;
第二匹配子单元,用于如果在所述预设时长内接收到来自所述第二主播用户发起的随机连麦请求,将所述第一主播用户与所述第二主播用户匹配成功,并且从所述连麦候选池中删除所述第一主播用户;a second matching subunit, configured to match the first anchor user and the second anchor user successfully if a random connection request initiated by the second anchor user is received within the preset duration Deleting the first anchor user from the connected pool of candidate pools;
第二删除子单元,用于如果所述第一主播用户保持在所述连麦候选池中的时长超过所述预设时长,从所述连麦候选池中删除所述第一主播用户,并且向所述第一主播客户端下发匹配失败消息。a second deletion subunit, configured to delete the first anchor user from the connected pool of candidate pools if the duration of the first anchor user remaining in the connected pool of candidate pools exceeds the preset duration Sending a matching failure message to the first anchor client.
可选的,所述连麦服务器还包括:Optionally, the connected server further includes:
成功消息发送单元,用于在所述第一主播用户与所述第二主播用户匹配成功之后,向所述第一主播客户端和所述第二直播客户端发送匹配成功消息,所述匹配成功消息用于指示所述第一主播客户端和所述第二主播客户端各自隐藏匹配等待界面;a success message sending unit, configured to send a matching success message to the first anchor client and the second live client after the first anchor user and the second anchor user successfully match, the matching succeeds The message is used to indicate that the first anchor client and the second anchor client each hide a matching waiting interface;
状态数据单元,用于获取表征所述第一主播用户与所述第二主播用户之间连麦状态的连麦状态数据,存储至所述连麦服务器所建立的连麦会话中。And a status data unit, configured to acquire the connected status data that represents the connected status between the first anchor user and the second anchor user, and store the data in the connected status established by the connected server.
可选的,所述连麦服务器还包括:Optionally, the connected server further includes:
取消连麦处理单元,用于在将所述第一主播用户加入至所述连麦候选池之后,并且在所述第一主播用户与所述第二主播用户匹配成功之前,如果接收到来自所述第一主播客户端的取消连麦请求,从所述连麦候选池中删除所述第一主播用户,并且向所述第一主播用户所在的所述第一主播客户端发送删除成功消息。De-linking the processing unit, after the first anchor user is added to the connected pool, and before the first anchor user and the second anchor user are successfully matched, if the source is received Deleting the first anchor user of the first anchor client, deleting the first anchor user from the connected pool, and sending a delete success message to the first anchor client where the first anchor user is located.
可选的,所述连麦服务器还包括:Optionally, the connected server further includes:
结束连麦请求接收单元,用于在所述建立所述第一主播客户端与所述第二主播用户所在的第二主播客户端之间的连麦服务之后,接收结束连麦请求,所述结束连麦请求来自所述第一主播客户端或者所述第二主播客户端,所述结束 连麦请求中携带有所述第一主播用户的用户ID和所述第二主播用户的用户ID;Ending the connection request unit, configured to receive the end of the connection request after the establishing the connection between the first anchor client and the second anchor client where the second anchor user is located, Ending the connection request from the first anchor client or the second anchor client, the ending connection request carries the user ID of the first anchor user and the user ID of the second anchor user;
数据构建单元,用于根据所述第一主播用户的用户ID和所述第二主播用户的用户ID构建目标查询数据;a data construction unit, configured to construct target query data according to the user ID of the first anchor user and the user ID of the second anchor user;
数据查询单元,用于在所述连麦会话中进行查询是否存在所述目标查询数据;a data query unit, configured to query, in the connected session, whether the target query data exists;
结束连麦处理单元,用于如果所述连麦会话中存在所述目标查询数据,结束所述第一主播客户端与所述第一主播客户端之间的连麦服务,并且从所述连麦会话中删除表征所述第一主播用户与所述第二主播用户之间连麦状态的连麦状态数据,还向所述第一主播客户端和所述第二主播客户端发送连麦结束通知消息;Ending the continuous processing unit, if the target query data exists in the connected session, ending the connection service between the first anchor client and the first anchor client, and from the connection Deleting the connection status data indicating the connection between the first anchor user and the second anchor user, and sending the connection to the first anchor client and the second anchor client Notification message
错误消息发送单元,用于如果所述连麦会话中不存在所述目标查询数据,向发起所述结束连麦请求的主播客户端返回错误消息。The error message sending unit is configured to return an error message to the anchor client that initiates the end of the connection request if the target query data does not exist in the connected session.
可选的,所述连麦服务器还包括:Optionally, the connected server further includes:
心跳消息接收单元,用于在所述建立所述第一主播客户端与所述第二主播用户所在的第二主播客户端之间的连麦服务之后,接收来自所述第一主播客户端按照预设心跳时间间隔发送的第一心跳消息和所述第二主播客户端按照所述预设心跳时间间隔发送的第二心跳消息,所述第一心跳消息和所述第二心跳消息中均携带有所述第一主播用户的用户ID和所述第二主播用户的用户ID;a heartbeat message receiving unit, configured to receive, after the establishing the connection between the first anchor client and the second anchor client where the second anchor user is located, from the first anchor client a first heartbeat message sent by the preset heartbeat time interval and a second heartbeat message sent by the second anchor client according to the preset heartbeat time interval, where both the first heartbeat message and the second heartbeat message are carried Having the user ID of the first anchor user and the user ID of the second anchor user;
时间戳更新单元,用于在接收到所述第一心跳消息时,在所述连麦会话中更新所述第一主播用户的保活时间戳,在接收到所述第二心跳消息时,在所述连麦会话中更新所述第二主播用户的保活时间戳;a timestamp updating unit, configured to update a keepalive timestamp of the first anchor user in the connected session when receiving the first heartbeat message, when receiving the second heartbeat message, Updating the keepalive time stamp of the second anchor user in the connected session;
第一失连处理单元,用于如果超过预设检查时长没有接收到所述第一心跳消息,则结束所述第一主播客户端与所述第二主播客户端之间的连麦服务,并且向所述第二主播客户端发送主播失连消息;a first disconnection processing unit, configured to end the connection between the first anchor client and the second anchor client if the first heartbeat message is not received after the preset check duration is exceeded, and Sending an anchor loss message to the second anchor client;
第二失连处理单元,用于如果超过预设检查时长没有接收到所述第二心跳消息,则结束所述第一主播客户端与所述第二主播客户端之间的连麦服务,并且向所述第一主播客户端发送主播失连消息。a second disconnection processing unit, configured to end the connection between the first anchor client and the second anchor client if the second heartbeat message is not received after the preset check duration is exceeded, and Sending an anchor loss message to the first anchor client.
第三方面,本发明实施例提供一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现第一方面的任一种可能的实现方式所述的步骤。In a third aspect, an embodiment of the present invention provides a computer readable storage medium having stored thereon a computer program, the program being executed by a processor to implement the steps described in any of the possible implementations of the first aspect.
第四方面,本发明实施例提供一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现第一方面的任一种可能的实现方式所述的步骤。In a fourth aspect, an embodiment of the present invention provides a computer device, including a memory, a processor, and a computer program stored on the memory and operable on the processor, where the processor implements the first aspect when executing the program A possible implementation of the steps described.
本发明实施例中提供的一个或多个技术方案,至少具有如下技术效果或优点:One or more technical solutions provided in the embodiments of the present invention have at least the following technical effects or advantages:
接收来自于第一主播用户所在的第一主播客户端的随机连麦请求;在连麦服务器所建立的连麦候选池中为第一主播用户匹配第二主播用户;如果第一主 播用户与第二主播用户匹配成功,建立第一主播客户端与第二主播用户所在的第二主播客户端之间的连麦服务,使得第一主播用户与第二主播用户之间进入连麦状态。因此,只要有两个发起随机连麦请求的主播客户端,就能够连麦成功,不需要向某个指定的主播用户发起连麦请求,提高了人气不高的主播用户所在的主播客户端的连麦成功率,缓解了人气较高的主播用户所在的主播客户端的负载压力,因此,平衡了不同级别的主播用户的主播客户端之间的连麦,进而,能够提高主播连麦的可靠性。Receiving a random connection request from the first anchor client where the first anchor user is located; matching the second anchor user to the first anchor user in the connected pool candidate pool established by the connected server; if the first anchor user and the second The anchor user is successfully matched, and the connection between the first anchor client and the second anchor client where the second anchor user is located is established, so that the first anchor user and the second anchor user enter the connected state. Therefore, as long as there are two anchor clients that initiate random random connection requests, the success of the connection can be achieved without the need to initiate a connection request to a designated anchor user, thereby improving the connection of the anchor client where the less popular anchor user is located. The success rate of the wheat eases the load pressure of the anchor client where the popular anchor user is located. Therefore, the balance between the anchor clients of different levels of the anchor users is balanced, and the reliability of the anchor network can be improved.
另外,通过本发明实施例还提升了主播趣味性,进而可以大大提升连麦活跃性,进而加强平台主播间的互动性。In addition, the embodiment of the present invention also improves the interest of the anchor, thereby greatly improving the activity of the continuous wheat, thereby enhancing the interaction between the platform anchors.
附图说明DRAWINGS
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据提供的附图获得其他的附图。In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the embodiments or the description of the prior art will be briefly described below. Obviously, the drawings in the following description are only It is an embodiment of the present invention, and those skilled in the art can obtain other drawings according to the provided drawings without any creative work.
图1为本发明实施例提供的直播连麦方法所在的网络架构的示意图;FIG. 1 is a schematic diagram of a network architecture of a live broadcast method according to an embodiment of the present invention;
图2为本发明实施例提供的直播连麦方法的流程示意图;2 is a schematic flowchart of a live broadcast method according to an embodiment of the present invention;
图3为本发明实施例提供的连麦服务器的流程示意图;3 is a schematic flowchart of a connection server according to an embodiment of the present invention;
图4为本发明实施例提供的计算机可读存储介质的结构示意图;FIG. 4 is a schematic structural diagram of a computer readable storage medium according to an embodiment of the present disclosure;
图5为本发明实施例提供的计算机设备的结构示意图。FIG. 5 is a schematic structural diagram of a computer device according to an embodiment of the present invention.
具体实施方式Detailed ways
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the drawings in the embodiments of the present invention. It is a partial embodiment of the invention, and not all of the embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
本发明实施例提供的一种直播连麦方法,应用于连麦服务器,连麦服务器与各个主播客户端之间通过通信网络建立连接,连麦服务器10可以接收各主播客户端在直播过程中发起的随机连麦请求。The live broadcast method is provided in the embodiment of the present invention, and is applied to the connection server, and the connection between the connection server and the respective anchor clients is established through the communication network, and the connection server 10 can receive the initiation of each anchor client in the live broadcast process. Random random wheat request.
参考图1所示,图1给出本发明实施例所处的网络架构,该网络架构包括连麦服务器10,在连麦服务器10中建立有连麦候选池101,并且由连麦服务器10维护连麦候选池101,还包括多个主播客户端20,每个主播客户端20 上登陆有主播用户,每个主播客户端20与连麦服务器10之间建立有数据连接,每个主播客户端20都能够向连麦服务器10发起随机连麦请求,在连麦候选池101中加入有发起随机连麦请求后没有立即匹配到主播客户端20而是在等待随机连麦的另一个主播客户端20。Referring to FIG. 1, FIG. 1 shows a network architecture according to an embodiment of the present invention. The network architecture includes a connected server 10, and a connected pool candidate pool 101 is established in the connected server 10, and is maintained by the connected server 10 The contiguous candidate pool 101 further includes a plurality of anchor clients 20, each of which has an anchor user logged in, and each of the anchor clients 20 establishes a data connection with the mai server 10, and each anchor client 20 can all initiate a random connection request to the connected server 10, and add another anchor client that does not immediately match the anchor client 20 but waits for the random connection after initiating the random connection request 101. 20.
参考图2所示,本发明实施例提供的直播连麦方法,应用连麦服务器,包括如下步骤:Referring to FIG. 2, the live broadcast method provided by the embodiment of the present invention applies the connected server, and includes the following steps:
首先,执行步骤S101:连麦服务器接收来自于第一主播用户所在的第一主播客户端的随机连麦请求。First, step S101 is performed: the connected server receives the random connection request from the first anchor client where the first anchor user is located.
在第一主播客户端启动并且第一主播用户登录至第一主播用户之后,第一主播客户端可以发起随机连麦请求。具体来讲,在第一主播客户端启动并且第一主播用户登录至第一主播客户端之后,如果第一主播用户点击随机连麦按钮,第一主播客户端会响应于第一主播用户对随机连麦按钮的点击操作而向连麦服务器发送随机连麦请求,从而连麦服务器接收到来自于第一主播用户所在的第一主播客户端的随机连麦请求。After the first anchor client starts and the first anchor user logs in to the first anchor user, the first anchor client may initiate a random connection request. Specifically, after the first anchor client starts and the first anchor user logs in to the first anchor client, if the first anchor user clicks the random link button, the first anchor client responds to the first anchor user pair randomly. The click operation of the link button sends a random connection request to the connected server, so that the connection server receives the random connection request from the first anchor client where the first anchor user is located.
需要说明的是,第一主播用户不是特指某个主播用户,而在处于该网络架构中的任一主播用户,第一主播客户端是第一主播用户可以登录的任一主播客户端。It should be noted that the first anchor user does not specifically refer to an anchor user, and in any of the anchor users in the network architecture, the first anchor client is any anchor client that the first anchor user can log in.
还需要说明的是,随机连麦请求中携带有随机连麦消息,比如,可以命名为AP_RandomPhoneStart,在第一主播用户向连麦服务器发送随机连麦请求时,会在第一主播客户端上显示匹配等待界面,直到第一主播客户端接收到第一主播用户对取消连麦按钮的点击操作所产生的取消连麦指示,或者接收到来自连麦服务器的对第一主播客户端发起的随机连麦请求的响应消息,具体的, 连麦服务器的响应消息可能是为第一主播用户匹配第二主播用户失败时的匹配失败消息、也可能是为第一主播用户匹配第二主播用户成功时的匹配成功消息。It should also be noted that the random connection request carries a random connection message, for example, it can be named AP_RandomPhoneStart, and is displayed on the first anchor client when the first anchor user sends a random connection request to the Lianmai server. Matching the waiting interface until the first anchor client receives the canceled connection indication generated by the click operation of the first anchor user to cancel the link button, or receives the random connection initiated by the first anchor client from the connected server The response message of the request, specifically, the response message of the connection server may be a matching failure message when the first anchor user fails to match the second anchor user, or may be the first anchor user matches the success of the second anchor user. Match the success message.
在步骤S101之后,接着执行步骤S102:连麦服务器在连麦服务器所建立的连麦候选池中为第一主播用户匹配第二主播用户。After step S101, step S102 is followed: the connected server matches the second anchor user for the first anchor user in the connected pool of the candidate pool established by the connected server.
需要说明的是,在执行步骤S101之间,连麦服务器建立并维护一个连麦候选池,比如,可以命名为RandomPhonePool,连麦候选池中存在的是正在等待连麦的主播用户。It should be noted that, between the execution of step S101, the connected server establishes and maintains a pool of candidate pools, for example, may be named RandomPhonePool, and there is an anchor user waiting for the connection in the candidate pool.
具体的,在一种实施方式中,第二主播用户不是特指的某一个主播用户,而是连麦服务器当接收到第一主播客户端的随机连麦请求时在连麦候选池中随机匹配的一个主播用户,在这种实施方式中,只要连麦候选池中有正在等待连麦的主播用户,就会将第一主播用户与连麦候选池中有正在等待连麦的唯一一个主播用户匹配成功,所以在这种实施方式下,连麦候选池中始终只存在一个正在等待连麦的主播用户或者不存在正在等待连麦的主播用户。Specifically, in an implementation manner, the second anchor user does not specifically refer to one of the anchor users, but the random connection server randomly matches the candidate pool in the candidate pool when receiving the random connection request of the first anchor client. An anchor user, in this embodiment, as long as there is an anchor user waiting for the connection in the candidate pool, the first anchor user and the only one anchor user in the candidate pool that is waiting for the connection are matched. Success, so in this implementation mode, there is always only one anchor user waiting for the connection in the candidate pool or there is no anchor user waiting for the connection.
具体的,在另一实施方式中,第二主播用户是:连麦服务器接收到第一主播客户端的随机连麦请求时从连麦候选池中正在等待连麦的主播用户中选择满足一定条件的一个主播用户确定为第二主播用户,在这种实施方式下,连麦候选池中可能会存在多个正在等待连麦的主播用户。Specifically, in another embodiment, the second anchor user is: when the connection server receives the random connection request of the first anchor client, the connection server selects a certain condition from the anchor user waiting for the connection An anchor user is determined to be the second anchor user. In this embodiment, there may be multiple anchor users waiting for the connection in the candidate pool.
具体来讲,可以是如下一种方式从连麦候选池中为第一主播用户选择一个主播用户:Specifically, the following method may be used to select an anchor user for the first anchor user from the pool of candidate pools:
方式一、从连麦候选池中存在的一个以上主播用户中选择预设时间段内连麦次数少于预设连麦次数阈值一个主播用户,确定为第二主播用户。Manner 1: Select one anchor user from the one or more anchor users existing in the candidate pool, and determine that the number of consecutive wheats in the preset time period is less than the preset number of consecutive times, and determine the second anchor user.
方式二、从连麦候选池中存在的一个以上主播用户中选择当前观看用户量大于预设观看用户量阈值的一个主播用户,确定为第二主播用户。Manner 2: Select one anchor user whose current viewing user quantity is greater than a preset viewing user quantity threshold from one or more anchor users existing in the contiguous candidate pool, and determine the second anchor user.
方式三、从连麦候选池中存在的一个以上主播用户中随机选择处于同一地域范围的一个主播用户,确定为第二主播用户。The third method randomly selects one anchor user in the same geographical area from one or more anchor users existing in the candidate pool, and determines to be the second anchor user.
方式四、从连麦候选池中存在的一个以上主播用户中选择当前关注用户量大于预设关注用户量的一个主播用户,确定为第二主播用户。Manner 4: Select one anchor user whose current user quantity is greater than the preset attention user quantity from one or more anchor users existing in the candidate pool, and determine the second anchor user.
在具体实施过程中,为了提高随机连麦的匹配成功概率,无论是在连麦候选池中为第一主播用户随机匹配一个主播用户,还是从连麦候选池中正在等待连麦的主播用户中选择满足一定条件的一个主播用户,步骤S102的具体实施过程均可以包括如下步骤:In the specific implementation process, in order to improve the probability of matching success of the random connection, whether the first anchor user randomly matches one anchor user in the candidate pool, or the anchor user waiting for the connection in the candidate pool Selecting an anchor user that meets certain conditions, the specific implementation process of step S102 may include the following steps:
首先,执行步骤S1021:在连麦服务器接收到来自第一主播客户端的随机连麦请求时,连麦服务器查询连麦候选池中是否存在正在等待连麦的主播用户,如果连麦候选池中存在正在等待连麦的主播用户,连麦服务器依次执行步骤S1022~S1024,如果连麦候选池中不存在正在等待连麦的主播用户,则连麦服务器依次执行步骤S1022’~S1024’。First, step S1021 is performed: when the connected server receives the random connection request from the first anchor client, the connection server queries whether there is an anchor user waiting for the connection in the candidate pool, if the existing candidate pool exists Waiting for the anchor user of the connection, the connection server sequentially performs steps S1022 to S1024. If there is no anchor user waiting for the connection in the candidate pool, the connection server sequentially performs steps S1022' to S1024'.
具体来讲,连麦服务器接收到第一主播客户端的随机连麦请求时,连麦服务器在本地维护的连麦候选池中进行查询。Specifically, when the connection server receives the random connection request of the first anchor client, the connection server queries the local maintenance candidate pool.
在具体实施过程中,步骤S1022~S1024的实施过程具体如下:In the specific implementation process, the implementation process of steps S1022 to S1024 is specifically as follows:
首先,执行步骤S1022、连麦服务器从连麦候选池中选择一个正在等待连麦的主播用户确定为第二主播用户;First, executing step S1022, the connected server selects an anchor user that is waiting for continuous connection from the pool of candidate pools as the second anchor user;
接着,执行步骤S1023、连麦服务器将第一主播用户和第二主播用户匹配成功;Then, in step S1023, the connected server successfully matches the first anchor user and the second anchor user;
接着,执行步骤S1024、连麦服务器从连麦候选池中删除第二主播用户。Next, in step S1024, the connected server deletes the second anchor user from the connected pool.
在具体实施过程中,步骤S1022’~S1024’的实施过程具体如下:In the specific implementation process, the implementation process of steps S1022' to S1024' is specifically as follows:
执行步骤S1022’:将第一主播用户加入至连麦候选池,并记录第一主播用户被加入连麦候选池时的时间戳。Step S1022' is performed: the first anchor user is added to the connected pool, and the timestamp when the first anchor user is added to the connected pool is recorded.
如果S1021的查询结果为连麦候选池中不存在正在等待连麦的主播用户,则表明连麦候选池为空,说明连麦候选池中当前没有任何一个主播用户在正在等待连麦,则把当前发起随机连麦请求的第一主播用户加入连麦候选池中,同时记录第一主播用户加入连麦候选池中时的时间戳,比如,可以命名为RandomWaitTimestamp。If the query result of S1021 is that there is no anchor user waiting for the connection in the candidate pool, it indicates that the candidate pool is empty, indicating that none of the current candidate users in the candidate pool is waiting for the connection. The first anchor user that initiates the random connection request is added to the candidate pool, and the timestamp when the first anchor user joins the candidate pool is recorded. For example, it may be named RandomWaitTimestamp.
接着,执行步骤S1023’:连麦服务器将第一主播用户在以时间戳为起始时刻的预设时长内保持在连麦候选池中。Next, step S1023' is performed: the connected server maintains the first anchor user in the pool of candidate pools within a preset duration of time starting from the time stamp.
在具体实施过程中,预设时长可以根据实际需求进行设置,比如,可以设置为28秒、或者28秒、或者30秒或者其他近似的数值。In the specific implementation process, the preset duration can be set according to actual needs, for example, it can be set to 28 seconds, or 28 seconds, or 30 seconds or other similar values.
接着,执行步骤S1024’:如果在预设时长内接收到来自第二主播用户发起的随机连麦请求,将第一主播用户与第二主播用户匹配成功,并且从连麦候选池中删除第一主播用户;如果第一主播用户保持在连麦候选池中的时长超过预设时长,从连麦候选池中删除第一主播用户,并且向第一主播客户端下发匹配失败消息。Then, step S1024′ is performed: if the random connection request initiated by the second anchor user is received within the preset duration, the first anchor user is successfully matched with the second anchor user, and the first candidate is deleted from the connected pool. If the duration of the first anchor user is kept in the pool of the candidate pool, the first anchor user is deleted from the pool of candidate pools, and the matching failure message is sent to the first anchor client.
需要说明的是,如果在预设时长内未接收到来自任何主播用户发起的随机连麦请求,则会导致第一主播用户保持在连麦候选池中的时长超过预设时长。It should be noted that if the random connection request initiated by any anchor user is not received within the preset duration, the duration of the first anchor user remaining in the candidate pool may exceed the preset duration.
具体的,在步骤S1024’中,连麦服务器通过定时器每隔1秒轮询一次连麦候选池,每次轮询时会校验第一主播用户加入连麦候选池的时间戳与当前时间,如果校验结果为当前时间与时间戳之间时间差大于预设时长,则表明第一主播用户保持在连麦候选池中的时长已经超过预设时长,则连麦服务器将第一主播用户从连麦候选池中删除,并给第一主播用户所在的第一主播客户端发送匹配超时消息,可以命名为AP_RandomPhoneTimeout。使得第一主播客户端收到匹配超时消息后,隐藏第一主播客户端的匹配等待界面,并在第一主播客户端输出用于提示第一主播用户匹配超时的信息。Specifically, in step S1024', the connected server polls the candidate pool of the connected wheat every 1 second through the timer, and checks the timestamp and the current time of the first anchor user to join the candidate pool in each polling. If the check result is that the time difference between the current time and the timestamp is greater than the preset duration, it indicates that the duration of the first anchor user staying in the candidate pool has exceeded the preset duration, and then the connection server is the first anchor user. The candidate pool is deleted and the matching timeout message is sent to the first anchor client where the first anchor user is located, which can be named AP_RandomPhoneTimeout. After the first anchor client receives the matching timeout message, the matching waiting interface of the first anchor client is hidden, and the first anchor client outputs information for prompting the first anchor user to match the timeout.
具体的,无论是在步骤S1023中的第一主播用户与第二主播用户匹配成功之后,还是在执行步骤S1024’中的第一主播用户与第二主播用户匹配成功之后,只要第一主播用户与第二主播用户匹配成功,还包括如下步骤S1025~S1026:Specifically, after the first anchor user and the second anchor user in the step S1023 are successfully matched, or after the first anchor user and the second anchor user in the step S1024′ are successfully matched, the first anchor user and the first anchor user are The second anchor user is successfully matched, and the following steps S1025 to S1026 are also included:
S1025、连麦服务器向第一主播客户端和第二直播客户端发送匹配成功消息,其中,匹配成功消息中携带有第一主播用户的用户ID(Identity,身份标识号码)和第二主播用户的用户ID。S1025: The connection server sends a match success message to the first anchor client and the second live client, where the match success message carries the user ID (Identity) of the first anchor user and the second anchor user. User ID.
需要说明的是,匹配成功消息用于指示第一主播客户端和第二主播客户端各自隐藏匹配等待界面。匹配成功消息还可以用于指示第一主播客户端和第二主播客户端各自输出用于提示第一主播用户和第二主播用户进入连麦状态的提示信息。It should be noted that the matching success message is used to indicate that the first anchor client and the second anchor client each hide the matching waiting interface. The matching success message may also be used to indicate that the first anchor client and the second anchor client each output prompt information for prompting the first anchor user and the second anchor user to enter the connected state.
S1026、连麦服务器获取表征第一主播用户与第二主播用户之间连麦状态的连麦状态数据,存储至连麦服务器所建立的连麦会话中。S1026: The connection server obtains the connection status data indicating the connection between the first anchor user and the second anchor user, and stores the data in the connection status of the connection between the first anchor user and the second anchor user.
具体的,连麦状态数据是一个Map数据结构,即字典或关联数据结构,Map数据结构用于保存具有映射关系的数据,Map数据结构中保存两组数据:key和value,其中一组数据KEY的类型是std::pair<int,int>,pair值使用第一主播用户与第二主播用户的双方用户ID进行组合,且用户ID较大的在前面。Specifically, the link state data is a Map data structure, that is, a dictionary or an associated data structure, and the Map data structure is used to store data having a mapping relationship, and the Map data structure stores two sets of data: a key and a value, wherein a set of data KEY The type is std::pair<int, int>, and the pair value is combined using the two user IDs of the first anchor user and the second anchor user, and the user ID is larger in the front.
在步骤S102之后,执行步骤S103:如果第一主播用户与第二主播用户匹配成功,连麦服务器建立第一主播客户端与第二主播用户所在的第二主播客户端之间的连麦服务,使得第一主播用户与第二主播用户进入连麦状态。After step S102, step S103 is performed: if the first anchor user and the second anchor user match successfully, the connection server establishes a connection service between the first anchor client and the second anchor client where the second anchor user is located, The first anchor user and the second anchor user are brought into the connected state.
进一步的技术方案中,为了实现在建立连麦服务之前可以随时取消连麦,还包括如下步骤:在第一主播用户与第二主播用户匹配成功之前,如果接收到来自第一主播客户端的取消连麦请求,连麦服务器从连麦候选池中删除第一主播用户,并且向第一主播用户所在的第一主播客户端发送删除成功消息。In a further technical solution, in order to cancel the connection before the establishment of the connection service, the method further includes the following steps: before the first anchor user and the second anchor user match successfully, if the cancellation is received from the first anchor client The MG request removes the first anchor user from the pool of candidate pools and sends a delete success message to the first anchor client where the first anchor user is located.
进一步的技术方案中,为了实现在建立连麦服务之后,主播用户能够随时取消连麦,还包括如下步骤:In a further technical solution, in order to realize that the anchor user can cancel the connection at any time after establishing the connection service, the following steps are also included:
步骤A1、在建立第一主播客户端与第二主播用户所在的第二主播客户端之间的连麦服务之后,连麦服务器接收来自第一主播客户端或者第二主播客户端的结束连麦请求,结束连麦请求中携带有第一主播用户的用户ID和第二主播用户的用户ID。Step A1: After establishing a connection service between the first anchor client and the second anchor client where the second anchor user is located, the connection server receives the end connection request from the first anchor client or the second anchor client. The end of the connection request carries the user ID of the first anchor user and the user ID of the second anchor user.
具体来讲,在步骤A1中,第一主播用户与第二主播用户进入连麦状态之后,第一主播用户与第二主播用户都可以点击结束连麦按钮,以此来随时结束连麦。第一主播客户端接收到第一主播用户对结束连麦按钮的点击操作时向连麦服务器发送结束连麦请求,第二主播客户端接收到第二主播用户对结束连麦按钮的点击操作时向连麦服务器发送结束连麦请求,因此,无论连麦服务器接收到来自第一主播客户端的结束连麦请求还是来自第二主播客户端的结束连麦请求,都执行步骤A2。Specifically, in step A1, after the first anchor user and the second anchor user enter the connected state, both the first anchor user and the second anchor user can click the end button to end the connection at any time. When the first anchor client receives the click operation of the first anchor user to end the link button, the first anchor client sends a request to the connected server, and the second anchor client receives the click operation of the second anchor user to end the link button. The end of the connection request is sent to the connected server. Therefore, step A2 is performed regardless of whether the connection server receives the end of the connection request from the first anchor client or the end of the connection request from the second anchor client.
在一优选的实施例方式中,在第一主播用户与第二主播用户进入连麦状态的时刻开始,达到预设连麦时长时,下发指示显示结束连麦按钮的指示,指示第一主播客户端和第二主播客户端显示结束连麦按钮。通过这种方式,能避免恶意连麦。In a preferred embodiment, when the first anchor user and the second anchor user enter the continuous wheat state, when the preset duration is reached, the instruction to display the end of the continuous button is displayed, indicating the first anchor. The client and the second anchor client display the End of Link button. In this way, malicious malt can be avoided.
具体的,结束连麦请求中携带有结束连麦消息AP_RandomPhoneOver,结束连麦消息中携带有第一主播用户的用户ID和第二主播用户的用户ID。Specifically, the end of the connection request carries the end of the connection message AP_RandomPhoneOver, and the end of the continuous connection message carries the user ID of the first anchor user and the user ID of the second anchor user.
步骤A2、如果连麦服务器接收到结束连麦请求,连麦服务器根据第一主播用户的用户ID和第二主播用户的用户ID构建目标查询数据。Step A2: If the connected server receives the end of the connection request, the connected server constructs the target query data according to the user ID of the first anchor user and the user ID of the second anchor user.
需要说明的是,目标查询数据为Map数据结构中的KEY数据,KEY数据的类型具体为std::pair<int,int>,与连麦会话中的连麦状态数据的KEY数据的类型相同,目标查询数据中包含有第一主播用户的用户ID和第二主播用户的用户ID。It should be noted that the target query data is the KEY data in the Map data structure, and the type of the KEY data is specifically std::pair<int, int>, which is the same as the type of the KEY data of the connected state data in the connected session. The target query data includes the user ID of the first anchor user and the user ID of the second anchor user.
步骤A3、连麦服务器在连麦会话中进行查询是否存在目标查询数据;如果连麦会话中存在目标查询数据,则执行步骤A4,如果连麦会话中不存在目标查询数据,则执行步骤A5。In step A3, the connection server queries whether there is target query data in the connection session; if there is target query data in the connection session, step A4 is performed, and if there is no target query data in the connection session, step A5 is performed.
步骤A4具体为:连麦服务器结束第一主播客户端与第一主播客户端之间的连麦服务,并且从连麦会话中删除表征第一主播用户与第二主播用户之间连麦状态的连麦状态数据,还向第一主播客户端和第二主播客户端发送连麦结束通知消息;Step A4 is specifically: the connection server terminates the connection between the first anchor client and the first anchor client, and deletes the connection between the first anchor user and the second anchor user. And connecting the wheat status data to the first anchor client and the second anchor client to send a connection notification message;
步骤A5具体为:连麦服务器向发起结束连麦请求的主播客户端返回错误消息。Step A5 is specifically as follows: the connection server returns an error message to the anchor client that initiates the connection request.
在具体实施过程中,发起结束连麦请求的主播客户端可以为第一主播客户端,也可以是第二主播客户端。In a specific implementation process, the anchor client that initiates the end of the connection request may be the first anchor client or the second anchor client.
通过上述步骤A1~A5,能够在处于连麦状态的任何一个主播用户都能够根据需要结束连麦,提高了连麦的灵活性。Through the above steps A1 to A5, any one of the anchor users in the continuous wheat state can end the continuous wheat as needed, thereby improving the flexibility of the continuous wheat.
进一步的,在建立第一主播客户端与第二主播用户所在的第二主播客户端之间的连麦服务之后,还可以包括如下步骤:Further, after establishing the connection service between the first anchor client and the second anchor client where the second anchor user is located, the following steps may be further included:
步骤B1、连麦服务器接收来自第一主播客户端按照预设心跳时间间隔发送的第一心跳消息和第二主播客户端按照预设心跳时间间隔发送的第二心跳消息,第一心跳消息和第二心跳消息中均携带有第一主播用户的用户ID和第二主播用户的用户ID。在接收到第一心跳消息时,在连麦会话中更新第一主播用户的保活时间戳,在接收到第二心跳消息时,在连麦会话中更新第二主播用户的保活时间戳。Step B1: The first heartbeat message sent by the first anchor client according to the preset heartbeat interval and the second heartbeat message sent by the second anchor client according to the preset heartbeat interval, the first heartbeat message and the first The two heartbeat messages carry the user ID of the first anchor user and the user ID of the second anchor user. When the first heartbeat message is received, the keepalive timestamp of the first anchor user is updated in the connected session, and when the second heartbeat message is received, the keepalive timestamp of the second anchor user is updated in the connected session.
具体实施过程中,预设心跳时间间隔根据实际需求进行设置,比如,预设心跳时间间隔可以设置为1~10秒中的任意一个数值,以预设心跳时间间隔为5秒进行举例来讲:在建立第一主播客户端与第二主播用户所在的第二主播客户端之间的连麦服务之后,第一主播客户端每隔5秒向连麦服务器的连麦服务发送一次第一心跳消息,可以命名为AP_RandomPhoneHeartbeat,第一心跳消息中携带有第一主播用户的用户ID和第二主播用户的用户ID。连麦服务器的连麦服务收到第一心跳消息后,更新第一主播用户在连麦会话中的保活时间戳。同样的,第二主播客户端每隔5秒向连麦服务器的连麦服务发送一次第二心跳消息,可以命名为AP_RandomPhoneHeartbeat,第二心跳消息中携带有第二主播用户的用户ID和第一主播用户的用户ID。连麦服务器的连麦服务接收到收到来自第二主播用户的第二心跳消息后,更新第二主播用户在连麦会话中的保活时间戳。During the specific implementation, the preset heartbeat interval is set according to actual requirements. For example, the preset heartbeat interval can be set to any one of 1 to 10 seconds, and the preset heartbeat interval is 5 seconds. After the connection between the first anchor client and the second anchor client where the second anchor user is located, the first anchor client sends a first heartbeat message to the connected server of the connected server every 5 seconds. It can be named as AP_RandomPhoneHeartbeat, and the first heartbeat message carries the user ID of the first anchor user and the user ID of the second anchor user. After receiving the first heartbeat message, the connected server of the connected server updates the keepalive time stamp of the first anchor user in the connected session. Similarly, the second anchor client sends a second heartbeat message to the connected server of the connected server every 5 seconds, which can be named AP_RandomPhoneHeartbeat, and the second heartbeat message carries the user ID and the first anchor of the second anchor user. User's user ID. After receiving the second heartbeat message from the second anchor user, the connected service of the connected server updates the keepalive time stamp of the second anchor user in the connected session.
步骤B2、连麦服务器按照预设检查时间间隔检查是否接到第一心跳消息,以及按照预设检查时间间隔检查是否接收到第二心跳消息,如果超过预设检查时长均没有接收到第一心跳消息,则执行步骤B3,如果超过预设检查时长均没有接收到第二心跳消息,则执行步骤B4。Step B2: The connection server checks whether the first heartbeat message is received according to the preset check interval, and checks whether the second heartbeat message is received according to the preset check interval. If the first heartbeat is not received after the preset check duration is exceeded, If the message does not receive the second heartbeat message, the process proceeds to step B3.
具体的,预设检查时间间隔和预设检查时长可以根据实际需求进行设置,预设检查时间间隔可以设置为1-3秒中任一数值,预设检查时长可以设置为10~15中的任一数值。比如,预设检查时间间隔设置为1秒,则连麦服务器会通过定时器每隔1秒检查一次所有处于连麦状态的主播用户在连麦会话中的保活时间戳,其中,包括第一主播用户在连麦会话中的保活时间戳和第二主播用户在连麦会话中的保活时间戳,如果超过15秒没有收到心跳消息的主播客户端,则认为对应的主播用户失连。Specifically, the preset check interval and the preset check duration can be set according to actual requirements. The preset check interval can be set to any value of 1-3 seconds, and the preset check duration can be set to any of 10-15. A value. For example, if the preset check interval is set to 1 second, the server will check the keepalive time stamp of all the anchor users in the connected state every 1 second through the timer, including the first The keepalive timestamp of the anchor user in the connected session and the keepalive timestamp of the second anchor user in the connected session. If the anchor client does not receive the heartbeat message for more than 15 seconds, the corresponding anchor user is considered to be disconnected. .
步骤B3、连麦服务器结束第一主播客户端与第二主播客户端之间的连麦服务,并且向第二主播客户端发送主播失连消息。Step B3: The connection server ends the connection service between the first anchor client and the second anchor client, and sends an anchor loss message to the second anchor client.
步骤B4、连麦服务器结束第一主播客户端与第二主播客户端之间的连麦服务,并且向所述第一主播客户端发送主播失连消息。Step B4: The connection server ends the connection service between the first anchor client and the second anchor client, and sends an anchor loss message to the first anchor client.
通过上述步骤B1~B4能够监测处于连麦状态的两个主播用户是否失连,在一方主播用户失连时,能够即使通知另一方主播用户所在的主播客户端,提示另一方主播用户,以便进行重新连麦。Through the above steps B1 to B4, it is possible to monitor whether two anchor users in the connected state are disconnected, and when one of the anchor users loses the connection, the other anchor user can be prompted to notify the other anchor user even if the other anchor user is notified. Re-connected wheat.
下面,对本发明实施例提供的直播连麦方法,基于主播客户端A、主播客户端B和连麦服务器为例给出一交互实施例,主播客户端A上登陆有主播用户X,主播客户端B上登陆有主播用户Y,以理解本发明:In the following, the live broadcast method according to the embodiment of the present invention provides an interaction embodiment based on the anchor client A, the anchor client B, and the connected server. The anchor client A has the anchor user X and the anchor client. The host user Y is logged in on B to understand the present invention:
主播客户端A:主播用户X启动主播客户端A并基于用户ID登录后,点击随机连麦按钮,则主播客户端A发起随机连麦请求,在主播客户端A上显示匹配等待界面,直到主播用户X点击取消随机连麦按钮进行取消随机连麦或者收到连麦服务器的响应消息。Anchor client A: The anchor user X starts the anchor client A and logs in based on the user ID, clicks the random link button, then the anchor client A initiates a random connection request, and displays the matching waiting interface on the anchor client A until the anchor User X clicks the Cancel Random Link button to cancel the random connection or receive the response message from the connected server.
连麦服务器:接收主播客户端A的随机连麦请求,查询本地维护的连麦候选池,如果连麦候选池为空,说明当前没有任何一个主播用户在等待连麦,则把主播用户X加入连麦候选池中,同时记录主播用户X加入连麦候选池的时间戳。如果连麦候选池有等待连麦的主播用户Y,则把主播用户Y与主播用户X匹配成功。把主播用户Y从连麦候选池中删除,并给主播用户X和主播用户Y发送随机匹配成功消息,匹配成功消息中带上主播用户X的用户ID和主播用户Y的用户ID。同时把主播用户X和主播用户Y的连麦状态数据存储到连麦会话,主播客户端B和主播客户端A收到匹配成功消息后,隐藏匹配等待界面,提示主播用户Y与主播用户X进入与对方的连麦状态。连麦服务器通过定时器每隔1秒轮询一次连麦候选池,校验主播用户X加入连麦候选池的时间戳与当前时间,如果发现主播用户X等候已经超过30秒,则把主播用户X从连麦候选池中删除,并给主播客户端A发送匹配超时消息。Connected to the server: Receive the random connection request of the anchor client A, and query the local maintenance candidate pool. If the candidate pool is empty, it means that no anchor user is waiting for the connection, then the anchor user X is added. In the candidate pool of the wheat, the time stamp of the anchor user X joining the candidate pool is recorded. If the candidate pool of the candidate has a host user Y waiting for the connection, the anchor user Y is successfully matched with the anchor user X. The anchor user Y is deleted from the pool of candidate pools, and a random match success message is sent to the anchor user X and the anchor user Y. The match success message carries the user ID of the anchor user X and the user ID of the anchor user Y. At the same time, the connection status data of the anchor user X and the anchor user Y is stored in the connected session, and the anchor client B and the anchor client A receive the matching success message, and then hide the matching waiting interface, prompting the anchor user Y and the anchor user X to enter. With the other side of the state of the wheat. The Lianmai server polls the candidate pool every 1 second, and checks the timestamp and current time of the anchor user X joining the candidate pool. If the host X waits for more than 30 seconds, the anchor user is used. X is deleted from the candidate pool and sends a matching timeout message to the anchor client A.
主播客户端A:收到超时消息后,隐藏匹配等待界面,提示主播用户X超时了。Anchor client A: After receiving the timeout message, the matching match waiting interface is hidden, prompting the anchor user X to time out.
主播客户端A:主播发起随机连麦请求后,最多等候30秒,在匹配成功之前,主播用户X可以点击取消连麦按钮,进行取消随机连麦。主播客户端A会向连麦服务器取消连麦请求。Anchor client A: After the anchor initiates a random connection request, it can wait up to 30 seconds. Before the match is successful, the anchor user X can click the Cancel button to cancel the random connection. The anchor client A will cancel the connection request to the Lianmai server.
连麦服务器:连麦服务收到取消连麦请求后,把主播用户X从连麦候选池中删除,并回复删除成功消息。Lianmai server: After receiving the request to cancel the connection, the connection service user X deletes the anchor user X from the candidate pool and responds with the deletion success message.
主播客户端A:主播用户X与主播用户Y随机匹配成功后,与主播用户X与主播用户Y进入连麦状态,主播用户X可以随时点击结束连麦按钮结束连麦。主播客户端A会向连麦服务器发送结束连麦请求,结束连麦请求的消息中携带有主播用户X的用户ID与主播用户Y的用户ID。The anchor client A: After the anchor user X and the anchor user Y are randomly matched, the anchor user X and the anchor user Y enter the connected state, and the anchor user X can click the end button to end the link at any time. The anchor client A sends a request to the connected server to terminate the connection request, and the message ending the connection request carries the user ID of the anchor user X and the user ID of the anchor user Y.
主播客户端B:主播用户X与主播用户Y随机匹配成功后,与主播用户X与主播用户Y进入连麦状态,主播用户Y可以随时点击结束连麦按钮结束连麦。主播客户端B会向连麦服务器发送结束连麦请求,结束连麦请求的消息中携带有主播用户X的用户ID与主播用户Y的用户ID。The anchor client B: After the anchor user X and the anchor user Y are randomly matched, the anchor user X and the anchor user Y enter the connection state, and the anchor user Y can click the end button to end the connection at any time. The anchor client B sends a request to the connected server, and the message ending with the connection request carries the user ID of the anchor user X and the user ID of the anchor user Y.
连麦服务器:收到结束连麦请求,根据主播用户X的用户ID与主播用户Y的用户ID构造KEY,根据KEY在连麦会话中进行查询,如果查不到所构造的构造KEY,说明主播用户X与主播用户Y之间的连麦不存在,给客户端回错误消息。如果查到所构造的构造KEY,则结束主播用户X与主播用户Y 之间的连麦,从连麦候选池中删除对应的连麦状态数据,并给主播客户端B和主播客户端A发送连麦结束通知消息。Connected Mai server: Receive the end of the connection request, according to the user ID of the anchor user X and the user ID of the anchor user Y to construct the KEY, according to the KEY in the Lianmai session to query, if the constructed structure KEY is not found, the anchor The connection between the user X and the anchor user Y does not exist, and the client returns an error message. If the constructed KEY is found, the connection between the anchor user X and the anchor user Y is terminated, and the corresponding connected wheat status data is deleted from the connected pool candidate pool, and sent to the anchor client B and the anchor client A. Lian Mai ended the notification message.
主播客户端A:主播用户X与主播用户Y随机匹配成功进入连麦状态后,每隔5秒向连麦服务器发送一次心跳消息。The anchor client A: After the anchor user X and the anchor user Y are randomly matched and successfully enter the connected state, the heartbeat message is sent to the connected server every 5 seconds.
主播客户端B:主播用户X与主播用户Y随机匹配成功进入连麦状态后,每隔5秒向连麦服务器发送一次心跳消息。The anchor client B: After the anchor user X and the anchor user Y are randomly matched and successfully enter the connected state, the heartbeat message is sent to the connected server every 5 seconds.
连麦服务器:在连麦会话中更新各主播用户X的保活时间戳。同时通过定时器每隔1秒检查一次所有处于连麦状态的主播用户(包括主播用户X、主播用户Y)的保活时间,如果连麦服务器超过15秒没有收到主播客户端A的心跳消息,则认为该主播用户X失连,这时会结束主播用户X与主播用户Y之间的连麦,给主播客户端B发送主播用户X失连的消息。如果连麦服务器超过15秒没有收到主播客户端B的心跳消息,则认为该主播用户Y失连,这时也会结束主播用户X与主播用户Y之间的连麦,主播客户端A发送主播用户Y失连的消息。Lianmai server: Update the keepalive timestamp of each anchor user X in the connected session. At the same time, the keepalive time of all the anchor users (including the anchor user X and the anchor user Y) in the connected state is checked every 1 second. If the server is connected to the server for more than 15 seconds, the heartbeat message of the anchor client A is not received. Then, the anchor user X is considered to be disconnected. At this time, the connection between the anchor user X and the anchor user Y is ended, and the anchor client B is sent a message that the anchor user X is disconnected. If the connected server does not receive the heartbeat message of the anchor client B for more than 15 seconds, the anchor user Y is considered to be disconnected, and the connection between the anchor user X and the anchor user Y is terminated. The anchor client A sends the message. The message that the anchor user Y is lost.
主播客户端A:收到主播用户Y失连的消息后,输出提示主播用户Y失连的信息,断开连麦。The anchor client A: After receiving the message that the anchor user Y is disconnected, the output prompts the information that the anchor user Y is disconnected, and disconnects the connection.
主播客户端B:收到主播用户X失连的消息后,输出提示主播用户X失连的信息,断开连麦。The anchor client B: after receiving the message that the anchor user X is disconnected, outputs a message indicating that the anchor user X is disconnected, and disconnects the connection.
基于同一发明构思,本发明实施例提供一种连麦服务器,参考图3所示,包括:Based on the same inventive concept, an embodiment of the present invention provides a connected server, as shown in FIG. 3, including:
连麦请求接收单元201,用于接收来自于第一主播用户所在的第一主播客户端的随机连麦请求;The connection request unit 201 is configured to receive a random connection request from the first anchor client where the first anchor user is located;
主播用户匹配单元202,用于在所述连麦服务器所建立的连麦候选池中为所述第一主播用户匹配第二主播用户;The anchor user matching unit 202 is configured to match the first anchor user to the second anchor user in the connected pool candidate pool established by the connected server;
连麦服务建立单元203,用于如果所述第一主播用户与所述第二主播用户匹配成功,建立所述第一主播客户端与所述第二主播用户所在的第二主播客户端之间的连麦服务,使得所述第一主播用户与所述第二主播用户之间进入连麦状态。The connection between the first anchor user and the second anchor client where the second anchor user is located, if the first anchor user and the second anchor user match successfully. The connected service enables the first anchor user to enter the connected state with the second anchor user.
可选的,所述主播用户匹配单元202,包括:Optionally, the anchor user matching unit 202 includes:
池中查询子单元,用于在接收到来自所述第一主播客户端的所述随机连麦请求时,查询所述连麦候选池中是否存在正在等待连麦的主播用户;a querying sub-unit in the pool, configured to query, in the connection of the random connection request from the first anchor client, whether there is an anchor user waiting for a connection in the connected pool;
选择子单元,用于如果所述连麦候选池中存在正在等待连麦的主播用户,从所述连麦候选池中选择一个正在等待连麦的主播用户,确定为所述第二主播用户;Selecting a subunit, configured to: if there is an anchor user waiting for the connection in the candidate pool, select an anchor user waiting for the connection from the pool of candidate pools, and determine the second anchor user;
第一匹配子单元,用于将所述第一主播用户和所述第二主播用户匹配成功;a first matching subunit, configured to successfully match the first anchor user and the second anchor user;
第一删除子单元,用于从所述连麦候选池中删除所述第二主播用户。a first deleting subunit, configured to delete the second anchor user from the connected pool of candidate pools.
可选的,所述主播用户匹配单元202,还包括:Optionally, the anchor user matching unit 202 further includes:
加入子单元,用于在所述查询所述连麦候选池中是否存在正在等待连麦的主播用户之后,如果所述连麦候选池中不存在正在等待连麦的主播用户,将所述第一主播用户加入至所述连麦候选池,并记录所述第一主播用户被加入所述连麦候选池时的时间戳;Adding a subunit, configured to: after the querying the connected candidate pool, whether there is an anchor user waiting for the connection, if there is no anchor user waiting for the connection in the connected pool, the first An anchor user joins the pool of candidate pools, and records a timestamp when the first anchor user is added to the pool of candidate pools;
等待子单元,用于将所述第一主播用户在以所述时间戳为起始时刻的预设时长内,保持在所述连麦候选池中;a waiting subunit, configured to keep the first anchor user in the connected pool of candidate pools within a preset duration of time starting from the time stamp;
第二匹配子单元,用于如果在所述预设时长内接收到来自所述第二主播用户发起的随机连麦请求,将所述第一主播用户与所述第二主播用户匹配成功,并且从所述连麦候选池中删除所述第一主播用户;a second matching subunit, configured to match the first anchor user and the second anchor user successfully if a random connection request initiated by the second anchor user is received within the preset duration Deleting the first anchor user from the connected pool of candidate pools;
第二删除子单元,用于如果所述第一主播用户保持在所述连麦候选池中的时长超过所述预设时长,从所述连麦候选池中删除所述第一主播用户,并且向所述第一主播客户端下发匹配失败消息。a second deletion subunit, configured to delete the first anchor user from the connected pool of candidate pools if the duration of the first anchor user remaining in the connected pool of candidate pools exceeds the preset duration Sending a matching failure message to the first anchor client.
可选的,所述连麦服务器还包括:Optionally, the connected server further includes:
成功消息发送单元,用于在所述第一主播用户与所述第二主播用户匹配成功之后,向所述第一主播客户端和所述第二直播客户端发送匹配成功消息,所述匹配成功消息用于指示所述第一主播客户端和所述第二主播客户端各自隐藏匹配等待界面;a success message sending unit, configured to send a matching success message to the first anchor client and the second live client after the first anchor user and the second anchor user successfully match, the matching succeeds The message is used to indicate that the first anchor client and the second anchor client each hide a matching waiting interface;
状态数据单元,用于获取表征所述第一主播用户与所述第二主播用户之间连麦状态的连麦状态数据,存储至所述连麦服务器所建立的连麦会话中。And a status data unit, configured to acquire the connected status data that represents the connected status between the first anchor user and the second anchor user, and store the data in the connected status established by the connected server.
可选的,所述连麦服务器还包括:Optionally, the connected server further includes:
取消连麦处理单元,用于在将所述第一主播用户加入至所述连麦候选池之后,并且在所述第一主播用户与所述第二主播用户匹配成功之前,如果接收到来自所述第一主播客户端的取消连麦请求,从所述连麦候选池中删除所述第一主播用户,并且向所述第一主播用户所在的所述第一主播客户端发送删除成功消息。De-linking the processing unit, after the first anchor user is added to the connected pool, and before the first anchor user and the second anchor user are successfully matched, if the source is received Deleting the first anchor user of the first anchor client, deleting the first anchor user from the connected pool, and sending a delete success message to the first anchor client where the first anchor user is located.
可选的,所述连麦服务器还包括:Optionally, the connected server further includes:
结束连麦请求接收单元,用于在所述建立所述第一主播客户端与所述第二主播用户所在的第二主播客户端之间的连麦服务之后,接收结束连麦请求,所述结束连麦请求来自所述第一主播客户端或者所述第二主播客户端,所述结束连麦请求中携带有所述第一主播用户的用户ID和所述第二主播用户的用户ID:Ending the connection request unit, configured to receive the end of the connection request after the establishing the connection between the first anchor client and the second anchor client where the second anchor user is located, Ending the connection request from the first anchor client or the second anchor client, the ending connection request carries the user ID of the first anchor user and the user ID of the second anchor user:
数据构建单元,用于根据所述第一主播用户的用户ID和所述第二主播用户的用户ID构建目标查询数据;a data construction unit, configured to construct target query data according to the user ID of the first anchor user and the user ID of the second anchor user;
数据查询单元,用于在所述连麦会话中进行查询是否存在所述目标查询数据;a data query unit, configured to query, in the connected session, whether the target query data exists;
结束连麦处理单元,用于如果所述连麦会话中存在所述目标查询数据,结束所述第一主播客户端与所述第一主播客户端之间的连麦服务,并且从所述连麦会话中删除表征所述第一主播用户与所述第二主播用户之间连麦状态的连麦状态数据,还向所述第一主播客户端和所述第二主播客户端发送连麦结束通知消息;Ending the continuous processing unit, if the target query data exists in the connected session, ending the connection service between the first anchor client and the first anchor client, and from the connection Deleting the connection status data indicating the connection between the first anchor user and the second anchor user, and sending the connection to the first anchor client and the second anchor client Notification message
错误消息发送单元,用于如果所述连麦会话中不存在所述目标查询数据,向发起所述结束连麦请求的主播客户端返回错误消息。The error message sending unit is configured to return an error message to the anchor client that initiates the end of the connection request if the target query data does not exist in the connected session.
可选的,所述连麦服务器还包括:Optionally, the connected server further includes:
心跳消息接收单元,用于在所述建立所述第一主播客户端与所述第二主播用户所在的第二主播客户端之间的连麦服务之后,接收来自所述第一主播客户端按照预设心跳时间间隔发送的第一心跳消息和所述第二主播客户端按照所述预设心跳时间间隔发送的第二心跳消息,所述第一心跳消息和所述第二心跳消息中均携带有所述第一主播用户的用户ID和所述第二主播用户的用户ID;a heartbeat message receiving unit, configured to receive, after the establishing the connection between the first anchor client and the second anchor client where the second anchor user is located, from the first anchor client a first heartbeat message sent by the preset heartbeat time interval and a second heartbeat message sent by the second anchor client according to the preset heartbeat time interval, where both the first heartbeat message and the second heartbeat message are carried Having the user ID of the first anchor user and the user ID of the second anchor user;
时间戳更新单元,用于在接收到所述第一心跳消息时,在所述连麦会话中更新所述第一主播用户的保活时间戳,在接收到所述第二心跳消息时,在所述连麦会话中更新所述第二主播用户的保活时间戳;a timestamp updating unit, configured to update a keepalive timestamp of the first anchor user in the connected session when receiving the first heartbeat message, when receiving the second heartbeat message, Updating the keepalive time stamp of the second anchor user in the connected session;
第一失连处理单元,用于如果超过预设检查时长没有接收到所述第一心跳消息,则结束所述第一主播客户端与所述第二主播客户端之间的连麦服务,并且向所述第二主播客户端发送主播失连消息;a first disconnection processing unit, configured to end the connection between the first anchor client and the second anchor client if the first heartbeat message is not received after the preset check duration is exceeded, and Sending an anchor loss message to the second anchor client;
第二失连处理单元,用于如果超过预设检查时长没有接收到所述第二心跳消息,则结束所述第一主播客户端与所述第二主播客户端之间的连麦服务,并且向所述第一主播客户端发送主播失连消息。a second disconnection processing unit, configured to end the connection between the first anchor client and the second anchor client if the second heartbeat message is not received after the preset check duration is exceeded, and Sending an anchor loss message to the first anchor client.
基于同一发明构思,本发明实施例提供了一种计算机可读存储介质401,参考图4所示,其上存储有计算机程序402,该程序402被处理器执行时实现前述直播连麦方法实施例中任一个实施方式所述的步骤。Based on the same inventive concept, an embodiment of the present invention provides a computer readable storage medium 401. Referring to FIG. 4, a computer program 402 is stored thereon, and the program 402 is implemented by the processor to implement the foregoing live broadcast method. The steps described in any of the embodiments.
基于同一发明构思,本发明实施例提供了一种计算机设备500,参考图5所示,包括存储器510、处理器530及存储在存储器510上并可在处理器530上运行的计算机程序520,所述处理器530执行所述程序520时实现前述直播连麦方法实施例中任一个实施方式所述的步骤。Based on the same inventive concept, an embodiment of the present invention provides a computer device 500, including a memory 510, a processor 530, and a computer program 520 stored on the memory 510 and operable on the processor 530, as shown in FIG. When the processor 530 executes the program 520, the steps described in any one of the foregoing embodiments of the live broadcast method are implemented.
由于上述所介绍的服务器、存储介质及计算机设备为实施本发明实施例中前述直播连麦方法所采用,故而基于本发明实施例中所介绍的直播连麦方法,本领域所属技术人员能够了解服务器、存储介质及计算机设备的具体实施方式以及其各种变化形式,所以在此对于服务器、存储介质及计算机设备如何实现本发明实施例中的直播连麦方法不再详细介绍。只要本领域所属技术人员实施本发明实施例中的直播连麦方法所采用的服务器、存储介质及计算机设备,都属于本发明所欲保护的范围。The server, the storage medium, and the computer device are the same as those used in the embodiments of the present invention. Therefore, those skilled in the art can understand the server based on the live broadcast method described in the embodiment of the present invention. The specific embodiments of the storage medium and the computer device, and various changes thereof, are not described in detail herein for how the server, the storage medium, and the computer device implement the live broadcast method in the embodiment of the present invention. The server, the storage medium, and the computer device used by the person skilled in the art to implement the live broadcast method in the embodiment of the present invention are all within the scope of the present invention.
本发明实施例中提供的一个或多个技术方案,至少具有如下技术效果或优点:One or more technical solutions provided in the embodiments of the present invention have at least the following technical effects or advantages:
接收来自于第一主播用户所在的第一主播客户端的随机连麦请求;在连麦服务器所建立的连麦候选池中为第一主播用户匹配第二主播用户;如果第一主播用户与第二主播用户匹配成功,建立第一主播客户端与第二主播用户所在的第二主播客户端之间的连麦服务,使得第一主播用户与第二主播用户之间进入连麦状态。因此,只要有两个发起随机连麦请求的主播客户端,就能够连麦成功,不需要向某个指定的主播用户发起连麦请求,提高了人气不高的主播用户所在的主播客户端的连麦成功率,缓解了人气较高的主播用户所在的主播客户端的负载压力,因此,平衡了不同级别的主播用户的主播客户端之间的连麦,进而,能够提高主播连麦的可靠性。Receiving a random connection request from the first anchor client where the first anchor user is located; matching the second anchor user to the first anchor user in the connected pool candidate pool established by the connected server; if the first anchor user and the second The anchor user is successfully matched, and the connection between the first anchor client and the second anchor client where the second anchor user is located is established, so that the first anchor user and the second anchor user enter the connected state. Therefore, as long as there are two anchor clients that initiate random random connection requests, the success of the connection can be achieved without the need to initiate a connection request to a designated anchor user, thereby improving the connection of the anchor client where the less popular anchor user is located. The success rate of the wheat eases the load pressure of the anchor client where the popular anchor user is located. Therefore, the balance between the anchor clients of different levels of the anchor users is balanced, and the reliability of the anchor network can be improved.
另外,通过本发明实施例还提升了主播趣味性,进而可以大大提升连麦活跃性,进而加强平台主播间的互动性。In addition, the embodiment of the present invention also improves the interest of the anchor, thereby greatly improving the activity of the continuous wheat, thereby enhancing the interaction between the platform anchors.
本领域内的技术人员应明白,本发明的实施例可提供为方法、***、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art will appreciate that embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
本发明是参照根据本发明实施例的方法、设备(***)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention has been described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (system), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or FIG. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine for the execution of instructions for execution by a processor of a computer or other programmable data processing device. Means for implementing the functions specified in one or more of the flow or in a block or blocks of the flow chart.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。The computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device. The apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device. The instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
尽管已描述了本发明的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例作出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本发明范围的所有变更和修改。While the preferred embodiment of the invention has been described, it will be understood that Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and the modifications and
显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及 其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。It is apparent that those skilled in the art can make various modifications and variations to the invention without departing from the spirit and scope of the invention. Thus, it is intended that the present invention cover the modifications and the modifications of the

Claims (10)

  1. 一种直播连麦方法,应用于连麦服务器,其特征在于,所述方法包括:A method for broadcasting live wheat, which is applied to a continuous wheat server, characterized in that the method comprises:
    接收来自于第一主播用户所在的第一主播客户端的随机连麦请求;Receiving a random connection request from the first anchor client where the first anchor user is located;
    在所述连麦服务器所建立的连麦候选池中为所述第一主播用户匹配第二主播用户;Matching the first anchor user to the second anchor user in the connected pool candidate pool established by the connected server;
    如果所述第一主播用户与所述第二主播用户匹配成功,建立所述第一主播客户端与所述第二主播用户所在的第二主播客户端之间的连麦服务,使得所述第一主播用户与所述第二主播用户之间进入连麦状态。If the first anchor user and the second anchor user match successfully, establishing a connection service between the first anchor client and the second anchor client where the second anchor user is located, so that the first An anchor user enters a continuous state with the second anchor user.
  2. 如权利要求1所述的直播连麦方法,其特征在于,所述在所述连麦服务器所建立的连麦候选池中为所述第一主播用户匹配第二主播用户,包括:The live broadcast method according to claim 1, wherein the matching the second anchor user for the first anchor user in the pool of candidate pools established by the connected server includes:
    在接收到来自所述第一主播客户端的所述随机连麦请求时,查询所述连麦候选池中是否存在正在等待连麦的主播用户;When receiving the random connection request from the first anchor client, querying whether there is an anchor user waiting for the connection in the connected pool;
    如果所述连麦候选池中存在正在等待连麦的主播用户,从所述连麦候选池中选择一个正在等待连麦的主播用户,确定为所述第二主播用户;And if there is an anchor user waiting for the connection in the candidate pool, selecting an anchor user waiting for the connection from the pool of candidate pools, and determining to be the second anchor user;
    将所述第一主播用户和所述第二主播用户匹配成功;Matching the first anchor user and the second anchor user successfully;
    从所述连麦候选池中删除所述第二主播用户。And deleting the second anchor user from the connected pool of candidate pools.
  3. 如权利要求2所述的直播连麦方法,其特征在于,所述在所述连麦服务器所建立的连麦候选池中为所述第一主播用户匹配第二主播用户,还包括:The live broadcast method according to claim 2, wherein the matching the second anchor user to the first anchor user in the connected pool of the connected pools of the connected server includes:
    在所述查询所述连麦候选池中是否存在正在等待连麦的主播用户之后,如果所述连麦候选池中不存在正在等待连麦的主播用户,将所述第一主播用户加入至所述连麦候选池,并记录所述第一主播用户被加入所述连麦候选池时的时间戳;After the querying whether there is an anchor user waiting for the connection in the connected pool, if the anchor user waiting for the connection is not present in the connected pool, the first anchor user is added to the office. Determining a candidate pool of the wheat, and recording a timestamp when the first anchor user is added to the pool of candidate pools;
    将所述第一主播用户在以所述时间戳为起始时刻的预设时长内保持在所述连麦候选池中;And maintaining the first anchor user in the connected pool of candidate pools within a preset duration that starts with the time stamp;
    如果在所述预设时长内接收到来自所述第二主播用户发起的随机连麦请求,将所述第一主播用户与所述第二主播用户匹配成功,并且从所述连麦候选池中删除所述第一主播用户;If the random connection request initiated by the second anchor user is received within the preset duration, the first anchor user and the second anchor user are successfully matched, and from the pool of candidate pools Deleting the first anchor user;
    如果所述第一主播用户保持在所述连麦候选池中的时长超过所述预设时长,从所述连麦候选池中删除所述第一主播用户,并且向所述第一主播客户端下发匹配失败消息。If the duration of the first anchor user remaining in the connected pool candidate pool exceeds the preset duration, deleting the first anchor user from the connected pool candidate pool, and to the first anchor client A matching failure message is sent.
  4. 如权利要求1-3中任一项所述的直播连麦方法,其特征在于,在所述第一主播用户与所述第二主播用户匹配成功之后,所述方法还包括:The method of the live broadcast of the MG according to any one of claims 1 to 3, wherein after the first anchor user and the second anchor user are successfully matched, the method further includes:
    向所述第一主播客户端和所述第二直播客户端发送匹配成功消息,所述匹配成功消息用于指示所述第一主播客户端和所述第二主播客户端各自隐藏匹配等待界面;Sending a matching success message to the first anchor client and the second live client, where the matching success message is used to indicate that the first anchor client and the second anchor client each hide a matching waiting interface;
    获取表征所述第一主播用户与所述第二主播用户之间连麦状态的连麦状态数据,存储至所述连麦服务器所建立的连麦会话中。Obtaining the connection status data that represents the connection status between the first anchor user and the second anchor user, and storing the data to the connected status established by the connected server.
  5. 如权利要求4所述的直播连麦方法,其特征在于,在将所述第一主播用户加入至所述连麦候选池之后,并且在所述第一主播用户与所述第二主播用户匹配成功之前,所述方法还包括:The live broadcast method according to claim 4, wherein after the first anchor user is added to the connected pool, and the first anchor user matches the second anchor user Before successful, the method further includes:
    如果接收到来自所述第一主播客户端的取消连麦请求,从所述连麦候选池中删除所述第一主播用户,并且向所述第一主播用户所在的所述第一主播客户端发送删除成功消息。And deleting the first anchor user from the connected pool of candidate pools, and sending the first anchor user to the first anchor client where the first anchor user is located, if receiving the canceled connection request from the first anchor client Delete the success message.
  6. 如权利要求4所述的直播连麦方法,其特征在于,在所述建立所述第一主播客户端与所述第二主播用户所在的第二主播客户端之间的连麦服务之后,所述方法还包括:The live broadcast method according to claim 4, wherein after the establishing the connection between the first anchor client and the second anchor client where the second anchor user is located, The method also includes:
    接收结束连麦请求,所述结束连麦请求来自所述第一主播客户端或者所述第二主播客户端,所述结束连麦请求中携带有所述第一主播用户的用户ID和所述第二主播用户的用户ID;Receiving a connection request, the ending connection request is from the first anchor client or the second anchor client, and the ending connection request carries the user ID of the first anchor user and the User ID of the second anchor user;
    根据所述第一主播用户的用户ID和所述第二主播用户的用户ID构建目标查询数据;Constructing target query data according to the user ID of the first anchor user and the user ID of the second anchor user;
    在所述连麦会话中进行查询是否存在所述目标查询数据;Querying whether there is the target query data in the connected session;
    如果所述连麦会话中存在所述目标查询数据,结束所述第一主播客户端与所述第一主播客户端之间的连麦服务,并且从所述连麦会话中删除表征所述第一主播用户与所述第二主播用户之间连麦状态的连麦状态数据,还向所述第一主播客户端和所述第二主播客户端发送连麦结束通知消息;If the target query data exists in the connected session, ending the connection service between the first anchor client and the first anchor client, and deleting the representation from the connected session And transmitting, to the first anchor client and the second anchor client, a connection notification message to the first anchor client and the second anchor client;
    如果所述连麦会话中不存在所述目标查询数据,向发起所述结束连麦请求的主播客户端返回错误消息。If the target query data does not exist in the connected session, an error message is returned to the anchor client that initiates the end of the connection request.
  7. 如权利要求4所述的直播连麦方法,其特征在于,在所述建立所述第一主播客户端与所述第二主播用户所在的第二主播客户端之间的连麦服务之后,所述方法还包括:The live broadcast method according to claim 4, wherein after the establishing the connection between the first anchor client and the second anchor client where the second anchor user is located, The method also includes:
    接收来自所述第一主播客户端按照预设心跳时间间隔发送的第一心跳消息和所述第二主播客户端按照所述预设心跳时间间隔发送的第二心跳消息,所述第一心跳消息和所述第二心跳消息中均携带有所述第一主播用户的用户ID和所述第二主播用户的用户ID;Receiving, by the first anchor client, a first heartbeat message sent according to a preset heartbeat time interval, and a second heartbeat message sent by the second anchor client according to the preset heartbeat time interval, the first heartbeat message And the second heartbeat message carries the user ID of the first anchor user and the user ID of the second anchor user;
    在接收到所述第一心跳消息时,在所述连麦会话中更新所述第一主播用户的保活时间戳,在接收到所述第二心跳消息时,在所述连麦会话中更新所述第二主播用户的保活时间戳;Updating the keepalive timestamp of the first anchor user in the connected session, and updating in the connected session when receiving the second heartbeat message when receiving the first heartbeat message The keepalive time stamp of the second anchor user;
    如果超过预设检查时长没有接收到所述第一心跳消息,则结束所述第一主播客户端与所述第二主播客户端之间的连麦服务,并且向所述第二主播客户端发送主播失连消息;If the first heartbeat message is not received after the preset check duration is exceeded, ending the connection service between the first anchor client and the second anchor client, and sending the connection to the second anchor client The anchor loses the message;
    如果超过预设检查时长没有接收到所述第二心跳消息,则结束所述第一主播客户端与所述第二主播客户端之间的连麦服务,并且向所述第一主播客户端发送主播失连消息。If the second heartbeat message is not received after the preset check duration is exceeded, ending the connection service between the first anchor client and the second anchor client, and sending the connection to the first anchor client The anchor lost the message.
  8. 一种连麦服务器,其特征在于,包括:A connected server, which is characterized in that it comprises:
    连麦请求接收单元,用于接收来自于第一主播用户所在的第一主播客户端的随机连麦请求;a continuous request receiving unit, configured to receive a random connection request from the first anchor client where the first anchor user is located;
    主播用户匹配单元,用于在所述连麦服务器所建立的连麦候选池中为所述第一主播用户匹配第二主播用户;An anchor user matching unit, configured to match the second anchor user to the first anchor user in the connected pool candidate pool established by the connected server;
    连麦服务建立单元,用于如果所述第一主播用户与所述第二主播用户匹配成功,建立所述第一主播客户端与所述第二主播用户所在的第二主播客户端之间的连麦服务,使得所述第一主播用户与所述第二主播用户之间进入连麦状态。a connection between the first anchor user and the second anchor client where the second anchor user is located, if the first anchor user and the second anchor user match successfully. The connection between the first anchor user and the second anchor user is in a continuous state.
  9. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,该程序被处理器执行时实现权利要求1-7中任一项所述的步骤。A computer readable storage medium having stored thereon a computer program, wherein the program, when executed by a processor, implements the steps of any of claims 1-7.
  10. 一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其特征在于,所述处理器执行所述程序时实现权利要求1-7中任一项所述的步骤。A computer device comprising a memory, a processor, and a computer program stored on the memory and operable on the processor, wherein the processor executes the program to implement any one of claims 1-7 The steps described.
PCT/CN2018/082506 2018-01-10 2018-04-10 Live streaming microphone connection method and apparatus WO2019136862A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810023758.5A CN108184140B (en) 2018-01-10 2018-01-10 Live broadcast wheat connecting method, server, storage medium and computer equipment
CN201810023758.5 2018-01-10

Publications (1)

Publication Number Publication Date
WO2019136862A1 true WO2019136862A1 (en) 2019-07-18

Family

ID=62550153

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/082506 WO2019136862A1 (en) 2018-01-10 2018-04-10 Live streaming microphone connection method and apparatus

Country Status (2)

Country Link
CN (1) CN108184140B (en)
WO (1) WO2019136862A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110765366A (en) * 2019-10-30 2020-02-07 网易(杭州)网络有限公司 Live broadcast and microphone connection matching method, device and equipment and computer readable storage medium

Families Citing this family (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109121013A (en) * 2018-07-25 2019-01-01 北京达佳互联信息技术有限公司 Method, apparatus, terminal, server and the storage medium of played data
CN109388924A (en) * 2018-09-30 2019-02-26 武汉斗鱼网络科技有限公司 A kind of auth method, device, server and storage medium
CN110971922B (en) * 2018-09-30 2021-11-09 武汉斗鱼网络科技有限公司 Live broadcast and microphone connection state monitoring method, client, server, medium and system
CN109257658A (en) * 2018-10-12 2019-01-22 北京潘达互娱科技有限公司 A kind of live streaming even wheat method, apparatus and server
CN109618191A (en) * 2018-12-17 2019-04-12 广州市百果园信息技术有限公司 Live streaming connects wheat method, apparatus, computer readable storage medium and terminal
CN109743587B (en) * 2019-01-03 2021-09-17 广州虎牙信息科技有限公司 Live broadcast connection monitoring method, terminal equipment and storage medium
CN109756504B (en) * 2019-01-16 2021-11-09 武汉斗鱼鱼乐网络科技有限公司 Communication method based on live broadcast platform and related device
CN110149525A (en) * 2019-05-23 2019-08-20 广州虎牙信息科技有限公司 A kind of live broadcasting method, device, equipment and storage medium
CN110311795B (en) * 2019-07-02 2020-10-20 广州华多网络科技有限公司 Method and system for creating friend group and server
CN110996180B (en) * 2019-12-17 2021-05-28 李昱颉 Network live broadcast chatting method, system and server
CN111683262B (en) * 2020-06-04 2022-03-15 广州酷狗计算机科技有限公司 Method, device, server, terminal and storage medium for determining continuous microphone time
CN112312154B (en) * 2020-10-30 2022-08-09 广州华多网络科技有限公司 Network live broadcast control and execution method and corresponding device, equipment and medium
CN113691872A (en) * 2021-06-18 2021-11-23 北京达佳互联信息技术有限公司 Live broadcast task allocation method and device, electronic equipment and storage medium
CN113141519B (en) * 2021-06-23 2021-09-17 大学长(北京)网络教育科技有限公司 Live broadcast data processing method and device
CN113645475B (en) * 2021-08-03 2023-10-13 杭州情咖网络技术有限公司 Live broadcast connection method and device
CN115996213A (en) * 2022-12-29 2023-04-21 百果园技术(新加坡)有限公司 Live-broadcast continuous-wheat processing method and device, equipment and medium thereof

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105812951A (en) * 2016-03-24 2016-07-27 广州华多网络科技有限公司 Stream media data interaction method, terminal, server and system
CN106303657A (en) * 2016-08-18 2017-01-04 北京奇虎科技有限公司 A kind of even method that wheat is live and main broadcaster's end equipment
CN106454537A (en) * 2016-10-14 2017-02-22 广州华多网络科技有限公司 Live video streaming method and relevant equipment

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW571812U (en) * 2003-06-11 2004-01-11 Vision Electronics Co Ltd Audio device for TV game machine
WO2015073924A1 (en) * 2013-11-14 2015-05-21 Smiletime, Inc. Social multi-camera interactive live engagement system
CN104468395B (en) * 2014-10-20 2018-11-06 广州华多网络科技有限公司 The channel access method and system of direct broadcasting room
CN106156243A (en) * 2015-04-26 2016-11-23 上海灵域网络科技有限公司 A kind of social entertainment method and system
CN106488251B (en) * 2016-10-19 2019-09-20 北京小米移动软件有限公司 Realize the method and device, main broadcaster's client and user client for connecting wheat in live streaming

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105812951A (en) * 2016-03-24 2016-07-27 广州华多网络科技有限公司 Stream media data interaction method, terminal, server and system
CN106303657A (en) * 2016-08-18 2017-01-04 北京奇虎科技有限公司 A kind of even method that wheat is live and main broadcaster's end equipment
CN106454537A (en) * 2016-10-14 2017-02-22 广州华多网络科技有限公司 Live video streaming method and relevant equipment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110765366A (en) * 2019-10-30 2020-02-07 网易(杭州)网络有限公司 Live broadcast and microphone connection matching method, device and equipment and computer readable storage medium

Also Published As

Publication number Publication date
CN108184140B (en) 2020-03-17
CN108184140A (en) 2018-06-19

Similar Documents

Publication Publication Date Title
WO2019136862A1 (en) Live streaming microphone connection method and apparatus
WO2018068628A1 (en) Live video method and related device
US20230067099A1 (en) Method and server for performing game battle in live broadcast room, and storage medium
US8621585B2 (en) Invitation service for multi-device application sessions
JP5336338B2 (en) Communication system and communication method
US20120203848A1 (en) System and method to provide context for an automated agent to service multiple avatars within a virtual universe
WO2019071829A1 (en) Method, storage medium, device and system for implementing microphone connection-based battle between hosts on pc
CN108881936B (en) Live broadcast resource sharing method, electronic device and medium
JP6492198B2 (en) Information processing method, terminal, and computer storage medium
US20150238859A1 (en) System and method for granting remote access to a video game executed on a video game console or network client
JP2007534076A (en) System and method for chat load management in a network chat environment
KR20090100628A (en) A method for matching network game users, and an electronic device for using the method
CN113518247A (en) Video playing method, related equipment and computer readable storage medium
CN109257616B (en) Voice microphone-connected interaction method, device, equipment and medium
CN113727132A (en) Virtual gift display method, server, storage medium and computer device
CN111818349A (en) Page display method and device, electronic equipment and storage medium
WO2019061598A1 (en) Data verification method and client
US10821358B2 (en) Gaming server and method to generate context-aware gaming information
CN106791975A (en) A kind of method of net cast, terminal device and video living transmission system
US20220021715A1 (en) Live streaming method and apparatus, device and computer readable storage medium
CN113242173B (en) Screen sharing method, device and system and instant messaging server
EP4007283A1 (en) Video connection method and apparatus, and non-transitory computer-readable storage medium
WO2019071857A1 (en) Method and device preventing gift giving on live streaming platform
WO2015109991A1 (en) Data processing method and apparatus for internet application
US20080215595A1 (en) Data distribution system, terminal apparatus, connection candidate introduction apparatus, information processing method and recording medium with program recorded thereon

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: 18899843

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: 18899843

Country of ref document: EP

Kind code of ref document: A1