Efficient live broadcast stream distribution method for continuously increasing video file

By introducing functions such as verification, marking, monitoring and waiting, data reading, configuration, queueing and data sending in the live stream distribution system, the traditional system has solved the problems of slow processing speed and high resource occupation when facing the continuous growth of video files. It realizes efficient and real-time live stream distribution, improving the scalability and stability of the system.

CN119484880AActive Publication Date: 2025-02-18HANGZHOU ARCVIDEO TECHNOLOGY CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411371717.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-29
Publication Date
2025-02-18
Estimated Expiration
2044-09-29

AI Technical Summary

Technical Problem

When traditional live stream distribution systems face the continuous growth of large-scale concurrent requests and video files, they have problems such as slow processing speed, long response time, and high resource utilization, which affects the smoothness and real-timeness of live streaming and increases operating costs.

Method used

By introducing functions such as verification, marking, monitoring and waiting, data reading, configuration, queueing and data sending, efficient and real-time distribution of continuously growing video files is achieved. The specific steps include setting up configuration modules, marking modules, data reading modules and data sending modules to ensure the rapid processing and real-time distribution of video files.

Benefits of technology

It improves processing speed and responsiveness, reduces resource usage, enhances the scalability and stability of the system, and reduces user waiting time and operation costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119484880A_ABST
    Figure CN119484880A_ABST
Patent Text Reader

Abstract

The invention discloses an efficient live broadcast stream distribution method for continuously increasing video files. The method comprises the following steps: setting a configuration module to carry out parameter configuration; setting a marking module for variable declaration; setting a live broadcast stream request client to perform a live broadcast stream request; setting a verification module to verify the validity and legality of the live broadcast stream identifier; the setting marking module creates a data reading thread corresponding to the live broadcast stream identifier; setting a monitoring waiting module to create monitoring to maintain client connection, and circularly waiting by taking whether the client is reading as a monitoring interruption condition; setting a data reading module to create an independent first-in first-out queue corresponding to the live stream identifier in a queue module, and acquiring configuration information from a configuration module by the data reading module; setting a data reading module to create a data sending thread corresponding to the live stream identifier; the data reading module is used for executing a circular waiting process; the data sending module performs loop execution; and sending the data packet based on the client connection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of streaming media, and in particular relates to an efficient live streaming distribution method for continuously growing video files. Background Art

[0002] With the rapid development of network technology and the widespread adoption of high-definition video content, live streaming services have become an indispensable part of people's daily lives. However, the continuous growth of video files in live streaming services poses a significant challenge to live streaming distribution systems. Traditional live streaming distribution systems often suffer from slow processing speeds, long response times, and high resource usage when faced with large-scale concurrent requests and the continuous growth of video files. These issues not only affect the smoothness and real-time performance of live streaming, but also increase operating costs and hinder the development of live streaming services.

[0003] While various live streaming distribution solutions exist, most fail to effectively address the ever-increasing volume of video files. Some systems employ simple polling or push mechanisms, failing to dynamically adjust to the actual volume of video files and network conditions, resulting in inefficient distribution. Other systems are overly complex, requiring expensive hardware investments and complex configuration management, making them challenging to deploy and maintain at scale. Summary of the Invention

[0004] In view of the above problems, the present invention provides an efficient live streaming distribution method for continuously growing video files. By introducing functions such as verification, marking, listening and waiting, data reading, configuration, queuing and data sending, efficient and real-time distribution of continuously growing video files is achieved.

[0005] In order to solve the above technical problems, the present invention adopts the following technical solutions:

[0006] An efficient live streaming distribution method for continuously growing video files is applied to a live streaming distribution system including a live streaming request client and a live streaming server. The live streaming server further includes a verification module, a marking module, a listening and waiting module, a data reading module, a configuration module, a video file, a queue module, and a data sending module. The video file continuously grows and the file name is named with a live streaming identifier. The method includes the following steps:

[0007] Set the configuration module to configure parameters;

[0008] Setting a marking module to declare variables, wherein the variables include a data reading thread set, an identification bit indicating whether a live stream identifier is being read, and a requesting client set of the live stream identifier;

[0009] Set up the live stream request client to make live stream requests;

[0010] Set up a verification module to verify the validity and legality of the live stream identifier;

[0011] Setting a marking module to create a data reading thread corresponding to the live stream identifier, the marking module stores the created data reading thread information, marks the reading of the live stream identifier as being read, and stores the client information of the live stream identifier currently requested;

[0012] Set the monitoring waiting module to create a monitor to maintain the client connection, and use whether it is reading as the monitoring interrupt condition, and wait in a loop;

[0013] Set the data reading module to create an independent first-in-first-out queue corresponding to the live stream identifier in the queue module, and the data reading module obtains configuration information from the configuration module;

[0014] Set the data reading module to create a data sending thread corresponding to the live stream identifier; the data reading module uses the "whether the live stream is being read" in the marking module as the interrupt condition and the "read video file frequency" in the configuration module as the time interval to enter the loop waiting state and execute the loop waiting process;

[0015] After the loop is finished, the thread information corresponding to the live stream identifier is removed from the marking module;

[0016] The data sending module uses "whether the live stream is being read" as the interrupt condition and uses the "frequency of sending data" in the configuration module as the time interval to enter the loop and perform loop execution;

[0017] Send packets based on client connections.

[0018] In a possible implementation, the parameters for parameter configuration include a frequency of reading video files, a size of the video files read each time, a timeout period for no change in the video files, a maximum queue value, and a frequency of sending data.

[0019] In a possible implementation, the configuration information obtained by the data reading module from the configuration module includes: a frequency of reading video files, a size of the video files read each time, a timeout period for unchanged video files, and a maximum queue value.

[0020] In a possible implementation, the cyclic waiting process includes the following steps:

[0021] Get the latest data packet information: including index position and data packet reading time. If this loop step is executed for the first time, the index position starts with the current file size minus the configured "data packet size", and the data packet reading time is the current system time.

[0022] Based on the time difference between the current system time and the latest data packet, determine whether the configured "video file unchanged timeout" has been exceeded. If it has timed out: call the marking module to set the current live stream to unread, ending the relevant loop;

[0023] If there is no timeout, read the content of the video file according to the index position and data packet size; obtain the current queue size in the queue module, and use the current queue size plus the content read this time as a basis to determine whether it exceeds the configured "queue maximum value". If it exceeds: clear the current queue; update the latest data packet information, including the index position and the time of reading the data packet. The index position is the previous index position plus the current file size read, and the data packet time is the current system time.

[0024] In a possible implementation, the loop execution includes the following steps:

[0025] Get the first data packet in the queue module;

[0026] Get the created client connection information in the marking module;

[0027] Determine the number of clients. If it is empty, call the marking module to set the current live stream to unread, which ends the relevant loop.

[0028] If it is not empty, the obtained data packets are reused to send data to each client that requests the corresponding live stream, that is, respond to the live stream request client. If a client fails to send, the marking module is called to remove the corresponding client.

[0029] The present invention has the following beneficial effects:

[0030] (1) Improve processing speed and responsiveness: By multiplexing data packets, rapid processing and real-time distribution of continuously growing video files can be achieved, reducing user waiting time and improving user experience.

[0031] (2) Reduce resource usage: Through intelligent resource scheduling and management mechanisms, only one thread is used to read the video file for a single live stream, which rationally allocates system resources, reduces hardware investment and energy consumption, and reduces operating costs.

[0032] (3) Enhanced scalability and stability: Modular design and flexible configuration strategies can easily cope with business growth and changes while ensuring system stability and reliability. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 This is a flowchart of a method for efficiently distributing live streams of continuously growing video files according to an embodiment of the present invention;

[0034] Figure 2 This is a principle block diagram of a live streaming distribution system applied in an efficient live streaming distribution method for continuously growing video files according to an embodiment of the present invention. DETAILED DESCRIPTION

[0035] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.

[0036] See also Figure 1 , which is a flowchart of a method for efficiently distributing live streams of continuously growing video files according to an embodiment of the present invention, is applied to Figure 2 The live stream distribution system shown includes a live stream request client and a live stream server, wherein the live stream server further includes a verification module, a marking module, a listening and waiting module, a data reading module, a configuration module, a video file, a queue module, and a data sending module. The video file continues to grow and is named with a live stream identifier. The video file can be generated by an encoder or a third party, including the following steps:

[0037] S101, set the configuration module to configure parameters, where the parameters include the frequency of reading video files, the size of each video file read, the timeout period for no change in the video file, the maximum value of the queue and the frequency of sending data; wherein by adjusting the frequency of reading video files, the update frequency of video files in different environments can be coped with, which can effectively improve processing performance. By setting the size of each video file read, the value can be adjusted according to the network environment to achieve the minimum packet loss rate and improve fluency. The timeout period for no change in the video file can be adjusted according to the client timeout period required by the business. The maximum value of the queue can be adjusted in combination with the actual server memory resources to improve the stability of the data packet. The frequency of sending data can be adjusted according to the actual server bandwidth to improve the stability of client playback.

[0038] S102, setting a marking module to declare variables, wherein the variables include a data reading thread set, an identification bit indicating whether a live stream identifier is being read, and a requesting client set of the live stream identifier;

[0039] S103, setting a live stream request client to make a live stream request;

[0040] S104, setting a verification module to verify the validity and legality of the live stream identifier; for example, directly rejecting a live stream that is not maintained in the system or has ended; for example, restricting requests from clients that are not in the whitelist;

[0041] S105, setting a marking module to create a data reading thread corresponding to the live stream identifier, the marking module stores the created data reading thread information, marks the live stream identifier as being read, and stores the client information of the live stream identifier currently requested;

[0042] S106, setting the monitoring waiting module to establish a monitoring to maintain the client connection, and using whether the reading is in progress as the monitoring interrupt condition, and cyclically waiting;

[0043] S107: Setting the data reading module to create an independent first-in-first-out queue corresponding to the live stream identifier in the queue module, and the data reading module to obtain configuration information from the configuration module. The obtained configuration information includes the frequency of reading video files, the size of each video file read, the timeout period for unchanged video files, and the maximum queue value;

[0044] S108, setting the data reading module to create a data sending thread corresponding to the live stream identifier; the data reading module uses "whether the live stream is being read" in the marking module as an interrupt condition and "the frequency of reading video files" in the configuration module as a time interval to enter a loop waiting state and perform a loop waiting process;

[0045] S109, after the loop is finished, the thread information corresponding to the live stream identifier is removed from the marking module;

[0046] S110, the data sending module uses "whether the live stream is being read" as the interrupt condition and uses the "frequency of sending data" in the configuration module as the time interval to enter a loop and perform loop execution;

[0047] S111, sending a data packet based on the client connection.

[0048] In another embodiment of the present invention, in an efficient live streaming distribution method for continuously growing video files, the loop waiting process in S108 includes the following steps:

[0049] Get the latest data packet information: including the index position (the location of the data packet in the video file) and the time the data packet was read. If this is the first time this loop is executed, the index position starts at the current file size minus the configured "data packet size," and the data packet read time is the current system time. Data packets are separated by a certain size within the video file. For example, if the size of each data packet is defined as 2KB for a 1MB video file, the video file will contain 512 data packets.

[0050] The time difference between the current system time and the latest data packet is used as a basis to determine whether the configured "video file no change timeout" has exceeded. If the timeout has exceeded, the marking module is called to mark the current live stream as unread, ending the relevant loop. No change in the video file means that no new data packets have been generated.

[0051] If there is no timeout, read the content of the video file according to the index position and data packet size; obtain the current queue size in the queue module, and use the current queue size plus the content read this time as a basis to determine whether it exceeds the configured "queue maximum value". If it exceeds: clear the current queue; update the latest data packet information, including the index position and the time of reading the data packet. The index position is the previous index position plus the current file size read, and the data packet time is the current system time.

[0052] In another embodiment of the present invention, in an efficient live streaming distribution method for continuously growing video files, the loop execution in S110 includes the following steps:

[0053] Get the first data packet in the queue module;

[0054] Get the created client connection information in the marking module, which can be the client IP;

[0055] Determine the number of clients. If it is empty, call the marking module to set the current live stream to unread, which ends the relevant loop.

[0056] If it is not empty, the obtained data packets are reused to send data to each client that requests the corresponding live stream, that is, respond to the live stream request client. If a client fails to send, the marking module is called to remove the corresponding client.

[0057] The above-described efficient live streaming distribution method for continuously growing video files implements functions such as verification, marking, listening, data reading, configuration, queuing, and data sending, achieving efficient, real-time distribution of continuously growing video files. This method not only improves the fluency and stability of live streaming services, but also reduces resource usage and operating costs, promising broad application prospects and market demand.

[0058] It should be understood that the exemplary embodiments described herein are illustrative and not restrictive. Although one or more embodiments of the present invention have been described in conjunction with the accompanying drawings, it should be understood by those skilled in the art that various changes in form and details may be made without departing from the spirit and scope of the present invention as defined by the appended claims.

Claims

1. An efficient live streaming distribution method for continuously growing video files, characterized in that: The live streaming distribution system is applied to a live streaming request client and a live streaming server, wherein the live streaming server further comprises a verification module, a marking module, a listening and waiting module, a data reading module, a configuration module, a video file, a queue module and a data sending module, wherein the video file continuously grows and the file name is named after the live streaming identifier, and comprises the following steps: Set the configuration module to configure parameters; Setting a marking module to declare variables, wherein the variables include a data reading thread set, an identification bit indicating whether a live stream identifier is being read, and a requesting client set of the live stream identifier; Set the live stream request client to make live stream request; Set up a verification module to verify the validity and legality of the live stream identifier; A marking module is set to create a data reading thread corresponding to the live stream identifier, the marking module stores the created data reading thread information, marks the reading of the live stream identifier as being read, and stores the client information of the live stream identifier currently requested; Set the monitoring waiting module to create a monitor to maintain the client connection, and use whether it is reading as the monitoring interrupt condition, and wait in a loop; Set the data reading module to create an independent first-in-first-out queue corresponding to the live stream identifier in the queue module, and the data reading module obtains configuration information from the configuration module; Set the data reading module to create a data sending thread corresponding to the live stream identifier; the data reading module uses "whether the live stream is being read" in the marking module as the interrupt condition and "the frequency of reading video files" in the configuration module as the time interval to enter the loop waiting state and execute the loop waiting process; After the loop is finished, the thread information corresponding to the live stream identifier is removed from the marking module; The data sending module uses "whether the live stream is being read" as the interrupt condition and uses the "frequency of sending data" in the configuration module as the time interval to enter the loop and perform loop execution; Send packets based on client connections.

2. The efficient live streaming distribution method for continuously growing video files according to claim 1, characterized in that: The parameters for parameter configuration include the frequency of reading video files, the size of the video files read each time, the timeout period for no change in the video files, the maximum value of the queue and the frequency of sending data.

3. The efficient live streaming distribution method for continuously growing video files as claimed in claim 2, characterized in that: The configuration information obtained by the data reading module from the configuration module includes: the frequency of reading the video file, the size of the video file read each time, the timeout time when the video file is unchanged, and the maximum value of the queue.

4. The efficient live streaming distribution method for continuously growing video files as claimed in claim 2, characterized in that: The cycle waiting process comprises the following steps: Get the latest data packet information: including the index position (the position of the data packet in the video file) and the time to read the data packet. If this loop step is executed for the first time, the index position starts with the current file size minus the configured "data packet size", and the time to read the data packet is the current system time. The time difference between the current system time and the latest data packet is used as a basis to determine whether it exceeds the configured "video file unchanged timeout". If it times out: call the mark module to set the current live stream as unread and end the relevant loop; If there is no timeout, read the content of the video file according to the index position and data packet size; Get the current queue size in the queue module, and use the current queue size plus the content read this time as a basis to determine whether it exceeds the configured "queue maximum value". If it exceeds: clear the current queue; Update the latest data packet information, including the index position and the time when the data packet was read. The index position is the previous index position plus the current file size read, and the data packet time is the current system time.

5. The efficient live streaming distribution method for continuously growing video files as claimed in claim 2, characterized in that: The loop execution includes the following steps: Get the first data packet in the queue module; Get the created client connection information in the marking module; Determine the number of clients. If it is empty, call the marking module to set the current live stream as unread to end the relevant loop; If it is not empty, the obtained data packets are reused to send data to each client that requests the corresponding live stream, that is, respond to the live stream request client. If a client fails to send, the marking module is called to remove the corresponding client.

Citation Information

Patent Citations

  • Video streaming data distribution method and device for monitoring device

    CN103731641A

  • Video stream distributing method

    CN106681832A

  • File system

    CN1156862A

  • Multicast distribution system, multicast distributing method and multicast distributing program

    JP2004120137A

  • Video data processing apparatus

    US20160286254A1