CN115134618A - Live stream life cycle information processing method and device and computing equipment - Google Patents

Live stream life cycle information processing method and device and computing equipment Download PDF

Info

Publication number
CN115134618A
CN115134618A CN202210689075.XA CN202210689075A CN115134618A CN 115134618 A CN115134618 A CN 115134618A CN 202210689075 A CN202210689075 A CN 202210689075A CN 115134618 A CN115134618 A CN 115134618A
Authority
CN
China
Prior art keywords
sequence number
life cycle
stream
callback request
live
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.)
Granted
Application number
CN202210689075.XA
Other languages
Chinese (zh)
Other versions
CN115134618B (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.)
Shanghai Bilibili Technology Co Ltd
Original Assignee
Shanghai Bilibili 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 Shanghai Bilibili Technology Co Ltd filed Critical Shanghai Bilibili Technology Co Ltd
Priority to CN202210689075.XA priority Critical patent/CN115134618B/en
Publication of CN115134618A publication Critical patent/CN115134618A/en
Application granted granted Critical
Publication of CN115134618B publication Critical patent/CN115134618B/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/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/21Server components or server architectures
    • H04N21/218Source of audio or video content, e.g. local disk arrays
    • H04N21/2187Live feed
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/239Interfacing the upstream path of the transmission network, e.g. prioritizing client content requests
    • H04N21/2393Interfacing the upstream path of the transmission network, e.g. prioritizing client content requests involving handling client requests
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/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/433Content storage operation, e.g. storage operation in response to a pause request, caching operations
    • H04N21/4334Recording operations
    • 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/458Scheduling content for creating a personalised stream, e.g. by combining a locally stored advertisement with an incoming stream; Updating operations, e.g. for OS modules ; time-related management operations
    • H04N21/4586Content update operation triggered locally, e.g. by comparing the version of software modules in a DVB carousel to the version stored locally
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/85Assembly of content; Generation of multimedia applications
    • H04N21/858Linking data to content, e.g. by linking an URL to a video object, by creating a hotspot

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Databases & Information Systems (AREA)
  • Computer And Data Communications (AREA)

Abstract

The application discloses a live stream life cycle information processing method, a live stream life cycle information processing device and computing equipment, and relates to the technical field of internet, wherein the live stream life cycle information processing method comprises the following steps: acquiring a stream state callback request which is initiated by an edge node and carries a first sequence number corresponding to a stream pushing link and life cycle information of a live stream; the first sequence number is generated by a client side generating a live stream and is provided for an edge node, and the first sequence number is a variable changing in a global monotone way; if the stream state callback request is a stream pushing callback request, updating the life cycle record of the live stream, wherein the life cycle record comprises a first serial number and life cycle information of the live stream; and if the stream state callback request is a cut-off callback request, inquiring the life cycle record of the live stream, and determining whether to refuse to respond to the cut-off callback request according to a comparison result of a second sequence number and a first sequence number contained in the inquired life cycle record. By the method, the life cycle information of the live stream can be accurately recorded.

Description

Live stream life cycle information processing method and device and computing equipment
Technical Field
The application relates to the technical field of internet, in particular to a live stream life cycle information processing method and device and computing equipment.
Background
With the development of internet technology, live webcasting has become a trend, in a live webcasting scene, a source stream directly pushed by a host can pass through an uplink edge node, a central source station, a content distribution network and the like, the whole link relates to a plurality of edge nodes and various devices distributed at different geographic positions, the stability of a transmission link in a public network environment is difficult to guarantee, a live webcasting link can be changed continuously, and the life cycle of a live webcasting stream also has very important application significance, so that it is very necessary to accurately record the life cycle of the live webcasting stream.
In the prior art, a center server records a live stream life cycle through a stream state callback request sent by an edge node. However, due to the complex public network environment, the order of the stream state callback requests of each edge node reaching the central server is disordered, which may cause the central server to record the stream life cycle inaccurately.
Disclosure of Invention
The embodiments of the present application provide a live stream lifecycle information processing method, an apparatus, and a computing device, so as to solve the problem in the prior art that a recording of a stream lifecycle by a central server is inaccurate due to a time sequence confusion when a stream state callback request of each edge node reaches the central server.
According to an aspect of the present application, a live stream lifecycle information processing method is provided, including:
acquiring a stream state callback request which is initiated by an edge node and carries a first sequence number corresponding to a stream pushing link and life cycle information of a live stream; the first sequence number is generated by a client side generating a live stream and is provided for an edge node, and the first sequence number is a variable changing in a global monotone way;
if the stream state callback request is a stream pushing callback request, updating a life cycle record of the live stream, wherein the life cycle record comprises a first sequence number and life cycle information of the live stream;
and if the stream state callback request is a cut-off callback request, inquiring the life cycle record of the live stream, and determining whether to refuse to respond to the cut-off callback request according to a comparison result of a second sequence number and a first sequence number contained in the inquired life cycle record.
Optionally, the determining whether to reject the response to the blackout callback request according to a comparison result of the first sequence number and the second sequence number included in the queried lifecycle record further comprises:
if the comparison result is that the first sequence number is consistent with the second sequence number, responding to the flow-cutoff callback request;
and if the comparison result shows that the first sequence number is not consistent with the second sequence number, refusing to respond the flow-cutoff callback request.
Optionally, responding to the blackout callback request further comprises: deleting the life cycle record of the live stream containing the second sequence number.
Optionally, the lifecycle information of the live stream comprises one or more of the following information: edge node information, content distribution network information, and stream pushing time.
Optionally, the method further comprises: collecting live streaming state information of each edge node at regular time, and producing the live streaming state information into a message queue; consuming the message queue, and determining life cycle information of each live stream; and updating the life cycle record of each live stream.
According to another aspect of the present application, a live stream lifecycle information processing method is provided, including:
generating a first sequence number corresponding to the push flow link; wherein the first sequence number is a variable which changes monotonically in the global sense;
providing a live broadcast stream data packet carrying a first serial number to an edge node for the edge node to analyze to obtain the first serial number, initiating a stream state callback request carrying the first serial number and life cycle information of a live broadcast stream to a central server, and further updating a life cycle record of the live broadcast stream by the central server under the condition that the central server receives the stream pushing callback request, wherein the life cycle record comprises the first serial number and the life cycle information of the live broadcast stream; and under the condition of receiving the interruption callback request, inquiring the life cycle record of the live stream, and determining whether to refuse to respond to the interruption callback request according to a comparison result of a second sequence number and a first sequence number contained in the inquired life cycle record.
Optionally, the first sequence number is a variable that is incremented following a time change.
Optionally, generating the first sequence number corresponding to the push flow link further comprises:
reading a record value of a preset incremental variable, and calculating the sum of the record value of the preset incremental variable and a preset amplification to obtain a target value of the preset incremental variable;
determining a first sequence number according to a target value of a preset incremental variable;
the method further comprises the following steps: and after the target value of the preset incremental variable is obtained, updating the recorded value of the preset incremental variable to the target value of the preset incremental variable.
Optionally, determining the first sequence number according to the target value of the preset incremental variable further comprises:
and calculating the sum of the value of the local timestamp and the target value of the preset incremental variable to obtain a first sequence number.
Optionally, providing the live streaming data packet carrying the first sequence number to the edge node further includes:
and adding the first sequence number into a packet header of the live streaming data packet, and pushing the live streaming data packet added with the first sequence number to an edge node.
According to another aspect of the present application, a live stream lifecycle information processing method is provided, including:
receiving a live streaming data packet which is sent by a client and carries a first sequence number corresponding to a stream pushing link; wherein the first sequence number is a variable which changes monotonically in the global sense;
binding and storing the first serial number and the push flow link;
initiating a stream state callback request carrying a first sequence number and life cycle information of the live stream to a central server, so that the central server updates life cycle records of the live stream under the condition of receiving a stream pushing callback request, wherein the life cycle records comprise the first sequence number and the life cycle information of the live stream; and under the condition of receiving the interruption callback request, inquiring the life cycle record of the live stream, and determining whether to refuse to respond to the interruption callback request according to a comparison result of a second sequence number and a first sequence number contained in the inquired life cycle record.
Optionally, before initiating the blackout callback request to the central server, the method further comprises: and inquiring a first sequence number bound with a push flow link of the occurrence interruption, and adding the first sequence number into the interruption callback request.
According to another aspect of the present application, there is provided a live stream lifecycle information processing apparatus, comprising:
the acquisition module is suitable for acquiring a stream state callback request which is initiated by an edge node and carries a first sequence number corresponding to a stream pushing link and life cycle information of a live stream; the first sequence number is generated by a client side generating a live stream and is provided for an edge node, and the first sequence number is a variable changing in a global monotone way;
the processing module is suitable for updating a life cycle record of the live stream if the stream state callback request is a push stream callback request, wherein the life cycle record comprises a first sequence number and life cycle information of the live stream; and if the stream state callback request is a blanking callback request, inquiring the life cycle record of the live stream, and determining whether to refuse to respond to the blanking callback request according to a comparison result of a second sequence number and a first sequence number contained in the inquired life cycle record.
Optionally, the processing module is further adapted to: if the comparison result is that the first sequence number is consistent with the second sequence number, responding to the flow-cutoff callback request; and if the comparison result shows that the first sequence number is not consistent with the second sequence number, refusing to respond the flow-cutoff callback request.
Optionally, the processing module is further adapted to: deleting the life cycle record of the live stream containing the second sequence number.
Optionally, the lifecycle information of the live stream comprises one or more of the following information: edge node information, content distribution network information, and stream pushing time.
Optionally, the apparatus further comprises: the updating processing module is suitable for acquiring the live streaming state information of each edge node at regular time and generating the live streaming state information into a message queue; consuming the message queue, and determining the life cycle information of each live stream; and updating the life cycle record of each live stream.
According to another aspect of the present application, there is provided a live stream lifecycle information processing apparatus, including:
the serial number generation module is suitable for generating a first serial number corresponding to the push flow link; wherein, the first sequence number is a variable which changes globally and monotonically;
the first sending module is suitable for providing a live streaming data packet carrying a first serial number to an edge node so as to be analyzed by the edge node to obtain the first serial number, and initiating a streaming state callback request carrying the first serial number and life cycle information of a live streaming to a central server so that the central server updates life cycle records of the live streaming under the condition that the central server receives the stream pushing callback request, wherein the life cycle records comprise the first serial number and the life cycle information of the live streaming; and under the condition of receiving the interruption callback request, inquiring the life cycle record of the live stream, and determining whether to refuse to respond to the interruption callback request according to a comparison result of a second sequence number and a first sequence number contained in the inquired life cycle record.
Optionally, the first sequence number is a variable that is incremented following a time change.
Optionally, the serial number generation module is further adapted to: reading a record value of a preset incremental variable, and calculating the sum of the record value of the preset incremental variable and a preset amplification to obtain a target value of the preset incremental variable; determining a first sequence number according to a target value of a preset incremental variable;
the apparatus further comprises: and the updating module is suitable for updating the record value of the preset incremental variable to the target value of the preset incremental variable after the target value of the preset incremental variable is obtained.
Optionally, the serial number generation module is further adapted to: and calculating the sum of the value of the local timestamp and the target value of the preset incremental variable to obtain a first sequence number.
Optionally, the first transmitting module is further adapted to: and adding the first sequence number into a packet header of the live streaming data packet, and pushing the live streaming data packet added with the first sequence number to an edge node.
According to another aspect of the present application, there is provided a live stream lifecycle information processing apparatus, comprising:
the receiving module is suitable for receiving a live streaming data packet which is sent by a client and carries a first serial number corresponding to the stream pushing link; wherein the first sequence number is a variable which changes monotonically in the global sense;
the binding module is suitable for binding and storing the first serial number and the push flow link;
the second sending module is suitable for initiating a stream state callback request carrying the first sequence number and the life cycle information of the live stream to the central server, so that the central server updates the life cycle record of the live stream under the condition of receiving the stream pushing callback request, wherein the life cycle record comprises the first sequence number and the life cycle information of the live stream; and under the condition of receiving the interruption callback request, inquiring the life cycle record of the live stream, and determining whether to refuse to respond to the interruption callback request according to a comparison result of a second sequence number and a first sequence number contained in the inquired life cycle record.
Optionally, the apparatus further comprises: and the query module is suitable for querying the first sequence number bound with the flow pushing link in which flow cutoff occurs and adding the first sequence number into the flow cutoff callback request.
According to yet another aspect of the present application, there is provided a computing device comprising: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication through the communication bus;
the memory is used for storing at least one executable instruction, and the executable instruction enables the processor to execute the operation corresponding to the live stream life cycle information processing method.
According to another aspect of the present application, a computer storage medium is provided, where at least one executable instruction is stored in the storage medium, and the executable instruction causes a processor to execute an operation corresponding to the live stream lifecycle information processing method.
According to the live stream life cycle information processing method, the live stream life cycle information processing device and the computing equipment, the method comprises the following steps: on one hand, a first sequence number is generated by the client aiming at each plug flow link and is provided for the edge node, the first sequence number is kept to be monotonously changed, and the edge node sends a flow state callback request carrying the first sequence number corresponding to the plug flow link and life cycle information of the live flow to the central server; if the stream state callback request is a stream pushing callback request, updating a life cycle record of the live stream, wherein the life cycle record comprises a first sequence number and life cycle information of the live stream; if the stream state callback request is a cut-off callback request, inquiring the life cycle record of the live stream, and determining whether to refuse to respond to the cut-off callback request according to a comparison result of a second sequence number and a first sequence number contained in the inquired life cycle record; by the mode, life cycle information of live streams under different push link links is distinguished and recorded respectively based on the characteristic of monotonous change of the first serial number, whether the push link corresponding to the cut-off callback request is consistent with the push link corresponding to the recently recorded first serial number is determined by comparing the first serial number corresponding to the recently recorded push link with the first serial number carried by the received cut-off callback request, whether the cut-off callback request is responded is further determined, the overdue cut-off callback request can be identified, further, if the cut-off callback request is consistent, the cut-off callback request is determined to be unexpired and responded, the life cycle record of the live stream containing the recently recorded first serial number is deleted, and the life cycle information of the live stream can be accurately recorded; on the other hand, live stream state information of each edge node is collected regularly, life cycle information of each live stream is calculated according to the live stream state information, life cycle records of each live stream are updated, and the problem that live stream life cycle data are inaccurate due to loss of stream state callback requests is solved through an edge global collection dotting compensation strategy.
The above description is only an overview of the technical solutions of the present application, and the present application may be implemented in accordance with the content of the description so as to make the technical means of the present application more clearly understood, and the detailed description of the present application will be given below in order to make the above and other objects, features, and advantages of the present application more clearly understood.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the application. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
fig. 1 shows a flowchart of a live stream lifecycle information processing method provided in an embodiment of the present application;
fig. 2 shows a flowchart of a live stream lifecycle information processing method according to another embodiment of the present application;
FIG. 3a is a schematic diagram of a system architecture in an embodiment of the present application;
FIG. 3b shows a schematic diagram of a flash reconnect in an embodiment of the present application;
fig. 4 shows a flowchart of a live stream lifecycle information processing method according to another embodiment of the present application;
fig. 5 is a flowchart illustrating a live stream lifecycle information processing method according to another embodiment of the present application;
fig. 6 is a schematic structural diagram illustrating a live stream lifecycle information processing apparatus according to another embodiment of the present application;
fig. 7 is a schematic structural diagram illustrating a live stream lifecycle information processing apparatus according to another embodiment of the present application;
fig. 8 shows a schematic structural diagram of a live stream lifecycle information processing apparatus according to another embodiment of the present application;
fig. 9 shows a schematic structural diagram of a computing device provided in an embodiment of the present application.
Detailed Description
Exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present application are shown in the drawings, it should be understood that the present application may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
First, the noun terms to which one or more embodiments of the present application relate are explained.
Live streaming: live audiovisual data transmission that can be transmitted as a steady and continuous stream over a network for viewing by an audience.
Edge nodes: the user side server is deployed at the edge of each city, is close to the physical distance of the user, and has the advantage of low transmission delay.
The central server: and the edge nodes are connected and used for recording the life cycle information of the live stream.
CDN: the Content Delivery Network (Content Delivery Network) is an advanced flow distribution Network constructed on the existing Network, a new Network architecture is added in the existing Network, the Content of a website is distributed to the edge of the Network closest to a user, the response speed of the user for accessing the website is improved, and the CDN has the characteristic of load balancing, has the functions of caching, mirroring and integral load balancing, and is mainly used for caching static data in the website.
Pushing flow linkage: and the edge nodes participating in the push flow, the content distribution network and other equipment nodes.
Flow state callback request: and the edge node sends a callback request to the central service according to the push flow state of the push flow link.
A push flow callback request: when a new push flow link pushes flow, the edge node triggers a push flow callback request.
Cutoff callback request: when the flow interruption occurs to the push flow link, the edge node triggers the flow interruption callback request.
Fig. 1 shows a flowchart of a live stream lifecycle information processing method provided by an embodiment of the present application, where the method is applied in a central server, and as shown in fig. 1, the method includes the following steps:
step S110, a stream state callback request which is initiated by the edge node and carries a first sequence number corresponding to the stream pushing link and life cycle information of the live stream is obtained. The first sequence number is generated by a client end generating a live broadcast stream and is provided for an edge node, and the first sequence number is a variable changing in a global monotone mode.
The live stream has a stream identifier, the stream identifier of the same live stream remains unchanged, reconnection can be performed under the condition that the network is unstable, the push stream link changes, and the stream identifier of the reconnected live stream remains unchanged, namely the live stream remains the same after reconnection.
The client generates a first sequence number and provides the first sequence number to the edge node, and after determining the push flow link, the client generates the first sequence number corresponding to the push flow link and sends the first sequence number to the edge node. The first sequence number is a variable that changes globally monotonically, and the first sequence numbers generated by the client for different push flow links are all different, for example, if the first sequence number is globally monotonically increasing, the first sequence number corresponding to the push flow link that is constructed first is smaller than the first sequence number corresponding to the push flow link that is constructed later.
The method comprises the steps that an edge node sends a streaming state callback request carrying a first serial number corresponding to a push streaming link and life cycle information of a live streaming to a central server, and specifically, when a streaming data packet (the streaming data packet is streamed according to the push streaming link) is received, the edge node sends the push streaming callback request to the central server, and the push streaming callback request carries the first serial number corresponding to the push streaming link and the life cycle information of the live streaming generated by a client generating the first serial number; when the occurrence of flow interruption of the push flow link is detected, the edge node sends a flow interruption callback request to the central server, and similarly, the flow interruption callback request carries a first sequence number of the push flow link and life cycle information of a live flow generated by a client generating the first sequence number.
The life cycle information of the live stream includes: the information of the edge node (i.e. the identifier of the edge node where the live stream is located), the information of the content delivery network (i.e. the identifier of the CDN where the live stream is pushed), the information of the latest stream pushing time, and so on. As can be seen, the live stream lifecycle information included in the stream state callback request corresponds to the stream pushing link corresponding to the first sequence number.
Step S120, if the stream state callback request is a stream pushing callback request, updating a life cycle record of the live stream, wherein the life cycle record comprises a first sequence number and life cycle information of the live stream.
And if the central server receives the push flow callback request sent by the edge node, updating a first sequence number carried by the push flow callback request and life cycle information of the live flow into a life cycle record. For example, the first sequence number carried by the push flow callback request and the life cycle information of the live stream are refreshed to the life cycle record, or a new life cycle record is created for recording the first sequence number carried by the push flow callback request and the life cycle information of the live stream. In this way, the life cycle information of the live stream under different push stream links can be recorded.
Step S130, if the stream state callback request is a cut-off callback request, querying a life cycle record of the live stream, and determining whether to reject to respond to the cut-off callback request according to a comparison result between a second sequence number and a first sequence number included in the queried life cycle record.
The second sequence number included in the lifetime record is essentially the first sequence number carried by the last received push flow callback request. And if the edge node receives the blackout callback request, inquiring the life cycle record of the latest updated live stream, comparing a second sequence number contained in the life cycle record of the latest updated live stream with a first sequence number carried by the blackout callback request, and determining whether to refuse to respond to the blackout callback request according to a comparison result.
Because the push flow links have a one-to-one correspondence relationship with the first sequence number, whether the push flow link corresponding to the last push flow callback request is the same as the push flow link corresponding to the cutoff callback request can be determined by comparing the size relationship between the cutoff callback request and the second sequence number contained in the life cycle record, if so, the cutoff callback request is responded, and if not, the cutoff callback request is refused to be responded. And responding to the interruption callback request means that the life cycle record containing the second sequence number is normally ended, and the interruption of the live broadcast stream on the stream pushing link corresponding to the second sequence number is indicated.
In some scenarios, such as network jitter, the occurrence timing of the live stream lifecycle information recorded by the central server may be abnormal because the time sequence of each live stream callback request reaching the central server is inconsistent with the occurrence timing of the event triggering each live stream callback request. For example, when the connection between the client and the edge node a is disconnected, including the disconnection of the push stream link a where the edge node a is located, the client automatically reconnects to the edge node B, the push stream link B including the edge node B is established by reconnection, and the live streams generated by the client before and after the flash restart are automatically identified as the same live stream.
In a short time, the edge node a may initiate a flow interruption callback request corresponding to the flow pushing link a, and the edge node B may initiate a flow pushing callback request corresponding to the flow pushing link B, but the sequence of the two requests reaching the central server cannot be guaranteed, so that the timing sequence of the central server receiving the flow state callback request is disordered, for example, the flow pushing callback request of the edge node B is received first, and then the flow interruption callback request of the edge node a is received, if the flow pushing link corresponding to the flow interruption callback request is not judged to be directly responded, the live stream is recorded to be interrupted, but actually the client normally pushes the stream through the flow pushing link B, it can be seen that if the timing sequence of the flow state callback reaching the central server is disordered, the life cycle information management of the live stream by the central server is abnormal.
According to the live stream life cycle information processing method provided by the embodiment, a client generates a first serial number for each push stream link and provides the first serial number to an edge node, the first serial number is kept to be monotonously changed, and the edge node sends a stream state callback request carrying the first serial number corresponding to the push stream link and life cycle information of a live stream to a central server; if the stream state callback request is a stream pushing callback request, updating a life cycle record of the live stream, wherein the life cycle record comprises a first sequence number and life cycle information of the live stream; if the stream state callback request is a blanking callback request, inquiring the life cycle record of the live stream, and determining whether to refuse to respond to the blanking callback request according to a comparison result of a second serial number and a first serial number contained in the inquired life cycle record; by the mode, life cycle information of the live stream under different push link links is distinguished and recorded respectively based on the characteristic of monotonous change of the first serial number, whether the push link corresponding to the cut-off callback request is consistent with the push link corresponding to the recently recorded first serial number or not is determined by comparing the first serial number corresponding to the recently recorded push link with the first serial number carried by the received cut-off callback request, the overdue cut-off callback request can be identified, and whether the cut-off callback request is responded or not is determined, so that the life cycle information of the live stream can be accurately recorded.
Fig. 2 shows a flowchart of a live stream lifecycle information processing method provided in another embodiment of the present application, where the method is applied in a central server, and as shown in fig. 2, the method includes the following steps:
step S210, a stream state callback request which is initiated by the edge node and carries a first sequence number corresponding to the push stream link and life cycle information of the live stream is obtained.
The first sequence number is generated by a client side generating a live stream and is provided for the edge node, and the first sequence number is a variable changing in a global monotone mode.
The flow state callback request is divided into a push flow callback request and a flow break callback request, and different parameters are carried in the flow state callback request to distinguish the push flow callback request from the flow break callback request.
Specifically, after the push stream link is established, the client generates a first sequence number corresponding to the push stream link before performing a real push stream operation, adds the first sequence number to a packet header of a stream packet of the live stream, and pushes the stream packet to which the first sequence number is added to the edge node, thereby providing the first sequence number to the edge node. After receiving the stream data packet, the edge node analyzes the stream data packet and extracts a first sequence number carried in the stream data packet, brings the first sequence number into a flow-pushing callback request, meanwhile, establishes an association relation between the first sequence number and the flow-pushing link, and then brings the first sequence number associated with the flow-pushing link into the flow-breaking callback request if flow breaking of the flow-pushing link is detected.
In an optional manner, a sender is set in the client, and a first sequence number corresponding to the push flow link is generated by using the sender, where the sender is specifically a component. Specifically, reading a record value of a preset incremental variable, and calculating the sum of the record value of the preset incremental variable and a preset amplification to obtain a target value of the preset incremental variable; and determining the first sequence number according to the target value of the preset increment variable. When a client end generating the live stream has a new push stream link, for example, when an edge node of the push stream changes, a record value of the preset incremental variable is read first, a preset amplification is added to the record value, a target value is obtained through calculation, and a first sequence number corresponding to the new push stream link is obtained according to the target value, for example, the target value can be directly used as the first sequence number. And after the target value of the preset incremental variable is obtained, the record value of the preset incremental variable is updated to the target value, so that when a new push stream link exists in the live stream in the subsequent process, the first sequence number is generated on the basis of the updated record value of the preset incremental variable, and the first sequence number is ensured to be incremented along with the time change.
In an optional manner, determining the first sequence number according to the target value of the preset incremental variable further includes: and calculating the sum of the value of the local timestamp and the target value of the preset incremental variable to obtain a first sequence number.
Step S220, if the stream state callback request is a stream pushing callback request, updating a life cycle record of the live stream, where the life cycle record includes the first sequence number and life cycle information of the live stream.
And if the central server receives the push flow callback request sent by the edge node, updating a first sequence number carried by the push flow callback request and the life cycle information of the live stream into the life cycle record. For example, the first sequence number carried by the push stream callback request and the life cycle information of the live stream are refreshed to the life cycle record, or a new life cycle record is created for recording the first sequence number carried by the stream callback request and the life cycle information of the live stream. In this way, the life cycle information of the live stream under different push stream links can be recorded.
Step S230, if the stream state callback request is a cut-off callback request, querying a life cycle record of the live stream that is updated recently, comparing a second sequence number included in the queried life cycle record with the first sequence number, and if the two are consistent, deleting the life cycle record of the live stream that includes the second sequence number.
If the central server receives a cut-off callback request sent by the edge node, the life cycle record of the latest updated live stream is inquired, the latest updated live stream lifecycle information is obtained in response to the latest received push callback request, the second sequence number (i.e. the first sequence number carried in the latest received push callback request) contained in the queried lifecycle record is compared with the first sequence number carried in the interruption callback request, because the first sequence number and the push stream link have a corresponding relationship, if the first sequence number and the push stream link are consistent, the central server does not receive the push stream callback requests of other push stream links between the recently received push stream callback request and the flow interruption callback request, the recording of the life cycle information of the live stream is normally ended in response to the cut-off callback request, that is, the life cycle recording of the live stream containing the second sequence number is deleted. And if the first sequence number is not consistent with the second sequence number, rejecting the response interruption callback request.
The following further describes the embodiment of the method of the present embodiment with reference to the drawings. Fig. 3a shows a schematic diagram of a system architecture according to an embodiment of the present application, where a client pushes a flow to an edge node a, the edge node a pushes the flow to a CDN a, and a push flow link a specifically includes: the method comprises the steps that a client side, an edge node A and a CDN A are included, the edge node A sends a push flow callback request to a central server, the push flow callback request comprises a first sequence number-101 corresponding to a push flow link A, the CDN pushed by the flow of a live flow and the edge node where the flow is located, and the push flow callback request comprises the following information: 101 for seq, CDN for CDN A and Node for Node A.
Fig. 3b shows a schematic diagram of a flash reconnection in an embodiment of the present application, and as shown in fig. 3b, in the case of network jitter, if a push link a is disconnected, an edge node a sends a blackout callback request to a central server, where the blackout callback request carries a first sequence number-101 corresponding to the push link a, and includes the following information: 101 for seq, CDN for CDN A and Node for Node A; meanwhile, the automatic reconnection is switched to the edge node B, and the reconnection forms a new push flow link, namely the push flow link B, which specifically comprises the following steps: the method comprises the following steps that a client-edge node B-CDN A pushes flow to the edge node B, the edge node B pushes flow to the CDN A, the client generates a first serial number-102 (101+1) corresponding to a push flow link B and provides the first serial number to the edge node B, the edge node B sends a push flow callback request to a central server, and the push flow callback request comprises the following information: seq 102, CDN CDN A and node NodeB.
When the central server receives the push flow callback request of the edge Node A, seq:101, CDN: CDN A, Node: Node A are updated into the life cycle record of the live flow, and then the sequence of the flow break callback request initiated by the edge Node A and the sequence of the push flow callback request initiated by the edge Node B reaching the central server are divided into the following two cases.
In the first case: the cutoff callback request of edge node a arrives first and the push callback request of edge node B arrives later, which is consistent with normal timing. When a cut-off callback request of an edge Node A is received, if a first sequence number carried by the cut-off callback request is consistent with a second sequence number contained in a life cycle record and is 101, responding to the cut-off callback request, normally finishing recording life cycle information of a live stream corresponding to a stream pushing link A, and deleting life cycle records of the live stream containing the second sequence number (seq:101, CDN: CDN A, Node: Node A); then, receiving a push flow callback request of the edge node B, and updating a life cycle record of the live broadcast flow in response to the push flow callback request, that is: seq:102, CDN: CDN A, Node: Node B.
In the second case: the push-flow callback request of edge node B arrives first and the break-flow callback request of edge node a arrives later, which is abnormal. When a push stream callback request of an edge Node B is received, a first sequence number carried in the push stream callback request is 102, a life cycle record is updated according to the first sequence number carried in the push stream callback request and life cycle information of a live stream, and the life cycle record is (seq:102, CDN: CDN A, Node: Node B); and then, receiving the interruption callback request of the edge node A, wherein the carried first sequence number-101 is inconsistent with the second sequence number-102 contained in the latest updated life cycle record, and refusing to respond to the interruption callback request.
Step S240, collecting live streaming state information of each edge node at regular time, and generating the live streaming state information into a message queue; consuming the message queue, and determining life cycle information of each live stream; and updating the life cycle record of each live stream.
In practical applications, a situation that the streaming state callback request is lost may occur, for example, the streaming state callback request cannot be normally sent due to network downtime, edge hardware problems, unstable network links, and the like, so that the live stream lifecycle data is inaccurate.
Based on the method, the central server regularly collects the live stream state information of all edge nodes, produces the collected data into a state message queue, consumes the message queue by an independent state service, calculates the life cycle information (including the edge node where the stream is located, the CDN of stream push and the first sequence number of the stream) of each live stream, updates the life cycle record of each live stream, for example, compensates the missing life cycle information, corrects the wrong life cycle information, and solves the problem of inaccurate live stream life cycle data caused by loss of the stream state callback request through an edge global collection dotting compensation strategy.
On one hand, the method of the embodiment distinguishes and records the life cycle information of the live broadcast stream under different stream pushing links by using the characteristic of monotonous change of the first serial number, and ensures that the life cycle record of the stream pushing link can only be finished by the flow interruption callback request of the same stream pushing link, thereby being capable of accurately recording the life cycle information of the live broadcast stream; on the other hand, by the edge global acquisition dotting compensation strategy, the problem of inaccurate live stream life cycle data caused by loss of stream state callback requests can be avoided.
Fig. 4 is a flowchart illustrating a live stream lifecycle information processing method provided by another embodiment of the present application, which is applied to a client, and as shown in fig. 4, the method includes the following steps:
in step S410, a first sequence number corresponding to the push flow link is generated.
Wherein the first sequence number is a variable that changes globally and monotonically.
In an alternative mode, the first sequence number is a variable that is incremented with time, and generating the first sequence number corresponding to the push flow link includes: reading a record value of a preset incremental variable, and calculating the sum of the record value of the preset incremental variable and a preset amplification to obtain a target value of the preset incremental variable; determining a first sequence number according to a target value of a preset incremental variable; and after the target value of the preset incremental variable is obtained, updating the record value of the preset incremental variable to the target value of the preset incremental variable.
When a new push flow link exists at the client, for example, when an edge node of the push flow changes, the client reads a recorded value of the preset incremental variable, adds a preset increment to the recorded value, calculates to obtain a target value, and obtains a first sequence number of the new push flow link according to the target value, for example, the target value can be directly used as the first sequence number. And after the target value of the preset incremental variable is obtained, the record value of the preset incremental variable is updated to the target value, so that when a new push flow link is generated in the subsequent process, the first sequence number is generated on the basis of the updated record value of the preset incremental variable, and the first sequence number is ensured to be incremented along with the time change.
In an optional manner, the step of determining the first sequence number according to the target value of the preset incremental variable specifically includes: and calculating the sum of the value of the local timestamp and the target value of the preset incremental variable to obtain a first sequence number.
In an optional manner, a sender is set in the client, and a first sequence number corresponding to the push flow link is generated by using the sender, where the sender is specifically a component.
Step S420, providing the live broadcast stream data packet carrying the first serial number to an edge node for the edge node to analyze to obtain the first serial number, initiating a stream state callback request carrying the first serial number and life cycle information of the live broadcast stream to a central server, and further updating life cycle records of the live broadcast stream by the central server under the condition that the central server receives the stream push callback request, wherein the life cycle records comprise the first serial number and the life cycle information of the live broadcast stream; and under the condition of receiving the interruption callback request, inquiring the life cycle record of the live stream, and determining whether to refuse to respond to the interruption callback request according to a comparison result of a second sequence number and a first sequence number contained in the inquired life cycle record.
The first sequence number is added to a live streaming data packet, the live streaming data packet added with the first sequence number is pushed to an edge node, the edge node analyzes the received live streaming data packet, the first sequence number of the push streaming link is extracted from the live streaming data packet, and the edge node sends a streaming state callback request carrying the first sequence number of the push streaming link to a central server so that the central server can conveniently judge the idempotent.
In an optional manner, the first sequence number is added to a header of the live streaming data packet, and the live streaming data packet to which the first sequence number is added is pushed to the edge node. Before the client executes the real stream pushing operation, a first sequence number corresponding to the stream pushing link is generated, the first sequence number is added into a packet header of a live stream data packet, the stream data packet added with the first sequence number is pushed to the edge node, and therefore the first sequence number is provided for the edge node.
After receiving the stream data packet, the edge node analyzes the stream data packet and extracts a first sequence number carried in the stream data packet, brings the first sequence number into the flow pushing callback request, meanwhile, establishes an association relation between the first sequence number and the flow pushing link, and then brings the first sequence number associated with the flow pushing link into the flow stopping callback request if the flow stopping of the flow pushing link is detected.
And if the central server receives the push flow callback request sent by the edge node, updating the first sequence number carried by the push flow callback request and the life cycle information of the live flow into the life cycle record. For example, the first sequence number carried by the stream call request and the life cycle information of the live stream are refreshed into the life cycle record, or a new life cycle record is created for recording the first sequence number carried by the stream call request and the life cycle information of the live stream. In this way, the life cycle information of the live stream under different push stream links can be recorded.
The life cycle information of the live stream includes: the information of the edge node (i.e. the identifier of the edge node where the live stream is located), the information of the content delivery network (i.e. the identifier of the CDN where the live stream is pushed), the information of the latest stream pushing time, and so on. As can be seen, the live stream lifecycle information included in the stream state callback request corresponds to the stream pushing link corresponding to the first sequence number.
And if the central server receives the cutoff callback request sent by the edge node, inquiring the life cycle record of the latest updated live stream, and determining whether to refuse to respond to the cutoff callback request according to a comparison result of a second sequence number and a first sequence number contained in the inquired life cycle record. The second sequence number included in the lifetime record is essentially the first sequence number carried by the last received push flow callback request.
Because the first sequence number has a corresponding relation with the plug-flow link, by comparing the size relation between the cutout callback request and the second sequence number contained in the life cycle record, whether the plug-flow link corresponding to the last plug-flow callback request is the same as the plug-flow link corresponding to the cutout callback request can be determined, and whether the central server receives the plug-flow callback requests of other plug-flow links between the recently received plug-flow callback request and the cutout callback request can also be determined, if so, the cutout callback request is responded, otherwise, the cutout callback request is denied to be responded. Specifically, responding to the blackout callback request refers to deleting a life cycle record of the live stream containing the second sequence number.
According to the live stream lifecycle information processing method provided by the embodiment, the live stream lifecycle information under different push stream links is distinguished and recorded respectively by using the characteristic of monotonic change of the first sequence number, and it is ensured that the live stream lifecycle recording of the push stream link can only be ended by the cut-off callback request of the same push stream link, thereby being capable of realizing accurate recording of the live stream lifecycle information.
Fig. 5 is a flowchart illustrating a live stream lifecycle information processing method provided in another embodiment of the present application, where the method is applied to an edge node, and as shown in fig. 5, the method includes the following steps:
step S510, receiving a live streaming data packet sent by the client and carrying a first sequence number corresponding to the stream pushing link.
After determining the push flow link, the client generates a first sequence number corresponding to the push flow link and sends the first sequence number to the edge node. Optionally, the first sequence number is added to the live streaming data packet, the live streaming data packet to which the first sequence number is added is pushed to the edge node, the edge node analyzes the received live streaming data packet, and the first sequence number of the push streaming link is extracted from the received live streaming data packet.
In an alternative manner, the first sequence number is a variable that is incremented along with a time change, and the step of the client generating the first sequence number corresponding to the push flow link includes:
reading a record value of a preset incremental variable, and calculating the sum of the record value of the preset incremental variable and a preset amplification to obtain a target value of the preset incremental variable; determining a first sequence number according to a target value of a preset incremental variable; optionally, a sum of the value of the local timestamp and a target value of a preset incremental variable is calculated to obtain the first sequence number. And after the client obtains the target value of the preset incremental variable, updating the record value of the preset incremental variable to the target value of the preset incremental variable.
When a new push flow link exists at the client, for example, when an edge node of the push flow changes, the client reads a recorded value of the preset incremental variable, adds a preset increment to the recorded value, calculates to obtain a target value, and obtains a first sequence number of the new push flow link according to the target value, for example, the target value can be directly used as the first sequence number. And after the target value of the preset incremental variable is obtained, the recorded value of the preset incremental variable is updated to the target value, so that when a new plug flow link exists in the subsequent process, the first sequence number is generated on the basis of the updated recorded value of the preset incremental variable, and the first sequence number is ensured to be increased along with the time change.
In an optional manner, the step of determining the first sequence number according to the target value of the preset incremental variable specifically includes: and calculating the sum of the value of the local timestamp and the target value of the preset incremental variable to obtain a first sequence number.
In an optional manner, a number sender is set in the client, and a first serial number corresponding to the push stream link is generated by using the number sender, where the number sender is specifically a component.
And step S520, binding and storing the first serial number and the push flow link.
And establishing a binding relation between the first sequence number and the push flow link, and storing the binding relation.
Step S530, a stream state callback request carrying a first sequence number and life cycle information of the live stream is sent to the central server, so that the central server updates life cycle records of the live stream under the condition that the central server receives the stream pushing callback request, wherein the life cycle records comprise the first sequence number and the life cycle information of the live stream; and under the condition of receiving the interruption callback request, inquiring the life cycle record of the live stream, and determining whether to refuse to respond to the interruption callback request according to a comparison result of a second sequence number and a first sequence number contained in the inquired life cycle record.
The client side pushes a streaming data packet carrying a first serial number to an edge node, the edge node analyzes and extracts the first serial number corresponding to a push stream link contained in the streaming data packet, and sends a push stream callback request carrying the first serial number corresponding to the push stream link and life cycle information of a live stream to a central server; and meanwhile, establishing a binding relationship between the first serial number and the push stream link, inquiring the serial number bound with the push stream link with the occurrence of the interruption when the interruption of the push stream link is detected, and sending an interruption callback request carrying the first serial number corresponding to the push stream link and the life cycle information of the live stream to the central server.
And if the central server receives the push flow callback request sent by the edge node, updating the first sequence number carried by the push flow callback request and the life cycle information of the live flow into the life cycle record. For example, the first sequence number carried by the stream call request and the life cycle information of the live stream are refreshed into the life cycle record, or a new life cycle record is created for recording the first sequence number carried by the stream call request and the life cycle information of the live stream. In this way, the life cycle information of the live stream under different push stream links can be recorded.
The life cycle information of the live stream includes: the information of the edge node (i.e. the identifier of the edge node where the live stream is located), the information of the content delivery network (i.e. the identifier of the CDN where the live stream is pushed), the information of the latest stream pushing time, and so on. As can be seen, the live stream lifecycle information included in the stream state callback request corresponds to the stream pushing link corresponding to the first sequence number.
And if the central server receives the cutoff callback request sent by the edge node, inquiring the life cycle record of the latest updated live stream, and determining whether to refuse to respond to the cutoff callback request according to a comparison result of a second sequence number and a first sequence number contained in the inquired life cycle record. The second sequence number included in the lifetime record is essentially the first sequence number carried by the last received push flow callback request.
Because the first sequence number has a corresponding relation with the plug-flow link, by comparing the size relation between the cutout callback request and the second sequence number contained in the life cycle record, whether the plug-flow link corresponding to the last plug-flow callback request is the same as the plug-flow link corresponding to the cutout callback request can be determined, and whether the central server receives the plug-flow callback requests of other plug-flow links between the recently received plug-flow callback request and the cutout callback request can also be determined, if so, the cutout callback request is responded, otherwise, the cutout callback request is denied to be responded. Specifically, the response to the blackout callback request refers to normal ending of recording of the life cycle information of the live stream, that is, deleting the life cycle record of the live stream including the second sequence number.
According to the live stream life cycle information processing method provided by the embodiment, the life cycle information of the live stream under different push stream links is distinguished and recorded respectively by utilizing the characteristic of monotonous change of the first sequence number, and the life cycle recording of the push stream link is ensured to be ended only by the cut-off callback request of the same push stream link, so that the live stream life cycle information can be accurately recorded.
Fig. 6 is a schematic structural diagram of a live stream lifecycle information processing apparatus provided in another embodiment of the present application, which is applied to a central server, and as shown in fig. 6, the apparatus includes:
the acquisition module 61 is adapted to acquire a stream state callback request, which is initiated by the edge node and carries a first sequence number corresponding to the stream pushing link and life cycle information of the live stream; the first sequence number is generated by a client side generating a live stream and is provided for an edge node, and the first sequence number is a variable changing in a global monotone way;
the processing module 62 is adapted to update a life cycle record of the live stream if the stream state callback request is a push stream callback request, the life cycle record including a first sequence number and life cycle information of the live stream; and if the stream state callback request is a cut-off callback request, inquiring the life cycle record of the live stream, and determining whether to refuse to respond to the cut-off callback request according to a comparison result of a second sequence number and a first sequence number contained in the inquired life cycle record.
Optionally, the processing module 62 is further adapted to: if the comparison result is that the first sequence number is consistent with the second sequence number, responding to the flow-cutoff callback request; and if the comparison result shows that the first sequence number is not consistent with the second sequence number, refusing to respond the flow-cutoff callback request.
Optionally, the processing module 62 is further adapted to: deleting the life cycle record of the live stream containing the second sequence number.
Optionally, the lifecycle information of the live stream comprises one or more of the following information: edge node information, content distribution network information, and stream pushing time.
Optionally, the apparatus further comprises: the updating processing module is suitable for acquiring the live streaming state information of each edge node at regular time and generating the live streaming state information into a message queue; consuming the message queue, and determining life cycle information of each live stream; and updating the life cycle record of each live stream.
Fig. 7 is a schematic structural diagram of a live stream lifecycle information processing apparatus according to another embodiment of the present application, where the apparatus is applied to a client, and as shown in fig. 7, the apparatus specifically includes:
a sequence number generation module 71 adapted to generate a first sequence number corresponding to the push flow link; wherein the first sequence number is a variable which changes monotonically in the global sense;
the first sending module 72 is adapted to provide the live streaming data packet carrying the first sequence number to the edge node for the edge node to analyze to obtain the first sequence number, and initiate a streaming status callback request carrying the first sequence number and life cycle information of the live streaming to the central server, so that the central server updates a life cycle record of the live streaming under the condition that the central server receives the stream push callback request, where the life cycle record includes the first sequence number and the life cycle information of the live streaming; and under the condition of receiving the interruption callback request, inquiring the life cycle record of the live stream, and determining whether to refuse to respond to the interruption callback request according to a comparison result of a second sequence number and a first sequence number contained in the inquired life cycle record.
Optionally, the first sequence number is a variable that is incremented following a time change.
Optionally, the serial number generation module 71 is further adapted to: reading a record value of a preset incremental variable, and calculating the sum of the record value of the preset incremental variable and a preset amplification to obtain a target value of the preset incremental variable; determining a first sequence number according to a target value of a preset incremental variable;
the apparatus further comprises: and the updating module is suitable for updating the record value of the preset incremental variable to the target value of the preset incremental variable after the target value of the preset incremental variable is obtained.
Optionally, the serial number generation module 71 is further adapted to: and calculating the sum of the value of the local timestamp and the target value of the preset incremental variable to obtain a first sequence number.
Optionally, the first sending module 72 is further adapted to: and adding the first sequence number into a packet header of the live streaming data packet, and pushing the live streaming data packet added with the first sequence number to an edge node.
Fig. 8 is a schematic structural diagram illustrating a live stream lifecycle information processing apparatus according to another embodiment of the present application, where the apparatus is applied to an edge node, and as shown in fig. 8, the apparatus specifically includes:
the receiving module 81 is adapted to receive a live streaming data packet which is sent by a client and carries a first serial number corresponding to the stream pushing link; wherein, the first sequence number is a variable which changes globally and monotonically;
a binding module 82, adapted to perform binding storage on the first sequence number and the push flow link;
the second sending module 83 is adapted to carry a stream state callback request of the first sequence number and the life cycle information of the live stream to the central server, so that the central server updates the life cycle record of the live stream when receiving the stream push callback request, wherein the life cycle record includes the first sequence number and the life cycle information of the live stream; and under the condition of receiving the interruption callback request, inquiring the life cycle record of the live stream, and determining whether to refuse to respond to the interruption callback request according to a comparison result of a second sequence number and a first sequence number contained in the inquired life cycle record.
Optionally, the apparatus further comprises: and the query module is suitable for querying a first sequence number bound with the flow pushing link of the flow interruption and adding the first sequence number into the flow interruption callback request.
The embodiment of the application provides a nonvolatile computer storage medium, wherein the computer storage medium stores at least one executable instruction, and the computer executable instruction can execute the live stream life cycle information processing method in any method embodiment.
The embodiment of the application provides a nonvolatile computer storage medium, wherein the computer storage medium stores at least one executable instruction, and the computer executable instruction can execute the live stream life cycle information processing method in any method embodiment.
Fig. 9 shows a schematic structural diagram of an embodiment of a computing device according to the present application, and the specific embodiment of the present application does not limit a specific implementation of the computing device.
As shown in fig. 9, the computing device may include: a processor (processor), a Communications Interface (Communications Interface), a memory (memory), and a Communications bus.
Wherein: the processor, the communication interface, and the memory communicate with each other via a communication bus. A communication interface for communicating with network elements of other devices, such as clients or other servers. The processor is configured to execute a program, and may specifically execute relevant steps in the above live stream lifecycle information processing method embodiment for a computing device.
In particular, the program may include program code comprising computer operating instructions.
The processor may be a central processing unit CPU, or an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits configured to implement embodiments of the present application. The computing device includes one or more processors, which may be the same type of processor, such as one or more CPUs; or may be different types of processors such as one or more CPUs and one or more ASICs.
And the memory is used for storing programs. The memory may comprise high-speed RAM memory, and may also include non-volatile memory, such as at least one disk memory.
The algorithms or displays presented herein are not inherently related to any particular computer, virtual machine, or other apparatus. Various general purpose systems may also be used with the teachings herein. The required structure for constructing such a system will be apparent from the description above. In addition, embodiments of the present application are not directed to any particular programming language. It will be appreciated that a variety of programming languages may be used to implement the teachings of the present application as described herein, and any descriptions of specific languages are provided above to disclose the best modes of the present application.
In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the application may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the application, various features of the embodiments of the application are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the application and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: this application is intended to cover such departures from the present disclosure as come within known or customary practice in the art to which this invention pertains. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this application.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Moreover, those skilled in the art will appreciate that while some embodiments herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the application and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.
Various component embodiments of the present application may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that a microprocessor or Digital Signal Processor (DSP) may be used in practice to implement some or all of the functionality of some or all of the components according to embodiments of the present application. The present application may also be embodied as apparatus or device programs (e.g., computer programs and computer program products) for performing a portion or all of the methods described herein. Such programs implementing the present application may be stored on a computer readable medium or may be in the form of one or more signals. Such a signal may be downloaded from an internet website, or provided on a carrier signal, or provided in any other form.
It should be noted that the above-mentioned embodiments illustrate rather than limit the application, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The application may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means can be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names. The steps in the above embodiments should not be construed as limited to the order of execution unless otherwise specified.

Claims (17)

1. A live stream life cycle information processing method comprises the following steps:
acquiring a stream state callback request which is initiated by an edge node and carries a first sequence number corresponding to a stream pushing link and life cycle information of a live stream; the first sequence number is generated by a client side which generates the live broadcast stream and is provided for the edge node, and the first sequence number is a variable which changes in a global monotone way;
if the stream state callback request is a stream pushing callback request, updating a life cycle record of the live stream, wherein the life cycle record comprises the first sequence number and life cycle information of the live stream;
and if the stream state callback request is a flow interruption callback request, inquiring the life cycle record of the live stream, and determining whether to refuse to respond to the flow interruption callback request according to a comparison result of a second sequence number and the first sequence number contained in the inquired life cycle record.
2. The method of claim 1, wherein said determining whether to deny a response to said blackout callback request based on a comparison of a second sequence number included in said queried lifecycle record with said first sequence number further comprises:
if the comparison result is that the first sequence number is consistent with the second sequence number, responding to the flow-cutoff callback request;
and if the comparison result shows that the first sequence number is inconsistent with the second sequence number, refusing to respond to the flow interruption callback request.
3. The method of claim 2, wherein said responding to said blackout callback request further comprises: deleting a life cycle record of the live stream containing a second sequence number.
4. The method of any of claims 1-3, wherein the lifecycle information of the live stream includes one or more of the following information: edge node information, content distribution network information, and stream pushing time.
5. The method according to any one of claims 1-4, wherein the method further comprises:
collecting live streaming state information of each edge node at fixed time, and producing the live streaming state information into a message queue;
consuming the message queue and determining life cycle information of each live stream;
and updating the life cycle record of each live stream.
6. A live stream life cycle information processing method comprises the following steps:
generating a first sequence number corresponding to the push flow link; wherein the first sequence number is a variable which changes monotonically in a global manner;
providing a live broadcast stream data packet carrying the first sequence number to an edge node for the edge node to analyze to obtain the first sequence number, initiating a stream state callback request carrying the first sequence number and life cycle information of a live broadcast stream to a central server, and further allowing the central server to update life cycle records of the live broadcast stream under the condition of receiving the stream push callback request, wherein the life cycle records comprise the first sequence number and the life cycle information of the live broadcast stream; and under the condition of receiving a blackout callback request, inquiring the life cycle record of the live stream, and determining whether to refuse to respond to the blackout callback request according to a comparison result of a second sequence number and the first sequence number contained in the inquired life cycle record.
7. The method of claim 6, wherein the first sequence number is a variable that increments with time.
8. The method of claim 7, wherein the generating a first sequence number corresponding to a push flow link further comprises:
reading a record value of a preset incremental variable, and calculating the sum of the record value of the preset incremental variable and a preset amplification to obtain a target value of the preset incremental variable;
determining the first serial number according to the target value of the preset incremental variable;
the method further comprises the following steps: and after the target value of the preset incremental variable is obtained, updating the record value of the preset incremental variable to the target value of the preset incremental variable.
9. The method of claim 8, wherein the determining the first sequence number according to the target value of the preset incremental variable further comprises:
and calculating the sum of the value of the local timestamp and the target value of the preset incremental variable to obtain the first sequence number.
10. The method of claim 6, wherein the providing live streaming packets carrying the first sequence number to an edge node further comprises:
and adding the first sequence number into a packet header of a live streaming data packet, and pushing the live streaming data packet added with the first sequence number to the edge node.
11. A live stream life cycle information processing method comprises the following steps:
receiving a live streaming data packet which is sent by a client and carries a first sequence number corresponding to a push streaming link; wherein the first sequence number is a variable which changes monotonically in the global sense;
binding and storing the first serial number and the push flow link;
initiating a stream state callback request carrying the first sequence number and life cycle information of the live stream to a central server, so that the central server updates life cycle records of the live stream under the condition of receiving a stream pushing callback request, wherein the life cycle records comprise the first sequence number and the life cycle information of the live stream; and under the condition of receiving a blackout callback request, inquiring the life cycle record of the live stream, and determining whether to refuse to respond to the blackout callback request according to a comparison result of a second sequence number and the first sequence number contained in the inquired life cycle record.
12. The method of claim 11, wherein prior to initiating the blackout callback request to the central server, the method further comprises: and inquiring a first sequence number bound with a push flow link of the occurrence interruption, and adding the first sequence number to the interruption callback request.
13. A live stream lifecycle information processing apparatus, comprising:
the acquisition module is suitable for acquiring a stream state callback request which is initiated by an edge node and carries a first sequence number corresponding to a stream pushing link and life cycle information of a live stream; the first sequence number is generated by a client side which generates the live broadcast stream and is provided for the edge node, and the first sequence number is a variable which changes in a global monotone way;
the processing module is suitable for updating a life cycle record of the live stream if the stream state callback request is a stream pushing callback request, wherein the life cycle record comprises the first sequence number and life cycle information of the live stream; and if the stream state callback request is a flow interruption callback request, inquiring the life cycle record of the live stream, and determining whether to refuse to respond to the flow interruption callback request according to a comparison result of a second sequence number and the first sequence number contained in the inquired life cycle record.
14. A live stream lifecycle information processing apparatus, comprising:
the serial number generation module is suitable for generating a first serial number corresponding to the push flow link; wherein the first sequence number is a variable which changes monotonically in a global manner;
the first sending module is suitable for providing a live streaming data packet carrying the first sequence number to an edge node so that the edge node can analyze the live streaming data packet to obtain the first sequence number, and initiating a streaming state callback request carrying the first sequence number and life cycle information of a live streaming to a central server so that the central server can update life cycle records of the live streaming under the condition that the central server receives the stream pushing callback request, wherein the life cycle records comprise the first sequence number and the life cycle information of the live streaming; and under the condition of receiving a blackout callback request, inquiring the life cycle record of the live stream, and determining whether to refuse to respond to the blackout callback request according to a comparison result of a second sequence number and the first sequence number contained in the inquired life cycle record.
15. A live stream lifecycle information processing apparatus, comprising:
the receiving module is suitable for receiving a live streaming data packet which is sent by a client and carries a first serial number corresponding to the stream pushing link; wherein the first sequence number is a variable which changes monotonically in the global sense;
the binding module is suitable for binding and storing the first serial number and the push flow link;
the second sending module is suitable for initiating a stream state callback request carrying the first sequence number and life cycle information of the live stream to a central server, so that the central server updates life cycle records of the live stream under the condition of receiving a stream pushing callback request, wherein the life cycle records comprise the first sequence number and the life cycle information of the live stream; and under the condition of receiving a blackout callback request, inquiring the life cycle record of the live stream, and determining whether to refuse to respond to the blackout callback request according to a comparison result of a second sequence number and the first sequence number contained in the inquired life cycle record.
16. A computing device, comprising: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication through the communication bus;
the memory is used for storing at least one executable instruction, and the executable instruction causes the processor to execute the operation corresponding to the live stream life cycle information processing method as defined in any one of claims 1 to 5, and/or execute the operation corresponding to the live stream life cycle information processing method as defined in any one of claims 6 to 10, and/or execute the operation corresponding to the live stream life cycle information processing method as defined in claim 11 or 12.
17. A computer storage medium having stored therein at least one executable instruction for causing a processor to perform an operation corresponding to the live stream lifecycle information processing method as defined in any one of claims 1 to 5, and/or to perform an operation corresponding to the live stream lifecycle information processing method as defined in any one of claims 6 to 10, and/or to perform an operation corresponding to the live stream lifecycle information processing method as defined in claim 11 or 12.
CN202210689075.XA 2022-06-17 2022-06-17 Live stream life cycle information processing method and device and computing equipment Active CN115134618B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210689075.XA CN115134618B (en) 2022-06-17 2022-06-17 Live stream life cycle information processing method and device and computing equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210689075.XA CN115134618B (en) 2022-06-17 2022-06-17 Live stream life cycle information processing method and device and computing equipment

Publications (2)

Publication Number Publication Date
CN115134618A true CN115134618A (en) 2022-09-30
CN115134618B CN115134618B (en) 2024-03-12

Family

ID=83378909

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210689075.XA Active CN115134618B (en) 2022-06-17 2022-06-17 Live stream life cycle information processing method and device and computing equipment

Country Status (1)

Country Link
CN (1) CN115134618B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080270629A1 (en) * 2007-04-27 2008-10-30 Yahoo! Inc. Data snychronization and device handling using sequence numbers
CN105847854A (en) * 2016-04-12 2016-08-10 乐视控股(北京)有限公司 Webcasting method and system
CN110351569A (en) * 2019-06-25 2019-10-18 腾讯科技(深圳)有限公司 A kind of live content processing method, device, equipment and medium
CN111263171A (en) * 2020-02-25 2020-06-09 北京达佳互联信息技术有限公司 Live streaming media data acquisition method and edge node area networking system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080270629A1 (en) * 2007-04-27 2008-10-30 Yahoo! Inc. Data snychronization and device handling using sequence numbers
CN105847854A (en) * 2016-04-12 2016-08-10 乐视控股(北京)有限公司 Webcasting method and system
CN110351569A (en) * 2019-06-25 2019-10-18 腾讯科技(深圳)有限公司 A kind of live content processing method, device, equipment and medium
CN111263171A (en) * 2020-02-25 2020-06-09 北京达佳互联信息技术有限公司 Live streaming media data acquisition method and edge node area networking system

Also Published As

Publication number Publication date
CN115134618B (en) 2024-03-12

Similar Documents

Publication Publication Date Title
US10275578B2 (en) Continuous content identification of broadcast content
US11350139B2 (en) Video live broadcast method and apparatus
CN110830564B (en) CDN scheduling method, device, system and computer readable storage medium
CN109842781B (en) Monitoring video playing method, device, system, media server and storage medium
US20150237113A1 (en) Method and system for file transmission
CN111355971B (en) Live streaming transmission method and device, CDN server and computer readable medium
US20110113124A1 (en) Method and device for downloading multimedia contents at high speed in the internet
WO2014166265A1 (en) Method, terminal, cache server and system for updating webpage data
CN104301741A (en) Data live broadcast system and method
CN103312593B (en) A kind of message distributing system and method
WO2023061060A1 (en) Audio and video code stream scheduling method, system, medium and electronic apparatus
CN112218175B (en) Processing method and device for live broadcast room state and computing equipment
CN109995824B (en) Task scheduling method and device in peer-to-peer network
CN112532714A (en) Data processing method, processing device, server and storage medium
CN110602515B (en) Data processing method based on block chain, server and storage medium
CN108366097A (en) Resource access control method and system
CN112130931A (en) Application deployment method, node, system and storage medium
CN101958934B (en) Electronic program guide incremental content synchronization method, device and system
CN115134618B (en) Live stream life cycle information processing method and device and computing equipment
CN110582090A (en) CDN scheduling method, scheduling system and MEC network element
CN113207007A (en) Live broadcast recording method based on HLS protocol
CN109962948B (en) P2P task processing method and device
CN112702610B (en) Video-on-demand method, device, server and medium of cross-level camera
CN113438313B (en) Video continuous playing processing method, related device and readable storage medium
CN117793002A (en) Path acquisition method, content distribution network system, computing device, and storage medium

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