CN113852642B - DVB standard-based TS (transport stream) stream fragment uploading method and device - Google Patents

DVB standard-based TS (transport stream) stream fragment uploading method and device Download PDF

Info

Publication number
CN113852642B
CN113852642B CN202111175671.8A CN202111175671A CN113852642B CN 113852642 B CN113852642 B CN 113852642B CN 202111175671 A CN202111175671 A CN 202111175671A CN 113852642 B CN113852642 B CN 113852642B
Authority
CN
China
Prior art keywords
pcr
splicing
server
stb
program
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111175671.8A
Other languages
Chinese (zh)
Other versions
CN113852642A (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.)
Zhuhai Gotech Intelligent Technology Co Ltd
Original Assignee
Zhuhai Gotech Intelligent 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 Zhuhai Gotech Intelligent Technology Co Ltd filed Critical Zhuhai Gotech Intelligent Technology Co Ltd
Priority to CN202111175671.8A priority Critical patent/CN113852642B/en
Publication of CN113852642A publication Critical patent/CN113852642A/en
Application granted granted Critical
Publication of CN113852642B publication Critical patent/CN113852642B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/60Network streaming of media packets
    • H04L65/75Media network packet handling
    • H04L65/765Media network packet handling intermediate
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0805Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
    • H04L43/0811Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking connectivity
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/10Active monitoring, e.g. heartbeat, ping or trace-route
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • H04L45/745Address table lookup; Address filtering
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers
    • 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/231Content storage operation, e.g. caching movies for short term storage, replicating data over plural servers, prioritizing data for deletion
    • H04N21/23103Content storage operation, e.g. caching movies for short term storage, replicating data over plural servers, prioritizing data for deletion using load balancing strategies, e.g. by placing or distributing content on different disks, different memories or different servers
    • 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/231Content storage operation, e.g. caching movies for short term storage, replicating data over plural servers, prioritizing data for deletion
    • H04N21/23106Content storage operation, e.g. caching movies for short term storage, replicating data over plural servers, prioritizing data for deletion involving caching operations
    • 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/234Processing of video elementary streams, e.g. splicing of video streams, manipulating MPEG-4 scene graphs
    • H04N21/2343Processing of video elementary streams, e.g. splicing of video streams, manipulating MPEG-4 scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements
    • 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/236Assembling of a multiplex stream, e.g. transport stream, by combining a video stream with other content or additional data, e.g. inserting a URL [Uniform Resource Locator] into a video stream, multiplexing software data into a video stream; Remultiplexing of multiplex streams; Insertion of stuffing bits into the multiplex stream, e.g. to obtain a constant bit-rate; Assembling of a packetised elementary stream
    • H04N21/23605Creation or processing of packetized elementary streams [PES]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/25Management operations performed by the server for facilitating the content distribution or administrating data related to end-users or client devices, e.g. end-user or client device authentication, learning user preferences for recommending movies
    • H04N21/262Content or additional data distribution scheduling, e.g. sending additional data at off-peak times, updating software modules, calculating the carousel transmission frequency, delaying a video stream transmission, generating play-lists
    • H04N21/2625Content or additional data distribution scheduling, e.g. sending additional data at off-peak times, updating software modules, calculating the carousel transmission frequency, delaying a video stream transmission, generating play-lists for delaying content or additional data distribution, e.g. because of an extended sport event
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/25Management operations performed by the server for facilitating the content distribution or administrating data related to end-users or client devices, e.g. end-user or client device authentication, learning user preferences for recommending movies
    • H04N21/262Content or additional data distribution scheduling, e.g. sending additional data at off-peak times, updating software modules, calculating the carousel transmission frequency, delaying a video stream transmission, generating play-lists
    • H04N21/26258Content or additional data distribution scheduling, e.g. sending additional data at off-peak times, updating software modules, calculating the carousel transmission frequency, delaying a video stream transmission, generating play-lists for generating a list of items to be played back in a given order, e.g. playlist, or scheduling item distribution according to such list

Abstract

The invention provides a TS stream slice uploading method and a device based on DVB standard, which comprises the steps of obtaining TS stream data of a current program; requesting to connect the load balancing server, and acquiring the address of the splicing server after successful connection; requesting to connect a splicing server, judging whether the splicing server enters a waiting state after successful connection, if not, acquiring a pcr fragment range sent by the splicing server and an index function uploaded by a current STB (set top box), filtering pcr fragments according to the pcr fragment range and the index function, and judging whether the filtered pcr fragments meet uploading requirements; if the result is yes, adding a pcr fragment head to each pcr fragment meeting the uploading requirement, judging the current signal condition and the network condition of the STB, if the signal and the network condition are good, delaying the pcr fragments in the cache and then sending the delayed pcr fragments to a splicing server for splicing and outputting. The device is used for realizing the method. The invention can improve the stability of IPTV program sources.

Description

DVB standard-based TS (transport stream) stream fragment uploading method and device
Technical Field
The invention relates to the technical field of set top boxes, in particular to a TS (transport stream) fragment uploading method based on DVB (digital video broadcasting) standard and a device for realizing the method.
Background
At present, a large number of files are uploaded and downloaded by using a fragmented uploading technology, namely, the files to be uploaded are divided into a plurality of data blocks (called parts) according to a certain size to be respectively uploaded, and after the uploading is finished, all the uploaded files are summarized and integrated into an original file by a server. The problem that the file is always required to be uploaded from the starting position or the uploading position due to poor network environment can be avoided, different partitioned data can be transmitted in parallel by using multithreading, the transmission efficiency is improved, and the transmission time is reduced.
The slice uploading is mainly applicable to the following scenes:
1. the network environment is not good: when the uploading fails, the failed Part can be independently retried without re-uploading other parts.
2. Breakpoint continuous transmission: after a mid-pause, the upload may continue from the location of the Part where the last upload was completed.
3. Acceleration of uploading: when the local file to be uploaded to the OSS is large, multiple parts may be uploaded in parallel to speed up the upload.
4. And (3) stream uploading: the upload may be initiated in case the file size to be uploaded is not yet determined. Such a scenario is common in video surveillance and other industrial applications.
5. The file is larger: when the general file is relatively large, slice uploading is generally adopted under the default condition.
At present, a large number of DVB program sources of an IPTV system are mostly acquired by adopting a Sat2ip mode and then transcoded. However, the collection end is generally fixed in a machine room or an area, and once the collection end is abnormal, the whole IPTV program system will have problems. In addition, the TS stream of DVB standard has no scheme at present, and a large number of clients upload to a server in real time in a slicing way and splice the TS stream for the iptv.
The prior art has the defects that: the current fragment uploading technology or scheme is a one-to-one mode of the server and the client, which is not suitable in some cases, for example, a plurality of clients simultaneously upload a file, the network conditions of each client are different, the uploading is a real-time stream file, and the stream file after the uploading is finally required to be played in real time.
Disclosure of Invention
The main purpose of the invention is to provide a TS stream fragment uploading method based on DVB standard, which can improve the stability of IPTV program source.
Another object of the present invention is to provide a TS stream slice uploading apparatus based on the DVB standard, which can improve the stability of an IPTV program source.
In order to achieve the main purpose, the invention provides a TS stream fragment uploading method based on DVB standard, which comprises the steps of obtaining TS stream data of a current program after a STB starts up; requesting to connect a load balancing server, sending current program information, network state information and signal state information, and acquiring a splicing server address after successful connection; requesting to connect with a splicing server, and sending current program information, network state information and signal state information; after the connection is successful, judging whether the waiting state is entered, if not, acquiring a pcr fragment range sent by a splicing server and an index function uploaded by a current STB (set top box), filtering pcr fragments according to the pcr fragment range and the index function, and judging whether the filtered pcr fragments meet uploading requirements; if the result is yes, adding a pcr fragment head to each pcr fragment meeting the uploading requirement, judging the current signal condition and the network condition of the STB, if the signal and the network condition are good, delaying the pcr fragments in the cache and then sending the delayed pcr fragments to a splicing server for splicing and outputting.
In a further scheme, after the STB starts a machine, a program for uploading a slice is executed in the background, a program buffer queue is opened up, TS stream data of a current program is obtained from a recording channel, and after a period of time for playing the program is started, a connection to a load balancing server is requested.
In a further aspect, the pcr chip header includes: CRC32: checking whether the whole pcr fragment is interfered in the transmission process; for redundancy matching when splicing; pre_pcr+cur_pcr: marking the relative positions of pcr fragments, wherein each pcr fragment corresponds to a unique mark; when the pcr fragment is the first slice, the pre_pcr value is 0; ts_data: ts stream cut pcr fragment data.
In a further scheme, the acquiring the address of the splicing server includes sending a heartbeat registration service to a load balancing server after the splicing server is started, and the load balancing server obtains the address and the state information of the splicing server; program lists are configured for different splicing servers on the load balancing server and are sent to the splicing servers, and the splicing servers start pcr splicing threads of corresponding programs to wait for STB connection; after the load balancing server receives the connection request of the STB, judging the program information of the STB, and returning the address of the corresponding splicing server to the STB.
In a further aspect, after requesting to connect to the splice server, the splice server further performs: the splicing server creates a pcr splicing thread for each program, and each program comprises a pcr fragmentation memory pool and a pcr fragmentation pointer queue; and taking data from the pcr slice pointer queue, analyzing to obtain a cur_pcr value, comparing the sizes of cur_pcr and p_get_pcr, releasing the pointer if cur_pcr is smaller than p_get_pcr, and searching the bptree through cur_pcr if cur_pcr is larger than p_get_pcr.
In a further scheme, if the bptree is traversed to obtain the same pcr value, pointers of corresponding structures are obtained through vlaues of the bptree, and whether CRC32 values of p_pcr1,2 and 3 are equal is sequentially compared; if the CRC32 values of the p_pcr1,2 and 3 are equal, adding one to the corresponding p_pcr_num count until one p_pcr_num is greater than 3, assigning the corresponding pointer to the p_pcr, and releasing the p_pcr1,2 and 3; if the CRC32 values of the p_pcr1,2 and 3 are not equal, judging whether the p_pcr1,2 and 3 are null values, if so, releasing the pointer, and if not, assigning the pointer value to the corresponding p_pcr_num count in the corresponding p_pcr by one; if the traversal bptree does not obtain the same pcr value, applying for a pcr value in the structure array, assigning a pointer to p_pcr1, adding a cur_pcr value to the bptree, and assigning the pointer to value.
In a further scheme, a program connection management thread, a program connection pool, a pcr ready queue and a pcr fragment splicing queue are created in each program by the splicing server; after all STBs are connected to the splice server, a ready queue is first entered, and a message for entering the ready queue is sent to each STB to enter a waiting state.
In a further aspect, after the STB enters the waiting state, the splice server further performs: judging whether the pcr fragment splicing queue is smaller than 100 or the weight is lower than 60, if yes, taking the STB with the largest weight from the pcr ready queue to enter the pcr fragment splicing queue, sending a message entering the pcr fragment splicing queue to the STB, and starting uploading pcr fragments by the STB; judging whether the pcr ready queue weight is less than 0, if so, adding a blacklist to the STB, and disconnecting the long connection with the STB; judging the heartbeat time interval of each STB connection, accumulating the heartbeat timeout times, if the timeout times are more than 3, subtracting 1 from the weight of the STB, and if the timeout times are less than 1, adding 1 to the weight of the STB.
In a further scheme, an output thread is created in each program, the output thread takes p_tree_head in the bptree, and whether a structural body write_flag corresponding to the current bptree is true or not is judged; if not, acquiring the total number of the use in the structure body array, and if the total number of the use in the structure body array is greater than 50%, sequentially taking down the next node until the corresponding structure body write_flag is true or the total number of the use in the structure body array is less than 50%; if yes, acquiring a corresponding structure body array pointer, taking out data, releasing nodes corresponding to the structure body, constructing an http service for the obtained data, and outputting the http service in sequence.
In order to achieve the above another object, the present invention provides a device for uploading a TS stream slice based on the DVB standard, including: the data acquisition unit is used for acquiring TS stream data of the current program after the STB is started; the first connection unit is used for requesting to connect with the load balancing server, sending current program information, network state information and signal state information, and acquiring a splicing server address after successful connection; the second connection unit is used for requesting to connect the splicing server and sending current program information, network state information and signal state information; the judging unit is used for judging whether the waiting state is entered after the connection is successful, if not, acquiring a pcr fragment range sent by the splicing server and an index function uploaded by the current STB, filtering pcr fragments according to the pcr fragment range and the index function, and judging whether the filtered pcr fragments meet uploading requirements; and the uploading unit is used for adding a pcr fragment head to each pcr fragment meeting the uploading requirement if the judging result is yes, judging the current signal condition and the network condition of the STB, and if the signal and the network condition are good, delaying the pcr fragment in the cache and then sending the delayed pcr fragment to the splicing server.
Therefore, the invention can realize real-time slicing uploading to the server through a large number of clients, and can be used for IPTV after splicing, and under the condition that the network conditions of each client are different, the invention can meet the requirement that a plurality of clients upload one TS stream file at the same time, and can meet the requirement of uploading the TS stream file in real time, and can play the uploaded TS stream in real time, thereby improving the stability of IPTV program sources and improving the user experience.
Drawings
Fig. 1 is a flowchart of an embodiment of a method for uploading a TS stream slice based on the DVB standard.
Fig. 2 is a schematic diagram of a frame of an STB in an embodiment of a method for uploading a TS stream slice based on the DVB standard.
Fig. 3 is a schematic topology diagram of a splicing server in an embodiment of a method for uploading a TS stream slice based on the DVB standard.
Fig. 4 is a flowchart of a STB using pcr for slicing in an embodiment of a method for uploading a TS stream slice based on the DVB standard.
Fig. 5 is a schematic diagram of the design of the pcr chip header in an embodiment of the method for uploading a TS stream chip based on the DVB standard.
Fig. 6 is a schematic diagram of a first frame at a splicing server in an embodiment of a method for uploading a TS stream slice based on the DVB standard.
Fig. 7 is a schematic diagram of a second frame of a splicing server in an embodiment of a method for uploading a TS stream slice based on the DVB standard.
Fig. 8 is a flowchart of a splicing strategy at a splicing server in an embodiment of a method for uploading a TS stream slice based on the DVB standard.
Fig. 9 is a schematic diagram of a frame of a splicing system in an embodiment of a method for uploading a TS stream slice based on the DVB standard.
Fig. 10 is a schematic diagram of an embodiment of a TS stream slice uploading apparatus based on the DVB standard according to the present invention.
The invention is further described below with reference to the drawings and examples.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more clear, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. It will be apparent that the described embodiments are some, but not all, embodiments of the invention. All other embodiments, which can be made by a person skilled in the art without creative efforts, based on the described embodiments of the present invention fall within the protection scope of the present invention.
An embodiment of a TS stream fragment uploading method based on DVB standard:
Referring to fig. 1 to 3, the method for uploading the TS stream fragments based on the DVB standard comprises the following steps:
step S1, when the STB starts up, TS stream data of the current program is obtained.
And S2, requesting to connect the load balancing server, transmitting current program information, network state information and signal state information, and acquiring a splicing server address after successful connection.
And step S3, requesting to connect the splicing server, and sending current program information, network state information and signal state information.
And S4, judging whether the waiting state is entered after the connection is successful, if not, acquiring a pcr fragment range sent by the splicing server and an index function uploaded by the current STB, filtering pcr fragments according to the pcr fragment range and the index function, and judging whether the filtered pcr fragments meet uploading requirements.
And S5, if the judgment result is yes, adding a pcr fragment head to each pcr fragment meeting the uploading requirement, judging the current signal condition and the network condition of the STB, and if the signal and the network condition are good, delaying the pcr fragment in the buffer and then sending the delayed pcr fragment to a splicing server for splicing and outputting.
In the step S1, after the STB starts the machine, a program for uploading a slice is executed in the background, a program buffer queue is opened up, and the TS stream data of the current program is obtained from the recording channel, and when the program starts to be played for a period of time, the connection to the load balancing server is requested.
In the above step S4, the pcr chip header includes: CRC32: checking whether the whole pcr fragment is interfered in the transmission process; for redundancy matching when splicing; pre_pcr+cur_pcr: marking the relative positions of pcr fragments, wherein each pcr fragment corresponds to a unique mark; when the pcr fragment is the first slice, the pre_pcr value is 0; ts_data: ts stream cut pcr fragment data.
In the step S2, acquiring the splicing server address specifically includes: after the splicing server starts up, sending a heartbeat registration service to a load balancing server, and obtaining the address and state information of the splicing server by the load balancing server; program lists are configured for different splicing servers on the load balancing server and are sent to the splicing servers, and the splicing servers start pcr splicing threads of corresponding programs to wait for STB connection; after the load balancing server receives the connection request of the STB, judging the program information of the STB, and returning the address of the corresponding splicing server to the STB.
In the present embodiment, after requesting connection to the splice server, the splice server further performs: the splicing server creates a pcr splicing thread for each program, and each program comprises a pcr fragmentation memory pool and a pcr fragmentation pointer queue; and taking data from the pcr slice pointer queue, analyzing to obtain a cur_pcr value, comparing the sizes of cur_pcr and p_get_pcr, releasing the pointer if cur_pcr is smaller than p_get_pcr, and searching the bptree through cur_pcr if cur_pcr is larger than p_get_pcr.
If the bptree is traversed to obtain the same pcr value, the pointers of the corresponding structures are obtained through vlaue of the bptree, and whether the CRC32 values of p_pcr1,2 and 3 are equal is sequentially compared.
If the CRC32 values of p_pcr1,2,3 are equal, the corresponding p_pcr_num count is incremented by one until one p_pcr_num is greater than 3, the corresponding pointer is assigned to p_pcr, and p_pcr1,2,3 is released.
If the CRC32 values of the p_pcr1,2 and 3 are not equal, judging whether the p_pcr1,2 and 3 are null values, if so, releasing the pointer, and if not, assigning the pointer value to the corresponding p_pcr_num count in the corresponding p_pcr by one.
If the traversal bptree does not obtain the same pcr value, applying for a pcr value in the structure array, assigning a pointer to p_pcr1, adding a cur_pcr value to the bptree, and assigning the pointer to value.
In this embodiment, the splicing server creates a program connection management thread, a program connection pool, a pcr ready queue, and a pcr fragment splicing queue for each program; after all STBs are connected to the splice server, a ready queue is first entered, and a message for entering the ready queue is sent to each STB to enter a waiting state.
After the STB enters the wait state, the splice server also performs: judging whether the pcr fragment splicing queue is smaller than 100 or the weight is lower than 60, if yes, taking the STB with the largest weight from the pcr ready queue to enter the pcr fragment splicing queue, sending the message entering the pcr fragment splicing queue to the STB, and starting uploading the pcr fragment by the STB.
And judging whether the pcr ready queue weight is less than 0, if so, adding a blacklist to the STB, and disconnecting the long connection with the STB.
Judging the heartbeat time interval of each STB connection, accumulating the heartbeat timeout times, if the timeout times are more than 3, subtracting 1 from the weight of the STB, and if the timeout times are less than 1, adding 1 to the weight of the STB.
In this embodiment, an output thread is created in each program, and the output thread takes p_tree_head in the bptree, and determines whether the structure write_flag corresponding to the current bptree is true; if not, acquiring the total number of the use in the structure body array, and if the total number of the use in the structure body array is greater than 50%, sequentially taking down the next node until the corresponding structure body write_flag is true or the total number of the use in the structure body array is less than 50%; if yes, acquiring a corresponding structure body array pointer, taking out data, releasing nodes corresponding to the structure body, constructing an http service for the obtained data, and outputting the http service in sequence.
In this embodiment, the method for uploading the TS stream fragments based on the DVB standard includes a method for performing fragments by using pcr by using the STB and a splicing strategy of a splicing server.
In this embodiment, as shown in fig. 4, the STB uses pcr to perform slicing as follows:
After the STB starts, a program uploaded by fragments is started in the background, a program buffer queue is opened up, TS stream data of the current program is obtained from a recording channel, and the server is disconnected after the program is started to play for 10 seconds. Different programs may be spliced on different servers, so that each time the programs are switched, the servers are reconnected, and if the programs are frequently switched, great concurrency pressure is caused on the servers. In general, after a user frequently switches programs, the user views the programs for more than 10 seconds, so that the user can consider the programs to be watched by the user, and the user views the programs for a long time, and after 10 seconds, the user can effectively avoid unnecessary server stress by connecting the server.
The load balancing server is connected to transmit current program information (original_network_id, transport_stream_id, and video_id), network status information, and signal status information. If the server refuses, the connection is requested again after 100s, and the spliced server address is obtained after the connection is successful.
And connecting the splicing server, and transmitting the current program information, the network state information and the signal state information once every 5 s.
If the connection fails, the connection is performed again after 100s, and if the connection is successful, whether the connection enters a waiting state is judged according to the returned message.
If waiting is not needed, analyzing the pcr fragmentation range sent by the splicing server and the index uploaded by the current STB, for example, the fragmentation range: 20, index: and 5, taking out pcr, taking the remainder 20, and sending the remainder 5, wherein the remainder is not sent.
And filtering out pcr fragments meeting the requirements according to the pcr fragment range and index sent by the splicing server, and adding a fragment head to each pcr fragment.
As shown in fig. 5, the pcr chip header is designed as follows:
CRC32: checking whether the whole fragment is interfered in the transmission process; and the method is used for redundancy matching during splicing.
pre_pcr+cur_pcr: marking the relative positions of the segments, and uniquely marking one segment; (the pre_pcr value is 0 when the slice is the first slice).
ts_data: ts stream cut pcr fragment data.
And then judging the current signal condition according to the current signal perBer/postBer and the signal strength quality of the STB, if the signal is not good, clearing all pcr intervals, and disconnecting the connection with the server until the signal is good.
Judging the current network condition of the STB, if the network condition is good, delaying the pcr fragment in the cache for 1s and then sending. The pcr value sent by some STBs is sent to the server side by pcr fragments before being buffered for 1s, so that the server side can splice conveniently.
And repeating the operation of filtering the pcr fragments after the pcr fragments are successfully transmitted, namely continuously filtering pcr fragments meeting the requirements according to the pcr fragment range and index transmitted by the splicing server.
In this embodiment, as shown in fig. 8, the splicing policy of the splicing server is implemented as follows:
and the start-up of the splicing server sends heartbeat registration service to the load balancing server, and the load balancing server obtains the address and the state information of the splicing server.
Program lists are manually configured for different splicing servers on the load balancing server and are sent to the splicing servers, and the splicing servers start pcr splicing threads of corresponding programs and wait for STB connection.
After receiving the connection request of the STB, the load balancing server judges the program information of the STB and returns the address of the corresponding splicing server to the STB.
The splice server creates a pcr splice thread for each program and each program includes a pcr fragmentation memory pool and pcr fragmentation pointer queue that is 5 times the current program code rate, as shown in fig. 6. The pcr splicing thread is characterized in that data in a pcr slicing pointer queue is taken out and put into a B+ tree, and the pcr slicing memory pool and the pcr slicing pointer queue can reduce the coupling between a front stb connection receiving thread and a rear pcr splicing thread; meanwhile, because the splicing edge is time-consuming, the operations of inquiring, inserting and deleting the team B+Tree and the structure body array are involved. If the receiving terminal is directly placed at the stb, the direct processing is unreasonable; the memory pool can be determined by the program code rate and redundancy and the buffer time, and is applied for the beginning without dynamic application at each time later. The size of the fragments is determined by calculating the packet number +10 of pcr intervals of the program through stb filtering; the program code rate is counted up during 10s of playing with stb.
Then, data is obtained from the pcr slice pointer queue, a cur_pcr value is obtained through analysis, the sizes of cur_pcr and p_get_pcr are compared, if cur_pcr is smaller than p_get_pcr, the pointer is released, and if cur_pcr is larger than p_get_pcr, bptree is searched through cur_pcr.
If the bptree is traversed to obtain the same pcr value, the pointers of the corresponding structures are obtained through vlaues of the bptree, and whether the CRC32 values of p_pcr1,2 and 3 are equal is sequentially compared.
If equal, the corresponding p_pcr_num count is incremented by one until there is one p_pcr_num greater than 3, the corresponding pointer is assigned to p_pcr, and p_pcr1,2,3 is released.
If the p_pcr1,2 and 3 are not equal, judging whether the p_pcr1,2 and 3 are empty, releasing the pointer for the empty, and not assigning the pointer value to the corresponding p_pcr_num count in the corresponding p_pcr for the empty, and adding one.
If traversing does not obtain the same pcr value, applying for a pcr value in the structure array, assigning a pointer to p_pcr1, adding cur_pcr to bptree, and assigning the pointer to value.
Specifically, as shown in fig. 7, in this embodiment, the pcr pointer is used to obtain the cur_pcr of the pcr fragment to be matched, and the size of p_get_pcr is compared with that of the pcr fragment:
directly releasing the pointer if the pointer is smaller than the first set point; if greater than query B+ Tree; if less than and cur_pcr less than 1 minute, query b+ Tree.
B+ Tree is found, a structural body is obtained through p_struct or struct_index, and crc32 corresponding to p_pcr1,2 and 3 is compared in sequence:
if the coincidence count is increased by 1, releasing the pointer; if the values are inconsistent, and p_pcr1,2 and 3 are empty, namely assigning a value and counting and adding 1; if not, the pointer is released.
B+ Tree is not queried, the structure array is queried (quick query), an unused structure index or pointer is taken, and elements are inserted into the B+ Tree.
In this embodiment, each program creates a program connection management thread, and creates a program connection pool, ready queue 100, pcr fragment splice queue 100.
When all clients (STBs) connect to the splice server, they first enter a ready queue and send messages to the clients to enter the ready queue, please wait.
And judging whether the pcr fragmentation degree column is smaller than 100 or the weight is smaller than 60, if so, taking the client with the largest weight from the pcr ready queue to enter the pcr fragmentation queue, sending a message to the client to enter the pcr fragmentation queue, and starting uploading the pcr fragmentation.
And judging whether the pcr ready queue weight is less than 0, if so, entering a blacklist, and disconnecting the long connection with the client.
And judging the heartbeat time interval connected with each client, accumulating the heartbeat timeout times, and if the timeout times are more than 3, subtracting 1 from the weight, and adding 1 to the weight of less than 1 from the timeout.
And creating an output thread for each program, wherein the output thread takes p_tree_head in the bptree, and judging whether the structural body write_flag corresponding to the current bptree is true or not.
If not true, the total number of uses in the structure array is obtained, and if the total number of uses is greater than 50%, then sequentially taking down the nodes until the corresponding structure write_flag is true or the total number of uses in the structure array is less than 50%.
If true, the corresponding structure array pointer is obtained, the data is taken out, and the corresponding nodes of the structure are released. And constructing an http service for the obtained data and outputting the http service in sequence.
Specifically, the first node acquiring method in this embodiment is as follows: the number of arrays used is determined, if 50% of the total number is occupied, p_get_pcr starts traversing from p_tree_head until the first element with write_flag being true is fetched.
In this embodiment, if the next_pcr corresponding to p_get_pcr matches the cur_pcr corresponding to p_get_pcr- > next, the case that the pcr structure body write_flag is always a flag and the pcr value is correct is encountered in the traversal process:
the number of arrays used is determined, if the number is 80% of the total number, i.e. p_get_pcr starts traversing from p_tree_head until the first element with the write_flag being true is fetched.
In this embodiment, if the next_pcr corresponding to p_get_pcr does not match the cur_pcr corresponding to p_get_pcr- > next, there are two cases:
1. an erroneous pcr occurs just in the middle of the two correct values.
2. Two correct pcr are present, one pcr is missing in between, i.e. all uploaded pcr: none of the 12138 connections are uploaded.
The treatment method comprises the following steps: judging the cur_pcr difference value of the p_get_pcr and the cur_pcr difference value of the p_get_pcr- > next, if the p_get_pcr- > next is within 40ms, continuing to compare the p_get_pcr- > next, and if more than 80% of the arrays are used, taking the difference value to be greater than 40ms or the write_flag to be true.
In this embodiment, the pcr interval is generally not more than 40ms, and assuming that 10ms is one, 1s is 100, and if 10s is cached, 1000 pcr slices are needed, so the structure array size of 1000 is set in this embodiment.
In this embodiment, each time the structure is acquired and released, all pointers therein are released; once the pcr fabric is used use_flag to true, and the fabric array usage total is incremented by 1; after the p_pcr is successfully matched, the write_flag is true, writing with the count of p_pcr1,2 and 3 being more than or equal to 3 is performed, p_pcr1,2 and 3 are released, the count is less than 3, and the stb connection weight corresponding to the p_pcr is reduced by 1; p_pcr1,2,3 for saving, pcr_num is its count in case of pcr being identical but data error.
Specifically, the output thread of the embodiment is specifically implemented as follows:
p_get_pcr traverses from left to right, comparing the cur_pcr value of the structure corresponding to the current pcr with p_get_pcr- > next.
If the p_get_pcr- > next corresponding structure is not matched, deleting the element in the B+ Tree.
If so, judging the write_flag of the p_get_pcr- > next.
If the structure is wire, releasing the structure body corresponding to the p_get_pcr, wherein p_get_pcr=p_get_pcr- > next, and taking the data output of p_pcr in the p_get_pcr.
If the result is a flag, the method enters a waiting state, and waits until the utilization rate of the structure body array reaches 80%, namely, the structure body of p_get_pcr- > next is skipped and fetched backwards.
In this embodiment, the load balancing server arranges a cms program management program, and obtains various status information (network load, system load, software version, ip address, etc.) of the fragment uploading server through heartbeat of each fragment uploading server. And then, different programs are issued to each fragment uploading server, so that each different server is responsible for different program splicing.
The STB and the server communicate in a TCP long connection mode, and the load balancing server distributes corresponding uploading server addresses according to program information uploaded by the STB by matching the corresponding relation between locally configured programs and the uploading server address list.
Of course, the STB of this embodiment delays the sending time, 5 times redundancy of the splicing server, and 200 numbers of connections of each program, and forced voting (3 values of 5 data are the same in the splicing process), the size of the program buffer queue, the number of pcr fragment splicing arrays, pcr queues, and the like are all configured by the system, and can be modified according to practical situations.
As shown in fig. 9, this embodiment further provides a splicing system, including a massive client (STB), a background service server, a control server, a load balancing server, and a splicing server, specifically, after STB plays for 10s, the STB starts to connect with the control server and then connects with the splicing server, and in the 10s of playing, the program code rate and pcr average interval time need to be acquired. This can be used to dynamically create a memory pool for each program, as well as the B + Tree mapped structure array size.
The control server judges the network condition of the stb end in a heartbeat jitter and weight calculation mode, and tells the splicing server to disconnect the appointed stb through a message, and distributes new stb connection for the splicing server.
In the above process, cur_pcr is the pcr of the current slice; pre_pcr is the pcr value of the previous slice to the current slice; p_get_pcr is the position where the output thread points to a node in the tree; p_pcr is the pointer of the current slice, and is assigned in the structure body if pcr is confirmed, otherwise, the pointer is empty; p_pcr1,2 and 3 are pointers of different fragments respectively recording the same pcr value, and a plurality of pointers can be used, and at most three pointers are taken; p_pcr_num1,2,3 is the count of the slices pointed by the corresponding pointers above, and when the count exceeds 3, the corresponding pcr slices are determined and assigned to p_pcr; p_struct is a structure pointer pointing to the structure corresponding to the tree element; struct_index is an array index, through which a corresponding structure can be found; p_tree_head is the head pointer of the tree.
Therefore, the invention can realize real-time slicing uploading to the server through a large number of clients, and can be used for IPTV after splicing, and under the condition that the network conditions of each client are different, the invention can meet the requirement that a plurality of clients upload one TS stream file at the same time, and can meet the requirement of uploading the TS stream file in real time, and can play the uploaded TS stream in real time, thereby improving the stability of IPTV program sources and improving the user experience.
An embodiment of a TS stream fragment uploading device based on DVB standard:
in this embodiment, as shown in fig. 10, the apparatus for uploading a TS stream slice based on the DVB standard provided by the present invention includes:
and the data acquisition unit is used for acquiring TS stream data of the current program after the STB is started.
The first connection unit is used for requesting to connect with the load balancing server, sending current program information, network state information and signal state information, and acquiring the address of the splicing server after successful connection.
And the second connection unit is used for requesting to connect the splicing server and sending the current program information, the network state information and the signal state information.
And the judging unit is used for judging whether the waiting state is entered after the connection is successful, if not, acquiring a pcr fragment range sent by the splicing server and an index function uploaded by the current STB, filtering pcr fragments according to the pcr fragment range and the index function, and judging whether the filtered pcr fragments meet uploading requirements.
And the uploading unit is used for adding a pcr fragment head to each pcr fragment meeting the uploading requirement if the judging result is yes, judging the current signal condition and the network condition of the STB, and if the signal and the network condition are good, delaying the pcr fragment in the cache and then sending the delayed pcr fragment to the splicing server.
In this embodiment, after the STB starts the machine, a program for uploading a slice is executed in the background, a program buffer queue is opened up, and the TS stream data of the current program is obtained from the recording channel, and after a period of time for starting playing the program, a connection to the load balancing server is requested.
In this embodiment, the pcr chip header includes: CRC32: checking whether the whole pcr fragment is interfered in the transmission process; for redundancy matching when splicing; pre_pcr+cur_pcr: marking the relative positions of pcr fragments, wherein each pcr fragment corresponds to a unique mark; when the pcr fragment is the first slice, the pre_pcr value is 0; ts_data: ts stream cut pcr fragment data.
In this embodiment, acquiring the splicing server address specifically includes: after the splicing server starts up, sending a heartbeat registration service to a load balancing server, and obtaining the address and state information of the splicing server by the load balancing server; program lists are configured for different splicing servers on the load balancing server and are sent to the splicing servers, and the splicing servers start pcr splicing threads of corresponding programs to wait for STB connection; after the load balancing server receives the connection request of the STB, judging the program information of the STB, and returning the address of the corresponding splicing server to the STB.
In the present embodiment, after requesting connection to the splice server, the splice server further performs: the splicing server creates a pcr splicing thread for each program, and each program comprises a pcr fragmentation memory pool and a pcr fragmentation pointer queue; and taking data from the pcr slice pointer queue, analyzing to obtain a cur_pcr value, comparing the sizes of cur_pcr and p_get_pcr, releasing the pointer if cur_pcr is smaller than p_get_pcr, and searching the bptree through cur_pcr if cur_pcr is larger than p_get_pcr.
If the bptree is traversed to obtain the same pcr value, the pointers of the corresponding structures are obtained through vlaue of the bptree, and whether the CRC32 values of p_pcr1,2 and 3 are equal is sequentially compared.
If the CRC32 values of p_pcr1,2,3 are equal, the corresponding p_pcr_num count is incremented by one until one p_pcr_num is greater than 3, the corresponding pointer is assigned to p_pcr, and p_pcr1,2,3 is released.
If the CRC32 values of the p_pcr1,2 and 3 are not equal, judging whether the p_pcr1,2 and 3 are null values, if so, releasing the pointer, and if not, assigning the pointer value to the corresponding p_pcr_num count in the corresponding p_pcr by one.
If the traversal bptree does not obtain the same pcr value, applying for a pcr value in the structure array, assigning a pointer to p_pcr1, adding a cur_pcr value to the bptree, and assigning the pointer to value.
In this embodiment, the splicing server creates a program connection management thread, a program connection pool, a pcr ready queue, and a pcr fragment splicing queue for each program; after all STBs are connected to the splice server, a ready queue is first entered, and a message for entering the ready queue is sent to each STB to enter a waiting state.
After the STB enters the wait state, the splice server also performs: judging whether the pcr fragment splicing queue is smaller than 100 or the weight is lower than 60, if yes, taking the STB with the largest weight from the pcr ready queue to enter the pcr fragment splicing queue, sending the message entering the pcr fragment splicing queue to the STB, and starting uploading the pcr fragment by the STB.
And judging whether the pcr ready queue weight is less than 0, if so, adding a blacklist to the STB, and disconnecting the long connection with the STB.
Judging the heartbeat time interval of each STB connection, accumulating the heartbeat timeout times, subtracting 1 from the weight of the timeout times larger than 3, and adding 1 to the weight of the timeout times smaller than 1.
In this embodiment, an output thread is created in each program, and the output thread takes p_tree_head in the bptree, and determines whether the structure write_flag corresponding to the current bptree is true; if not, acquiring the total number of the use in the structure body array, and if the total number of the use in the structure body array is greater than 50%, sequentially taking down the next node until the corresponding structure body write_flag is true or the total number of the use in the structure body array is less than 50%; if yes, acquiring a corresponding structure body array pointer, taking out data, releasing nodes corresponding to the structure body, constructing an http service for the obtained data, and outputting the http service in sequence.
Computer apparatus embodiment:
the computer device of the present embodiment includes a processor, and the steps in the foregoing embodiment of the method for uploading a TS stream slice based on the DVB standard are implemented when the processor executes a computer program.
For example, a computer program may be split into one or more modules, one or more modules stored in a memory and executed by a processor to perform the present invention. One or more modules may be a series of computer program instruction segments capable of performing particular functions to describe the execution of a computer program in a computer device.
Computer devices may include, but are not limited to, processors, memory. Those skilled in the art will appreciate that a computer apparatus may include more or fewer components, or may combine certain components, or different components, e.g., a computer apparatus may also include input and output devices, network access devices, buses, etc.
For example, the processor may be a central processing unit (CentralProcessingUnit, CPU), but may also be other general purpose processors, digital signal processors (DigitalSignalProcessor, DSP), application specific integrated circuits (ApplicationSpecificIntegratedCircuit, ASIC), off-the-shelf programmable gate arrays (FieldProgrammableGateArray, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The processor is the control center of the computer device and connects the various parts of the entire computer device using various interfaces and lines.
The memory may be used to store computer programs and/or modules, and the processor implements various functions of the computer device by running or executing the computer programs and/or modules stored in the memory, and invoking data stored in the memory. For example, the memory may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function (e.g., a sound receiving function, a sound converting to text function, etc.), and the like; the storage data area may store data (e.g., audio data, text data, etc.) created according to the use of the handset, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as a hard disk, memory, plug-in hard disk, smart memory card (SmartMediaCard, SMC), secure digital (SecureDigital, SD) card, flash card (FlashCard), at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
Storage medium embodiment:
the modules integrated in the terminal device may be stored in a computer readable storage medium if implemented in the form of software functional units and sold or used as a stand alone product. Based on such understanding, the implementation of all or part of the flow in the method of the foregoing embodiment of the present invention may also be implemented by a computer program, which may be stored in a computer readable storage medium, and the computer program may be executed by a processor, to implement the steps of the foregoing method for uploading TS streams based on the DVB standard by using the relevant hardware.
Wherein the computer program comprises computer program code, which may be in the form of source code, object code, executable files or in some intermediate form, etc. The computer readable medium may include: any entity or device capable of carrying computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM), a random access Memory (RAM, randomAccessMemory), an electrical carrier signal, a telecommunication signal, a software distribution medium, and so forth. It should be noted that the content of the computer readable medium can be appropriately increased or decreased according to the requirements of the jurisdiction's jurisdiction and the patent practice, for example, in some jurisdictions, the computer readable medium does not include electrical carrier signals and telecommunication signals according to the jurisdiction and the patent practice.
It can be seen that the present invention provides a computer apparatus and a storage medium comprising: one or more memories, one or more processors. The memory is used for storing the program codes, intermediate data generated in the running process of the program, the output result of the model and model parameters; the processor is used for processor resources occupied by code running and a plurality of processor resources occupied when training the model.
It should be noted that the foregoing is only a preferred embodiment of the present invention, but the design concept of the present invention is not limited thereto, and any insubstantial modifications made to the present invention by using the concept fall within the scope of the present invention.

Claims (9)

1. The TS stream fragment uploading method based on DVB standard is characterized by comprising the following steps:
when the STB starts up, TS stream data of the current program is obtained;
requesting to connect a load balancing server, sending current program information, network state information and signal state information, and acquiring a splicing server address after successful connection;
requesting to connect with a splicing server, and sending current program information, network state information and signal state information;
after the connection is successful, judging whether the waiting state is entered, if not, acquiring a pcr fragment range sent by a splicing server and an index function uploaded by a current STB (set top box), filtering pcr fragments according to the pcr fragment range and the index function, and judging whether the filtered pcr fragments meet uploading requirements;
if the result is yes, adding a pcr fragment head to each pcr fragment meeting the uploading requirement, judging the current signal condition and the network condition of the STB, if the signal and the network condition are good, delaying the pcr fragments in the cache and then sending the delayed pcr fragments to a splicing server for splicing and outputting;
The splicing server creates a program connection management thread, a program connection pool, a pcr ready queue and a pcr fragment splicing queue in each program;
after all STBs are connected to the splice server, a ready queue is first entered, and a message for entering the ready queue is sent to each STB to enter a waiting state.
2. The method for uploading the TS stream fragments based on the DVB standard according to claim 1, wherein:
after the STB starts, a program uploaded by fragments is executed in the background, a program buffer queue is opened up, TS stream data of the current program is obtained from a recording channel, and after a period of time for playing the program is started, the program is requested to be connected with a load balancing server.
3. The method for uploading the TS stream slice based on the DVB standard according to claim 1, wherein the pcr slice header includes:
CRC32: checking whether the whole pcr fragment is interfered in the transmission process; for redundancy matching when splicing;
pre_pcr+cur_pcr: marking the relative positions of pcr fragments, wherein each pcr fragment corresponds to a unique mark; when the pcr fragment is the first slice, the pre_pcr value is 0;
ts_data: ts stream cut pcr fragment data.
4. A method for uploading a TS stream fragment based on the DVB standard according to claim 3, wherein the obtaining the splice server address includes:
After the splicing server starts up, sending a heartbeat registration service to a load balancing server, and obtaining the address and state information of the splicing server by the load balancing server;
program lists are configured for different splicing servers on the load balancing server and are sent to the splicing servers, and the splicing servers start pcr splicing threads of corresponding programs to wait for STB connection;
after the load balancing server receives the connection request of the STB, judging the program information of the STB, and returning the address of the corresponding splicing server to the STB.
5. The method for uploading the TS stream fragments based on the DVB standard according to claim 4, wherein after requesting to connect the splicing server, the splicing server further performs:
the splicing server creates a pcr splicing thread for each program, and each program comprises a pcr fragmentation memory pool and a pcr fragmentation pointer queue;
and taking data from the pcr slice pointer queue, analyzing to obtain a cur_pcr value, comparing the sizes of cur_pcr and p_get_pcr, releasing the pointer if cur_pcr is smaller than p_get_pcr, and searching the bptree through cur_pcr if cur_pcr is larger than p_get_pcr.
6. The method for uploading the TS stream fragments based on the DVB standard according to claim 5, wherein:
If the bptree is traversed to obtain the same pcr value, the pointers of the corresponding structures are obtained through vlaues of the bptree, and whether the CRC32 values of p_pcr1,2 and 3 are equal is sequentially compared;
if the CRC32 values of the p_pcr1,2 and 3 are equal, adding one to the corresponding p_pcr_num count until one p_pcr_num is greater than 3, assigning the corresponding pointer to the p_pcr, and releasing the p_pcr1,2 and 3;
if the CRC32 values of the p_pcr1,2 and 3 are not equal, judging whether the p_pcr1,2 and 3 are null values, if so, releasing the pointer, and if not, assigning the pointer value to the corresponding p_pcr_num count in the corresponding p_pcr by one;
if the traversal bptree does not obtain the same pcr value, applying for a pcr value in the structure array, assigning a pointer to p_pcr1, adding a cur_pcr value to the bptree, and assigning the pointer to value.
7. The method for uploading the TS stream fragments based on the DVB standard according to claim 6, wherein after the STB enters the waiting state, the splicing server further performs:
judging whether the pcr fragment splicing queue is smaller than 100 or the weight is lower than 60, if yes, taking the STB with the largest weight from the pcr ready queue to enter the pcr fragment splicing queue, sending a message entering the pcr fragment splicing queue to the STB, and starting uploading pcr fragments by the STB;
Judging whether the pcr ready queue weight is less than 0, if so, adding a blacklist to the STB, and disconnecting the long connection with the STB;
judging the heartbeat time interval of each STB connection, accumulating the heartbeat timeout times, if the timeout times are more than 3, subtracting 1 from the weight of the STB, and if the timeout times are less than 1, adding 1 to the weight of the STB.
8. The method for uploading the TS stream fragments based on the DVB standard according to claim 7, wherein:
creating an output thread in each program, wherein the output thread takes p_tree_head in the bptree, and judging whether a structural body write_flag corresponding to the current bptree is true or not;
if not, acquiring the total number of the use in the structure body array, and if the total number of the use in the structure body array is greater than 50%, sequentially taking down the next node until the corresponding structure body write_flag is true or the total number of the use in the structure body array is less than 50%;
if yes, acquiring a corresponding structure body array pointer, taking out data, releasing nodes corresponding to the structure body, constructing an http service for the obtained data, and outputting the http service in sequence.
9. A DVB standard based TS stream fragment upload system, comprising:
the data acquisition unit is used for acquiring TS stream data of the current program after the STB is started;
The first connection unit is used for requesting to connect with the load balancing server, sending current program information, network state information and signal state information, and acquiring a splicing server address after successful connection;
the second connection unit is used for requesting to connect the splicing server and sending current program information, network state information and signal state information;
the judging unit is used for judging whether the waiting state is entered after the connection is successful, if not, acquiring a pcr fragment range sent by the splicing server and an index function uploaded by the current STB, filtering pcr fragments according to the pcr fragment range and the index function, and judging whether the filtered pcr fragments meet uploading requirements;
the uploading unit is used for adding a pcr fragment head to each pcr fragment meeting the uploading requirement if the judging result is yes, judging the current signal condition and the network condition of the STB, and if the signal and the network condition are good, delaying the pcr fragment in the cache and then sending the delayed pcr fragment to the splicing server;
the splicing server creates a program connection management thread, a program connection pool, a pcr ready queue and a pcr fragment splicing queue in each program;
after all STBs are connected to the splice server, a ready queue is first entered, and a message for entering the ready queue is sent to each STB to enter a waiting state.
CN202111175671.8A 2021-10-09 2021-10-09 DVB standard-based TS (transport stream) stream fragment uploading method and device Active CN113852642B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111175671.8A CN113852642B (en) 2021-10-09 2021-10-09 DVB standard-based TS (transport stream) stream fragment uploading method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111175671.8A CN113852642B (en) 2021-10-09 2021-10-09 DVB standard-based TS (transport stream) stream fragment uploading method and device

Publications (2)

Publication Number Publication Date
CN113852642A CN113852642A (en) 2021-12-28
CN113852642B true CN113852642B (en) 2023-05-09

Family

ID=78977774

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111175671.8A Active CN113852642B (en) 2021-10-09 2021-10-09 DVB standard-based TS (transport stream) stream fragment uploading method and device

Country Status (1)

Country Link
CN (1) CN113852642B (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102571788A (en) * 2011-12-30 2012-07-11 北京奇虎科技有限公司 Sample collection method and system
CN103561100A (en) * 2013-11-06 2014-02-05 乐视网信息技术(北京)股份有限公司 Cloud uploading method, cloud uploading system, dispatching device and client terminal
WO2016000211A1 (en) * 2014-07-01 2016-01-07 华为技术有限公司 Video data transmission device, method, server, base station and client
CN105357593A (en) * 2015-10-30 2016-02-24 努比亚技术有限公司 Method, device and system for uploading video
WO2018059222A1 (en) * 2016-09-28 2018-04-05 杭州海康威视数字技术股份有限公司 File slice uploading method and apparatus, and cloud storage system
CN109831506A (en) * 2019-01-31 2019-05-31 百度在线网络技术(北京)有限公司 File uploading method, device, terminal, server and readable storage medium storing program for executing
CN109982160A (en) * 2019-04-09 2019-07-05 北京奇艺世纪科技有限公司 A kind of method, apparatus, client device and server that video uploads
WO2019222934A1 (en) * 2018-05-23 2019-11-28 优视科技新加坡有限公司 File processing method, apparatus and system
CN110650182A (en) * 2019-08-30 2020-01-03 深圳壹账通智能科技有限公司 Network caching method and device, computer equipment and storage medium
WO2021164178A1 (en) * 2020-02-21 2021-08-26 平安科技(深圳)有限公司 Cloud technology-based file fragment uploading method and apparatus, and device and storage medium
CN113438499A (en) * 2021-06-29 2021-09-24 北京奇艺世纪科技有限公司 Data uploading and receiving method, device, equipment and storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8589565B2 (en) * 2010-05-24 2013-11-19 Microsoft Corporation Client-server session parallelism
US11599500B2 (en) * 2018-10-11 2023-03-07 Box, Inc. Systems and methods for sharding based on distributed inverted indexes

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102571788A (en) * 2011-12-30 2012-07-11 北京奇虎科技有限公司 Sample collection method and system
CN103561100A (en) * 2013-11-06 2014-02-05 乐视网信息技术(北京)股份有限公司 Cloud uploading method, cloud uploading system, dispatching device and client terminal
WO2016000211A1 (en) * 2014-07-01 2016-01-07 华为技术有限公司 Video data transmission device, method, server, base station and client
CN105357593A (en) * 2015-10-30 2016-02-24 努比亚技术有限公司 Method, device and system for uploading video
WO2018059222A1 (en) * 2016-09-28 2018-04-05 杭州海康威视数字技术股份有限公司 File slice uploading method and apparatus, and cloud storage system
WO2019222934A1 (en) * 2018-05-23 2019-11-28 优视科技新加坡有限公司 File processing method, apparatus and system
CN109831506A (en) * 2019-01-31 2019-05-31 百度在线网络技术(北京)有限公司 File uploading method, device, terminal, server and readable storage medium storing program for executing
CN109982160A (en) * 2019-04-09 2019-07-05 北京奇艺世纪科技有限公司 A kind of method, apparatus, client device and server that video uploads
CN110650182A (en) * 2019-08-30 2020-01-03 深圳壹账通智能科技有限公司 Network caching method and device, computer equipment and storage medium
WO2021164178A1 (en) * 2020-02-21 2021-08-26 平安科技(深圳)有限公司 Cloud technology-based file fragment uploading method and apparatus, and device and storage medium
CN113438499A (en) * 2021-06-29 2021-09-24 北京奇艺世纪科技有限公司 Data uploading and receiving method, device, equipment and storage medium

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
Lingzi Xiao ; Sanxing Cao.Design and implementation of multimedia repository system based on middle tier structure.《2015 6th IEEE International Conference on Software Engineering and Service Science (ICSESS)》.2015,179-182页. *
生物数据分析平台中的大文件多线程传输方案;史若曦; 马俊才; 田园静; 张荐辕;《计算机系统应用》;第第30卷卷(第第9期期);317-321页 *
高校视频资源共享框架的设计与实现;王鹰;《软件导刊(教育技术)》;第第18卷卷(第第5期期);74-76页 *

Also Published As

Publication number Publication date
CN113852642A (en) 2021-12-28

Similar Documents

Publication Publication Date Title
US11350139B2 (en) Video live broadcast method and apparatus
US20190158936A1 (en) Method and Apparatus for Downloading Streaming Media File Fragment and Terminal
EP2383941B1 (en) Client terminal, method and system for downloading streaming media
US8667158B2 (en) Video splitting and distributed placement scheme for clustered video servers
US20110055881A1 (en) Media file on-demand method, system and appartus
WO2013159703A1 (en) Offline download method, multimedia file download method and system thereof
EP1944944A1 (en) System and method for combining pull and push modes
CN103078847B (en) Method for storing and reading multi-code-rate stream file and relevant device
CN110636340B (en) Video file uploading method, storage device, terminal device and storage medium
US11032584B2 (en) Picture storage method, apparatus and video monitoring system
WO2017181601A1 (en) Live broadcast streaming processing method, apparatus, electronic device and system
EP3800894A1 (en) Method and apparatus for detecting video playing quality
CN112312162B (en) Video server for transmitting video stream
CN110113626A (en) A kind of method and device playing back live video
CN104539984A (en) Video playing method, device and system
CN114222086B (en) Method, system, medium and electronic device for scheduling audio and video code stream
CN113115120B (en) Video slicing method and device, electronic equipment and storage medium
CN107659626B (en) Temporary metadata oriented separation storage method
CN113852642B (en) DVB standard-based TS (transport stream) stream fragment uploading method and device
CN113923473A (en) Video and audio playing method and device, electronic equipment and storage medium
US20060224758A1 (en) System and method for file header operation in a peer-to-peer network providing streaming services
CN115941907A (en) RTP data packet sending method, system, electronic equipment and storage medium
CN115412777A (en) Streaming media data transmission method, device and system
EP1836846A1 (en) Apparatus and method for resource management in data broadcast receiver
CN111711826B (en) Video live broadcast service system and method

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