CN105245509B - The method for building up in the bidirectional data transfers channel based on Flash platform - Google Patents

The method for building up in the bidirectional data transfers channel based on Flash platform Download PDF

Info

Publication number
CN105245509B
CN105245509B CN201510618660.0A CN201510618660A CN105245509B CN 105245509 B CN105245509 B CN 105245509B CN 201510618660 A CN201510618660 A CN 201510618660A CN 105245509 B CN105245509 B CN 105245509B
Authority
CN
China
Prior art keywords
client
data
flash
building
function
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
CN201510618660.0A
Other languages
Chinese (zh)
Other versions
CN105245509A (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.)
Storm Group Ltd By Share Ltd
Original Assignee
Storm Group Ltd By Share 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 Storm Group Ltd By Share Ltd filed Critical Storm Group Ltd By Share Ltd
Priority to CN201510618660.0A priority Critical patent/CN105245509B/en
Publication of CN105245509A publication Critical patent/CN105245509A/en
Application granted granted Critical
Publication of CN105245509B publication Critical patent/CN105245509B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1044Group management mechanisms 
    • H04L67/1046Joining mechanisms
    • 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

Abstract

This application discloses a kind of method for building up in bidirectional data transfers channel based on Flash platform, are based on the Flash platform, and the first client is established to be connect with the forward direction of the second client;After forward direction connection is successfully established, which sends the first data to second client;Based on the Flash platform, which establishes the Opposite direction connection with first client;And after the Opposite direction connection is successfully established, which sends the second data to first client;Wherein, the step of being based on the Flash platform, establishing forward direction connection and the step of establishing the Opposite direction connection, are packaged, and form single P2PStream object.Bidirectional data transfers channel constructed by use of the present invention, client can carry arbitrary P2P application protocol, and adaptability is wider.

Description

The method for building up in the bidirectional data transfers channel based on Flash platform
Technical field
This application involves the processing of Flash file, pass more particularly, to a kind of bi-directional data based on Flash platform The method for building up in defeated channel.
Background technique
Flash is a kind of multimedia player popular, proprietary on webpage at present, and first purpose of design is to play 2 dimensions Vector momentum becomes the tool for being suitble to exploitation to create rich Internet application, stream video audio later.Flash is used The technology of vector graphics come minimize file size and create save network bandwidth and download time file, therefore Flash becomes trivial games, animation and the common format of graphic user interface in embedded web page.More matchmakers are played using Flash Body file, mainly by connecting network server downloading multimedia file and being played out to it.Currently, Flash is provided Complete P2P computing (Peer to Peer, abbreviation P2P) solution (such as Cirrus of Adobe company exploitation), permits Perhaps in different Flash clients (for example, being mounted with the smart television of Flash, smart phone, tablet computer, notebook electricity Brain, desktop computer, smartwatch etc.) between interact data, to reduce network server by Flash client constantly quilt The pressure of access.
Due to the Cirrus scheme that Flash is provided, the application of many P2P can be quickly developed based on this.But at present Flash P2P scheme there is also some problems: one side Flash client can remind whether user opens P2P at runtime Function, this brings bad user experience to user, therefore some users can refuse to open;On the other hand, Cirrus is provided P2P function is had no idea and the client with other systems (i.e. third party's operation system) since it realizes the closing of details Realize intercommunication in end;In addition, realizing that (such as abstraction hierarchy, Cirrus provide not only P2P connection for the level of P2P based on Cirrus Function additionally provides the realization of sharing files) it is relatively high, it is not easy to be communicated with the client with other systems.
In view of this, the present invention provides a kind of method for building up in bidirectional data transfers channel based on Flash platform to solve The certainly above problem.
Summary of the invention
This application discloses a kind of bidirectional data transfers channel based on Flash platform method for building up, feature exists In, comprising:
Based on the Flash platform, the first client is established to be connect with the forward direction of the second client;
After forward direction connection is successfully established, which sends the first data to second client;
Based on the Flash platform, which establishes the Opposite direction connection with first client;And
After the Opposite direction connection is successfully established, which sends the second data to first client;
Wherein, it is based on the Flash platform, the step of forward direction connects will be established and establishes Opposite direction connection the step of progress Encapsulation, forms single P2PStream object.
Further, wherein first client uses NetConnection NetConnection:connect function NetStream object is established, to establish forward direction connection.
Further, wherein the parameter of the NetConnection:connect function is second client PeerID。
Further, wherein second client establishes NetStream using NetConnection:connect function Object, to establish the Opposite direction connection.
Further, wherein the parameter of the NetConnection:connect function is first client RemoteID。
Further, wherein the first/second client passes through NetStream.send function to the second/the first visitor Family end sends the first/second data.
Further, wherein the second/the first client handles function by H and receives the first/second data.
Further, wherein first client and/or the second client executing single P2PStream object are used To establish the bidirectional data transfers channel.
Further, wherein the upper layer application of first client and/or second client directly uses this single P2PStream object.
Method proposed by the present invention, has the advantage that
1) constructed bidirectional data transfers channel is used, client can carry arbitrary P2P application protocol, and adaptability is more Extensively.
2) using the P2PStream object of encapsulation, the function of NetStream can be realized between PC desktop and mobile terminal, To realize cross-platform P2P data communication.
Certainly, implementing either the application method must be not necessarily required to reach all the above technical effect simultaneously.
Detailed description of the invention
The drawings described herein are used to provide a further understanding of the present application, constitutes part of this application, this Shen Illustrative embodiments and their description please are not constituted an undue limitation on the present application for explaining the application.In the accompanying drawings:
Fig. 1 is the method for building up in the bidirectional data transfers channel based on Flash platform of an embodiment according to the present invention Flow diagram;
Fig. 2 is the method for building up in the bidirectional data transfers channel based on Flash platform of another embodiment according to the present invention Flow diagram.
Specific embodiment
As used some vocabulary to censure specific components in the specification and claims.Those skilled in the art answer It is understood that hardware manufacturer may call the same component with different nouns.This specification and claims are not with name The difference of title is as the mode for distinguishing component, but with the difference of component functionally as the criterion of differentiation.Such as logical The "comprising" of piece specification and claim mentioned in is an open language, therefore should be construed to " include but do not limit In "." substantially " refer within the acceptable error range, those skilled in the art can within a certain error range solve described in Technical problem basically reaches the technical effect.Specification subsequent descriptions are to implement the better embodiment of the application, so described Description is being not intended to limit the scope of the present application for the purpose of the rule for illustrating the application.The protection scope of the application As defined by the appended claims.
P2P solution provided by Flash (such as Cirrus of Adobe company exploitation) at present, allows in difference Flash client foundation be directly connected to, be used for accessing multimedia file.It is this be directly connected to be assisted based on real-time multimedia streaming Discuss (Real Time Media Flow Protocol, RTMFP).By using RTMFP, those rely on live streaming, real time communication Application, such as community, audio-video chat and multiplayer just have the ability to publication high quality communication solution.RTMFP Terminal user can be directly connected to and communicates, microphone can be used and stylus is directly chatted.This scheme improves at present Experience of the Flash player in terms of network interaction.In addition, RTMFP will reduce the bandwidth consumption of live streaming, live chat scheme, Such as audio-video is chatted and multiplayer.Because the data of RTMFP flow between end users, rather than and server, institute It is well suited for disposing on a large scale with this scheme.RTMFP is because use User Datagram Protocol (User Datagram Protocol, UDP) it is communicated, also improve the speed of transmission.UDP is not belonging to connecting-type agreement, thus has resource consumption It is small, the fast advantage of processing speed, so usually audio, video and general data are more using UDP in transmission, because they are Make to lose one or two of data packet once in a while, will not have much impact to reception result.There are two characteristics by RTMFP, i.e., quickly connect Recovery and IP mobilism are connect, can help to solve some connection errors.Quickly connection restores: connection in unexpected situations will be quick Restore.For example, a wireless connection goes offline, once reconnection, he will possess rapidly all transfer capabilities.IP mobilism: one A movable network session will be identified with PEER, even if he has become an IP, can also keep original session.For example, one A notebook obtains a new IP address in a wireless network, it will continue session just now at once.
Specifically, Flash provides NetStream object, the object is packaged using RTMFP agreement, in other words It says, realizes NetStream using RTMFP agreement.And sending method is provided, it can unidirectionally send data.Flash client Another Flash client connected, then can unidirectionally receive data.NetStream provides counting messages function, it is according to report Purpose IP address, destination slogan, source IP address, source port number, protocol number and the TOS of text distinguish stream information, and for not Same stream information carries out independent data statistics.It is received in this way, Flash provides unidirectional send with unidirectional.
The NetStream provided based on Flash is sent and received channel unidirectionally to realize that two-way data pass by the present invention Defeated channel, i.e. Flash client can not only send data, while can also receive the number that another Flash client is sent According to.Based on the two-way data transmission channel, various P2P application protocols can be run.
Fig. 1 is the method for building up in the bidirectional data transfers channel based on Flash platform of an embodiment according to the present invention Flow diagram.As shown in Figure 1, comprising the following steps:
Step 101 is based on Flash platform, and the first client is established to be connect with the forward direction of the second client.
In one embodiment of this invention, this connect function of NetConnection can be used to establish for the first client NetStream object, wherein the parameter of the function is the PeerID of the second client.
Step 102, after above-mentioned positive connection is successfully established, the first client sends the first number to the second client According to.
In one embodiment of this invention, the first client can by NetStream provide NetStream.send (H, D) function sends the first data D1 to the second client, wherein not limiting the form of the first data D1 in the present invention.Second visitor Family end then can handle function by H and receive first data D1.Wherein, first H parameter of NetStream.send is pair The receiver function at end, second D parameter are only data.
Step 103, after establishing and being connect with the above-mentioned forward direction of the first client, based on Flash platform, the second client Establish the Opposite direction connection with the first client.
In one embodiment of this invention, this connect function of NetConnection can be used to establish for the second client NetStream object, wherein the parameter of the function is the RemoteID of the first client.
Step 104, after above-mentioned Opposite direction connection is successfully established, the second client to the first client send data.
In one embodiment of this invention, the second client can by NetStream provide NetStream.send (H, D) function sends the second data D2 to the first client, wherein not limiting the form of the second data D2 in the present invention.First visitor Family end then can handle function by H and receive second data D2.
After above-mentioned steps completion, established based on Flash platform between the first client and the second client Bidirectional data transfers channel.In one embodiment of this invention, by the attribute default setting of Netstream::dataReliable It is true (true) that NetStream is reliable to the transmission of data, in this way, logical between the first client and the second client News are reliable.
Fig. 2 is the method for building up in the bidirectional data transfers channel based on Flash platform of another embodiment according to the present invention Flow diagram.As shown in Figure 2, comprising the following steps:
Step 201 is based on Flash platform, and the first client is established to be connect with the forward direction of the second client.
In one embodiment of this invention, this connect function of NetConnection can be used to establish for the first client NetStream object, wherein the parameter of the function is the PeerID of the second client.
Step 202, after above-mentioned positive connection is successfully established, the first client sends data to the second client.
In one embodiment of this invention, the first client can by NetStream provide NetStream.send (H, D) function sends the first data D1 to the second client, wherein not limiting the form of the first data D1 in the present invention.Second visitor Family end then can handle function by H and receive first data D1.
Step 203, after establishing and being connect with the above-mentioned forward direction of the first client, based on Flash platform, the second client Establish the Opposite direction connection with the first client.
In one embodiment of this invention, this connect function of NetConnection can be used to establish for the second client NetStream object, wherein the parameter of the function is the RemoteID of the first client.
Step 204, after above-mentioned Opposite direction connection is successfully established, the second client to the first client send data.
In one embodiment of this invention, the second client can by NetStream provide NetStream.send (H, D) function sends the second data D2 to the first client, wherein not limiting the form of the second data D2 in the present invention.First visitor Family end then can handle function by H and receive second data D2.
Step 205 is based on Flash platform, and the above-mentioned steps 201-204 NetStream function being related to and object are carried out Encapsulation, forms single P2PStream object.
In one embodiment of this invention, by the encapsulation (being packaged) to above step 201-204, one can be provided P2PStream object, the first client and/or the second client by execute the P2PStream object can establish it is two-way Data transmission channel realizes bi-directional data transmitting-receiving.Wherein, which is not relevant for the format of data, only by it It is handled as common byte stream.The P2PStream object can be used directly in upper layer application, as common TCP connection Equally use (such as connection/read/write).
Therefore compared to the conventional method of one-way data transfer, the invention has the following advantages that
1) constructed bidirectional data transfers channel is used, client can carry arbitrary P2P application protocol, and adaptability is more Extensively.
2) using the P2PStream object being packaged, the function of NetStream can be realized between PC desktop and mobile terminal, To realize cross-platform P2P data communication.
It should be noted that the terms "include", "comprise" or its any other variant are intended to the packet of nonexcludability Contain, so that the process, method, commodity or the system that include a series of elements not only include those elements, but also including Other elements that are not explicitly listed, or further include for this process, method, commodity or the intrinsic element of system. In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including the element Process, method, there is also other identical elements in commodity or system.
The above description is only an example of the present application, is not intended to limit this application.For those skilled in the art For, various changes and changes are possible in this application.All any modifications made within the spirit and principles of the present application are equal Replacement, improvement etc., should be included within the scope of the claims of this application.

Claims (5)

1. a kind of method for building up in the bidirectional data transfers channel based on Flash platform characterized by comprising
Based on the Flash platform, the first client establishes NetStream object using NetConnection:connect function, It is connect with establishing with the forward direction of the second client;
After forward direction connection is successfully established, which sends the first data to second client;
Based on the Flash platform, which establishes NetStream pairs using NetConnection:connect function As to establish the Opposite direction connection with first client;And
After the Opposite direction connection is successfully established, which sends the second data to first client;
Wherein, the step of being based on the Flash platform, establishing forward direction connection and the step of establishing the Opposite direction connection, seal Dress, forms single P2PStream object;
First client and/or the second client executing single P2PStream object, to establish the bi-directional data The upper layer application of transmission channel, first client and/or second client directly uses this single P2PStream pairs As.
2. the method for building up in bidirectional data transfers channel as described in claim 1, which is characterized in that the NetConnection: The parameter of connect function is the PeerID of second client.
3. the method for building up in bidirectional data transfers channel as described in claim 1, which is characterized in that the NetConnection: The parameter of connect function is the RemoteID of first client.
4. the method for building up in bidirectional data transfers channel as described in claim 1, which is characterized in that first/second client End sends the first/second data to the second/the first client by NetStream.send function.
5. the method for building up in bidirectional data transfers channel as described in claim 1, which is characterized in that the second/the first client End handles function by H and receives the first/second data.
CN201510618660.0A 2015-09-24 2015-09-24 The method for building up in the bidirectional data transfers channel based on Flash platform Active CN105245509B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510618660.0A CN105245509B (en) 2015-09-24 2015-09-24 The method for building up in the bidirectional data transfers channel based on Flash platform

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510618660.0A CN105245509B (en) 2015-09-24 2015-09-24 The method for building up in the bidirectional data transfers channel based on Flash platform

Publications (2)

Publication Number Publication Date
CN105245509A CN105245509A (en) 2016-01-13
CN105245509B true CN105245509B (en) 2019-01-22

Family

ID=55043009

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510618660.0A Active CN105245509B (en) 2015-09-24 2015-09-24 The method for building up in the bidirectional data transfers channel based on Flash platform

Country Status (1)

Country Link
CN (1) CN105245509B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104079658A (en) * 2014-07-14 2014-10-01 南通大学 Environment-friendly internet of things real-time control method under Web environment and based on pool technology

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8923325B2 (en) * 2009-10-06 2014-12-30 Adobe Systems Incorporated Client-server architecture for audio-video communications

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104079658A (en) * 2014-07-14 2014-10-01 南通大学 Environment-friendly internet of things real-time control method under Web environment and based on pool technology

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
RTMFP 协议在P2P 视频通信中的应用;高奇特等;《计算机系统应用》;20121231;176-180页
基于 AIR 的实时网络视频家教系统的设计与实现;胡世清等;《中国电化教育》;20111231;130-133页

Also Published As

Publication number Publication date
CN105245509A (en) 2016-01-13

Similar Documents

Publication Publication Date Title
WO2019205907A1 (en) Intelligent device communication platform based on mqtt message protocol
EP3046331B1 (en) Media control method and system based on cloud desktop
RU2567378C2 (en) User input back channel for wireless displays
KR101596530B1 (en) Systems and methods for managing multimedia operations in remote sessions
JP5694568B2 (en) User input back channel for wireless display
EP2171972B1 (en) File protocol for transaction based communication
US20200228579A1 (en) Parallel peer to peer connection establishment in webrtc conferencing
KR101301434B1 (en) Voice instant messaging between mobile and computing devices
CN102377823A (en) Method and system for realizing interactive sharing among multiple screens and multiple users by sliding screens
CN105637472B (en) The frame of screen content shared system with the description of broad sense screen
CN110011935B (en) Data stream processing method and related equipment
CN103348657B (en) Flow media playing method, equipment and system
CN102088460B (en) Method, device and system for transmitting streaming media data in restricted networks
Lei et al. Design and implementation of streaming media processing software based on RTMP
US20120287224A1 (en) Video chat within a webpage and video instant messaging
US20140244763A1 (en) Apparatus And Method For Level-Based Self-Adjusting Peer-to-Peer Media Streaming
WO2019165960A1 (en) Media data real time transmission control method, system and storage medium
CN109361671A (en) A kind of streaming media framework method based on Session Initiation Protocol
CN105245509B (en) The method for building up in the bidirectional data transfers channel based on Flash platform
WO2007024412A3 (en) Peer-to-peer communication system
CN103533054A (en) Method for realizing coordinated processing among multiple terminals and multi-terminal coordinated processing device
CN114793225B (en) Data communication method and system for cloud mobile phone and true mobile phone
CN103023746B (en) A kind of drawing board implementation method based on IM system and a kind of IM system
KR101900969B1 (en) Real-time media optimization over remoted sessions
CN102130921A (en) Method and system for realizing two paths of voice communication based on webpage

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: 100191 Beijing, Xueyuan Road No. 51, the first to enjoy the science and technology building, floor 6,

Applicant after: Storm group Limited by Share Ltd

Address before: 100191 Beijing, Xueyuan Road No. 51, the first to enjoy the science and technology building, floor 6,

Applicant before: Beijing Baofeng Technology Co., Ltd.

COR Change of bibliographic data
GR01 Patent grant
GR01 Patent grant
PP01 Preservation of patent right

Effective date of registration: 20190705

Granted publication date: 20190122

PP01 Preservation of patent right