WO2022161215A1 - Method and device for recovering inter-live streaming studio connection - Google Patents
Method and device for recovering inter-live streaming studio connection Download PDFInfo
- Publication number
- WO2022161215A1 WO2022161215A1 PCT/CN2022/072562 CN2022072562W WO2022161215A1 WO 2022161215 A1 WO2022161215 A1 WO 2022161215A1 CN 2022072562 W CN2022072562 W CN 2022072562W WO 2022161215 A1 WO2022161215 A1 WO 2022161215A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- connection
- live
- client
- live broadcast
- room
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 54
- 230000002159 abnormal effect Effects 0.000 claims description 47
- 238000011084 recovery Methods 0.000 claims description 7
- 230000005856 abnormality Effects 0.000 abstract 2
- 230000008569 process Effects 0.000 description 7
- 230000008901 benefit Effects 0.000 description 4
- 238000004891 communication Methods 0.000 description 2
- 238000004590 computer program Methods 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/21—Server components or server architectures
- H04N21/218—Source of audio or video content, e.g. local disk arrays
- H04N21/2187—Live feed
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/23—Processing of content or additional data; Elementary server operations; Server middleware
- H04N21/24—Monitoring of processes or resources, e.g. monitoring of server load, available bandwidth, upstream requests
- H04N21/2404—Monitoring of server processing errors or hardware failure
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
- H04N21/437—Interfacing the upstream path of the transmission network, e.g. for transmitting client requests to a VOD server
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/47—End-user applications
- H04N21/478—Supplemental services, e.g. displaying phone caller identification, shopping application
- H04N21/4788—Supplemental services, e.g. displaying phone caller identification, shopping application communicating with other users, e.g. chatting
Definitions
- the present application relates to the technical field of connections between live broadcast rooms, and in particular, to a method and device for restoring connections across live broadcast rooms.
- Live broadcast can comprehensively convey product information, create a group buying atmosphere through the gathering popularity, create user application scenarios, and use interactive methods to stimulate consumers' potential needs and enhance fans' stickiness. Wait, live streaming is becoming more and more popular.
- Cross-live room connection is a connection technology based on live broadcast technology, which combines the audio and video streams of different live rooms. It can display the audio and video streams of multiple live rooms on the same screen.
- the connection PK is one of the This is a game based on the connection between the live broadcast rooms. It is that the anchor who gets more rewards within the specified time wins. However, if one of the anchor's APP suddenly crashes or exits abnormally, the anchor cannot return to the connection PK this time. , even before the APP crashed or exited abnormally, the anchor was in a leading state, and it was judged to be running away because he did not return to the connection PK in time, resulting in losing this PK, which is a big problem for the anchor. A pretty bad experience.
- the present application provides a method for restoring the connection between the live broadcast rooms, which to a certain extent solves the problem that the connection between the live broadcast rooms cannot be quickly restored after the APP crashes or exits the connection between the live broadcast rooms abnormally.
- the embodiment of the present application also provides a device for restoring connections across live broadcast rooms, so as to ensure the implementation of the above method.
- an embodiment of the present application discloses a method for restoring a connection between a live broadcast room, which is applied to a live broadcast client, and the method includes:
- the first live broadcast client If the first live broadcast client restarts the broadcast within a preset time after the first live broadcast client quits the cross-live broadcast room connection with the second live broadcast client due to an abnormal situation, the first live broadcast client obtains the first connection status sent by the server. information; the first connection state information is the connection state information periodically sent by the server for the connection between the first live client and the second live client to perform a cross-live connection;
- the first live broadcast client determines whether the connection between the live broadcast rooms needs to be restored according to the first connection state information
- the first live broadcast client resumes the cross-live broadcast room connection with the second live broadcast client.
- the embodiment of the present application also provides a device for restoring connections across live broadcast rooms, which is applied to a live broadcast client, and the device includes:
- the obtaining module is used for obtaining the data sent by the server if the first live client quits the cross-live room connection with the second live client due to an abnormal situation and restarts the broadcast within a preset time.
- the first connection status information; the first connection status information is the connection status information periodically sent by the server for the connection between the first live client and the second live client to connect across the live broadcast room;
- a judgment module used for the first live broadcast client to judge whether the connection between the live broadcast rooms needs to be restored according to the first connection state information
- a recovery module configured to restore the cross-live room connection between the first live client client and the second live client if it is determined that the cross-live room connection needs to be resumed.
- Embodiments of the present application also provide an electronic device including a memory and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by one or more processors.
- one or more programs include a method for restoring a connection between live broadcast rooms as described in any of the embodiments of the present application.
- the embodiments of the present application include the following advantages:
- the first live broadcast client obtains the first live broadcast client sent by the server.
- a connection state information wherein the first connection state information is the connection state information periodically sent by the server for the connection between the first live client and the second live client to perform a cross-live connection, and then the first live client according to The first connection status information determines whether the cross-live room connection needs to be resumed. If it is determined that the cross-live room connection needs to be resumed, the first live client restores the cross-live room connection with the second live client.
- the embodiments of the present application can help a host who is currently connecting across live broadcast rooms to quickly restore the cross live broadcast room connection after quitting the cross live broadcast room connection halfway due to an abnormal situation, which greatly improves user experience.
- FIG. 1 is a flow chart of steps of a method for restoring a connection between a live broadcast room provided by an embodiment of the present application
- FIG. 2 is a flow chart of steps of a method for restoring a connection between a live broadcast room provided by an embodiment of the present application
- FIG. 3 is a flow chart of steps of a method for restoring a connection between a live broadcast room provided by an embodiment of the present application
- FIG. 4 is a structural block diagram of a recovery device for a connection across a live broadcast room provided by an embodiment of the present application
- FIG. 5 is an electronic device provided by an embodiment of the present application.
- FIG. 1 a flowchart of steps of a method for restoring a connection between a live broadcast room provided by an embodiment of the present application is shown, which is applied to a live broadcast client.
- the method may specifically include the following steps:
- Step 101 If the first live broadcast client exits the cross-live broadcast room connection with the second live broadcast client due to an abnormal situation and restarts the broadcast within a preset time, then the first live broadcast client obtains the first broadcast sent by the server.
- Connection status information is the connection status information periodically sent by the server for the connection between the first live broadcast client and the second live broadcast client to be connected across the live broadcast room.
- the live broadcast client may be a computer device used on the move, such as a mobile phone, an iPad (tablet computer), a notebook computer, etc., which is not limited in this application.
- These live streaming clients can support Android (Android), iOS (iPhone Operation System, Apple operating system), windows and other operating systems.
- the server will periodically send the first connection
- the status information is sent to the first live broadcast client and the second live broadcast client, for example, the server sends it every 10 seconds, wherein the first connection status information is periodically sent by the server for cross live broadcast between the first live broadcast client and the second live broadcast client Connection status information for the connection.
- the first live broadcast client can receive the first connection status information periodically sent by the server, and then save the first connection status information in the local memory.
- the second live broadcast client can also receive the first connection status information periodically sent by the server.
- first live client and the second live client can synchronize the connection status, so as to maintain the first live client and the second live client through the server.
- the state of the first live broadcast client and the second live broadcast client are prevented from being out of synchronization.
- the abnormal situation may be network freeze, APP crash, the user accidentally presses the home button to return to the main interface, the system memory is insufficient, etc., which is not limited in the present application. If the first live broadcast client withdraws from the cross-live broadcast room connection due to an abnormal situation, within a preset time, the first live broadcast client receives the host's restart instruction, the first live broadcast client can obtain the first connection sent by the server. Line status information.
- step 102 the first live broadcast client determines whether the connection between the live broadcast rooms needs to be restored according to the first connection state information.
- the online PK is that within a specified time, the two anchors use talent shows to attract the audience to give rewards to the anchors. At the end, they get the most rewards. The anchor wins. Therefore, during the period from the beginning to the end of the online PK, the anchor cannot go offline halfway, otherwise even if it is in a leading state before going offline, it will lose the support and rewards of the audience during the offline time, and lag behind the other party. Sometimes due to uncontrollable factors, the APP will crash or abnormally exit the cross-live room connection.
- the anchor who exits the cross-live room connection cannot return to the cross-live room connection even after restarting the broadcast, until it connects with the cross-live room. If the heartbeat packet of the server times out by 2 minutes, the server will disconnect the cross-live streaming connection between the two live streaming clients.
- the server will periodically send the first connection status information to the first live client and the second live client. If After the first live broadcast client exits the cross-live broadcast room connection due to an abnormal situation, and restarts the broadcast within a preset time, the first live broadcast client can obtain the first connection status information sent by the server. After the first live broadcast client is restarted, it cannot be determined whether the connection state is a normal exit state or an abnormal exit state.
- connection state is the end connection state; if it is an abnormal exit state, then the connection state is the connection state, so the first live client can use the first connection state information according to the information Determine if you need to restore the connection between the live broadcast rooms.
- the first live broadcast client can obtain the connection state identifier included in the first connection state information. If the connection state identifier indicates the connection state, it means that the first live broadcast client exits the cross-live broadcast room connection abnormally. Then the first live client can judge that the cross-live room connection needs to be resumed; if the connection status indicator does not indicate the connection status, such as the end of the connection state, it means that the first live client has exited the cross-live room connection normally, then The first live broadcast client may determine that it is not necessary to restore the connection between the live broadcast rooms.
- Step 103 If it is determined that the cross-live broadcast room connection needs to be restored, the first live broadcast client resumes the cross-live broadcast room connection with the second live broadcast client.
- the first live broadcast client determines that it is necessary to restore the connection across the live broadcast room, the first live broadcast client can use the first connection state information to restore the cross-live broadcast room connection with the second live broadcast client, so that It is possible to return to the cross-live room connection in time, which solves the problem in the prior art that the cross-live room connection cannot be returned even after restarting the broadcast.
- the first live broadcast client may not resume the cross-live broadcast room connection with the second live broadcast client.
- the first live broadcast client The invitation may be sent to the second live broadcast client again, and the first live broadcast client and the second live broadcast client will be reconnected across the live broadcast room.
- the first live broadcast client obtains the first live broadcast client sent by the server.
- a connection state information wherein the first connection state information is the connection state information periodically sent by the server for the connection between the first live client and the second live client to perform a cross-live connection, and then the first live client according to The first connection status information determines whether the cross-live room connection needs to be resumed. If it is determined that the cross-live room connection needs to be resumed, the first live client restores the cross-live room connection with the second live client.
- the embodiments of the present application can help a host who is currently connecting across live broadcast rooms to quickly restore the cross live broadcast room connection after quitting the cross live broadcast room connection halfway due to an abnormal situation, which greatly improves user experience.
- FIG. 2 a flowchart of steps of a method for restoring a connection between a live broadcast room provided by an embodiment of the present application is shown, which is applied to a live broadcast client, and the method may specifically include the following steps:
- Step 201 if the first live broadcast client exits the cross-live broadcast room connection with the second live broadcast client due to an abnormal situation and restarts the broadcast within a preset time, the first live broadcast client receives the broadcast, and the first live broadcast client receives the broadcast.
- Connection PK is a real-time audio and video stream PK interaction between two anchors in two live broadcast rooms.
- a host initiates a PK invitation. If another host accepts the PK invitation, the live client who initiated the PK invitation can obtain the audio and video streams of the live client who accepted the PK invitation through the server, so that the two hosts can start connecting to the PK. .
- the two live clients store the connection state information in the local memory respectively, and after that, the server does not periodically send the connection state information to the two live clients.
- the server will periodically send the first connection status information to the first live client and the second live client side, e.g. the server sends every 10 seconds.
- the first live broadcast client can receive the first connection status information periodically sent by the server, and then save the first connection status information in the local memory.
- the second live broadcast client can also receive the first connection status information periodically sent by the server. line state information, and then save the first connection state information to the local memory.
- the server can continue to periodically send the first connection status information
- the first live broadcast client and the second live broadcast client the first live broadcast client that exits the cross-live broadcast room connection cannot receive the first connection status information sent by the server.
- the connection program of the first live broadcast client that exits the connection across the live broadcast room can immediately register the listener, and then the listener can continue to receive the first connection state information.
- Step 202 After restarting the broadcast, the live client client requests the server for second connection status information of the connection between the live broadcast rooms.
- every time the live broadcast client starts broadcasting it can request the connection status information from the server. Therefore, after the first live broadcast client restarts the broadcast, it can request the server for a second connection that is connected across the live broadcast room. status information.
- the first connection status information is actively sent by the server to the first live broadcast client or the second live broadcast client
- the second connection status information is after the first live broadcast client or the second live broadcast client starts broadcasting. Actively requested from the server, that is, the first connection status information is actively sent by the server, and the second connection status information is actively requested by the live client.
- Step 203 Determine the latest connection state information in the first connection state information and the second connection state information.
- the first live broadcast client may continue to receive the first connection status information periodically sent by the server by using the listener, and the first live broadcast client may actively request the server for the second connection status information, Since the connection state after re-broadcasting changes in real time, the first live broadcast client needs to determine the latest connection state information among the first connection state information and the second connection state information.
- a timestamp is added to the first connection state information and the second connection state information, and step 203 may include the following sub-steps:
- the first live broadcast client cannot guarantee which connection state information is the latest connection state information among the first connection state information and the second connection state information.
- the server sends the first connection status information every 10 seconds
- the first live broadcast client requests the second connection status information from the server in the first second of the broadcast
- the server returns the second connection status information to the first live broadcast in the second second
- the first connection status information may arrive before the second connection status information.
- the second connection status information arrives before the first connection status information.
- the first live broadcast client cannot determine which is the latest connection status information.
- a timestamp is added to the first connection state information and the second connection state information, and when the first live broadcast client receives the first connection state information and the second connection state information, it can compare the first connection state information and the second connection state information A time stamp corresponding to the connection state information and the second connection state information, and then the connection state information corresponding to the latest time stamp is determined as the latest connection state information.
- the timestamp corresponding to the first connection status information is 10:25
- the timestamp corresponding to the second connection status information is 10:30.
- the first live client compares the timestamp 10 corresponding to the first connection status information: 25 and the time stamp 10:30 corresponding to the second connection state information, and then determine that the latest time stamp is 10:30, then the second connection state information corresponding to the time stamp 10:30 is the latest connection state information.
- the above examples are only used to make those skilled in the art better understand the embodiments of the present application, which are not limited in the present application.
- Step 204 the first live broadcast client determines whether the connection between the live broadcast rooms needs to be restored according to the latest connection status information.
- connection state is a normal exit state or an abnormal exit state. For example, if it is a normal exit state, the connection state is the end connection state; if it is an abnormal exit state, then the connection state is the connection state, so the first live client is in the first connection state information and After the latest connection state information is determined in the second connection state information, it may be determined whether the connection between the live broadcast rooms needs to be restored according to the latest connection state information.
- step 204 may include the following sub-steps:
- the first live client obtains the connection state identifier included in the latest connection state information; if the connection state identifier included in the latest connection state information indicates a connection state, the first A live broadcast client judges that it is necessary to restore the connection between the live broadcast rooms; if the connection state identifier included in the latest connection status information does not indicate the connection status, the first live broadcast client judges that it is not necessary to restore the cross live broadcast. connection between.
- the connection state identifier in the first connection state information sent by the server may indicate a connection state.
- the first live broadcast client may send connection termination information to the server, and the server may determine the first live broadcast client according to the connection termination information. If the connection between the live broadcast rooms needs to be terminated, the connection state identifier in the first connection state information sent by the server may indicate the end connection state. If the first live broadcast client quits the cross-live broadcast connection with the second live broadcast client due to an abnormal situation, then after the first live broadcast client restarts the broadcast, the first live broadcast client cannot determine that the connection status is normal.
- the status is still the status of an abnormal exit. For example, if it is a normal exit state, the connection state is the end connection state; if it is an abnormal exit state, then the connection state is the connection state, so the first live client can use the latest connection state information according to the state of the connection. Determine if you need to restore the connection between the live broadcast rooms.
- the first live client can obtain the connection state identifier included in the latest connection state information, and determine the latest connection state through the connection state identifier. If a live client exits the cross-live room connection abnormally, the first live client can determine that the cross-live room connection needs to be resumed; If the live client exits the cross live room connection normally, the first live broadcast client can determine that it does not need to resume the cross live room connection.
- Step 205 if it is determined that the cross-live broadcast room connection needs to be restored, the first live broadcast client resumes the cross-live broadcast room connection with the second live broadcast client.
- the first live broadcast client can use the latest connection status information to restore the cross-live broadcast room connection with the second live broadcast client.
- the process of connecting across the live broadcast room after the first live broadcast client obtains the latest status information, the first live broadcast client first initializes the connection program, initializes the connection session, initializes the connection session listener, and then first The live client sends the latest connection status information to the connection program, and the connection program extracts the latest connection status from the latest connection status information, saves the latest connection status to the connection session, and then broadcasts the APP.
- the first live client obtains the audio and video streams of the second live client from the server, and finally merges the audio and video streams of the first live client and the second live client on the screen of the live APP, As a result, the connection between the live broadcast rooms is restored, which greatly improves the user experience.
- the method may further include:
- the first live broadcast client If the first live broadcast client does not restart the broadcast within a preset time after the first live broadcast client exits the cross-live broadcast room connection with the second live broadcast client due to an abnormal situation, the first live broadcast client generates connection end information, and send the connection end information to the server; wherein, the connection end information is used to instruct the server to disconnect the cross-broadcast room connection.
- the connection end information can be generated, and then the connection end information can be sent to the server to notify the server to disconnect the cross-live room connection. After the server receives the connection end information, it can be disconnected according to the connection end information. Open a connection across the live room.
- the first connection state information includes a connection session identifier, a connection state identifier, user identifiers of both parties to the connection, and room identifiers of both parties to the connection, and the method may further include:
- the connection status identifier indicates a connection status
- the connection session identifier and the user identifiers of both parties in the connection are connected If the room identifiers of the two parties in the connection match the information of the cross-live room connection, it is determined that the first live-broadcast client quits the cross-live room connection with the second live-broadcast client due to an abnormal situation.
- the connection status of the first connection status information indicates the end of the connection state.
- the connection session ID, the user IDs of both parties, and the room IDs of both parties match the information of the cross-live room connection, and the connection status If the identifier still indicates the connection status, it can be determined that the first live broadcast client has withdrawn from the cross-live broadcast room connection with the second live broadcast client due to an abnormal situation.
- the first live broadcast client obtains the first live broadcast client sent by the server.
- a connection state information wherein the first connection state information is the connection state information periodically sent by the server for the connection between the first live client and the second live client to perform a cross-live connection, and then the first live client according to The first connection status information determines whether the cross-live room connection needs to be resumed. If it is determined that the cross-live room connection needs to be resumed, the first live client restores the cross-live room connection with the second live client.
- the embodiment of the present application can help a host who is currently connecting across a live broadcast room to quickly restore the cross-live room connection after quitting the cross-live room connection due to an abnormal situation, which greatly improves the user experience.
- FIG. 3 a flowchart of steps of a method for restoring a connection between a live broadcast room provided by an embodiment of the present application is shown, which is applied to a live broadcast client.
- the method may specifically include the following steps:
- Step 301 if the first live client re-launches the broadcast within a preset time after the first live client exits the cross-live room connection with the second live client due to an abnormal situation, the live client obtains the data from the preset disk.
- the first connection status information stored by the first live broadcast client and sent by the server periodically;
- the first connection state information is connection state information periodically sent by the server for the connection between the first live broadcast client and the second live broadcast client to be connected across the live broadcast room.
- the local memory of the live broadcast client After exiting the cross-live room connection, the local memory of the live broadcast client will automatically clear the connection status information, so whether it is a normal exit or an abnormal exit, the connection state information stored in the local memory will be lost, so the live broadcast client cannot be recovered.
- the server may periodically send the first connection status information to the first live client and the second live client, for example Sent every 10 seconds.
- the first live broadcast client After receiving the first connection state information, the first live broadcast client can store the first connection state information in the local memory, and also write the first connection state information into the preset disk of the first live broadcast client, and also That is to say, every time the server sends the first connection status information, the first live broadcast client will update the first connection status information stored in the local memory and the preset disk, so as to ensure the local memory and preset of the first live broadcast client.
- the first connection state information stored on the disk is the latest connection state information.
- the second live broadcast client can store the first connection state information in the local memory, and also write the first connection state information into the preset of the second live broadcast client Disk, that is to say, every time the server sends the first connection status information, the second live broadcast client will update the first connection status information stored in the local memory and the preset disk, so as to ensure the local memory of the second live broadcast client
- the first connection state information stored with the preset disk is the latest connection state information.
- the first live broadcast client after the first live broadcast client quits the cross-live broadcast room connection with the second live broadcast client due to an abnormal situation, if the first live broadcast client exits the cross-live broadcast room connection within a preset time, for example, within 2 minutes
- the first live broadcast client of the line receives the restart instruction, it can indicate that the host wants to return to the cross-live room connection in time
- the first live broadcast client can read the first connection status information stored in the preset disk.
- the first connection state information written to the preset disk will not be lost, so the first live broadcast client can obtain the first connection state information through the preset disk.
- Step 302 the first live broadcast client determines whether the connection between the live broadcast rooms needs to be restored according to the first connection state information.
- the first connection state information is obtained from the preset disk, because the first live broadcast client cannot determine whether the connection state is a normal exit state or an abnormal exit state. For example, if it is a normal exit state, the connection state is the end connection state; if it is an abnormal exit state, then the connection state is the connection state, so the first live client can use the first connection state information according to the information Determine if you need to restore the connection between the live broadcast rooms.
- the first live client can obtain the connection state identifier included in the first connection state information, and use the connection state identifier to determine the latest connection state stored on the preset disk. If the latest connection state is connecting If the connection status of the first live broadcast client is abnormally exited from the cross-live broadcast room, then the first live broadcast client can determine that the cross-live room connection needs to be resumed; if the latest connection status is not the connection status, such as ending the connection status, indicating that the first live broadcast client exits the cross-live room connection normally, then the first live broadcast client can judge that it does not need to resume the cross-live room connection.
- Step 303 if it is determined that the cross-live broadcast room connection needs to be restored, the first live broadcast client resumes the cross-live broadcast room connection with the second live broadcast client.
- the first connection state information may be used to restore the connection across the live broadcast room.
- the process of connecting across the live broadcast room after the first live broadcast client obtains the first connection status information, the first live broadcast client first initializes the connection program, initializes the connection session, initializes the connection session listener, and then The first live broadcast client sends the first connection state information to the connection program, and the connection program extracts the connection state before exiting the cross-live room connection due to abnormal conditions from the first connection state information, and then the connection
- the online state is saved to the connection session, and then the live APP layout video and renders the canvas, the first live client obtains the audio and video stream of the second live client from the server, and finally the audio and video streams of the first live client are sent to the second live client.
- the audio and video streams of the terminal are merged into the screen of the live broadcast APP, thus restoring the connection between the live broadcast rooms and greatly improving
- the method may further include:
- the first live broadcast client If the first live broadcast client does not restart the broadcast within a preset time after the first live broadcast client exits the cross-live broadcast room connection with the second live broadcast client due to an abnormal situation, the first live broadcast client generates connection end information, and send the connection end information to the server; wherein, the connection end information is used to instruct the server to disconnect the cross-broadcast room connection.
- the first connection state information includes a connection session identifier, a connection state identifier, user identifiers of both parties to the connection, and room identifiers of both parties to the connection, and the method may further include:
- the connection status identifier indicates a connection status
- the connection session identifier and the user identifiers of both parties in the connection are connected If the room identifiers of the two parties in the connection match with the information of the cross-live room connection, it is determined that the first live-broadcast client quits the cross-live room connection with the second live-broadcast client due to an abnormal situation.
- the first live broadcast client obtains the first live broadcast client sent by the server.
- a connection state information wherein the first connection state information is the connection state information periodically sent by the server for the connection between the first live client and the second live client to perform a cross-live connection, and then the first live client according to The first connection status information determines whether the cross-live room connection needs to be resumed. If it is determined that the cross-live room connection needs to be resumed, the first live client restores the cross-live room connection with the second live client.
- the embodiments of the present application can help a host who is currently connecting across live broadcast rooms to quickly restore the cross live broadcast room connection after quitting the cross live broadcast room connection halfway due to an abnormal situation, which greatly improves user experience.
- the embodiment of the present application also provides a device for restoring connections across live broadcast rooms, which is applied to a live broadcast client, and the device includes:
- FIG. 4 a block diagram of a structure of a recovery device for connecting a connection between a live broadcast room provided by an embodiment of the present application is shown, which may specifically include the following modules:
- the obtaining module 401 is configured to, if the first live client client withdraws from the cross-live room connection with the second live client due to an abnormal situation, restart the broadcast within a preset time, the first live client obtains the server sending The first connection status information; the first connection status information is the connection status information sent by the server periodically for the connection between the first live client and the second live client to connect across the live broadcast room ;
- the judgment module 402 is used for the first live broadcast client to judge whether the connection between the live broadcast rooms needs to be restored according to the first connection state information
- the restoration module 403 is configured to restore the connection between the first live client and the second live client if it is determined that the cross-live room connection needs to be restored.
- the obtaining module 401 includes:
- the first acquisition submodule is used for the first live client to receive the first connection status information periodically sent by the server after the first live client restarts the broadcast.
- the obtaining module 401 includes:
- the second obtaining submodule is used for the first live client to obtain from the preset disk before the first live client quits the cross-live room connection with the second live client due to an abnormal situation , the first connection status information periodically sent by the server stored by the first live client client.
- the judging module 402 includes:
- the third acquisition sub-module is used for the first live client to request the second connection state information of the cross-live room connection from the server after restarting the broadcast;
- a determination submodule used by the first live client to determine the latest connection state information in the first connection state information and the second connection state information
- the judgment submodule is used for the first live broadcast client to judge whether the connection between the live broadcast rooms needs to be restored according to the latest connection state information.
- the judging submodule includes:
- connection state identifier acquisition unit used for the first live client to acquire the connection state identifier included in the latest connection state information
- a first restoration unit configured to, if the connection state identifier included in the latest connection state information indicates a connection state, the first live broadcast client determines that the connection between the live broadcast rooms needs to be restored;
- the second restoration unit is configured to, if the connection state identifier included in the latest connection state information does not indicate a connection state, the first live broadcast client determines that it is not necessary to restore the connection across the live broadcast room.
- a timestamp is added to the first connection state information and the second connection state information, and the determining submodule includes:
- a comparison unit configured to compare the timestamps corresponding to the first connection state information and the second connection state information
- a determining unit configured to determine the connection state information corresponding to the latest time stamp as the latest connection state information.
- the method further includes:
- the connection termination module is configured to: if the first live client does not restart the broadcast within a preset time after the first live client exits the cross-live connection with the second live client due to an abnormal situation, the first live client The live client generates connection end information, and sends the connection end information to the server; wherein the connection end information is used to instruct the server to disconnect the cross-live room connection.
- the first connection state information includes a connection session identifier, a connection state identifier, user identifiers of both parties to the connection, and room identifiers of both parties to the connection, and the method further includes:
- the abnormal exit module is used for, when the first live client client detects that it has exited the cross-live room connection, if the connection status identifier indicates a connection status, and the connection session identifier, all If the user identifiers of both parties in the connection and the room identifiers of the two parties in the connection match with the information of the connection between the two live broadcast rooms, then it is determined that the first live broadcast client has withdrawn from the cross-connection with the second live broadcast client due to an abnormal situation. Live connection.
- the apparatus for restoring connections across live broadcast rooms provided by the embodiments of the present application has functional modules corresponding to the method for restoring connections across live broadcast rooms, and can execute the methods for restoring connections across live broadcast rooms provided by the embodiments of the present application, and can achieve same beneficial effect.
- Embodiments of the present application further provide an electronic device, which may include: a processor, a memory, and a computer program stored on the memory and executable on the processor, when the processor executes the program
- the electronic device may specifically include: a processor 501 , a storage device 502 , a display screen 503 , an input device 504 , an output device 505 , and a communication device 506 .
- the number of processors 501 in the electronic device may be one or more, and one processor 501 is taken as an example in FIG. 5 .
- the processor 501 , the storage device 502 , the display screen 503 , the input device 504 , the output device 505 and the communication device 506 of the electronic device may be connected by a bus or in other ways.
- Embodiments of the present application further provide a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium runs on a computer, the computer enables the computer to execute any of the above-mentioned embodiments. line recovery method.
- Embodiments of the present application also provide a computer program product including instructions, which, when run on a computer, enables the computer to execute the method for restoring a connection across a live broadcast room described in any of the foregoing embodiments.
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Databases & Information Systems (AREA)
- General Engineering & Computer Science (AREA)
- Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
Abstract
Embodiments of the present application provide a method and device for recovering an inter-live streaming studio connection. The method comprises: if a first live streaming client re-starts live streaming within a preset time period after exiting an inter-live streaming studio connection with a second live streaming client due to an abnormality, the first live streaming client obtains first connection state information sent by a server, wherein the first connection state information is connection state information periodically sent by the server for the inter-live streaming studio connection between the first live streaming client and the second live streaming client; then the first live streaming client determines, according to the first connection state information, whether there is a need to recover the inter-live streaming studio connection; if it is determined that there is a need to recover the inter-live streaming studio connection, the first live streaming client recovers the inter-live streaming studio connection with the second live streaming client. According to the embodiments of the present application, an anchor in inter-live streaming studio connection can quickly recover the inter-live streaming studio connection after exiting the inter-live streaming studio connection in the middle of the inter-live streaming studio connection due to an abnormality, thereby greatly improving user experience.
Description
相关申请的交叉引用CROSS-REFERENCE TO RELATED APPLICATIONS
本公开要求在2021年1月29日提交中国专利局、申请号为202110130836.3、名称为“一种跨直播间连线的恢复方法和装置”的中国专利申请的优先权,其全部内容通过引用结合在本公开中。This disclosure claims the priority of a Chinese patent application with application number 202110130836.3 and titled "A Method and Device for Restoring Connections between Live Streaming Rooms" filed with the Chinese Patent Office on January 29, 2021, the entire contents of which are incorporated by reference in this disclosure.
本申请涉及跨直播间连线技术领域,特别是涉及一种跨直播间连线的恢复方法和装置。The present application relates to the technical field of connections between live broadcast rooms, and in particular, to a method and device for restoring connections across live broadcast rooms.
近年来直播产业发展迅猛,直播能够全面地传递商品信息、可以通过聚集的人气去营造团购氛围、能够去打造用户的应用场景、利用互动式的方式去激发消费者的潜在需求和增强粉丝的粘性等等,直播越来越受到人们的青睐。In recent years, the live broadcast industry has developed rapidly. Live broadcast can comprehensively convey product information, create a group buying atmosphere through the gathering popularity, create user application scenarios, and use interactive methods to stimulate consumers' potential needs and enhance fans' stickiness. Wait, live streaming is becoming more and more popular.
跨直播间连线是一种基于直播技术,将不同直播间的音视频流进行合并的连线技术,可以在同一个屏幕中显示多个直播间的音视频流,例如连线PK是其中一种基于跨直播间连线的玩法,它是在规定时间内获得打赏更多的主播获胜,然而如果其中一位主播的APP突然崩溃或异常退出,该主播无法回到这次的连线PK中,即使在APP崩溃或异常退出之前,该主播处于领先的状态,也会因为没有及时回到连线PK中而被判定为逃跑,导致输掉这次的PK,这对于该主播来说是一个相当糟糕的体验。Cross-live room connection is a connection technology based on live broadcast technology, which combines the audio and video streams of different live rooms. It can display the audio and video streams of multiple live rooms on the same screen. For example, the connection PK is one of the This is a game based on the connection between the live broadcast rooms. It is that the anchor who gets more rewards within the specified time wins. However, if one of the anchor's APP suddenly crashes or exits abnormally, the anchor cannot return to the connection PK this time. , even before the APP crashed or exited abnormally, the anchor was in a leading state, and it was judged to be running away because he did not return to the connection PK in time, resulting in losing this PK, which is a big problem for the anchor. A pretty bad experience.
发明内容SUMMARY OF THE INVENTION
有鉴于此,本申请提供一种跨直播间连线的恢复方法,在一定程度上解决了因APP崩溃或异常退出跨直播间连线后,无法快速恢复跨直播间连线的问题。In view of this, the present application provides a method for restoring the connection between the live broadcast rooms, which to a certain extent solves the problem that the connection between the live broadcast rooms cannot be quickly restored after the APP crashes or exits the connection between the live broadcast rooms abnormally.
本申请实施例还提供了一种跨直播间连线的恢复装置,以保证上述方法的实施。The embodiment of the present application also provides a device for restoring connections across live broadcast rooms, so as to ensure the implementation of the above method.
为了解决上述问题,本申请实施例公开了一种跨直播间连线的恢复方法,应用于直播客户端,所述方法包括:In order to solve the above problem, an embodiment of the present application discloses a method for restoring a connection between a live broadcast room, which is applied to a live broadcast client, and the method includes:
若第一直播客户端在因异常情况退出与第二直播客户端进行的跨直播间连线之后的预设时间内重新开播,则所述第一直播客户端获取服务器发送的第一连线状态信息;所述第一连线状态信息为所述服务器周期发送的针对所述第一直播客户端与所述第二直播客户端进行跨直播间连线的连线状态信息;If the first live broadcast client restarts the broadcast within a preset time after the first live broadcast client quits the cross-live broadcast room connection with the second live broadcast client due to an abnormal situation, the first live broadcast client obtains the first connection status sent by the server. information; the first connection state information is the connection state information periodically sent by the server for the connection between the first live client and the second live client to perform a cross-live connection;
所述第一直播客户端根据所述第一连线状态信息判断是否需要恢复跨直播间连线;The first live broadcast client determines whether the connection between the live broadcast rooms needs to be restored according to the first connection state information;
若判断为需要恢复跨直播间连线,则所述第一直播客户端恢复与所述第二直播客户端的跨直播间连线。If it is determined that the cross-live broadcast room connection needs to be resumed, the first live broadcast client resumes the cross-live broadcast room connection with the second live broadcast client.
本申请实施例还提供了一种跨直播间连线的恢复装置,应用于直播客户端,所述装置包括:The embodiment of the present application also provides a device for restoring connections across live broadcast rooms, which is applied to a live broadcast client, and the device includes:
获取模块,用于若第一直播客户端在因异常情况退出与第二直播客户端进行的跨直播间连线之后的预设时间内重新开播,则所述第一直播客户端获取服务器发送的第一连线状态信息;所述第一连线状态信息为所述服务器周期发送的针对所述第一直播客户端与所述第二直播客户端进行跨直播间连线的连线状态信息;The obtaining module is used for obtaining the data sent by the server if the first live client quits the cross-live room connection with the second live client due to an abnormal situation and restarts the broadcast within a preset time. The first connection status information; the first connection status information is the connection status information periodically sent by the server for the connection between the first live client and the second live client to connect across the live broadcast room;
判断模块,用于所述第一直播客户端根据所述第一连线状态信息判断是否需要恢复跨直播间连线;a judgment module, used for the first live broadcast client to judge whether the connection between the live broadcast rooms needs to be restored according to the first connection state information;
恢复模块,用于若判断为需要恢复跨直播间连线,则所述第一直播客户端恢复与所述第二直播客户端的跨直播间连线。A recovery module, configured to restore the cross-live room connection between the first live client client and the second live client if it is determined that the cross-live room connection needs to be resumed.
本申请实施例还提供了一种电子设备,包括有存储器,以及一个或者一个以上的程序,其中一个或者一个以上程序存储于存储器中,且经配置以由一个或者一个以上处理器执行所述一个或者一个以上程序包含用于执行如本申请实施例任一所述的跨直播间连线的恢复方法。Embodiments of the present application also provide an electronic device including a memory and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by one or more processors. Or one or more programs include a method for restoring a connection between live broadcast rooms as described in any of the embodiments of the present application.
与现有技术相比,本申请实施例包括以下优点:Compared with the prior art, the embodiments of the present application include the following advantages:
本申请实施例中,若第一直播客户端在因异常情况退出与第二直播客户端进行的跨直播间连线之后的预设时间内重新开播,则第一直播客户端获取服务器发送的第一连线状态信息,其中,第一连线状态信息为服务器周期发送的针对第一直播客户端与第二直播客户端进行跨直播间连线的连线状态信 息,然后第一直播客户端根据第一连线状态信息判断是否需要恢复跨直播间连线,若判断为需要恢复跨直播间连线,则第一直播客户端恢复与第二直播客户端的跨直播间连线。本申请实施例可以帮助正在进行跨直播间连线的主播在因异常情况而中途退出跨直播间连线后,迅速恢复跨直播间连线,大大提升了用户体验。In this embodiment of the present application, if the first live broadcast client restarts the broadcast within a preset time after the first live broadcast client quits the cross-live broadcast room connection with the second live broadcast client due to an abnormal situation, the first live broadcast client obtains the first live broadcast client sent by the server. A connection state information, wherein the first connection state information is the connection state information periodically sent by the server for the connection between the first live client and the second live client to perform a cross-live connection, and then the first live client according to The first connection status information determines whether the cross-live room connection needs to be resumed. If it is determined that the cross-live room connection needs to be resumed, the first live client restores the cross-live room connection with the second live client. The embodiments of the present application can help a host who is currently connecting across live broadcast rooms to quickly restore the cross live broadcast room connection after quitting the cross live broadcast room connection halfway due to an abnormal situation, which greatly improves user experience.
上述说明仅是本公开技术方案的概述,为了能够更清楚了解本公开的技术手段,而可依照说明书的内容予以实施,并且为了让本公开的上述和其它目的、特征和优点能够更明显易懂,以下特举本公开的具体实施方式。The above description is only an overview of the technical solutions of the present disclosure. In order to understand the technical means of the present disclosure more clearly, it can be implemented according to the contents of the description, and in order to make the above-mentioned and other purposes, features and advantages of the present disclosure more obvious and easy to understand , the following specific embodiments of the present disclosure are given.
通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本发明的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are for the purpose of illustrating preferred embodiments only and are not to be considered limiting of the invention. Also, the same components are denoted by the same reference numerals throughout the drawings. In the attached image:
图1是本申请实施例提供的一种跨直播间连线的恢复方法的步骤流程图;1 is a flow chart of steps of a method for restoring a connection between a live broadcast room provided by an embodiment of the present application;
图2是本申请实施例提供的一种跨直播间连线的恢复方法的步骤流程图;2 is a flow chart of steps of a method for restoring a connection between a live broadcast room provided by an embodiment of the present application;
图3是本申请实施例提供的一种跨直播间连线的恢复方法的步骤流程图;3 is a flow chart of steps of a method for restoring a connection between a live broadcast room provided by an embodiment of the present application;
图4是本申请实施例提供的一种跨直播间连线的恢复装置的结构框图;FIG. 4 is a structural block diagram of a recovery device for a connection across a live broadcast room provided by an embodiment of the present application;
图5是本申请实施例提供的一种电子设备。FIG. 5 is an electronic device provided by an embodiment of the present application.
下面将参照附图更详细地描述本发明的示例性实施例。虽然附图中显示了本发明的示例性实施例,然而应当理解,可以以各种形式实现本发明而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本发明,并且能够将本发明的范围完整的传达给本领域的技术人员。Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present invention are shown in the drawings, it should be understood that the present invention may be embodied in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided so that the present invention will be more thoroughly understood, and will fully convey the scope of the present invention to those skilled in the art.
参照图1,示出了本申请实施例提供的一种跨直播间连线的恢复方法的步骤流程图,应用于直播客户端,该方法具体可以包括如下步骤:Referring to FIG. 1 , a flowchart of steps of a method for restoring a connection between a live broadcast room provided by an embodiment of the present application is shown, which is applied to a live broadcast client. The method may specifically include the following steps:
步骤101,若第一直播客户端在因异常情况退出与第二直播客户端进行的跨直播间连线之后的预设时间内重新开播,则所述第一直播客户端获取服务器发送的第一连线状态信息;所述第一连线状态信息为所述服务器周期发送 的针对所述第一直播客户端与所述第二直播客户端进行跨直播间连线的连线状态信息。Step 101: If the first live broadcast client exits the cross-live broadcast room connection with the second live broadcast client due to an abnormal situation and restarts the broadcast within a preset time, then the first live broadcast client obtains the first broadcast sent by the server. Connection status information; the first connection status information is the connection status information periodically sent by the server for the connection between the first live broadcast client and the second live broadcast client to be connected across the live broadcast room.
在本申请实施例中,直播客户端可以是在移动中使用的计算机设备,例如,手机、iPad(平板电脑)、笔记本电脑等等,本申请对此不加以限制。这些直播客户端可以支持Android(安卓)、iOS(iPhone Operation System,苹果操作***)、windows等操作***。In this embodiment of the present application, the live broadcast client may be a computer device used on the move, such as a mobile phone, an iPad (tablet computer), a notebook computer, etc., which is not limited in this application. These live streaming clients can support Android (Android), iOS (iPhone Operation System, Apple operating system), windows and other operating systems.
本申请实施例在因异常情况退出跨直播间连线之前,第一直播客户端和第二直播客户端是正常进行跨直播间连线的,在此过程中,服务器会周期发送第一连线状态信息给第一直播客户端和第二直播客户端,例如服务器每10秒发送一次,其中第一连线状态信息为服务器周期发送的针对第一直播客户端与第二直播客户端进行跨直播间连线的连线状态信息。第一直播客户端可以接收服务器周期发送的第一连线状态信息,然后将第一连线状态信息保存到本地内存中,同样地,第二直播客户端也可以接收服务器周期发送的第一连线状态信息,然后将第一连线状态信息保存到本地内存中,使得第一直播客户端与第二直播客户端可以同步连线状态,从而通过服务器维护第一直播客户端和第二直播客户端的状态,避免了第一直播客户端和第二直播客户端的状态不同步情况。In this embodiment of the present application, before the cross-live room connection is withdrawn due to an abnormal situation, the first live client and the second live client are normally connected across the live room. During this process, the server will periodically send the first connection The status information is sent to the first live broadcast client and the second live broadcast client, for example, the server sends it every 10 seconds, wherein the first connection status information is periodically sent by the server for cross live broadcast between the first live broadcast client and the second live broadcast client Connection status information for the connection. The first live broadcast client can receive the first connection status information periodically sent by the server, and then save the first connection status information in the local memory. Similarly, the second live broadcast client can also receive the first connection status information periodically sent by the server. and then save the first connection status information in the local memory, so that the first live client and the second live client can synchronize the connection status, so as to maintain the first live client and the second live client through the server. The state of the first live broadcast client and the second live broadcast client are prevented from being out of synchronization.
在本申请实施例中,异常情况可以是网络卡顿、APP崩溃、用户不小心按了home键返回了主界面、***内存不足等等,本申请对此不加以限制。如果第一直播客户端因为异常情况退出跨直播间连线之后,在预设时间内,第一直播客户端接收到主播的重新开播指令,则第一直播客户端可以获取服务器发送的第一连线状态信息。In the embodiment of the present application, the abnormal situation may be network freeze, APP crash, the user accidentally presses the home button to return to the main interface, the system memory is insufficient, etc., which is not limited in the present application. If the first live broadcast client withdraws from the cross-live broadcast room connection due to an abnormal situation, within a preset time, the first live broadcast client receives the host's restart instruction, the first live broadcast client can obtain the first connection sent by the server. Line status information.
步骤102,所述第一直播客户端根据所述第一连线状态信息判断是否需要恢复跨直播间连线。In step 102, the first live broadcast client determines whether the connection between the live broadcast rooms needs to be restored according to the first connection state information.
以基于跨直播间连线的一种连线PK玩法为例,连线PK是在规定时间内,两位主播分别通过才艺展示来吸引观众对主播打赏,在结束的时候,获得打赏最多的主播获胜。因此,在连线PK开始到结束的这段时间内,主播不能中途离线,否则在离线前即使是领先状态,也会在离线时间内失去观众的支持和打赏,落后于另外一方,然而有时候会因为不可控制的因素导致APP崩溃或异常退出跨直播间连线。在现有技术中,在一方退出跨直播间连线,另一 方仍在跨直播间连线时,退出跨直播间连线的主播即使重新开播后也无法回到跨直播间连线,直到与服务器的心跳包超时2分钟,服务器就会断开两个直播客户端的跨直播间连线。Take the online PK gameplay based on the connection between the live broadcast rooms as an example. The online PK is that within a specified time, the two anchors use talent shows to attract the audience to give rewards to the anchors. At the end, they get the most rewards. The anchor wins. Therefore, during the period from the beginning to the end of the online PK, the anchor cannot go offline halfway, otherwise even if it is in a leading state before going offline, it will lose the support and rewards of the audience during the offline time, and lag behind the other party. Sometimes due to uncontrollable factors, the APP will crash or abnormally exit the cross-live room connection. In the prior art, when one party exits the cross-live room connection and the other party is still connected across the live room, the anchor who exits the cross-live room connection cannot return to the cross-live room connection even after restarting the broadcast, until it connects with the cross-live room. If the heartbeat packet of the server times out by 2 minutes, the server will disconnect the cross-live streaming connection between the two live streaming clients.
本申请实施例在第一直播客户端和第二直播客户端进行跨直播间连线的过程中,服务器会周期发送第一连线状态信息给第一直播客户端和第二直播客户端,如果第一直播客户端因为异常情况退出跨直播间连线之后,在预设时间内重新开播,那么第一直播客户端可以获取服务器发送的第一连线状态信息。由于第一直播客户端重新开播之后无法确定连线状态是正常退出的状态还是异常退出的状态。例如,如果是正常退出的状态,那么连线状态是结束连线状态;如果是异常退出的状态,那么连线状态是正在连线状态,所以第一直播客户端可以根据第一连线状态信息判断是否需要恢复跨直播间连线。In this embodiment of the present application, during the process of connecting the first live client and the second live client across the live broadcast room, the server will periodically send the first connection status information to the first live client and the second live client. If After the first live broadcast client exits the cross-live broadcast room connection due to an abnormal situation, and restarts the broadcast within a preset time, the first live broadcast client can obtain the first connection status information sent by the server. After the first live broadcast client is restarted, it cannot be determined whether the connection state is a normal exit state or an abnormal exit state. For example, if it is a normal exit state, the connection state is the end connection state; if it is an abnormal exit state, then the connection state is the connection state, so the first live client can use the first connection state information according to the information Determine if you need to restore the connection between the live broadcast rooms.
具体地,第一直播客户端可以获取第一连线状态信息所包括的连线状态标识,如果连线状态标识表示正在连线状态,说明第一直播客户端是异常退出跨直播间连线,那么第一直播客户端可以判断需要恢复跨直播间连线;如果连线状态标识不表示正在连线状态,例如结束连线状态,说明第一直播客户端是正常退出跨直播间连线,那么第一直播客户端可以判断不需要恢复跨直播间连线。Specifically, the first live broadcast client can obtain the connection state identifier included in the first connection state information. If the connection state identifier indicates the connection state, it means that the first live broadcast client exits the cross-live broadcast room connection abnormally. Then the first live client can judge that the cross-live room connection needs to be resumed; if the connection status indicator does not indicate the connection status, such as the end of the connection state, it means that the first live client has exited the cross-live room connection normally, then The first live broadcast client may determine that it is not necessary to restore the connection between the live broadcast rooms.
步骤103,若判断为需要恢复跨直播间连线,则所述第一直播客户端恢复与所述第二直播客户端的跨直播间连线。Step 103: If it is determined that the cross-live broadcast room connection needs to be restored, the first live broadcast client resumes the cross-live broadcast room connection with the second live broadcast client.
在本申请实施例中,如果第一直播客户端判断需要恢复跨直播间连线,那么第一直播客户端可以采用第一连线状态信息恢复与第二直播客户端的跨直播间连线,这样可以及时地回到跨直播间连线中,解决了现有技术中即使重新开播后也无法回到跨直播间连线的问题。In this embodiment of the present application, if the first live broadcast client determines that it is necessary to restore the connection across the live broadcast room, the first live broadcast client can use the first connection state information to restore the cross-live broadcast room connection with the second live broadcast client, so that It is possible to return to the cross-live room connection in time, which solves the problem in the prior art that the cross-live room connection cannot be returned even after restarting the broadcast.
需要说明的是,如果第一直播客户端判断不需要恢复跨直播间连线,那么第一直播客户端可以不恢复与第二直播客户端的跨直播间连线,此时,第一直播客户端可以重新向第二直播客户端发送邀请,第一直播客户端与第二直播客户端重新跨直播间连线。It should be noted that, if the first live broadcast client determines that it is not necessary to restore the cross-live broadcast room connection, then the first live broadcast client may not resume the cross-live broadcast room connection with the second live broadcast client. At this time, the first live broadcast client The invitation may be sent to the second live broadcast client again, and the first live broadcast client and the second live broadcast client will be reconnected across the live broadcast room.
本申请实施例中,若第一直播客户端在因异常情况退出与第二直播客户端进行的跨直播间连线之后的预设时间内重新开播,则第一直播客户端获取服务器发送的第一连线状态信息,其中,第一连线状态信息为服务器周期发 送的针对第一直播客户端与第二直播客户端进行跨直播间连线的连线状态信息,然后第一直播客户端根据第一连线状态信息判断是否需要恢复跨直播间连线,若判断为需要恢复跨直播间连线,则第一直播客户端恢复与第二直播客户端的跨直播间连线。本申请实施例可以帮助正在进行跨直播间连线的主播在因异常情况而中途退出跨直播间连线后,迅速恢复跨直播间连线,大大提升了用户体验。In this embodiment of the present application, if the first live broadcast client restarts the broadcast within a preset time after the first live broadcast client quits the cross-live broadcast room connection with the second live broadcast client due to an abnormal situation, the first live broadcast client obtains the first live broadcast client sent by the server. A connection state information, wherein the first connection state information is the connection state information periodically sent by the server for the connection between the first live client and the second live client to perform a cross-live connection, and then the first live client according to The first connection status information determines whether the cross-live room connection needs to be resumed. If it is determined that the cross-live room connection needs to be resumed, the first live client restores the cross-live room connection with the second live client. The embodiments of the present application can help a host who is currently connecting across live broadcast rooms to quickly restore the cross live broadcast room connection after quitting the cross live broadcast room connection halfway due to an abnormal situation, which greatly improves user experience.
参照图2,示出了本申请实施例提供的一种跨直播间连线的恢复方法的步骤流程图,应用于直播客户端,该方法具体可以包括如下步骤:Referring to FIG. 2 , a flowchart of steps of a method for restoring a connection between a live broadcast room provided by an embodiment of the present application is shown, which is applied to a live broadcast client, and the method may specifically include the following steps:
步骤201,若第一直播客户端在因异常情况退出与第二直播客户端进行的跨直播间连线之后的预设时间内重新开播,则所述第一直播客户端接收,在所述第一直播客户端重新开播后所述服务器周期发送的第一连线状态信息;所述第一连线状态信息为所述服务器周期发送的针对所述第一直播客户端与所述第二直播客户端进行跨直播间连线的连线状态信息。 Step 201, if the first live broadcast client exits the cross-live broadcast room connection with the second live broadcast client due to an abnormal situation and restarts the broadcast within a preset time, the first live broadcast client receives the broadcast, and the first live broadcast client receives the broadcast. A first connection status information periodically sent by the server after the live client is restarted; the first connection status information is periodically sent by the server for the first live client and the second live client The connection status information of the connection between the terminal and the cross-broadcast room.
以跨直播间连线的一种连线PK玩法为例,连线PK是两位主播在两个直播间进行实时的音视频流PK互动,在连线PK之前,一位主播需要向另一位主播发起PK邀请,如果另一位主播接受PK邀请,那么发起PK邀请的直播客户端就可以通过服务器获取接受PK邀请的直播客户端的音视频流,这样两位主播就可以开始连线PK了。在现有技术中,在开始跨连线房间时,两个直播客户端分别将连线状态信息存储至本地内存,在此之后,服务器没有周期发送连线状态信息给两个直播客户端。如果其中一个直播客户端的直播APP突然奔溃或异常退出跨直播间连线,那么存在本地内存中的连线状态信息会丢失,即使重新开播后也无法恢复跨直播间连线,只能等到另一直播客户端也退出跨直播间连线,然后两个直播客户端重新开播和重新连线才能再次进行跨直播间连线,否则直到与服务器的心跳包超时2分钟,服务器就会断开两个直播客户端的跨直播间连线。Take a connection PK game that is connected across live broadcast rooms as an example. Connection PK is a real-time audio and video stream PK interaction between two anchors in two live broadcast rooms. A host initiates a PK invitation. If another host accepts the PK invitation, the live client who initiated the PK invitation can obtain the audio and video streams of the live client who accepted the PK invitation through the server, so that the two hosts can start connecting to the PK. . In the prior art, when the connection room starts to be bridged, the two live clients store the connection state information in the local memory respectively, and after that, the server does not periodically send the connection state information to the two live clients. If the live app of one of the live clients suddenly crashes or exits the cross-live room connection abnormally, the connection status information in the local memory will be lost. Even after restarting the broadcast, the cross-live room connection cannot be restored. Once the live client also exits the cross live room connection, and then the two live broadcast clients restart and reconnect before they can connect to the cross live room again, otherwise the server will disconnect the two live broadcast rooms until the heartbeat packet with the server times out for 2 minutes. A cross-live room connection of a live client.
在本申请实施例中,在第一直播客户端与第二直播客户端进行跨直播间连线的过程中,服务器会周期发送第一连线状态信息给第一直播客户端和第二直播客户端,例如服务器每10秒发送。第一直播客户端可以接收服务器周期发送的第一连线状态信息,然后将第一连线状态信息保存到本地内存中,同样地,第二直播客户端也可以接收服务器周期发送的第一连线状态信息, 然后将第一连线状态信息保存到本地内存中。如果第一直播客户端在因异常情况退出与第二直播客户端进行的跨直播间连线之后,在预设时间内,例如在2分钟内,服务器还是可以继续周期发送第一连线状态信息给第一直播客户端和第二直播客户端的,然而退出跨直播间连线的第一直播客户端是无法接收到服务器发送的第一连线状态信息。本申请实施例在预设时间内重新开播时,退出跨直播间连线的第一直播客户端的连线程序可以立刻注册***,然后可以采用***继续接收第一连线状态信息。In the embodiment of the present application, during the process of connecting the first live client and the second live client across the live broadcast room, the server will periodically send the first connection status information to the first live client and the second live client side, e.g. the server sends every 10 seconds. The first live broadcast client can receive the first connection status information periodically sent by the server, and then save the first connection status information in the local memory. Similarly, the second live broadcast client can also receive the first connection status information periodically sent by the server. line state information, and then save the first connection state information to the local memory. If the first live client quits the cross-live room connection with the second live client due to an abnormal situation, within a preset time, such as within 2 minutes, the server can continue to periodically send the first connection status information For the first live broadcast client and the second live broadcast client, the first live broadcast client that exits the cross-live broadcast room connection cannot receive the first connection status information sent by the server. When the embodiment of the present application restarts the broadcast within the preset time, the connection program of the first live broadcast client that exits the connection across the live broadcast room can immediately register the listener, and then the listener can continue to receive the first connection state information.
步骤202,所述直播客户端在重新开播后,向所述服务器请求跨直播间连线的第二连线状态信息。Step 202: After restarting the broadcast, the live client client requests the server for second connection status information of the connection between the live broadcast rooms.
在本申请实施例中,直播客户端每次开播,都可以向服务器请求连线状态信息,因此,第一直播客户端在重新开播后,可以向服务器请求跨直播间连线的第二连线状态信息。In the embodiment of the present application, every time the live broadcast client starts broadcasting, it can request the connection status information from the server. Therefore, after the first live broadcast client restarts the broadcast, it can request the server for a second connection that is connected across the live broadcast room. status information.
需要说明的是,第一连线状态信息是服务器主动向第一直播客户端或第二直播客户端发送的,第二连线状态信息是第一直播客户端或第二直播客户端在开播后主动向服务器请求的,即:第一连线状态信息是服务器主动发送的,第二连线状态信息是直播客户端主动请求的。It should be noted that the first connection status information is actively sent by the server to the first live broadcast client or the second live broadcast client, and the second connection status information is after the first live broadcast client or the second live broadcast client starts broadcasting. Actively requested from the server, that is, the first connection status information is actively sent by the server, and the second connection status information is actively requested by the live client.
步骤203,确定所述第一连线状态信息和所述第二连线状态信息中,最新的连线状态信息。Step 203: Determine the latest connection state information in the first connection state information and the second connection state information.
本申请实施例在重新开播后,第一直播客户端可以采用***继续接收服务器周期发送的第一连线状态信息,以及,第一直播客户端可以主动向服务器请求第二连线状态信息,由于重新开播后的连线状态是实时变化的,所以第一直播客户端需要确定第一连线状态信息和第二连线状态信息中,最新的连线状态信息。After restarting the broadcast in this embodiment of the present application, the first live broadcast client may continue to receive the first connection status information periodically sent by the server by using the listener, and the first live broadcast client may actively request the server for the second connection status information, Since the connection state after re-broadcasting changes in real time, the first live broadcast client needs to determine the latest connection state information among the first connection state information and the second connection state information.
本申请的一个可选实施例中,所述第一连线状态信息和所述第二连线状态信息添加有时间戳,步骤203可以包括以下子步骤:In an optional embodiment of the present application, a timestamp is added to the first connection state information and the second connection state information, and step 203 may include the following sub-steps:
比较所述第一连线状态信息和所述第二连线状态信息对应的时间戳;将最新的所述时间戳对应的连线状态信息确定为所述最新的连线状态信息。comparing the time stamps corresponding to the first connection state information and the second connection state information; and determining the connection state information corresponding to the latest time stamp as the latest connection state information.
由于网络状态会存在不可控的因素,所以第一直播客户端无法保证第一连线状态信息和第二连线状态信息中,哪个连线状态信息是最新的连线状态信息。例如服务器每10秒发送第一连线状态信息,第一直播客户端在开播的 第1秒向服务器请求第二连线状态信息,服务器在第2秒返回第二连线状态信息给第一直播客户端,如果网络状态突然卡顿,第一连线状态信息可能比第二连线状态信息先到达,正常来说,第二连线状态信息是比第一连线状态信息先到达的,然而第一直播客户端无法确定哪个是最新的连线状态信息的。上述示例仅用于使本领域技术人员更好理解本申请实施例,本申请对此不作出限定。Since the network state may have uncontrollable factors, the first live broadcast client cannot guarantee which connection state information is the latest connection state information among the first connection state information and the second connection state information. For example, the server sends the first connection status information every 10 seconds, the first live broadcast client requests the second connection status information from the server in the first second of the broadcast, and the server returns the second connection status information to the first live broadcast in the second second On the client side, if the network status suddenly freezes, the first connection status information may arrive before the second connection status information. Normally, the second connection status information arrives before the first connection status information. However, The first live broadcast client cannot determine which is the latest connection status information. The above examples are only used to make those skilled in the art better understand the embodiments of the present application, which are not limited in the present application.
在本申请实施例中,第一连线状态信息和第二连线状态信息添加有时间戳,第一直播客户端接收到第一连线状态信息和第二连线状态信息时,可以比较第一连线状态信息和第二连线状态信息对应的时间戳,然后将最新的时间戳对应的连线状态信息确定为最新的连线状态信息。例如第一连线状态信息对应的时间戳为10:25,第二连线状态信息对应的时间戳为10:30,然后第一直播客户端比较第一连线状态信息对应的时间戳10:25和第二连线状态信息对应的时间戳10:30,然后确定最新的时间戳是10:30,那么时间戳10:30对应的第二连线状态信息就是最新的连线状态信息了。上述示例仅用于使本领域技术人员更好理解本申请实施例,本申请对此不做出限定。In this embodiment of the present application, a timestamp is added to the first connection state information and the second connection state information, and when the first live broadcast client receives the first connection state information and the second connection state information, it can compare the first connection state information and the second connection state information A time stamp corresponding to the connection state information and the second connection state information, and then the connection state information corresponding to the latest time stamp is determined as the latest connection state information. For example, the timestamp corresponding to the first connection status information is 10:25, and the timestamp corresponding to the second connection status information is 10:30. Then the first live client compares the timestamp 10 corresponding to the first connection status information: 25 and the time stamp 10:30 corresponding to the second connection state information, and then determine that the latest time stamp is 10:30, then the second connection state information corresponding to the time stamp 10:30 is the latest connection state information. The above examples are only used to make those skilled in the art better understand the embodiments of the present application, which are not limited in the present application.
步骤204,所述第一直播客户端根据所述最新的连线状态信息判断是否需要恢复跨直播间连线。 Step 204, the first live broadcast client determines whether the connection between the live broadcast rooms needs to be restored according to the latest connection status information.
在本申请实施例中,由于第一直播客户端重新开播之后无法确定连线状态是正常退出的状态还是异常退出的状态。例如,如果是正常退出的状态,那么连线状态是结束连线状态;如果是异常退出的状态,那么连线状态是正在连线状态,所以第一直播客户端在第一连线状态信息和第二连线状态信息中确定最新的连线状态信息后,可以根据最新的连线状态信息判断是否需要恢复跨直播间连线。In the embodiment of the present application, after the first live broadcast client restarts the broadcast, it cannot be determined whether the connection state is a normal exit state or an abnormal exit state. For example, if it is a normal exit state, the connection state is the end connection state; if it is an abnormal exit state, then the connection state is the connection state, so the first live client is in the first connection state information and After the latest connection state information is determined in the second connection state information, it may be determined whether the connection between the live broadcast rooms needs to be restored according to the latest connection state information.
本申请的一个可选实施例中,步骤204可以包括以下子步骤:In an optional embodiment of the present application, step 204 may include the following sub-steps:
所述第一直播客户端获取所述最新的连线状态信息所包括的连线状态标识;若所述最新的连线状态信息所包括的连线状态标识表示正在连线状态,则所述第一直播客户端判断需要恢复跨直播间连线;若所述最新的连线状态信息所包括的连线状态标识不表示正在连线状态,则所述第一直播客户端判断不需要恢复跨直播间连线。The first live client obtains the connection state identifier included in the latest connection state information; if the connection state identifier included in the latest connection state information indicates a connection state, the first A live broadcast client judges that it is necessary to restore the connection between the live broadcast rooms; if the connection state identifier included in the latest connection status information does not indicate the connection status, the first live broadcast client judges that it is not necessary to restore the cross live broadcast. connection between.
需要说明的是,在第一直播客户端与第二直播客户端进行跨直播间连线 时,服务器发送的第一连线状态信息中的连线状态标识可以表示正在连线状态。在第一直播客户端正常退出与第二直播客户端进行的跨直播间连线时,第一直播客户端可以向服务器发送结束连线信息,服务器可以根据结束连线信息确定第一直播客户端需要结束跨直播间连线,那么服务器发送的第一连线状态信息中的连线状态标识可以表示结束连线状态。如果第一直播客户端中途因异常情况退出与第二直播客户端进行的跨直播间连线,那么在第一直播客户端重新开播之后,第一直播客户端无法确定连线状态是正常退出的状态还是异常退出的状态。例如,如果是正常退出的状态,那么连线状态是结束连线状态;如果是异常退出的状态,那么连线状态是正在连线状态,所以第一直播客户端可以根据最新的连线状态信息判断是否需要恢复跨直播间连线。It should be noted that, when the first live client and the second live client are connected across live rooms, the connection state identifier in the first connection state information sent by the server may indicate a connection state. When the first live broadcast client exits the cross-live broadcast room connection with the second live broadcast client normally, the first live broadcast client may send connection termination information to the server, and the server may determine the first live broadcast client according to the connection termination information. If the connection between the live broadcast rooms needs to be terminated, the connection state identifier in the first connection state information sent by the server may indicate the end connection state. If the first live broadcast client quits the cross-live broadcast connection with the second live broadcast client due to an abnormal situation, then after the first live broadcast client restarts the broadcast, the first live broadcast client cannot determine that the connection status is normal. The status is still the status of an abnormal exit. For example, if it is a normal exit state, the connection state is the end connection state; if it is an abnormal exit state, then the connection state is the connection state, so the first live client can use the latest connection state information according to the state of the connection. Determine if you need to restore the connection between the live broadcast rooms.
具体地,第一直播客户可以获取最新的连线状态信息所包括的连线状态标识,通过该连线状态标识确定最新的连线状态,如果最新的连线状态是正在连线状态,说明第一直播客户端是异常退出跨直播间连线,那么第一直播客户端可以判断需要恢复跨直播间连线;如果最新的连线状态不是正在连线状态,例如结束连线状态,说明第一直播客户端是正常退出跨直播间连线,那么第一直播客户端可以判断不需要恢复跨直播间连线。Specifically, the first live client can obtain the connection state identifier included in the latest connection state information, and determine the latest connection state through the connection state identifier. If a live client exits the cross-live room connection abnormally, the first live client can determine that the cross-live room connection needs to be resumed; If the live client exits the cross live room connection normally, the first live broadcast client can determine that it does not need to resume the cross live room connection.
步骤205,若判断为需要恢复跨直播间连线,则所述第一直播客户端恢复与所述第二直播客户端的跨直播间连线。 Step 205, if it is determined that the cross-live broadcast room connection needs to be restored, the first live broadcast client resumes the cross-live broadcast room connection with the second live broadcast client.
如果第一直播客户端确定需要恢复跨直播间连线,那么第一直播客户端可以采用最新的连线状态信息恢复与第二直播客户端的跨直播间连线。具体地,跨直播间连线的过程:第一直播客户端获取到最新的状态信息后,第一直播客户端首先初始化连线程序、初始化连线会话、初始化连线会话***,然后第一直播客户端把最新的连线状态信息发送给连线程序,连线程序从最新的连线状态信息中提取最新的连线状态,将最新的连线状态保存到连线会话中,接着直播APP布局视频和渲染画布,第一直播客户端向服务器获取第二直播客户端的音视频流,最后将第一直播客户端的音视频流和第二直播客户端的音视频流合并到直播APP的屏幕上,从而恢复了跨直播间连线,大大提升了用户体验。If the first live broadcast client determines that the cross-live broadcast room connection needs to be restored, the first live broadcast client can use the latest connection status information to restore the cross-live broadcast room connection with the second live broadcast client. Specifically, the process of connecting across the live broadcast room: after the first live broadcast client obtains the latest status information, the first live broadcast client first initializes the connection program, initializes the connection session, initializes the connection session listener, and then first The live client sends the latest connection status information to the connection program, and the connection program extracts the latest connection status from the latest connection status information, saves the latest connection status to the connection session, and then broadcasts the APP. Layout the video and render the canvas, the first live client obtains the audio and video streams of the second live client from the server, and finally merges the audio and video streams of the first live client and the second live client on the screen of the live APP, As a result, the connection between the live broadcast rooms is restored, which greatly improves the user experience.
本申请的一个可选实施例中,所述方法还可以包括:In an optional embodiment of the present application, the method may further include:
若所述第一直播客户端在因异常情况退出与第二直播客户端进行的跨直播间连线之后的预设时间内没有重新开播,则所述第一直播客户端生成连线结束信息,并向所述服务器发送所述连线结束信息;其中,所述连线结束信息用于指示所述服务器断开所述跨直播间连线。If the first live broadcast client does not restart the broadcast within a preset time after the first live broadcast client exits the cross-live broadcast room connection with the second live broadcast client due to an abnormal situation, the first live broadcast client generates connection end information, and send the connection end information to the server; wherein, the connection end information is used to instruct the server to disconnect the cross-broadcast room connection.
在本申请实施例中,第一直播客户端在因异常情况退出与第二直播客户端进行的跨直播间连线之后,如果在预设时间内,例如2分钟内,第一直播客户端没有接收到重新开播指令时,可以生成连线结束信息,然后将连线结束信息发送给服务器,通知服务器断开跨直播间连线,服务器接收到连线结束信息后,可以根据连线结束信息断开跨直播间连线。In this embodiment of the present application, after the first live broadcast client exits the cross-live broadcast room connection with the second live broadcast client due to an abnormal situation, if the first live broadcast client fails to connect within a preset time, for example, within 2 minutes When the restart instruction is received, the connection end information can be generated, and then the connection end information can be sent to the server to notify the server to disconnect the cross-live room connection. After the server receives the connection end information, it can be disconnected according to the connection end information. Open a connection across the live room.
本申请的一个可选实施例中,所述第一连线状态信息包括连线会话标识、连线状态标识、连线双方用户标识、连线双方房间标识,所述方法还可以包括:In an optional embodiment of the present application, the first connection state information includes a connection session identifier, a connection state identifier, user identifiers of both parties to the connection, and room identifiers of both parties to the connection, and the method may further include:
在所述第一直播客户端检测到退出所述跨直播间连线的情况下,若所述连线状态标识表示正在连线状态,以及所述连线会话标识、所述连线双方用户标识、所述连线双方房间标识与所述跨直播间连线的信息匹配,则确定所述第一直播客户端因异常情况退出与所述第二直播客户端进行的跨直播间连线。In the case where the first live broadcast client detects that it has withdrawn from the cross-live broadcast room connection, if the connection status identifier indicates a connection status, and the connection session identifier and the user identifiers of both parties in the connection are connected If the room identifiers of the two parties in the connection match the information of the cross-live room connection, it is determined that the first live-broadcast client quits the cross-live room connection with the second live-broadcast client due to an abnormal situation.
在本申请实施例中,如果第一直播客户端是正常退出跨直播间连线的,例如连线时间结束或者主播主动断开跨直播间连线,那么第一连线状态信息的连线状态标识表示结束连线状态,然而如果直播客户端退出跨直播间连线后,连线会话标识、连线双方用户标识、连线双方房间标识与跨直播间连线的信息匹配,而连线状态标识依然表示正在连线状态,那么可以确定第一直播客户端因异常情况退出与第二直播客户端进行的跨直播间连线。In the embodiment of the present application, if the first live client exits the cross-live room connection normally, for example, the connection time ends or the host actively disconnects the cross-live room connection, then the connection status of the first connection status information The ID indicates the end of the connection state. However, if the live client exits the cross-live room connection, the connection session ID, the user IDs of both parties, and the room IDs of both parties match the information of the cross-live room connection, and the connection status If the identifier still indicates the connection status, it can be determined that the first live broadcast client has withdrawn from the cross-live broadcast room connection with the second live broadcast client due to an abnormal situation.
本申请实施例中,若第一直播客户端在因异常情况退出与第二直播客户端进行的跨直播间连线之后的预设时间内重新开播,则第一直播客户端获取服务器发送的第一连线状态信息,其中,第一连线状态信息为服务器周期发送的针对第一直播客户端与第二直播客户端进行跨直播间连线的连线状态信息,然后第一直播客户端根据第一连线状态信息判断是否需要恢复跨直播间连线,若判断为需要恢复跨直播间连线,则第一直播客户端恢复与第二直播客户端的跨直播间连线。本申请实施例可以帮助正在进行跨直播间连线的主 播在因异常情况而中途退出跨直播间连线后,迅速恢复跨直播间连线,大大提升了用户体验。In this embodiment of the present application, if the first live broadcast client restarts the broadcast within a preset time after the first live broadcast client quits the cross-live broadcast room connection with the second live broadcast client due to an abnormal situation, the first live broadcast client obtains the first live broadcast client sent by the server. A connection state information, wherein the first connection state information is the connection state information periodically sent by the server for the connection between the first live client and the second live client to perform a cross-live connection, and then the first live client according to The first connection status information determines whether the cross-live room connection needs to be resumed. If it is determined that the cross-live room connection needs to be resumed, the first live client restores the cross-live room connection with the second live client. The embodiment of the present application can help a host who is currently connecting across a live broadcast room to quickly restore the cross-live room connection after quitting the cross-live room connection due to an abnormal situation, which greatly improves the user experience.
参照图3,示出了本申请实施例提供的一种跨直播间连线的恢复方法的步骤流程图,应用于直播客户端,该方法具体可以包括如下步骤:Referring to FIG. 3 , a flowchart of steps of a method for restoring a connection between a live broadcast room provided by an embodiment of the present application is shown, which is applied to a live broadcast client. The method may specifically include the following steps:
步骤301,若第一直播客户端在因异常情况退出与第二直播客户端进行的跨直播间连线之后的预设时间内重新开播,则所述直播客户端从预设磁盘中,获取在所述第一直播客户端因异常情况退出与所述第二直播客户端进行的跨直播间连线之前,所述第一直播客户端存储的所述服务器周期发送的第一连线状态信息;所述第一连线状态信息为所述服务器周期发送的针对所述第一直播客户端与所述第二直播客户端进行跨直播间连线的连线状态信息。 Step 301, if the first live client re-launches the broadcast within a preset time after the first live client exits the cross-live room connection with the second live client due to an abnormal situation, the live client obtains the data from the preset disk. Before the first live broadcast client exits the cross-live broadcast room connection with the second live broadcast client due to an abnormal situation, the first connection status information stored by the first live broadcast client and sent by the server periodically; The first connection state information is connection state information periodically sent by the server for the connection between the first live broadcast client and the second live broadcast client to be connected across the live broadcast room.
在退出跨直播间连线后,直播客户端的本地内存会自动清空连线状态信息,所以不管是正常退出还是异常退出,存储在本地内存的连线状态信息会丢失,这样直播客户端就无法恢复跨直播间连线了。本申请实施例在第一直播客户端与第二直播客户端进行跨直播间连线的过程中,服务器可以周期发送第一连线状态信息给第一直播客户端和第二直播客户端,例如每10秒发送一次。第一直播客户端在接收到第一连线状态信息后,可以将第一连线状态信息存储至本地内存,同时也将第一连线状态信息写入第一直播客户端的预设磁盘,也就是说,服务器每发送一次第一连线状态信息,第一直播客户端就会更新一次本地内存和预设磁盘存储的第一连线状态信息,从而保证第一直播客户端的本地内存和预设磁盘存储的第一连线状态信息都是最新的连线状态信息。同样地,第二直播客户端在接收到第一连线状态信息后,可以将第一连线状态信息存储至本地内存,同时也将第一连线状态信息写入第二直播客户端的预设磁盘,也就是说,服务器每发送一次第一连线状态信息,第二直播客户端就会更新一次本地内存和预设磁盘存储的第一连线状态信息,从而保证第二直播客户端的本地内存和预设磁盘存储的第一连线状态信息都是最新的连线状态信息。After exiting the cross-live room connection, the local memory of the live broadcast client will automatically clear the connection status information, so whether it is a normal exit or an abnormal exit, the connection state information stored in the local memory will be lost, so the live broadcast client cannot be recovered. Connected across the live room. In this embodiment of the present application, during the process of connecting the first live client and the second live client across the live broadcast room, the server may periodically send the first connection status information to the first live client and the second live client, for example Sent every 10 seconds. After receiving the first connection state information, the first live broadcast client can store the first connection state information in the local memory, and also write the first connection state information into the preset disk of the first live broadcast client, and also That is to say, every time the server sends the first connection status information, the first live broadcast client will update the first connection status information stored in the local memory and the preset disk, so as to ensure the local memory and preset of the first live broadcast client. The first connection state information stored on the disk is the latest connection state information. Similarly, after receiving the first connection state information, the second live broadcast client can store the first connection state information in the local memory, and also write the first connection state information into the preset of the second live broadcast client Disk, that is to say, every time the server sends the first connection status information, the second live broadcast client will update the first connection status information stored in the local memory and the preset disk, so as to ensure the local memory of the second live broadcast client The first connection state information stored with the preset disk is the latest connection state information.
在本申请实施例中,第一直播客户端在因异常情况退出与第二直播客户端进行的跨直播间连线之后,如果在预设时间内,例如在2分钟内,退出跨直播间连线的第一直播客户端接收到重新开播指令时,可以说明主播想要及时回到跨直播间连线,那么第一直播客户端可以读取预设磁盘存储的第一连 线状态信息,由于在第一直播客户端退出跨直播间连线后,写入预设磁盘的第一连线状态信息并不会丢失,所以第一直播客户端可以通过预设磁盘获取第一连线状态信息。In the embodiment of the present application, after the first live broadcast client quits the cross-live broadcast room connection with the second live broadcast client due to an abnormal situation, if the first live broadcast client exits the cross-live broadcast room connection within a preset time, for example, within 2 minutes When the first live broadcast client of the line receives the restart instruction, it can indicate that the host wants to return to the cross-live room connection in time, then the first live broadcast client can read the first connection status information stored in the preset disk. After the first live broadcast client exits the cross-live broadcast room connection, the first connection state information written to the preset disk will not be lost, so the first live broadcast client can obtain the first connection state information through the preset disk.
步骤302,所述第一直播客户端根据所述第一连线状态信息判断是否需要恢复跨直播间连线。 Step 302, the first live broadcast client determines whether the connection between the live broadcast rooms needs to be restored according to the first connection state information.
在本申请实施例中,第一直播客户端重新开播后,从预设磁盘获取第一连线状态信息,由于第一直播客户端无法确定连线状态是正常退出的状态还是异常退出的状态。例如,如果是正常退出的状态,那么连线状态是结束连线状态;如果是异常退出的状态,那么连线状态是正在连线状态,所以第一直播客户端可以根据第一连线状态信息判断是否需要恢复跨直播间连线。In the embodiment of the present application, after the first live broadcast client restarts the broadcast, the first connection state information is obtained from the preset disk, because the first live broadcast client cannot determine whether the connection state is a normal exit state or an abnormal exit state. For example, if it is a normal exit state, the connection state is the end connection state; if it is an abnormal exit state, then the connection state is the connection state, so the first live client can use the first connection state information according to the information Determine if you need to restore the connection between the live broadcast rooms.
具体地,第一直播客户可以获取第一连线状态信息所包括的连线状态标识,通过该连线状态标识确定预设磁盘存储的最新的连线状态,如果最新的连线状态是正在连线状态,说明第一直播客户端是异常退出跨直播间连线,那么第一直播客户端可以判断需要恢复跨直播间连线;如果最新的连线状态不是正在连线状态,例如结束连线状态,说明第一直播客户端是正常退出跨直播间连线,那么第一直播客户端可以判断不需要恢复跨直播间连线。Specifically, the first live client can obtain the connection state identifier included in the first connection state information, and use the connection state identifier to determine the latest connection state stored on the preset disk. If the latest connection state is connecting If the connection status of the first live broadcast client is abnormally exited from the cross-live broadcast room, then the first live broadcast client can determine that the cross-live room connection needs to be resumed; if the latest connection status is not the connection status, such as ending the connection status, indicating that the first live broadcast client exits the cross-live room connection normally, then the first live broadcast client can judge that it does not need to resume the cross-live room connection.
步骤303,若判断为需要恢复跨直播间连线,则所述第一直播客户端恢复与所述第二直播客户端的跨直播间连线。 Step 303, if it is determined that the cross-live broadcast room connection needs to be restored, the first live broadcast client resumes the cross-live broadcast room connection with the second live broadcast client.
在本申请实施例中,第一直播客户端如果确定需要恢复跨直播间连线,那么就可以采用第一连线状态信息恢复跨直播间连线。具体地,跨直播间连线的过程:第一直播客户端获取到第一连线状态信息后,第一直播客户端首先初始化连线程序、初始化连线会话、初始化连线会话***,然后第一直播客户端把第一连线状态信息发送给连线程序,连线程序从第一连线状态信息中,提取因异常情况退出跨直播间连线之前的连线状态,然后将该连线状态保存到连线会话中,接着直播APP布局视频和渲染画布,第一直播客户端向服务器获取第二直播客户端的音视频流,最后将第一直播客户端的音视频流和第二直播客户端的音视频流合并到直播APP的屏幕上,从而恢复了跨直播间连线,大大提升了用户体验。In this embodiment of the present application, if the first live broadcast client determines that it is necessary to restore the connection across the live broadcast room, the first connection state information may be used to restore the connection across the live broadcast room. Specifically, the process of connecting across the live broadcast room: after the first live broadcast client obtains the first connection status information, the first live broadcast client first initializes the connection program, initializes the connection session, initializes the connection session listener, and then The first live broadcast client sends the first connection state information to the connection program, and the connection program extracts the connection state before exiting the cross-live room connection due to abnormal conditions from the first connection state information, and then the connection The online state is saved to the connection session, and then the live APP layout video and renders the canvas, the first live client obtains the audio and video stream of the second live client from the server, and finally the audio and video streams of the first live client are sent to the second live client. The audio and video streams of the terminal are merged into the screen of the live broadcast APP, thus restoring the connection between the live broadcast rooms and greatly improving the user experience.
本申请的一个可选实施例中,所述方法还可以包括:In an optional embodiment of the present application, the method may further include:
若所述第一直播客户端在因异常情况退出与第二直播客户端进行的跨直 播间连线之后的预设时间内没有重新开播,则所述第一直播客户端生成连线结束信息,并向所述服务器发送所述连线结束信息;其中,所述连线结束信息用于指示所述服务器断开所述跨直播间连线。If the first live broadcast client does not restart the broadcast within a preset time after the first live broadcast client exits the cross-live broadcast room connection with the second live broadcast client due to an abnormal situation, the first live broadcast client generates connection end information, and send the connection end information to the server; wherein, the connection end information is used to instruct the server to disconnect the cross-broadcast room connection.
在本申请实施例中,此步骤的具体方式可以参见前述实施例中的描述,此处不另赘述。In this embodiment of the present application, reference may be made to the descriptions in the foregoing embodiments for the specific manner of this step, which is not repeated here.
本申请的一个可选实施例中,所述第一连线状态信息包括连线会话标识、连线状态标识、连线双方用户标识、连线双方房间标识,所述方法还可以包括:In an optional embodiment of the present application, the first connection state information includes a connection session identifier, a connection state identifier, user identifiers of both parties to the connection, and room identifiers of both parties to the connection, and the method may further include:
在所述第一直播客户端检测到退出所述跨直播间连线的情况下,若所述连线状态标识表示正在连线状态,以及所述连线会话标识、所述连线双方用户标识、所述连线双方房间标识与所述跨直播间连线的信息匹配,则确定所述第一直播客户端因异常情况退出与第二直播客户端进行的跨直播间连线。In the case where the first live broadcast client detects that it has withdrawn from the cross-live broadcast room connection, if the connection status identifier indicates a connection status, and the connection session identifier and the user identifiers of both parties in the connection are connected If the room identifiers of the two parties in the connection match with the information of the cross-live room connection, it is determined that the first live-broadcast client quits the cross-live room connection with the second live-broadcast client due to an abnormal situation.
在本申请实施例中,此步骤的具体方式可以参见前述实施例中的描述,此处不另赘述。In this embodiment of the present application, reference may be made to the descriptions in the foregoing embodiments for the specific manner of this step, which is not repeated here.
本申请实施例中,若第一直播客户端在因异常情况退出与第二直播客户端进行的跨直播间连线之后的预设时间内重新开播,则第一直播客户端获取服务器发送的第一连线状态信息,其中,第一连线状态信息为服务器周期发送的针对第一直播客户端与第二直播客户端进行跨直播间连线的连线状态信息,然后第一直播客户端根据第一连线状态信息判断是否需要恢复跨直播间连线,若判断为需要恢复跨直播间连线,则第一直播客户端恢复与第二直播客户端的跨直播间连线。本申请实施例可以帮助正在进行跨直播间连线的主播在因异常情况而中途退出跨直播间连线后,迅速恢复跨直播间连线,大大提升了用户体验。In this embodiment of the present application, if the first live broadcast client restarts the broadcast within a preset time after the first live broadcast client quits the cross-live broadcast room connection with the second live broadcast client due to an abnormal situation, the first live broadcast client obtains the first live broadcast client sent by the server. A connection state information, wherein the first connection state information is the connection state information periodically sent by the server for the connection between the first live client and the second live client to perform a cross-live connection, and then the first live client according to The first connection status information determines whether the cross-live room connection needs to be resumed. If it is determined that the cross-live room connection needs to be resumed, the first live client restores the cross-live room connection with the second live client. The embodiments of the present application can help a host who is currently connecting across live broadcast rooms to quickly restore the cross live broadcast room connection after quitting the cross live broadcast room connection halfway due to an abnormal situation, which greatly improves user experience.
本申请实施例还提供了一种跨直播间连线的恢复装置,应用于直播客户端,所述装置包括:The embodiment of the present application also provides a device for restoring connections across live broadcast rooms, which is applied to a live broadcast client, and the device includes:
参考图4,示出了本申请实施例提供的一种跨直播间连线的恢复装置的结构框图,具体可以包括如下模块:Referring to FIG. 4 , a block diagram of a structure of a recovery device for connecting a connection between a live broadcast room provided by an embodiment of the present application is shown, which may specifically include the following modules:
获取模块401,用于若第一直播客户端在因异常情况退出与第二直播客户端进行的跨直播间连线之后的预设时间内重新开播,则所述第一直播客户端获取服务器发送的第一连线状态信息;所述第一连线状态信息为所述服务器 周期发送的针对所述第一直播客户端与所述第二直播客户端进行跨直播间连线的连线状态信息;The obtaining module 401 is configured to, if the first live client client withdraws from the cross-live room connection with the second live client due to an abnormal situation, restart the broadcast within a preset time, the first live client obtains the server sending The first connection status information; the first connection status information is the connection status information sent by the server periodically for the connection between the first live client and the second live client to connect across the live broadcast room ;
判断模块402,用于所述第一直播客户端根据所述第一连线状态信息判断是否需要恢复跨直播间连线;The judgment module 402 is used for the first live broadcast client to judge whether the connection between the live broadcast rooms needs to be restored according to the first connection state information;
恢复模块403,用于若判断为需要恢复跨直播间连线,则所述第一直播客户端恢复与所述第二直播客户端的跨直播间连线。The restoration module 403 is configured to restore the connection between the first live client and the second live client if it is determined that the cross-live room connection needs to be restored.
本申请的一个可选实施例中,所述获取模块401包括:In an optional embodiment of the present application, the obtaining module 401 includes:
第一获取子模块,用于所述第一直播客户端接收,在所述第一直播客户端重新开播后所述服务器周期发送的第一连线状态信息。The first acquisition submodule is used for the first live client to receive the first connection status information periodically sent by the server after the first live client restarts the broadcast.
本申请的一个可选实施例中,所述获取模块401包括:In an optional embodiment of the present application, the obtaining module 401 includes:
第二获取子模块,用于所述第一直播客户端从预设磁盘中,获取在所述第一直播客户端因异常情况退出与所述第二直播客户端进行的跨直播间连线之前,所述第一直播客户端存储的所述服务器周期发送的第一连线状态信息。The second obtaining submodule is used for the first live client to obtain from the preset disk before the first live client quits the cross-live room connection with the second live client due to an abnormal situation , the first connection status information periodically sent by the server stored by the first live client client.
本申请的一个可选实施例中,所述判断模块402包括:In an optional embodiment of the present application, the judging module 402 includes:
第三获取子模块,用于所述第一直播客户端在重新开播后,向所述服务器请求跨直播间连线的第二连线状态信息;The third acquisition sub-module is used for the first live client to request the second connection state information of the cross-live room connection from the server after restarting the broadcast;
确定子模块,用于所述第一直播客户端确定所述第一连线状态信息和所述第二连线状态信息中,最新的连线状态信息;A determination submodule, used by the first live client to determine the latest connection state information in the first connection state information and the second connection state information;
判断子模块,用于所述第一直播客户端根据所述最新的连线状态信息判断是否需要恢复跨直播间连线。The judgment submodule is used for the first live broadcast client to judge whether the connection between the live broadcast rooms needs to be restored according to the latest connection state information.
本申请的一个可选实施例中,所述判断子模块包括:In an optional embodiment of the present application, the judging submodule includes:
连线状态标识获取单元,用于所述第一直播客户端获取所述最新的连线状态信息所包括的连线状态标识;a connection state identifier acquisition unit, used for the first live client to acquire the connection state identifier included in the latest connection state information;
第一恢复单元,用于若所述最新的连线状态信息所包括的连线状态标识表示正在连线状态,则所述第一直播客户端判断需要恢复跨直播间连线;a first restoration unit, configured to, if the connection state identifier included in the latest connection state information indicates a connection state, the first live broadcast client determines that the connection between the live broadcast rooms needs to be restored;
第二恢复单元,用于若所述最新的连线状态信息所包括的连线状态标识不表示正在连线状态,则所述第一直播客户端判断不需要恢复跨直播间连线。The second restoration unit is configured to, if the connection state identifier included in the latest connection state information does not indicate a connection state, the first live broadcast client determines that it is not necessary to restore the connection across the live broadcast room.
本申请的一个可选实施例中,所述第一连线状态信息和所述第二连线状态信息添加有时间戳,所述确定子模块包括:In an optional embodiment of the present application, a timestamp is added to the first connection state information and the second connection state information, and the determining submodule includes:
比较单元,用于比较所述第一连线状态信息和所述第二连线状态信息对 应的时间戳;a comparison unit, configured to compare the timestamps corresponding to the first connection state information and the second connection state information;
确定单元,用于将最新的所述时间戳对应的连线状态信息确定为所述最新的连线状态信息。A determining unit, configured to determine the connection state information corresponding to the latest time stamp as the latest connection state information.
本申请的一个可选实施例中,所述方法还包括:In an optional embodiment of the present application, the method further includes:
连线结束模块,用于若所述第一直播客户端在因异常情况退出与所述第二直播客户端进行的跨直播间连线之后的预设时间内没有重新开播,则所述第一直播客户端生成连线结束信息,并向所述服务器发送所述连线结束信息;其中,所述连线结束信息用于指示所述服务器断开所述跨直播间连线。The connection termination module is configured to: if the first live client does not restart the broadcast within a preset time after the first live client exits the cross-live connection with the second live client due to an abnormal situation, the first live client The live client generates connection end information, and sends the connection end information to the server; wherein the connection end information is used to instruct the server to disconnect the cross-live room connection.
本申请的一个可选实施例中,所述第一连线状态信息包括连线会话标识、连线状态标识、连线双方用户标识、连线双方房间标识,所述方法还包括:In an optional embodiment of the present application, the first connection state information includes a connection session identifier, a connection state identifier, user identifiers of both parties to the connection, and room identifiers of both parties to the connection, and the method further includes:
异常退出模块,用于在所述第一直播客户端检测到退出所述跨直播间连线的情况下,若所述连线状态标识表示正在连线状态,以及所述连线会话标识、所述连线双方用户标识、所述连线双方房间标识与所述跨直播间连线的信息匹配,则确定所述第一直播客户端因异常情况退出与所述第二直播客户端进行的跨直播间连线。The abnormal exit module is used for, when the first live client client detects that it has exited the cross-live room connection, if the connection status identifier indicates a connection status, and the connection session identifier, all If the user identifiers of both parties in the connection and the room identifiers of the two parties in the connection match with the information of the connection between the two live broadcast rooms, then it is determined that the first live broadcast client has withdrawn from the cross-connection with the second live broadcast client due to an abnormal situation. Live connection.
本申请实施例提供的跨直播间连线的恢复装置具备执行跨直播间连线的恢复方法相应的功能模块,可执行本申请实施例所提供的跨直播间连线的恢复方法,且能达到相同的有益效果。The apparatus for restoring connections across live broadcast rooms provided by the embodiments of the present application has functional modules corresponding to the method for restoring connections across live broadcast rooms, and can execute the methods for restoring connections across live broadcast rooms provided by the embodiments of the present application, and can achieve same beneficial effect.
本申请实施例还提供了一种电子设备,电子设备可以包括:处理器、存储器以及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述处理器执行所述程序时实现上述跨直播间连线的恢复方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。示例的,如图5所示,该电子设备具体可以包括:处理器501、存储装置502、显示屏503、输入装置504、输出装置505以及通信装置506。该电子设备中处理器501的数量可以是一个或者多个,图5中以一个处理器501为例。该电子设备的处理器501、存储装置502、显示屏503、输入装置504、输出装置505以及通信装置506可以通过总线或者其他方式连接。Embodiments of the present application further provide an electronic device, which may include: a processor, a memory, and a computer program stored on the memory and executable on the processor, when the processor executes the program Each process of the above embodiment of the method for restoring a connection between live broadcast rooms can be achieved, and the same technical effect can be achieved. In order to avoid repetition, details are not repeated here. For example, as shown in FIG. 5 , the electronic device may specifically include: a processor 501 , a storage device 502 , a display screen 503 , an input device 504 , an output device 505 , and a communication device 506 . The number of processors 501 in the electronic device may be one or more, and one processor 501 is taken as an example in FIG. 5 . The processor 501 , the storage device 502 , the display screen 503 , the input device 504 , the output device 505 and the communication device 506 of the electronic device may be connected by a bus or in other ways.
本申请实施例还提供了一种计算机可读存储介质,该计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机执行上述实施例中任一所述的跨直播间连线的恢复方法。Embodiments of the present application further provide a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium runs on a computer, the computer enables the computer to execute any of the above-mentioned embodiments. line recovery method.
本申请实施例还提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述实施例中任一所述的跨直播间连线的恢复方法。Embodiments of the present application also provide a computer program product including instructions, which, when run on a computer, enables the computer to execute the method for restoring a connection across a live broadcast room described in any of the foregoing embodiments.
书中的各个实施例均采用相关的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于***实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。Each embodiment in the book is described in a related manner, and the same and similar parts between the various embodiments may be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, as for the system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and for related parts, please refer to the partial descriptions of the method embodiments.
以上所述仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围。凡在本发明的精神和原则之内所作的任何修改、等同替换、改进等,均包含在本发明的保护范围内。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.
Claims (10)
- 一种跨直播间连线的恢复方法,应用于直播客户端,所述方法包括:A method for restoring a connection between a live broadcast room is applied to a live broadcast client, and the method includes:若第一直播客户端在因异常情况退出与第二直播客户端进行的跨直播间连线之后的预设时间内重新开播,则所述第一直播客户端获取服务器发送的第一连线状态信息;所述第一连线状态信息为所述服务器周期发送的针对所述第一直播客户端与所述第二直播客户端进行跨直播间连线的连线状态信息;If the first live broadcast client restarts the broadcast within a preset time after the first live broadcast client quits the cross-live broadcast room connection with the second live broadcast client due to an abnormal situation, the first live broadcast client obtains the first connection status sent by the server. information; the first connection state information is the connection state information periodically sent by the server for the connection between the first live client and the second live client to perform a cross-live connection;所述第一直播客户端根据所述第一连线状态信息判断是否需要恢复跨直播间连线;The first live broadcast client determines whether the connection between the live broadcast rooms needs to be restored according to the first connection state information;若判断为需要恢复跨直播间连线,则所述第一直播客户端恢复与所述第二直播客户端的跨直播间连线。If it is determined that the cross-live broadcast room connection needs to be resumed, the first live broadcast client resumes the cross-live broadcast room connection with the second live broadcast client.
- 根据权利要求1所述的方法,其特征在于,所述第一直播客户端获取服务器发送的第一连线状态信息,包括:The method according to claim 1, wherein the first live client client obtains the first connection status information sent by the server, comprising:所述第一直播客户端接收,在所述第一直播客户端重新开播后所述服务器周期发送的第一连线状态信息。The first live broadcast client receives the first connection status information periodically sent by the server after the first live broadcast client restarts the broadcast.
- 根据权利要求1所述的方法,其特征在于,所述第一直播客户端获取服务器发送的第一连线状态信息,包括:The method according to claim 1, wherein the first live client client obtains the first connection status information sent by the server, comprising:所述第一直播客户端从预设磁盘中,获取在所述第一直播客户端因异常情况退出与第二直播客户端进行的跨直播间连线之前,所述第一直播客户端存储的所述服务器周期发送的第一连线状态信息。The first live broadcast client obtains, from the preset disk, the data stored by the first live broadcast client before the first live broadcast client quits the cross-live broadcast connection with the second live broadcast client due to an abnormal situation. The first connection status information sent periodically by the server.
- 根据权利要求1所述的方法,其特征在于,所述第一直播客户端根据所述第一连线状态信息判断是否需要恢复跨直播间连接,包括:The method according to claim 1, wherein the first live client client determines whether the connection between the live broadcast rooms needs to be restored according to the first connection status information, comprising:所述第一直播客户端在重新开播后,向所述服务器请求跨直播间连线的第二连线状态信息;After restarting the broadcast, the first live client client requests the server for second connection status information of the connection between the live broadcast rooms;所述第一直播客户端确定所述第一连线状态信息和所述第二连线状态信息中,最新的连线状态信息;determining, by the first live client, the latest connection state information in the first connection state information and the second connection state information;所述第一直播客户端根据所述最新的连线状态信息判断是否需要恢复跨直播间连线。The first live broadcast client determines whether the connection between the live broadcast rooms needs to be restored according to the latest connection state information.
- 根据权利要求4所述的方法,其特征在于,所述第一直播客户端根据所述最新的连线状态信息判断是否需要恢复跨直播间连线,包括:The method according to claim 4, wherein the first live client client judges whether it is necessary to restore the connection between the live broadcast rooms according to the latest connection status information, comprising:所述第一直播客户端获取所述最新的连线状态信息所包括的连线状态标识;obtaining, by the first live client, the connection status identifier included in the latest connection status information;若所述最新的连线状态信息所包括的连线状态标识表示正在连线状态, 则所述第一直播客户端判断需要恢复跨直播间连线;If the connection state identifier included in the latest connection state information indicates a connection state, the first live broadcast client determines that it is necessary to restore the connection across the live broadcast room;若所述最新的连线状态信息所包括的连线状态标识不表示正在连线状态,则所述第一直播客户端判断不需要恢复跨直播间连线。If the connection state identifier included in the latest connection state information does not indicate a connection state, the first live broadcast client determines that it is not necessary to restore the connection across the live broadcast room.
- 根据权利要求4所述的方法,其特征在于,所述第一连线状态信息和所述第二连线状态信息添加有时间戳,所述确定所述第一连线状态信息和所述第二连线状态信息中,最新的连线状态信息,包括:The method according to claim 4, wherein a timestamp is added to the first connection state information and the second connection state information, and the determining the first connection state information and the first connection state information In the second connection status information, the latest connection status information includes:比较所述第一连线状态信息和所述第二连线状态信息对应的时间戳;comparing the timestamps corresponding to the first connection state information and the second connection state information;将最新的所述时间戳对应的连线状态信息确定为所述最新的连线状态信息。The connection state information corresponding to the latest time stamp is determined as the latest connection state information.
- 根据权利要求1所述的方法,其特征在于,所述方法还包括:The method according to claim 1, wherein the method further comprises:若所述第一直播客户端在因异常情况退出与所述第二直播客户端进行的跨直播间连线之后的预设时间内没有重新开播,则所述第一直播客户端生成连线结束信息,并向所述服务器发送所述连线结束信息;其中,所述连线结束信息用于指示所述服务器断开所述跨直播间连线。If the first live broadcast client does not restart the broadcast within a preset time after the first live broadcast client quits the cross-live broadcast room connection with the second live broadcast client due to an abnormal situation, the first live broadcast client generates the connection and ends information, and send the connection end information to the server; wherein, the connection end information is used to instruct the server to disconnect the cross-broadcast room connection.
- 根据权利要求1所述的方法,其特征在于,所述第一连线状态信息包括连线会话标识、连线状态标识、连线双方用户标识、连线双方房间标识,所述方法还包括:The method according to claim 1, wherein the first connection state information comprises a connection session identifier, a connection state identifier, a user identifier of both parties to the connection, and a room identifier of both parties to the connection, and the method further comprises:在所述第一直播客户端检测到退出所述跨直播间连线的情况下,若所述连线状态标识表示正在连线状态,以及所述连线会话标识、所述连线双方用户标识、所述连线双方房间标识与所述跨直播间连线的信息匹配,则确定所述第一直播客户端因异常情况退出与所述第二直播客户端进行的跨直播间连线。In the case where the first live broadcast client detects that it has exited the cross-live broadcast room connection, if the connection status identifier indicates the connection status, and the connection session identifier and the user identifiers of both parties to the connection are connected If the room identifiers of the two parties in the connection match the information of the cross-live room connection, it is determined that the first live-broadcast client quits the cross-live room connection with the second live-broadcast client due to an abnormal situation.
- 一种跨直播间连线的恢复装置,应用于直播客户端,所述装置包括:A recovery device for connecting across a live broadcast room, applied to a live broadcast client, the device includes:获取模块,用于若第一直播客户端在因异常情况退出与第二直播客户端进行的跨直播间连线之后的预设时间内重新开播,则所述第一直播客户端获取服务器发送的第一连线状态信息;所述第一连线状态信息为所述服务器周期发送的针对所述第一直播客户端与所述第二直播客户端进行跨直播间连线的连线状态信息;The obtaining module is used for obtaining the data sent by the server for the first live client if the first live client quits the cross-live room connection with the second live client due to an abnormal situation and restarts the broadcast within a preset time. The first connection status information; the first connection status information is the connection status information periodically sent by the server for the connection between the first live client and the second live client to connect across the live broadcast room;判断模块,用于所述第一直播客户端根据所述第一连线状态信息判断是否需要恢复跨直播间连线;a judgment module, used for the first live broadcast client to judge whether the connection between the live broadcast rooms needs to be restored according to the first connection status information;恢复模块,用于若判断为需要恢复跨直播间连线,则所述第一直播客户 端恢复与所述第二直播客户端的跨直播间连线。A recovery module, configured to restore the cross-live room connection with the second live client client if it is determined that the cross-live room connection needs to be resumed.
- 一种电子设备,其特征在于,包括有存储器,以及一个或者一个以上的程序,其中一个或者一个以上程序存储于存储器中,且经配置以由一个或者一个以上处理器执行所述一个或者一个以上程序包含用于执行如方法权利要求1-8任一所述的跨直播间连线的恢复方法。An electronic device comprising a memory and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by one or more processors to execute the one or more programs The program includes a recovery method for performing a connection between live broadcasts according to any of the method claims 1-8.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110130836.3A CN112911325B (en) | 2021-01-29 | 2021-01-29 | Method and device for recovering inter-live-broadcast room connection |
CN202110130836.3 | 2021-01-29 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2022161215A1 true WO2022161215A1 (en) | 2022-08-04 |
Family
ID=76121936
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2022/072562 WO2022161215A1 (en) | 2021-01-29 | 2022-01-18 | Method and device for recovering inter-live streaming studio connection |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN112911325B (en) |
WO (1) | WO2022161215A1 (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112911325B (en) * | 2021-01-29 | 2023-07-14 | 百果园技术(新加坡)有限公司 | Method and device for recovering inter-live-broadcast room connection |
CN113810775B (en) * | 2021-09-13 | 2023-04-07 | 上海哔哩哔哩科技有限公司 | Voice and video connection system and method |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20140082495A1 (en) * | 2012-09-18 | 2014-03-20 | VS Media, Inc. | Media systems and processes for providing or accessing multiple live performances simultaneously |
CN108111879A (en) * | 2017-12-12 | 2018-06-01 | 福建中金在线信息科技有限公司 | A kind of method, apparatus and electronic equipment of net cast abnormality processing |
CN108259448A (en) * | 2016-12-30 | 2018-07-06 | 广州华多网络科技有限公司 | The method and device of abnormal broken line during a kind of company of preventing wheat |
CN108306942A (en) * | 2018-01-09 | 2018-07-20 | 武汉斗鱼网络科技有限公司 | Communication means, storage medium, electronic equipment and the system that multi-user is broadcast live simultaneously |
CN112911325A (en) * | 2021-01-29 | 2021-06-04 | 百果园技术(新加坡)有限公司 | Method and device for restoring connection between live broadcasting rooms |
Family Cites Families (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR100755974B1 (en) * | 2006-01-16 | 2007-09-06 | 삼성전자주식회사 | Health Care Network System using Smart Communicator and Method thereof |
KR101722673B1 (en) * | 2015-12-08 | 2017-04-03 | 네이버 주식회사 | Method and system for providing time machine function in live broadcast |
CN106488335B (en) * | 2016-09-20 | 2019-08-16 | 北京小米移动软件有限公司 | Live-broadcast control method and device |
CN106685971B (en) * | 2016-12-30 | 2018-06-12 | 广州华多网络科技有限公司 | Client connects wheat live streaming treating method and apparatus |
CN106803997B (en) * | 2017-03-14 | 2019-12-17 | 广州视源电子科技股份有限公司 | system and method for detecting client playing state in audio and video live broadcast |
US10621784B2 (en) * | 2017-09-29 | 2020-04-14 | Sony Interactive Entertainment America Llc | Venue mapping for virtual reality spectating of live events |
CN107743250B (en) * | 2017-10-10 | 2019-07-09 | 武汉斗鱼网络科技有限公司 | Realize that main broadcaster connects method, storage medium, equipment and the system of wheat PK on PC |
US20190189290A1 (en) * | 2017-12-18 | 2019-06-20 | Healthy Option Consulting Inc. | Method and system for medical cannabis education and operation, and promotion and facilitation of communication and commerce between medical cannabis patients, physicians, cultivators, processors, sellers and others |
CN110971922B (en) * | 2018-09-30 | 2021-11-09 | 武汉斗鱼网络科技有限公司 | Live broadcast and microphone connection state monitoring method, client, server, medium and system |
CN111385592A (en) * | 2018-12-29 | 2020-07-07 | 广州市百果园信息技术有限公司 | Cross-room live broadcast connection method and device, storage medium and server |
CN111385664B (en) * | 2018-12-29 | 2023-04-14 | 广州市百果园网络科技有限公司 | Interactive data processing method and device for live broadcast room, storage medium and server |
-
2021
- 2021-01-29 CN CN202110130836.3A patent/CN112911325B/en active Active
-
2022
- 2022-01-18 WO PCT/CN2022/072562 patent/WO2022161215A1/en active Application Filing
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20140082495A1 (en) * | 2012-09-18 | 2014-03-20 | VS Media, Inc. | Media systems and processes for providing or accessing multiple live performances simultaneously |
CN108259448A (en) * | 2016-12-30 | 2018-07-06 | 广州华多网络科技有限公司 | The method and device of abnormal broken line during a kind of company of preventing wheat |
CN108111879A (en) * | 2017-12-12 | 2018-06-01 | 福建中金在线信息科技有限公司 | A kind of method, apparatus and electronic equipment of net cast abnormality processing |
CN108306942A (en) * | 2018-01-09 | 2018-07-20 | 武汉斗鱼网络科技有限公司 | Communication means, storage medium, electronic equipment and the system that multi-user is broadcast live simultaneously |
CN112911325A (en) * | 2021-01-29 | 2021-06-04 | 百果园技术(新加坡)有限公司 | Method and device for restoring connection between live broadcasting rooms |
Also Published As
Publication number | Publication date |
---|---|
CN112911325B (en) | 2023-07-14 |
CN112911325A (en) | 2021-06-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2022161215A1 (en) | Method and device for recovering inter-live streaming studio connection | |
CN111711830B (en) | Live broadcast bit supplementing method and device, server and storage medium | |
WO2021114708A1 (en) | Method and apparatus for implementing multi-person video live-streaming service, and computer device | |
EP3840394A1 (en) | Video screen projection method, device, computer equipment and storage medium | |
CN103839558A (en) | Method and server for synchronous playing and player | |
CN113518247A (en) | Video playing method, related equipment and computer readable storage medium | |
CN112752114B (en) | Method and device for generating live broadcast playback interactive message, server and storage medium | |
US20140149606A1 (en) | Server, multimedia apparatus and control method thereof for synchronously playing multimedia contents through a plurality of multimedia devices | |
US20210289255A1 (en) | Synchronization of media content across multiple participant devices | |
WO2017084279A1 (en) | Network live broadcast method, apparatus and system | |
US20170171509A1 (en) | Method and electronic apparatus for realizing two-person simultaneous live video | |
CN104284200A (en) | Multi-screen synchronized playing method and system and related device | |
WO2017092554A1 (en) | Method, device, and system for audio/video multicast playback based on virtual desktop | |
CN112055227B (en) | Cloud game interaction method, system, device, storage medium and electronic equipment | |
US20050193342A1 (en) | Simultaneous wireless broadcasting of video and graphical content | |
CN111447458A (en) | Live broadcast system, method and device based on content explanation and live broadcast server | |
CN112653859B (en) | Online transaction video recording method and device | |
CN111885167B (en) | Data synchronization method, device, electronic equipment and storage medium | |
CN111107296B (en) | Audio data acquisition method and device, electronic equipment and readable storage medium | |
CN112702620A (en) | Method for realizing multi-screen synchronous playing of player based on gstreamer | |
CN114615512A (en) | Game event live broadcasting system and game event live broadcasting method | |
CN104768037B (en) | A kind of video request program apparatus for fast switching and method realized between multi-screen | |
WO2011144105A2 (en) | Method, device, server and terminal for updating interaction information | |
CN113163270B (en) | Method and system for repairing video signal | |
CN114500572B (en) | Multi-device synchronization method and device, electronic device and storage medium |
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: 22745091 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: 22745091 Country of ref document: EP Kind code of ref document: A1 |