CN107071038B - Method and device for transmitting multimedia data - Google Patents

Method and device for transmitting multimedia data Download PDF

Info

Publication number
CN107071038B
CN107071038B CN201710267664.8A CN201710267664A CN107071038B CN 107071038 B CN107071038 B CN 107071038B CN 201710267664 A CN201710267664 A CN 201710267664A CN 107071038 B CN107071038 B CN 107071038B
Authority
CN
China
Prior art keywords
user terminal
data
server
mode information
viewing mode
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.)
Expired - Fee Related
Application number
CN201710267664.8A
Other languages
Chinese (zh)
Other versions
CN107071038A (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.)
Shenzhen Spotmau Information Technology Co ltd
Original Assignee
Shenzhen Spotmau Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Spotmau Information Technology Co ltd filed Critical Shenzhen Spotmau Information Technology Co ltd
Priority to CN201710267664.8A priority Critical patent/CN107071038B/en
Publication of CN107071038A publication Critical patent/CN107071038A/en
Application granted granted Critical
Publication of CN107071038B publication Critical patent/CN107071038B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/563Data redirection of data network streams
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • H04L67/63Routing a service request depending on the request content or context

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention provides a method and a device for transmitting multimedia data, comprising the following steps: receiving a data request message of a first user terminal, wherein the data request message carries viewing mode information; determining whether a second user terminal which requests the same data as the first user terminal exists at present or not according to the viewing mode information; if yes, judging whether data transmission is carried out between the second user terminal and the second user terminal through a transfer port distributed by the transfer server; and if so, transmitting the multimedia data corresponding to the viewing mode information to the first user terminal through the transit port. The embodiment of the invention judges whether a plurality of user terminals request the same data, if so, only one piece of data is uploaded to the transfer server, and the transfer server simultaneously transmits the data to the plurality of user terminals through the transfer port, so that the operation load of the Internet of things equipment is reduced, the uplink bandwidth of the Internet of things equipment is saved, the fluency of the user terminals for acquiring multimedia data can be ensured through a transfer mode, and the user experience is improved.

Description

Method and device for transmitting multimedia data
Technical Field
The present invention relates to the field of network communication technologies, and in particular, to a method and an apparatus for transmitting multimedia data.
Background
In the field of internet of things, internet of things devices such as intelligent doorbells or network cameras can collect multimedia data in real time, and users can remotely watch the multimedia data collected by the internet of things devices in real time through an APP (Application) on a user terminal.
Currently, when a user watches multimedia data collected by an internet of things device through a user terminal, an attempt is made to establish a P2P (Peer to Peer) direct connection data channel between the user terminal and the internet of things device through a NAT (Network Address Translation) traversal technology. If the P2P direct connection data channel is successfully established, the Internet of things equipment directly transmits the multimedia data to the user terminal through the P2P direct connection data channel. If the P2P direct connection data channel is failed to be established, the Internet of things equipment firstly sends the multimedia data to the server, and the server forwards the multimedia data to the user terminal. In practical application, a plurality of user terminals often obtain multimedia data of the internet of things device at the same time, and the internet of things device needs to upload a plurality of identical multimedia data to a server or a plurality of user terminals at the same time according to the above manner.
However, hardware computing capacity and uplink bandwidth of the internet of things equipment are limited, multiple multimedia data are uploaded at the same time, performance of the internet of things equipment is reduced, and uplink bandwidth occupied by uploading multiple multimedia data is large and even exceeds the limit of the uplink bandwidth of the internet of things equipment. The performance reduction of the internet of things equipment and the limitation of uplink bandwidth also cause the unsmooth multimedia data acquisition of the user terminal.
Disclosure of Invention
In view of this, an object of the embodiments of the present invention is to provide a method and an apparatus for transmitting multimedia data, so as to prevent an internet of things device from uploading multiple pieces of multimedia data at the same time, and achieve the effects of reducing an operation load of the internet of things device and saving an uplink bandwidth of the internet of things device.
In a first aspect, an embodiment of the present invention provides a method for transmitting multimedia data, where the method includes:
receiving a data request message of a first user terminal, wherein the data request message carries viewing mode information;
determining whether a second user terminal which requests the same data as the first user terminal exists at present according to the viewing mode information, wherein the second user terminal is other user terminals except the first user terminal;
if the second user terminal is determined to exist, judging whether data transmission is carried out between the second user terminal and the second user terminal through a transfer port distributed by a transfer server;
and if so, transmitting the multimedia data corresponding to the viewing mode information to the first user terminal through the transit port.
With reference to the first aspect, an embodiment of the present invention provides a first possible implementation manner of the first aspect, where the determining, according to the viewing mode information, whether there is a second user terminal that requests the same data as the first user terminal currently includes:
checking whether the corresponding relation between the viewing mode and the terminal identification contains the viewing mode information or not according to the viewing mode information;
if yes, determining that a second user terminal which has the same data as the first user terminal and requests exists currently;
and if not, determining that a second user terminal which requests the same data as the first user terminal does not exist currently.
With reference to the first aspect, an embodiment of the present invention provides a second possible implementation manner of the first aspect, where the determining whether data transmission is performed between the second user terminal and the second user terminal through a transit port allocated by a transit server includes:
acquiring a terminal identifier of the second user terminal from the corresponding relation between the viewing mode and the terminal identifier according to the viewing mode information;
acquiring a corresponding transmission channel type from the corresponding relation between the terminal identification and the transmission channel type according to the terminal identification of the second user terminal;
and if the acquired transmission channel type is a transfer type, determining that data transmission is performed between the second user terminal and the second user terminal through a transfer port distributed by a transfer server.
With reference to the first aspect, an embodiment of the present invention provides a third possible implementation manner of the first aspect, where the transmitting the multimedia data corresponding to the viewing mode information to the first user terminal through the transit port includes:
acquiring a transfer port number corresponding to the transfer port from the transfer server;
sending the transit port number to the first user terminal through a P2P server;
and transmitting the multimedia data to the first user terminal through the transit port on the transit server.
With reference to the first aspect, an embodiment of the present invention provides a fourth possible implementation manner of the first aspect, where the method further includes:
when determining that a second user terminal requesting the same data as the first user terminal does not exist currently, attempting to establish a P2P direct connection data channel with the first user terminal;
if the P2P direct connection data channel between the first user terminal and the first user terminal is successfully established, transmitting multimedia data corresponding to the viewing mode information to the first user terminal through the P2P direct connection data channel between the first user terminal and the first user terminal;
and if the P2P direct connection data channel between the first user terminal and the first user terminal is not successfully established, transmitting the multimedia data corresponding to the viewing mode information to the first user terminal through a transit server.
With reference to the second possible implementation manner of the first aspect, an embodiment of the present invention provides a fifth possible implementation manner of the first aspect, where the method further includes:
and if the acquired transmission channel type indicates that the transmission channel is a P2P direct connection data channel, applying for a transfer port from a transfer server, and simultaneously transmitting the multimedia data corresponding to the viewing mode information to the first user terminal and the second user terminal through the transfer port distributed by the transfer server.
With reference to the fifth possible implementation manner of the first aspect, an embodiment of the present invention provides a sixth possible implementation manner of the first aspect, where the applying for a transit port from a transit server, and transmitting the multimedia data corresponding to the viewing mode information to the first user terminal and the second user terminal through the transit port allocated by the transit server simultaneously includes:
sending a transfer port allocation request to a transfer server, and receiving a transfer port number returned by the transfer server;
sending the transit port numbers to the first user terminal and the second user terminal through a P2P server;
and transmitting the multimedia data corresponding to the viewing mode information to the transit server, and transmitting the multimedia data to the first user terminal and the second user terminal simultaneously through a transit port corresponding to the transit port number allocated by the transit server.
With reference to the sixth possible implementation manner of the first aspect, an embodiment of the present invention provides the seventh possible implementation manner of the first aspect, where after the transmitting the multimedia data corresponding to the viewing mode information to the relay server, the method further includes:
and cutting off the P2P direct connection data channel between the second user terminal and the second user terminal.
In a second aspect, an embodiment of the present invention provides an apparatus for transmitting multimedia data, where the apparatus includes:
the receiving module is used for receiving a data request message of a first user terminal, wherein the data request message carries viewing mode information;
a determining module, configured to determine whether a second user terminal that requests the same data as the first user terminal exists currently according to the viewing mode information, where the second user terminal is another user terminal except the first user terminal;
the judging module is used for judging whether data transmission is carried out between the second user terminal and the second user terminal through a transfer port distributed by a transfer server if the determining module determines that the second user terminal exists;
and a transmission module, configured to transmit the multimedia data corresponding to the viewing mode information to the first user terminal through a relay port if the determination module determines that data transmission is performed between the first user terminal and the second user terminal through the relay port allocated by the relay server.
With reference to the second aspect, an embodiment of the present invention provides a first possible implementation manner of the second aspect, where the determining module includes:
the viewing unit is used for viewing whether the corresponding relation between the viewing mode and the terminal identification contains the viewing mode information or not according to the viewing mode information;
a determining unit, configured to determine that a second user terminal that requests the same data as the first user terminal currently exists if the first user terminal is determined to be currently present; and if not, determining that a second user terminal which requests the same data as the first user terminal does not exist currently.
In the method and the device provided by the embodiment of the invention, a data request message of a first user terminal is received, wherein the data request message carries viewing mode information; determining whether a second user terminal which requests the same data as the first user terminal exists at present or not according to the viewing mode information; if yes, judging whether data transmission is carried out between the second user terminal and the second user terminal through a transfer port distributed by the transfer server; and if so, transmitting the multimedia data corresponding to the viewing mode information to the first user terminal through the transit port. The embodiment of the invention judges whether a plurality of user terminals request the same data, if so, only one piece of data is uploaded to the transfer server, and the transfer server simultaneously transmits the data to the plurality of user terminals through the transfer port, so that the operation load of the Internet of things equipment is reduced, the uplink bandwidth of the Internet of things equipment is saved, the fluency of the user terminals for acquiring multimedia data can be ensured through a transfer mode, and the user experience is improved.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
Fig. 1 is a diagram illustrating a network architecture for transmitting multimedia data according to embodiment 1 of the present invention;
fig. 2 is a flowchart illustrating a method for transmitting multimedia data according to embodiment 1 of the present invention;
fig. 3 is a schematic structural diagram illustrating an apparatus for transmitting multimedia data according to embodiment 2 of the present invention;
fig. 4 is a schematic structural diagram illustrating another apparatus for transmitting multimedia data according to embodiment 2 of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present invention without making any creative effort, shall fall within the protection scope of the present invention.
In the prior art, the internet of things equipment needs to upload multiple identical multimedia data to the server or multiple user terminals at the same time, so that the performance of the internet of things equipment is reduced, and uplink bandwidth occupied by uploading the multiple multimedia data is large and even exceeds the limit of the uplink bandwidth of the internet of things equipment. The performance reduction of the internet of things equipment and the limitation of uplink bandwidth also cause the unsmooth multimedia data acquisition of the user terminal. Based on this, embodiments of the present invention provide a method and an apparatus for transmitting multimedia data, which are described below by way of embodiments.
Example 1
The embodiment of the invention provides a method for transmitting multimedia data. The execution subject of the method is the Internet of things equipment. The Internet of things equipment can be multimedia real-time viewing equipment such as an intelligent doorbell or a network camera. In the field of the internet of things, a user can remotely watch multimedia data acquired by internet of things equipment in real time through an APP installed on a user terminal. For the same internet of things device, multiple user terminals may exist at the same time to request the multimedia data collected by the internet of things device at the same time. When a plurality of user terminals simultaneously request the same multimedia data from the internet of things device, the internet of things device only uploads one piece of multimedia data to the transfer server through the method for transmitting the multimedia data provided by the embodiment of the invention, and the multimedia data is transmitted to the plurality of user terminals through the transfer server simultaneously, so that the internet of things device is prevented from uploading a plurality of pieces of the same data simultaneously, the uplink bandwidth of the internet of things device is saved, and the user terminals are ensured to be capable of smoothly acquiring the multimedia data.
A network architecture based on the method provided by the embodiment of the invention is shown in fig. 1, and the network architecture comprises a user terminal, an internet of things device, a transit server and a P2P server. The relay server and the P2P server may be two independent server devices, or may be a relay service function and a P2P service function configured on the same physical device. The embodiment of the present invention is described by taking a transit server and a P2P server as two independent physical devices as an example. In the network architecture shown in fig. 1, a user terminal is schematically shown, and in practice one or more user terminals may be present.
The Internet of things equipment is provided with an equipment identifier capable of uniquely identifying the Internet of things equipment. Before the multimedia data is transmitted by the method provided by the embodiment of the invention, the internet of things equipment needs to send a registration request to the P2P server, the registration request carries the equipment identifier of the internet of things equipment, and the P2P server stores the equipment identifier of the internet of things equipment to complete registration of the internet of things equipment. And the Internet of things equipment also sends heartbeat messages to the P2P server at intervals of a preset time period, wherein the heartbeat messages carry an intranet IP (Internet Protocol, Protocol for interconnection between networks) address and an intranet port number of the Internet of things equipment, when the P2P server receives the heartbeat messages of the Internet of things equipment, the Internet IP address and the extranet port number of the Internet of things equipment can be obtained based on network information transmission, the equipment identification, the intranet IP address, the intranet port number, the extranet IP address and the extranet port number of the Internet of things equipment form routing table information of the Internet of things equipment, and the routing table information is stored.
The preset time period may be 5 hours, one day, one week, or the like. And comparing the intranet IP address, the intranet port number, the extranet IP address and the extranet port number corresponding to the heartbeat message with the intranet IP address, the intranet port number, the extranet IP address and the extranet port number in the stored routing table information of the Internet of things equipment when the P2P server receives the heartbeat message of the Internet of things equipment every time, and if the intranet IP address, the intranet port number, the extranet IP address and the extranet port number are consistent, not operating. If not, deleting the stored routing table information, establishing new routing table information according to the heartbeat message, and storing the new routing table information.
After the internet of things equipment is registered on the P2P server, if a user wants to watch multimedia data collected by the internet of things equipment, the multimedia data are transmitted to the user terminal of the user by the method provided by the embodiment of the invention. Referring to fig. 2, the method specifically includes the following steps:
step 101: and receiving a data request message of the first user terminal, wherein the data request message carries the viewing mode information.
When a user wants to watch multimedia data collected by the internet of things equipment, the user sends a data request message to the P2P server through the terminal of the user. For convenience of description, in the embodiment of the present invention, the terminal of the user is referred to as a first user terminal. The data request message carries the viewing mode information, as well as the terminal identifier of the first user terminal, the device identifier of the internet of things device, the intranet IP address and the intranet port number of the first user terminal. The viewing mode information is used for indicating a mode of the multimedia data, and the mode of the multimedia data includes a fluency mode, a standard definition mode or a high definition mode. The data volume of the multimedia data in different modes is different, and the definition of the picture is different when the multimedia data is played.
When the P2P server receives the data request message sent by the first user terminal, it can acquire the external network IP address and the external network port number of the first user terminal. The P2P server checks the routing table information of the Internet of things device according to the device identification of the Internet of things device carried by the data request message, and sends the data request message and the external network IP address and the external network port number of the first user terminal to the Internet of things device according to the external network IP address, the external network port number, the internal network IP address and the internal network port number of the Internet of things device included in the routing table information. And the Internet of things equipment receives the data request message of the first user terminal forwarded by the P2P server, and the external network IP address and the external network port number of the first user terminal.
Step 102: and determining whether a second user terminal which requests the same data as the first user terminal exists at present according to the viewing mode information, wherein the second user terminal is other user terminals except the first user terminal.
The equipment of the Internet of things maintains a corresponding relation between a viewing mode and a terminal identifier, and the terminal identifiers of all user terminals acquiring multimedia data and viewing mode information requested by the user terminals are stored in the corresponding relation.
For the same internet of things equipment, the multimedia data corresponding to the same viewing mode information are the same. After receiving a data request message of a first user terminal, the Internet of things equipment checks whether the corresponding relation between a viewing mode and a terminal identifier contains the viewing mode information or not according to the viewing mode information contained in the data request message; if yes, determining that a second user terminal which has the same data as the first user terminal and requests exists currently; if not, determining that a second user terminal which requests the same data as the first user terminal does not exist currently.
In the embodiment of the present invention, when it is determined that there is no second user terminal requesting the same data as the first user terminal, it is determined that the first user terminal is the first user terminal requesting the multimedia data corresponding to the viewing mode information, at this time, the internet of things device attempts to establish a P2P direct connection data channel with the first user terminal through the NAT traversal technology, and if the P2P direct connection data channel with the first user terminal is successfully established, the multimedia data corresponding to the viewing mode information is transmitted to the first user terminal through a P2P direct connection data channel with the first user terminal. And if the P2P direct connection data channel between the first user terminal and the first user terminal is not successfully established, transmitting the multimedia data corresponding to the viewing mode information to the first user terminal through the transit server.
When the internet of things equipment tries to establish a P2P direct connection data channel with a first user terminal, the internet of things equipment firstly sends a route forwarding notice to a P2P server, and the route forwarding notice comprises an equipment identifier of the internet of things equipment, a terminal identifier of the first user terminal and route forwarding indication information. The route forwarding indication information may be a preset indicator, such as 0 or 1, for instructing the P2P server to forward the route information. And after receiving the route forwarding notification sent by the internet of things device, the P2P server acquires the routing table information of the internet of things device according to the device identifier of the internet of things device. And then according to the terminal identification included in the route forwarding notification, the route table information is sent to the first user terminal. The routing table information comprises equipment identification of the Internet of things equipment, an intranet IP address, an intranet port number, an extranet IP address and an extranet port number. So far, both the internet of things device and the first user terminal know the intranet IP address, the intranet port number, the extranet IP address and the extranet port number of the other party. Then, the internet of things device and the first user terminal start to try to establish a P2P direct connection data channel through the NAT traversal technology.
And if the P2P direct connection data channel is successfully established, directly transmitting the multimedia data corresponding to the viewing mode information to the first user terminal through the P2P direct connection data channel. If the establishment of the P2P direct connection data channel fails, the multimedia data needs to be forwarded to the first user terminal through the transit server, and at this time, the internet of things device first sends a transit port allocation request to the transit server, where the transit port allocation request carries a device identifier of the internet of things device. And after receiving the transfer port allocation request, the transfer server allocates a transfer port for the internet of things equipment according to the equipment identifier of the internet of things equipment, and returns the transfer port number of the allocated transfer port to the internet of things equipment. After receiving the transit port number returned by the transit server, the internet of things device sends a transit request message to the P2P server, where the transit request message carries the transit port number and the terminal identifier of the first user terminal. And after receiving the transfer request message, the P2P server sends the transfer port number to the first user terminal according to the terminal identifier of the first user terminal. The internet of things equipment uploads the multimedia data corresponding to the viewing mode information to the transfer server, and after the first user terminal receives the transfer port number, the multimedia data are acquired from the transfer port corresponding to the transfer port number in the transfer server subsequently. That is, the multimedia data is subsequently transmitted to the first user terminal by the transit server via the transit port.
When it is determined that there is no second user terminal requesting the same data as the first user terminal, after the multimedia data is transmitted to the first user terminal through the P2P direct connection data channel or in a forwarding manner through the relay server, the internet of things device further stores viewing mode information carried by the data request message of the first user terminal and the terminal identifier of the first user terminal in a corresponding relationship between the viewing mode and the terminal identifier, and stores the terminal identifier of the first user terminal and a transmission channel type transmitting data to the first user terminal in a corresponding relationship between the terminal identifier and the transmission channel type. When the multimedia data is transmitted through the P2P direct connection data channel, the transmission channel type is the P2P direct connection data channel, and if the multimedia data is forwarded through the relay server, the transmission channel type is the relay type.
In the embodiment of the present invention, when it is determined that there is a second user terminal requesting the same data as the first user terminal, multimedia data is transmitted to the first user terminal by the operations of steps 103 and 104 as follows.
Step 103: and if the second user terminal is determined to exist, judging whether data transmission is carried out between the second user terminal and the second user terminal through a transfer port distributed by the transfer server.
When step 102 determines that a second user terminal which has the same data as the first user terminal and requests exists currently, the internet of things equipment acquires a terminal identifier of the second user terminal from the corresponding relation between the viewing mode and the terminal identifier according to the viewing mode information; acquiring a corresponding transmission channel type from the corresponding relation between the terminal identification and the transmission channel type according to the terminal identification of the second user terminal; if the acquired transmission channel type is a transit type, it is determined that data transmission is performed between the second user terminal and the second user terminal through a transit port allocated by the transit server, and the operation of step 104 is subsequently performed.
And if the acquired transmission channel type indicates that the transmission channel is a P2P direct connection data channel, applying for a transfer port from the transfer server, and simultaneously transmitting the multimedia data corresponding to the viewing mode information to the first user terminal and the second user terminal through the transfer port distributed by the transfer server.
Specifically, the internet of things device sends a transfer port allocation request to the transfer server, where the transfer port allocation request carries a device identifier of the internet of things device. After allocating the transfer port for the internet of things equipment, the transfer server sends the transfer port number corresponding to the transfer port to the internet of things equipment. And the Internet of things equipment receives the transfer port number returned by the transfer server. And then the internet of things equipment sends the transit port number to the first user terminal and the second user terminal through the P2P server, transmits the multimedia data corresponding to the viewing mode information to the transit server, and simultaneously transmits the multimedia data to the first user terminal and the second user terminal through the transit port corresponding to the transit port number distributed by the transit server.
After the multimedia data are forwarded to the first user terminal by the transfer server in the manner, the internet of things device also correspondingly stores the viewing mode information carried by the data request message of the first user terminal and the terminal identifier of the first user terminal in the corresponding relation between the viewing mode and the terminal identifier, and correspondingly stores the terminal identifier of the first user terminal and the transmission channel type for transmitting the data to the first user terminal in the corresponding relation between the terminal identifier and the transmission channel type. The transmission channel type is the transit type at this time.
In the embodiment of the present invention, after the internet of things device transmits the multimedia data corresponding to the viewing mode information to the transit server, the P2P direct connection data channel with the second user terminal is also cut off. The second user terminal obtains the multimedia data from the transfer server after being cut off, so that the first user terminal and the second user terminal both obtain the same multimedia data from the transfer server, the internet of things equipment only uploads the multimedia data to the transfer server, the internet of things equipment only uploads one part of multimedia data, the multimedia data can be simultaneously transmitted to the first user terminal and the second user terminal, and the uplink bandwidth of the internet of things equipment is greatly saved.
In the embodiment of the present invention, there is also a possibility that any transmission channel has not been established with the second user terminal, and in this case, the type of the transmission channel obtained according to the terminal identifier of the second user terminal is null. When the acquired transmission channel type is empty, it is determined that no data transmission channel is established with the second user terminal, and at this time, the situation that the data channel is directly connected with the transmission channel type P2P is the same as that of the transmission channel type, a transfer port is also applied to the transfer server according to the above manner, and the multimedia data corresponding to the viewing mode information is simultaneously transmitted to the first user terminal and the second user terminal through the transfer port allocated by the transfer server.
When the acquired transmission channel type is the relay type, the multimedia data is transmitted to the first user terminal in the following step 104.
Step 104: and if the second user terminal is judged to perform data transmission with the second user terminal through the transit port distributed by the transit server, transmitting the multimedia data corresponding to the viewing mode information to the first user terminal through the transit port.
When the multimedia data is determined to be sent to the second user terminal in a forwarding mode through the forwarding server, it is indicated that the forwarding server has allocated a forwarding port for the internet of things device, and the internet of things device has uploaded the multimedia data corresponding to the viewing mode information to the forwarding server, and the forwarding server transmits the multimedia data to the second user terminal through the forwarding port.
Since the multimedia data requested by the first user terminal and the second user terminal are the same, the relay server can directly utilize the relay port to forward the multimedia data to the first user terminal. The internet of things equipment acquires the transfer port number corresponding to the transfer port from the transfer server, sends the transfer port number to the first user terminal through the P2P server, and then transmits the multimedia data to the first user terminal through the transfer port on the transfer server.
Specifically, the internet of things device sends a transfer request message to the P2P server, where the transfer request message carries the terminal identifier of the first user terminal and the transfer port number corresponding to the transfer port. After receiving the relay request message, the P2P server sends the relay port number to the first user terminal according to the terminal identifier of the first user terminal. After receiving the transit port number, the first user terminal can obtain the multimedia data from the transit port corresponding to the transit port number on the transit server. That is, the same multimedia data is forwarded to the first user terminal and the second user terminal at the same time through the transfer port for forwarding the multimedia data to the second user terminal.
The Internet of things equipment intelligently selects a mode of transmitting multimedia data by judging whether the data requested by the plurality of user terminals are the same or not. When a plurality of user terminals request the same data, only upload a data to the transfer server, transmit the data for a plurality of user terminals simultaneously through the transfer server, can reduce the operational load of thing networking device on the one hand, can reduce the uplink bandwidth that thing networking device used on the other hand, through the mode of transfer, can also ensure the smoothness of user terminal broadcast multimedia data, promote user experience.
In the embodiment of the invention, the transfer server also recovers the transfer port after the multimedia data is transferred to the first user terminal and the second user terminal through the transfer port, thereby avoiding the waste of the transfer port resources.
In addition, in the embodiment of the invention, if for a second user terminal applying for the same data as the first user terminal, the internet of things device transmits the multimedia data to the second user terminal in a transfer mode of the transfer server, the transfer port for forwarding the data to the second user terminal is directly used, and the transfer port does not need to be applied to the transfer server, so that the utilization rate of the transfer port is improved, and the processing time is saved.
In the embodiment of the invention, a data request message of a first user terminal is received, wherein the data request message carries viewing mode information; determining whether a second user terminal which requests the same data as the first user terminal exists at present or not according to the viewing mode information; if yes, judging whether data transmission is carried out between the second user terminal and the second user terminal through a transfer port distributed by the transfer server; and if so, transmitting the multimedia data corresponding to the viewing mode information to the first user terminal through the transit port. The embodiment of the invention judges whether a plurality of user terminals request the same data, if so, only one piece of data is uploaded to the transfer server, and the transfer server simultaneously transmits the data to the plurality of user terminals through the transfer port, so that the operation load of the Internet of things equipment is reduced, the uplink bandwidth of the Internet of things equipment is saved, the fluency of the user terminals for acquiring multimedia data can be ensured through a transfer mode, and the user experience is improved.
Example 2
Referring to fig. 3, an embodiment of the present invention provides an apparatus for transmitting multimedia data, where the apparatus is configured to execute the method for transmitting multimedia data provided in embodiment 1, and the apparatus specifically includes:
a receiving module 21, configured to receive a data request message of a first user terminal, where the data request message carries viewing mode information;
a determining module 22, configured to determine whether a second user terminal that requests the same data as the first user terminal exists currently according to the viewing mode information, where the second user terminal is another user terminal except the first user terminal;
a judging module 23, configured to, if the determining module 22 determines that the second user terminal exists, judge whether data transmission is performed between the second user terminal and the second user terminal through a relay port allocated by the relay server;
a transmission module 24, configured to transmit the multimedia data corresponding to the viewing mode information to the first user terminal through the relay port if the determination module 23 determines that data transmission is performed between the first user terminal and the second user terminal through the relay port allocated by the relay server.
As shown in fig. 4, the determination module 22 includes:
a checking unit 221, configured to check whether the viewing mode information is included in the correspondence between the viewing mode and the terminal identifier according to the viewing mode information;
a determining unit 222, configured to determine that a second user terminal requesting the same data as the first user terminal currently exists if the first user terminal is determined to be the current user terminal; if not, determining that a second user terminal which requests the same data as the first user terminal does not exist currently.
In the embodiment of the present invention, the determining module 23 is configured to obtain, according to the viewing mode information, a terminal identifier of the second user terminal from a correspondence between the viewing mode and the terminal identifier; acquiring a corresponding transmission channel type from the corresponding relation between the terminal identification and the transmission channel type according to the terminal identification of the second user terminal; and if the acquired transmission channel type is the transfer type, determining that data transmission is carried out between the second user terminal and the second user terminal through a transfer port distributed by the transfer server.
A transmission module 24, configured to obtain a transit port number corresponding to the transit port from the transit server; transmitting the transit port number to the first user terminal through the P2P server; and transmitting the multimedia data to the first user terminal through a transit port on the transit server.
In an embodiment of the present invention, the apparatus further includes: the establishing module is used for trying to establish a P2P direct connection data channel between the establishing module and the first user terminal when determining that a second user terminal which has the same data request with the first user terminal does not exist currently; if the P2P direct connection data channel between the first user terminal and the first user terminal is successfully established, transmitting multimedia data corresponding to the viewing mode information to the first user terminal through the P2P direct connection data channel between the first user terminal and the first user terminal; and if the P2P direct connection data channel between the first user terminal and the first user terminal is not successfully established, transmitting the multimedia data corresponding to the viewing mode information to the first user terminal through the transit server.
In this embodiment of the present invention, the transmission module 24 is further configured to apply for a relay port from the relay server if the obtained transmission channel type indicates that the transmission channel is a P2P direct connection data channel, and transmit the multimedia data corresponding to the viewing mode information to the first user terminal and the second user terminal through the relay port allocated by the relay server.
The transmission module 24 is configured to send a transfer port allocation request to the transfer server, and receive a transfer port number returned by the transfer server; transmitting the transit port numbers to the first user terminal and the second user terminal through the P2P server; and transmitting the multimedia data corresponding to the viewing mode information to a transfer server, and transmitting the multimedia data to the first user terminal and the second user terminal simultaneously through a transfer port corresponding to a transfer port number distributed by the transfer server.
In an embodiment of the present invention, the apparatus further includes: and the cutting-off module is used for cutting off the P2P direct connection data channel between the second user terminal and the second user terminal.
In the embodiment of the invention, the Internet of things equipment receives a data request message of a first user terminal, wherein the data request message carries viewing mode information; determining whether a second user terminal which requests the same data as the first user terminal exists at present or not according to the viewing mode information; if yes, judging whether data transmission is carried out between the second user terminal and the second user terminal through a transfer port distributed by the transfer server; and if so, transmitting the multimedia data corresponding to the viewing mode information to the first user terminal through the transit port. The embodiment of the invention judges whether a plurality of user terminals request the same data, if so, only one piece of data is uploaded to the transfer server, and the transfer server simultaneously transmits the data to the plurality of user terminals through the transfer port, so that the operation load of the Internet of things equipment is reduced, the uplink bandwidth of the Internet of things equipment is saved, the fluency of the user terminals for acquiring multimedia data can be ensured through a transfer mode, and the user experience is improved.
The device for transmitting multimedia data provided by the embodiment of the invention can be specific hardware on the equipment or software or firmware installed on the equipment. The device provided by the embodiment of the present invention has the same implementation principle and technical effect as the method embodiments, and for the sake of brief description, reference may be made to the corresponding contents in the method embodiments without reference to the device embodiments. It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the foregoing systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments provided by the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus once an item is defined in one figure, it need not be further defined and explained in subsequent figures, and moreover, the terms "first", "second", "third", etc. are used merely to distinguish one description from another and are not to be construed as indicating or implying relative importance.
Finally, it should be noted that: the above-mentioned embodiments are only specific embodiments of the present invention, which are used for illustrating the technical solutions of the present invention and not for limiting the same, and the protection scope of the present invention is not limited thereto, although the present invention is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the present invention in its spirit and scope. Are intended to be covered by the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims.

Claims (10)

1. A method for transmitting multimedia data is applied to an Internet of things device with a multimedia real-time viewing function, and comprises the following steps:
receiving a data request message of a first user terminal, wherein the data request message carries viewing mode information; the viewing mode information is used for indicating a mode of multimedia data, and the mode of the multimedia data comprises a fluency mode, a standard definition mode or a high definition mode;
determining whether a second user terminal which requests the same data as the first user terminal exists at present according to the viewing mode information, wherein the second user terminal is other user terminals except the first user terminal;
if the second user terminal is determined to exist, judging whether data transmission is carried out between the second user terminal and the second user terminal through a transfer port distributed by a transfer server;
and if so, transmitting the multimedia data corresponding to the viewing mode information to the first user terminal through the transit port.
2. The method according to claim 1, wherein the determining whether a second user terminal requesting the same data as the first user terminal currently exists according to the viewing mode information comprises:
checking whether the corresponding relation between the viewing mode and the terminal identification contains the viewing mode information or not according to the viewing mode information;
if yes, determining that a second user terminal which has the same data as the first user terminal and requests exists currently;
and if not, determining that a second user terminal which requests the same data as the first user terminal does not exist currently.
3. The method according to claim 1, wherein the determining whether the data transmission with the second user terminal is performed through a transit port allocated by a transit server comprises:
acquiring a terminal identifier of the second user terminal from the corresponding relation between the viewing mode and the terminal identifier according to the viewing mode information;
acquiring a corresponding transmission channel type from the corresponding relation between the terminal identification and the transmission channel type according to the terminal identification of the second user terminal;
and if the acquired transmission channel type is a transfer type, determining that data transmission is performed between the second user terminal and the second user terminal through a transfer port distributed by a transfer server.
4. The method according to claim 1, wherein the transmitting the multimedia data corresponding to the viewing mode information to the first user terminal through the transit port comprises:
acquiring a transfer port number corresponding to the transfer port from the transfer server;
sending the transit port number to the first user terminal through a P2P server;
and transmitting the multimedia data to the first user terminal through the transit port on the transit server.
5. The method of claim 1, further comprising:
when determining that a second user terminal requesting the same data as the first user terminal does not exist currently, attempting to establish a P2P direct connection data channel with the first user terminal;
if the P2P direct connection data channel between the first user terminal and the first user terminal is successfully established, transmitting multimedia data corresponding to the viewing mode information to the first user terminal through the P2P direct connection data channel between the first user terminal and the first user terminal;
and if the P2P direct connection data channel between the first user terminal and the first user terminal is not successfully established, transmitting the multimedia data corresponding to the viewing mode information to the first user terminal through a transit server.
6. The method of claim 3, further comprising:
and if the acquired transmission channel type indicates that the transmission channel is a P2P direct connection data channel, applying for a transfer port from a transfer server, and simultaneously transmitting the multimedia data corresponding to the viewing mode information to the first user terminal and the second user terminal through the transfer port distributed by the transfer server.
7. The method of claim 6, wherein the applying for a transit port from a transit server, and transmitting the multimedia data corresponding to the viewing mode information to the first user terminal and the second user terminal through the transit port allocated by the transit server simultaneously comprises:
sending a transfer port allocation request to a transfer server, and receiving a transfer port number returned by the transfer server;
sending the transit port numbers to the first user terminal and the second user terminal through a P2P server;
and transmitting the multimedia data corresponding to the viewing mode information to the transit server, and transmitting the multimedia data to the first user terminal and the second user terminal simultaneously through a transit port corresponding to the transit port number allocated by the transit server.
8. The method of claim 7, wherein after transmitting the multimedia data corresponding to the viewing mode information to the relay server, the method further comprises:
and cutting off the P2P direct connection data channel between the second user terminal and the second user terminal.
9. An apparatus for transmitting multimedia data, applied to an internet of things device having a multimedia real-time viewing function, the apparatus comprising:
the receiving module is used for receiving a data request message of a first user terminal, wherein the data request message carries viewing mode information; the viewing mode information is used for indicating a mode of multimedia data, and the mode of the multimedia data comprises a fluency mode, a standard definition mode or a high definition mode;
a determining module, configured to determine whether a second user terminal that requests the same data as the first user terminal exists currently according to the viewing mode information, where the second user terminal is another user terminal except the first user terminal;
the judging module is used for judging whether data transmission is carried out between the second user terminal and the second user terminal through a transfer port distributed by a transfer server if the determining module determines that the second user terminal exists;
and a transmission module, configured to transmit the multimedia data corresponding to the viewing mode information to the first user terminal through a relay port if the determination module determines that data transmission is performed between the first user terminal and the second user terminal through the relay port allocated by the relay server.
10. The apparatus of claim 9, wherein the determining module comprises:
the viewing unit is used for viewing whether the corresponding relation between the viewing mode and the terminal identification contains the viewing mode information or not according to the viewing mode information;
a determining unit, configured to determine that a second user terminal that requests the same data as the first user terminal currently exists if the first user terminal is determined to be currently present; and if not, determining that a second user terminal which requests the same data as the first user terminal does not exist currently.
CN201710267664.8A 2017-04-21 2017-04-21 Method and device for transmitting multimedia data Expired - Fee Related CN107071038B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710267664.8A CN107071038B (en) 2017-04-21 2017-04-21 Method and device for transmitting multimedia data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710267664.8A CN107071038B (en) 2017-04-21 2017-04-21 Method and device for transmitting multimedia data

Publications (2)

Publication Number Publication Date
CN107071038A CN107071038A (en) 2017-08-18
CN107071038B true CN107071038B (en) 2020-04-24

Family

ID=59603356

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710267664.8A Expired - Fee Related CN107071038B (en) 2017-04-21 2017-04-21 Method and device for transmitting multimedia data

Country Status (1)

Country Link
CN (1) CN107071038B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109728992B (en) * 2018-11-27 2021-09-28 苏州盛科通信股份有限公司 Method, device, storage medium and electronic device for distributing forwarding domain
CN110535975A (en) * 2019-09-27 2019-12-03 京东方科技集团股份有限公司 Data transmission method, apparatus and system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101631006A (en) * 2008-07-15 2010-01-20 株式会社日立制作所 System and method for transmitting data
CN103607700A (en) * 2013-11-07 2014-02-26 北京邮电大学 Time window based high energy efficiency unicast and multicast mixing transmission method and apparatus
US9191374B1 (en) * 2014-09-22 2015-11-17 Belkin International Inc. Routing device data caching
WO2016181861A1 (en) * 2015-05-08 2016-11-17 シャープ株式会社 Terminal device and base station device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101631006A (en) * 2008-07-15 2010-01-20 株式会社日立制作所 System and method for transmitting data
CN103607700A (en) * 2013-11-07 2014-02-26 北京邮电大学 Time window based high energy efficiency unicast and multicast mixing transmission method and apparatus
US9191374B1 (en) * 2014-09-22 2015-11-17 Belkin International Inc. Routing device data caching
WO2016181861A1 (en) * 2015-05-08 2016-11-17 シャープ株式会社 Terminal device and base station device

Also Published As

Publication number Publication date
CN107071038A (en) 2017-08-18

Similar Documents

Publication Publication Date Title
CN103069755B (en) Use the method and system that the instant message of multiple client instance transmits
CN110012083B (en) Data transmission method, server and data transmission device
GB2482268A (en) Mobile terminal and peer-to-peer mode based data transmission method thereof
CN110381160B (en) Communication information interaction method and device, storage medium and computer equipment
CN104462033A (en) Method and device for realizing editing operation among devices
CN113032223B (en) Server state detection method and device
CN105262836A (en) Information push method of server and push information reception method of client
CN111541555A (en) Group chat optimization method and related product
CN107071038B (en) Method and device for transmitting multimedia data
CN108337241B (en) Multimedia data transmission method and system
US20140201376A1 (en) Method and system for the handling of redundant long poll
KR101367265B1 (en) Push server, push service providing system and method of the same
CN110365802B (en) Message transmission method, message forwarding equipment and storage medium
CN116996421A (en) Network quality detection method and related equipment
KR101144190B1 (en) System and method for transmitting message
CN107105034B (en) Method and device for transmitting multimedia data
CN111565235A (en) Method and device for obtaining address of multimedia message service server
CN114884805A (en) Data transmission method, device, terminal and storage medium
CN110474807B (en) Log processing method and device
CN114268940A (en) Mesh network topological graph display method, system, equipment and storage medium
CN109379277B (en) Distributed IM communication method and device based on routing addressing
CN112383617A (en) Method, device, terminal equipment and medium for long connection
CN108307401A (en) Establish the method, apparatus and communication equipment of communication connection
CN107548025B (en) Position information sharing method and core network
CN111193794A (en) File transmission method and device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20200424