CN112887775B - Data push method, auxiliary terminal, main terminal and data push system - Google Patents

Data push method, auxiliary terminal, main terminal and data push system Download PDF

Info

Publication number
CN112887775B
CN112887775B CN202110246126.7A CN202110246126A CN112887775B CN 112887775 B CN112887775 B CN 112887775B CN 202110246126 A CN202110246126 A CN 202110246126A CN 112887775 B CN112887775 B CN 112887775B
Authority
CN
China
Prior art keywords
time
data
auxiliary
terminal
main
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110246126.7A
Other languages
Chinese (zh)
Other versions
CN112887775A (en
Inventor
王云龙
彭旸
黄剑飞
夏龙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Ape Power Future Technology Co Ltd
Original Assignee
Beijing Ape Power Future Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Ape Power Future Technology Co Ltd filed Critical Beijing Ape Power Future Technology Co Ltd
Priority to CN202110246126.7A priority Critical patent/CN112887775B/en
Publication of CN112887775A publication Critical patent/CN112887775A/en
Application granted granted Critical
Publication of CN112887775B publication Critical patent/CN112887775B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing 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/4302Content synchronisation processes, e.g. decoder synchronisation
    • H04N21/4305Synchronising client clock from received content stream, e.g. locking decoder clock with encoder clock, extraction of the PCR packets
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/45Management operations performed by the client for facilitating the reception of or the interaction with the content or administrating data related to the end-user or to the client device itself, e.g. learning user preferences for recommending movies, resolving scheduling conflicts
    • H04N21/462Content or additional data management, e.g. creating a master electronic program guide from data received from the Internet and a Head-end, controlling the complexity of a video stream by scaling the resolution or bit-rate based on the client capabilities
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Abstract

The present specification provides a data push method, an auxiliary terminal, a main terminal, and a data push system, wherein the data push method includes: responding to a data acquisition request sent by a main terminal, and acquiring first direct broadcasting data; determining a first main terminal time corresponding to the first direct broadcasting data according to a first auxiliary terminal time of the first direct broadcasting data; and carrying the first main terminal time in the first direct broadcasting data and sending the first direct broadcasting data to the main terminal. Therefore, calculation and processing of the live broadcast data can be distributed to a plurality of auxiliary terminals to be executed, the calculation pressure of the main terminal is reduced, the energy consumption of the main terminal is reduced, and the performance requirement on the main terminal is correspondingly reduced.

Description

Data pushing method, auxiliary terminal, main terminal and data pushing system
Technical Field
The present disclosure relates to the field of internet technologies, and in particular, to a data pushing method, an auxiliary terminal, a main terminal, and a data pushing system.
Background
With the rapid development of computer technology and internet technology, user demand is also increasing explosively, and video live broadcast service is an effective way for users to communicate in real time, and is popular with a large number of users due to the characteristics of rich and colorful live broadcast types and real-time and rapid communication. The anchor carries out live broadcast through a live broadcast client, and then pushes live broadcast data to a watching client for watching.
In the prior art, a live broadcast client often acquires live broadcast data, processes the live broadcast data, uploads the live broadcast data to a live broadcast server, and the live broadcast server pushes the live broadcast data to each watching client requesting to acquire the live broadcast data. However, the live broadcast client needs to acquire live broadcast data, process the live broadcast data, and upload the live broadcast data, and both calculation and processing of the live broadcast data are concentrated on the live broadcast client, so that the calculation pressure of the live broadcast client is high, and the performance requirement of the live broadcast client is high.
Disclosure of Invention
In view of this, the embodiments of the present specification provide a data pushing method. The present specification also relates to an auxiliary terminal, two main terminals, two data push systems, a computing device, and a computer readable storage medium, so as to solve the technical defects existing in the prior art.
According to a first aspect of the embodiments of the present specification, there is provided a data pushing method applied to a secondary side, the method including:
responding to a data acquisition request sent by a main terminal, and acquiring first direct broadcasting data;
determining a first main terminal time corresponding to the first direct broadcasting data according to a first auxiliary terminal time of the first direct broadcasting data;
and carrying the first main terminal time in the first direct broadcasting data and sending the first direct broadcasting data to the main terminal.
According to a second aspect of the embodiments of the present specification, there is provided a data pushing method applied to a master, the method including:
sending data acquisition requests to at least two auxiliary terminals;
receiving first direct-broadcast data sent by the at least two auxiliary terminals in response to the data acquisition request, wherein the first direct-broadcast data carries first main terminal time determined by the auxiliary terminals according to first auxiliary terminal time for acquiring the first direct-broadcast data;
and according to the first main terminal time carried in the first live data, carrying out time alignment on the received first live data, and pushing the time-aligned first live data to a live broadcast server.
According to a third aspect of embodiments of the present specification, there is provided a data pushing method applied to a master, the method including:
acquiring second live broadcast data and sending a data acquisition request to at least one auxiliary terminal;
receiving first direct-broadcast data sent by the at least one auxiliary terminal in response to the data acquisition request, wherein the first direct-broadcast data carries first main terminal time determined by the auxiliary terminal according to first auxiliary terminal time for acquiring the first direct-broadcast data;
and according to the first main terminal time carried in the first live data and the time for acquiring the second live data, time alignment is carried out on the first live data and the second live data, and the time-aligned first live data and second live data are pushed to a live server.
According to a fourth aspect of embodiments herein, there is provided a secondary terminal including:
the first acquisition module is configured to respond to a data acquisition request sent by a main terminal to acquire first direct broadcasting data;
the determining module is configured to determine a first main terminal time corresponding to the first direct broadcasting data according to a first auxiliary terminal time for acquiring the first direct broadcasting data;
a first sending module, configured to send the first main terminal time carried in the first direct broadcast data to the main terminal.
According to a fifth aspect of embodiments herein, there is provided a master, comprising:
the second sending module is configured to send data acquisition requests to the at least two auxiliary terminals;
a first receiving module, configured to receive first broadcast data sent by the at least two auxiliary terminals in response to the data acquisition request, where the first broadcast data carries a first main terminal time determined by the auxiliary terminal according to a first auxiliary terminal time for acquiring the first broadcast data;
the first pushing module is configured to perform time alignment on the received first live data according to the first master time carried in the first live data, and push the time-aligned first live data to a live server.
According to a sixth aspect of embodiments herein, there is provided a master terminal comprising:
the third sending module is configured to send a data acquisition request to at least one auxiliary terminal;
a second receiving module, configured to receive first broadcast data sent by the at least one auxiliary terminal in response to the data acquisition request, where the first broadcast data carries a first main terminal time determined by the auxiliary terminal according to a first auxiliary terminal time for acquiring the first broadcast data;
a second acquisition module configured to acquire second live data;
and the second pushing module is configured to align the time of the first live data with the time of the second live data according to the first main-end time carried in the first live data and the time of acquiring the second live data, and push the time-aligned first live data and second live data to a live server.
According to a seventh aspect of embodiments of the present specification, there is provided a data push system, including: a main terminal and at least two auxiliary terminals;
the main terminal is configured to send data acquisition requests to the at least two auxiliary terminals;
the at least two auxiliary terminals are configured to respond to the data acquisition request and acquire first direct broadcasting data; determining a first main terminal time corresponding to the first direct broadcasting data according to a first auxiliary terminal time of the first direct broadcasting data; carrying the first main terminal time in the first direct broadcasting data and sending the first direct broadcasting data to the main terminal;
the master is further configured to receive the first live broadcast data, perform time alignment on the received first live broadcast data according to the first master time carried in the first live broadcast data, and push the time-aligned first live broadcast data to a live broadcast server.
According to an eighth aspect of embodiments herein, there is provided a data push system, including: a main terminal and at least one auxiliary terminal;
the main terminal is configured to acquire second live broadcast data and send a data acquisition request to the at least one auxiliary terminal;
the at least one auxiliary terminal is configured to respond to the data acquisition request and acquire first direct broadcasting data; determining a first main terminal time corresponding to the first direct broadcasting data according to a first auxiliary terminal time of the first direct broadcasting data; carrying the first main terminal time in the first direct broadcasting data and sending the first direct broadcasting data to the main terminal;
the master is further configured to receive the first live broadcast data, perform time alignment on the first live broadcast data and the second live broadcast data according to the first master time carried in the first live broadcast data and the time for acquiring the second live broadcast data, and push the time-aligned first live broadcast data and second live broadcast data to a live broadcast server.
According to a ninth aspect of embodiments herein, there is provided a computing device comprising:
a memory and a processor;
the memory is used for storing computer-executable instructions, and the processor is used for executing the computer-executable instructions so as to realize the operation steps of the data pushing method.
According to a tenth aspect of embodiments herein, there is provided a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the operational steps of the data pushing method.
In the data push method provided in this specification, the auxiliary terminal may obtain the first live broadcast data, determine corresponding first main terminal time according to the auxiliary terminal time and the main terminal time synchronization of the auxiliary terminal and the main terminal, carry the first main terminal time in the obtained first live broadcast data, and the main terminal may receive the first live broadcast data sent by at least two auxiliary terminals, and push the first live broadcast data to the live broadcast server after performing time alignment on the first live broadcast data according to the first main terminal time carried in the first live broadcast data. Therefore, the time of the main end is carried in the first live broadcast data received by the main end, the main end and the auxiliary ends accurately time-synchronize, the consistency of the data between the main end and the auxiliary ends is guaranteed, the calculation and the processing of the live broadcast data are dispersed to be executed by the auxiliary ends, the calculation pressure of the main end is reduced, the energy consumption of the main end is reduced, and the performance requirement of the main end is correspondingly reduced; and secondly, the main end can be simultaneously connected with a plurality of auxiliary ends, so that the method has good scale expandability and can fully utilize the network bandwidth.
In another data push method provided in this specification, an auxiliary terminal may obtain first broadcast data, determine a corresponding first main terminal time according to an auxiliary terminal time and a main terminal time pair of the auxiliary terminal, and carry the first main terminal time in the obtained first broadcast data; the main terminal can also obtain second live broadcast data, receive first live broadcast data sent by at least one auxiliary terminal, and push the first live broadcast data and the second live broadcast data to a live broadcast server after time alignment according to first main terminal time carried in the first live broadcast data and obtaining time of the second live broadcast data. Therefore, the time of the main end is carried in the first live data received by the main end, the time of the second live data can be directly obtained by the main end, the main end and the auxiliary end accurately time-pair, the consistency of the data between the main end and the auxiliary end is guaranteed, the calculation and the processing of the live data are dispersed to the auxiliary end for execution, the calculation pressure of the main end is reduced, the energy consumption of the main end is reduced, and the performance requirement of the main end is correspondingly reduced.
Drawings
Fig. 1 is a flowchart of a first data pushing method provided in an embodiment of the present specification;
fig. 2 is a flowchart of a second data pushing method provided in an embodiment of the present specification;
fig. 3 is a flowchart of a third data pushing method provided in an embodiment of the present specification;
fig. 4 is a flowchart of a fourth data pushing method provided in an embodiment of the present specification;
fig. 5 is a flowchart of a fifth data pushing method provided in an embodiment of the present specification;
FIG. 6 is a schematic structural diagram of a secondary terminal according to an embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of a main end according to an embodiment of the present disclosure;
FIG. 8 is a schematic structural diagram of another main terminal provided in an embodiment of the present disclosure;
fig. 9 is a block diagram illustrating a data push system according to an embodiment of the present disclosure;
FIG. 10 is a block diagram of another data pushing system provided in an embodiment of the present disclosure;
fig. 11 is a block diagram of a computing device according to an embodiment of the present disclosure.
Detailed Description
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present specification. This description may be implemented in many ways other than those specifically set forth herein, and those skilled in the art will appreciate that the present description is susceptible to similar generalizations without departing from the scope of the description, and thus is not limited to the specific implementations disclosed below.
The terminology used in the description of the one or more embodiments is for the purpose of describing the particular embodiments only and is not intended to be limiting of the description of the one or more embodiments. As used in one or more embodiments of the present specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used in one or more embodiments of the present specification refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It will be understood that, although the terms first, second, etc. may be used herein in one or more embodiments to describe various information, these information should not be limited by these terms. These terms are only used to distinguish one type of information from another. For example, a first can also be referred to as a second and, similarly, a second can also be referred to as a first without departing from the scope of one or more embodiments of the present description. The word "if," as used herein, may be interpreted as "at \8230; \8230when" or "when 8230; \823030when" or "in response to a determination," depending on the context.
Wide Area Network (WAN): the wide area network is not equivalent to the internet, but is a remote network for connecting computers in local area networks or metropolitan area networks in different regions to communicate, and mainly uses packet switching technology. Wide area networks typically span a large physical area, covering a wider range than Local Area Networks (LANs) and Metropolitan Area Networks (MANs), ranging from tens of kilometers to thousands of kilometers, and can connect multiple regions, cities and countries, providing long-range communications.
Local Area Network (LAN): the system is a computer group formed by interconnecting a plurality of computers in a certain area, and can be connected with a remote local area network, a database or a processing center through a data communication network or a special data circuit to form an information processing system with a larger range. A local area network is a closed type and may consist of two computers in an office or thousands of computers in a company.
In the present specification, a data push method is provided, and the present specification relates to a secondary side, two primary sides, two data push systems, a computing device, and a computer-readable storage medium, which are described in detail in the following embodiments one by one.
Fig. 1 shows a flowchart of a first data pushing method provided in an embodiment of the present specification, which is applied to a secondary side, and as shown in fig. 1, the method specifically includes the following steps:
step 102: and responding to a data acquisition request sent by the master end to acquire the first direct broadcasting data.
Specifically, the main end is used for interacting with the auxiliary end and the live broadcast server, and in practical application, the main end can be a live broadcast client used by a main broadcast; the auxiliary end is used for providing live broadcast data for the main end according to the requirement of the main end, namely the auxiliary end can assist the main end to push the live broadcast data to the live broadcast server. In addition, the first live broadcast data is the live broadcast data acquired by the auxiliary terminal; the data acquisition request is a request for indicating the auxiliary terminal to start acquiring corresponding first direct broadcast data, the data acquisition request may carry a live broadcast data identifier, and the auxiliary terminal may acquire the corresponding first direct broadcast data according to the live broadcast data identifier carried in the data acquisition request when receiving the data acquisition request sent by the main terminal.
In an optional implementation manner of this embodiment, before the secondary side receives the data acquisition request sent by the primary side, the secondary side further needs to establish a connection with the primary side first, so before the secondary side acquires the live data in response to the data acquisition request sent by the primary side, the method further includes:
sending a connection information acquisition request to an intermediate node, wherein the connection information acquisition request carries a first identity mark;
receiving connection information returned by the intermediate node based on a second identity identifier and the first identity identifier, wherein the second identity identifier is an identity identifier carried in the connection information sent by the master terminal to the intermediate node;
and initiating a connection request according to a network address carried in the connection information, wherein the network address is an address carried in the connection information sent to the intermediate node by the master terminal.
Specifically, the intermediate node is used for storing connection information required by the connection between the main terminal and the auxiliary terminal; the first identity mark is the identity mark of the auxiliary end, and the second identity mark is the identity mark of the main end. It should be noted that, when the auxiliary terminal acquires the connection information from the intermediate node, the intermediate node may also verify the identity of the auxiliary terminal, so that the auxiliary terminal needs to carry the first identity of the auxiliary terminal when sending the connection information acquisition request, the intermediate node may verify the first identity of the auxiliary terminal based on the second identity of the main terminal, and only when the auxiliary terminal uses the same identity, the connection information of the main terminal may be acquired from the intermediate node, thereby ensuring the security of the main terminal.
During actual implementation, the intermediate node receives and stores the connection information sent by the main terminal, and acquires a second identity identifier in the connection information; the intermediate node receives a connection information acquisition request sent by the auxiliary terminal, wherein the connection information acquisition request carries a first identity; and the intermediate node returns the connection information to the auxiliary terminal under the condition that the first identity identification is the same as the second identity identification.
In practical application, the intermediate node can expose the domain name of the wide area network in advance, and after the auxiliary terminal obtains the domain name exposed by the intermediate node, the auxiliary terminal can establish connection with the intermediate node through an http protocol. And then, the auxiliary terminal can acquire the connection information of the main terminal from the intermediate node based on the first identity, and then send a connection request to a network address carried in the connection information.
In addition, if the auxiliary terminal acquires the connection information of the main terminal, a connection request can be sent to the main terminal according to the connection information, so that connection with the main terminal is attempted, if the connection is successful, subsequent data interaction can be carried out, if the connection is failed, the connection information can be acquired from the intermediate node again according to a fixed time interval, and connection is attempted with the main terminal according to the newly acquired connection information until the number of connection failures reaches a preset number.
In an optional implementation manner of this embodiment, after the connection between the secondary end and the primary end is successful, the secondary end may further send keep-alive information to the primary end to determine availability of the connection, that is, after the connection between the secondary end and the primary end is established, the method further includes:
sending first keep-alive information to the main end, and receiving second keep-alive information sent by the main end;
and under the condition that the second keep-alive information is not received in a second preset time length, disconnecting the main end.
Specifically, the keep-alive information is information for identifying an active state of the auxiliary terminal, the first keep-alive information is information sent by the auxiliary terminal to the main terminal to notify the main terminal of the active state, the second keep-alive information is information sent by the main terminal to the auxiliary terminal, and the auxiliary terminal can know the active state of the main terminal through the second keep-alive information. If the secondary terminal does not receive the keep-alive information sent by the main terminal within the second preset time length, the fact that the main terminal is abnormal or the connection with the main terminal is abnormal is indicated, so that the connection with the main terminal can be disconnected, the connection can be timely disconnected when a fault occurs, and resources are saved.
Step 104: and determining a first main terminal time corresponding to the first direct broadcasting data according to the first auxiliary terminal time of the first direct broadcasting data.
Specifically, on the basis of acquiring first broadcast data in response to a data acquisition request sent by a master, further, a first master time corresponding to the first broadcast data is determined according to a first auxiliary time for acquiring the first broadcast data.
In an optional implementation manner of this embodiment, since the primary end and the secondary end use respective local clocks that are not affected by adjustment of the system clock, that is, the primary end and the secondary end use respective local times (such as boot time), after the primary end and the secondary end successfully establish a connection, the secondary end needs to perform time synchronization before sending data to the primary end, so as to ensure accuracy of time and avoid inconsistency of data due to time confusion. During specific implementation, before determining the first main-end time corresponding to the first broadcast data according to the first auxiliary-end time for obtaining the first broadcast data, the method further includes:
sending a time synchronization packet to the main terminal every a first preset time length, wherein the time synchronization packet carries second auxiliary terminal time to be sent;
receiving a time synchronization response packet sent by the master end, and recording a third auxiliary end time for receiving the time synchronization response packet, wherein the time synchronization response packet carries the second auxiliary end time, the second master end time and a third master end time for sending the time synchronization response packet, and the second master end time is the time for receiving the time synchronization response packet by the master end;
and determining the time offset corresponding to the time-setting packet according to a first time difference between the second main end time and the second auxiliary end time and a second time difference between the third main end time and the third auxiliary end time.
Specifically, the first preset duration is a preset time interval for sending the time tick packet, that is, how long a time tick packet is sent. For example, the first predetermined period of time may be 1 minute, 5 minutes, 10 minutes, etc.
It should be noted that the auxiliary end sends a time-tick packet to the main end every other first preset time, and then determines the time offset corresponding to the time-tick packet according to the relevant time of the time-tick packet, that is, the time offset corresponding to the time-tick packet is obtained every time a time-tick packet is sent.
In specific implementation, for any one time-tick packet that is sent, the time offset corresponding to the time-tick packet is determined according to a first time difference between the second master time and the second slave time, and a second time difference between the third master time and the third slave time, which can be implemented by the following formula (1):
offset n =(time receive -time originate +time transmit -time response )/2 (1);
wherein the offset n Indicating the time offset, time, corresponding to the nth tick packet receive Representing the second master time, time originate Representing the second secondary time, time transmit Representing the third master time, time response Indicating a third secondary terminal time.
For example, assuming that the first preset time duration is 5 minutes, after the connection between the primary end and the secondary end is established, the primary end immediately sends a first time synchronization packet to the secondary end, and calculates a corresponding time offset to be offset according to the time synchronization packet 1 =0.4 seconds; after 5 minutes, the master end sends a second time-tick packet to the slave end, and the corresponding time offset is obtained by calculation according to the time-tick packet and is offset 2 =0.2 seconds; and 5 minutes later, the master end sends a third time tick packet to the slave end, and the corresponding time offset is obtained by calculation according to the time tick packet 3 =0.3 seconds; and after another 5 minutes, the master end sends a fourth time-setting packet to the slave end, and the corresponding time offset is obtained by calculation according to the time-setting packet 4 =0.1 sec; and after another 5 minutes, the master end sends a fifth time-tick packet to the slave end, and the corresponding time offset is calculated and obtained according to the time-tick packet and is offset 5 =0.3 seconds.
In an optional implementation manner of this embodiment, after a period of time, time offsets corresponding to a plurality of time tick packets are obtained respectively, and then a current time tick offset between the primary end and the secondary end may be determined according to the time offsets corresponding to the plurality of time tick packets sent in the period of time, so after determining the time offsets corresponding to the time tick packets, the method further includes:
under the condition that time offset corresponding to n time-setting packets is determined, current time-setting offset between the main end and the auxiliary end is determined according to the time offset corresponding to the 1 st time-setting packet and the time offset corresponding to the m th time-setting packet, wherein n is greater than or equal to 1, m is smaller than or equal to n, and m and n are both natural numbers.
Specifically, m is a parameter preset in the system and represents the number of time offsets required for calculating the current time synchronization offset between the main terminal and the auxiliary terminal, and since m is less than or equal to n and is a parameter preset by the system, the current time synchronization offset between the main terminal and the auxiliary terminal can be calculated only after the time offsets corresponding to n time synchronization packets are obtained, and it is required to ensure that n is greater than or equal to m.
In an optional implementation manner of this embodiment, the current time synchronization offset between the primary end and the secondary end is determined according to the time offset corresponding to the 1 st time synchronization packet to the time offset corresponding to the m th time synchronization packet, and a specific implementation process may be:
and calculating a first average value of the time offset corresponding to the 1 st time tick packet to the time offset corresponding to the mth time tick packet, and determining the first average value as the current time tick offset between the main terminal and the auxiliary terminal.
In a specific implementation, the following formula (2) can be expressed:
offsetavg 1,m =offset 1 +offset 2 +...+offset m (2);
wherein, offsetavg 1,m Indicating the time offset corresponding to the 1 st time pair packet to the first mean, offset, of the time offset corresponding to the m-th time pair packet 1 Indicating the time offset, corresponding to the first time-pair packet 2 Indicating the time offset, corresponding to the second pair of time packets m Indicating the time offset corresponding to the mth time pair packet.
Along with the above example, assuming that m is 3 and n is 5, that is, data of 3 time offsets are needed to calculate the current time offset between the primary and secondary terminals, the current calculation obtains 5 time offsets, which are respectively offset 1 =0.4 sec, offset 2 =0.2 seconds, offset 3 Offset of =0.3 seconds 4 =0.1 sec and offset 5 =0.3 sec, calculated at this time
Figure BDA0002964134530000091
That is, the current time setting offset is calculated to be 0.3 seconds.
In this specification, the time offset corresponding to the 1 st time-tick packet to the time offset corresponding to the m-th time-tick packet may be integrated by calculating an average value, so as to obtain the current time-tick offset between the main terminal and the auxiliary terminal. Of course, in practical application, the time offset corresponding to the 1 st time tick packet to the time offset corresponding to the m th time tick packet may also be synthesized through other manners, such as calculating a weighted average, calculating an average of a difference between a maximum time offset and a minimum time offset, and the like, which is not limited in this specification.
In an optional implementation manner of this embodiment, after the current time synchronization offset between the primary end and the secondary end is obtained through calculation, the secondary end may continue to send the time synchronization packet to the primary end, continue to perform time synchronization, and determine whether the current time synchronization offset between the primary end and the secondary end needs to be updated according to a time offset corresponding to a time synchronization packet that is sent subsequently, that is, after the current time synchronization offset between the primary end and the secondary end is determined according to a time offset corresponding to a 1 st time synchronization packet to a time offset corresponding to an m th time synchronization packet, the method further includes:
under the condition that the time offset corresponding to the kth time tick packet is determined, whether the current time tick offset between the main end and the auxiliary end is updated or not is determined according to the time offset corresponding to the jth time tick packet to the time offset corresponding to the kth time tick packet, wherein j is equal to k-m +1, k is larger than n, and j and k are both natural numbers.
Specifically, the kth time tick packet is the time tick packet after the nth time tick packet, the consistency of the time tick packet data after the nth time tick packet can be determined according to the time shift corresponding to the jth time tick packet to the time shift corresponding to the kth time tick packet, and whether to update the current time tick shift between the main terminal and the auxiliary terminal is determined according to the data consistency.
In an optional implementation manner of this embodiment, whether to update the current time synchronization offset between the primary end and the secondary end is determined according to the time offset corresponding to the j-th time synchronization packet to the time offset corresponding to the k-th time synchronization packet, and a specific implementation process may be as follows:
calculating the deviation value of the time deviation corresponding to the jth time-setting packet to the time deviation corresponding to the kth time-setting packet;
determining not to update the current time synchronization offset between the main terminal and the auxiliary terminal under the condition that the deviation value is greater than or equal to a preset threshold value;
and under the condition that the deviation value is smaller than a preset threshold value, updating the current time synchronization deviation between the main end and the auxiliary end according to the time deviation corresponding to the jth time synchronization packet to the time deviation corresponding to the kth time synchronization packet.
Specifically, the preset threshold is a parameter preset in the system, and is configured to determine whether a time offset corresponding to the time tick packet determined after the nth time tick packet is too large, that is, whether the consistency of the data of the time tick packet after the nth time tick packet is poor, determine not to update the current time tick offset between the primary end and the secondary end in the case of poor data consistency, and use the new data to recalculate the current time tick offset in the case of good data consistency, even if the time tick offset calculated by using the old data is continuously used as the current time tick offset (that is, the first mean value is continuously determined as the current time tick offset between the primary end and the secondary end).
It should be noted that the offset value is used to indicate whether the time offset corresponding to the jth time tick packet to the kth time tick packet is too large, that is, the consistency of the data of the jth time tick packet to the kth time tick packet is high or low. In specific implementation, the variance of the time offset corresponding to the jth time-tick packet to the time offset corresponding to the kth time-tick packet may be calculated, and whether to update the current time-tick offset between the primary end and the secondary end is determined according to the relationship between the variance and a preset threshold. Certainly, in practical application, the calculation may also be performed in other manners, for example, a standard deviation of a time offset corresponding to a j-th time tick to a time offset corresponding to a k-th time tick may be calculated, and whether to update the current time tick between the primary end and the secondary end is determined according to a relationship between the standard deviation and a preset threshold, which is not limited in this specification.
The current time synchronization offset between the main terminal and the auxiliary terminal is updated according to the time offset corresponding to the jth time synchronization packet to the time offset corresponding to the kth time synchronization packet, and the specific implementation process may be as follows:
and calculating a second average value of the time offset corresponding to the jth time pair packet to the time offset corresponding to the kth time pair packet, and updating the second average value to be the current time pair offset between the primary end and the secondary end.
For example, assuming that n is 10 and m is 6, the current time pair offset offsetavg is calculated from the time offset corresponding to the 1 st time pair packet to the time offset corresponding to the 6 th time pair packet 1,6 (ii) a Thereafter, the offset is obtained for the 11 th calculation 11 Determine offsetvar 11-6+1,11 I.e. offset var 6,11 Whether or not it is greater than a preset threshold (where offsetvar) 6,11 The variance indicating the time offset from the 6 th packet to the 11 th packet) is greater than the variance, which indicates that the consistency of the time offset from the 6 th packet to the 11 th packet is poor and the offset is still set 1,6 As the current time setting offset, otherwise, the current time setting offset is updated to offsetavg 6,11 (i.e., the time offset corresponding to the 6 th packet pair is the average of the time offsets corresponding to the 11 th packet pair).
In this specification, after the current time synchronization offset between the main terminal and the auxiliary terminal is obtained through calculation, time synchronization can be continuously performed, the current time synchronization offset between the main terminal and the auxiliary terminal is updated in real time, and accurate time synchronization of the main terminal and the auxiliary terminal is ensured, so that consistency of data between the main terminal and the auxiliary terminal is ensured.
It should be noted that, after receiving the data acquisition request sent by the main end, the auxiliary end needs to acquire corresponding live broadcast data, and the auxiliary end may directly acquire and generate the live broadcast data through a camera device carried by the auxiliary end, or may acquire corresponding data with the aid of other push devices and then process the data to obtain the live broadcast data. Certainly, in practical application, the auxiliary terminal may also be a device in other forms, and the live data that needs to be sent is obtained in other forms, which is not limited in this specification.
In an optional implementation manner of this embodiment, the determining, according to the first secondary end time of the obtained first broadcast data, a first primary end time corresponding to the first broadcast data may be implemented as follows:
and determining the sum of the first auxiliary terminal time and the current time setting offset as a first main terminal time corresponding to the first broadcast data.
In actual implementation, determining the sum of the first secondary time and the current time tick as the first primary time corresponding to the live broadcast data may be represented by the following formula (3):
time main =time assist +offset system (3);
wherein, time main Representing the first master time, time assist A first secondary time, offset, representing the generation of first direct broadcast data system Indicating the current time tick offset.
It should be noted that, when calculating the time offset corresponding to the time tick packet, the time tick time is subtracted from the time tick of the master end, so that the current time tick offset between the master end and the slave end obtained by subsequent calculation is the time that the slave end is later than the master end, and the current time offset can be added subsequently on the basis of the time tick of the slave end, so as to obtain the corresponding time tick of the master end. In practical application, of course, when calculating the offset time corresponding to the time tick packet, the time tick time may also be obtained by subtracting the time tick of the main end from the time tick of the auxiliary end, so that the current time tick offset between the main end and the auxiliary end obtained by subsequent calculation is the time tick that is earlier than the time tick of the main end by the auxiliary end, and the current time tick offset may be subsequently subtracted on the basis of the time tick of the auxiliary end, so as to obtain the corresponding time tick of the main end, which is not limited in this specification.
Step 106: and carrying the first main terminal time in the first direct broadcasting data and sending the first direct broadcasting data to the main terminal.
Specifically, on the basis of determining a first main terminal time corresponding to the first direct broadcast data according to a first auxiliary terminal time for acquiring the first direct broadcast data, the first main terminal time is further carried in the first direct broadcast data and sent to the main terminal.
It should be noted that, when the auxiliary end acquires the first live broadcast data, the local time (i.e., the first auxiliary end time) for acquiring the first live broadcast data is recorded, and the local time (the first auxiliary end time) of the auxiliary end is converted into the local time (the first main end time) of the main end according to the current time synchronization offset between the main end and the auxiliary end, and then is sent to the main end, so that the main end time is carried in the live broadcast data received by the main end.
In the data push method provided by this specification, the auxiliary terminal may obtain the first broadcast data, determine corresponding first main terminal time according to the auxiliary terminal time and the main terminal time synchronization of the auxiliary terminal and the main terminal, and carry the first main terminal time in the obtained first broadcast data, so that the subsequent main terminal may receive the first broadcast data sent by at least two auxiliary terminals, and push the first broadcast data to the live broadcast server after performing time alignment on the first broadcast data according to the first main terminal time carried in the first broadcast data. Therefore, the time of the main end is carried in the first live broadcast data received by the main end, the main end and the auxiliary ends accurately time-synchronize, the consistency of the data between the main end and the auxiliary ends is ensured, the calculation and the processing of the live broadcast data are dispersed to be executed by the auxiliary ends, the calculation pressure of the main end is reduced, the energy consumption of the main end is reduced, and the performance requirement of the main end is correspondingly reduced; and secondly, the main end can be simultaneously connected with a plurality of auxiliary ends, so that the method has good scale expandability and can fully utilize the network bandwidth.
Fig. 2 shows a flowchart of a second data pushing method provided according to an embodiment of the present specification, which is applied to a master, and as shown in fig. 2, the method specifically includes the following steps:
step 202: and sending data acquisition requests to at least two auxiliary terminals.
It should be noted that the main end may acquire different live broadcast data from the at least two auxiliary ends, so that when the main end sends a data acquisition request to the auxiliary ends, the main end may carry an identifier of the required live broadcast data in the data acquisition request, so that after a subsequent auxiliary end receives the data acquisition request, the subsequent auxiliary end may collect corresponding live broadcast data according to the identifier of the required live broadcast data of the main end, that is, the identifiers of the required live broadcast data carried in the data acquisition requests sent by the main end to the different auxiliary ends may be different.
For example, the primary end sends a data acquisition request 1 to the secondary end a, where the data acquisition request 1 carries a time identifier t1, and the secondary end a can acquire live data before the time t1 when receiving the data acquisition request 1; the main terminal sends a data acquisition request 2 to the auxiliary terminal B, the data acquisition request 2 carries time marks t1 and t2, and the auxiliary terminal B acquires live broadcast data between the time t1 and the time t2 when receiving the data acquisition request 2.
In an optional implementation manner of this embodiment, when the data push system includes a plurality of auxiliary terminals, the main terminal needs to determine to which auxiliary terminals to send the data acquisition request, that is, the main terminal needs to select a part or all of the auxiliary terminals that execute the data generation task from the plurality of auxiliary terminals included in the data push system, so before the main terminal sends the data acquisition request to at least two auxiliary terminals, the method further includes:
and determining the auxiliary end for receiving the data acquisition request according to the load of each of the at least two auxiliary ends.
It should be noted that the primary end may determine, according to the load of the secondary end, that is, a live data generation task that has not been executed, which secondary ends execute a new live data generation task, that is, may determine, through load balancing, a secondary end that receives the data acquisition request (that is, a secondary end that executes a live data generation task).
For example, the data push system includes 5 auxiliary terminals, and if the main terminal has 5 requirements for generating live broadcast data, the main terminal sends data acquisition requests to the 5 auxiliary terminals respectively. Then, assuming that the master has 3 requirements for generating live data, at this time, since only one task for generating live data is being executed by each of the 5 slave terminals, that is, the loads are the same, at this time, 3 slave terminals (slave terminal 1, slave terminal 2, and slave terminal 3) may be randomly selected from the 5 slave terminals, and the data acquisition request is sent to the selected 3 slave terminals again. Later, assuming that the master peer has 2 demands for generating live broadcast data, at this time, according to the load, the data acquisition request is sent again to the slave peers (slave peer 4 and slave peer 4) other than the 3 slave peers among the 5 slave peers.
In an optional implementation manner of this embodiment, before the main end sends the data obtaining request to the at least two auxiliary ends, the main end further needs to establish a connection with the at least two auxiliary ends first, and thus before sending the data obtaining request to the at least two auxiliary ends, the method further includes:
sending connection information to an intermediate node, wherein the connection information comprises a network address and a second identity;
monitoring a connection request at the network address;
and responding to the monitored connection request to establish connection with the auxiliary terminal, wherein the connection request is initiated by the auxiliary terminal based on the network address acquired by the intermediate node based on the first identity.
Specifically, the intermediate node is used for storing connection information required by the connection between the main terminal and the auxiliary terminal, the intermediate node can expose a domain name of the wide area network of the intermediate node in advance, and the main terminal and the auxiliary terminal can establish connection with the intermediate node through an http protocol after acquiring the domain name exposed by the intermediate node. Then, the master may send connection information carrying a network Address to the intermediate node, and start monitoring on the network Address, where the network Address may be an available IP Address (Internet Protocol Address) of the master, that is, an available port. After the connection between the auxiliary terminal and the intermediate node is established, the connection information of the main terminal can be acquired from the intermediate node, and then the connection request is sent to the network address carried in the connection information.
It should be noted that the connection information sent by the master to the intermediate node carries the second identity identifier of the master, and the connection information of the master can be acquired from the intermediate node only by using the same identity identifier by the slave, thereby ensuring the security of the master.
In addition, if the main terminal and the auxiliary terminal are in the local area network, the connection information sent by the main terminal to the intermediate node is the local area network information, and if the main terminal and the auxiliary terminal are in the wide area network, the connection information sent by the main terminal to the intermediate node is the wide area network information. In addition, the intermediate node is typically in a wide area network with the primary and secondary sides, i.e., the intermediate node is typically accessed through a wide area network domain name.
In an optional implementation manner of this embodiment, after the main end and the auxiliary end are successfully connected, the main end may further send keep-alive information to the auxiliary end to determine availability of the connection, that is, after the main end and the auxiliary end establish the connection, the method further includes:
sending second keep-alive information to the auxiliary terminal, and receiving first keep-alive information sent by the auxiliary terminal;
and under the condition that the first keep-alive information is not received in a second preset time length, disconnecting the auxiliary terminal.
It should be noted that the primary end may send second keep-alive information to the secondary end to notify the active state of the secondary end itself, and the first keep-alive information is information sent by the secondary end to the primary end, and through the first keep-alive information, the primary end may learn the active state of the secondary end. If the main terminal does not receive the keep-alive information sent by the auxiliary terminal within the second preset time length, the fact that the auxiliary terminal is abnormal possibly or the connection with the auxiliary terminal is abnormal is indicated, so that the connection with the auxiliary terminal can be disconnected, the connection can be timely disconnected when a fault occurs, and resources are saved.
Step 204: and receiving first direct-broadcasting data sent by the at least two auxiliary terminals in response to the data acquisition request, wherein the first direct-broadcasting data carries first main terminal time determined by the auxiliary terminals according to the first auxiliary terminal time for acquiring the first direct-broadcasting data.
Specifically, on the basis of sending a data acquisition request to at least two auxiliary terminals, first broadcast data sent by the at least two auxiliary terminals in response to the data acquisition request is further received.
Step 206: and according to the first main terminal time carried in the first live data, carrying out time alignment on the received first live data, and pushing the time-aligned first live data to a live broadcast server.
Specifically, on the basis of receiving first live broadcast data sent by the at least two auxiliary terminals in response to the data acquisition request, further, according to the first main terminal time carried in the first live broadcast data, time alignment is performed on the received first live broadcast data, and the first live broadcast data after time alignment is pushed to a live broadcast server.
It should be noted that the local time (i.e., the time of the first main terminal) of the main terminal is carried in the first broadcast data sent by each auxiliary terminal to the main terminal, and after the main terminal receives the first broadcast data, the main terminal does not need to convert the time in the first broadcast data, but can directly sequence the first broadcast data according to the time carried in the first broadcast data (i.e., time alignment), thereby avoiding time confusion and data errors, and ensuring the consistency of data between the main terminal and each auxiliary terminal. And time synchronization between the main end and the auxiliary ends is carried out at each auxiliary end in a scattered manner, the main end only needs to receive the first direct broadcasting data and sequence according to the time carried in the first direct broadcasting data, excessive processing operation is not needed, the calculation pressure of the main end is reduced, the energy consumption of the main end is reduced, and therefore the performance requirement on the main end is reduced.
For example, the time of the first auxiliary end, which generates the live data 1, of the auxiliary end a is 1 minute 25 seconds, and the current time synchronization offset between the auxiliary end a and the main end is 10 seconds, so that the corresponding time of the first main end is 1 minute 35 seconds; the first auxiliary end time of the auxiliary end B for generating the live data 2 is 1 minute 28 seconds, the current time setting offset between the auxiliary end B and the main end is 5 seconds, and then the corresponding first main end time is 1 minute 33 seconds; the first auxiliary terminal time of the auxiliary terminal C for generating the live data 3 is 1 minute 30 seconds, and the current time synchronization offset between the auxiliary terminal C and the main terminal is 1 second, so that the corresponding first main terminal time is 1 minute 31 seconds. After receiving the live data 1, the live data 2 and the live data 3, the main terminal performs time alignment (i.e., sequencing) on the live data 1, the live data 2 and the live data 3 according to the time of the first main terminal carried by the main terminal, i.e., 1 minute 35 seconds, 1 minute 33 seconds and 1 minute 31 seconds, so as to obtain the live data 3, the live data 2 and the live data 1.
Furthermore, after the main terminal time aligns the first live data according to the main terminal time carried in the first live data, the main terminal can push the time-aligned first live data to the live broadcast server, and the live broadcast server pushes the first live data to each watching client terminal requesting to watch live broadcast, so that a user can watch live broadcast.
In the data push method provided by this specification, the auxiliary terminal may obtain first live broadcast data, determine corresponding first main terminal time according to the auxiliary terminal time and the main terminal time of the auxiliary terminal, carry the first main terminal time in the obtained first live broadcast data, the main terminal may receive the first live broadcast data sent by at least two auxiliary terminals, time-align the first live broadcast data according to the first main terminal time carried in the first live broadcast data, and push the first live broadcast data to the live broadcast server. Therefore, the time of the main end is carried in the first live broadcast data received by the main end, the main end and the auxiliary ends accurately time-synchronize, the consistency of the data between the main end and the auxiliary ends is guaranteed, the calculation and the processing of the live broadcast data are dispersed to be executed by the auxiliary ends, the calculation pressure of the main end is reduced, the energy consumption of the main end is reduced, and the performance requirement of the main end is correspondingly reduced; and secondly, the main end can be simultaneously connected with a plurality of auxiliary ends, so that the method has good scale expandability and can fully utilize the network bandwidth.
Fig. 3 is a flowchart of a third data pushing method provided in an embodiment of the present specification, and is applied to a master, where as shown in fig. 3, the method specifically includes the following steps:
step 302: and acquiring second live broadcast data, and sending a data acquisition request to at least one auxiliary terminal.
Specifically, the second live broadcast data is live broadcast data acquired or collected by the host. It should be noted that, besides the secondary side is used to obtain the live data, the primary side itself can also obtain the corresponding live data. In addition, the data acquisition request sent by the main terminal to the auxiliary terminal can carry a live data identifier to indicate the auxiliary terminal to acquire corresponding first live data.
For example, the main terminal sends a data acquisition request 1 to the auxiliary terminal a, where the data acquisition request 1 carries a time identifier t1, and the auxiliary terminal a can acquire first direct-broadcast data before the time t1 when receiving the data acquisition request 1; the main terminal sends a data acquisition request 2 to the auxiliary terminal B, the data acquisition request 2 carries time marks t1 and t2, the auxiliary terminal B acquires first live broadcast data between the time t1 and the time t2 when receiving the data acquisition request 2, and at the moment, the main terminal can acquire second live broadcast data after the time t 2.
It should be noted that the specific implementation process of sending the data acquisition request to the at least one auxiliary terminal in step 302 is similar to the specific implementation process of sending the data acquisition request to the at least two auxiliary terminals in step 202, and is not described herein again.
Step 304: and receiving first direct-broadcasting data sent by the at least one auxiliary terminal in response to the data acquisition request, wherein the first direct-broadcasting data carries first main terminal time determined by the auxiliary terminal according to the first auxiliary terminal time for acquiring the first direct-broadcasting data.
Specifically, on the basis of acquiring the second live data and sending a data acquisition request to at least one auxiliary terminal, the first live data sent by the at least one auxiliary terminal in response to the data acquisition request is further received.
Step 306: and according to the first main terminal time carried in the first live data and the time for acquiring the second live data, time alignment is carried out on the first live data and the second live data, and the time-aligned first live data and second live data are pushed to a live server.
Specifically, on the basis of receiving first live broadcast data sent by the at least one auxiliary terminal in response to the data acquisition request, further, time alignment is performed on the first live broadcast data and the second live broadcast data according to the time of the first main terminal carried in the first live broadcast data and the time of acquiring the second live broadcast data, and the first live broadcast data and the second live broadcast data after the time alignment are pushed to a live broadcast server.
It should be noted that the local time of the main end (i.e., the time of the first main end) is carried in the first live broadcast data sent by each auxiliary end to the main end, and after the main end receives the first live broadcast data, the time in the first live broadcast data does not need to be converted, but the first live broadcast data and the second live broadcast data obtained by the main end can be directly sorted according to the time carried in the first live broadcast data (i.e., time alignment), so that time confusion and data errors are avoided, and the consistency of the data between the main end, the auxiliary end and each auxiliary end is ensured. And time synchronization between the main end and the auxiliary ends is carried out at each auxiliary end in a scattered manner, the main end only needs to receive the first direct broadcasting data and sequence according to the time carried in the first direct broadcasting data, excessive processing operation is not needed, the calculation pressure of the main end is reduced, the energy consumption of the main end is reduced, and therefore the performance requirement on the main end is reduced.
For example, the time of a first auxiliary terminal generating the live data 1 by the auxiliary terminal a is 1 minute 25 seconds, the current time-setting offset between the auxiliary terminal a and the main terminal is 10 seconds, and then the corresponding time of the first main terminal is 1 minute 35 seconds; the first auxiliary end time of the auxiliary end B for generating the live data 2 is 1 minute 28 seconds, the current time setting offset between the auxiliary end B and the main end is 5 seconds, and then the corresponding first main end time is 1 minute 33 seconds; the first auxiliary terminal time of the auxiliary terminal C for generating the live data 3 is 1 minute 30 seconds, and the current time synchronization offset between the auxiliary terminal C and the main terminal is 1 second, so that the corresponding first main terminal time is 1 minute 31 seconds. The time of the main end obtaining the live data 4 is 1 minute 38 seconds, after the main end receives the live data 1, the live data 2 and the live data 3, the main end carries the first main end time 1 minute 35 seconds, 1 minute 33 seconds, 1 minute 31 seconds and the obtaining time 1 minute 38 seconds of the live data 4, time alignment (namely sequencing) is carried out on the live data 1, the live data 2, the live data 3 and the live data 4 to obtain the live data 3, the live data 2, the live data 1 and the live data 4.
In the data push method provided by the present specification, an auxiliary terminal may obtain first direct broadcast data, determine a corresponding first main terminal time according to an auxiliary terminal time of the auxiliary terminal and a main terminal time pair, and carry the first main terminal time in the obtained first direct broadcast data; the main terminal can also obtain second live broadcast data, receive first live broadcast data sent by at least one auxiliary terminal, and push the first live broadcast data and the second live broadcast data to a live broadcast server after time alignment according to first main terminal time carried in the first live broadcast data and obtaining time of the second live broadcast data. Therefore, the time of the main end is carried in the first live data received by the main end, the time of the second live data can be directly obtained by the main end, the main end and the auxiliary end accurately time-pair, the consistency of the data between the main end and the auxiliary end is guaranteed, the calculation and the processing of the live data are dispersed to the auxiliary end for execution, the calculation pressure of the main end is reduced, the energy consumption of the main end is reduced, and the performance requirement of the main end is correspondingly reduced.
Fig. 4 is a flowchart illustrating a fourth data pushing method according to an embodiment of the present disclosure, and as shown in fig. 4, the method specifically includes the following steps:
step 402: a main terminal sends connection information to an intermediate node, wherein the connection information comprises a network address; and listens for connection requests at the network address.
Step 404: the auxiliary end acquires the connection information from the intermediate node; and initiating a connection request to the main terminal according to the network address carried in the connection information.
In an optional implementation manner of this embodiment, when the auxiliary node obtains the connection information from the intermediate node, the intermediate node may further verify the identity of the auxiliary node, that is, the connection information sent by the main node to the intermediate node may further include the second identity, and the auxiliary node obtains the connection information from the intermediate node, where a specific implementation process may be as follows:
the intermediate node receives and stores the connection information sent by the main terminal, and acquires a second identity identifier in the connection information;
the intermediate node receives a connection information acquisition request sent by the auxiliary terminal, wherein the connection information acquisition request carries a first identity;
and the intermediate node returns the connection information to the auxiliary terminal under the condition that the first identity identification is the same as the second identity identification.
Step 406: and the main terminal responds to the monitored connection request and establishes connection with the auxiliary terminal.
In an optional implementation manner of this embodiment, after the main terminal and the auxiliary terminal are successfully connected, the main terminal and the auxiliary terminal may further send keep-alive information to each other; and under the condition that the keep-alive information sent by the opposite end is not received within the second preset time, disconnecting the main end and the auxiliary end, thereby ensuring that the main end or the auxiliary end can be disconnected in time after a problem occurs, and saving resources.
During specific implementation, the main terminal can send second keep-alive information to the auxiliary terminal and receive first keep-alive information sent by the auxiliary terminal; under the condition that the first keep-alive information is not received within a second preset time length, the connection with the auxiliary terminal is disconnected; correspondingly, the auxiliary end sends first keep-alive information to the main end and receives second keep-alive information sent by the main end; and under the condition that the second keep-alive information is not received in the second preset time length, disconnecting the connection with the main end. The second keep-alive information refers to information for identifying an active state of the primary terminal, and the first keep-alive information refers to information for identifying an active state of the secondary terminal.
Step 408: and the main terminal sends data acquisition requests to the at least two auxiliary terminals.
Step 410: and the auxiliary terminal responds to the data acquisition request and acquires the first direct broadcasting data.
Step 412: and the auxiliary end sends a time synchronization packet to the main end every a first preset time, wherein the time synchronization packet carries second auxiliary end time to be sent.
Step 414: and the master end records the time of the second master end for receiving the time synchronization packet and sends a time synchronization response packet to the auxiliary end, wherein the time synchronization response packet carries the time of the second auxiliary end, the time of the second master end and the time of a third master end for sending the time synchronization response packet.
Step 416: and the auxiliary end records the time of receiving the third auxiliary end of the time synchronization response packet, and determines the time offset corresponding to the time synchronization packet according to the first time difference between the time of the second main end and the time of the second auxiliary end and the second time difference between the time of the third main end and the time of the third auxiliary end.
Step 418: and under the condition that the time offset corresponding to n time tick packets is determined, the auxiliary end determines the current time tick offset between the main end and the auxiliary end according to the time offset corresponding to the 1 st time tick packet to the time offset corresponding to the mth time tick packet, wherein n is more than or equal to 1, m is less than or equal to n, and m and n are both natural numbers.
Step 420: and under the condition that the time offset corresponding to the kth time tick packet is determined, the auxiliary end determines whether to update the current time tick offset between the main end and the auxiliary end according to the time offset corresponding to the jth time tick packet to the time offset corresponding to the kth time tick packet, wherein j is equal to k-m +1, k is greater than n, and j and k are both natural numbers.
Step 422: the auxiliary terminal determines first main terminal time corresponding to the first direct broadcasting data according to first auxiliary terminal time for acquiring the first direct broadcasting data; and carrying the first main terminal time in the first direct broadcasting data and sending the first direct broadcasting data to the main terminal.
Step 424: and the master end receives the first live data, performs time alignment on the received first live data according to the first master end time carried in the first live data, and pushes the time-aligned first live data to a live broadcast server.
Step 426: and the live broadcast server pushes the received live broadcast data to a watching client.
In the data push method provided by this specification, the auxiliary terminal may obtain first live broadcast data, determine corresponding first main terminal time according to the auxiliary terminal time and the main terminal time of the auxiliary terminal, carry the first main terminal time in the obtained first live broadcast data, the main terminal may receive the first live broadcast data sent by at least two auxiliary terminals, time-align the first live broadcast data according to the first main terminal time carried in the first live broadcast data, and push the first live broadcast data to the live broadcast server. Therefore, the time of the main end is carried in the first live broadcast data received by the main end, the main end and the auxiliary ends accurately time-synchronize, the consistency of the data between the main end and the auxiliary ends is guaranteed, the calculation and the processing of the live broadcast data are dispersed to be executed by the auxiliary ends, the calculation pressure of the main end is reduced, the energy consumption of the main end is reduced, and the performance requirement of the main end is correspondingly reduced; and secondly, the main end can be simultaneously connected with a plurality of auxiliary ends, so that the method has good scale expandability and can fully utilize the network bandwidth.
Fig. 4 shows a schematic scheme of a data pushing method according to this embodiment. It should be noted that the technical solution of the data pushing method shown in fig. 4 is the same as the technical solution of the data pushing method shown in fig. 1 and 2, and details of the technical solution of the data pushing method shown in fig. 4, which are not described in detail, can be referred to the description of the technical solution of the data pushing method shown in fig. 1 and 2.
Fig. 5 is a flowchart illustrating a fifth data pushing method provided according to an embodiment of the present specification, and as shown in fig. 5, the method specifically includes the following steps:
step 502: the main end sends connection information to the intermediate node, wherein the connection information comprises a network address; and listens for connection requests at the network address.
Step 504: the auxiliary end acquires the connection information from the intermediate node; and initiating a connection request to the main terminal according to the network address carried in the connection information.
Step 506: and the main terminal responds to the monitored connection request and establishes connection with the auxiliary terminal.
Step 508: and the main terminal acquires the second live broadcast data and sends a data acquisition request to at least one auxiliary terminal.
Step 510: and the auxiliary terminal responds to the data acquisition request to acquire the first direct broadcasting data.
Step 512: and the auxiliary end sends a time synchronization packet to the main end every a first preset time, wherein the time synchronization packet carries second auxiliary end time to be sent.
Step 514: and the master end records the time of the second master end for receiving the time synchronization packet and sends a time synchronization response packet to the auxiliary end, wherein the time synchronization response packet carries the time of the second auxiliary end, the time of the second master end and the time of a third master end for sending the time synchronization response packet.
Step 516: and the auxiliary end records the time of receiving the third auxiliary end of the time synchronization response packet, and determines the time offset corresponding to the time synchronization packet according to the first time difference between the time of the second main end and the time of the second auxiliary end and the second time difference between the time of the third main end and the time of the third auxiliary end.
Step 518: and under the condition that the time offset corresponding to n time-setting packets is determined, the auxiliary end determines the current time-setting offset between the main end and the auxiliary end according to the time offset corresponding to the 1 st time-setting packet and the time offset corresponding to the m th time-setting packet, wherein n is greater than or equal to 1, m is less than or equal to n, and m and n are natural numbers.
Step 520: and under the condition that the time offset corresponding to the kth time-setting packet is determined, the auxiliary end determines whether to update the current time-setting offset between the main end and the auxiliary end according to the time offset corresponding to the jth time-setting packet and the time offset corresponding to the kth time-setting packet, wherein j is equal to k-m +1, k is greater than n, and j and k are both natural numbers.
Step 522: the auxiliary terminal determines first main terminal time corresponding to the first direct broadcasting data according to first auxiliary terminal time for acquiring the first direct broadcasting data; and carrying the first main terminal time in the first direct broadcasting data and sending the first direct broadcasting data to the main terminal.
Step 524: and the main terminal receives the first live broadcast data, time alignment is carried out on the first live broadcast data and the second live broadcast data according to the first main terminal time carried in the first live broadcast data and the time for acquiring the second live broadcast data, and the time-aligned first live broadcast data and second live broadcast data are pushed to a live broadcast server.
Step 526: and the live broadcast server pushes the received live broadcast data to a watching client.
In the data push method provided by the present specification, an auxiliary terminal may obtain first direct broadcast data, determine a corresponding first main terminal time according to an auxiliary terminal time of the auxiliary terminal and a main terminal time pair, and carry the first main terminal time in the obtained first direct broadcast data; the main end can also obtain second live broadcast data, receive first live broadcast data sent by at least one auxiliary end, align the time of the first live broadcast data and the second live broadcast data according to the first main end time carried in the first live broadcast data and the obtaining time of the second live broadcast data, and then push the first live broadcast data and the second live broadcast data to a live broadcast server. Therefore, the time of the main end is carried in the first live broadcast data received by the main end, the time of the second live broadcast data can be directly compared with the time of the main end, the main end and the auxiliary end accurately time, the consistency of the data between the main end and the auxiliary end and the data between the main end and the auxiliary end are guaranteed, the calculation and the processing of the live broadcast data are dispersed to the auxiliary end to be executed, the calculation pressure of the main end is reduced, the energy consumption of the main end is reduced, and the performance requirement of the main end is correspondingly reduced.
Fig. 5 shows a schematic scheme of a data pushing method according to this embodiment. It should be noted that the technical solution of the data pushing method shown in fig. 5 is the same as the technical solution of the data pushing method shown in fig. 1 and 3, and details of the technical solution of the data pushing method shown in fig. 5, which are not described in detail, can be referred to the description of the technical solution of the data pushing method shown in fig. 1 and 3.
Corresponding to the method embodiment shown in fig. 1, the present application further provides an auxiliary terminal embodiment, and fig. 6 shows a schematic structural diagram of an auxiliary terminal provided in an embodiment of the present application. As shown in fig. 6, the auxiliary terminal includes:
a first obtaining module 602, configured to obtain first live data in response to a data obtaining request sent by a master;
a determining module 604, configured to determine, according to a first auxiliary terminal time for obtaining the first live data, a first main terminal time corresponding to the first live data;
a first sending module 606 configured to send the first direct broadcast data carried by the first master time to the master.
Optionally, the auxiliary terminal further includes a first connection establishing module configured to:
sending a connection information acquisition request to an intermediate node, wherein the connection information acquisition request carries a first identity;
receiving connection information returned by the intermediate node based on a second identity and the first identity, wherein the second identity is an identity carried in the connection information sent by the master end to the intermediate node;
and initiating a connection request according to a network address carried in the connection information, wherein the network address is an address carried in the connection information sent to the intermediate node by the master terminal.
Optionally, the secondary terminal further includes a time setting module configured to:
sending a time synchronization packet to the main terminal every a first preset time length, wherein the time synchronization packet carries second auxiliary terminal time to be sent;
receiving a time synchronization response packet sent by the master end, and recording a third auxiliary end time for receiving the time synchronization response packet, wherein the time synchronization response packet carries the second auxiliary end time, the second master end time and a third master end time for sending the time synchronization response packet, and the second master end time is the time for receiving the time synchronization response packet by the master end;
and determining the time offset corresponding to the time-setting packet according to a first time difference between the second main end time and the second auxiliary end time and a second time difference between the third main end time and the third auxiliary end time.
Optionally, the time tick module is further configured to:
under the condition that time offset corresponding to n time-setting packets is determined, current time-setting offset between the main end and the auxiliary end is determined according to the time offset corresponding to the 1 st time-setting packet and the time offset corresponding to the m th time-setting packet, wherein n is greater than or equal to 1, m is smaller than or equal to n, and m and n are both natural numbers.
Optionally, the time tick module is further configured to:
and calculating a first average value of the time offset corresponding to the 1 st time tick packet to the time offset corresponding to the mth time tick packet, and determining the first average value as the current time tick offset between the main terminal and the auxiliary terminal.
Optionally, the time tick module is further configured to:
under the condition that the time offset corresponding to the kth time tick packet is determined, whether the current time tick offset between the main end and the auxiliary end is updated or not is determined according to the time offset corresponding to the jth time tick packet to the time offset corresponding to the kth time tick packet, wherein j is equal to k-m +1, k is larger than n, and j and k are both natural numbers.
Optionally, the time tick module is further configured to:
calculating the deviation value of the time deviation corresponding to the jth time-setting packet to the time deviation corresponding to the kth time-setting packet;
determining not to update the current time synchronization offset between the main terminal and the auxiliary terminal under the condition that the deviation value is greater than or equal to a preset threshold value;
and under the condition that the deviation value is smaller than a preset threshold value, updating the current time synchronization deviation between the main end and the auxiliary end according to the time deviation corresponding to the jth time synchronization packet to the time deviation corresponding to the kth time synchronization packet.
Optionally, the time tick module is further configured to:
and calculating a second average value of the time offset corresponding to the jth time-tick packet to the time offset corresponding to the kth time-tick packet, and updating the second average value to the current time-tick offset between the main end and the auxiliary end.
Optionally, the determining module 604 is further configured to:
and determining the sum of the first auxiliary terminal time and the current time setting offset as a first main terminal time corresponding to the first broadcast data.
Optionally, the secondary terminal further includes a first keep-alive module configured to:
sending first keep-alive information to the main end, and receiving second keep-alive information sent by the main end;
and under the condition that the second keep-alive information is not received in a second preset time length, disconnecting the main terminal.
The auxiliary terminal provided by this specification can acquire first live broadcast data, determine corresponding first main terminal time according to the auxiliary terminal time and the main terminal time of the auxiliary terminal, carry the first main terminal time in the acquired first live broadcast data, enable a subsequent main terminal to receive the first live broadcast data sent by at least two auxiliary terminals, time-align the first live broadcast data according to the first main terminal time carried in the first live broadcast data, and push the first live broadcast data to a live broadcast server. Therefore, the time of the main end is carried in the first live broadcast data received by the main end, the main end and the auxiliary ends are accurately time-synchronized, the consistency of the data between the main end and the auxiliary ends is guaranteed, the calculation and the processing of the live broadcast data are dispersed to be executed by the auxiliary ends, the calculation pressure of the main end is reduced, the energy consumption of the main end is reduced, and the performance requirement of the main end is correspondingly reduced; and secondly, the main end can be simultaneously connected with a plurality of auxiliary ends, so that the method has good scale expandability and can fully utilize the network bandwidth.
The foregoing is a schematic scheme of an auxiliary terminal in this embodiment. It should be noted that the technical solution of the auxiliary terminal belongs to the same concept as the technical solution of the data pushing method shown in fig. 1, and details of the technical solution of the auxiliary terminal, which are not described in detail, can be referred to the description of the technical solution of the data pushing method shown in fig. 1.
Corresponding to the embodiment of the method shown in fig. 2, the present application further provides an embodiment of a main terminal, and fig. 7 shows a schematic structural diagram of a main terminal provided in an embodiment of the present application. As shown in fig. 7, the main terminal includes:
a second sending module 702, configured to send data acquisition requests to at least two secondary terminals;
a first receiving module 704, configured to receive first broadcast data sent by the at least two auxiliary terminals in response to the data acquisition request, where the first broadcast data carries a first main terminal time determined by the auxiliary terminal according to a first auxiliary terminal time for acquiring the first broadcast data;
a first pushing module 706, configured to perform time alignment on the received first live data according to the first master time carried in the first live data, and push the time-aligned first live data to a live server.
Optionally, the master further includes a second connection establishing module configured to:
sending connection information to an intermediate node, wherein the connection information comprises a network address and a second identity;
monitoring a connection request at the network address;
and responding to the monitored connection request to establish connection with the auxiliary terminal, wherein the connection request is initiated by the auxiliary terminal from the network address acquired from the intermediate node based on the first identity.
Optionally, the primary end further includes a second keep-alive module configured to:
sending second keep-alive information to the auxiliary terminal, and receiving first keep-alive information sent by the auxiliary terminal;
and under the condition that the first keep-alive information is not received in a second preset time length, disconnecting the auxiliary terminal.
Optionally, the primary end further includes a secondary end determining module configured to:
and determining the auxiliary end for receiving the data acquisition request according to the load of each of the at least two auxiliary ends.
The main terminal can acquire live data from the auxiliary terminal, the auxiliary terminal can acquire first live data, corresponding first main terminal time is determined according to the auxiliary terminal time and the main terminal time of the main terminal, the first main terminal time is carried in the acquired first live data, the main terminal can receive the first live data sent by at least two auxiliary terminals, the first live data are subjected to time alignment according to the first main terminal time carried in the first live data, and the first live data are pushed to a live server. Therefore, the time of the main end is carried in the first live broadcast data received by the main end, the main end and the auxiliary ends accurately time-synchronize, the consistency of the data between the main end and the auxiliary ends is guaranteed, the calculation and the processing of the live broadcast data are dispersed to be executed by the auxiliary ends, the calculation pressure of the main end is reduced, the energy consumption of the main end is reduced, and the performance requirement of the main end is correspondingly reduced; and secondly, the main end can be simultaneously connected with a plurality of auxiliary ends, so that the method has good scale expandability and can fully utilize the network bandwidth.
The above is an exemplary scheme of a main terminal of the present embodiment. It should be noted that the technical solution of the master end belongs to the same concept as the technical solution of the data pushing method shown in fig. 2, and details that are not described in detail in the technical solution of the master end can refer to the description of the technical solution of the data pushing method shown in fig. 2.
Corresponding to the embodiment of the method shown in fig. 3, the present application further provides an embodiment of a main terminal, and fig. 8 shows a schematic structural diagram of another main terminal provided in an embodiment of the present application. As shown in fig. 8, the main terminal includes:
a second obtaining module 802, configured to obtain second live broadcast data, and send a data obtaining request to at least one secondary terminal;
a second receiving module 804, configured to receive first broadcast data sent by the at least one auxiliary terminal in response to the data obtaining request, where the first broadcast data carries a first main terminal time determined by the auxiliary terminal according to a first auxiliary terminal time for obtaining the first broadcast data;
the second pushing module 806 is configured to perform time alignment on the first live data and the second live data according to the first master time carried in the first live data and the time for acquiring the second live data, and push the time-aligned first live data and second live data to a live server.
The main terminal can acquire live broadcast data from the auxiliary terminal, the auxiliary terminal can acquire first live broadcast data, determine corresponding first main terminal time according to the auxiliary terminal time and the main terminal time pair of the auxiliary terminal, and carry the first main terminal time in the acquired first live broadcast data; the main terminal can also obtain second live broadcast data, receive first live broadcast data sent by at least one auxiliary terminal, and push the first live broadcast data and the second live broadcast data to a live broadcast server after time alignment according to first main terminal time carried in the first live broadcast data and obtaining time of the second live broadcast data. Therefore, the time of the main end is carried in the first live data received by the main end, the time of the second live data can be directly obtained by the main end, the main end and the auxiliary end accurately time-pair, the consistency of the data between the main end and the auxiliary end is guaranteed, the calculation and the processing of the live data are dispersed to the auxiliary end for execution, the calculation pressure of the main end is reduced, the energy consumption of the main end is reduced, and the performance requirement of the main end is correspondingly reduced.
The above is an exemplary scheme of a main terminal of the present embodiment. It should be noted that the technical solution of the master end belongs to the same concept as the technical solution of the data pushing method shown in fig. 3, and details that are not described in detail in the technical solution of the master end can refer to the description of the technical solution of the data pushing method shown in fig. 3.
Fig. 9 shows a block diagram of a data push system provided according to an embodiment of the present specification, and as shown in fig. 9, the data push system includes a primary peer 902 and at least two secondary peers 904.
The primary peer 902 configured to send a data acquisition request to the secondary peer 904;
the at least two auxiliary terminals 904 configured to obtain first broadcast data in response to the data obtaining request; determining a first main terminal time corresponding to the first direct broadcasting data according to a first auxiliary terminal time of the first direct broadcasting data; carrying the first master end time in the first direct broadcasting data and sending the first direct broadcasting data to the master end 902;
the master 902 is further configured to receive the first live data, perform time alignment on the received first live data according to the first master time carried in the first live data, and push the time-aligned first live data to a live server.
In an optional implementation manner of this embodiment, the system further includes an intermediate node, and the master end 902 is further configured to:
sending a connection information acquisition request to the intermediate node, and receiving connection information returned by the intermediate node;
establishing a connection with the secondary 904 in response to the intercepted connection request;
correspondingly, the secondary 904 is further configured to:
obtaining the connection information from the intermediate node;
and initiating a connection request according to the network address carried in the connection information.
According to the data pushing system provided by the specification, the auxiliary terminal can acquire first live broadcast data, corresponding first main terminal time is determined according to the auxiliary terminal time and the main terminal time of the auxiliary terminal, the first main terminal time is carried in the acquired first live broadcast data, the main terminal can receive the first live broadcast data sent by at least two auxiliary terminals, and the first live broadcast data are pushed to a live broadcast server after being subjected to time alignment according to the first main terminal time carried in the first live broadcast data. Therefore, the time of the main end is carried in the first live broadcast data received by the main end, the main end and the auxiliary ends accurately time-synchronize, the consistency of the data between the main end and the auxiliary ends is guaranteed, the calculation and the processing of the live broadcast data are dispersed to be executed by the auxiliary ends, the calculation pressure of the main end is reduced, the energy consumption of the main end is reduced, and the performance requirement of the main end is correspondingly reduced; and secondly, the main end can be simultaneously connected with a plurality of auxiliary ends, so that the method has good scale expandability and can fully utilize the network bandwidth.
The above is an illustrative scheme of a data push system of the embodiment. It should be noted that the technical solution of the data pushing system and the technical solution of the data pushing method belong to the same concept, and details that are not described in detail in the technical solution of the data pushing system can be referred to the description of the technical solution of the data pushing method.
Fig. 10 is a block diagram illustrating a structure of another data pushing system provided according to an embodiment of the present disclosure, and as shown in fig. 10, the data pushing system includes a primary peer 1002 and at least one secondary peer 1004.
The primary side 1002 is configured to obtain second live data, and send a data obtaining request to the at least one secondary side 1004;
the at least one secondary terminal 1004 is configured to respond to the data acquisition request to acquire first direct broadcast data; determining first main terminal time corresponding to the first direct broadcasting data according to first auxiliary terminal time of the first direct broadcasting data; the first master end time is carried in the first direct broadcast data and sent to the master end 1002;
the master 1002 is further configured to receive the first live data, perform time alignment on the first live data and the second live data according to the first master time carried in the first live data and the time for acquiring the second live data, and push the time-aligned first live data and second live data to a live server.
In a data push system provided by the present specification, an auxiliary terminal may acquire first live broadcast data, determine corresponding first main terminal time according to own auxiliary terminal time and main terminal time synchronization, and carry the first main terminal time in the acquired first live broadcast data; the main terminal can also obtain second live broadcast data, receive first live broadcast data sent by at least one auxiliary terminal, and push the first live broadcast data and the second live broadcast data to a live broadcast server after time alignment according to first main terminal time carried in the first live broadcast data and obtaining time of the second live broadcast data. Therefore, the time of the main end is carried in the first live data received by the main end, the time of the second live data can be directly obtained by the main end, the main end and the auxiliary end accurately time-pair, the consistency of the data between the main end and the auxiliary end is guaranteed, the calculation and the processing of the live data are dispersed to the auxiliary end for execution, the calculation pressure of the main end is reduced, the energy consumption of the main end is reduced, and the performance requirement of the main end is correspondingly reduced.
The above is an illustrative scheme of a data push system of the embodiment. It should be noted that the technical solution of the data pushing system and the technical solution of the data pushing method belong to the same concept, and details that are not described in detail in the technical solution of the data pushing system can be referred to the description of the technical solution of the data pushing method.
FIG. 11 illustrates a block diagram of a computing device 1100 provided in accordance with an embodiment of the present description. The components of the computing device 1100 include, but are not limited to, memory 1110 and a processor 1120. The processor 1120 is coupled to the memory 1110 via a bus 1130 and the database 1150 is used to store data.
The computing device 1100 also includes an access device 1140, the access device 1140 enabling the computing device 1100 to communicate via one or more networks 1160. Examples of such networks include the Public Switched Telephone Network (PSTN), a Local Area Network (LAN), a Wide Area Network (WAN), a Personal Area Network (PAN), or a combination of communication networks such as the internet. Access device 1140 may include one or more of any type of network interface (e.g., a Network Interface Card (NIC)) whether wired or wireless, such as an IEEE802.11 Wireless Local Area Network (WLAN) wireless interface, a worldwide interoperability for microwave access (Wi-MAX) interface, an ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a bluetooth interface, a Near Field Communication (NFC) interface, and so forth.
In one embodiment of the present description, the above-described components of computing device 1100, as well as other components not shown in FIG. 11, may also be connected to each other, such as by a bus. It should be understood that the block diagram of the computing device architecture shown in FIG. 11 is for purposes of example only and is not limiting as to the scope of the present description. Those skilled in the art may add or replace other components as desired.
Computing device 1100 can be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., tablet, personal digital assistant, laptop, notebook, netbook, etc.), mobile phone (e.g., smartphone), wearable computing device (e.g., smartwatch, smartglasses, etc.), or other type of mobile device, or a stationary computing device such as a desktop computer or PC. Computing device 1100 can also be a mobile or stationary server.
The processor 1120 is configured to execute the following computer-executable instructions to implement the data pushing method.
The above is an illustrative scheme of a computing device of the present embodiment. It should be noted that the technical solution of the computing device and the technical solution of the data pushing method belong to the same concept, and details that are not described in detail in the technical solution of the computing device can be referred to the description of the technical solution of the data pushing method.
An embodiment of the present specification further provides a computer readable storage medium, which stores computer instructions, and the instructions are executed by a processor to implement the operation steps of the data pushing method.
The above is an illustrative scheme of a computer-readable storage medium of the present embodiment. It should be noted that the technical solution of the storage medium belongs to the same concept as the technical solution of the data pushing method described above, and details that are not described in detail in the technical solution of the storage medium can be referred to the description of the technical solution of the data pushing method shown in fig. 2.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The computer instructions comprise computer program code which may be in source code form, object code form, an executable file or some intermediate form, or the like. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, read-Only Memory (ROM), random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
It should be noted that, for the sake of simplicity, the foregoing method embodiments are described as a series of acts or combinations, but those skilled in the art should understand that the present disclosure is not limited by the described order of acts, as some steps may be performed in other orders or simultaneously according to the present disclosure. Further, those skilled in the art will appreciate that the embodiments described in this specification are presently considered to be preferred embodiments and that acts and modules are not necessarily required to be described in this specification.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
The preferred embodiments of the present specification disclosed above are intended only to aid in the description of the specification. Alternative embodiments are not exhaustive and do not limit the invention to the precise embodiments described. Obviously, many modifications and variations are possible in light of the above teaching. The embodiments were chosen and described in order to best explain the principles of the specification and its practical application, to thereby enable others skilled in the art to best understand the specification and utilize the specification. The specification is limited only by the claims and their full scope and equivalents.

Claims (22)

1. A data pushing method is applied to a secondary side, and the method comprises the following steps:
responding to a data acquisition request sent by a main terminal, acquiring first direct broadcasting data, wherein the data acquisition request carries time marks, the time marks are used for indicating the starting and stopping time periods of the auxiliary terminal for acquiring the first direct broadcasting data, and the time marks carried in the data acquisition requests sent by the main terminal to different auxiliary terminals are different;
determining first main-terminal time corresponding to the first direct-broadcasting data according to first auxiliary-terminal time and main-terminal time pairs of the first direct-broadcasting data, wherein the first auxiliary-terminal time refers to local time acquired by the first direct-broadcasting data on an auxiliary terminal;
and carrying the first main terminal time in the first direct broadcasting data and sending the first direct broadcasting data to the main terminal.
2. The data pushing method according to claim 1, wherein before acquiring the live data in response to the data acquisition request sent by the host, the method further comprises:
sending a connection information acquisition request to an intermediate node, wherein the connection information acquisition request carries a first identity mark;
receiving connection information returned by the intermediate node based on a second identity identifier and the first identity identifier, wherein the second identity identifier is an identity identifier carried in the connection information sent by the master terminal to the intermediate node;
and initiating a connection request according to a network address carried in the connection information, wherein the network address is an address carried in the connection information sent to the intermediate node by the master terminal.
3. The data pushing method according to claim 1 or 2, wherein before determining the first primary-end time corresponding to the first live data according to the first secondary-end time and the primary-end time for obtaining the first live data, the method further includes:
sending a time synchronization packet to the main terminal every a first preset time length, wherein the time synchronization packet carries second auxiliary terminal time to be sent;
receiving a time synchronization response packet sent by the master end, and recording a third auxiliary end time for receiving the time synchronization response packet, wherein the time synchronization response packet carries the second auxiliary end time, the second master end time and a third master end time for sending the time synchronization response packet, and the second master end time is the time for receiving the time synchronization response packet by the master end;
and determining the time offset corresponding to the time pair packet according to a first time difference between the second main end time and the second auxiliary end time and a second time difference between the third main end time and the third auxiliary end time.
4. The data pushing method according to claim 3, wherein after determining the time offset corresponding to the time pair packet, the method further comprises:
under the condition that time offset corresponding to n time tick packets is determined, current time tick offset between the main end and the auxiliary end is determined according to the time offset corresponding to the 1 st time tick packet to the time offset corresponding to the mth time tick packet, wherein n is greater than or equal to 1, m is less than or equal to n, and m and n are both natural numbers.
5. The data pushing method according to claim 4, wherein the determining the current time synchronization offset between the primary end and the secondary end according to the time offset corresponding to the 1 st time synchronization packet to the time offset corresponding to the m-th time synchronization packet includes:
and calculating a first average value of the time offset corresponding to the 1 st time tick packet to the time offset corresponding to the mth time tick packet, and determining the first average value as the current time tick offset between the main terminal and the auxiliary terminal.
6. The data pushing method according to claim 4, wherein after determining the current time synchronization offset between the primary end and the secondary end according to the time offset corresponding to the 1 st time synchronization packet to the time offset corresponding to the m-th time synchronization packet, the method further comprises:
and under the condition that the time offset corresponding to the kth time tick packet is determined, determining whether to update the current time tick offset between the main end and the auxiliary end according to the time offset corresponding to the jth time tick packet from the time offset corresponding to the kth time tick packet to the time offset corresponding to the kth time tick packet, wherein j is equal to k-m +1, k is greater than n, and j and k are both natural numbers.
7. The method according to claim 6, wherein the determining whether to update the current time synchronization offset between the primary end and the secondary end according to the time offset corresponding to the j-th time synchronization packet to the time offset corresponding to the k-th time synchronization packet includes:
calculating the deviation value of the time deviation corresponding to the jth time-setting packet to the time deviation corresponding to the kth time-setting packet;
determining not to update the current time synchronization offset between the main terminal and the auxiliary terminal under the condition that the deviation value is greater than or equal to a preset threshold value;
and under the condition that the deviation value is smaller than a preset threshold value, updating the current time synchronization deviation between the main end and the auxiliary end according to the time deviation corresponding to the jth time synchronization packet to the time deviation corresponding to the kth time synchronization packet.
8. The data pushing method according to claim 7, wherein the updating the current time synchronization offset between the primary end and the secondary end according to the time offset corresponding to the j-th time synchronization packet to the time offset corresponding to the k-th time synchronization packet includes:
and calculating a second average value of the time offset corresponding to the jth time-tick packet to the time offset corresponding to the kth time-tick packet, and updating the second average value to the current time-tick offset between the main end and the auxiliary end.
9. The data pushing method according to any one of claims 4 to 8, wherein the determining, according to the first secondary peer time and the primary peer time obtained from the first live data, the first primary peer time corresponding to the first live data includes:
and determining the sum of the first auxiliary terminal time and the current time setting offset as a first main terminal time corresponding to the first broadcast data.
10. The data pushing method of claim 1, further comprising:
sending first keep-alive information to the main end, and receiving second keep-alive information sent by the main end;
and under the condition that the second keep-alive information is not received in a second preset time length, disconnecting the main terminal.
11. A data pushing method is applied to a master end, and comprises the following steps:
sending data acquisition requests to at least two auxiliary terminals, wherein the data acquisition requests carry time marks, the time marks are used for indicating the starting and stopping time periods of the auxiliary terminals for acquiring the first broadcast data, and the time marks carried in the data acquisition requests sent by the main terminal to different auxiliary terminals are different;
receiving first direct broadcast data sent by the at least two auxiliary terminals in response to the data acquisition request, wherein the first direct broadcast data carries first main terminal time determined by the auxiliary terminals according to first auxiliary terminal time for acquiring the first direct broadcast data and main terminal time pairs, and the first auxiliary terminal time refers to local time acquired by the first direct broadcast data on the auxiliary terminals;
and according to the first main terminal time carried in the first live data, carrying out time alignment on the received first live data, and pushing the time-aligned first live data to a live broadcast server.
12. The data pushing method according to claim 11, wherein before sending the data acquisition request to the at least two secondary terminals, the method further comprises:
sending connection information to an intermediate node, wherein the connection information comprises a network address and a second identity;
monitoring a connection request at the network address;
and responding to the monitored connection request to establish connection with the auxiliary terminal, wherein the connection request is initiated by the auxiliary terminal based on the network address acquired by the intermediate node based on the first identity.
13. The data pushing method according to claim 11, further comprising:
sending second keep-alive information to the auxiliary terminal, and receiving first keep-alive information sent by the auxiliary terminal;
and under the condition that the first keep-alive information is not received in a second preset time length, disconnecting the auxiliary terminal.
14. The data pushing method according to claim 11, wherein before sending the data acquisition request to the at least two secondary terminals, the method further comprises:
and determining the auxiliary end for receiving the data acquisition request according to the load of each of the at least two auxiliary ends.
15. A data pushing method is applied to a master end, and comprises the following steps:
acquiring second live broadcast data and sending a data acquisition request to at least one auxiliary terminal, wherein the data acquisition request carries time identification, the time identification is used for indicating the start-stop time period of the auxiliary terminal for acquiring the first live broadcast data, and the time identifications carried in the data acquisition requests sent by the main terminal to different auxiliary terminals are different;
receiving first direct-broadcasting data sent by the at least one auxiliary terminal in response to the data acquisition request, wherein the first direct-broadcasting data carries first main terminal time determined by the auxiliary terminal according to first auxiliary terminal time for acquiring the first direct-broadcasting data and main terminal time pairs, and the first auxiliary terminal time refers to local time acquired by the first direct-broadcasting data on the auxiliary terminal;
and according to the first main terminal time carried in the first live data and the time for acquiring the second live data, time alignment is carried out on the first live data and the second live data, and the time-aligned first live data and second live data are pushed to a live server.
16. An auxiliary terminal, comprising:
the first obtaining module is configured to obtain first direct-broadcast data in response to a data obtaining request sent by a main terminal, where the data obtaining request carries a time identifier, the time identifier is used to indicate a start-stop period when the auxiliary terminal obtains the first direct-broadcast data, and time identifiers carried in data obtaining requests sent by the main terminal to different auxiliary terminals are different;
the determining module is configured to determine a first main terminal time corresponding to the first direct broadcast data according to a first auxiliary terminal time and a main terminal pair for acquiring the first direct broadcast data, wherein the first auxiliary terminal time refers to local time acquired by the first direct broadcast data on the auxiliary terminal;
a first sending module, configured to send the first main terminal time carried in the first direct broadcast data to the main terminal.
17. A primary side, comprising:
a second sending module, configured to send data acquisition requests to at least two auxiliary terminals, where the data acquisition requests carry time identifiers, the time identifiers are used to indicate start-stop periods when the auxiliary terminals acquire the first broadcast data, and the time identifiers carried in the data acquisition requests sent by the main terminal to different auxiliary terminals are different;
a first receiving module, configured to receive first broadcast data sent by the at least two auxiliary terminals in response to the data acquisition request, where the first broadcast data carries a first main terminal time determined by the auxiliary terminal according to a first auxiliary terminal time for acquiring the first broadcast data and a main terminal time pair, where the first auxiliary terminal time is local time acquired by the first broadcast data on the auxiliary terminal;
the first pushing module is configured to perform time alignment on the received first live data according to the first master time carried in the first live data, and push the time-aligned first live data to a live server.
18. A primary side, comprising:
a second obtaining module, configured to obtain second live broadcast data and send a data obtaining request to at least one auxiliary terminal, where the data obtaining request carries a time identifier, the time identifier is used to indicate a start-stop time period when the auxiliary terminal obtains the first live broadcast data, and time identifiers carried in data obtaining requests sent by the main terminal to different auxiliary terminals are different;
a second receiving module, configured to receive first broadcast data sent by the at least one auxiliary terminal in response to the data acquisition request, where the first broadcast data carries a first main terminal time determined by the auxiliary terminal according to a first auxiliary terminal time for acquiring the first broadcast data and a main terminal time pair, where the first auxiliary terminal time is local time acquired by the first broadcast data on the auxiliary terminal;
and the second pushing module is configured to time align the first live data and the second live data according to the first master time carried in the first live data and the time for acquiring the second live data, and push the time-aligned first live data and second live data to a live server.
19. A data push system, characterized in that the system comprises: a main terminal and at least two auxiliary terminals;
the main terminal is configured to send data acquisition requests to the at least two auxiliary terminals, where the data acquisition requests carry time identifiers, the time identifiers are used to indicate start-stop periods during which the auxiliary terminals acquire the first broadcast data, and the time identifiers carried in the data acquisition requests sent by the main terminal to different auxiliary terminals are different;
the at least two auxiliary terminals are configured to respond to the data acquisition request and acquire first direct broadcasting data; determining first main terminal time corresponding to the first direct broadcasting data according to first auxiliary terminal time and main terminal time of the first direct broadcasting data; carrying the first main terminal time in the first direct broadcasting data and sending the first direct broadcasting data to the main terminal, wherein the first auxiliary terminal time refers to local time acquired by the first direct broadcasting data on the auxiliary terminal;
the master is further configured to receive the first live broadcast data, perform time alignment on the received first live broadcast data according to the first master time carried in the first live broadcast data, and push the time-aligned first live broadcast data to a live broadcast server.
20. A data push system, the system comprising: a main terminal and at least one auxiliary terminal;
the main terminal is configured to acquire second live data and send a data acquisition request to the at least one auxiliary terminal, wherein the data acquisition request carries a time identifier, the time identifier is used for indicating a start-stop time period when the auxiliary terminal acquires the first live data, and the time identifiers carried in the data acquisition requests sent by the main terminal to different auxiliary terminals are different;
the at least one auxiliary terminal is configured to respond to the data acquisition request and acquire first direct broadcasting data; determining first main terminal time corresponding to the first direct broadcasting data according to first auxiliary terminal time and main terminal time of the first direct broadcasting data; carrying the first main terminal time in the first direct broadcasting data and sending the first direct broadcasting data to the main terminal, wherein the first auxiliary terminal time refers to local time acquired by the first direct broadcasting data on the auxiliary terminal;
the master is further configured to receive the first live broadcast data, perform time alignment on the first live broadcast data and the second live broadcast data according to the first master time carried in the first live broadcast data and the time for acquiring the second live broadcast data, and push the time-aligned first live broadcast data and second live broadcast data to a live broadcast server.
21. A computing device, comprising:
a memory and a processor;
the memory is used for storing computer-executable instructions, and the processor is used for executing the computer-executable instructions to realize the operation steps of the data pushing method of the above claims 1-10 or 11-14 or 15.
22. A computer readable storage medium storing computer instructions which, when executed by a processor, implement the operational steps of the data pushing method of claims 1-10 or 11-14 or 15.
CN202110246126.7A 2021-03-05 2021-03-05 Data push method, auxiliary terminal, main terminal and data push system Active CN112887775B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110246126.7A CN112887775B (en) 2021-03-05 2021-03-05 Data push method, auxiliary terminal, main terminal and data push system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110246126.7A CN112887775B (en) 2021-03-05 2021-03-05 Data push method, auxiliary terminal, main terminal and data push system

Publications (2)

Publication Number Publication Date
CN112887775A CN112887775A (en) 2021-06-01
CN112887775B true CN112887775B (en) 2023-03-07

Family

ID=76055529

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110246126.7A Active CN112887775B (en) 2021-03-05 2021-03-05 Data push method, auxiliary terminal, main terminal and data push system

Country Status (1)

Country Link
CN (1) CN112887775B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106210757A (en) * 2016-07-28 2016-12-07 北京小米移动软件有限公司 Live broadcasting method, live broadcast device and live broadcast system
WO2017050006A1 (en) * 2015-09-24 2017-03-30 广州视睿电子科技有限公司 Remote live broadcast method and system
CN106713975A (en) * 2016-12-08 2017-05-24 广州华多网络科技有限公司 Live broadcast processing method and apparatus
CN107948664A (en) * 2017-11-20 2018-04-20 广州虎牙信息科技有限公司 Direct broadcasting room video playing control method, device and terminal
CN108259989A (en) * 2018-01-19 2018-07-06 广州华多网络科技有限公司 Method, computer readable storage medium and the terminal device of net cast
CN111698521A (en) * 2019-03-12 2020-09-22 广州华林珠宝有限公司 Network live broadcast method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017050006A1 (en) * 2015-09-24 2017-03-30 广州视睿电子科技有限公司 Remote live broadcast method and system
CN106210757A (en) * 2016-07-28 2016-12-07 北京小米移动软件有限公司 Live broadcasting method, live broadcast device and live broadcast system
CN106713975A (en) * 2016-12-08 2017-05-24 广州华多网络科技有限公司 Live broadcast processing method and apparatus
CN107948664A (en) * 2017-11-20 2018-04-20 广州虎牙信息科技有限公司 Direct broadcasting room video playing control method, device and terminal
CN108259989A (en) * 2018-01-19 2018-07-06 广州华多网络科技有限公司 Method, computer readable storage medium and the terminal device of net cast
CN111698521A (en) * 2019-03-12 2020-09-22 广州华林珠宝有限公司 Network live broadcast method and device

Also Published As

Publication number Publication date
CN112887775A (en) 2021-06-01

Similar Documents

Publication Publication Date Title
US10298457B2 (en) Synchronization of configuration file of virtual application distribution chassis
CN107800565B (en) Inspection method, inspection device, inspection system, computer equipment and storage medium
CN107357571B (en) Maintenance method and system for equipment component program
CN103744809A (en) Method for dual-computer hot-standby of vehicle information management system on basis of VRRP
WO2021017703A1 (en) Communication information exchange method and apparatus, storage medium and computer device
CN113032223B (en) Server state detection method and device
CN111181747A (en) Gateway cooperation realization method and device, IoT gateway and storage medium
CN111294240A (en) Cross-domain coordination method, coordination device and control device for network-as-a-Service (SERVICE) service
CN112887775B (en) Data push method, auxiliary terminal, main terminal and data push system
CN112003943A (en) Voice data synchronization method and device
CN111258795B (en) Samba cluster fault reconnection method, device, equipment and medium
CN113014947B (en) Data pushing method, auxiliary terminal, main terminal and data pushing system
CN110868466B (en) Storage method, system and equipment for distributed storage network
CN116915353A (en) Stacked network device as accurate time protocol boundary clock
CN109344202B (en) Data synchronization method and management node
CN107979653B (en) Load balancing method and device
CN112637351B (en) File downloading method and device
CN112533304B (en) Ad hoc network management method, device, system, electronic equipment and storage medium
CN105323270A (en) Network information pushing method and system
CN110519002B (en) Time synchronization method and related device
Wantamanee et al. Virtualising machine to machine (M2M) application using open baton as NFV-compliant framework for building energy management system
JP2023012870A (en) Communication device, communication method, and program
CN112910595A (en) Real-time communication method and device
CN117471934B (en) Simulation method of multifunctional measurement and control device and computer equipment
CN112752123B (en) Network quality evaluation method and device

Legal Events

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