CN115334068A - Data transmission method, device, terminal equipment and storage medium - Google Patents

Data transmission method, device, terminal equipment and storage medium Download PDF

Info

Publication number
CN115334068A
CN115334068A CN202210830640.XA CN202210830640A CN115334068A CN 115334068 A CN115334068 A CN 115334068A CN 202210830640 A CN202210830640 A CN 202210830640A CN 115334068 A CN115334068 A CN 115334068A
Authority
CN
China
Prior art keywords
distribution server
terminal
service
server
distribution
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.)
Pending
Application number
CN202210830640.XA
Other languages
Chinese (zh)
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.)
Visionvera Information Technology Co Ltd
Original Assignee
Visionvera Information 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 Visionvera Information Technology Co Ltd filed Critical Visionvera Information Technology Co Ltd
Priority to CN202210830640.XA priority Critical patent/CN115334068A/en
Publication of CN115334068A publication Critical patent/CN115334068A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • H04L67/025Protocols based on web technology, e.g. hypertext transfer protocol [HTTP] for remote control or remote monitoring of applications
    • 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
    • H04L67/101Server selection for load balancing based on network conditions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/148Migration or transfer of sessions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N7/00Television systems
    • H04N7/18Closed-circuit television [CCTV] systems, i.e. systems in which the video signal is not broadcast

Abstract

The embodiment of the invention provides a data transmission method, a data transmission device, terminal equipment and a storage medium, wherein the method comprises the following steps: acquiring service parameters of a plurality of distribution servers and service states of terminals; the method comprises the steps that a distribution server and a terminal are matched according to service parameters of the distribution server and service states of the terminal, so that the distribution server and the terminal can transmit service data, when the concurrent terminal sends a watching monitoring request to a server monitoring platform, the server monitoring platform obtains the service parameters of each distribution server connected with the server monitoring platform and the service states of the terminal, and when the situation that the distribution server is blocked and/or the terminal sends a switching request to the server monitoring platform when the terminal continuously lacks or is in imminent shortage of playing cache data in a player is detected, the more optimal distribution server is selected for dynamic switching, and therefore the terminal can achieve uninterrupted and smooth playing of pictures.

Description

Data transmission method, device, terminal equipment and storage medium
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a data transmission method, an apparatus, a terminal device, and a storage medium.
Background
With the continuous development of video networking technology, a browser terminal provided with MSE (Media Source extension, which is a set of API capable of continuously plugging audio and video binary data into a video tag for playing) can be adopted to watch monitoring pictures, so that the monitoring display effect and timeliness are good.
However, if a plurality of browsers send requests to the server at the same time, the phenomena of insufficient bandwidth, network card not supporting the concurrent function and packet loss are easily caused, which causes delayed display or jamming of the display image of the browser terminal.
Disclosure of Invention
In view of the above problems, embodiments of the present invention are proposed to provide a data transmission method, apparatus, terminal device and storage medium that overcome or at least partially solve the above problems.
In a first aspect, an embodiment of the present invention provides a data transmission method, where the method is applied to a server monitoring platform, the server monitoring platform is connected to multiple distribution servers, and the distribution servers are connected to multiple terminals, where the method includes:
acquiring service parameters of a plurality of distribution servers and service states of terminals; the service parameter is used for judging whether the distribution server is blocked or not, and the service state of the terminal is used for judging whether the terminal sends a switching sending request or not;
and matching the distribution server with the terminal according to the service parameters of the distribution server and the service state of the terminal so as to enable the distribution server and the terminal to carry out service data transmission.
Optionally, after the distribution server is matched with the terminal and service data transmission is performed, the method further includes:
when the matched distribution server is blocked and/or the service state of the terminal is a switching request sending state, switching the matched distribution server;
determining whether the distribution server is blocked or not according to the service parameters of the distribution server; and determining whether the service state of the terminal is a switching request sending state or not according to the service state of the terminal.
Optionally, the switching the matched distribution server includes:
switching the blocked distribution server to an idle distribution server according to a preset distribution server list;
the preset distribution server list at least comprises a distribution server name and a service state of a distribution server corresponding to the distribution server name, and the service state at least comprises blocking or idle.
Optionally, the determining, according to the service parameter of the distribution server, whether the distribution server is blocked includes at least time consumed for sending a data packet and/or size of queue cache data, including:
and if the time consumed for sending the data packet in the service parameters of the distribution server is judged to be longer than a first preset value, and/or the size of the queue cache data is judged to be larger than a second preset value, determining that the distribution server is in a blocking state.
Optionally, the determining, according to the service state of the terminal, that the service state of the terminal is a state of sending a handover request includes:
the server monitoring platform receives a switching request sent by the terminal and determines that the service state of the terminal is a switching request sending state;
and when monitoring that the data in the cache queue is smaller than a third preset value within a preset time period, the terminal sends a switching request sent by the terminal to the server monitoring platform.
Optionally, the method further comprises:
and under the condition that the distribution server before switching is connected with the terminal, when the terminal receives the first I-frame video frame sent by the distribution server after switching, the terminal is controlled to disconnect the distribution server before switching.
Optionally, the distribution server is connected with a plurality of terminals through websockets.
In a second aspect, an embodiment of the present invention provides a data transmission apparatus, where the apparatus is applied to a server monitoring platform, the server monitoring platform is connected to a plurality of distribution servers, and the distribution servers are connected to a plurality of terminals, and the apparatus includes:
the acquisition module is used for acquiring the service parameters of the plurality of distribution servers and the service state of the terminal; the service parameter is used for judging whether the distribution server is blocked or not, and the service state of the terminal is used for judging whether the terminal sends a switching sending request or not;
and the matching module is used for matching the distribution server with the terminal according to the service parameters of the distribution server and the service state of the terminal so as to enable the distribution server and the terminal to transmit service data.
Optionally, the matching module is configured to:
when the matched distribution server is blocked and/or the service state of the terminal is a switching request sending state, switching the matched distribution server;
determining whether the distribution server is blocked or not according to the service parameters of the distribution server; and determining whether the service state of the terminal is a switching request sending state or not according to the service state of the terminal.
Optionally, the matching module is configured to:
switching the blocked distribution server to an idle distribution server according to a preset distribution server list;
the preset distribution server list at least comprises a distribution server name and a service state of a distribution server corresponding to the distribution server name, and the service state at least comprises blocking or idle.
Optionally, the service parameter at least includes a time consumed for sending a data packet and/or a queue buffer data size, and the matching module is configured to:
and if the time consumed for sending the data packet in the service parameters of the distribution server is judged to be longer than a first preset value, and/or the size of the queue cache data is larger than a second preset value, determining that the distribution server is in a blocking state.
Optionally, the matching module is configured to:
receiving a switching request sent by the terminal, and determining that the service state of the terminal is a switching request sending state;
when the terminal monitors that the data in the cache queue is smaller than a third preset value within a preset time period, the terminal sends a switching request sent by the terminal to the server monitoring platform.
Optionally, the matching module is further configured to:
and under the condition that the distribution server before switching is connected with the terminal, when the terminal receives the first I-frame video frame sent by the distribution server after switching, the terminal is controlled to disconnect the distribution server before switching.
Optionally, the distribution server is connected with a plurality of terminals through websockets.
In a third aspect, an embodiment of the present invention provides a terminal device, including: at least one processor and a memory;
the memory stores a computer program; the at least one processor executes the computer program stored by the memory to implement the data transmission method provided by the first aspect.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, where a computer program is stored, and when the computer program is executed, the computer program implements the data transmission method provided in the first aspect.
The embodiment of the invention has the following advantages:
the data transmission method, the data transmission device, the terminal equipment and the storage medium provided by the embodiment of the invention are applied to a server monitoring platform, the server monitoring platform is connected with a plurality of distribution servers, and the distribution servers are connected with a plurality of terminals, and the method comprises the following steps: acquiring service parameters of a plurality of distribution servers and service states of terminals; the service parameter is used for judging whether the distribution server is blocked or not, and the service state of the terminal is used for judging whether the terminal sends a switching sending request or not; in the embodiment of the invention, when concurrent terminals send watching monitoring requests to a server monitoring platform, the server monitoring platform acquires the service parameters of each distribution server connected with the server monitoring platform and the service state of the terminal, and selects a more optimal distribution server to perform dynamic switching under the condition that a switching request is sent to the server monitoring platform when the distribution server is detected to be blocked and/or the terminal plays cache data in a player continuously in short or nearly in short, so that the terminal realizes uninterrupted and smooth playing of pictures.
Drawings
FIG. 1 is a flow chart of the steps of one embodiment of a data transmission method of the present invention;
FIG. 2 is a flow chart of steps in another data transmission method embodiment of the present invention;
FIG. 3 is a flow chart of the steps of yet another data transmission method embodiment of the present invention;
fig. 4 is a block diagram of the structure of the terminal of the present invention;
FIG. 5 is a block diagram of an embodiment of a data transmission apparatus according to the present invention;
fig. 6 is a schematic structural diagram of a terminal device of the present invention.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention more comprehensible, the present invention is described in detail with reference to the accompanying drawings and the detailed description thereof.
The video networking is an important milestone for network development, is a real-time network, can realize high-definition video real-time transmission, and pushes a plurality of internet applications to high-definition video, and high-definition faces each other.
The video networking adopts a real-time high-definition video exchange technology, can integrate required services such as dozens of services of video, voice, pictures, characters, communication, data and the like on a system platform on a network platform, such as high-definition video conference, video monitoring, intelligent monitoring analysis, emergency command, digital broadcast television, delayed television, network teaching, live broadcast, VOD on demand, television mail, personal Video Recorder (PVR), intranet (self-office) channels, intelligent video broadcast control, information distribution and the like, and realizes high-definition quality video broadcast through a television or a computer.
In the process of service, N distribution servers are hung under a server monitoring platform, each distribution server supports a websocket (Protocol for full duplex communication on a single TCP connection) service function and a video networking module function, the server monitoring platform acquires each distribution server message, wherein the distribution server message at least comprises one or more of IP (Internet Protocol) address information, port information, current service state of the distribution server, CPU (central processing unit) occupancy rate of the distribution server, memory consumption rate, bandwidth consumption quantity, current service concurrency quantity and total concurrency limit quantity corresponding to each distribution server, and the server monitoring platform selects a proper distribution server and pulls a media stream from a browser terminal connected with the distribution server.
In the case that the time consumed by the distribution server to send each data packet to the terminal through the websocket is continuously increased or kept in a certain high-level state, the data to be sent may be accumulated, or when the playing cache data in the player on the user browser is continuously in short supply or is in imminent short supply, in the two states, the terminal cannot acquire a media stream from the distribution server and cannot normally play the media stream through the player. The execution main body of the embodiment is a data transmission device and is arranged on the server monitoring platform.
Referring to fig. 1, a flowchart of steps of an embodiment of a data transmission method according to the present invention is shown, where the method is applied to a server monitoring platform, the server monitoring platform is connected to multiple distribution servers, and the distribution servers are connected to multiple terminals, and specifically the method includes the following steps:
s101, acquiring service parameters of a plurality of distribution servers and service states of terminals; the service parameter is used for judging whether the distribution server is blocked or not, and the service state of the terminal is used for judging whether the terminal sends a switching sending request or not;
wherein, the service parameter at least includes: time consumed for sending the data packet, queue cache data size, address information of the distribution server, port information, the state of the current service, memory consumed information of the distribution server, bandwidth consumption information, the current service concurrency number and the maximum concurrency number.
In the embodiment of the present application, the terminal may be a terminal device installed with a browser.
The embodiment of the invention is applied to a server monitoring platform, the server monitoring platform is connected with a plurality of distribution servers, each distribution server can be connected with one or more terminals, and the distribution servers are connected with the terminals through websockets.
MSE (Media Source extension, MSE, is a set of API (application program interface) capable of continuously plugging audio and video binary data into video tags for playing) is installed on the terminal.
In the process of carrying out services by the distribution server and the terminal, the distribution server reports service parameters to the server monitoring platform through an HTTP (Hyper Text Transfer Protocol), wherein the service parameters at least include address information of the distribution server, port information, a current service state, time consumed for sending a data packet corresponding to the distribution server, a size of queue cache data corresponding to the distribution server, memory consumed information of the distribution server, bandwidth consumption information, a current service concurrency number and a maximum concurrency number. The address information and the port information of the distribution server are used for determining that the distribution server is a certain distribution server and for data transmission, the time consumed for sending a data packet and the size of queue cache data are used for judging whether the distribution server is blocked or not, the distribution server consumes memory information and bandwidth consumption information and is used for judging whether the distribution server is idle or not and how many services can be borne, the current service concurrency number and the maximum concurrency number are used for judging how many concurrent monitoring requests can be received, the current service state is used for judging the execution state of each service, and the service state of the distribution server can also be judged according to each service state.
In the process of playing the monitoring data by the terminal, if the terminal monitors that the playing cache data is in continuous shortage and is in imminent shortage, it is indicated that a distribution server connected with the terminal is in fault or is blocked, the monitoring data cannot be sent to the terminal, the distribution server needs to be replaced, a switching request is sent to a server monitoring platform, and the service state of the terminal is determined to be a sending request state.
The server monitoring platform judges which distribution service is blocked and which terminal cannot normally play the monitoring video by acquiring the service parameters of the plurality of distribution servers and the service states of the terminals, and the service parameters of the distribution servers and the judgment results of the service states of the terminals can be used as trigger conditions for switching of the distribution servers, so that the data processing process is more flexible.
S102, matching the distribution server and the terminal according to the service parameters of the distribution server and the service state of the terminal so as to enable the distribution server and the terminal to transmit service data.
Specifically, the server monitoring platform judges the time consumed for sending the data packet and/or the size of the queue cache data in the received service parameters of the distribution server, and if the time consumed for sending the data packet is greater than a first preset value and/or the size of the queue cache data is greater than a second preset value, it is indicated that the distribution server is blocked.
When the server monitoring platform matches the distribution server with the terminal under the condition of judging whether the distribution server is blocked and/or whether the service state of the terminal is the state of sending the switching request, the server monitoring platform selects the distribution server which is not blocked to be connected with the terminal which sends the switching request state, and therefore smooth service data transmission between the distribution server and the terminal can be guaranteed.
Illustratively, a server monitoring platform is connected to the distribution server 1, the distribution server 2 and the distribution server 3, the distribution server 1 is connected to the terminal 1, a list of each distribution server is stored on the server monitoring platform, the list of the distribution servers includes a service state of each distribution server, the server monitoring platform determines that the distribution server 1 is blocked, then the server monitoring platform selects an idle distribution server according to the list of the distribution servers, switches the distribution server 1 to the distribution server 2 (i.e., an idle distribution server), and the distribution server 2 is connected to the terminal 1 to perform normal transmission of service data. By switching the distribution servers, a more appropriate distribution server is selected, and the switched distribution server is connected with the terminal, so that the phenomenon that a display picture of the terminal is displayed in a delayed mode or is jammed is avoided.
The data transmission method provided by the embodiment of the invention is applied to a server monitoring platform, the server monitoring platform is connected with a plurality of distribution servers, and the distribution servers are connected with a plurality of terminals, and the method comprises the following steps: acquiring service parameters of a plurality of distribution servers and service states of terminals; the service parameter is used for judging whether the distribution server is blocked or not, and the service state of the terminal is used for judging whether the terminal sends a switching sending request or not; in the embodiment of the invention, when concurrent terminals send watching monitoring requests to a server monitoring platform, the server monitoring platform acquires the service parameters of each distribution server connected with the server monitoring platform and the service state of the terminal, and selects a more optimal distribution server to perform dynamic switching under the condition that a switching request is sent to the server monitoring platform when the distribution server is detected to be blocked and/or the terminal plays cache data in a player continuously in short or nearly in short, so that the terminal realizes uninterrupted and smooth playing of pictures.
The present invention further provides a supplementary description of the data transmission method provided in the above embodiment.
As shown in fig. 2, a flow chart of steps of another embodiment of a data transmission method of the present invention is shown, and the data transmission method includes:
s201, acquiring service parameters of a plurality of distribution servers and service states of terminals;
wherein, the service parameters at least comprise: time consumed for sending the data packet, queue cache data size, address information of the distribution server, port information, the state of the current service, memory consumed information of the distribution server, bandwidth consumption information, the current service concurrency number and the maximum concurrency number.
S202, if the time consumed for sending the data packet in the service parameters of the distribution server is judged to be longer than a first preset value and/or the size of the queue cache data is judged to be larger than a second preset value, the distribution server is determined to be in a blocking state.
Specifically, after the distribution server is connected with the terminal, the server monitoring platform monitors the service information of the distribution server in real time, and when the service information of the distribution server is in a blocking state, the distribution server is switched to ensure normal transmission of terminal data;
the first preset value and the second preset value can be set according to requirements.
Illustratively, as an optional implementation manner, the time taken for sending the data packet in the service parameter in the distribution server is 10ms, which is greater than the first preset value of 8ms, and this indicates that the distribution server is in a blocking state.
As another optional embodiment, in the process of sending the monitoring data to the terminal, the server monitoring platform determines that the distribution server is in a blocking state according to that the size of the queue cache data of the monitoring data in the service parameters is 12M and is greater than the second preset value by 10M.
As another optional implementation manner, the time taken for sending the data packet in the service parameter in the distribution server is 10ms, which is greater than the first preset value by 8ms, and the size of the queue buffer data of the monitoring data is 12M, which is greater than the second preset value by 10M, which indicates that the distribution server is in a blocking state.
And S203, if the distribution server is blocked, switching the distribution server so that the distribution server and the terminal transmit the service data.
The server monitoring platform acquires service information of each distribution server, wherein the service information comprises blocking or idle, the service information can be determined according to the CPU occupancy rate or the memory utilization rate of each distribution server, if the CPU occupancy rate is greater than a first preset value and/or the memory utilization rate is greater than a second preset value, the distribution server is determined to be in a busy state, otherwise, the distribution server is in an idle state.
When the server monitoring platform distributes the distribution servers, the distribution server with the congestion is switched to an idle distribution server according to a preset distribution server list, for example, the distribution server in an idle state may be selected, for example, an idle distribution server may be selected randomly, or the distribution servers may be selected according to the sequence of the distribution servers, or each distribution server may be sorted according to the occupancy rate of the CPU or sorted according to the usage rate of the memory, and then, according to the result of the sorting, the distribution server is selected according to the occupancy rate of the CPU from small to large and/or the usage rate of the memory from small to large, which is not specifically limited in this application.
Illustratively, the server monitoring platform is connected to the distribution server 1 and the distribution server 2, respectively, the distribution server 1 is connected to the terminal 1, and the server monitoring platform determines that the distribution server 1 is blocked, and then the server monitoring platform switches the distribution server 1 to the distribution server 2, and the distribution server 2 is connected to the terminal 1 to perform service data transmission.
S204, receiving a switching instruction sent by the terminal under the condition that the terminal detects that the data in the cache queue is smaller than a third preset value within a preset time period, and determining that the service state of the terminal is a switching request sending state;
specifically, after the distribution server is connected with the terminal, the server monitoring platform monitors the service state of the terminal in real time, and when the service state of the terminal is a state of sending a switching request, the distribution server is switched to ensure normal transmission of terminal data.
And S205, under the condition that the distribution server before switching keeps connected with the terminal, the terminal receives the first I frame video frame sent by the distribution server after switching, and the terminal is controlled to disconnect from the distribution server before switching.
Specifically, if the terminal 1 detects that the data in the cache queue is smaller than the third preset value within 100ms in the preset time period, which indicates that the terminal 1 cannot acquire a large amount of monitoring data from the distribution server, the terminal 1 sends a request to the server monitoring platform, and the server monitoring platform switches the distribution server 1 connected to the terminal 1 to the distribution server 2 after receiving the request sent by the terminal 1.
Under the condition that the distribution server before switching is connected with the terminal, the terminal receives the first I-frame video frame sent by the distribution server after switching, the control terminal is disconnected from the distribution server before switching, and the terminal actively connects the distribution server after switching according to the IP address and the port number of the distribution server after switching, so that the monitoring data sent by the distribution server after switching can be received, and the phenomenon of delayed display or blockage of a display picture is avoided.
Fig. 3 is a flowchart of steps of another data transmission method embodiment of the present invention, and as shown in fig. 3, in a distribution server according to an embodiment of the present invention, a websocket service function and a video networking module function are supported, and a server monitoring platform obtains messages of each distribution server, where the messages of the distribution server at least include one or more of IP (Internet Protocol) address information, port information, a current service state of the distribution server, a Central Processing Unit (CPU) occupancy of the distribution server, a memory consumption rate, a bandwidth consumption amount, a current service concurrency amount, and a total concurrency limit amount corresponding to each distribution server, and the server monitoring platform selects an appropriate distribution server and pulls a media stream from a terminal connected to the distribution server.
When the time consumed by the distribution server to send each data packet through the websocket is continuously increased or kept in a certain high-level state to cause data accumulation, or when the playing cache data in the user player is continuously in short supply or is in short supply, a more optimal distribution server is selected to perform dynamic switching in the two states.
When a terminal switches distribution servers, because services are in progress, browser page perception needs to be reduced as much as possible, in the process of switching the distribution servers, a realization strategy that the services are not interrupted is kept, websocket connection can be firstly carried out with a new distribution server, when I-frame monitoring data sent by the new distribution server are received, the terminal is disconnected from the original distribution server, and then the new distribution server is reconnected, so that a user cannot perceive the switching process of the distribution server when viewing the monitoring data through a browser.
The method specifically comprises the following steps:
1. and the distribution server regularly reports related information to the server monitoring platform through an HTTP (hyper text transport protocol).
2. The server monitoring platform obtains distribution server information of all current distribution servers, wherein the distribution server information at least comprises one or more of IP (Internet Protocol) address information, port information, current service states of the distribution servers, central Processing Unit (CPU) occupancy rates of the distribution servers, memory consumption rates, bandwidth consumption numbers, current service concurrency numbers and total concurrency limit numbers corresponding to all the distribution servers.
3. And the server monitoring platform selects the optimal server from the distribution servers, connects the distribution servers with the terminal through a websocket and executes pull stream operation.
4. The distribution server monitors the transmission time-consuming growth rate and/or the queue cache data size of each websocket link, and determines whether blocking occurs according to the two parameters. And detecting cache data by a player at the terminal, wherein the decrease indicates that the received data is reduced, and triggering the dynamic switching of the distribution server.
5. The method comprises the steps of detecting cache data at a terminal, namely a user player terminal, rendering when data cache is too little or no data exists, indicating that the received data are reduced, and triggering dynamic switching of a distribution server after a certain time length.
6. And triggering dynamic switching of the distribution servers in the steps 4 and 5, acquiring a distribution server list at the current moment from the server monitoring platform, and selecting a proper distribution server again.
7. And (4) keeping the original connection in the process of the step (6), and actively connecting the terminal with a new distribution server pull stream until the terminal receives the first I frame data in the step (6), and reloading after receiving the first I frame data.
Specifically, fig. 4 is a structural block diagram of the terminal of the present invention, and as shown in fig. 4, the terminal is installed with an MSE, and the MSE has three modules to process streams media source, remuxController and buffer controllers, where:
media resource: binding a video plug-in, and performing data aperpendBuffer (media source expansion), updateend (update end) and the like of bottom-layer MSE;
buffercontrolers: the tie transmits data in an encapsulation channel remuxConroller to MSE;
remuxController is an implementation of data encapsulation fmp4 (Fragmented mp 4).
When the terminal is connected with the switched distribution server, the connection relation with the original distribution server is firstly disconnected, monitoring data in buffer controllers are only needed to be emptied during resetting, the remuxConroller is destroyed and then reestablished, the media resource is bound with a play control and should not be changed, an interface is changed to be sensed, the media resource receives the monitoring data sent by the switched distribution server, and then the received monitoring data is sent to the remuxConroller through a reestablished remuxConroller channel to carry out fmp4 packaging, so that the terminal can play.
8. The picture can be recovered to be normal after the short-time still frame of the picture is seen in the playing picture of the terminal, and the embodiment of the invention realizes the large concurrent watching of the monitoring data through the MES.
In the embodiment of the invention, under the condition of large MSE concurrency, the implementation strategy of the distribution server is dynamically changed, and the images are watched and monitored by the MES without interruption and are smoothly played.
It should be noted that for simplicity of description, the method embodiments are shown as a series of combinations of acts, but those skilled in the art will recognize that the embodiments are not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments. Further, those of skill in the art will appreciate that the embodiments described in the specification are presently preferred and that no particular act is required to implement the embodiments of the invention.
The data transmission method provided by the embodiment of the invention is applied to a server monitoring platform, the server monitoring platform is connected with a plurality of distribution servers, and the distribution servers are connected with a plurality of terminals, and the method comprises the following steps: acquiring service parameters of a plurality of distribution servers and service states of terminals; the service parameter is used for judging whether the distribution server is blocked or not, and the service state of the terminal is used for judging whether the terminal sends a switching sending request or not; in the embodiment of the invention, when concurrent terminals send watching monitoring requests to a server monitoring platform, the server monitoring platform acquires the service parameters of each distribution server connected with the server monitoring platform and the service state of the terminal, and selects a more optimal distribution server to perform dynamic switching under the condition that a switching request is sent to the server monitoring platform when the distribution server is detected to be blocked and/or the terminal plays cache data in a player continuously in short or nearly in short, so that the terminal realizes uninterrupted and smooth playing of pictures.
Another embodiment of the present invention provides a data transmission apparatus, configured to execute the data transmission method provided in the foregoing embodiment.
Referring to fig. 5, a block diagram of a data transmission apparatus according to an embodiment of the present invention is shown, where the apparatus may be applied to a server monitoring platform, the server monitoring platform is connected to a plurality of distribution servers, and the distribution servers are connected to a plurality of terminals, and specifically may include the following modules: an obtaining module 501 and a matching module 502, wherein:
the obtaining module 501 is configured to obtain service parameters of multiple distribution servers and service states of terminals; the service parameter is used for judging whether the distribution server is blocked or not, and the service state of the terminal is used for judging whether the terminal sends a switching sending request or not;
the matching module 502 is configured to match the distribution server with the terminal according to the service parameter of the distribution server and the service state of the terminal, so that the distribution server and the terminal perform service data transmission.
The data transmission device provided by the embodiment of the invention is applied to a server monitoring platform, the server monitoring platform is connected with a plurality of distribution servers, and the distribution servers are connected with a plurality of terminals, and the method comprises the following steps: acquiring service parameters of a plurality of distribution servers and service states of terminals; the service parameter is used for judging whether the distribution server is blocked or not, and the service state of the terminal is used for judging whether the terminal sends a switching sending request or not; in the embodiment of the invention, when concurrent terminals send watching monitoring requests to a server monitoring platform, the server monitoring platform obtains the service parameters of each distribution server connected with the server monitoring platform and the service state of the terminal, and selects a more optimal distribution server to perform dynamic switching under the condition that a switching request is sent to the server monitoring platform when the distribution server is detected to be blocked and/or the terminal plays cache data in a player continuously in short supply or is imminent in short supply, so that the terminal realizes continuous and smooth playing of pictures.
The data transmission device provided by the above embodiment is further described in an additional embodiment of the present invention.
Optionally, the matching module is configured to:
when the matched distribution server is blocked and/or the service state of the terminal is a switching request sending state, switching the matched distribution server;
determining whether the distribution server is blocked or not according to the service parameters of the distribution server; and determining whether the service state of the terminal is a switching request sending state or not according to the service state of the terminal.
Optionally, the matching module is configured to:
switching the blocked distribution server to an idle distribution server according to a preset distribution server list;
the preset distribution server list at least comprises a distribution server name and a service state of a distribution server corresponding to the distribution server name, and the service state at least comprises blocking or idle.
Optionally, the service parameter at least includes a time consumed for sending a data packet and/or a queue buffer data size, and the matching module is configured to:
and if the time consumed for sending the data packet in the service parameters of the distribution server is judged to be longer than a first preset value, and/or the size of the queue cache data is judged to be larger than a second preset value, determining that the distribution server is in a blocking state.
Optionally, the matching module is configured to:
receiving a switching request sent by the terminal, and determining that the service state of the terminal is a switching request sending state;
and when monitoring that the data in the cache queue is smaller than a third preset value within a preset time period, the terminal sends a switching request sent by the terminal to the server monitoring platform.
Optionally, the matching module is further configured to:
and under the condition that the distribution server before switching is connected with the terminal, the terminal receives the first I-frame video frame sent by the distribution server after switching and controls the terminal to disconnect the distribution server before switching.
Optionally, the distribution server is connected with a plurality of terminals through websockets.
It should be noted that the respective implementable modes in the present embodiment may be implemented individually, or may be implemented in combination in any combination without conflict, and the present application is not limited thereto.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
The data transmission device provided by the embodiment of the invention is applied to a server monitoring platform, the server monitoring platform is connected with a plurality of distribution servers, and the distribution servers are connected with a plurality of terminals, and the method comprises the following steps: acquiring service parameters of a plurality of distribution servers and service states of terminals; the service parameter is used for judging whether the distribution server is blocked or not, and the service state of the terminal is used for judging whether the terminal sends a switching sending request or not; in the embodiment of the invention, when concurrent terminals send watching monitoring requests to a server monitoring platform, the server monitoring platform acquires the service parameters of each distribution server connected with the server monitoring platform and the service state of the terminal, and selects a more optimal distribution server to perform dynamic switching under the condition that a switching request is sent to the server monitoring platform when the distribution server is detected to be blocked and/or the terminal plays cache data in a player continuously in short or nearly in short, so that the terminal realizes uninterrupted and smooth playing of pictures.
Still another embodiment of the present invention provides a terminal device, configured to execute the data transmission method provided in the foregoing embodiment.
Fig. 6 is a schematic structural diagram of a terminal device of the present invention, and as shown in fig. 6, the terminal device includes: at least one processor 601 and memory 602;
the memory stores a computer program; at least one processor executes the computer program stored in the memory to implement the data transmission method provided by the above-described embodiments.
The terminal device provided by the embodiment is applied to a server monitoring platform, the server monitoring platform is connected with a plurality of distribution servers, and the distribution servers are connected with a plurality of terminals, and the method comprises the following steps: acquiring service parameters of a plurality of distribution servers and service states of terminals; the service parameter is used for judging whether the distribution server is blocked or not, and the service state of the terminal is used for judging whether the terminal sends a switching sending request or not; in the embodiment of the invention, when concurrent terminals send watching monitoring requests to a server monitoring platform, the server monitoring platform acquires the service parameters of each distribution server connected with the server monitoring platform and the service state of the terminal, and selects a more optimal distribution server to perform dynamic switching under the condition that a switching request is sent to the server monitoring platform when the distribution server is detected to be blocked and/or the terminal plays cache data in a player continuously in short or nearly in short, so that the terminal realizes uninterrupted and smooth playing of pictures.
Yet another embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed, the data transmission method provided in any one of the above embodiments is implemented.
The computer-readable storage medium according to this embodiment is applied to a server monitoring platform, the server monitoring platform is connected to a plurality of distribution servers, and the distribution servers are connected to a plurality of terminals, the method including: acquiring service parameters of a plurality of distribution servers and service states of terminals; the service parameter is used for judging whether the distribution server is blocked or not, and the service state of the terminal is used for judging whether the terminal sends a switching sending request or not; in the embodiment of the invention, when concurrent terminals send watching monitoring requests to a server monitoring platform, the server monitoring platform acquires the service parameters of each distribution server connected with the server monitoring platform and the service state of the terminal, and selects a more optimal distribution server to perform dynamic switching under the condition that a switching request is sent to the server monitoring platform when the distribution server is detected to be blocked and/or the terminal plays cache data in a player continuously in short or nearly in short, so that the terminal realizes uninterrupted and smooth playing of pictures.
The embodiments in the present specification are all described in a progressive manner, and each embodiment focuses on differences from other embodiments, and portions that are the same and similar between the embodiments may be referred to each other.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Embodiments of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, electronic devices (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing electronic device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing electronic device, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing electronic device to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing electronic device to cause a series of operational steps to be performed on the computer or other programmable electronic device to produce a computer implemented process such that the instructions which execute on the computer or other programmable electronic device provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the embodiments of the invention.
Finally, it should also be noted that, in this document, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or electronic device that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or electronic device. Without further limitation, an element defined by the phrases "comprising a component of' 8230; \8230;" does not exclude the presence of additional like elements in the process, method, article, or electronic device in which the element is included.
The data transmission method and the data transmission device provided by the invention are described in detail, and the principle and the implementation mode of the invention are explained by applying specific examples, and the description of the embodiments is only used for helping to understand the method and the core idea of the invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (10)

1. A data transmission method is applied to a server monitoring platform, the server monitoring platform is connected with a plurality of distribution servers, and the distribution servers are connected with a plurality of terminals, and the method comprises the following steps:
acquiring service parameters of a plurality of distribution servers and service states of terminals; the service parameter is used for judging whether the distribution server is blocked or not, and the service state of the terminal is used for judging whether the terminal sends a switching sending request or not;
and matching the distribution server with the terminal according to the service parameters of the distribution server and the service state of the terminal so as to enable the distribution server and the terminal to transmit service data.
2. The method of claim 1, wherein after the distribution server and the terminal are matched for service data transmission, the method further comprises:
when the matched distribution server is blocked and/or the service state of the terminal is a switching request sending state, switching the matched distribution server;
determining whether the distribution server is blocked or not according to the service parameters of the distribution server; and determining whether the service state of the terminal is a switching request sending state or not according to the service state of the terminal.
3. The method of claim 2, wherein the switching the matched distribution server comprises:
switching the blocked distribution server to an idle distribution server according to a preset distribution server list;
the preset distribution server list at least comprises a distribution server name and a service state of a distribution server corresponding to the distribution server name, and the service state at least comprises blocking or idle.
4. The method according to claim 2, wherein the service parameters at least include time consumed for sending a data packet and/or queue buffer data size, and the determining whether the distribution server is blocked according to the service parameters of the distribution server includes:
and if the time consumed for sending the data packet in the service parameters of the distribution server is judged to be longer than a first preset value, and/or the size of the queue cache data is judged to be larger than a second preset value, determining that the distribution server is in a blocking state.
5. The method according to claim 2, wherein the determining the service status of the terminal as the state of sending the handover request according to the service status of the terminal comprises:
the server monitoring platform receives a switching request sent by the terminal and determines that the service state of the terminal is a switching request sending state;
and when monitoring that the data in the cache queue is smaller than a third preset value within a preset time period, the terminal sends a switching request sent by the terminal to the server monitoring platform.
6. The method of claim 5, further comprising:
and under the condition that the distribution server is connected with the terminal, when the terminal receives the first I-frame video frame sent by the distribution server after switching, the terminal is controlled to disconnect the distribution server before switching.
7. The method of claim 1, wherein the distribution server is coupled to a plurality of terminals via a websocket.
8. A data transmission apparatus, applied to a server monitoring platform, wherein the server monitoring platform is connected to a plurality of distribution servers, and the distribution servers are connected to a plurality of terminals, the apparatus comprising:
the acquisition module is used for acquiring the service parameters of the plurality of distribution servers and the service state of the terminal; the service parameter is used for judging whether the distribution server is blocked or not, and the service state of the terminal is used for judging whether the terminal sends a switching sending request or not;
and the matching module is used for matching the distribution server with the terminal according to the service parameters of the distribution server and the service state of the terminal so as to enable the distribution server and the terminal to transmit service data.
9. A terminal device, comprising: at least one processor and a memory;
the memory stores a computer program; the at least one processor executes the computer program stored by the memory to implement the data transfer method of any of claims 1-7.
10. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when executed, implements the data transmission method of any one of claims 1-7.
CN202210830640.XA 2022-07-15 2022-07-15 Data transmission method, device, terminal equipment and storage medium Pending CN115334068A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210830640.XA CN115334068A (en) 2022-07-15 2022-07-15 Data transmission method, device, terminal equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210830640.XA CN115334068A (en) 2022-07-15 2022-07-15 Data transmission method, device, terminal equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115334068A true CN115334068A (en) 2022-11-11

Family

ID=83916854

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210830640.XA Pending CN115334068A (en) 2022-07-15 2022-07-15 Data transmission method, device, terminal equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115334068A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116974722A (en) * 2023-07-18 2023-10-31 广东南方智媒科技有限公司 AI service calling method, device and system for media service

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116974722A (en) * 2023-07-18 2023-10-31 广东南方智媒科技有限公司 AI service calling method, device and system for media service
CN116974722B (en) * 2023-07-18 2024-04-05 广东南方智媒科技有限公司 AI service calling method, device and system for media service

Similar Documents

Publication Publication Date Title
KR100898210B1 (en) Method and apparatus for transferring digital signal and changing received streaming content channels, and computer readable medium
US9608921B2 (en) Dynamic bit rate scaling
US7974200B2 (en) Transmitting and receiving real-time data
US6292834B1 (en) Dynamic bandwidth selection for efficient transmission of multimedia streams in a computer network
JP5442766B2 (en) Multimedia stream access delivery changes supported by the service layer
KR101178853B1 (en) Method and apparatus for reducing channel change response times for internet protocol television
EP2974207B1 (en) Playback stall avoidance in adaptive media streaming
US10003830B1 (en) Controller to manage streaming video of playback devices
US8813160B2 (en) Method, system and user device for obtaining a key frame in a streaming media service
WO2012033766A1 (en) Method and apparatus for adaptive bit rate switching
CN102547449A (en) Method, set-top box and media server of control terminal buffer media stream data
CA2275058A1 (en) Method of discrete interactive multimedia list broadcasting
KR20160086854A (en) Method for distributing available bandwidth of a network amongst ongoing traffic sessions run by devices of the network, corresponding device
US11863841B2 (en) Video playing control method and system
CN111083536B (en) Method and device for adjusting video code rate
EP1879353B1 (en) Contents distribution system, contents distribution server, contents reproduction terminal, and contents distribution method
JP2008277961A (en) On-demand data distribution system
CN110933470B (en) Video data sharing method
CN115334068A (en) Data transmission method, device, terminal equipment and storage medium
CN102148806A (en) Time shift processing method and system, network equipment and terminal for network television
JP4917497B2 (en) Video distribution device, distribution video switching method, distribution video switching program, and distribution video switching program recording medium
CN115348409A (en) Video data processing method and device, terminal equipment and storage medium
JP2009170985A (en) On-demand data distribution system
CN101552684B (en) Method, device and system for controlling real time streaming media protocol conversation state
CN114070827B (en) Transmission method, equipment and medium for forwarding and pushing stream data

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