CN109995660B - Streaming media transmission method and device, terminal equipment and computer readable storage medium - Google Patents

Streaming media transmission method and device, terminal equipment and computer readable storage medium Download PDF

Info

Publication number
CN109995660B
CN109995660B CN201711483717.6A CN201711483717A CN109995660B CN 109995660 B CN109995660 B CN 109995660B CN 201711483717 A CN201711483717 A CN 201711483717A CN 109995660 B CN109995660 B CN 109995660B
Authority
CN
China
Prior art keywords
streaming media
robot
target terminal
public network
address
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
CN201711483717.6A
Other languages
Chinese (zh)
Other versions
CN109995660A (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.)
Shanghai Youbijie Education Technology Co ltd
Shenzhen Ubtech Technology Co ltd
Original Assignee
Shenzhen Ubtech 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 Ubtech Technology Co ltd filed Critical Shenzhen Ubtech Technology Co ltd
Priority to CN201711483717.6A priority Critical patent/CN109995660B/en
Publication of CN109995660A publication Critical patent/CN109995660A/en
Application granted granted Critical
Publication of CN109995660B publication Critical patent/CN109995660B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/25Mapping addresses of the same type
    • H04L61/2503Translation of Internet protocol [IP] addresses
    • H04L61/256NAT traversal
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/60Network streaming of media packets
    • H04L65/75Media network packet handling

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Multimedia (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The present invention relates to the field of robotics, and in particular, to a streaming media transmission method, apparatus, terminal device, and computer-readable storage medium. The method comprises the steps of detecting whether a router connected with a streaming media robot is switched or not, if the router connected with the streaming media robot is switched, obtaining a public network IP address of the streaming media robot after the router is switched, judging whether the streaming media robot and a streaming media target terminal are in the same local area network or not according to the public network IP address of the streaming media robot and a preset public network IP address of the streaming media target terminal, and if the streaming media robot and the streaming media target terminal are not in the same local area network, establishing transmission connection between the streaming media robot and the streaming media target terminal through NAT penetration, namely reestablishing the transmission connection between the streaming media robot and the streaming media target terminal in the switched local area network, and ensuring continuous transmission of streaming media.

Description

Streaming media transmission method and device, terminal equipment and computer readable storage medium
Technical Field
The present invention relates to the field of robotics, and in particular, to a streaming media transmission method, apparatus, terminal device, and computer-readable storage medium.
Background
With the continuous development of robotics, the application fields of the robotics are becoming wider and wider, for example, many enterprises and scientific research institutions have started to use robots to collect streaming media such as audio and video.
In the existing streaming media transmission method, the positions of the streaming media source terminal and the streaming media target terminal are generally fixed and variable, and the transmission connection between the streaming media source terminal and the streaming media target terminal is preset, and after the transmission connection is set, the transmission connection will not change.
However, in the application scenario of the robot, the robot is often required to be in continuous motion, and the position of the robot is continuously changed, so that the transmission connection preset in the process is very easy to be interrupted, and the streaming media cannot be continuously transmitted. For example, if the robot and the target terminal are both in the coverage area of the lan a in the initial state, the worker sets the transmission connection between the robot and the target terminal based on the setting, but moves to the coverage area of the lan B in the process of acquiring the streaming media by the robot, and at this time, the original transmission connection is interrupted.
Disclosure of Invention
In view of this, embodiments of the present invention provide a streaming media transmission method, an apparatus, a terminal device, and a computer-readable storage medium, so as to solve the problem that a preset transmission connection is easily interrupted during a continuous movement of a robot in the prior art, and the streaming media transmission cannot be continued.
A first aspect of an embodiment of the present invention provides a streaming media transmission method, which may include:
detecting whether a router connected with a streaming media robot is switched, wherein the streaming media robot is a robot for collecting and transmitting streaming media;
if the router connected with the streaming media robot is switched, acquiring the public network IP address of the streaming media robot after the router is switched;
judging whether the streaming media robot and the streaming media target terminal are in the same local area network or not according to the public network IP address of the streaming media robot and the preset public network IP address of the streaming media target terminal;
and if the streaming media robot and the streaming media target terminal are not in the same local area network, establishing transmission connection between the streaming media robot and the streaming media target terminal through NAT penetration.
Further, the establishing, through NAT traversal, a transmission connection between the streaming media robot and the streaming media target terminal may include:
establishing communication connection with a preset streaming media server;
acquiring a public network port of the streaming media robot after router switching;
sending an NAT (network address translation) penetration instruction to the streaming media server to enable the streaming media server to control the streaming media target terminal to send an NAT penetration detection packet to a public network IP address and a public network port of the streaming media robot so as to establish transmission connection from the streaming media robot to the streaming media target terminal, wherein the NAT penetration instruction comprises the public network IP address and the public network port of the streaming media robot and the public network IP address and the public network port of the streaming media target terminal;
and sending an NAT penetration detection packet to a preset public network IP address and a preset public network port of the streaming media target terminal, so as to establish transmission connection from the streaming media target terminal to the streaming media robot.
Further, before establishing a transmission connection between the streaming media robot and the streaming media target terminal through NAT traversal, the method may further include:
sending a UPNP function query instruction to the switched router;
receiving feedback information sent by the router after switching;
judging whether the switched router has a UPNP function or not according to the feedback information;
if the switched router has the UPNP function, establishing UPNP mapping between the streaming media robot and a preset streaming media server according to a UPNP protocol so as to establish transmission connection between the streaming media robot and the streaming media target terminal through the streaming media server.
Further, after determining whether the streaming media robot and the streaming media target terminal are in the same local area network, the method may further include:
if the streaming media robot and the streaming media target terminal are in the same local area network, acquiring a local area network IP address and a local area network port of the streaming media robot after router switching;
and sending the local area network IP address and the local area network port of the streaming media robot to the streaming media target terminal so that the streaming media target terminal establishes transmission connection with the streaming media robot through the local area network IP address and the local area network port of the streaming media robot.
Further, the detecting whether a router connected to the streaming media robot is switched may include:
acquiring a first service set identifier of a router connected with the streaming media robot at the current detection time;
comparing the first service set identifier with a second service set identifier to obtain a comparison result, wherein the second server identifier is a pre-stored service set identifier of a router connected with the streaming media robot before the current detection moment;
and if the comparison result is inconsistent, determining that the router connected with the streaming media robot is switched.
A second aspect of an embodiment of the present invention provides a streaming media transmission apparatus, which may include:
the switching detection module is used for detecting whether a router connected with the streaming media robot is switched or not, and the streaming media robot is a robot for collecting and transmitting streaming media;
the public network IP address acquisition module is used for acquiring a public network IP address of the streaming media robot after the router is switched if the router connected with the streaming media robot is switched;
the local area network judging module is used for judging whether the streaming media robot and the streaming media target terminal are in the same local area network or not according to the public network IP address of the streaming media robot and the preset public network IP address of the streaming media target terminal;
and the NAT penetration module is used for establishing the transmission connection between the streaming media robot and the streaming media target terminal through NAT penetration if the streaming media robot and the streaming media target terminal are not in the same local area network.
Further, the NAT traversal module may include:
the communication connection unit is used for establishing communication connection with a preset streaming media server;
a public network port obtaining unit, configured to obtain a public network port of the streaming media robot after router switching;
an NAT traversal instruction sending unit, configured to send an NAT traversal instruction to the streaming media server, so that the streaming media server controls the streaming media target terminal to send an NAT traversal probe packet to a public network IP address and a public network port of the streaming media robot, so as to establish a transmission connection from the streaming media robot to the streaming media target terminal, where the NAT traversal instruction includes the public network IP address and the public network port of the streaming media robot, and the public network IP address and the public network port of the streaming media target terminal;
and the NAT penetration detection packet sending unit is used for sending an NAT penetration detection packet to a preset public network IP address and a preset public network port of the streaming media target terminal so as to establish transmission connection from the streaming media target terminal to the streaming media robot.
Further, the streaming media transmission apparatus may further include:
the query instruction sending module is used for sending a UPNP function query instruction to the switched router;
a feedback information receiving module, configured to receive feedback information sent by the switched router;
a UPNP function judging module, configured to judge whether the switched router has a UPNP function according to the feedback information;
and a UPNP mapping module, configured to establish a UPNP mapping between the streaming media robot and a preset streaming media server according to a UPNP protocol if the switched router has a UPNP function, so that the streaming media robot and the streaming media target terminal establish a transmission connection through the streaming media server.
Further, the streaming media transmission apparatus may further include:
a local area network information obtaining module, configured to obtain a local area network IP address and a local area network port of the streaming media robot after router switching if the streaming media robot and the streaming media target terminal are in the same local area network;
and the local area network transmission connection establishing module is used for sending the local area network IP address and the local area network port of the streaming media robot to the streaming media target terminal so that the streaming media target terminal establishes transmission connection with the streaming media robot through the local area network IP address and the local area network port of the streaming media robot.
Further, the handover detection module may include:
a service set identifier obtaining unit, configured to obtain a first service set identifier of a router connected to the streaming media robot at a current detection time;
a service set identifier comparison unit, configured to compare the first service set identifier with a second service set identifier to obtain a comparison result, where the second server identifier is a service set identifier of a router that is pre-stored and is connected to the streaming media robot before the current detection time;
and the switching determining module is used for determining that the router connected with the streaming media robot is switched if the comparison result is inconsistent.
A third aspect of the embodiments of the present invention provides streaming media transmission terminal equipment, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of any of the streaming media transmission methods when executing the computer program.
A fourth aspect of the embodiments of the present invention provides a computer-readable storage medium, which stores a computer program, where the computer program is executed by a processor to implement the steps of any one of the above streaming media transmission methods.
Compared with the prior art, the embodiment of the invention has the following beneficial effects: the embodiment of the invention detects whether a router connected with a streaming media robot is switched, if the router connected with the streaming media robot is switched, the streaming media robot enters a new local area network in the moving process, the original transmission connection cannot be used, at this time, the public network IP address of the streaming media robot after the router is switched is obtained, whether the streaming media robot and the streaming media target terminal are in the same local area network is judged according to the public network IP address of the streaming media robot and the preset public network IP address of the streaming media target terminal, if the streaming media robot and the streaming media target terminal are not in the same local area network, the transmission connection between the streaming media robot and the streaming media target terminal is established through penetration, namely, the transmission connection between the streaming media robot and the streaming media target terminal is re-established in the switched local area network NAT, continuous transmission of streaming media is guaranteed.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a schematic flow chart of a streaming media transmission method according to an embodiment of the present invention;
fig. 2 is a schematic flow chart of a streaming media transmission method according to a second embodiment of the present invention;
fig. 3 is a schematic block diagram of a streaming media transmission apparatus according to a third embodiment of the present invention;
fig. 4 is a schematic block diagram of a streaming media transmission terminal device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, features and advantages of the present invention more obvious and understandable, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is obvious that the embodiments described below are only a part of the embodiments of the present invention, and 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.
The first embodiment is as follows:
as shown in fig. 1, which is a schematic flowchart of a streaming media transmission method provided in an embodiment of the present invention, the method may include:
and step S101, detecting whether a router connected with the streaming media robot is switched or not.
The streaming media robot is a robot that collects and transmits streaming media. In this embodiment, a first service set identifier of a router connected to the streaming media robot at a current detection time may be obtained first. The Service Set Identifier (SSID) is used to distinguish different networks, the router broadcasts the SSID, and the streaming media robot obtains the SSID by analyzing the broadcast information. Specifically, the information contained in the broadcast information is arranged in order: timestamp (8 bytes), Beacon interval (2 bytes), Capability Information (2 bytes), SSID (9 bytes) … …, wherein the contents of the 9 bytes from 13 th to 21 th are intercepted as the SSID of the router.
And then, comparing the first service set identifier with a second service set identifier to obtain a comparison result, wherein the second server identifier is a pre-stored service set identifier of a router connected with the streaming media robot before the current detection moment.
If the comparison result is consistent, it is determined that the router connected to the streaming media robot is not switched, and at this time, step S102 is performed, and if the comparison result is inconsistent, it is determined that the router connected to the streaming media robot is switched, and at this time, step S103 and subsequent steps are performed.
And step S102, keeping the original transmission connection.
Under the condition that the router is not switched, the original transmission connection is still effective, and the streaming media robot and the streaming media target terminal can still transmit the streaming media through the original transmission connection.
And step S103, acquiring the public network IP address of the streaming media robot after the router is switched.
In the local area network provided by the new router, the new router sets a public network IP address and a public network port, a local area network IP address and a local area network port and a mapping relation between the public network IP address and the public network port and the local area network port for the streaming media robot.
And step S104, judging whether the streaming media robot and the streaming media target terminal are in the same local area network.
In this embodiment, whether the public network IP address of the streaming robot and the preset public network IP address of the streaming target terminal are in the same lan or not is determined according to the public network IP address of the streaming robot and the preset public network IP address of the streaming target terminal, if the public network IP addresses of the streaming robot and the preset public network IP address of the streaming target terminal belong to the same network segment, it is determined that the streaming robot and the streaming target terminal are in the same lan, at this time, step S105 is executed, if the public network IP addresses of the streaming robot and the streaming target terminal do not belong to the same network segment, it is determined that the streaming robot and the streaming target terminal are not in the same lan, it is determined that the streaming target terminal and the streaming target terminal are not in the same lan, and at this time, step S106 is executed.
And step S105, establishing transmission connection between the streaming media robot and the streaming media target terminal in a local area network.
Specifically, a local area network IP address and a local area network port of the streaming media robot after router switching are first acquired, and then the local area network IP address and the local area network port of the streaming media robot are sent to the streaming media target terminal, so that the streaming media target terminal establishes transmission connection with the streaming media robot through the local area network IP address and the local area network port of the streaming media robot.
And S106, establishing transmission connection between the streaming media robot and the streaming media target terminal through NAT penetration.
With the increasing number of internet users, the internet protocol version four (IPv4) address resource used by the internet is very tight, and it is not enough to make every user have an IPv4 address, i.e. a public network IP address, which can directly access the internet. In order to enable users in enterprises to use internet resources, enterprises generally adopt a Network Address Translation (NAT) technology to convert the local area Network IP Address in the enterprise into a public Network IP Address capable of directly accessing the internet, so that one or more users in the enterprises can use one public Network IP Address to access the internet.
Although the use of the NAT technology can temporarily alleviate the crisis of IPv4 address resources, the NAT technology can affect the internet interoperability since it can limit the access of internet users to users inside the enterprise behind the NAT device. In order to enable users located in the internet to access users located inside the enterprise behind the NAT device, NAT traversal technology needs to be used to traverse the NAT device.
In this embodiment, NAT traversal may be specifically performed through the following steps: firstly, the streaming media robot establishes communication connection with a preset streaming media server, then obtains a public network port of the streaming media robot after router switching, and sends NAT penetration instruction to the streaming media server, the NAT penetration instruction includes the public network IP address and the public network port of the streaming media robot, and the public network IP address and the public network port of the streaming media target terminal, so that the streaming media server controls the streaming media target terminal to send an NAT penetration detection packet to the public network IP address and the public network port of the streaming media robot, thereby establishing a transmission connection from the streaming robot to the streaming target terminal, and finally, and the streaming media robot sends an NAT penetration detection packet to a preset public network IP address and a preset public network port of the streaming media target terminal, so that transmission connection from the streaming media target terminal to the streaming media robot is established.
To sum up, the embodiment of the present invention detects whether a router connected to a streaming media robot is switched, and if the router connected to the streaming media robot is switched, it indicates that the streaming media robot enters a new local area network during a moving process, and an original transmission connection is not already available, at this time, a public network IP address of the streaming media robot after the router is switched is obtained, and it is determined whether the streaming media robot and the streaming media target terminal are in the same local area network according to the public network IP address of the streaming media robot and a preset public network IP address of the streaming media target terminal, if the streaming media robot and the streaming media target terminal are not in the same local area network, a transmission connection between the streaming media robot and the streaming media target terminal is established through NAT, that is, a transmission connection between the streaming media robot and the streaming media target terminal is re-established in the switched local area network, continuous transmission of streaming media is guaranteed.
Example two:
as shown in fig. 2, which is a schematic flowchart of a streaming media transmission method provided in an embodiment of the present invention, the method may include:
step S201, whether a router connected with the streaming media robot is switched or not is detected.
If the router connected to the streaming media robot is not switched, step S202 is executed, and if the router connected to the streaming media robot is switched, step S203 and the following steps are executed.
Step S202, the original transmission connection is kept.
And step S203, acquiring the public network IP address of the streaming media robot after the router is switched.
And step S204, judging whether the streaming media robot and the streaming media target terminal are in the same local area network.
If both are in the same lan, step S205 is executed, and if both are not in the same lan, step S206 and the following steps are executed.
And step S205, establishing the transmission connection between the streaming media robot and the streaming media target terminal in the local area network.
The process from step S201 to step S205 is similar to the process from step S101 to step S105 in the first embodiment, and specific reference may be made to the detailed description in the first embodiment, which is not repeated herein.
And step S206, sending a UPNP function inquiry command to the switched router.
Universal Plug and Play (UPNP) is an architecture for common peer-to-peer network connections for computers and smart devices. UPNP is based on Internet standards and technologies that allow such devices to automatically connect and interoperate with each other.
When accessing the switched router, the streaming media robot does not know whether the router has the UPNP function, and therefore, a UPNP function query instruction needs to be sent to the switched router.
And step S207, receiving the feedback information sent by the switched router.
After receiving the UPNP function query instruction sent by the streaming media robot, the router after switching sends feedback information to the streaming media robot, and the streaming media robot can know whether the router after switching has the UPNP function or not by reading the feedback information.
And step S208, judging whether the switched router has a UPNP function.
If the switched router has the UPNP function, step S209 is executed, and if the switched router does not have the UPNP function, step S210 is executed.
Step S209, establishing UPNP mapping between the streaming media robot and a preset streaming media server according to a UPNP protocol so as to establish transmission connection between the streaming media robot and the streaming media target terminal through the streaming media server.
Firstly, performing UPNP mapping on a local area network IP address and a local area network port of the streaming media robot, namely establishing a mapping relation between the local area network IP address and the local area network port of the streaming media robot and a public network IP address and a public network port of the streaming media server, and performing UPNP mapping on the local area network IP address and the local area network port of the streaming media robot so that a transmission request sent by a streaming media target terminal can be forwarded to the streaming media robot by the streaming media server after reaching the streaming media server. For example, if the local area network IP address of the streaming media robot is IP 1: 192.168.0.1, PORT number of local area network PORT is PORT 1: 7766, the public network IP address of the streaming server connected to said streaming robot is IP 2: 222.222.222.222, PORT number of public network PORT is PORT 2: 3344 and the port mapped public IP address and public port are mapped to 222.222.222.222 and 3344, respectively.
Then, the streaming media robot binds the public network IP address obtained by the port mapping, the public network port and the identification of the streaming media robot and reports the binding to the streaming media server. In the embodiment of the present invention, the identifier of the streaming media robot may specifically be the device ID of the intelligent device, and certainly, may also be other identifiers capable of uniquely indicating the streaming media robot, which is not specifically limited herein. After the port mapping is carried out, the streaming media robot binds the public network IP address, the public network port and the identification of the streaming media robot obtained after the mapping and reports the public network IP address, the public network port and the identification of the streaming media robot to the streaming media server. For example, if the local area network IP address of the streaming media robot is IP 1: 192.168.0.1, PORT number of the local area network PORT is PORT 1: 7766, the public network IP address obtained by said mapping is IP 2: 222.222.222.222, PORT number of public network PORT is PORT 2: 3344. if the identifier of the streaming media robot is S1, the streaming media robot binds the public network IP address 222.222.222.222, the public network port 3344 and the identifier of the streaming media robot S1, and reports the binding to the streaming media server.
When the streaming media server receives a transmission request of the streaming media target terminal to the streaming media robot, the streaming media server acquires a corresponding public network IP address and a public network port according to the identification of the streaming media robot carried in the transmission request, and forwards the received transmission request to the streaming media robot according to a port mapping relation. The streaming media robot monitors a local area network port, can timely know whether a transmission request is received or not, and responds to the received transmission request when receiving the transmission request, so that the streaming media robot and the streaming media target terminal establish transmission connection through the streaming media server.
And step S210, establishing transmission connection between the streaming media robot and the streaming media target terminal through NAT penetration.
The process of step S210 is similar to the process of step S106 in the first embodiment, and specific reference may be made to the detailed description in the first embodiment, which is not repeated herein.
If the NAT traversal fails, the transmission connection between the streaming media robot and the streaming media target terminal can only be transferred through the streaming media server, specifically, the streaming media robot first sends streaming media to the streaming media server, and then the streaming media target terminal receives the streaming media from the streaming media server.
In summary, in the embodiment of the present invention, on the basis of the first embodiment, the streaming media robot and the streaming media target terminal may perform transmission connection under various conditions, that is, if the streaming media robot and the streaming media target terminal are in the same local area network, direct transmission in the local area network is performed; if the two different networks are different but the router has the UPNP function, the transmission is carried out according to the port mapping established by the UPNP protocol; if the two networks are different and the router does not have the UPNP function, the transmission connection is established through NAT penetration; if NAT fails to penetrate, then transit transmission is carried out through the streaming media server. And the transmission connection between the streaming media robot and the streaming media target terminal can be reestablished in the switched local area network under various conditions, so that the continuous transmission of the streaming media is ensured.
Example three:
fig. 3 is a schematic block diagram of a streaming media transmission apparatus according to an embodiment of the present invention, where the apparatus may include:
a switching detection module 301, configured to detect whether a router connected to a streaming media robot is switched, where the streaming media robot is a robot that collects and transmits streaming media;
a public network IP address obtaining module 302, configured to obtain a public network IP address of the streaming media robot after router switching if a router connected to the streaming media robot is switched;
a local area network determining module 303, configured to determine whether the streaming media robot and the streaming media target terminal are in the same local area network according to a public network IP address of the streaming media robot and a preset public network IP address of the streaming media target terminal;
and an NAT traversal module 304, configured to establish a transmission connection between the streaming media robot and the streaming media target terminal through NAT traversal if the streaming media robot and the streaming media target terminal are not in the same local area network.
Further, the NAT traversal module may include:
the communication connection unit is used for establishing communication connection with a preset streaming media server;
a public network port obtaining unit, configured to obtain a public network port of the streaming media robot after router switching;
an NAT traversal instruction sending unit, configured to send an NAT traversal instruction to the streaming media server, so that the streaming media server controls the streaming media target terminal to send an NAT traversal probe packet to a public network IP address and a public network port of the streaming media robot, so as to establish a transmission connection from the streaming media robot to the streaming media target terminal, where the NAT traversal instruction includes the public network IP address and the public network port of the streaming media robot, and the public network IP address and the public network port of the streaming media target terminal;
and the NAT penetration detection packet sending unit is used for sending an NAT penetration detection packet to a preset public network IP address and a preset public network port of the streaming media target terminal so as to establish transmission connection from the streaming media target terminal to the streaming media robot.
Further, the streaming media transmission apparatus may further include:
the query instruction sending module is used for sending a UPNP function query instruction to the switched router;
a feedback information receiving module, configured to receive feedback information sent by the switched router;
a UPNP function judging module, configured to judge whether the switched router has a UPNP function according to the feedback information;
and a UPNP mapping module, configured to establish a UPNP mapping between the streaming media robot and a preset streaming media server according to a UPNP protocol if the switched router has a UPNP function, so that the streaming media robot and the streaming media target terminal establish a transmission connection through the streaming media server.
Further, the streaming media transmission apparatus may further include:
a local area network information obtaining module, configured to obtain a local area network IP address and a local area network port of the streaming media robot after router switching if the streaming media robot and the streaming media target terminal are in the same local area network;
and the local area network transmission connection establishing module is used for sending the local area network IP address and the local area network port of the streaming media robot to the streaming media target terminal so that the streaming media target terminal establishes transmission connection with the streaming media robot through the local area network IP address and the local area network port of the streaming media robot.
Further, the handover detection module may include:
a service set identifier obtaining unit, configured to obtain a first service set identifier of a router connected to the streaming media robot at a current detection time;
a service set identifier comparison unit, configured to compare the first service set identifier with a second service set identifier to obtain a comparison result, where the second server identifier is a service set identifier of a router that is pre-stored and is connected to the streaming media robot before the current detection time;
and the switching determining module is used for determining that the router connected with the streaming media robot is switched if the comparison result is inconsistent.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
Fig. 4 is a schematic block diagram of a streaming media transmission terminal device according to an embodiment of the present invention. As shown in fig. 4, the streaming media transmission terminal device 4 of this embodiment includes: a processor 40, a memory 41 and a computer program 42 stored in said memory 41 and executable on said processor 40. The processor 40 executes the computer program 42 to implement the steps in the above-mentioned streaming media transmission method embodiments, such as the steps S101 to S106 shown in fig. 1. Alternatively, the processor 40, when executing the computer program 42, implements the functions of each module/unit in the above-mentioned device embodiments, such as the functions of the modules 301 to 304 shown in fig. 3.
Illustratively, the computer program 42 may be partitioned into one or more modules/units that are stored in the memory 41 and executed by the processor 40 to implement the present invention. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used for describing the execution process of the computer program 42 in the streaming terminal device 4. For example, the computer program 42 may be divided into a handover detection module, a public network IP address acquisition module, a local network judgment module, a NAT traversal module, and the like.
The streaming media transmission terminal device 4 may be a desktop computer, a notebook, a palm computer, a cloud server, or other computing devices. The streaming terminal device may include, but is not limited to, a processor 40 and a memory 41. Those skilled in the art will appreciate that fig. 4 is only an example of the streaming terminal device 4, and does not constitute a limitation of the streaming terminal device 4, and may include more or less components than those shown, or combine some components, or different components, for example, the streaming terminal device 4 may further include an input/output device, a network access device, a bus, etc.
The Processor 40 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 41 may be an internal storage unit of the streaming media transmission terminal device 4, such as a hard disk or a memory of the streaming media transmission terminal device 4. The memory 41 may also be an external storage device of the streaming Media transmission terminal device 4, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are equipped on the streaming Media transmission terminal device 4. Further, the memory 41 may include both an internal storage unit and an external storage device of the streaming terminal device 4. The memory 41 is used to store the computer program and other programs and data required by the streaming terminal device 4. The memory 41 may also be used to temporarily store data that has been output or is to be output.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus/terminal device and method may be implemented in other ways. For example, the above-described embodiments of the apparatus/terminal device are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implemented, 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 through some interfaces, devices or units, 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 of 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 integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated modules/units, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may also be implemented by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method embodiments may be implemented. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.

Claims (7)

1. A streaming media transmission method, comprising:
detecting whether a router connected with a streaming media robot is switched, wherein the streaming media robot is a robot for collecting and transmitting streaming media;
if the router connected with the streaming media robot is not switched, the original transmission connection is kept;
if the router connected with the streaming media robot is switched, acquiring the public network IP address of the streaming media robot after the router is switched;
judging whether the streaming media robot and the streaming media target terminal are in the same local area network or not according to the public network IP address of the streaming media robot and the preset public network IP address of the streaming media target terminal;
if the streaming media robot and the streaming media target terminal are in the same local area network, establishing transmission connection between the streaming media robot and the streaming media target terminal in the local area network;
if the streaming media robot and the streaming media target terminal are not in the same local area network, sending a universal plug and play (UPNP) function query instruction to the switched router;
receiving feedback information sent by the router after switching;
judging whether the switched router has a UPNP function or not according to the feedback information;
if the switched router has a UPNP function, establishing UPNP mapping between the streaming media robot and a preset streaming media server according to a UPNP protocol so as to enable the streaming media robot and the streaming media target terminal to establish transmission connection through the streaming media server;
if the switched router does not have the UPNP function, establishing transmission connection between the streaming media robot and the streaming media target terminal through NAT penetration; if the NAT penetration fails, establishing transmission connection between the streaming media robot and the streaming media target terminal through the transfer of the streaming media server;
the detecting whether the router connected with the streaming media robot is switched or not comprises the following steps:
acquiring a first service set identifier of a router connected with the streaming media robot at the current detection time;
comparing the first service set identifier with a second service set identifier to obtain a comparison result, wherein the second server identifier is a pre-stored service set identifier of a router connected with the streaming media robot before the current detection moment;
if the comparison result is consistent, determining that the router connected with the streaming media robot is not switched;
and if the comparison result is inconsistent, determining that the router connected with the streaming media robot is switched.
2. The streaming media transmission method according to claim 1, wherein the establishing of the transmission connection between the streaming media robot and the streaming media target terminal through NAT traversal comprises:
establishing communication connection with the streaming media server;
acquiring a public network port of the streaming media robot after router switching;
sending an NAT (network address translation) penetration instruction to the streaming media server to enable the streaming media server to control the streaming media target terminal to send an NAT penetration detection packet to a public network IP address and a public network port of the streaming media robot so as to establish transmission connection from the streaming media robot to the streaming media target terminal, wherein the NAT penetration instruction comprises the public network IP address and the public network port of the streaming media robot and the public network IP address and the public network port of the streaming media target terminal;
and sending an NAT penetration detection packet to a preset public network IP address and a preset public network port of the streaming media target terminal, so as to establish transmission connection from the streaming media target terminal to the streaming media robot.
3. The streaming media transmission method according to claim 1, wherein the establishing of the transmission connection between the streaming media robot and the streaming media target terminal in the local area network comprises:
acquiring a local area network IP address and a local area network port of the streaming media robot after the router is switched;
and sending the local area network IP address and the local area network port of the streaming media robot to the streaming media target terminal so that the streaming media target terminal establishes transmission connection with the streaming media robot through the local area network IP address and the local area network port of the streaming media robot.
4. A streaming media transmission apparatus, comprising:
the switching detection module is used for detecting whether a router connected with the streaming media robot is switched or not, and the streaming media robot is a robot for collecting and transmitting streaming media;
the public network IP address acquisition module is used for keeping the original transmission connection if the router connected with the streaming media robot is not switched; if the router connected with the streaming media robot is switched, acquiring the public network IP address of the streaming media robot after the router is switched;
the local area network judging module is used for judging whether the streaming media robot and the streaming media target terminal are in the same local area network or not according to the public network IP address of the streaming media robot and the preset public network IP address of the streaming media target terminal;
the query instruction sending module is used for establishing transmission connection between the streaming media robot and the streaming media target terminal in a local area network if the streaming media robot and the streaming media target terminal are in the same local area network; if the streaming media robot and the streaming media target terminal are not in the same local area network, sending a universal plug and play (UPNP) function query instruction to the switched router;
a feedback information receiving module, configured to receive feedback information sent by the switched router;
a UPNP function judging module, configured to judge whether the switched router has a UPNP function according to the feedback information;
a UPNP mapping module, configured to establish a UPNP mapping between the streaming media robot and a preset streaming media server according to a UPNP protocol if the switched router has a UPNP function, so that the streaming media robot and the streaming media target terminal establish a transmission connection through the streaming media server;
an NAT traversal module, configured to establish a transmission connection between the streaming media robot and the streaming media target terminal through NAT traversal by using a Network Address Translation (NAT) if the switched router does not have a UPNP function; if the NAT penetration fails, establishing transmission connection between the streaming media robot and the streaming media target terminal through the transfer of the streaming media server;
the handover detection module includes:
a service set identifier obtaining unit, configured to obtain a first service set identifier of a router connected to the streaming media robot at a current detection time;
a service set identifier comparison unit, configured to compare the first service set identifier with a second service set identifier to obtain a comparison result, where the second server identifier is a service set identifier of a router that is pre-stored and is connected to the streaming media robot before the current detection time;
the switching determining unit is used for determining that the router connected with the streaming media robot is not switched if the comparison result is consistent; and if the comparison result is inconsistent, determining that the router connected with the streaming media robot is switched.
5. The streaming media transmission device of claim 4, wherein the NAT traversal module comprises:
the communication connection unit is used for establishing communication connection with the streaming media server;
a public network port obtaining unit, configured to obtain a public network port of the streaming media robot after router switching;
an NAT traversal instruction sending unit, configured to send an NAT traversal instruction to the streaming media server, so that the streaming media server controls the streaming media target terminal to send an NAT traversal probe packet to a public network IP address and a public network port of the streaming media robot, so as to establish a transmission connection from the streaming media robot to the streaming media target terminal, where the NAT traversal instruction includes the public network IP address and the public network port of the streaming media robot, and the public network IP address and the public network port of the streaming media target terminal;
and the NAT penetration detection packet sending unit is used for sending an NAT penetration detection packet to a preset public network IP address and a preset public network port of the streaming media target terminal so as to establish transmission connection from the streaming media target terminal to the streaming media robot.
6. Streaming media transmission terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor realizes the steps of the streaming media transmission method according to any of claims 1 to 3 when executing the computer program.
7. A computer-readable storage medium, in which a computer program is stored, which, when being executed by a processor, carries out the steps of the streaming media transmission method according to any one of claims 1 to 3.
CN201711483717.6A 2017-12-29 2017-12-29 Streaming media transmission method and device, terminal equipment and computer readable storage medium Active CN109995660B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711483717.6A CN109995660B (en) 2017-12-29 2017-12-29 Streaming media transmission method and device, terminal equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711483717.6A CN109995660B (en) 2017-12-29 2017-12-29 Streaming media transmission method and device, terminal equipment and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN109995660A CN109995660A (en) 2019-07-09
CN109995660B true CN109995660B (en) 2021-12-17

Family

ID=67110016

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711483717.6A Active CN109995660B (en) 2017-12-29 2017-12-29 Streaming media transmission method and device, terminal equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN109995660B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112866365A (en) * 2021-01-11 2021-05-28 杭州复杂美科技有限公司 Node communication method, computer device, and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8228861B1 (en) * 2008-09-12 2012-07-24 Nix John A Efficient handover of media communications in heterogeneous IP networks using handover procedure rules and media handover relays
CN103957287A (en) * 2014-04-25 2014-07-30 浙江大学城市学院 Internet of things device P2P connection method based on NAT penetration adapter

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101123540B (en) * 2007-08-21 2010-12-08 广东志成冠军集团有限公司 A monitoring method and system based on heterogeneous network
CN101540684A (en) * 2008-03-17 2009-09-23 纬创资通股份有限公司 Device agent method for universal plug and play network system and related device thereof
CN103067357B (en) * 2012-12-14 2015-11-11 北京思特奇信息技术股份有限公司 A kind of converged communication system IP phone Media Stream route system and implementation method
CN104135443B (en) * 2014-06-27 2018-07-27 小米科技有限责任公司 Router control method and device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8228861B1 (en) * 2008-09-12 2012-07-24 Nix John A Efficient handover of media communications in heterogeneous IP networks using handover procedure rules and media handover relays
CN103957287A (en) * 2014-04-25 2014-07-30 浙江大学城市学院 Internet of things device P2P connection method based on NAT penetration adapter

Also Published As

Publication number Publication date
CN109995660A (en) 2019-07-09

Similar Documents

Publication Publication Date Title
US11510060B2 (en) Method and a device for detecting wireless network security
CN110830575B (en) Data transmission method and control system of intelligent household equipment and intelligent gateway equipment
JP5889445B2 (en) Method and apparatus for identifying an application associated with an IP flow using DNS data
US10630551B2 (en) Method and apparatus for automatic networking of gateway device
EP3157230A1 (en) Method for acquiring identifier of terminal in network, management network element and storage medium
US10862862B2 (en) Identifying devices on a remote network
CN112261094A (en) Message processing method and proxy server
CN110691110B (en) Communication method, device, system, terminal, equipment and medium
CN108370334B (en) Network connectivity detection
CN104969515A (en) Methods and gateways for processing DNS request
CN103560973A (en) Method and device for filtering data packets
US20040076121A1 (en) Method for an internet communication
CN103987098B (en) IPV4 networks and the internetwork switching methods of IPV6 and system
CN109995660B (en) Streaming media transmission method and device, terminal equipment and computer readable storage medium
US20160294465A1 (en) Information collection system, relay terminal, control method for relay terminal to connect to center system, sensor terminal, and control method for sensor terminal to connect to center system
CN110535746B (en) Virtual private network VPN sharing method and device, electronic equipment and storage medium
WO2017088592A1 (en) Method and system for controlling access to wireless network by client
US11546232B1 (en) Video analysis and data delivery method
CN111385371B (en) MAC address acquisition method, device and equipment
CN111106977B (en) Data stream detection method, device and storage medium
CN105610763A (en) Protocol identification method and protocol identification device
KR101721418B1 (en) Reverse system of server and client
CN106209464A (en) The discovery method of terminal, terminal and management system thereof
CN115633018A (en) Device registration method, device, storage medium and electronic device
CN113032659B (en) Information processing method for device information, electronic device and 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
CP01 Change in the name or title of a patent holder

Address after: 518000 16th and 22nd Floors, C1 Building, Nanshan Zhiyuan, 1001 Xueyuan Avenue, Nanshan District, Shenzhen City, Guangdong Province

Patentee after: Shenzhen UBTECH Technology Co.,Ltd.

Address before: 518000 16th and 22nd Floors, C1 Building, Nanshan Zhiyuan, 1001 Xueyuan Avenue, Nanshan District, Shenzhen City, Guangdong Province

Patentee before: Shenzhen UBTECH Technology Co.,Ltd.

CP01 Change in the name or title of a patent holder
TR01 Transfer of patent right

Effective date of registration: 20230818

Address after: No. 60, Guohe Road, Yangpu District, Shanghai 200082

Patentee after: Shanghai youbijie Education Technology Co.,Ltd.

Address before: 518000 16th and 22nd Floors, C1 Building, Nanshan Zhiyuan, 1001 Xueyuan Avenue, Nanshan District, Shenzhen City, Guangdong Province

Patentee before: Shenzhen UBTECH Technology Co.,Ltd.

TR01 Transfer of patent right