CN105430035A - Network data uploading method and device - Google Patents

Network data uploading method and device Download PDF

Info

Publication number
CN105430035A
CN105430035A CN201410478519.0A CN201410478519A CN105430035A CN 105430035 A CN105430035 A CN 105430035A CN 201410478519 A CN201410478519 A CN 201410478519A CN 105430035 A CN105430035 A CN 105430035A
Authority
CN
China
Prior art keywords
data
uploaded
network data
network
size
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
CN201410478519.0A
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.)
Tencent Technology Beijing Co Ltd
Original Assignee
Tencent Technology Beijing 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 Tencent Technology Beijing Co Ltd filed Critical Tencent Technology Beijing Co Ltd
Priority to CN201410478519.0A priority Critical patent/CN105430035A/en
Publication of CN105430035A publication Critical patent/CN105430035A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses a network data uploading method and device, and belongs to the Internet technical field. The method includes the following steps: obtaining network data to be uploaded and the current uploading rate of a network that a terminal accesses; determining the size of a data packet that uploads the network data to be uploaded according to the current uploading rate; and uploading the network data to be uploaded to a server according to the determined size of the data packet. The device comprises a first obtaining module, a determining module and a first uploading module. The size of upload subpackets can be determined according to the current network condition, and the successes rate and the efficiency of network data uploading are improved.

Description

A kind of method and apparatus uploading network data
Technical field
The present invention relates to Internet technical field, particularly a kind of method and apparatus uploading network data.
Background technology
At present, most of terminal all has the function of access network, and when terminal is linked into network, terminal can upload network data to server.Server preserves the network data that this terminal is uploaded, and the other-end except this terminal in network can download this network data from server, thus realizes sharing of network data.Such as, terminal can upload one section of video to server, and server preserves this video, and the other-end except this terminal in network can download this video from server, thus realizes sharing of video.
A kind of method uploading network data is provided in prior art, can be: terminal obtains network data to be uploaded, if the network of current access is Wifi (wirelessfidelity, Wireless Fidelity) network time, this network data to be uploaded is encapsulated as a HTTP (Hypertexttransferprotocol by terminal, HTML (Hypertext Markup Language)) request, send this HTTP request to server; If the network of current access is GPRS (GeneralPacketRadioService, GPRS) network time, according to the size of network data to be uploaded, be multiple packet by network data cutting, the size of each packet in the plurality of packet is not more than 128KB; Be a HTTP request by each packet encapsulation, obtain multiple HTTP request, send each HTTP request in multiple HTTP request to server respectively.
Realizing in process of the present invention, inventor finds that prior art at least exists following problem:
If the network of current access is the Wifi network of public place, and the terminal number of the Wifi network insertion of public place is more, network bandwidth dog-eat-dog, is directly encapsulated as a HTTP request by network data to be uploaded, when server sends this HTTP request, easily upload failure.Further, the bandwidth fluctuation of the Different periods GPRS network of different location is very large, and such as, the bandwidth of current GPRS networks is very large, or uploads network data with the subpackage of 128KB fixed size, does not make full use of the network bandwidth, thus causes transfer efficiency low.
Summary of the invention
In order to make the problem of solution prior art, the invention provides a kind of method and apparatus uploading network data.Technical scheme is as follows:
On the one hand, the invention provides a kind of method uploading network data, described method comprises:
Obtain the current uploading rate of the network of network data to be uploaded and terminal access;
According to described current uploading rate, determine the data package size uploading described network data to be uploaded;
According to described established data bag size, upload described network data to be uploaded to server.
On the other hand, the invention provides a kind of device uploading network data, described device comprises:
First acquisition module, for obtaining the current uploading rate of the network of network data to be uploaded and terminal access;
Determination module, for according to described current uploading rate, determines the data package size uploading described network data to be uploaded;
Transmission module on first, for according to described established data bag size, uploads described network data to be uploaded to server.
In embodiments of the present invention, according to current uploading rate, determine the data package size uploading network data to be uploaded; According to established data bag size, upload network data to be uploaded to server, thus can determine to upload subpackage size according to current network conditions, improve the success rate and efficiency of uploading network data.
Accompanying drawing explanation
Fig. 1 is a kind of method flow diagram uploading network data that the embodiment of the present invention 1 provides;
Fig. 2 is a kind of method flow diagram uploading network data that the embodiment of the present invention 2 provides;
Fig. 3 is a kind of apparatus structure schematic diagram uploading network data that the embodiment of the present invention 3 provides;
Fig. 4 is the structural representation of a kind of terminal that the embodiment of the present invention 4 provides.
Embodiment
For making the object, technical solutions and advantages of the present invention clearly, below in conjunction with accompanying drawing, embodiment of the present invention is described further in detail.
Embodiment 1
Embodiments provide a kind of method uploading network data, the executive agent of the method can be terminal, and see Fig. 1, wherein, the method comprises:
Step 101: the current uploading rate obtaining the network of network data to be uploaded and terminal access;
Step 102: according to current uploading rate, determines the data package size uploading network data to be uploaded;
Step 103: according to established data bag size, upload network data to be uploaded to server.
In embodiments of the present invention, according to current uploading rate, determine the data package size uploading network data to be uploaded; According to established data bag size, upload network data to be uploaded to server, thus can determine to upload subpackage size according to current network conditions, improve the success rate and efficiency of uploading network data.
Embodiment 2
Embodiments provide a kind of method uploading network data, the executive agent of the method can be terminal, and see Fig. 2, wherein, the method comprises:
Step 201: the current uploading rate obtaining the network of network data to be uploaded and terminal access;
When user wants to upload network data to server, terminal obtains network data to be uploaded, and this network data can be video, picture or music etc.
In embodiments of the present invention, current uploading rate according to the network of terminal access determines the data package size uploading network data, therefore, first terminal obtains the current uploading rate of the network of terminal access by following steps (1) to (4), comprising:
(1): from the data package size preset, select minimum data package size;
Terminal presets multiple data package size in advance, when uploading network data to server, owing to not knowing the current uploading rate of the network that terminal accesses, in order to guarantee successfully to upload network data, from the data package size preset, select minimum data package size in this step.
Such as, terminal is preset multiple data package size in advance and is respectively 32KB, 64KB, 128KB, 512KB and 1024KB.Terminal selects minimum packet to be 32KB from presetting multiple data package size.
(2): from network data to be uploaded, obtain the network data that size of data is no more than minimum data package size;
If when the size of network data to be uploaded is not less than minimum data package size, in this step, obtain the network data that size of data equals minimum data package size from network data to be uploaded; If when the size of network data to be uploaded is less than minimum data package size, in this step, directly obtain network data to be uploaded.
Such as, user wants to upload one section of video to server, and the size of this video is 1024KB, in this step, obtains the video that size of data is 32KB from this video.
(3): the network data being no more than minimum data package size to server uploading data size, uplink time is obtained;
The network data that size of data is no more than minimum data package size by terminal is encapsulated as a HTTP request, sends this HTTP request to server, record transmitting time; This HTTP request that server receiving terminal sends, return success response to terminal, this success response is used to indicate this HTTP request and uploads successfully; The success response that terminal reception server returns, record time of reception; According to transmitting time and time of reception, calculate uplink time.
Such as, the video encapsulation of 32KB is a HTTP request by terminal, sends this HTTP request to server, and record transmitting time is 10:00:05am; This HTTP request that server receiving terminal sends, returns success response to terminal, the success response that terminal reception server sends, and record time of reception is 10:00:07am.According to transmitting time 10:00:05am and time of reception 10:00:07am, calculating uplink time is 2s.
(4): according to minimum data package size and uplink time, the current uploading rate of the network of computing terminal access.
Particularly, calculate minimum data package size and the ratio of uplink time, the current uploading rate of the network accessed as terminal by this ratio.
Such as, minimum data package size is 32KB, and uplink time is 2S, then the current uploading rate of the network of terminal access is 16KB/S.
Step 202: according to current uploading rate, determines the data package size uploading network data to be uploaded;
Step 202 can pass through following steps (1) and (2) realize, and comprising:
(1) the uploading rate scope at current uploading rate place: according to current uploading rate, is determined;
Before this step, terminal arranges multiple uploading rate scope in advance, according to multiple uploading rate scopes of current uploading rate and setting, determines the uploading rate scope at current uploading rate place.
Such as, terminal arranges five uploading rate scopes in advance, and the first uploading rate scope is: uploading rate <4KB/S; Second uploading rate scope is: 4KB/S=< uploading rate <15KB/S; 3rd uploading rate scope is: 15KB/S=< uploading rate <120KB/S; 4th uploading rate scope is: 120KB/S=< uploading rate <250KB/S; 5th uploading rate scope is: uploading rate >=250KB/S.The current uploading rate of the network of terminal access is 16KB/S, determines that the uploading rate scope at current uploading rate place is the 3rd uploading rate scope.
Further, uploading rate is defined as the network of non-constant by terminal at the network of the first uploading rate scope, uploading rate is defined as 2G (2rdGeneration at the network of the second uploading rate scope, Generation Mobile Telecommunication System) network, uploading rate is defined as the network of 3G (3rdGeneration, 3G (Third Generation) Moblie) at the network of the 3rd uploading rate scope; Uploading rate is defined as the network of 4G (4dGeneration, forth generation mobile communication) at the network of the 4th uploading rate scope, uploading rate is defined as Wifi network at the network of the 5th uploading rate scope.
(2) data package size of network data to be uploaded: according to the uploading rate scope determined, is uploaded from uploading rate scope and acquisition the corresponding relation of the data package size preset.
Before this step, the corresponding relation of terminal storage uploading rate scope and default size of data; In this step, according to the uploading rate scope determined, upload the data package size of network data to be uploaded from uploading rate scope and acquisition the corresponding relation of the data package size preset.
Such as, the data package size that the first uploading rate scope of terminal regulation is corresponding is 32KB; Data package size corresponding to the second uploading rate scope is 64KB; Data package size corresponding to the 3rd uploading rate scope is 128KB; Data package size corresponding to the 4th uploading rate scope is 512KB; Data package size corresponding to the 5th uploading rate scope is 1024KB.The uploading rate scope determined is the 3rd uploading rate scope, and data package size corresponding to the 3rd uploading rate scope is 128KB.
Step 203: according to established data bag size, obtain network data from network data to be uploaded, the size of the network data of this acquisition is no more than established data bag size;
If the size of the network data also do not uploaded in network data to be uploaded is not less than established data bag size, in this step, in the network data also do not uploaded from network data to be uploaded, obtain the network data of established data bag size; If the size of the network data also do not uploaded in network data to be uploaded is less than established data bag size, directly obtain the network data also do not uploaded in network data to be uploaded in this step.
Such as, video size to be uploaded is 1024KB, has uploaded the video of 32KB size in step 201, and the video size also do not uploaded in video to be uploaded is 992KB, in this step, obtains the video of 128KB from the video of 992KB.
Step 204: the network data of acquisition is encapsulated as a HTTP request;
The network data of acquisition is encapsulated as a HTTP request, performs step 205.
Such as, by the video encapsulation of the 128KB of acquisition be a HTTP request.
Step 205: send this HTTP request to server;
Step 206: whether successfully judge to send HTTP request to server, if so, perform step 207; If not, step 209 is performed;
Send this HTTP request to server, record sends the transmitting time of this HTTP request; If server receives this HTTP request that terminal sends, server sends success response to terminal; The success response that terminal reception server sends, determines to upload successfully, record time of reception.If send this HTTP request failure to server, determine to upload failure.
Further, according to transmitting time and time of reception, calculate and send this HTTP request time used to server.
Further, if send this HTTP request failure to server, obtain type of error, determine whether because network reason causes uploading failure according to type of error, if so, perform step 209; If not, terminate.
Determine whether that the step causing uploading failure due to network reason can be according to type of error:
Whether misjudgment type is default type of error, if so, then determines because network reason causes uploading failure; If not, then determine it is not because network reason causes uploading failure.
The type of error preset can carry out arranging and changing according to network, and such as, type of error can be-1001 ,-1005 or-1009 etc., when terminal acquisition-1001 ,-1005 or-1009, determines because network reason causes uploading failure.
Such as, the HTTP request of 128KB video is sent to server, the transmitting time that record sends the HTTP request of 128KB video is 10:00:08am, server receives the HTTP request of this 128KB video that terminal sends, success response is sent to terminal, the success response that terminal reception server sends, determine the HTTP request success sending 128KB video to server, record time of reception is 10:00:09am.Terminal is according to transmitting time 10:00:08am and time of reception 10:00:09am, and the time calculated to the HTTP request of server transmission 128KB video is used is 1S.
Step 207: according to sending HTTP request time used and established data bag size, obtain the current uploading rate of network;
Particularly, if send HTTP request success to server, the ratio of the established data bag size time used with sending HTTP request is calculated, using the current uploading rate of this ratio as network.
Such as, the time that the HTTP request of transmission 128KB video is used is 1s, and established data bag size is 128KB, then the current uploading rate of network is 128KB/S.
Step 208: according to the current uploading rate of network, upload the network data also do not uploaded in network data to be uploaded to server, terminates.
Step 208 can be passed through following steps (1) to (5) and realize, and comprising:
(1) the uploading rate scope at the current uploading rate place of network: according to the current uploading rate of network, is determined;
Terminal arranges multiple uploading rate scope in advance, according to the current uploading rate of network, and the multiple uploading rate scopes arranged, determine the uploading rate scope at the current uploading rate place of network.
Such as, the current uploading rate of network is 128KB/S, and the uploading rate scope according to the current uploading rate place of the multiple uploading rate scope determination networks arranged is the 4th uploading rate scope.
(2) data package size of the network data also do not uploaded in network data to be uploaded: according to the uploading rate scope determined, is uploaded from uploading rate scope and acquisition the corresponding relation of the data package size preset;
Before this step, the corresponding relation of terminal storage uploading rate scope and default size of data; In this step, according to the uploading rate scope determined, upload the data package size of the network data also do not uploaded in network data to be uploaded from uploading rate scope and acquisition the corresponding relation of the data package size preset.
Such as, the uploading rate scope determined is the 4th uploading rate scope, and data package size corresponding to the 4th uploading rate scope is 512KB.
(3): according to the data package size obtained, in the network data also do not uploaded from network data to be uploaded, obtain the network data that size of data is no more than the data package size of acquisition;
If the size of the network data also do not uploaded in network data to be uploaded is not less than established data bag size, in this step, in the network data also do not uploaded from network data to be uploaded, obtain the network data of established data bag size; If the size of the network data also do not uploaded in network data to be uploaded is less than established data bag size, directly obtain the network data also do not uploaded in network data to be uploaded in this step.
Such as, upload 128KB in the video of 992KB, the video size also do not uploaded is 864KB.The video of 512KB is obtained from the video of the 864KB also do not uploaded.
(4): the network data of acquisition is encapsulated as a HTTP request;
The network data of acquisition is encapsulated as a HTTP request, performs step (5).
Such as, by the video encapsulation of 512KB be a HTTP request.
(5): send this HTTP request to server.
Send this HTTP request to server, judge whether network data to be uploaded has been uploaded, if so, terminate; If not, step 207 is performed.
Such as, send the HTTP request of 512KB video to server, be now also left the video of 352KB, perform step 207.
Step 209: select minimum data package size from the data package size preset;
If send this HTTP request failure to server, in order to ensure this time can to upload successfully, then from the data package size preset, select minimum data package size, perform step 210.
Step 210: according to minimum data package size, uploads network data to be uploaded to server.
Step 210 can be passed through following steps (1) to (3) and realize, and comprising:
(1): obtain the number of times uploading network data failure to be uploaded to server;
Such as, the number of times uploading network data failure to be uploaded when forward direction server is 2.
(2): according to the frequency of failure obtained, time delay retry time is obtained;
Particularly, according to the frequency of failure obtained and preset algorithm, obtain time delay retry time.
Preset algorithm can be exponentiation algorithm or multiplication etc.Such as, preset algorithm is 15S* (n*n), n is the frequency of failure.If n=2, then time delay retry time is 60S.For another example, my 15S*n of preset algorithm, if n=2, then time delay retry is 30S.
(3): after time delay retry time, according to minimum data package size, network data to be uploaded is uploaded to server.
After time delay retry time, the network data that size of data is no more than minimum data package size is obtained in the network data also do not uploaded from network data to be uploaded, the network data of acquisition is encapsulated as a HTTP request, sends this HTTP request to server, perform step 206.
In embodiments of the present invention, according to current uploading rate, determine the data package size uploading network data to be uploaded; According to established data bag size, upload network data to be uploaded to server, thus can determine to upload subpackage size according to current network conditions, improve the success rate and efficiency of uploading network data.Further, terminal, according to the frequency of failure, determines time delay retry time, further increases the success rate uploading network data.
Embodiment 3
Embodiments provide a kind of device uploading network data, see Fig. 3, wherein, this device comprises:
First acquisition module 301, for obtaining the current uploading rate of the network of network data to be uploaded and terminal access;
Determination module 302, for according to current uploading rate, determines the data package size uploading network data to be uploaded;
Transmission module 303 on first, for according to established data bag size, uploads network data to be uploaded to server.
Preferably, the first acquisition module 301, comprising:
Selected cell, for selecting minimum data package size from the data package size preset;
First acquiring unit, for obtaining the network data that size of data is no more than minimum data package size from network data to be uploaded;
Second acquisition unit, for being no more than the network data of minimum data package size to server uploading data size, obtains uplink time;
Computing unit, for according to minimum data package size and uplink time, the current uploading rate of the network of computing terminal access.
Preferably, determination module 302, comprising:
Determining unit, for according to current uploading rate, determines the uploading rate scope at current uploading rate place;
3rd acquiring unit, for according to the uploading rate scope determined, uploads the data package size of network data to be uploaded from uploading rate scope and acquisition the corresponding relation of the data package size preset.
Preferably, transmission module 303 on first, comprising:
4th acquiring unit, for according to established data bag size, obtains network data from network data to be uploaded, and the size of the network data of acquisition is no more than established data bag size;
Encapsulation unit, for being encapsulated as a HTTP request by the network data of acquisition;
Transmitting element, for sending HTTP request to server.
Preferably, device also comprises:
Second acquisition module, for according to sending HTTP request time used and established data bag size, obtains the current uploading rate of network;
Transmission module on second, for the current uploading rate according to network, uploads the network data also do not uploaded in network data to be uploaded to server.
Preferably, device also comprises:
Select module, if for uploading network data failure to be uploaded to server, select minimum data package size from the data package size preset;
Transmission module on 3rd, for according to minimum data package size, uploads network data to be uploaded to server.
Preferably, transmission module on the 3rd, comprising:
5th acquiring unit, for obtaining the number of times uploading network data failure to be uploaded to server;
6th acquiring unit, for according to the frequency of failure obtained, obtains time delay retry time;
Uploading unit, for after time delay retry time, according to minimum data package size, uploads network data to be uploaded to server.
In embodiments of the present invention, according to current uploading rate, determine the data package size uploading network data to be uploaded; According to established data bag size, upload network data to be uploaded to server, thus can determine to upload subpackage size according to current network conditions, improve the success rate and efficiency of uploading network data.Further, terminal, according to the frequency of failure, determines time delay retry time, further increases the success rate uploading network data.
Embodiment 4
Please refer to Fig. 4, it illustrates the terminal structure schematic diagram with Touch sensitive surface involved by the embodiment of the present invention, this terminal may be used for the method for carrying out identifying code checking implementing to provide in above-described embodiment.Specifically:
Terminal 900 can comprise RF (RadioFrequency, radio frequency) circuit 110, the memory 120 including one or more computer-readable recording mediums, input unit 130, display unit 140, transducer 150, voicefrequency circuit 160, WiFi (wirelessfidelity, Wireless Fidelity) module 170, include the parts such as processor 180 and power supply 190 that more than or processes core.It will be understood by those skilled in the art that the restriction of the not structure paired terminal of the terminal structure shown in Fig. 4, the parts more more or less than diagram can be comprised, or combine some parts, or different parts are arranged.Wherein:
RF circuit 110 can be used for receiving and sending messages or in communication process, the reception of signal and transmission, especially, after being received by the downlink information of base station, transfer to more than one or one processor 180 to process; In addition, base station is sent to by relating to up data.Usually, RF circuit 110 includes but not limited to antenna, at least one amplifier, tuner, one or more oscillator, subscriber identity module (SIM) card, transceiver, coupler, LNA (LowNoiseAmplifier, low noise amplifier), duplexer etc.In addition, RF circuit 110 can also by radio communication and network and other devices communicatings.Described radio communication can use arbitrary communication standard or agreement, include but not limited to GSM (GlobalSystemofMobilecommunication, global system for mobile communications), GPRS (GeneralPacketRadioService, general packet radio service), CDMA (CodeDivisionMultipleAccess, code division multiple access), WCDMA (WidebandCodeDivisionMultipleAccess, Wideband Code Division Multiple Access (WCDMA)), LTE (LongTermEvolution, Long Term Evolution), Email, SMS (ShortMessagingService, Short Message Service) etc.
Memory 120 can be used for storing software program and module, and processor 180 is stored in software program and the module of memory 120 by running, thus performs the application of various function and data processing.Memory 120 mainly can comprise storage program district and store data field, and wherein, storage program district can storage operation system, application program (such as sound-playing function, image player function etc.) etc. needed at least one function; Store data field and can store the data (such as voice data, phone directory etc.) etc. created according to the use of terminal 900.In addition, memory 120 can comprise high-speed random access memory, can also comprise nonvolatile memory, such as at least one disk memory, flush memory device or other volatile solid-state parts.Correspondingly, memory 120 can also comprise Memory Controller, to provide the access of processor 180 and input unit 130 pairs of memories 120.
Input unit 130 can be used for the numeral or the character information that receive input, and produces and to arrange with user and function controls relevant keyboard, mouse, action bars, optics or trace ball signal and inputs.Particularly, input unit 130 can comprise Touch sensitive surface 131 and other input equipments 132.Touch sensitive surface 131, also referred to as touch display screen or Trackpad, user can be collected or neighbouring touch operation (such as user uses any applicable object or the operations of annex on Touch sensitive surface 131 or near Touch sensitive surface 131 such as finger, stylus) thereon, and drive corresponding jockey according to the formula preset.Optionally, Touch sensitive surface 131 can comprise touch detecting apparatus and touch controller two parts.Wherein, touch detecting apparatus detects the touch orientation of user, and detects the signal that touch operation brings, and sends signal to touch controller; Touch controller receives touch information from touch detecting apparatus, and converts it to contact coordinate, then gives processor 180, and the order that energy receiving processor 180 is sent also is performed.In addition, the polytypes such as resistance-type, condenser type, infrared ray and surface acoustic wave can be adopted to realize Touch sensitive surface 131.Except Touch sensitive surface 131, input unit 130 can also comprise other input equipments 132.Particularly, other input equipments 132 can include but not limited to one or more in physical keyboard, function key (such as volume control button, switch key etc.), trace ball, mouse, action bars etc.
Display unit 140 can be used for the various graphical user interface showing information or the information being supplied to user and the terminal 900 inputted by user, and these graphical user interface can be made up of figure, text, icon, video and its combination in any.Display unit 140 can comprise display floater 141, optionally, the form such as LCD (LiquidCrystalDisplay, liquid crystal display), OLED (OrganicLight-EmittingDiode, Organic Light Emitting Diode) can be adopted to configure display floater 141.Further, Touch sensitive surface 131 can cover display floater 141, when Touch sensitive surface 131 detects thereon or after neighbouring touch operation, send processor 180 to determine the type of touch event, on display floater 141, provide corresponding vision to export with preprocessor 180 according to the type of touch event.Although in the diagram, Touch sensitive surface 131 and display floater 141 be as two independently parts realize input and input function, in certain embodiments, can by Touch sensitive surface 131 and display floater 141 integrated and realize input and output function.
Terminal 900 also can comprise at least one transducer 150, such as optical sensor, motion sensor and other transducers.Particularly, optical sensor can comprise ambient light sensor and proximity transducer, and wherein, ambient light sensor the light and shade of environmentally light can regulate the brightness of display floater 141, proximity transducer when terminal 900 moves in one's ear, can cut out display floater 141 and/or backlight.As the one of motion sensor, Gravity accelerometer can detect the size of all directions (are generally three axles) acceleration, size and the direction of gravity can be detected time static, can be used for identifying the application (such as horizontal/vertical screen switching, dependent game, magnetometer pose calibrating) of mobile phone attitude, Vibration identification correlation function (such as pedometer, knock) etc.; As for terminal 900 also other transducers such as configurable gyroscope, barometer, hygrometer, thermometer, infrared ray sensor, do not repeat them here.
Voicefrequency circuit 160, loud speaker 161, microphone 162 can provide the audio interface between user and terminal 900.Voicefrequency circuit 160 can by receive voice data conversion after the signal of telecommunication, be transferred to loud speaker 161, by loud speaker 161 be converted to voice signal export; On the other hand, the voice signal of collection is converted to the signal of telecommunication by microphone 162, voice data is converted to after being received by voicefrequency circuit 160, after again voice data output processor 180 being processed, through RF circuit 110 to send to such as another terminal, or export voice data to memory 120 to process further.Voicefrequency circuit 160 also may comprise earphone jack, to provide the communication of peripheral hardware earphone and terminal 900.
WiFi belongs to short range wireless transmission technology, and by WiFi module 170, terminal 900 can help that user sends and receive e-mail, browsing page and access streaming video etc., and its broadband internet wireless for user provides is accessed.Although Fig. 4 shows WiFi module 170, be understandable that, it does not belong to must forming of terminal 900, can omit in the scope of essence not changing invention as required completely.
Processor 180 is control centres of terminal 900, utilize the various piece of various interface and the whole mobile phone of connection, software program in memory 120 and/or module is stored in by running or performing, and call the data be stored in memory 120, perform various function and the deal with data of terminal 900, thus integral monitoring is carried out to mobile phone.Optionally, processor 180 can comprise one or more process core; Preferably, processor 180 accessible site application processor and modem processor, wherein, application processor mainly processes operating system, user interface and application program etc., and modem processor mainly processes radio communication.Be understandable that, above-mentioned modem processor also can not be integrated in processor 180.
Terminal 900 also comprises the power supply 190 (such as battery) of powering to all parts, preferably, power supply can be connected with processor 180 logic by power-supply management system, thus realizes the functions such as management charging, electric discharge and power managed by power-supply management system.Power supply 190 can also comprise one or more direct current or AC power, recharging system, power failure detection circuit, power supply changeover device or the random component such as inverter, power supply status indicator.
Although not shown, terminal 900 can also comprise camera, bluetooth module etc., does not repeat them here.Specifically in the present embodiment, the display unit of terminal 900 is touch-screen displays, terminal 900 also includes memory, and one or more than one program, one of them or more than one program are stored in memory, and are configured to be performed by more than one or one processor state more than one or one program package containing the instruction for carrying out following operation:
Obtain the current uploading rate of the network of network data to be uploaded and terminal access;
According to described current uploading rate, determine the data package size uploading described network data to be uploaded;
According to described established data bag size, upload described network data to be uploaded to server.
Preferably, the current uploading rate of the network of described acquisition terminal access, comprising:
Minimum data package size is selected from the data package size preset;
The network data that size of data is no more than described minimum data package size is obtained from described network data to be uploaded;
Upload to described server the network data that described size of data is no more than described minimum data package size, obtain uplink time;
According to described minimum data package size and described uplink time, the current uploading rate of the network of computing terminal access.
Preferably, described according to described current uploading rate, determine the data package size uploading described network data to be uploaded, comprising:
According to described current uploading rate, determine the uploading rate scope at described current uploading rate place;
According to the described uploading rate scope determined, upload the data package size of described network data to be uploaded from uploading rate scope and acquisition the corresponding relation of the data package size preset.
Preferably, described according to described established data bag size, upload described network data to be uploaded to server, comprising:
According to described established data bag size, from described network data to be uploaded, obtain network data, the size of the network data of described acquisition is no more than described established data bag size;
The network data of described acquisition is encapsulated as a HTTP request;
Described HTTP request is sent to server.
Preferably, described to after server sends described HTTP request, also comprise:
According to sending described HTTP request time used and described established data bag size, obtain the current uploading rate of described network;
According to the current uploading rate of described network, upload the network data also do not uploaded in described network data to be uploaded to described server.
Preferably, described method also comprises:
If upload the failure of described network data to be uploaded to described server, from the data package size preset, select minimum data package size;
According to described minimum data package size, upload described network data to be uploaded to described server.
Preferably, described according to described minimum data package size, upload described network data to be uploaded to described server, comprising:
Obtain the number of times uploading described network data failure to be uploaded to described server;
According to the frequency of failure of described acquisition, obtain time delay retry time;
After described time delay retry time, according to described minimum data package size, upload described network data to be uploaded to described server.
In embodiments of the present invention, according to current uploading rate, determine the data package size uploading network data to be uploaded; According to established data bag size, upload network data to be uploaded to server, thus can determine to upload subpackage size according to current network conditions, improve the success rate and efficiency of uploading network data.Further, terminal, according to the frequency of failure, determines time delay retry time, further increases the success rate uploading network data.
It should be noted that: what above-described embodiment provided uploads the device of network data when uploading network data, only be illustrated with the division of above-mentioned each functional module, in practical application, can distribute as required and by above-mentioned functions and be completed by different functional modules, internal structure by device is divided into different functional modules, to complete all or part of function described above.In addition, the device of network data that what above-described embodiment provided upload belongs to same design with the embodiment of the method uploading network data, and its specific implementation process refers to embodiment of the method, repeats no more here.
One of ordinary skill in the art will appreciate that all or part of step realizing above-described embodiment can have been come by hardware, the hardware that also can carry out instruction relevant by program completes, described program can be stored in a kind of computer-readable recording medium, the above-mentioned storage medium mentioned can be read-only memory, disk or CD etc.
The foregoing is only preferred embodiment of the present invention, not in order to limit the present invention, within the spirit and principles in the present invention all, any amendment done, equivalent replacement, improvement etc., all should be included within protection scope of the present invention.

Claims (14)

1. upload a method for network data, it is characterized in that, described method comprises:
Obtain the current uploading rate of the network of network data to be uploaded and terminal access;
According to described current uploading rate, determine the data package size uploading described network data to be uploaded;
According to described established data bag size, upload described network data to be uploaded to server.
2. the method for claim 1, is characterized in that, the current uploading rate of the network of described acquisition terminal access, comprising:
Minimum data package size is selected from the data package size preset;
The network data that size of data is no more than described minimum data package size is obtained from described network data to be uploaded;
Upload to described server the network data that described size of data is no more than described minimum data package size, obtain uplink time;
According to described minimum data package size and described uplink time, the current uploading rate of the network of computing terminal access.
3. the method for claim 1, is characterized in that, described according to described current uploading rate, determines the data package size uploading described network data to be uploaded, comprising:
According to described current uploading rate, determine the uploading rate scope at described current uploading rate place;
According to the described uploading rate scope determined, upload the data package size of described network data to be uploaded from uploading rate scope and acquisition the corresponding relation of the data package size preset.
4. the method for claim 1, is characterized in that, described according to described established data bag size, uploads described network data to be uploaded, comprising to server:
According to described established data bag size, from described network data to be uploaded, obtain network data, the size of the network data of described acquisition is no more than described established data bag size;
The network data of described acquisition is encapsulated as a HTTP request;
Described HTTP request is sent to server.
5. method as claimed in claim 4, is characterized in that, described to after server sends described HTTP request, also comprises:
According to sending described HTTP request time used and described established data bag size, obtain the current uploading rate of described network;
According to the current uploading rate of described network, upload the network data also do not uploaded in described network data to be uploaded to described server.
6. the method for claim 1, is characterized in that, described method also comprises:
If upload the failure of described network data to be uploaded to described server, from the data package size preset, select minimum data package size;
According to described minimum data package size, upload described network data to be uploaded to described server.
7. method as claimed in claim 6, is characterized in that, described according to described minimum data package size, uploads described network data to be uploaded, comprising to described server:
Obtain the number of times uploading described network data failure to be uploaded to described server;
According to the frequency of failure of described acquisition, obtain time delay retry time;
After described time delay retry time, according to described minimum data package size, upload described network data to be uploaded to described server.
8. upload a device for network data, it is characterized in that, described device comprises:
First acquisition module, for obtaining the current uploading rate of the network of network data to be uploaded and terminal access;
Determination module, for according to described current uploading rate, determines the data package size uploading described network data to be uploaded;
Transmission module on first, for according to described established data bag size, uploads described network data to be uploaded to server.
9. device as claimed in claim 8, it is characterized in that, described first acquisition module, comprising:
Selected cell, for selecting minimum data package size from the data package size preset;
First acquiring unit, for obtaining the network data that size of data is no more than described minimum data package size from described network data to be uploaded;
Second acquisition unit, for uploading the network data that described size of data is no more than described minimum data package size to described server, obtains uplink time;
Computing unit, for according to described minimum data package size and described uplink time, the current uploading rate of the network of computing terminal access.
10. device as claimed in claim 8, it is characterized in that, described determination module, comprising:
Determining unit, for according to described current uploading rate, determines the uploading rate scope at described current uploading rate place;
3rd acquiring unit, for according to the described uploading rate scope determined, uploads the data package size of described network data to be uploaded from uploading rate scope and acquisition the corresponding relation of the data package size preset.
11. devices as claimed in claim 8, it is characterized in that, transmission module on described first, comprising:
4th acquiring unit, for according to described established data bag size, obtains network data from described network data to be uploaded, and the size of the network data of described acquisition is no more than described established data bag size;
Encapsulation unit, for being encapsulated as a HTTP request by the network data of described acquisition;
Transmitting element, for sending described HTTP request to server.
12. devices as claimed in claim 11, it is characterized in that, described device also comprises:
Second acquisition module, for according to sending described HTTP request time used and described established data bag size, obtains the current uploading rate of described network;
Transmission module on second, for the current uploading rate according to described network, uploads the network data also do not uploaded in described network data to be uploaded to described server.
13. devices as claimed in claim 8, it is characterized in that, described device also comprises:
Select module, if for uploading the failure of described network data to be uploaded to described server, select minimum data package size from the data package size preset;
Transmission module on 3rd, for according to described minimum data package size, uploads described network data to be uploaded to described server.
14. devices as claimed in claim 13, it is characterized in that, transmission module on the described 3rd, comprising:
5th acquiring unit, for obtaining the number of times uploading described network data failure to be uploaded to described server;
6th acquiring unit, for the frequency of failure according to described acquisition, obtains time delay retry time;
Uploading unit, for after described time delay retry time, according to described minimum data package size, uploads described network data to be uploaded to described server.
CN201410478519.0A 2014-09-18 2014-09-18 Network data uploading method and device Pending CN105430035A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410478519.0A CN105430035A (en) 2014-09-18 2014-09-18 Network data uploading method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410478519.0A CN105430035A (en) 2014-09-18 2014-09-18 Network data uploading method and device

Publications (1)

Publication Number Publication Date
CN105430035A true CN105430035A (en) 2016-03-23

Family

ID=55507974

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410478519.0A Pending CN105430035A (en) 2014-09-18 2014-09-18 Network data uploading method and device

Country Status (1)

Country Link
CN (1) CN105430035A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108040266A (en) * 2017-12-06 2018-05-15 深圳市雷鸟信息科技有限公司 Abnormality eliminating method, device and the storage medium of data synchronization
CN108574735A (en) * 2018-04-11 2018-09-25 努比亚技术有限公司 Data processing method, terminal and computer readable storage medium
CN109391694A (en) * 2018-10-26 2019-02-26 深圳壹账通智能科技有限公司 Document transmission method and relevant device based on SFTP
WO2019062007A1 (en) * 2017-09-26 2019-04-04 平安科技(深圳)有限公司 Data transmission method and apparatus, terminal device, and medium
CN109587266A (en) * 2018-12-21 2019-04-05 拉扎斯网络科技(上海)有限公司 Quality inspection report method, device, terminal and the storage medium of dispatching personnel

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101110818A (en) * 2007-07-12 2008-01-23 深圳市融合视讯科技有限公司 Optimization method facing data protocol of non-connected user
CN101347013A (en) * 2005-09-29 2009-01-14 诺基亚公司 Apparatus, method and computer program product to request a data rate increase based on ability to transmit at least one more selected data unit
CN101656756A (en) * 2009-09-17 2010-02-24 中国科学院声学研究所 File transferring method with self-adaptive control of transmission speed and system thereof
CN101945266A (en) * 2010-08-20 2011-01-12 山东神戎电子股份有限公司 Adaptive method for wireless network video stream transmission
CN102404187A (en) * 2010-09-13 2012-04-04 华为技术有限公司 Congestion control method and system as well as network equipment
CN102404771A (en) * 2010-09-17 2012-04-04 上海手机测试公共服务平台有限公司 Method for testing GPRS (General Packet Radio Service) data transmission performance of wireless communication module
CN102571966A (en) * 2012-01-16 2012-07-11 上海方正数字出版技术有限公司 Network transmission method for large extensible markup language (XML) document
CN102905319A (en) * 2012-10-23 2013-01-30 李文龙 Method and system for data flow distribution
CN103581242A (en) * 2012-07-27 2014-02-12 腾讯科技(深圳)有限公司 Method, client-side equipment, server and system for uploading files
CN103973778A (en) * 2014-04-22 2014-08-06 华为技术有限公司 Information pushing method and device
CN104022852A (en) * 2014-06-25 2014-09-03 北京奇艺世纪科技有限公司 Document transmission method and device

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101347013A (en) * 2005-09-29 2009-01-14 诺基亚公司 Apparatus, method and computer program product to request a data rate increase based on ability to transmit at least one more selected data unit
CN101110818A (en) * 2007-07-12 2008-01-23 深圳市融合视讯科技有限公司 Optimization method facing data protocol of non-connected user
CN101656756A (en) * 2009-09-17 2010-02-24 中国科学院声学研究所 File transferring method with self-adaptive control of transmission speed and system thereof
CN101945266A (en) * 2010-08-20 2011-01-12 山东神戎电子股份有限公司 Adaptive method for wireless network video stream transmission
CN102404187A (en) * 2010-09-13 2012-04-04 华为技术有限公司 Congestion control method and system as well as network equipment
CN102404771A (en) * 2010-09-17 2012-04-04 上海手机测试公共服务平台有限公司 Method for testing GPRS (General Packet Radio Service) data transmission performance of wireless communication module
CN102571966A (en) * 2012-01-16 2012-07-11 上海方正数字出版技术有限公司 Network transmission method for large extensible markup language (XML) document
CN103581242A (en) * 2012-07-27 2014-02-12 腾讯科技(深圳)有限公司 Method, client-side equipment, server and system for uploading files
CN102905319A (en) * 2012-10-23 2013-01-30 李文龙 Method and system for data flow distribution
CN103973778A (en) * 2014-04-22 2014-08-06 华为技术有限公司 Information pushing method and device
CN104022852A (en) * 2014-06-25 2014-09-03 北京奇艺世纪科技有限公司 Document transmission method and device

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019062007A1 (en) * 2017-09-26 2019-04-04 平安科技(深圳)有限公司 Data transmission method and apparatus, terminal device, and medium
US11146571B2 (en) 2017-09-26 2021-10-12 Ping An Technology (Shenzhen) Co., Ltd. Data transmission method, apparatus, terminal device, and medium
CN108040266A (en) * 2017-12-06 2018-05-15 深圳市雷鸟信息科技有限公司 Abnormality eliminating method, device and the storage medium of data synchronization
CN108574735A (en) * 2018-04-11 2018-09-25 努比亚技术有限公司 Data processing method, terminal and computer readable storage medium
CN108574735B (en) * 2018-04-11 2022-07-12 柴森森 Data processing method, terminal and computer readable storage medium
CN109391694A (en) * 2018-10-26 2019-02-26 深圳壹账通智能科技有限公司 Document transmission method and relevant device based on SFTP
CN109391694B (en) * 2018-10-26 2022-07-26 深圳壹账通智能科技有限公司 SFTP-based file transmission method and related equipment
CN109587266A (en) * 2018-12-21 2019-04-05 拉扎斯网络科技(上海)有限公司 Quality inspection report method, device, terminal and the storage medium of dispatching personnel

Similar Documents

Publication Publication Date Title
CN104142862B (en) The overload protection method of server and device
CN105005909A (en) Method and device for predicting lost users
CN104978115A (en) Content display method and device
CN104123120B (en) A kind of browser page data filtering method, device and system
CN104135502B (en) A kind of method, relevant device and system realizing application message and remind
CN104427083A (en) Volume adjusting method and device
CN104301504A (en) Message viewing method and device and mobile terminal
CN104065693A (en) Method, device and system for accessing network data in webpage applications
CN104980455A (en) Multi-terminal data synchronization method based on cloud storage, device and system thereof
CN103068016B (en) The method of mobile terminal and reduction power consumption thereof
CN104572690A (en) Webpage data acquisition method, webpage data acquisition device and webpage data acquisition system
CN103475914A (en) Video playing method, video playing device, terminal equipment and server
CN104967634A (en) File upload method and apparatus thereof
CN103312597B (en) A kind of speech message generation method and device
CN104123276A (en) Method, device and system for intercepting popup windows in browser
CN103177217B (en) A kind of file scanning method, system and client and server
CN104850406A (en) Page switching method and device
CN104133757A (en) Method for obtaining memory information and terminal
CN104636664A (en) Cross-site scripting vulnerability detection method and device based on file object model
CN104915091A (en) Method and device for displaying status bar prompt message
CN104239332A (en) Webpage content processing method, webpage content processing device and browser client side
CN105430035A (en) Network data uploading method and device
CN104954159A (en) Network information statistics method and device
CN104423822A (en) Automated test script recording method and device
CN105227598A (en) A kind of resource sharing method, device and system stored based on cloud

Legal Events

Date Code Title Description
C06 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

Application publication date: 20160323

RJ01 Rejection of invention patent application after publication