CN111726679B - Video playing method, device, equipment and medium - Google Patents

Video playing method, device, equipment and medium Download PDF

Info

Publication number
CN111726679B
CN111726679B CN202010540119.3A CN202010540119A CN111726679B CN 111726679 B CN111726679 B CN 111726679B CN 202010540119 A CN202010540119 A CN 202010540119A CN 111726679 B CN111726679 B CN 111726679B
Authority
CN
China
Prior art keywords
bandwidth
address
target gateway
smart television
gateway
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
CN202010540119.3A
Other languages
Chinese (zh)
Other versions
CN111726679A (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.)
Hisense Visual Technology Co Ltd
Original Assignee
Hisense Visual 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 Hisense Visual Technology Co Ltd filed Critical Hisense Visual Technology Co Ltd
Priority to CN202010540119.3A priority Critical patent/CN111726679B/en
Publication of CN111726679A publication Critical patent/CN111726679A/en
Application granted granted Critical
Publication of CN111726679B publication Critical patent/CN111726679B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/436Interfacing a local distribution network, e.g. communicating with another STB or one or more peripheral devices inside the home
    • H04N21/43615Interfacing a Home Network, e.g. for connecting the client to a plurality of peripherals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/442Monitoring of processes or resources, e.g. detecting the failure of a recording device, monitoring the downstream bandwidth, the number of times a movie has been viewed, the storage space available from the internal hard disk
    • H04N21/44209Monitoring of downstream path of the transmission network originating from a server, e.g. bandwidth variations of a wireless network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/60Network structure or processes for video distribution between server and client or between remote clients; Control signalling between clients, server and network components; Transmission of management data between server and client, e.g. sending from server to client commands for recording incoming content stream; Communication details between server and client 
    • H04N21/63Control signaling related to video distribution between client, server and network components; Network processes for video distribution between server and clients or between remote clients, e.g. transmitting basic layer and enhancement layers over different transmission paths, setting up a peer-to-peer communication via Internet between remote STB's; Communication protocols; Addressing
    • H04N21/64Addressing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/60Network structure or processes for video distribution between server and client or between remote clients; Control signalling between clients, server and network components; Transmission of management data between server and client, e.g. sending from server to client commands for recording incoming content stream; Communication details between server and client 
    • H04N21/63Control signaling related to video distribution between client, server and network components; Network processes for video distribution between server and clients or between remote clients, e.g. transmitting basic layer and enhancement layers over different transmission paths, setting up a peer-to-peer communication via Internet between remote STB's; Communication protocols; Addressing
    • H04N21/643Communication protocols
    • H04N21/64322IP
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/85Assembly of content; Generation of multimedia applications
    • H04N21/854Content authoring
    • H04N21/8543Content authoring using a description language, e.g. Multimedia and Hypermedia information coding Expert Group [MHEG], eXtensible Markup Language [XML]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/85Assembly of content; Generation of multimedia applications
    • H04N21/858Linking data to content, e.g. by linking an URL to a video object, by creating a hotspot
    • H04N21/8586Linking data to content, e.g. by linking an URL to a video object, by creating a hotspot by using a URL

Abstract

The invention discloses a video playing method, a video playing device, video playing equipment and a video playing medium. When monitoring that a video playing interface of the smart television is in a buffer state, the embodiment of the invention can acquire a first bandwidth and a first IP address corresponding to a first device with the largest bandwidth in the same local area network as the smart television, and send a first ARP request carrying a second IP address of a target gateway and a second MAC address of the smart television to the first device, so that the first device can send a data packet to the smart television, and after receiving the data packet sent by the first device, the smart television can send a second ARP request carrying the first IP address and the second MAC address to the target gateway, and further send the data packet to the target gateway with a second bandwidth smaller than the first bandwidth, thereby shortening the time of the video playing interface in the buffer state to a certain extent and improving user experience.

Description

Video playing method, device, equipment and medium
Technical Field
The present invention relates to the field of video playing technologies, and in particular, to a video playing method, apparatus, device, and medium.
Background
Fig. 1 is a schematic diagram of a current home lan network layout provided in the prior art, as shown in fig. 1, the home lan includes: the router, that is, the gateway serves as a control center of a home local area network (lan) network, and has functions of access network dialing, Dynamic Host Configuration Protocol (DHCP) delivery, network resource forwarding, receiving a bandwidth input by a user in a gateway management website for a device connected to the gateway, and controlling a bandwidth occupied by the device in the lan.
After the devices in the local area network, such as intelligent network devices such as an intelligent television, a mobile phone, a PC, etc., are connected with the gateway, the network resources can be accessed, and the sum of the bandwidths occupied by all the devices in the local area network is fixed.
If the bandwidth occupied by other devices in the same local area network as the smart television is large, for example, the other devices download the P2P connection mode and update network resources for a long time, the smart television will occupy a small bandwidth, and the video playing interface in the smart television may be in a buffer state for a long time, which greatly reduces the user viewing experience.
Disclosure of Invention
The embodiment of the invention provides a video playing method, a video playing device, video playing equipment and a video playing medium, which are used for solving the problems that a video playing interface is in a buffer state for a long time and user experience is low when the existing intelligent television plays videos.
One aspect of the present invention provides a video playing method, where the method is applied to a smart television, and the method includes:
if the video playing interface of the smart television is monitored to be in a buffer state, acquiring a first bandwidth and a first IP address corresponding to a first device with the maximum bandwidth in the same local area network as the smart television;
sending a first ARP request carrying a second IP address of a target gateway and a second MAC address of the intelligent television to the first equipment, wherein the target gateway and the intelligent television are in the same local area network;
sending a second ARP request carrying the first IP address and the second MAC address to the target gateway;
and if a data packet sent by the first equipment is received, determining a second bandwidth smaller than the first bandwidth, and sending the data packet to the target gateway by using the second bandwidth.
Further, the determining a second bandwidth that is smaller than the first bandwidth comprises:
determining a third bandwidth currently occupied by the smart television;
and determining the second bandwidth according to the ratio of the third bandwidth to the first bandwidth and the first bandwidth.
Further, the acquiring a first bandwidth and a first IP address corresponding to a first device with a maximum bandwidth in the same local area network as the smart television includes:
acquiring the corresponding relation between the bandwidth and the IP address of each device connected with the target gateway from a management website of the gateway;
determining a first bandwidth with the maximum bandwidth, and determining an IP address corresponding to the first bandwidth as a first IP address.
Further, the obtaining the corresponding relationship between the bandwidth and the IP address of each device connected to the target gateway includes:
acquiring the IP address of each device stored in the target gateway;
and sending an ARP request to equipment corresponding to the IP address according to each obtained IP address, if an ARP response returned by the equipment corresponding to the IP address is received, determining that the equipment corresponding to the IP address is equipment connected with the target gateway, and obtaining the corresponding relation between the IP address and the bandwidth stored in the target gateway.
Further, the method further comprises:
if the video playing interface of the intelligent television is monitored to be in a buffer ending state, sending a third ARP request carrying a second IP address of the target gateway and a third MAC address of the target gateway to the first equipment; and sending a fourth ARP request carrying the first IP address and the first MAC address of the first device to the target gateway.
Further, before determining the first bandwidth with the largest bandwidth, the method further includes:
determining a fourth bandwidth corresponding to the smart television acquired from a management website of a gateway; acquiring a fifth bandwidth stored in a data node of the smart television;
and if the difference value between the fourth bandwidth and the fifth bandwidth is smaller than a set threshold value, performing the subsequent step of determining the first bandwidth with the maximum bandwidth.
Still another aspect of the present invention provides a video playing apparatus, which is applied to a smart tv, and includes:
the device comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring a first bandwidth and a first IP address corresponding to a first device with the largest bandwidth, which is positioned in the same local area network with the intelligent television, if the video playing interface of the intelligent television is monitored to be in a buffer state;
the first sending module is used for sending a first ARP request carrying a second IP address of a target gateway and a second MAC address of the intelligent television to the first equipment, and the target gateway and the intelligent television are in the same local area network;
a second sending module, configured to send a second ARP request carrying the first IP address and the second MAC address to the target gateway;
and a third sending module, configured to determine, if a data packet sent by the first device is received, a second bandwidth smaller than the first bandwidth, and send the data packet to the target gateway with the second bandwidth.
Further, the third sending module is specifically configured to determine a third bandwidth currently occupied by the smart television; and determining the second bandwidth according to the ratio of the third bandwidth to the first bandwidth and the first bandwidth.
Further, the obtaining module is specifically configured to obtain, from a management website of a gateway, a correspondence between a bandwidth and an IP address of each device connected to the target gateway; determining a first bandwidth with the maximum bandwidth, and determining an IP address corresponding to the first bandwidth as a first IP address.
Further, the obtaining module is specifically configured to obtain an IP address of each device stored in the target gateway; and sending an ARP request to equipment corresponding to the IP address according to each obtained IP address, if an ARP response returned by the equipment corresponding to the IP address is received, determining that the equipment corresponding to the IP address is equipment connected with the target gateway, and obtaining the corresponding relation between the IP address and the bandwidth stored in the target gateway.
Further, the apparatus further comprises:
the fourth sending module is used for sending a third ARP request carrying the second IP address of the target gateway and the third MAC address of the target gateway to the first equipment if the video playing interface of the smart television is monitored to be in a buffer state; and sending a fourth ARP request carrying the first IP address and the first MAC address of the first device to the target gateway.
Further, the apparatus further comprises:
the verification module is used for determining a fourth bandwidth corresponding to the intelligent television acquired from a management website of the gateway before the first bandwidth with the maximum bandwidth is determined; acquiring a fifth bandwidth stored in a data node of the smart television; and if the difference value between the fourth bandwidth and the fifth bandwidth is smaller than a set threshold value, performing the subsequent step of determining the first bandwidth with the maximum bandwidth.
A further aspect of the present invention provides an electronic device, which at least includes a processor and a memory, wherein the processor is configured to implement the steps of any of the video playing methods described above when executing a computer program stored in the memory.
Yet another aspect of the present invention provides a computer-readable storage medium, which stores a computer program, and the computer program, when executed by a processor, implements the steps of any of the video playing methods described above.
When monitoring that a video playing interface of the smart television is in a buffer state, the embodiment of the invention can acquire a first bandwidth and a first IP address corresponding to a first device with the largest bandwidth in the same local area network as the smart television, and send a first ARP request carrying a second IP address of a target gateway and a second MAC address of the smart television to the first device, so that the first device can send a data packet to the smart television, after receiving the data packet sent by the first device, the smart television can send a second ARP request carrying the first IP address and the second MAC address to the target gateway, and further send the data packet to the target gateway with a second bandwidth smaller than the first bandwidth, so that the first bandwidth occupied by the first device can be reduced by adding the first bandwidth occupied by the first device and the bandwidth occupied by the smart television under the condition that the sum of the first bandwidth occupied by the first device and the bandwidth occupied by the smart television is fixed, the bandwidth occupied by the intelligent television is improved to a certain extent, so that the time of the video playing interface in a buffer state can be shortened to a certain extent, and the user experience is improved.
Drawings
Fig. 1 is a schematic diagram of a current home lan network topology provided in the prior art;
fig. 2 is a schematic diagram of a first video playing process according to an embodiment of the present invention;
fig. 3 is a schematic diagram of a home lan network layout according to an embodiment of the present invention;
fig. 4 is a schematic diagram of a data packet sending process according to an embodiment of the present invention;
fig. 5 is a schematic diagram illustrating a process of acquiring a correspondence between a bandwidth and an IP address of each device connected to a target gateway and transmitting a data packet according to an embodiment of the present invention;
fig. 6 is a schematic diagram of a process of acquiring a corresponding relationship between a bandwidth and an IP address of each device connected to a target gateway according to an embodiment of the present invention;
fig. 7 is a schematic diagram of another process for acquiring a corresponding relationship between a bandwidth and an IP address of each device connected to a target gateway according to an embodiment of the present invention;
fig. 8 is a schematic diagram of a second video playing process according to an embodiment of the present invention;
fig. 9 is a schematic view of a video playing apparatus according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the present invention will be described in further detail with reference to the accompanying drawings, and it is apparent that the described embodiments are only a part of the embodiments of the present invention, not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In order to shorten the time of a video playing interface in a buffer state and improve user experience, embodiments of the present invention provide a video playing method, apparatus, device, and medium.
Example 1:
fig. 2 is a schematic diagram of a first video playing process provided in an embodiment of the present invention, where the process includes the following steps:
s201: if the video playing interface of the intelligent television is monitored to be in a buffer state, a first bandwidth and a first IP address corresponding to a first device with the largest bandwidth, which is located in the same local area network, of the intelligent television are obtained.
The video playing method provided by the embodiment of the invention is applied to the smart television. In a possible implementation manner, if the video playing interface of the smart tv is in a buffering state, a buffering event (mediaplayer _ buffer) may be triggered, and after a service unit (network speed monitor _ Server) in the smart tv monitors the buffering event, it may be determined that the video playing interface of the smart tv is in the buffering state.
Because different devices in the same lan share a total bandwidth, if one of the devices occupies a larger bandwidth, the bandwidth occupied by other devices in the same lan will tend to decrease. When the video playing interface of the smart television is in a buffer state, the bandwidth occupied by the smart television can be considered to be less. In order to shorten the time that the video playing interface is in the buffer state, the smart television can obtain a first bandwidth and a first IP address corresponding to a first device with the largest bandwidth currently in the same local area network as the smart television.
When the first bandwidth and the first IP address corresponding to the first device are obtained, the first bandwidth and the first IP address corresponding to the first device with the largest current bandwidth may be determined according to the correspondence relationship between the bandwidths and the IP addresses of the multiple devices connected to the target gateway, which are stored in the target gateway in the same local area network as the smart television. In a possible implementation, if the correspondence between the network speeds and the IP addresses of the multiple devices is stored in the target gateway, the network speeds can be converted into bandwidths by using the prior art.
S202: and sending a first ARP request carrying a second IP address of a target gateway and a second MAC address of the intelligent television to the first equipment, wherein the target gateway and the intelligent television are in the same local area network.
Each device has its own IP address and dedicated MAC address, and when performing network communication, the peer device can be identified by the IP address at the network layer in the network protocol, and during the transmission of data packets at the data link layer in the network protocol, the peer device can be identified by the MAC address.
After the first device with the largest current bandwidth is obtained, in order to reduce the bandwidth occupied by the first device, a first ARP request carrying a second IP address of the target gateway and a second MAC address of the smart television may be sent to the first device. After receiving the first ARP request, the first device may store the second IP address and the second MAC address in the first ARP request in a first ARP cache table of the first device in order to respond to subsequent messages. At this time, the first device considers that the first ARP request is sent by the target gateway, and considers that the IP address and the MAC address of the target gateway are the second IP address and the second MAC address, respectively.
And the first equipment sends the data packet to the equipment with the second MAC address according to the corresponding relation between the second IP address and the second MAC address stored in the first ARP cache table, and at the moment, the first equipment sends the data packet which is supposed to be sent to the target gateway to the intelligent television according to the first ARP cache table because the second MAC address is the MAC address of the intelligent television.
S203: and sending a second ARP request carrying the first IP address and the second MAC address to the target gateway.
In order to enable the target gateway to consider the data packet as the data packet sent by the first device and to receive the data packet replied by the target gateway when the data packet sent by the first device is received and forwarded to the target gateway, the smart television may send a second ARP request carrying a first IP address of the first device and a second MAC address of the smart television to the target gateway.
After receiving the second ARP request, the target gateway may store the first IP address and the second MAC address in the second ARP request in a second ARP cache table of the target gateway in order to respond to subsequent messages. At this time, the target gateway considers that the second ARP request is sent by the first device, and considers that the IP address and the MAC address of the first device are the first IP address and the second MAC address, respectively.
And the target gateway sends the data packet to the equipment with the second MAC address according to the corresponding relation between the first IP address and the second MAC address stored in the second ARP cache table, and the second MAC address is the MAC address of the intelligent television, so that the target gateway sends the data packet which is supposed to be sent to the first equipment to the intelligent television according to the second ARP cache table.
S204: and if a data packet sent by the first equipment is received, determining a second bandwidth smaller than the first bandwidth, and sending the data packet to the target gateway by using the second bandwidth.
If the smart television receives the data packet, the data packet can be analyzed, whether the IP address carried in the data packet is the first IP address of the first device or not is judged, and if yes, the received data packet can be considered to be sent by the first device. For example, the data packet sent by the first device may be a Transmission Control Protocol (TCP) data packet, and a listening unit (socket) in the smart tv may listen whether an 8080 port of the smart tv receives the TCP data packet. If the data packet sent by the first device is received, the data packet can be forwarded to the target gateway so as to maintain network communication between the first device and the target gateway.
Because the first bandwidth occupied by the first device is larger at this moment, in order to improve the bandwidth occupied by the smart television, because the first device and the smart television are both in the same local area network, the sum of the first bandwidth occupied by the first device and the bandwidth occupied by the smart television is fixed, and if the first bandwidth occupied by the first device is reduced, the bandwidth occupied by the smart television can be correspondingly improved.
Therefore, after the smart television receives the data packet sent by the first device, in order to reduce the first bandwidth occupied by the first device, the data packet may be sent by using a second bandwidth smaller than the first bandwidth, and at this time, when the smart television sends the data packet by using the second bandwidth smaller than the first bandwidth, because the data packet is of the first device, it may be considered that the first bandwidth occupied by the first device is reduced, and the sum of the first bandwidth occupied by the first device and the bandwidth occupied by the smart television is fixed, so the bandwidth occupied by the smart television may be correspondingly increased.
It should be noted that the steps included in the video playing process are only an example, and the sequence between S202 and S203 is not limited in the embodiment of the present invention, that is, the sequence between the two steps is not limited, that is, the first ARP request carrying the second IP address of the target gateway and the second MAC address of the smart television is first sent to the first device, or the second ARP request carrying the first IP address and the second MAC address is first sent to the target gateway. Generally, in order to improve efficiency, the two steps S202 and S203 may be performed simultaneously.
Fig. 3 is a schematic diagram of a home lan network layout according to an embodiment of the present invention, as shown in fig. 3, after devices in the lan, such as an intelligent network device such as an intelligent Television (TV), a mobile phone, and a PC, are connected to a gateway, the devices may access network resources, the intelligent television may enable a first device corresponding to a first bandwidth to send a data packet to the intelligent television, and the intelligent television forwards the data packet sent by the first device to a target gateway with a second bandwidth smaller than the first bandwidth.
Specifically, when determining the second bandwidth smaller than the first bandwidth, the embodiment of the present invention does not specifically limit the specific values of the first bandwidth and the second bandwidth, and can flexibly select the second bandwidth according to the requirement. The first bandwidth may be multiplied by a factor less than 1, for example, to determine a second bandwidth that is smaller than the first bandwidth.
When monitoring that a video playing interface of the smart television is in a buffer state, the embodiment of the invention can acquire a first bandwidth and a first IP address corresponding to a first device with the largest bandwidth in the same local area network as the smart television, and send a first ARP request carrying a second IP address of a target gateway and a second MAC address of the smart television to the first device, so that the first device can send a data packet to the smart television, after receiving the data packet sent by the first device, the smart television can send a second ARP request carrying the first IP address and the second MAC address to the target gateway, and further send the data packet to the target gateway with a second bandwidth smaller than the first bandwidth, so that the first bandwidth occupied by the first device can be reduced by adding the first bandwidth occupied by the first device and the bandwidth occupied by the smart television under the condition that the sum of the first bandwidth occupied by the first device and the bandwidth occupied by the smart television is fixed, the bandwidth occupied by the intelligent television is improved to a certain extent, so that the time of the video playing interface in a buffer state can be shortened to a certain extent, and the user experience is improved.
Example 2:
in order to determine the second bandwidth for transmitting the data packet, on the basis of the foregoing embodiment, in an embodiment of the present invention, the determining the second bandwidth smaller than the first bandwidth includes:
determining a third bandwidth currently occupied by the smart television;
and determining the second bandwidth according to the ratio of the third bandwidth to the first bandwidth and the first bandwidth.
In order to increase the bandwidth occupied by the smart tv, the bandwidth occupied by the first device may be reduced, in one possible implementation, as long as the bandwidth occupied by the first device is smaller than the first bandwidth. Because the first device and the smart television are both in the same local area network, and the sum of the bandwidth occupied by the first device and the bandwidth occupied by the smart television is fixed, if the bandwidth occupied by the first device is reduced, the bandwidth occupied by the smart television can be correspondingly increased.
When the second bandwidth occupied by the first device is determined, the bandwidth occupied by the first device can be appropriately reduced according to the relation between the third bandwidth currently occupied by the smart television and the first bandwidth currently occupied by the first device.
Specifically, the third bandwidth currently occupied by the smart television may be determined first, and when the third bandwidth currently occupied by the smart television is determined, the third bandwidth currently occupied by the smart television may be determined according to the bandwidth of the smart television stored in the target gateway in the same local area network as the smart television.
In addition, when the third bandwidth currently occupied by the smart television is determined, the third bandwidth currently occupied by the smart television can also be determined through a data node (/ proc/net/tx _ qtague/stats) in the smart television, that is, a bandwidth stored in a network card of the smart television. For example, the average value of the bandwidths stored in the data node may be used as the third bandwidth currently occupied by the smart television in the process of downloading (ThreadDown _ temporal) video files from the cloud resource by the smart television.
Illustratively, the smart television downloads a 500-megabyte video file from the cloud resource, and the data node stores a plurality of real-time bandwidths of the smart television in the whole process from the beginning to the end of downloading the video file. In order to accurately determine the third bandwidth currently occupied by the smart television, the average value of the plurality of real-time bandwidths of the smart television in the whole process from the beginning to the end of downloading the video file, which is stored in the data node, may be used as the third bandwidth currently occupied by the smart television.
After determining the third bandwidth currently occupied by the smart television, the ratio of the reduction of the first bandwidth may be determined according to a ratio of the third bandwidth currently occupied by the smart television to the first bandwidth of the first device. In a possible implementation manner, a ratio of the third bandwidth to the first bandwidth may be directly used as a reduction ratio of the first bandwidth, and after the reduction ratio of the first bandwidth is determined, a second bandwidth smaller than the first bandwidth may be determined according to the first bandwidth and the reduction ratio of the first bandwidth. Specifically, the product of the first bandwidth and the reduction ratio may be used as the second bandwidth.
After the bandwidth of the first device and the bandwidth of the smart television are reduced according to the reduction ratio, the bandwidth of the first device and the bandwidth of the smart television are interchanged, if the difference between the bandwidth of the first device and the bandwidth of the smart television is not large, the bandwidth of the first device is reduced by a small amount after the adjustment, and correspondingly, the bandwidth of the smart television is increased by a small amount, so that the adjustment effect may not be particularly good.
Therefore, in the embodiment of the present invention, the ratio of the third bandwidth to the first bandwidth may be determined, and then the ratio is divided by a positive number greater than 1 to determine the reduction ratio of the first bandwidth.
For example, the reduction ratio of the first bandwidth may be determined by the following formula:
ln=(BW/DS)/n,
where ln is a reduction ratio to the first bandwidth, BW is a third bandwidth currently occupied by the smart television, DS is the first bandwidth of the first device, and n is a positive number greater than 1, for example, n may be 10, 20, and the like.
After the second bandwidth is determined, the bandwidth of the 8080 port of the smart television can be set as the second bandwidth through an entity rate limiting unit (iptable), so that the data packet is sent to the target gateway through the 8080 port in the second bandwidth. Specifically, the iptable may set the bandwidth of the 8080 port by executing a program (iptables-a FORWARD-s "MSD-IP" -m limit-limit "ln"/s-j ACCEPT).
Fig. 4 is a schematic diagram of a data packet sending process according to an embodiment of the present invention, as shown in fig. 4:
s401: and the intelligent television receives the data packet and analyzes the data packet.
S402: and judging whether the IP address carried in the data packet is the first IP address of the first device, if so, performing the step S403, and if not, sending the data packet to the target gateway.
S403: and sending a second ARP request carrying the first IP address and the second MAC address to the target gateway.
S404: and determining a second bandwidth smaller than the first bandwidth, and sending the data packet to the target gateway at the second bandwidth.
Example 3:
in order to obtain a first bandwidth and a first IP address corresponding to a first device with a maximum bandwidth in the same local area network as an intelligent television, on the basis of the foregoing embodiments, in an embodiment of the present invention, the obtaining of the first bandwidth and the first IP address corresponding to the first device with the maximum bandwidth in the same local area network as the intelligent television includes:
acquiring the corresponding relation between the bandwidth and the IP address of each device connected with the target gateway from a management website of the gateway;
determining a first bandwidth with the maximum bandwidth, and determining an IP address corresponding to the first bandwidth as a first IP address.
At present, the gateway equipment provider does not provide the interface of the equipment information in the gateway to the terminal equipment provider, so the equipment information stored in the gateway cannot be acquired through the interface. However, since the device information stored in the gateway is stored in the management website of the gateway at the same time, in the embodiment of the present invention, the correspondence between the bandwidth and the IP address of each device connected to the target gateway can be acquired from the management website of the gateway.
In a possible implementation manner, the acquisition unit (Router _ Search _ Engine) in the smart television may acquire the corresponding relationship between the bandwidth and the IP address of each device connected to the target gateway from the management website of the gateway.
Specifically, after monitoring the buffering event, a service unit (network speed monitor _ Server) in the smart television triggers a control unit (TranDataNovService) in the smart television, so that the TranDataNovService controls the acquisition unit to acquire a corresponding relationship between a bandwidth and an IP address of each device connected to the target gateway from a management website of the gateway.
When acquiring the corresponding relationship between the bandwidth and the IP address of each device connected to the target gateway from the management website, an initial Uniform Resource Locator (URL) of the target gateway may be transmitted into a request library (request), where the initial URL of the target gateway is generally 192.168.0.1 or 192.168.1.1. The URL is parsed using a parsing library (beautilfsoup), thereby obtaining HyperText Markup Language (HTML) data information in a main page of a management website of the target gateway.
Then, the device information of each device connected with the target gateway is acquired by traversing the URL address in the sub-page (a-tag) of the management website of the target gateway, specifically, the acquired device information of each device at least includes a corresponding relationship between a bandwidth and an IP address, and may further include information such as an MAC address and a device ID.
In one possible implementation, in order to store the device information of each device connected to the target gateway, which is obtained from the management website, the Router _ Search _ Engine in the smart tv may store the device information of each device connected to the target gateway, which is obtained from the management website, as an extensible markup language (XML) file, and may store the device information as a Router _ date.
In a possible implementation manner, in order to verify the authenticity of the bandwidth of each device connected to the target gateway, which is obtained from the management website of the gateway, on the basis of the foregoing embodiments, in an embodiment of the present invention, before determining the first bandwidth with the largest bandwidth, the method further includes:
determining a fourth bandwidth corresponding to the smart television acquired from a management website of a gateway; acquiring a fifth bandwidth stored in a data node of the smart television;
and if the difference value between the fourth bandwidth and the fifth bandwidth is smaller than a set threshold value, performing the subsequent step of determining the first bandwidth with the maximum bandwidth.
The bandwidth stored in the data node of the smart television can be considered to be real, so that a fifth bandwidth stored in the data node of the smart television in the same time can be acquired, a fourth bandwidth corresponding to the smart television acquired from the management website of the gateway is determined, and the authenticity of the bandwidth of each device connected with the target gateway acquired from the management website of the gateway is checked by comparing whether the difference value between the fourth bandwidth and the fifth bandwidth is smaller than a set threshold value.
Specifically, after the corresponding relationship between the bandwidth and the IP address of each device connected to the target gateway is obtained from the management website of the gateway, the fourth bandwidth corresponding to the smart television can be determined according to the corresponding relationship between the IP address, and the bandwidth of the smart television. And acquiring a fifth bandwidth saved in a data node (/ proc/net/tx _ qtaguid/stats) of the intelligent television.
Comparing the sizes of the fourth bandwidth and the fifth bandwidth, and if the difference value between the fourth bandwidth and the fifth bandwidth is smaller than a set threshold value, determining that the bandwidth of each device connected with the target gateway, which is acquired from the management website of the gateway, is credible.
The specific value of the set threshold can be flexibly set according to the requirement, for example, the set threshold can be ± 3KB, ± 2KB, etc. In general, the difference between the fourth bandwidth corresponding to the smart television acquired from the management website of the gateway and the fifth bandwidth stored in the data node of the smart television is no more than ± 3KB, so the threshold value may be set to ± 3KB, and if the difference between the fourth bandwidth and the fifth bandwidth is no more than the threshold value, the bandwidth of each device connected to the target gateway acquired from the management website of the gateway is considered to be authentic. And then, according to the corresponding relation between the bandwidth and the IP address of each device connected with the target gateway, which is acquired from the management website of the gateway, the first bandwidth with the maximum bandwidth can be determined by comparing the bandwidth of each device connected with the target gateway. And then determining the IP address corresponding to the first bandwidth as the first IP address.
Fig. 5 is a schematic diagram of a process for acquiring a corresponding relationship between a bandwidth and an IP address of each device connected to a target gateway and sending a data packet according to an embodiment of the present invention, as shown in fig. 5:
s501: and transmitting the URL of the target gateway into a request library.
Where the URL of the gateway is typically 192.168.0.1 or 192.168.1.1.
S502: and analyzing the URL by using an analysis library so as to obtain HTML data information in the main page of the management website of the target gateway.
S503: the device information of each device connected with the target gateway and stored in the management website of the target gateway is acquired by traversing the URL address in the sub-page (a-tag) of the management website of the target gateway.
The acquired device information of each device at least includes a corresponding relationship between a bandwidth and an IP address.
S504: and judging whether the URL addresses in the subpages (a labels) of the management website of the target gateway are traversed completely, if so, performing S505, and if not, performing S502.
S505: and saving the device information of each device connected with the target gateway, which is acquired from the management website of the target gateway, as router _ date.
S506: xml determines the fourth bandwidth corresponding to the smart tv from the router _ date, and step S508 is performed.
S507: and acquiring a fifth bandwidth saved in a data node (/ proc/net/tx _ qtaguid/stats) of the intelligent television.
S508: and comparing whether the difference value of the fourth bandwidth and the fifth bandwidth is smaller than a set threshold value or not to determine whether the bandwidth of each device connected with the target gateway acquired from the management website of the gateway is credible or not.
If the difference between the fourth bandwidth and the fifth bandwidth is smaller than the set threshold, it may be determined that the bandwidth of each device connected to the target gateway, which is acquired from the management website of the gateway, is trusted. In general, the difference between the fourth bandwidth and the fifth bandwidth is smaller than a set threshold, that is, the bandwidth of each device connected to the target gateway, which is acquired from the management website of the gateway, is generally trusted.
In a possible implementation manner, if the difference value between the fourth bandwidth and the fifth bandwidth is not less than the set threshold, the bandwidth of each device connected to the target gateway, which is currently acquired from the management website of the gateway, is considered to be untrustworthy. The bandwidth of each device connected with the target gateway can be obtained from the management website of the gateway again, and a fourth bandwidth corresponding to the smart television obtained from the management website of the gateway is determined; meanwhile, a fifth bandwidth stored in a data node of the smart television is obtained again, whether the difference value between the fourth bandwidth and the fifth bandwidth is smaller than a set threshold value or not is compared again until the difference value between the fourth bandwidth and the fifth bandwidth is smaller than the set threshold value, so that the subsequent step of determining the first bandwidth with the maximum bandwidth is carried out under the condition that the bandwidth of each device connected with the target gateway and obtained from a management website of the gateway is guaranteed to be credible.
S509: if the difference value between the fourth bandwidth and the fifth bandwidth is smaller than the set threshold value, according to the corresponding relation between the bandwidth and the IP address of each device connected with the target gateway, which is obtained from the management website of the gateway, the first bandwidth with the maximum bandwidth is determined by comparing the bandwidth of each device connected with the target gateway, and the IP address corresponding to the first bandwidth is determined as the first IP address.
S510: and sending a first ARP request carrying a second IP address of the target gateway and a second MAC address of the intelligent television to the first equipment.
And the target gateway and the intelligent television are positioned in the same local area network.
S511: and if a data packet sent by the first equipment is received, sending a second ARP request carrying the first IP address and the second MAC address to the target gateway.
S512: and determining a second bandwidth smaller than the first bandwidth, and sending the data packet to the target gateway at the second bandwidth.
The description of the value shows that the steps included in the process of acquiring the corresponding relationship between the bandwidth and the IP address of each device connected to the target gateway are only an example, and the embodiment of the present invention does not limit the sequence between S501 to S506 and S507, that is, the sequence between the steps of acquiring the corresponding relationship between the bandwidth and the IP address of each device connected to the target gateway from the management gateway of the target gateway, and acquiring the fifth bandwidth stored in the data node of the smart television is not limited. In general, in order to verify the authenticity of the bandwidth of each device connected to the target gateway, which is obtained from the management gateway of the target gateway, in order to obtain the fourth bandwidth corresponding to the smart tv in the management website of the gateway and the fifth bandwidth stored in the data node of the smart tv at the same time, the steps S501-S506 and S507 may be performed simultaneously.
Example 4:
in order to quickly obtain the corresponding relationship between the bandwidth and the IP address of each device connected to the target gateway, on the basis of the above embodiments, in the embodiment of the present invention, the obtaining of the corresponding relationship between the bandwidth and the IP address of each device connected to the target gateway includes:
acquiring the IP address of each device stored in the target gateway;
and sending an ARP request to equipment corresponding to the IP address according to each obtained IP address, if an ARP response returned by the equipment corresponding to the IP address is received, determining that the equipment corresponding to the IP address is equipment connected with the target gateway, and obtaining the corresponding relation between the IP address and the bandwidth stored in the target gateway.
Since there is a lot of device information stored in the management site of the gateway, for example, in addition to the correspondence between the bandwidth and the IP address of each device connected to the target gateway and the device information such as the device ID and the MAC address, there are also a lot of other information that is not related to the gateway, it takes time and is prone to errors if the correspondence between the bandwidth and the IP address of each device connected to the target gateway is found from such complicated device information.
In order to quickly and accurately acquire the corresponding relation between the bandwidth and the IP address of each device connected with the target gateway, the IP address of each device connected with the target gateway can be determined firstly, and then the corresponding relation between the IP address and the bandwidth can be quickly acquired from a plurality of pieces of device information stored in the target gateway according to the IP address, so that the efficiency of acquiring the bandwidth is improved.
In a possible implementation manner, in order to obtain the correspondence between the bandwidth and the IP address of each device connected to the target gateway, the IP address of each device stored in the target gateway may be obtained first. Specifically, the IP address of each device stored in the target gateway may be obtained by using the prior art. For example, the smart television converts an IP address of the target gateway, which is acquired through a Dynamic Host Configuration Protocol (DHCP), into a binary system, and performs bitwise and operation with a corresponding subnet mask, thereby acquiring an IP address of each device stored in the target gateway.
And after the IP address of each device stored in the target gateway is obtained, determining which devices corresponding to the IP addresses stored in the target gateway are the devices currently connected with the target gateway. Specifically, in order to obtain the device currently connected to the target gateway, an ARP request may be sent to the device corresponding to the IP address for each obtained IP address, where the ARP request carries the IP address corresponding to the device. And determining whether the equipment is the equipment which is currently connected with the target gateway according to whether the equipment returns the corresponding ARP response. Specifically, if receiving an ARP reply returned by the device corresponding to the IP address, the device corresponding to the IP address may be considered to be the device currently connected to the target gateway. The IP address of the device may be saved as a further xml file, for example as an actual IP.
After the device connected with the target gateway is determined, in order to quickly and accurately obtain the corresponding relationship between the bandwidth and the IP address of each device connected with the target gateway, the bandwidth corresponding to the IP address stored in the target gateway can be obtained according to the determined IP address of the device connected with the target gateway, so that the corresponding relationship between the bandwidth and the IP address of each device connected with the target gateway stored in the target gateway can be quickly and accurately obtained.
Fig. 6 is a schematic diagram of a process of obtaining a corresponding relationship between a bandwidth and an IP address of each device connected to a target gateway according to an embodiment of the present invention, as shown in fig. 6:
s601: after the smart tv is turned on, a control unit (TranDataNovService) in the smart tv may monitor whether a networking broadcast (connectivity _ CHANGE) is received.
Wherein the TranDataNovService can be preset as a receiver of the networking broadcast so that the TranDataNovService can receive the networking broadcast.
S602: after receiving the networking broadcast, the TranDataNovService may consider that the smart tv has established a connection with the target gateway at this time, and may acquire the IP address of each device stored in the target gateway.
The IP address of each device stored in the target gateway may be obtained by using the prior art. For example, the smart television converts an IP address of the target gateway, which is acquired through a Dynamic Host Configuration Protocol (DHCP), into a binary system, and performs bitwise and operation with a corresponding subnet mask, thereby acquiring an IP address of each device stored in the target gateway.
S603: and sending an ARP request to the equipment corresponding to the IP address according to each acquired IP address, wherein the ARP request carries the IP address corresponding to the equipment. If receiving the ARP reply returned by the device corresponding to the IP address, the device corresponding to the IP address may be considered as the device currently connected to the target gateway.
Wherein the determined IP address of the device connected to the target gateway may be saved as actual _ IP.
S604: in order to quickly acquire the corresponding relationship between the bandwidth and the IP address of each device connected to the target gateway, the corresponding relationship between the bandwidth and the IP address of each device connected to the target gateway may be quickly acquired from the router _ date.
In a possible implementation, since the corresponding relationship between the bandwidth and the IP address of each device connected to the target gateway, which is acquired from the management website of the gateway, is saved as a router _ date.xml file, a router _ date.xml file needs to be created first, and a certain time is consumed in the process of creating a router _ date. xml file, and in order to shorten the time that the smart television is in a buffer state, after the connection between the intelligent television and the target gateway is established, the corresponding relation between the bandwidth and the IP address of each device connected with the target gateway is obtained once, a router _ date.xml file is created, the corresponding relation between the bandwidth and the IP address of each device connected with the target gateway is stored in the router _ date.xml file, therefore, when the smart television is in a buffer state and the corresponding relation between the bandwidth and the IP address of each device connected with the target gateway is obtained, the corresponding relation between the bandwidth and the IP address stored in the router _ date.
Fig. 7 is a schematic diagram of another process for acquiring a corresponding relationship between a bandwidth and an IP address of each device connected to a target gateway according to an embodiment of the present invention, as shown in fig. 7:
s701: after the smart tv is turned on, a control unit (TranDataNovService) in the smart tv may monitor whether a networking broadcast (connectivity _ CHANGE) is received.
S702: after receiving the networking broadcast, the TranDataNovService may consider that the smart tv has established a connection with the target gateway at this time, and may acquire the IP address of each device stored in the target gateway.
S703: and sending an ARP request to the equipment corresponding to the IP address according to each acquired IP address, wherein the ARP request carries the IP address corresponding to the equipment. If receiving the ARP reply returned by the device corresponding to the IP address, the device corresponding to the IP address may be considered as the device currently connected to the target gateway.
Wherein the determined IP address of the device connected to the target gateway may be saved as actual _ IP.
S704: and transmitting the URL of the target gateway into a request library.
Where the URL of the gateway is typically 192.168.0.1 or 192.168.1.1.
S705: and analyzing the URL by using an analysis library so as to obtain HTML data information in the main page of the management website of the target gateway.
S706: the device information of each device connected with the target gateway and stored in the management website of the target gateway is acquired by traversing the URL address in the sub-page (a-tag) of the management website of the target gateway.
The acquired device information of each device at least includes a corresponding relationship between a bandwidth and an IP address.
S707: and judging whether the URL addresses in the sub-pages (a tags) of the management website of the target gateway are all traversed, if so, performing S708, and if not, performing S705.
S708: and saving the device information of each device connected with the target gateway, which is acquired from the management website of the target gateway, as router _ date.
S709: and based on the IP address stored in actual _ ip.xml, quickly acquiring the corresponding relation between the bandwidth and the IP address of each device connected with the target gateway from router _ date.xml.
It should be noted that the steps included in the process of obtaining the corresponding relationship between the bandwidth and the IP address of each device connected to the target gateway are only an example, and the embodiment of the present invention does not limit the sequence between S702 to S703 and S704 to S708, that is, the sequence between two steps of determining the device connected to the target gateway first or obtaining the device information of each device connected to the target gateway from the management website of the target gateway first is not limited. Generally, the two steps S702 to S703 and S704 to S708 may be performed simultaneously for efficiency improvement.
Example 5:
in order to restore the network connection between the first device and the target gateway, on the basis of the foregoing embodiments, in an embodiment of the present invention, the method further includes:
if the video playing interface of the intelligent television is monitored to be in a buffer ending state, sending a third ARP request carrying a second IP address of the target gateway and a third MAC address of the target gateway to the first equipment; and sending a fourth ARP request carrying the first IP address and the first MAC address of the first device to the target gateway.
In a possible implementation manner, when the video playing interface of the smart television finishes the buffer state, a buffer ending event (mediaplayer _ buffer) may be triggered, and after a service unit (network speed monitor _ Server) in the smart television monitors the buffer ending event, it may be considered that the video playing interface of the smart television finishes the buffer state, and the bandwidth occupied by the smart television at this time is large, and the bandwidth of the first device may not be limited any more.
In a possible implementation manner, in order to recover the network connection between the first device and the target gateway, when it is monitored that the video playing interface of the smart television ends the buffer state, a third ARP request carrying a second IP address of the target gateway and a third MAC address of the target gateway may be sent to the first device, and after receiving the third ARP request, the first device may store the second IP address and the third MAC address in the third ARP request in a first ARP cache table of the first device in order to perform a response of a subsequent message. At this time, the first device considers that the third ARP request is sent by the target gateway, and considers that the IP address and the MAC address of the target gateway are the second IP address and the third MAC address, respectively.
The first device sends a data packet to the device with the third MAC address according to the corresponding relation between the second IP address and the third MAC address stored in the first ARP cache table, and the third MAC address is the MAC address of the target gateway.
Meanwhile, the smart television may further send a fourth ARP request carrying the first IP address of the first device and the first MAC address of the first device to the target gateway, and after receiving the fourth ARP request, the target gateway may store the first IP address and the first MAC address in the fourth ARP request in a second ARP cache table of the target gateway in order to perform a response to a subsequent message. At this time, the target gateway considers that the fourth ARP request is sent by the first device, and considers that the IP address and the MAC address of the first device are the first IP address and the first MAC address, respectively.
The target gateway sends a data packet to the device with the first MAC address according to the corresponding relation between the first IP address and the first MAC address stored in the second ARP cache table, and the first MAC address is the MAC address of the first device.
Fig. 8 is a schematic diagram of a second video playing process provided by the embodiment of the present invention, as shown in fig. 8:
s801: if the video playing interface of the intelligent television is monitored to be in a buffer state, a first bandwidth and a first IP address corresponding to a first device with the largest bandwidth, which is located in the same local area network, of the intelligent television are obtained.
S802: and sending a first ARP request carrying a second IP address of the target gateway and a second MAC address of the intelligent television to the first equipment, wherein the target gateway and the intelligent television are in the same local area network.
S803: and if a data packet sent by the first equipment is received, sending a second ARP request carrying the first IP address and the second MAC address to the target gateway.
S804: and determining a second bandwidth smaller than the first bandwidth, and sending the data packet to the target gateway at the second bandwidth.
S805: if the video playing interface of the smart television is monitored to be in a buffer state, sending a third ARP request carrying a second IP address of the target gateway and a third MAC address of the target gateway to the first equipment; and sending a fourth ARP request carrying the first IP address and the first MAC address of the first equipment to a target gateway.
Example 6:
fig. 9 is a schematic view of a video playing apparatus according to an embodiment of the present invention, and as shown in fig. 9, on the basis of the foregoing embodiments, the video playing apparatus according to an embodiment of the present invention includes:
the acquiring module 91 is configured to acquire a first bandwidth and a first IP address corresponding to a first device with a maximum bandwidth in the same local area network as the smart television if it is monitored that a video playing interface of the smart television is in a buffer state;
a first sending module 92, configured to send a first ARP request carrying a second IP address of a target gateway and a second MAC address of the smart television to the first device, where the target gateway and the smart television are in the same local area network;
a second sending module 93, configured to send a second ARP request carrying the first IP address and the second MAC address to the target gateway;
a third sending module 94, configured to determine, if a data packet sent by the first device is received, a second bandwidth smaller than the first bandwidth, and send the data packet to the target gateway with the second bandwidth.
In a possible implementation manner, the third sending module 94 is specifically configured to determine a third bandwidth currently occupied by the smart television; and determining the second bandwidth according to the ratio of the third bandwidth to the first bandwidth and the first bandwidth.
In a possible implementation manner, the obtaining module 91 is specifically configured to obtain, from a management website of a gateway, a corresponding relationship between a bandwidth and an IP address of each device connected to the target gateway; determining a first bandwidth with the maximum bandwidth, and determining an IP address corresponding to the first bandwidth as a first IP address.
In a possible implementation manner, the obtaining module 91 is specifically configured to obtain an IP address of each device stored in the target gateway; and sending an ARP request to equipment corresponding to the IP address according to each obtained IP address, if an ARP response returned by the equipment corresponding to the IP address is received, determining that the equipment corresponding to the IP address is equipment connected with the target gateway, and obtaining the corresponding relation between the IP address and the bandwidth stored in the target gateway.
In a possible embodiment, the apparatus further comprises:
the fourth sending module is used for sending a third ARP request carrying the second IP address of the target gateway and the third MAC address of the target gateway to the first equipment if the video playing interface of the smart television is monitored to be in a buffer state; and sending a fourth ARP request carrying the first IP address and the first MAC address of the first device to the target gateway.
In a possible embodiment, the apparatus further comprises:
the verification module is used for determining a fourth bandwidth corresponding to the intelligent television acquired from a management website of the gateway before the first bandwidth with the maximum bandwidth is determined; acquiring a fifth bandwidth stored in a data node of the smart television; and if the difference value between the fourth bandwidth and the fifth bandwidth is smaller than a set threshold value, performing the subsequent step of determining the first bandwidth with the maximum bandwidth.
When monitoring that a video playing interface of the smart television is in a buffer state, the embodiment of the invention can acquire a first bandwidth and a first IP address corresponding to a first device with the largest bandwidth in the same local area network as the smart television, and send a first ARP request carrying a second IP address of a target gateway and a second MAC address of the smart television to the first device, so that the first device can send a data packet to the smart television, after receiving the data packet sent by the first device, the smart television can send a second ARP request carrying the first IP address and the second MAC address to the target gateway, and further send the data packet to the target gateway with a second bandwidth smaller than the first bandwidth, so that the first bandwidth occupied by the first device can be reduced by adding the first bandwidth occupied by the first device and the bandwidth occupied by the smart television under the condition that the sum of the first bandwidth occupied by the first device and the bandwidth occupied by the smart television is fixed, the bandwidth occupied by the intelligent television is improved to a certain extent, so that the time of the video playing interface in a buffer state can be shortened to a certain extent, and the user experience is improved.
Example 7:
fig. 10 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, and on the basis of the foregoing embodiments, an embodiment of the present invention further provides an electronic device, as shown in fig. 10, including: the system comprises a processor 101, a communication interface 102, a memory 103 and a communication bus 104, wherein the processor 101, the communication interface 102 and the memory 103 are communicated with each other through the communication bus 104;
the memory 103 has stored therein a computer program which, when executed by the processor 101, causes the processor 101 to perform the steps of:
if the video playing interface of the smart television is monitored to be in a buffer state, acquiring a first bandwidth and a first IP address corresponding to a first device with the maximum bandwidth in the same local area network as the smart television;
sending a first ARP request carrying a second IP address of a target gateway and a second MAC address of the intelligent television to the first equipment, wherein the target gateway and the intelligent television are in the same local area network;
sending a second ARP request carrying the first IP address and the second MAC address to the target gateway;
and if a data packet sent by the first equipment is received, determining a second bandwidth smaller than the first bandwidth, and sending the data packet to the target gateway by using the second bandwidth.
In a possible implementation manner, the processor 101 is specifically configured to determine a third bandwidth currently occupied by the smart television;
and determining the second bandwidth according to the ratio of the third bandwidth to the first bandwidth and the first bandwidth.
In a possible implementation manner, the processor 101 is specifically configured to obtain, from a management website of a gateway, a correspondence between a bandwidth and an IP address of each device connected to the target gateway;
determining a first bandwidth with the maximum bandwidth, and determining an IP address corresponding to the first bandwidth as a first IP address.
In a possible implementation manner, the processor 101 is specifically configured to obtain an IP address of each device stored in the target gateway;
and sending an ARP request to equipment corresponding to the IP address according to each obtained IP address, if an ARP response returned by the equipment corresponding to the IP address is received, determining that the equipment corresponding to the IP address is equipment connected with the target gateway, and obtaining the corresponding relation between the IP address and the bandwidth stored in the target gateway.
In a possible implementation manner, the processor 101 is further configured to send a third ARP request carrying a second IP address of the target gateway and a third MAC address of the target gateway to the first device if it is monitored that the video playing interface of the smart television is in the end buffer state; and sending a fourth ARP request carrying the first IP address and the first MAC address of the first device to the target gateway.
In one possible implementation, the processor 101 is further configured to:
determining a fourth bandwidth corresponding to the smart television acquired from a management website of a gateway; acquiring a fifth bandwidth stored in a data node of the smart television;
and if the difference value between the fourth bandwidth and the fifth bandwidth is smaller than a set threshold value, performing the subsequent step of determining the first bandwidth with the maximum bandwidth.
Because the principle of the electronic device for solving the problems is similar to the video playing method, the implementation of the electronic device can refer to the implementation of the method, and repeated details are not repeated.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface 102 is used for communication between the above-described electronic device and other devices.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Alternatively, the memory may be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a central processing unit, a Network Processor (NP), and the like; but may also be a Digital instruction processor (DSP), an application specific integrated circuit, a field programmable gate array or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or the like.
When monitoring that a video playing interface of the smart television is in a buffer state, the embodiment of the invention can acquire a first bandwidth and a first IP address corresponding to a first device with the largest bandwidth in the same local area network as the smart television, and send a first ARP request carrying a second IP address of a target gateway and a second MAC address of the smart television to the first device, so that the first device can send a data packet to the smart television, after receiving the data packet sent by the first device, the smart television can send a second ARP request carrying the first IP address and the second MAC address to the target gateway, and further send the data packet to the target gateway with a second bandwidth smaller than the first bandwidth, so that the first bandwidth occupied by the first device can be reduced by adding the first bandwidth occupied by the first device and the bandwidth occupied by the smart television under the condition that the sum of the first bandwidth occupied by the first device and the bandwidth occupied by the smart television is fixed, the bandwidth occupied by the intelligent television is improved to a certain extent, so that the time of the video playing interface in a buffer state can be shortened to a certain extent, and the user experience is improved.
Example 8:
on the basis of the foregoing embodiments, an embodiment of the present invention provides a computer-readable storage medium, in which a computer program executable by an electronic device is stored, and when the program is run on the electronic device, the electronic device is caused to execute the following steps:
if the video playing interface of the smart television is monitored to be in a buffer state, acquiring a first bandwidth and a first IP address corresponding to a first device with the maximum bandwidth in the same local area network as the smart television;
sending a first ARP request carrying a second IP address of a target gateway and a second MAC address of the intelligent television to the first equipment, wherein the target gateway and the intelligent television are in the same local area network;
sending a second ARP request carrying the first IP address and the second MAC address to the target gateway;
and if a data packet sent by the first equipment is received, determining a second bandwidth smaller than the first bandwidth, and sending the data packet to the target gateway by using the second bandwidth.
In one possible embodiment, the determining the second bandwidth smaller than the first bandwidth includes:
determining a third bandwidth currently occupied by the smart television;
and determining the second bandwidth according to the ratio of the third bandwidth to the first bandwidth and the first bandwidth.
In a possible implementation manner, the obtaining a first bandwidth and a first IP address corresponding to a first device with a maximum bandwidth in the same local area network as the smart television includes:
acquiring the corresponding relation between the bandwidth and the IP address of each device connected with the target gateway from a management website of the gateway;
determining a first bandwidth with the maximum bandwidth, and determining an IP address corresponding to the first bandwidth as a first IP address.
In a possible implementation manner, the obtaining the correspondence between the bandwidth and the IP address of each device connected to the target gateway includes:
acquiring the IP address of each device stored in the target gateway;
and sending an ARP request to equipment corresponding to the IP address according to each obtained IP address, if an ARP response returned by the equipment corresponding to the IP address is received, determining that the equipment corresponding to the IP address is equipment connected with the target gateway, and obtaining the corresponding relation between the IP address and the bandwidth stored in the target gateway.
In one possible embodiment, the method further comprises:
if the video playing interface of the intelligent television is monitored to be in a buffer ending state, sending a third ARP request carrying a second IP address of the target gateway and a third MAC address of the target gateway to the first equipment; and sending a fourth ARP request carrying the first IP address and the first MAC address of the first device to the target gateway.
In a possible implementation, before determining the first bandwidth with the largest bandwidth, the method further includes:
determining a fourth bandwidth corresponding to the smart television acquired from a management website of a gateway; acquiring a fifth bandwidth stored in a data node of the smart television;
and if the difference value between the fourth bandwidth and the fifth bandwidth is smaller than a set threshold value, performing the subsequent step of determining the first bandwidth with the maximum bandwidth.
The computer readable storage medium may be any available medium or data storage device that can be accessed by a processor in an electronic device, including but not limited to magnetic memory such as floppy disks, hard disks, magnetic tape, magneto-optical disks (MOs), etc., optical memory such as CDs, DVDs, BDs, HVDs, etc., and semiconductor memory such as ROMs, EPROMs, EEPROMs, non-volatile memory (NAND FLASH), Solid State Disks (SSDs), etc.
When monitoring that a video playing interface of the smart television is in a buffer state, the embodiment of the invention can acquire a first bandwidth and a first IP address corresponding to a first device with the largest bandwidth in the same local area network as the smart television, and send a first ARP request carrying a second IP address of a target gateway and a second MAC address of the smart television to the first device, so that the first device can send a data packet to the smart television, after receiving the data packet sent by the first device, the smart television can send a second ARP request carrying the first IP address and the second MAC address to the target gateway, and further send the data packet to the target gateway with a second bandwidth smaller than the first bandwidth, so that the first bandwidth occupied by the first device can be reduced by adding the first bandwidth occupied by the first device and the bandwidth occupied by the smart television under the condition that the sum of the first bandwidth occupied by the first device and the bandwidth occupied by the smart television is fixed, the bandwidth occupied by the intelligent television is improved to a certain extent, so that the time of the video playing interface in a buffer state can be shortened to a certain extent, and the user experience is improved.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application 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.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to the application. 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 apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, 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 apparatus 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 apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.

Claims (10)

1. A video playing method is applied to a smart television and comprises the following steps:
if the video playing interface of the smart television is monitored to be in a buffer state, acquiring a first bandwidth and a first IP address corresponding to a first device with the maximum bandwidth in the same local area network as the smart television;
sending a first ARP request carrying a second IP address of a target gateway and a second MAC address of the intelligent television to the first equipment, and enabling the first equipment to store the second IP address and the second MAC address in the first ARP request in a first ARP cache table of the first equipment; the target gateway and the intelligent television are positioned in the same local area network;
sending a second ARP request carrying the first IP address and the second MAC address to the target gateway, so that the target gateway stores the first IP address and the second MAC address in the second ARP request in a second ARP cache table of the target gateway;
and if a data packet sent by the first equipment is received, determining a second bandwidth smaller than the first bandwidth, and sending the data packet to the target gateway by using the second bandwidth.
2. The method of claim 1, wherein determining the second bandwidth that is smaller than the first bandwidth comprises:
determining a third bandwidth currently occupied by the smart television;
and determining the second bandwidth according to the ratio of the third bandwidth to the first bandwidth and the first bandwidth.
3. The method of claim 1, wherein the obtaining the first bandwidth and the first IP address corresponding to the first device with the largest bandwidth in the same local area network as the smart tv comprises:
acquiring the corresponding relation between the bandwidth and the IP address of each device connected with the target gateway from a management website of the gateway;
determining a first bandwidth with the maximum bandwidth, and determining an IP address corresponding to the first bandwidth as a first IP address.
4. The method of claim 3, wherein obtaining the correspondence between the bandwidth and the IP address of each device connected to the target gateway comprises:
acquiring the IP address of each device stored in the target gateway;
and sending an ARP request to equipment corresponding to the IP address according to each obtained IP address, if an ARP response returned by the equipment corresponding to the IP address is received, determining that the equipment corresponding to the IP address is equipment connected with the target gateway, and obtaining the corresponding relation between the IP address and the bandwidth stored in the target gateway.
5. The method of claim 1, further comprising:
if the video playing interface of the intelligent television is monitored to be in a buffer ending state, sending a third ARP request carrying a second IP address of the target gateway and a third MAC address of the target gateway to the first equipment; and sending a fourth ARP request carrying the first IP address and the first MAC address of the first device to the target gateway.
6. The method of claim 3, wherein prior to determining the first bandwidth with the largest bandwidth, the method further comprises:
determining a fourth bandwidth corresponding to the smart television acquired from a management website of a gateway; acquiring a fifth bandwidth stored in a data node of the smart television;
and if the difference value between the fourth bandwidth and the fifth bandwidth is smaller than a set threshold value, performing the subsequent step of determining the first bandwidth with the maximum bandwidth.
7. A video playing device is applied to a smart television, and the device comprises:
the device comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring a first bandwidth and a first IP address corresponding to a first device with the largest bandwidth, which is positioned in the same local area network with the intelligent television, if the video playing interface of the intelligent television is monitored to be in a buffer state;
the first sending module is used for sending a first ARP request carrying a second IP address of a target gateway and a second MAC address of the intelligent television to the first equipment, so that the first equipment stores the second IP address and the second MAC address in the first ARP request in a first ARP cache table of the first equipment; the target gateway and the intelligent television are positioned in the same local area network;
the second sending module is used for sending a second ARP request carrying the first IP address and the second MAC address to the target gateway, so that the target gateway stores the first IP address and the second MAC address in the second ARP request in a second ARP cache table of the target gateway;
and a third sending module, configured to determine, if a data packet sent by the first device is received, a second bandwidth smaller than the first bandwidth, and send the data packet to the target gateway with the second bandwidth.
8. The apparatus according to claim 7, wherein the third sending module is specifically configured to determine a third bandwidth currently occupied by the smart tv; and determining the second bandwidth according to the ratio of the third bandwidth to the first bandwidth and the first bandwidth.
9. An electronic device, characterized in that the electronic device comprises at least a processor and a memory, the processor being adapted to implement the steps of the video playback method according to any of claims 1-6 when executing a computer program stored in the memory.
10. A computer-readable storage medium, characterized in that it stores a computer program which, when being executed by a processor, carries out the steps of the video playback method according to any one of claims 1 to 6.
CN202010540119.3A 2020-06-12 2020-06-12 Video playing method, device, equipment and medium Active CN111726679B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010540119.3A CN111726679B (en) 2020-06-12 2020-06-12 Video playing method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010540119.3A CN111726679B (en) 2020-06-12 2020-06-12 Video playing method, device, equipment and medium

Publications (2)

Publication Number Publication Date
CN111726679A CN111726679A (en) 2020-09-29
CN111726679B true CN111726679B (en) 2022-02-15

Family

ID=72566727

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010540119.3A Active CN111726679B (en) 2020-06-12 2020-06-12 Video playing method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN111726679B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106534790A (en) * 2016-11-25 2017-03-22 浙江宇视科技有限公司 Method and apparatus for automatically adjusting video media stream transmission path
CN108234522A (en) * 2018-03-01 2018-06-29 深圳市共进电子股份有限公司 Prevent Address Resolution Protocol ARP attack method, device, computer equipment and storage medium
CN109167851A (en) * 2018-09-18 2019-01-08 青岛海信电器股份有限公司 A kind of method and device obtaining MAC Address
CN109819058A (en) * 2017-11-20 2019-05-28 北京华为数字技术有限公司 A kind of methods, devices and systems of forwarding service data

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6334219B1 (en) * 1994-09-26 2001-12-25 Adc Telecommunications Inc. Channel selection for a hybrid fiber coax network
EP2117201A1 (en) * 2008-05-07 2009-11-11 Alcatel Lucent Network device and method for local routing of data traffic

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106534790A (en) * 2016-11-25 2017-03-22 浙江宇视科技有限公司 Method and apparatus for automatically adjusting video media stream transmission path
CN109819058A (en) * 2017-11-20 2019-05-28 北京华为数字技术有限公司 A kind of methods, devices and systems of forwarding service data
CN108234522A (en) * 2018-03-01 2018-06-29 深圳市共进电子股份有限公司 Prevent Address Resolution Protocol ARP attack method, device, computer equipment and storage medium
CN109167851A (en) * 2018-09-18 2019-01-08 青岛海信电器股份有限公司 A kind of method and device obtaining MAC Address

Also Published As

Publication number Publication date
CN111726679A (en) 2020-09-29

Similar Documents

Publication Publication Date Title
CN107566786B (en) Method and device for acquiring monitoring video and terminal equipment
US9753794B2 (en) Method and apparatus for controlling sending of heartbeat signal
KR20090101384A (en) Full mesh rates transaction in a network
CN113595897B (en) Path detection method and device
CN108696588B (en) Information sending method and equipment
CN110445723B (en) Network data scheduling method and edge node
CN112929241B (en) Network testing method and device
WO2018086695A1 (en) Node type based control of assistance for data streaming
CN110691110B (en) Communication method, device, system, terminal, equipment and medium
US10136375B2 (en) Method for service data management, apparatus, and system
CN110312140B (en) Live broadcast data processing method, device and system and computer readable storage medium
CN110661673B (en) Heartbeat detection method and device
CN109194706B (en) Network resource dial testing method and terminal
CN111726679B (en) Video playing method, device, equipment and medium
US8931085B2 (en) Download optimization in the presence of multicast data
CN109120541B (en) Method, device, terminal equipment and storage medium for limiting network speed
CN113285920B (en) Service access method, device, equipment and storage medium
EP3119044B1 (en) Page insertion method and device
CN114024917B (en) Method, device, equipment and storage medium for guaranteeing internet service bandwidth
CN112003749B (en) Host information adding method, system and electronic equipment
CN111726429A (en) Communication method, device, equipment and medium
CN111781848A (en) Server connection method, device and system based on intelligent household equipment
US9787730B2 (en) Data sharing method and electronic device using same
US11849163B2 (en) Redundant video stream generation
US20200128103A1 (en) Methods, network node and client device for acquisition and delivery of resources in a communications network

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