CN109104408A - data transmission method, mobile terminal and computer readable storage medium - Google Patents
data transmission method, mobile terminal and computer readable storage medium Download PDFInfo
- Publication number
- CN109104408A CN109104408A CN201810696722.3A CN201810696722A CN109104408A CN 109104408 A CN109104408 A CN 109104408A CN 201810696722 A CN201810696722 A CN 201810696722A CN 109104408 A CN109104408 A CN 109104408A
- Authority
- CN
- China
- Prior art keywords
- terminal
- data
- communication protocol
- user data
- protocol
- 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
Links
- 230000005540 biological transmission Effects 0.000 title claims abstract description 91
- 238000000034 method Methods 0.000 title claims abstract description 40
- 230000006854 communication Effects 0.000 claims abstract description 167
- 238000004891 communication Methods 0.000 claims abstract description 166
- 238000006243 chemical reaction Methods 0.000 claims abstract description 31
- 230000007613 environmental effect Effects 0.000 claims abstract description 18
- 230000015654 memory Effects 0.000 claims description 26
- 230000006870 function Effects 0.000 description 15
- 238000012545 processing Methods 0.000 description 9
- 238000001514 detection method Methods 0.000 description 5
- 238000010586 diagram Methods 0.000 description 5
- 230000033001 locomotion Effects 0.000 description 4
- 238000007726 management method Methods 0.000 description 3
- 230000005611 electricity Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000005764 inhibitory process Effects 0.000 description 2
- 239000004973 liquid crystal related substance Substances 0.000 description 2
- 230000007774 longterm Effects 0.000 description 2
- 238000010295 mobile communication Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- 230000001133 acceleration Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 238000005314 correlation function Methods 0.000 description 1
- 238000013524 data verification Methods 0.000 description 1
- 230000001419 dependent effect Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000008030 elimination Effects 0.000 description 1
- 238000003379 elimination reaction Methods 0.000 description 1
- 230000005484 gravity Effects 0.000 description 1
- 230000001404 mediated effect Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 230000000149 penetrating effect Effects 0.000 description 1
- 238000009527 percussion Methods 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000008054 signal transmission Effects 0.000 description 1
- 230000005236 sound signal Effects 0.000 description 1
- 238000010897 surface acoustic wave method Methods 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
- 238000012795 verification Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/08—Protocols for interworking; Protocol conversion
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/16—Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
- H04L69/165—Combined use of TCP and UDP protocols; selection criteria therefor
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W24/00—Supervisory, monitoring or testing arrangements
- H04W24/08—Testing, supervising or monitoring using real traffic
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Security & Cryptography (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
The invention discloses a kind of data transmission methods, mobile terminal and computer readable storage medium, by being judged whether to meet environmental condition as defined in current communication protocol according to the running parameter of current communication network, user data in first terminal is converted according to the result of judgement, and the user data after conversion is sent to second terminal by communication protocol corresponding with the result of judgement, to realize under identical communication network, guarantee the complete of data transmission by switching communication protocol appropriate, the transmission security of data is also improved simultaneously, and the phenomenon that switching by carrying out communication protocol according to network environment leads to data packet loss in transmission process and can also avoiding the factor for network environment, and realize real-time communication protocol replacement, guarantee the timeliness of data transmission, improve data biography Defeated efficiency.
Description
Technical field
The present invention relates to field of navigation technology, more specifically to a kind of data transmission method, mobile terminal and calculating
Machine readable storage medium storing program for executing.
Background technique
With popularizing for WLAN, more and more people pass through wireless local area by wireless terminals such as mobile phone, pad
Net carries out the mutual transmission of data.Wireless LAN characteristic and traditional cable network (fixed network) have apparent difference: as when
Prolong, packet loss, bandwidth etc..APP on wireless terminal mainly accesses service server by TCP at present.Router and client it
Between communication need to carry out protocol conversion, be upd (User Datagram Protocol, user data based on tcp/ip layers
Datagram protocol) and tcp P (Transmission Control Protocol, transmission control protocol) between agreement converted.
Major part game and video software at present, it is optimal that selection, which is under most scene based on TCP and UDP, but there are also one
A little scenes have that performance is relatively low, for example environment is more noisy in wlan network, is easy to happen packet loss, retransmit, and wait existing
As when, and the control of its packet loss controls well there is no the packet loss in the communication of TCP in the communication of UDP, and present has
A little game, some videos are namely based on the data transmission of udp protocol progress, and with regard in the communication of both router and client,
In order to solve the problems, such as packet loss, current main settling mode is to reduce data in transmission process by the circuit of some auxiliary
In packet loss, and these modes can not solve the problems, such as the transmission safety and completeness of data from the root, still can exist
Certain packet loss.
Summary of the invention
The technical problem to be solved in the present invention is that: in wlan network, the communication between router and client turns
The technical issues of it is excessive to change that there are packet loss, and data retransmit provides a kind of data transmission method, movement for the technical problem
Terminal and computer readable storage medium.
In order to solve the above technical problems, the present invention provides a kind of data transmission method, it is applied to first terminal and second eventually
Communications between end, which comprises
Detect the running parameter for the communication network that the first terminal is presently in;
Judge whether the running parameter meets environmental condition as defined in current communication protocol, the communication protocol includes
One of User Datagram Protocol UDP and transmission control protocol TCP;
Obtain user data to be transmitted in the first terminal;
The user data is converted according to the result of judgement, and by the user data after conversion by with judgement
As a result corresponding communication protocol is sent in the second terminal.
Optionally, after judging whether the running parameter meets environmental condition as defined in current communication protocol, also
Include: that the result of judgement is sent to the second terminal, the second terminal is notified to adjust according to the result of the judgement is corresponding
Whole communication protocol.
Optionally, the method also includes: receive the second terminal according to the result of judgement send back come message, and
Communication connection between the two is established according to the message, the communication connection is with the corresponding communication protocols of the result of the judgement
What view was established.
Optionally, the running parameter includes the noisy coefficient of environment for the communication network being presently in, described in the judgement
Whether running parameter meets environmental condition as defined in current communication protocol
Judge whether the noisy coefficient of the environment is greater than noisy coefficient threshold as defined in current communication protocol;
If more than noisy coefficient threshold, then the result judged is does not select to carry out data using current communication protocol
Transmission;
If being not more than noisy coefficient threshold, the result judged carries out data biography as the current communication protocol of selection
It is defeated.
Optionally, if the current communication protocol is User Data Protocol UDP, and the noisy coefficient of the environment is greater than institute
When stating noisy coefficient threshold, the result according to judgement converts the user data, and by the number of users after conversion
Include: according to being sent in the second terminal by communication protocol corresponding with the result of judgement
The communication protocol of the first terminal is switched into the biography transport control protocol from the User Data Protocol UDP
Discuss TCP;
The user data is converted into data format corresponding with the transmission control protocol TCP;
The user data after conversion is sent to the second terminal by the transmission control protocol TCP.
Optionally, if the current communication protocol is transmission control protocol TCP, and the noisy coefficient of the environment is greater than institute
When stating noisy coefficient threshold, the result according to judgement converts the user data, and by the number of users after conversion
Include: according to being sent in the second terminal by communication protocol corresponding with the result of judgement
The communication protocol of the first terminal is switched into the user data association from the transmission control protocol TCP
Discuss UDP;
The user data is converted into data format corresponding with the User Data Protocol UDP;
The user data after conversion is sent to the second terminal by the User Data Protocol UDP.
Optionally, the running parameter further includes the packet loss of current communication network;
After judging whether the noisy coefficient of the environment is greater than noisy coefficient threshold as defined in current communication protocol, also
Include:
Judge whether the packet loss of the current communication network is greater than preset threshold;
If thering is one to be unsatisfactory in the packet loss and the noisy coefficient of the environment, execute according to the result of judgement to institute
State the step of user data is converted.
Optionally, the first terminal is router, and the second terminal is client.
Further, the present invention also provides a kind of mobile terminal, the mobile terminal includes reason device, memory and communication
Bus;
The communication bus is for realizing the connection communication between processor and memory;
The processor is for executing one or more program stored in memory, to realize such as any one of aforementioned institute
The step of data transmission method stated.
Further, the present invention also provides a kind of computer readable storage medium, the computer readable storage mediums
It is stored with one or more program, one or more of programs can be executed by one or more processor, to realize
The step of described in any item data transmission methods as describe above.
Beneficial effects of the present invention:
The present invention provides a kind of data transmission method, mobile terminal and computer readable storage medium, this method
Running parameter by the communication network being presently in detection first terminal judges whether to meet and work as according to the running parameter
Then environmental condition as defined in preceding communication protocol is converted user data in first terminal according to the result of judgement, and
User data after conversion is sent in second terminal by communication protocol corresponding with the result of judgement, is that basis is worked as
Preceding network environment determines the transmission realized to corresponding communication protocol to data, to realize in identical communication network
Under, guarantee the complete of data transmission by switching communication protocol appropriate, while also improving the transmission security of data, and
Data are caused to exist and the switching for carrying out communication protocol according to network environment can also avoid the factor for network environment
In transmission process the phenomenon that packet loss, and real-time communication protocol replacement is realized, guarantees the timeliness of data transmission, improve
The efficiency of data transmission.
Detailed description of the invention
Present invention will be further explained below with reference to the attached drawings and examples, in attached drawing:
The hardware structural diagram of Fig. 1 each embodiment one optional mobile terminal to realize the present invention;
Fig. 2 is the data transmission method basic flow chart that first embodiment of the invention provides;
Fig. 3 is the structural schematic diagram for the mobile terminal that third embodiment of the invention provides.
Specific embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
In subsequent description, it is only using the suffix for indicating such as " module ", " component " or " unit " of element
Be conducive to explanation of the invention, itself there is no a specific meaning.Therefore, " module ", " component " or " unit " can mix
Ground uses.
Terminal can be implemented in a variety of manners.For example, terminal described in the present invention may include such as mobile phone, plate
Computer, laptop, palm PC, personal digital assistant (Personal Digital Assistant, PDA), portable
Media player (Portable Media Player, PMP), navigation device, wearable device, Intelligent bracelet, pedometer etc. move
The fixed terminals such as dynamic terminal, and number TV, desktop computer.
It will be illustrated by taking mobile terminal as an example in subsequent descriptions, it will be appreciated by those skilled in the art that in addition to special
Except element for moving purpose, the construction of embodiment according to the present invention can also apply to the terminal of fixed type.
Referring to Fig. 1, a kind of hardware structural diagram of its mobile terminal of each embodiment to realize the present invention, the shifting
Dynamic terminal 100 may include: RF (Radio Frequency, radio frequency) unit 101, WiFi module 102, audio output unit
103, A/V (audio/video) input unit 104, sensor 105, display unit 106, user input unit 107, interface unit
108, the components such as memory 109, processor 110 and power supply 111.It will be understood by those skilled in the art that shown in Fig. 1
Mobile terminal structure does not constitute the restriction to mobile terminal, and mobile terminal may include components more more or fewer than diagram,
Perhaps certain components or different component layouts are combined.
It is specifically introduced below with reference to all parts of the Fig. 1 to mobile terminal:
Radio frequency unit 101 can be used for receiving and sending messages or communication process in, signal sends and receivees, specifically, by base station
Downlink information receive after, to processor 110 handle;In addition, the data of uplink are sent to base station.In general, radio frequency unit 101
Including but not limited to antenna, at least one amplifier, transceiver, coupler, low-noise amplifier, duplexer etc..In addition, penetrating
Frequency unit 101 can also be communicated with network and other equipment by wireless communication.Any communication can be used in above-mentioned wireless communication
Standard or agreement, including but not limited to GSM (Global System of Mobile communication, global system for mobile telecommunications
System), GPRS (General Packet Radio Service, general packet radio service), CDMA2000 (Code
Division Multiple Access 2000, CDMA 2000), WCDMA (Wideband Code Division
Multiple Access, wideband code division multiple access), TD-SCDMA (Time Division-Synchronous Code
Division Multiple Access, TD SDMA), FDD-LTE (Frequency Division
Duplexing-Long Term Evolution, frequency division duplex long term evolution) and TDD-LTE (Time Division
Duplexing-Long Term Evolution, time division duplex long term evolution) etc..
WiFi belongs to short range wireless transmission technology, and mobile terminal can help user to receive and dispatch electricity by WiFi module 102
Sub- mail, browsing webpage and access streaming video etc., it provides wireless broadband internet access for user.Although Fig. 1 shows
Go out WiFi module 102, but it is understood that, and it is not belonging to must be configured into for mobile terminal, it completely can be according to need
It to omit within the scope of not changing the essence of the invention.
Audio output unit 103 can be in call signal reception pattern, call mode, record mould in mobile terminal 100
When under the isotypes such as formula, speech recognition mode, broadcast reception mode, by radio frequency unit 101 or WiFi module 102 it is received or
The audio data stored in memory 109 is converted into audio signal and exports to be sound.Moreover, audio output unit 103
Audio output relevant to the specific function that mobile terminal 100 executes can also be provided (for example, call signal receives sound, disappears
Breath receives sound etc.).Audio output unit 103 may include loudspeaker, buzzer etc..
A/V input unit 104 is for receiving audio or video signal.A/V input unit 104 may include graphics processor
(Graphics Processing Unit, GPU) 1041 and microphone 1042, graphics processor 1041 is in video acquisition mode
Or the image data of the static images or video obtained in image capture mode by image capture apparatus (such as camera) carries out
Reason.Treated, and picture frame may be displayed on display unit 106.Through graphics processor 1041, treated that picture frame can be deposited
Storage is sent in memory 109 (or other storage mediums) or via radio frequency unit 101 or WiFi module 102.Mike
Wind 1042 can connect in telephone calling model, logging mode, speech recognition mode etc. operational mode via microphone 1042
Quiet down sound (audio data), and can be audio data by such acoustic processing.Audio that treated (voice) data can
To be converted to the format output that can be sent to mobile communication base station via radio frequency unit 101 in the case where telephone calling model.
Microphone 1042 can be implemented various types of noises elimination (or inhibition) algorithms and send and receive sound to eliminate (or inhibition)
The noise generated during frequency signal or interference.
Mobile terminal 100 further includes at least one sensor 105, such as optical sensor, motion sensor and other biographies
Sensor.Specifically, optical sensor includes ambient light sensor and proximity sensor, wherein ambient light sensor can be according to environment
The light and shade of light adjusts the brightness of display panel 1061, and proximity sensor can close when mobile terminal 100 is moved in one's ear
Display panel 1061 and/or backlight.As a kind of motion sensor, accelerometer sensor can detect in all directions (general
For three axis) size of acceleration, it can detect that size and the direction of gravity when static, can be used to identify the application of mobile phone posture
(such as horizontal/vertical screen switching, dependent game, magnetometer pose calibrating), Vibration identification correlation function (such as pedometer, percussion) etc.;
The fingerprint sensor that can also configure as mobile phone, pressure sensor, iris sensor, molecule sensor, gyroscope, barometer,
The other sensors such as hygrometer, thermometer, infrared sensor, details are not described herein.
Display unit 106 is for showing information input by user or being supplied to the information of user.Display unit 106 can wrap
Display panel 1061 is included, liquid crystal display (Liquid Crystal Display, LCD), Organic Light Emitting Diode can be used
Forms such as (Organic Light-Emitting Diode, OLED) configure display panel 1061.
User input unit 107 can be used for receiving the number or character information of input, and generate the use with mobile terminal
Family setting and the related key signals input of function control.Specifically, user input unit 107 may include touch panel 1071 with
And other input equipments 1072.Touch panel 1071, also referred to as touch screen collect the touch operation of user on it or nearby
(for example user uses any suitable objects or attachment such as finger, stylus on touch panel 1071 or in touch panel 1071
Neighbouring operation), and corresponding attachment device is driven according to preset formula.Touch panel 1071 may include touch detection
Two parts of device and touch controller.Wherein, the touch orientation of touch detecting apparatus detection user, and detect touch operation band
The signal come, transmits a signal to touch controller;Touch controller receives touch information from touch detecting apparatus, and by it
It is converted into contact coordinate, then gives processor 110, and order that processor 110 is sent can be received and executed.In addition, can
To realize touch panel 1071 using multiple types such as resistance-type, condenser type, infrared ray and surface acoustic waves.In addition to touch panel
1071, user input unit 107 can also include other input equipments 1072.Specifically, other input equipments 1072 can wrap
It includes but is not limited in physical keyboard, function key (such as volume control button, switch key etc.), trace ball, mouse, operating stick etc.
It is one or more, specifically herein without limitation.
Further, touch panel 1071 can cover display panel 1061, when touch panel 1071 detect on it or
After neighbouring touch operation, processor 110 is sent to determine the type of touch event, is followed by subsequent processing device 110 according to touch thing
The type of part provides corresponding visual output on display panel 1061.Although in Fig. 1, touch panel 1071 and display panel
1061 be the function that outputs and inputs of realizing mobile terminal as two independent components, but in certain embodiments, it can
The function that outputs and inputs of mobile terminal is realized so that touch panel 1071 and display panel 1061 is integrated, is not done herein specifically
It limits.
Interface unit 108 be used as at least one external device (ED) connect with mobile terminal 100 can by interface.For example,
External device (ED) may include wired or wireless headphone port, external power supply (or battery charger) port, wired or nothing
Line data port, memory card port, the port for connecting the device with identification module, audio input/output (I/O) end
Mouth, video i/o port, ear port etc..Interface unit 108 can be used for receiving the input from external device (ED) (for example, number
It is believed that breath, electric power etc.) and the input received is transferred to one or more elements in mobile terminal 100 or can be with
For transmitting data between mobile terminal 100 and external device (ED).
Memory 109 can be used for storing software program and various data.Memory 109 can mainly include storing program area
The storage data area and, wherein storing program area can (such as the sound of application program needed for storage program area, at least one function
Sound playing function, image player function etc.) etc.;Storage data area can store according to mobile phone use created data (such as
Audio data, phone directory etc.) etc..In addition, memory 109 may include high-speed random access memory, it can also include non-easy
The property lost memory, a for example, at least disk memory, flush memory device or other volatile solid-state parts.
Processor 110 is the control centre of mobile terminal, utilizes each of various interfaces and the entire mobile terminal of connection
A part by running or execute the software program and/or module that are stored in memory 109, and calls and is stored in storage
Data in device 109 execute the various functions and processing data of mobile terminal, to carry out integral monitoring to mobile terminal.Place
Managing device 110 may include one or more processing units;Preferably, processor 110 can integrate application processor and modulatedemodulate is mediated
Manage device, wherein the main processing operation system of application processor, user interface and application program etc., modem processor is main
Processing wireless communication.It is understood that above-mentioned modem processor can not also be integrated into processor 110.
Mobile terminal 100 can also include the power supply 111 (such as battery) powered to all parts, it is preferred that power supply 111
Can be logically contiguous by power-supply management system and processor 110, to realize management charging by power-supply management system, put
The functions such as electricity and power managed.
Although Fig. 1 is not shown, mobile terminal 100 can also be including bluetooth module etc., and details are not described herein.
Based on above-mentioned mobile terminal hardware configuration, each embodiment of the method for the present invention is proposed.
First embodiment
Data transmission method provided in an embodiment of the present invention is suitable for various mobile terminals, including PC, mobile phone, plate, pen
Remember the terminals such as this, it is specific referring to FIG. 2, Fig. 2 is data transmission method basic flow chart provided in this embodiment, wherein here
First terminal refer to router, second terminal refers to client, this method comprises:
The running parameter for the communication network that S201, detection first terminal are presently in.
In practical applications, for Wireless LAN environment, external sound or sound wave to the signal of WLAN
It can be interfered, extra interference noise can be increased to signal, so it is current particularly to obtain first terminal in this step
The interference parameter of communication network in locating environment, such as the noisy coefficient of environment, and these interference parameters can be under udp protocol
Authentication cause erroneous judgement, the verifying of signal is not passed through when receiving signal so as to cause second terminal, so as to cause
Loss of data in the repetition transmission of signal and signal.
S202, judge whether running parameter meets environmental condition as defined in current communication protocol.
In this step, the communication network that the current communication protocols refer to that first terminal is presently in is used
Communication protocol, which can be User Data Protocol UDP, is also possible to transmission control protocol TCP.
The environmental condition is referred in the guarantee using User Data Protocol UDP or transmission control protocol TCP defined
The maximum interference coefficient that the data sent will not be disturbed, such as first terminal are sent using User Data Protocol UDP and are used
When user data, the noisy coefficient of environment that can be verified by data check after data are sent to second terminal can guarantee, if being more than rule
After fixed environmental condition, then first terminal reuses User Data Protocol UDP and sends data to second terminal, then will lead to second
Terminal does not receive data, so that loss of data is rejected.
S203, obtain first terminal in user data to be transmitted, the user data can be video data, short message,
Document etc..
S204, user data is converted according to the result of judgement, and by the user data after conversion by with judgement
The corresponding communication protocol of result be sent in second terminal.
It in this step, further include the corresponding communication protocol of determining current communication network, according to determining communication protocol
And the result of judgement determines the need for carrying out the switching of communication protocol, if not needing, directly according to current communication protocols
Data format as defined in discussing carries out the conversion of data format to the user data to be transmitted;If it is determined that needing to carry out communication protocols
The conversion of view, then after first converting communication protocol, in the data format according to as defined in the communication protocol after conversion to described to be transmitted
User data format.
It, will be in the data transmission to second terminal after conversion according to determining communication protocol after converting data format.
In the present embodiment, for step S202, after the result judged, further include the result of judgement is informed to
The result of judgement specifically can be sent to second eventually by the communication mode before broadcast message either use by second terminal
End, notice second terminal adjust communication protocol according to the result of the judgement received is corresponding, and second terminal is also needed to the
One terminal returns feedback message, establishes communication connection between the two.,
Either first terminal receives the second terminal according to the result message pending sent back of judgement, and according to institute
The communication connection of message foundation between the two is stated, the communication connection carries out for the corresponding communication protocol of result judged with gesture
It establishes.
In practical applications, it can also be between first terminal and second terminal respectively according to User Data Protocol UDP
Two communication connections are established with transmission control protocol TCP, but the two communication connections are not connected directly, are needed according to judgement
Result determine which kind of communication protocol selected, select to connect any item communication connection according to communication protocol.
In the present embodiment, if the running parameter got includes the noisy coefficient for the communication network being presently in, institute
It states and judges whether running parameter meets environmental condition as defined in current communication protocol and include:
Judge whether the noisy coefficient of the environment is greater than noisy coefficient threshold as defined in current communication protocol;
If more than noisy coefficient threshold, then the result judged is does not select to carry out data using current communication protocol
Transmission;
If being not more than noisy coefficient threshold, the result judged carries out data biography as the current communication protocol of selection
It is defeated.
In practical applications, if current communication protocol is User Data Protocol, if judgement is greater than noisy coefficient threshold,
Then current communication protocol is switched to the transmission that transmission control protocol carries out data by first terminal selection, that is to say the basis
The result of judgement converts the user data, and the user data after conversion is passed through lead to corresponding with the result of judgement
Letter agreement, which is sent in the second terminal, includes:
The communication protocol of the first terminal is switched into the biography transport control protocol from the User Data Protocol UDP
Discuss TCP;
The user data is converted into data format corresponding with the transmission control protocol TCP;
The user data after conversion is sent to the second terminal by the transmission control protocol TCP.
Similarly, if judgement is not more than noisy coefficient threshold, first terminal selects the biography of User Data Protocol progress data
It is defeated, it that is to say, user data to be transmitted is converted according to data format as defined in User Data Protocol;
Then the user data after conversion is sent to institute by the communication connection established according to the User Data Protocol
Second terminal is stated, the second terminal is after the data sended over received, according to the verification mode of User Data Protocol
User data is verified, to realize the accuracy and improve data transfer of the data transmission between two terminals
Efficiency.
In the present embodiment, if the current communication protocol is transmission control protocol TCP, and the noisy coefficient of the environment
When greater than the noisy coefficient threshold, the result according to judgement converts the user data, and will be after conversion
User data is sent in the second terminal by communication protocol corresponding with the result of judgement
The communication protocol of the first terminal is switched into the user data association from the transmission control protocol TCP
Discuss UDP;
The user data is converted into data format corresponding with the User Data Protocol UDP;
The user data after conversion is sent to the second terminal by the User Data Protocol UDP.
Similarly, if judgement is not more than noisy coefficient threshold, first terminal selects the biography of transmission control protocol progress data
It is defeated, it that is to say, user data to be transmitted is converted according to data format as defined in transmission control protocol;
Then the user data after conversion is sent to institute by the communication connection established according to the transmission control protocol
State second terminal.
In the present embodiment, the running parameter further includes current other than including the above-mentioned noisy coefficient of environment
The packet loss of communication network is judging whether the noisy coefficient of the environment is greater than noisy coefficient threshold as defined in current communication protocol
After value, further includes:
Judge whether the packet loss of the current communication network is greater than preset threshold;
If thering is one to be unsatisfactory in the packet loss and the noisy coefficient of the environment, execute according to the result of judgement to institute
State the step of user data is converted.
In other words, when judging packet loss and the noisy coefficient of environment at the same time, as long as there are one in the two to be unsatisfactory for item
Part can all impact the user data that first terminal is sent, so that second terminal is using identical communication protocol
When receiving data, the verification of data can not pass through, and lead to the loss of data, or repeat to send, to reduce between the two
Data transmit accuracy and efficiency.
Data transmission method provided in this embodiment, by being determined according to current network environment to corresponding communication protocol
It realizes the transmission to data, to realize under identical communication network, is guaranteed by switching communication protocol appropriate
Data are transmitted complete, while also improving the transmission security of data, and by carrying out communication protocol according to network environment
Switching can also avoid the factor for network environment and cause data in transmission process the phenomenon that packet loss, and realize
Real-time communication protocol replacement, guarantees the timeliness of data transmission, improves the efficiency of data transmission.
Second embodiment
Referring to FIG. 3, Fig. 3 is a kind of structural schematic diagram for mobile terminal that third embodiment of the invention provides, the movement
Terminal includes: processor 31, memory 32 and communication bus 33, and the communication between processor 31 and memory 32 passes through described logical
Believe that bus 33 is realized.
Processor 31 usually controls the overall operation of the server belonging to itself.For example, processor 31 execute calculate and really
The operation such as recognize.Wherein, processor 31 can be central processing unit (CPU).In the present embodiment, processor 31 at least needs to have
Such function:
The running parameter for the communication network that the first terminal is presently in is detected, running parameter here refers specifically to
The interference parameter of communication network, such as the noisy coefficient of environment.
Judge whether the running parameter meets environmental condition as defined in current communication protocol, the communication protocol includes
One of User Datagram Protocol UDP and transmission control protocol TCP;
Obtain user data to be transmitted in the first terminal;
The user data is converted according to the result of judgement, and by the user data after conversion by with judgement
As a result corresponding communication protocol is sent in the second terminal.
In the present embodiment, the communication network that the current communication protocols refer to that first terminal is presently in makes
Communication protocol, the communication protocol can be User Data Protocol UDP, is also possible to transmission control protocol TCP.
The environmental condition is referred in the guarantee using User Data Protocol UDP or transmission control protocol TCP defined
The maximum interference coefficient that the data sent will not be disturbed.
In practical applications, for the processing step of processor 31, specifically the soft of corresponding function can be realized by setting
Part code realizes, optionally, the software code that 32 storage processor of memory is 31 readable, processor 31 is executable, it includes
The instruction (i.e. software execution function) of function described above is executed for control processor 31.In the present embodiment, memory
32 at least need to be stored with and realize that processor 31 executes the program that above-mentioned function needs and realizes that terminal is presently in first terminal
The running parameter, such as the quick-fried rate of data show when transmitted data on network, the noisy coefficient in environment of communication network etc..
Memory 32, generally uses semiconductor memory cell, including random access memory (RAM), read-only memory (ROM),
And cache (CACHE), RAM are most important one memories.Memory 32 is one of the ost important components in computer,
It is the bridge linked up with CPU, and the operation of all programs all carries out in memory in computer, and effect is to be used for
The temporarily operational data in storage CPU, and the data exchanged with external memories such as hard disks, as long as computer is in operation,
CPU will be transferred to the data for needing operation in memory and carry out operation, and CPU again sends out result after the completion of operation, interior
The operation deposited also determines the stable operation of computer.
In practical applications, if the running parameter got includes the noisy coefficient for the communication network being presently in, institute
Processor 31 is stated to execute for realizing judging whether running parameter meets the step of environmental condition as defined in current communication protocol
Suddenly it specifically includes:
Judge whether the noisy coefficient of the environment is greater than noisy coefficient threshold as defined in current communication protocol;
If more than noisy coefficient threshold, then the result judged is does not select to carry out data using current communication protocol
Transmission;
If being not more than noisy coefficient threshold, the result judged carries out data biography as the current communication protocol of selection
It is defeated.
In the present embodiment, if current communication protocol is User Data Protocol, if judgement is greater than noisy coefficient threshold,
Then current communication protocol is switched to the transmission that transmission control protocol carries out data by first terminal selection, that is to say the basis
The result of judgement converts the user data, and the user data after conversion is passed through lead to corresponding with the result of judgement
Letter agreement, which is sent in the second terminal, includes:
The communication protocol of the first terminal is switched into the biography transport control protocol from the User Data Protocol UDP
Discuss TCP;
The user data is converted into data format corresponding with the transmission control protocol TCP;
The user data after conversion is sent to the second terminal by the transmission control protocol TCP.
Similarly, if judgement is not more than noisy coefficient threshold, first terminal selects the biography of User Data Protocol progress data
It is defeated.
If the current communication protocol is transmission control protocol TCP, and the noisy coefficient of the environment is greater than described noisy
When coefficient threshold, the result according to judgement converts the user data, and the user data after conversion is passed through
Communication protocol corresponding with the result of judgement is sent in the second terminal
The communication protocol of the first terminal is switched into the user data association from the transmission control protocol TCP
Discuss UDP;
The user data is converted into data format corresponding with the User Data Protocol UDP;
The user data after conversion is sent to the second terminal by the User Data Protocol UDP.
Similarly, if judgement is not more than noisy coefficient threshold, first terminal selects the biography of transmission control protocol progress data
It is defeated.
In the present embodiment, the running parameter further includes current other than including the above-mentioned noisy coefficient of environment
The packet loss of communication network is judging whether the noisy coefficient of the environment is greater than noisy coefficient threshold as defined in current communication protocol
After value, further includes:
Judge whether the packet loss of the current communication network is greater than preset threshold;
If thering is one to be unsatisfactory in the packet loss and the noisy coefficient of the environment, execute according to the result of judgement to institute
State the step of user data is converted.
In the present embodiment, judge the running parameter whether meet environmental condition as defined in current communication protocol it
Afterwards, further includes: the result of judgement is sent to the second terminal, notifies the second terminal according to the result pair of the judgement
Communication protocol should be adjusted.
The first terminal receive the second terminal according to the result of judgement send back come message, and disappeared according to described
Breath establishes communication connection between the two, and the communication connection is to be established with the corresponding communication protocol of the result of the judgement
's.
The present embodiment additionally provides a kind of computer readable storage medium, and the computer-readable recording medium storage has one
A or multiple programs, one or more of programs can be executed by one or more processor, to perform the steps of
Detect the running parameter for the communication network that the first terminal is presently in;
Judge whether the running parameter meets environmental condition as defined in current communication protocol, the communication protocol includes
One of User Datagram Protocol UDP and transmission control protocol TCP;
Obtain user data to be transmitted in the first terminal;
The user data is converted according to the result of judgement, and by the user data after conversion by with judgement
As a result corresponding communication protocol is sent in the second terminal.
In conclusion data transmission method provided by the invention, mobile terminal and computer readable storage medium, this method
Mainly by the running parameter for the communication network being presently in detection first terminal, judged whether according to the running parameter
Meet environmental condition as defined in current communication protocol, then user data in first terminal is turned according to the result of judgement
It changes, and the user data after conversion is sent in second terminal by communication protocol corresponding with the result of judgement, thus
It realizes by switching communication protocol appropriate and guarantees the complete of data transmission, while also improving the transmission security of data,
The factor for network environment can also be avoided and cause data in transmission process the phenomenon that packet loss simultaneously, realized in real time
Communication protocol replacement, guarantee data transmission timeliness, improve data transmission efficiency.
It should be noted that, in this document, the terms "include", "comprise" or its any other variant are intended to non-row
His property includes, so that the process, method, article or the device that include a series of elements not only include those elements, and
And further include other elements that are not explicitly listed, or further include for this process, method, article or device institute it is intrinsic
Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including being somebody's turn to do
There is also other identical elements in the process, method of element, article or device.
The serial number of the above embodiments of the invention is only for description, does not represent the advantages or disadvantages of the embodiments.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side
Method can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but in many cases
The former is more preferably embodiment.Based on this understanding, technical solution of the present invention substantially in other words does the prior art
The part contributed out can be embodied in the form of software products, which is stored in a storage medium
In (such as ROM/RAM, magnetic disk, CD), including some instructions are used so that a terminal (can be mobile phone, computer, service
Device, air conditioner or network equipment etc.) execute method described in each embodiment of the present invention.
The embodiment of the present invention is described with above attached drawing, but the invention is not limited to above-mentioned specific
Embodiment, the above mentioned embodiment is only schematical, rather than restrictive, those skilled in the art
Under the inspiration of the present invention, without breaking away from the scope protected by the purposes and claims of the present invention, it can also make very much
Form, all of these belong to the protection of the present invention.
Claims (10)
1. a kind of data transmission method, applied to the communications between first terminal and second terminal, which is characterized in that described
Method includes:
Detect the running parameter for the communication network that the first terminal is presently in;
Judge whether the running parameter meets environmental condition as defined in current communication protocol, the communication protocol includes user
One of datagram protocol UDP and transmission control protocol TCP;
Obtain user data to be transmitted in the first terminal;
The user data is converted according to the result of judgement, and the user data after conversion is passed through into the result with judgement
Corresponding communication protocol is sent in the second terminal.
2. data transmission method according to claim 1, which is characterized in that work as judging whether the running parameter meets
After environmental condition as defined in preceding communication protocol, further includes: the result of judgement is sent to the second terminal, described in notice
Second terminal is according to the corresponding adjustment communication protocol of the result of the judgement.
3. data transmission method according to claim 2, which is characterized in that the method also includes: receive described second
Terminal according to the result of judgement send back come message, and communication connection between the two is established according to the message, it is described logical
What letter was connected as being established with the corresponding communication protocol of the result of the judgement.
4. data transmission method according to claim 1, which is characterized in that the running parameter include be presently in it is logical
The noisy coefficient of the environment of communication network, it is described to judge whether the running parameter meets environmental condition as defined in current communication protocol
Include:
Judge whether the noisy coefficient of the environment is greater than noisy coefficient threshold as defined in current communication protocol;
If more than noisy coefficient threshold, then the result judged is does not select to carry out data biography using current communication protocol
It is defeated;
If being not more than noisy coefficient threshold, the result judged carries out data transmission as the current communication protocol of selection.
5. data transmission method according to claim 4, which is characterized in that if the current communication protocol is number of users
According to agreement UDP, and when the noisy coefficient of the environment is greater than the noisy coefficient threshold, the result according to judgement is to the use
User data is converted, and the user data after conversion is sent to described by communication protocol corresponding with the result of judgement
Include: in two terminals
The communication protocol of the first terminal is switched into the transmission control protocol from the User Data Protocol UDP
TCP;
The user data is converted into data format corresponding with the transmission control protocol TCP;
The user data after conversion is sent to the second terminal by the transmission control protocol TCP.
6. data transmission method according to claim 4, which is characterized in that if the current communication protocol is transmission control
Agreement TCP processed, and the noisy coefficient of the environment be greater than the noisy coefficient threshold when, the result according to judgement is to the use
User data is converted, and the user data after conversion is sent to described by communication protocol corresponding with the result of judgement
Include: in two terminals
The communication protocol of the first terminal is switched into the User Data Protocol from the transmission control protocol TCP
UDP;
The user data is converted into data format corresponding with the User Data Protocol UDP;
The user data after conversion is sent to the second terminal by the User Data Protocol UDP.
7. data transmission method according to claim 4, which is characterized in that the running parameter further includes current communication
The packet loss of network;
After judging whether the noisy coefficient of the environment is greater than noisy coefficient threshold as defined in current communication protocol, also wrap
It includes:
Judge whether the packet loss of the current communication network is greater than preset threshold;
If thering is one to be unsatisfactory in the packet loss and the noisy coefficient of the environment, execute according to the result of judgement to the use
The step of user data is converted.
8. data transmission method according to claim 6, which is characterized in that the first terminal is router, described the
Two terminals are client.
9. a kind of mobile terminal, which is characterized in that the mobile terminal includes processor, memory and communication bus;
The communication bus is for realizing the connection communication between the processor and memory;
The processor is for executing one or more program stored in memory, to realize as appointed in claim 1 to 8
The step of data transmission method described in one.
10. a kind of computer readable storage medium, which is characterized in that the computer-readable recording medium storage have one or
Multiple programs, one or more of programs can be executed by one or more processor, to realize such as claim 1 to 8
Any one of described in data transmission method the step of.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201810696722.3A CN109104408A (en) | 2018-06-29 | 2018-06-29 | data transmission method, mobile terminal and computer readable storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201810696722.3A CN109104408A (en) | 2018-06-29 | 2018-06-29 | data transmission method, mobile terminal and computer readable storage medium |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN109104408A true CN109104408A (en) | 2018-12-28 |
Family
ID=64845091
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201810696722.3A Pending CN109104408A (en) | 2018-06-29 | 2018-06-29 | data transmission method, mobile terminal and computer readable storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN109104408A (en) |
Cited By (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112350979A (en) * | 2019-08-09 | 2021-02-09 | 华为技术有限公司 | Data transmission method, device and system |
| CN112995182A (en) * | 2021-03-04 | 2021-06-18 | 广州市百果园信息技术有限公司 | Media stream transmission method, device, equipment and medium |
| CN114079643A (en) * | 2020-08-21 | 2022-02-22 | 北京金山云网络技术有限公司 | Method, device, gateway equipment and computer readable medium for transmitting data |
| CN114844959A (en) * | 2022-04-29 | 2022-08-02 | 深圳市云语科技有限公司 | Method for automatically switching transmission protocol |
| CN116614533A (en) * | 2023-06-06 | 2023-08-18 | 江苏云从曦和人工智能有限公司 | Device communication method, system, electronic device and storage medium |
| CN119835306A (en) * | 2024-12-10 | 2025-04-15 | 珠海格力电器股份有限公司 | Data communication processing method and device, electronic equipment and storage medium |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20050265246A1 (en) * | 2001-02-05 | 2005-12-01 | Farley Kevin L | Application specific traffic optimization in a wireless link |
| CN102255898A (en) * | 2011-07-05 | 2011-11-23 | 上海悠络客电子科技有限公司 | Method for ensuring stability of large data stream by tcp (Transmission Control Protocol)/udp (User Datagram Protocol) double-mode communication |
| CN103078831A (en) * | 2011-10-26 | 2013-05-01 | 新太科技股份有限公司 | Self-adaption method on basis of TCP (Transmission Control Protocol) and UDP (User Datagram Protocol) transmission supported by streaming media |
| CN103685236A (en) * | 2013-11-21 | 2014-03-26 | 南京信息工程大学 | Method for processing data of user layer in transmission of network data of wireless sensor |
| US20140297791A1 (en) * | 2013-03-28 | 2014-10-02 | Canon Kabushiki Kaisha | Communication apparatus, method of controlling the same, and storage medium |
-
2018
- 2018-06-29 CN CN201810696722.3A patent/CN109104408A/en active Pending
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20050265246A1 (en) * | 2001-02-05 | 2005-12-01 | Farley Kevin L | Application specific traffic optimization in a wireless link |
| CN102255898A (en) * | 2011-07-05 | 2011-11-23 | 上海悠络客电子科技有限公司 | Method for ensuring stability of large data stream by tcp (Transmission Control Protocol)/udp (User Datagram Protocol) double-mode communication |
| CN103078831A (en) * | 2011-10-26 | 2013-05-01 | 新太科技股份有限公司 | Self-adaption method on basis of TCP (Transmission Control Protocol) and UDP (User Datagram Protocol) transmission supported by streaming media |
| US20140297791A1 (en) * | 2013-03-28 | 2014-10-02 | Canon Kabushiki Kaisha | Communication apparatus, method of controlling the same, and storage medium |
| CN103685236A (en) * | 2013-11-21 | 2014-03-26 | 南京信息工程大学 | Method for processing data of user layer in transmission of network data of wireless sensor |
Cited By (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112350979A (en) * | 2019-08-09 | 2021-02-09 | 华为技术有限公司 | Data transmission method, device and system |
| CN112350979B (en) * | 2019-08-09 | 2023-03-24 | 华为技术有限公司 | Data transmission method and device |
| CN114079643A (en) * | 2020-08-21 | 2022-02-22 | 北京金山云网络技术有限公司 | Method, device, gateway equipment and computer readable medium for transmitting data |
| CN112995182A (en) * | 2021-03-04 | 2021-06-18 | 广州市百果园信息技术有限公司 | Media stream transmission method, device, equipment and medium |
| CN114844959A (en) * | 2022-04-29 | 2022-08-02 | 深圳市云语科技有限公司 | Method for automatically switching transmission protocol |
| CN116614533A (en) * | 2023-06-06 | 2023-08-18 | 江苏云从曦和人工智能有限公司 | Device communication method, system, electronic device and storage medium |
| CN119835306A (en) * | 2024-12-10 | 2025-04-15 | 珠海格力电器股份有限公司 | Data communication processing method and device, electronic equipment and storage medium |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN109104408A (en) | data transmission method, mobile terminal and computer readable storage medium | |
| CN108494030B (en) | Wireless charging method, terminal and transmitting terminal equipment | |
| CN108227897A (en) | Control method for screen display, flexible screen terminal and computer readable storage medium | |
| CN109547054A (en) | Signal control circuit, terminal device and signal control method | |
| CN108398999A (en) | Control method, mobile terminal and the readable storage medium storing program for executing of screen display power consumption | |
| CN108521658A (en) | Reduce interference method, mobile terminal and computer readable storage medium | |
| CN110417999A (en) | Screen luminance adjustment method, mobile terminal and computer readable storage medium | |
| CN108391190B (en) | A kind of noise-reduction method, earphone and computer readable storage medium | |
| CN109453523A (en) | A kind of game picture display processing method, terminal and computer readable storage medium | |
| CN107920384A (en) | A kind of method, terminal and computer-readable recording medium for searching for communication network | |
| CN108345426A (en) | A kind of terminal control method, terminal and computer readable storage medium | |
| CN107181700A (en) | Control method, mobile terminal and the storage medium of application program for mobile terminal | |
| CN108924352A (en) | Sound quality method for improving, terminal and computer readable storage medium | |
| CN108958936A (en) | Application programe switch-over method, mobile terminal and computer readable storage medium | |
| CN110180181A (en) | Screenshot method, device and the computer readable storage medium of Wonderful time video | |
| CN108833665A (en) | Communication means, wearable device and computer readable storage medium | |
| CN108259233A (en) | Graphics processor GPU method for parameter configuration and mobile terminal in a kind of mobile terminal | |
| CN107870722A (en) | Document transmission method, mobile terminal and the computer-readable recording medium of terminal room | |
| CN107390856A (en) | A kind of method, mobile terminal and storage medium for reducing mobile terminal power consumption | |
| CN107241489A (en) | A kind of method of calling, mobile terminal and computer-readable recording medium | |
| CN109561221A (en) | A kind of call control method, equipment and computer readable storage medium | |
| CN109683778A (en) | A kind of flexible screen control method, equipment and computer readable storage medium | |
| CN109858447A (en) | An information processing method and terminal | |
| CN109587260A (en) | A kind of resource acquiring method, device and system | |
| CN109460082A (en) | Evade method, mobile terminal and the computer readable storage medium of external interference |
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 | ||
| RJ01 | Rejection of invention patent application after publication | ||
| RJ01 | Rejection of invention patent application after publication |
Application publication date: 20181228 |