CN114666306A - WebRTC network connection establishing method, server, electronic device and computer readable storage medium - Google Patents

WebRTC network connection establishing method, server, electronic device and computer readable storage medium Download PDF

Info

Publication number
CN114666306A
CN114666306A CN202210153311.6A CN202210153311A CN114666306A CN 114666306 A CN114666306 A CN 114666306A CN 202210153311 A CN202210153311 A CN 202210153311A CN 114666306 A CN114666306 A CN 114666306A
Authority
CN
China
Prior art keywords
network
client
server
application instance
connection establishment
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210153311.6A
Other languages
Chinese (zh)
Inventor
彭成
郑晓
龙欣
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba China Co Ltd
Original Assignee
Alibaba China 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 Alibaba China Co Ltd filed Critical Alibaba China Co Ltd
Priority to CN202210153311.6A priority Critical patent/CN114666306A/en
Publication of CN114666306A publication Critical patent/CN114666306A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/1066Session management
    • H04L65/1069Session establishment or de-establishment
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/04Real-time or near real-time messaging, e.g. instant messaging [IM]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/07User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail characterised by the inclusion of specific contents
    • H04L51/10Multimedia information
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Multimedia (AREA)
  • Business, Economics & Management (AREA)
  • General Business, Economics & Management (AREA)
  • Computer And Data Communications (AREA)

Abstract

The application discloses a WebRTC network connection establishing method, a server, electronic equipment and a computer readable storage medium. The method is applied to a server comprising an application instance, and comprises the following steps: according to a WebRTC connection establishment request sent by a client, the application instance acquires a first network address from a network module in the server, wherein the first network address is a network address which is allocated to the application instance by the network module to establish network connection with the client; sending the first network address to the client; and establishing the network connection with the client by the application instance according to the instruction of the client for establishing the network connection by using the first network address. According to the method and the device, the server can provide network information of direct network connection for the application examples in the server by means of the network address acquisition capability of the server, and the reliability and the stability of connection establishment between the client and the application examples in the server are greatly improved.

Description

WebRTC network connection establishing method, server, electronic device and computer readable storage medium
Technical Field
The present application relates to the field of network technologies, and in particular, to a WebRTC network connection establishing method, a server, an electronic device, and a computer-readable storage medium.
Background
With the development of communication technology, users can use the internet network to carry out real-time communication based on audio and video, and real-time communication among the users is greatly facilitated. For example, a Web-based instant messaging technology (WebRTC) has been proposed, in which a user can be allowed to have a Real-Time voice conversation or a video conversation through a Web browser. Due to the fact that the technical scheme has the characteristics of low time delay, self-adaptive network bandwidth and high platform compatibility, a user can carry out real-time audio and video communication on a webpage through a browser with the built-in module, and a special application program does not need to be additionally installed. Therefore, the technical scheme has been widely applied.
In recent years, cloud service functions based on WebRTC technology have been proposed, and a user can use various cloud computing resources provided by a cloud server by using a browser on a terminal. For example, a cloud service provider may use computing resources on a cloud server to perform personalized virtual machine service for a user, so that the user may own a dedicated virtual terminal on the cloud server. In this case, since the WebRTC technology enables the user to establish a point-to-point (P2P) direct connection with the virtual terminal on the cloud server, the user can directly transmit the data of the user to the virtual terminal to perform a task without relaying through the cloud server, and thus privacy security of the user data is greatly ensured.
Disclosure of Invention
Embodiments of the present application provide a WebRTC network connection establishment method, a server, an electronic device, and a computer-readable storage medium, so as to solve a defect in the prior art that establishing a direct network connection needs to depend on a third-party server.
In order to achieve the above object, an embodiment of the present application provides a WebRTC network connection establishing method, which is applied to a server including an application instance, and the method includes:
according to a WebRTC connection establishment request sent by a client, the application instance acquires a first network address from a network module in the server, wherein the first network address is a network address which is allocated to the application instance by the network module to establish network connection with the client, and the network module binds the first network address with a network card of the application instance;
sending the first network address to the client;
and establishing the network connection with the client by the application instance according to the instruction of establishing the network connection by the client by using the first network address.
Embodiments of the present application further provide a server, which includes an application instance, a network module, and a signaling module, wherein,
the application instance is used for acquiring a first network address from the network module according to a WebRTC connection establishment request sent by a client, wherein the first network address is a network address which is allocated to the application instance by the network module to establish network connection with the client, and the network module binds the first network address with a network card of the application instance;
the signaling module is used for receiving a WebRTC connection establishment request of the client, receiving an instruction of the client for establishing network connection by using the first network address, and sending the first network address to the client;
wherein the application instance is further to: and establishing network connection with the client according to the instruction.
An embodiment of the present application further provides an electronic device, including:
a memory for storing a program;
and the processor is used for operating the program stored in the memory, and the program executes the WebRTC network connection establishment method provided by the embodiment of the application when running.
Embodiments of the present application further provide a computer-readable storage medium on which a computer program executable by a processor is stored, where the program, when executed by the processor, implements the WebRTC network connection establishment method provided in an embodiment of the present application.
The WebRTC network connection establishing method, the server, the electronic device and the computer readable storage medium provided by the embodiment of the application acquire the first network address from the network module in the server by the application instance according to the connection establishing request sent by the client, send the first network address to the client, and establish the network connection with the client by the application instance according to the instruction of the client for establishing the network connection by using the first network address, so that the application instance in the server can acquire the first network address which can be used by the client for establishing the connection with the application instance without depending on an external third-party server, and the client can directly establish the direct network connection with the application connection in the server according to the first network address, therefore, the server can provide the network information of the direct network connection for the application instance in the server by means of the network address acquiring capability of the server, the reliability and stability of connection establishment between the client and the application instance in the server are greatly improved.
The foregoing description is only an overview of the technical solutions of the present application, and the present application can be implemented according to the content of the description in order to make the technical means of the present application more clearly understood, and the following detailed description of the present application is given in order to make the above and other objects, features, and advantages of the present application more clearly understandable.
Drawings
Various additional advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the application. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
fig. 1 is a schematic view of an application scenario of a WebRTC network connection establishment scheme provided in an embodiment of the present application;
fig. 2 is a flowchart of an embodiment of a WebRTC network connection establishment method provided in the present application;
fig. 3 is a flowchart of another embodiment of a WebRTC network connection establishment method provided in the present application;
FIG. 4 is a schematic structural diagram of an embodiment of a server provided in the present application;
fig. 5 is a schematic structural diagram of an embodiment of an electronic device provided in the present application.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
Example one
The scheme provided by the embodiment of the application can be applied to any server supporting network connection, such as a server system comprising a chip with network connection capability and related components, and the like. Fig. 1 is a schematic view of an application scenario of a WebRTC network connection establishment scheme provided in an embodiment of the present application, and the scenario shown in fig. 1 is only one example of an application scenario of the technical scheme of the present application.
With the development of communication technology, users can use the internet network to carry out real-time communication based on audio and video, and real-time communication among the users is greatly facilitated. For example, a Web-based instant messaging technology (WebRTC) has been proposed, in which a user can be allowed to have a Real-Time voice conversation or a video conversation through a Web browser. Due to the fact that the technical scheme has the characteristics of low time delay, self-adaptive network bandwidth and high platform compatibility, a user can carry out real-time audio and video communication on a webpage through a browser with the built-in module, and a special application program does not need to be additionally installed. Therefore, the technical scheme has been widely applied.
In the practical application of the prior art, since no matter the terminal operating environment is a browser, a desktop application, a mobile device (Android or iphone system (iOS)), or an IoT (internet of things) device, the real-time communication of the audio and video can be realized as long as the terminal connection is reachable and conforms to the WebRTC specification. Therefore, the WebRTC technology greatly improves the convenience of a user to perform real-time communication using various smart terminals (or applications running on the smart terminals), so that various application scenarios with high requirements for real-time interactivity can be realized.
Therefore, in recent years, a cloud service function based on the WebRTC technology has been proposed in the related art, and a user can use various cloud computing resources provided by a cloud server by using a browser on a terminal. For example, a cloud service provider may use computing resources on a cloud server to perform personalized virtual machine service for a user, so that the user may own a dedicated virtual terminal on the cloud server. In this case, since the WebRTC technology enables the user to establish a point-to-point (P2P) direct connection with the virtual terminal on the cloud server, the user can directly transmit the data of the user to the virtual terminal to perform a task without relaying through the cloud server, and thus privacy security of the user data is greatly ensured.
In the prior art, a user may establish a connection with an application instance in a WebRTC application instance by accessing a server in which the application instance is deployed, so as to perform real-time audio/video media transmission with the application instance. For example, a cloud service provider provides cloud service products, such as cloud handsets, to users based on virtual machine resources in the cloud service. For example, in the service of a cloud mobile phone, a user may rent computing resources in a cloud server of a cloud service provider to establish a virtual machine for the user, where the virtual machine may run a mobile phone operating system such as android, so that the user may establish a WebRTC connection with a cloud mobile phone instance in the server in the form of a web page through a browser installed in a client, and thus, the cloud mobile phone may be used remotely. Since a user usually generates a large amount of personal privacy data when using the cloud mobile phone, in the prior art, the WebRTC technology supports point-to-point direct communication, and therefore, after the client of the user establishes a direct connection with the cloud mobile phone application instance on the server, various data of the user are directly transmitted between the client of the user and the application instance on the server through the direct connection, thereby ensuring the security of the user privacy.
However, since the cloud mobile application instance on the server is a virtual machine instance generated based on the computing resources on the cloud server, it only has an internal network address allocated by a network module, such as the server, via which data it transceives needs to be forwarded. In other words, the network module of the prior art can only bind the internal network address assigned to the instance to the virtual network card of the instance, so that the application instance cannot be seen from the public network using the public network IP. Therefore, in the prior art, the client needs to know the network information, such as the network IP address, of the application instance in the server to be able to find a link directly communicating with the client to establish a direct connection with the client.
For this reason, in the prior art, it has been proposed to implement interworking of network conditions by obtaining mapping of an IP address of an external network or exchanging network information through a signaling server.
In the ideal network case, the application instance has a private public network IP, so that the client and the application instance in the WebRTC server can connect directly based on the public network IP. In practice, however, as described above, the application instance in the WebRTC server only has an internal network address assigned by, for example, the network module of the server, i.e., only has an internal web address assigned by the network module (e.g., router) of the local area network in the cloud server as its private network address, and needs to access the public network through the network module. For example, when a user uses a browser of a client to access the cloud server to want to use the cloud mobile phone application instance, he may issue a request to use the cloud mobile phone application instance, i.e., a request to establish a WebRTC connection with the cloud mobile phone application instance, by logging into the cloud mobile phone application service on the cloud server, so that the server may forward the request to the cloud mobile phone application instance. The cloud cell phone application instance may thus generate a connection response according to the request, so that, for example, a signaling server in the server may send the connection response to the client as a reply to the connection request sent by the client, to inform the user that a connection may begin.
However, network data such as the above-described connection request and response are actually relayed through the router of the server. In other words, the application instance needs to send its connection response to the signaling module, the signaling module sends the encapsulated response to the router, and the router performs NAT (Network Address Translation) to replace its private internal IP with the public Network IP of the local area Network, so as to send the encapsulated Network request to the destination Address, i.e., the client.
Therefore, when receiving the response, the client can only see the public network IP externally owned by the cloud server where the cloud mobile phone application instance is located, and the public network IP is not actually private to the application instance. In other words, as described above, since the network module in the prior art can only bind the network card of the application instance with the internal network address allocated to the network module, the public network IP can only see the binding with the network module from, for example, an external client, and therefore, when the application instance sends a packet according to the public network IP address in the received connection request, the packet is actually sent to the router because the router has the public network IP address as the only exit to the outside of the cloud server where the application instance is located. Therefore, after receiving a data packet sent back by, for example, a client, the router forwards the data packet to an application instance in the cloud server according to the identification information in the data packet and a routing table stored in the router.
Thus, in such a case, the client cannot actually establish any direct contact with the WebRTC server or even other clients on the public network. In this regard, in the prior art, an application instance of WebRTC typically needs to use an additional STUN (Session Traversal Utilities for NAT, NAT Session Traversal application) or TURN (Traversal Using relay round NAT) server to know about its network conditions (e.g., IP address and port, etc.) on the public network.
In other words, in the prior art, an additional STUN or TURN server is typically used to enable the WebRTC application instance in the server's internal network to know its network IP address and port on the public network so that the client can establish a connection directly with the WebRTC application instance using the network IP address and port.
For example, a STUN server may typically allow a WebRTC application instance located in an internal network to obtain its own network IP address on the public network and also know what type of NAT it is located behind and the network port for which the NAT is assigned. So that it can be used to establish a direct connection with a client on a public network or a client also located in another local network.
Therefore, in the prior art, the WebRTC application instance can use the STUN server to know the public network IP address and the port information as its private network information in the public network.
Furthermore, the TURN server may be used in addition to the STUN server to request a public network IP address through the TURN server as a relay between the client and, for example, the WebRTC server to forward communication data between the client and the WebRTC server in case the STUN server fails or is unable to allocate a network IP address and port for the client.
For example, in a WebRTC server scenario as shown in fig. 1, a client may create a PeerConnection object and actively send it to a WebRTC application instance in a cloud server by creating an Offer string, so that a router of the cloud server forwards the Offer request sent by the client to the WebRTC application instance to create an Answer string to send a response to the client through the router. Thereafter, the WebRTC application instance may request a STUN or TURN server to send the IP address and port information of the WebRTC application instance on the public network for it.
After the WebRTC application instance obtains information such as a network IP address and a port of the WebRTC application instance on a public network through the STUN or TURN server, the WebRTC application instance can be used as network information (client) to exchange network information, namely ICE client, with ICE (Interactive Connectivity Establishment) and a client, so that after both sides know the network information of the other side, the Establishment of a direct audio/video transmission link between the two sides can be completed, and a user can use the cloud mobile phone application instance through the direct network connection.
However, as described above, in the prior art scheme, whether a direct audio-video link can be successfully established between the WebRTC application instance and the client depends heavily on the STUN server or TURN server providing the WebRTC application instance with its network information on the public network. However, since the STUN server or TURN server is usually built by a third party and provided to the client for use, its stability cannot be guaranteed due to actual circumstances such as the number of clients used and requests processed. In addition, if the user or the client of the WebRTC application instance builds the application by himself, on one hand, high building cost may be generated, and on the other hand, since the STUN server or the TURN server needs to be deployed on the public network, the risk of attack is high, and stability cannot be guaranteed.
Therefore, in the embodiment of the application, the server may forward the connection establishment request sent by the user through the client to the application instance therein after receiving the connection establishment request. In the scenario shown in fig. 1, the application instance may be a cloud mobile phone application instance, and therefore, in the scenario shown in fig. 1, the application instance may obtain the first network address from a network module in the server according to the connection establishment request sent by the client. For example, the first network address may be a network IP address and a port on the above public network that the network module assigns to the application instance, and the first network address may be bound by the network module to an elastic network card of the application instance, so that the application instance may establish a WebRTC network connection with the client using the network address.
In this embodiment, the network module may provide the public network IP address for the application instance or may provide the NAT configuration information by binding the public network IP address with the virtual network card of the application instance, so that the application instance may further generate interactive network created network information (ICE legal) based on the public network IP address or the NAT configuration information provided by the network module, and send the network information to the client through, for example, the signaling module, so that the client may establish a WebRTC connection with the cloud application instance in the server according to the network information.
Therefore, in the embodiment of the present application, compared with the prior art, after receiving a connection establishment request sent by a client of a user and generating response information, an application instance obtains a network address capable of directly establishing the connection with the client through a network module inside a server, thereby eliminating the need of relying on an external STUN server in the prior art.
According to the WebRTC network connection establishment scheme provided by the embodiment of the application, the application instance acquires the first network address bound with the network card of the application instance from the network module in the server according to the connection establishment request sent by the client, sends the first network address to the client, and establishes the network connection with the client according to the instruction that the client uses the first network address to establish the network connection, so that the application instance in the server can acquire the first network address which can be used by the client to establish the connection with the application instance without depending on an external third-party server, the client can directly establish the direct network connection with the application connection in the server according to the first network address, and the server can provide the network information of the direct network connection for the application instance in the server by virtue of the self network address acquisition capability, the reliability and stability of connection establishment between the client and the application instance in the server are greatly improved.
The above embodiments are illustrations of technical principles and exemplary application frameworks of the embodiments of the present application, and specific technical solutions of the embodiments of the present application are further described in detail below through a plurality of embodiments.
Example two
Fig. 2 is a flowchart of an embodiment of a WebRTC network connection establishment method provided in the present application, where an execution subject of the method may be various terminal or server devices with network connection capability, or may also be devices or chips integrated on these devices. As shown in fig. 2, the WebRTC network connection establishing method includes the following steps:
s201, according to the WebRTC connection establishment request sent by the client, the application instance acquires a first network address from the network module in the server.
In step S201, the application instance in the server may obtain the first network address from the network module co-located in the server according to the connection establishment request of the client received by the server. In the embodiment of the present application, the first network address is a network address that the network module assigns to the application instance to establish a network connection with the client, and may be a network card that is bound to the application instance by the network module. For example, in the cloud mobile phone application scenario as shown in fig. 1, a cloud mobile phone application instance as a virtual machine running in a cloud server may obtain a network address from a network module of the server, where the network address may be, for example, a network address IP of the virtual machine on a public network, or may also be NAT configuration information generated by the network module for the virtual machine, and may be a public network IP address of an elastic network card that the network module has bound to the application instance, so that the network card of the application instance may become, for example, a network card of a pure public network, and other clients on the public network may directly find the cloud application instance on the public network using the network address.
S202, the first network address is sent to the client.
After the application instance obtains the first network address bound to its network card, the server may send the first network address to the client in step S202. For example, the application instance may transmit the first network address to a signaling module in the server, so that the signaling module may transmit the first network address to the client.
S203, according to the instruction of the client for establishing the network connection by using the first network address, the application instance establishes the network connection with the client.
In step S203, after receiving the first network address sent in step S202, the client may issue a network connection instruction according to the first network address, that is, for example, media data is sent with the first network address as a destination address, so as to implement network connection with the application instance.
Therefore, according to the WebRTC network connection establishment scheme provided in this embodiment of the present application, by acquiring, by an application instance, a first network address bound to a network card of the application instance from a network module in a server according to a connection establishment request sent by a client, and sending the first network address to the client, and according to an instruction for the client to establish a network connection using the first network address, the application instance establishes a network connection with the client, so that the application instance located in the server can acquire, without depending on an external third-party server, the first network address that the client can use to establish a connection with, so that the client can directly establish a direct network connection with the application connection in the server according to the first network address, and thus the server can provide network information of the direct network connection for the application instance therein by means of its own network address acquisition capability, the reliability and stability of connection establishment between the client and the application instance in the server are greatly improved.
EXAMPLE III
Fig. 3 is a flowchart of another embodiment of the WebRTC network connection establishment method provided in the present application, and the execution subject of the method may be various terminal or server devices with network connection capability, or may be a device or chip integrated on these devices. As shown in fig. 3, on the basis of the embodiment shown in fig. 2, the WebRTC network connection establishing method provided in the embodiment of the present application may include the following steps:
s301, a WebRTC connection establishment request of the client is received.
In step S301, a server, e.g., a cloud server, may receive a connection establishment request of a user. For example, in a cloud-phone scenario as shown in fig. 1, a user may send a connection establishment request to the server by logging in to a system providing cloud-phone services using a browser on the terminal. The connection establishment request may be for requesting establishment of a network connection with an application instance in a server.
For example, after logging in the cloud mobile phone system, the user may create a direct connection object according to a virtual instance object to be controlled by the user, that is, designate an application instance to be controlled as the connection object, and further, the user may create an audio and video stream through the client and add the audio and video stream to the connection object. At this time, since the client does not know the public network IP of the application instance and cannot establish a direct connection, the audio/video stream added to the connection object cannot be directly transmitted to the application instance to be executed, and therefore, next, in step S301, a request (Offer) string may be created, and a connection establishment request may be initiated to the cloud server by transmitting the request string as network data to, for example, a signaling module of the cloud server.
And S302, generating a connection establishment response by the application instance according to the WebRTC connection establishment request.
After receiving the connection establishment request containing, for example, the Offer character string sent by the user in step S301, the server may forward the request to the application instance in step S302, so that the application instance may generate a connection establishment response according to the connection establishment request in step S302 and send the connection establishment response to a signaling module in the server for processing the connection between the application instance and the client. In the embodiment of the present application, other modules may be used as a module for processing the connection between the application instance and the client.
S303, sending the connection establishment response to the client.
In step S303, for example, a signaling module of the server may forward the connection establishment response generated by the application instance in step S302 to the client. In the embodiment of the present application, the network connection established between the client and the application instance may be a peer-to-peer (P2P) connection based on the WebRTC technology, but the application instance, because it runs in a cloud server, typically has only an internal address assigned by a network module (e.g., a router) of the server, and therefore, in the embodiment of the present application, an external network address needs to be started based on sending of a response to the connection request sent to the client, that is, the client may use the network address to directly find a query of the address of the application instance. Therefore, in the embodiment of the present application, step S303 needs to be executed to start the query of the external network address.
S304, responding to the sending of the connection establishment response, the application instance acquires the first network address from the network module in the server.
In step S304, the application instance in the server may obtain the first network address from the network module co-located in the server according to the execution state of step S303. In the embodiment of the present application, the first network address is a network address that the network module assigns to the application instance to establish a network connection with the client, and the first network address may be an elastic network card that the network module binds to the network module. For example, in the cloud mobile phone application scenario as shown in fig. 1, a cloud mobile phone application instance as a virtual machine running in a cloud server may obtain a network address from a network module of the server, where the network address may be, for example, a network address IP of the virtual machine on a public network, or may also be NAT configuration information generated by the network module for the virtual machine, and may be a public network IP address of an elastic network card that the network module has bound to the application instance, so that the network card of the application instance may become, for example, a network card of a pure public network, and other clients on the public network may directly find the cloud application instance on the public network using the network address.
S305, generating a network information character string created by the switched network according to the first network address.
S306, the network information character string is sent to the client.
After the application instance acquires the first network address, in step S305, a network information string of the switched network creation (ICE) may be generated by, for example, a signaling module of the server from the first network address. And the network information string may be transmitted to the client in step S306.
S307, according to the instruction of the client for establishing the network connection by using the first network address, the application instance establishes the network connection with the client.
In step S307, after receiving the network information character string sent in step S306, the client may issue a network connection instruction according to the network information contained in the network information character string, that is, for example, media data is sent with the network address in the network information as the destination address, so as to implement network connection with the application instance. And after the connection, the user can use his client to send the audio-video stream that has been added to the connection object in step S301 to the application instance to execute it.
Therefore, according to the WebRTC network connection establishing method provided in this embodiment of the present application, by acquiring, by an application instance, a first network address bound to a network card of the application instance from a network module in a server according to a connection establishment request sent by a client, and sending the first network address to the client, and according to an instruction for the client to establish a network connection using the first network address, the application instance establishes a network connection with the client, so that the application instance located in the server can acquire, without depending on an external third-party server, the first network address that the client can use to establish a connection with, so that the client can directly establish a direct network connection with the application connection in the server according to the first network address, and thus the server can provide network information of the direct network connection for the application instance therein by means of its own network address acquiring capability, the reliability and stability of connection establishment between the client and the application instance in the server are greatly improved.
Example four
Fig. 4 is a schematic structural diagram of an embodiment of a server provided in the present application, which may be used to execute the network connection establishment method shown in fig. 2 or fig. 3. As shown in fig. 4, the server may include: an application instance 41, a network module 42 and a signaling module 43.
In the embodiment of the present application, the server may be a cloud server for providing various cloud services for the user, for example, a cloud server providing a cloud mobile phone service as shown in fig. 1. Application instance 41 may be, for example, the cloud handset application instance shown in fig. 1. The network module 42 may be a module for managing the network in the server, for example, it may assign internal network addresses to the application instance 41 and the signaling module 42, and may forward external data to the signaling module 43 or the application instance 41.
The signaling module 43 may be used to receive a WebRTC connection establishment request of a client. For example, in a cloud-phone scenario as shown in fig. 1, a user may send a connection establishment request to the server by logging in to a system providing cloud-phone services using a browser on the terminal. The connection establishment request may be for requesting establishment of a network connection with an application instance in a server.
For example, a user may create a request (Offer) string after logging into the cloud handset system, and may initiate a connection establishment request to the cloud server by transmitting the request string as network data to, for example, a signaling module of the cloud server. Thus, the signaling module 43 may receive the request and forward it to the application instance 41, so that the application instance 41 may be used to generate a connection establishment response from the connection establishment request of the client. In the embodiment of the present application, the application instance 41 needs to initiate the query operation of the network address after generating a response according to the connection request of the client and sending the response to the client through the signaling module.
Thus, the application instance 41 may query the network module 42 for a network address, for example in response to the signaling module 43 forwarding a connection establishment reply generated by the application instance 41 to the client.
In the embodiment of the present application, the network connection established between the client and the application instance 41 may be a peer-to-peer (P2P) connection based on the WebRTC technology, but the application instance 41, because it runs in a cloud server, typically has only an internal address assigned by the network module 42 (e.g., a router) of the server, and therefore, in the embodiment of the present application, an external network address needs to be started based on sending of a response to the connection request sent to the client, and the public network IP address is bound to the network card of the application instance 41 by the network module 42, so that the client can directly find the query of the address of the application instance using the network address.
The application instance 41 may further be adapted to retrieve the first network address from the network module 42.
The application instance 41 in the server may obtain the first network address from a network module 42 that is also located in the server. In the embodiment of the present application, the first network address is a network address assigned to the application instance 41 by the network module 42 to establish a network connection with the client, and the network module 42 is bound to the flexible network card of the application instance 41. For example, in the cloud mobile phone application scenario as shown in fig. 1, the cloud mobile phone application instance as a virtual machine running in the cloud server may obtain a network address from a network module of the server, where the network address may be, for example, a network address IP of the virtual machine on a public network, or may also be NAT configuration information generated by the network module for the virtual machine, and may be a public network IP address of an elastic network card that the network module has bound to the application instance, so that the network card of the application instance may become, for example, a network card of a pure public network, and other clients on the public network may directly find the cloud application instance 41 on the public network using the network address.
The first network address obtained from the network module 42 may be sent to the signaling module 43 at the application instance 41 in order to be sent to the client by the signaling module 43. So that the client can use this first network address to establish a network connection directly with the application instance 41. For example, the client may send the audiovisual data directly to the first network address.
In addition, the signaling module 43 may also generate a network information string created by the switched network according to the first network address, and send the network information string to the client.
Further, the application instance 41 may be configured to establish the network connection with the client according to an instruction for the client to establish the network connection using the first network address.
And S307, according to the instruction of the client for establishing the network connection by using the first network address, establishing the network connection with the client by the application example.
In step S307, after receiving the network information character string sent in step S306, the client may issue a network connection instruction according to the network information contained in the network information character string, that is, for example, media data is sent with the network address in the network information as the destination address, so as to implement network connection with the application instance.
Therefore, the server provided by the embodiment of the application acquires the first network address bound with the network card of the application instance from the network module in the server by the application instance according to the connection establishment request sent by the client, sends the first network address to the client, and establishes the network connection with the client by the application instance according to the instruction that the client establishes the network connection by using the first network address, so that the application instance in the server can acquire the first network address which can be used by the client to establish the connection with the client without depending on an external third-party server, so that the client can directly establish the direct network connection with the application connection in the server according to the first network address, and the server can provide the network information of the direct network connection for the application instance in the server by virtue of the network address acquisition capability of the server, the reliability and stability of connection establishment between the client and the application instance in the server are greatly improved.
EXAMPLE five
The internal functions and structure of the server are described above, and the apparatus can be implemented as an electronic device. Fig. 5 is a schematic structural diagram of an embodiment of an electronic device provided in the present application. As shown in fig. 5, the electronic device includes a memory 51 and a processor 52.
The memory 51 stores programs. In addition to the above-described programs, the memory 51 may also be configured to store other various data to support operations on the electronic device. Examples of such data include instructions for any application or method operating on the electronic device, contact data, phonebook data, messages, pictures, videos, and so forth.
The memory 51 may be implemented by any type or combination of volatile or non-volatile memory devices, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
The processor 52 is not limited to a processor (CPU), but may be a processing chip such as a Graphic Processing Unit (GPU), a Field Programmable Gate Array (FPGA), an embedded neural Network Processor (NPU), or an Artificial Intelligence (AI) chip. And a processor 52, coupled to the memory 51, for executing the program stored in the memory 51 to execute the WebRTC network connection establishing method of the second or third embodiment.
Further, as shown in fig. 5, the electronic device may further include: communication components 53, power components 54, audio components 55, display 56, and other components. Only some of the components are schematically shown in fig. 5, and it is not meant that the electronic device comprises only the components shown in fig. 5.
The communication component 53 is configured to facilitate wired or wireless communication between the electronic device and other devices. The electronic device may access a wireless network based on a communication standard, such as a WiFi, 2G, 3G, 4G/LTE, 5G, etc. mobile communication network, or a combination thereof. In an exemplary embodiment, the communication component 53 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 53 further comprises a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
A power supply component 54 provides power to the various components of the electronic device. The power components 54 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for electronic devices.
The audio component 55 is configured to output and/or input an audio signal. For example, the audio component 55 includes a Microphone (MIC) configured to receive external audio signals when the electronic device is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal may further be stored in the memory 51 or transmitted via the communication component 53. In some embodiments, audio assembly 55 also includes a speaker for outputting audio signals.
The display 56 includes a screen, which may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and these modifications or substitutions do not depart from the spirit of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A WebRTC network connection establishment method applied to a server including an application instance, and comprising:
according to a WebRTC connection establishment request sent by a client, the application instance acquires a first network address from a network module in the server, wherein the first network address is a network address which is allocated to the application instance by the network module to establish network connection with the client, and the network module binds the first network address with a network card of the application instance;
sending the first network address to the client;
and establishing the network connection with the client by the application instance according to the instruction of establishing the network connection by the client by using the first network address.
2. The WebRTC network connection establishment method of claim 1, wherein the method further comprises:
receiving a connection establishment request of a client, wherein the connection establishment request is used for requesting to establish network connection with an application instance in the server;
generating, by the application instance, a connection establishment response according to the connection establishment request;
and sending the connection establishment response to the client.
3. The WebRTC network connection establishment method of claim 2, wherein the obtaining, by the application instance, the first network address from the network module in the server according to the connection establishment request sent by the client comprises:
in response to sending the connection establishment reply, the application instance obtains a first network address from a network module in the server.
4. The WebRTC network connection establishment method of claim 1, wherein the sending the first network address to the client comprises:
generating a network information character string created by the switched network according to the first network address;
and sending the network information character string to the client.
5. The WebRTC network connection establishment method of claim 1, wherein the first network address comprises a public network address or network address translation configuration information.
6. A server comprising an application instance, a network module and a signaling module, wherein,
the application instance is used for acquiring a first network address from the network module according to a WebRTC connection establishment request sent by a client, wherein the first network address is a network address which is allocated to the application instance by the network module to establish network connection with the client, and the network module binds the first network address with a network card of the application instance;
the signaling module is used for receiving a WebRTC connection establishment request of the client, receiving an instruction of the client for establishing network connection by using the first network address, and sending the first network address to the client;
wherein the application instance is further to: and establishing network connection with the client according to the instruction.
7. The server according to claim 6, wherein,
the signaling module is further to: receiving a WebRTC connection establishment request of a client, wherein the WebRTC connection establishment request is used for requesting to establish network connection with an application instance in the server and is also used for sending a connection establishment response to the client;
the application instance is further configured to generate the connection establishment response according to the WebRTC connection establishment request.
8. The server of claim 6, wherein the signaling module is further to:
generating a network information character string created by the switched network according to the first network address;
and sending the network information character string to the client.
9. An electronic device, comprising:
a memory for storing a program;
a processor for executing the program stored in the memory to perform the WebRTC network connection establishment method of any one of claims 1 to 5.
10. A computer-readable storage medium, on which a computer program is stored which is executable by a processor, wherein the program, when executed by the processor, implements the WebRTC network connection establishment method of any one of claims 1 to 5.
CN202210153311.6A 2022-02-18 2022-02-18 WebRTC network connection establishing method, server, electronic device and computer readable storage medium Pending CN114666306A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210153311.6A CN114666306A (en) 2022-02-18 2022-02-18 WebRTC network connection establishing method, server, electronic device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210153311.6A CN114666306A (en) 2022-02-18 2022-02-18 WebRTC network connection establishing method, server, electronic device and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN114666306A true CN114666306A (en) 2022-06-24

Family

ID=82027662

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210153311.6A Pending CN114666306A (en) 2022-02-18 2022-02-18 WebRTC network connection establishing method, server, electronic device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN114666306A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116896544A (en) * 2023-08-29 2023-10-17 好信云(北京)网络通信有限公司 Method, apparatus, device and medium for establishing a real-time communication connection
WO2024055741A1 (en) * 2022-09-13 2024-03-21 腾讯科技(深圳)有限公司 Method and apparatus for establishing network connection, electronic device and storage medium

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB201419338D0 (en) * 2013-10-31 2014-12-17 Avaya Inc Providing origin insight for web applications via session traversal utilities for network address translation (stun) message, and computer-readable media
US20160173464A1 (en) * 2014-12-10 2016-06-16 Futurewei Technologies, Inc. Media Session Resumption in Web Session Restoration
US20160191461A1 (en) * 2014-12-31 2016-06-30 Futurewei Technologies, Inc. TURN Relay Service Reuse For NAT Traversal During Media Session Resumption
CN108289131A (en) * 2017-12-12 2018-07-17 北京知道未来信息技术有限公司 A method of obtaining subscription client Intranet and public network IP address
CN108989488A (en) * 2018-09-06 2018-12-11 腾讯科技(深圳)有限公司 Traversing method, device and the storage medium of network address translation apparatus
US20180375907A1 (en) * 2017-06-27 2018-12-27 Atlassian Pty Ltd Parallel peer to peer connection establishment in webrtc conferencing
KR20200110961A (en) * 2019-03-18 2020-09-28 에릭슨엘지엔터프라이즈 주식회사 Method, web real-time communications server and web real-time communications system for assigning traversal using relays around nat server
US10873852B1 (en) * 2020-04-10 2020-12-22 Avila Technology, LLC POOFster: a secure mobile text message and object sharing application, system, and method for same
CN112235238A (en) * 2020-09-02 2021-01-15 武汉烽火众智数字技术有限责任公司 MCU system and method based on WebRTC
WO2022002069A1 (en) * 2020-06-29 2022-01-06 中兴通讯股份有限公司 Method for accessing network, media gateway, electronic device, and storage medium

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB201419338D0 (en) * 2013-10-31 2014-12-17 Avaya Inc Providing origin insight for web applications via session traversal utilities for network address translation (stun) message, and computer-readable media
US20160173464A1 (en) * 2014-12-10 2016-06-16 Futurewei Technologies, Inc. Media Session Resumption in Web Session Restoration
US20160191461A1 (en) * 2014-12-31 2016-06-30 Futurewei Technologies, Inc. TURN Relay Service Reuse For NAT Traversal During Media Session Resumption
US20180375907A1 (en) * 2017-06-27 2018-12-27 Atlassian Pty Ltd Parallel peer to peer connection establishment in webrtc conferencing
CN108289131A (en) * 2017-12-12 2018-07-17 北京知道未来信息技术有限公司 A method of obtaining subscription client Intranet and public network IP address
CN108989488A (en) * 2018-09-06 2018-12-11 腾讯科技(深圳)有限公司 Traversing method, device and the storage medium of network address translation apparatus
KR20200110961A (en) * 2019-03-18 2020-09-28 에릭슨엘지엔터프라이즈 주식회사 Method, web real-time communications server and web real-time communications system for assigning traversal using relays around nat server
US10873852B1 (en) * 2020-04-10 2020-12-22 Avila Technology, LLC POOFster: a secure mobile text message and object sharing application, system, and method for same
WO2022002069A1 (en) * 2020-06-29 2022-01-06 中兴通讯股份有限公司 Method for accessing network, media gateway, electronic device, and storage medium
CN112235238A (en) * 2020-09-02 2021-01-15 武汉烽火众智数字技术有限责任公司 MCU system and method based on WebRTC

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024055741A1 (en) * 2022-09-13 2024-03-21 腾讯科技(深圳)有限公司 Method and apparatus for establishing network connection, electronic device and storage medium
CN116896544A (en) * 2023-08-29 2023-10-17 好信云(北京)网络通信有限公司 Method, apparatus, device and medium for establishing a real-time communication connection
CN116896544B (en) * 2023-08-29 2024-04-30 好信云(北京)网络通信有限公司 Method, apparatus, device and medium for establishing a real-time communication connection

Similar Documents

Publication Publication Date Title
CN109274634B (en) Multimedia communication method and device, and storage medium
US9332583B2 (en) Multipoint communication device and method of performing switching from multipoint communication to point-to-point communication
CN114666306A (en) WebRTC network connection establishing method, server, electronic device and computer readable storage medium
CN108965103B (en) Electronic device, server and method for providing conversation content
US20150081796A1 (en) Method, apparatus and system for transmitting media stream
US20120033616A1 (en) Mobile terminal and peer-to-peer mode based data transmission method thereof
CN114095557B (en) Data processing method, device, equipment and medium
CN103108089A (en) Connection establishment management method of network system and related system thereof
WO2017101298A1 (en) Input method and apparatus for audio and video information, network television, and user equipment
KR101366671B1 (en) System and method for providing callcenter service through web
US20230291706A1 (en) Method for accessing network, media gateway, electronic device and storage medium
CN103107983A (en) Data management method of network system and related system thereof
WO2016177121A1 (en) File transmission method and device, and application server
KR20140001566A (en) Home cloud gateway apparatus for multi service and method for providing service thereof
CN112261421B (en) Virtual reality display method and device, electronic equipment and storage medium
CN109474646B (en) Communication connection method, device, system and storage medium
EP2974159B1 (en) Method, device and system for voice communication
KR102064284B1 (en) Device, system, and method to perform real-time communication
CN108781217B (en) Multimedia data transmission method, server and terminal
CN113242261B (en) Method and device for sharing data network, electronic equipment and storage medium
WO2016042764A1 (en) Connection method, connection system, portable terminal, and program
CN113473493B (en) Communication method and device
US11659012B2 (en) Relayed communication channel establishment
CN108965765A (en) Video calling connects method for building up, system and computer equipment
CN113872862B (en) Communication method, mobile device and routing device

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