CN104184817A - Download optimizing method and device and terminal - Google Patents

Download optimizing method and device and terminal Download PDF

Info

Publication number
CN104184817A
CN104184817A CN201410432715.4A CN201410432715A CN104184817A CN 104184817 A CN104184817 A CN 104184817A CN 201410432715 A CN201410432715 A CN 201410432715A CN 104184817 A CN104184817 A CN 104184817A
Authority
CN
China
Prior art keywords
thread
write
buffering area
multiple data
data
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
CN201410432715.4A
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.)
Kingsoft Guangzhou Network Technology Co Ltd
Original Assignee
Kingsoft Guangzhou Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Kingsoft Guangzhou Network Technology Co Ltd filed Critical Kingsoft Guangzhou Network Technology Co Ltd
Priority to CN201410432715.4A priority Critical patent/CN104184817A/en
Publication of CN104184817A publication Critical patent/CN104184817A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the invention discloses a download optimizing method and device and a terminal. The method comprises the steps of receiving an input download instruction, making a response to the download instruction and establishing a reading thread and a writing thread, calling the reading thread to write multiple data sent by a server into a buffer area, and calling the write thread to write data, buffered by the buffer area, in the multiple data into a local file. According to the download optimizing method and device and the terminal, when the buffer area is neither full nor empty, a terminal device can write the data sent by the server corresponding to download address information indicated by the download instruction into the local file through the reading thread and the writing thread at the same time, and then bandwidth is fully utilized and downloading speed is increased.

Description

A kind of download optimization method and device, terminal
Technical field
The present invention relates to Internet technical field, be specifically related to a kind of download optimization method and device, terminal.
Background technology
At present, along with the terminal equipment of the access network such as smart mobile phone, panel computer is more and more universal, on network, there is various application software being arranged on terminal equipment, the installation of these application software and application need access network to obtain data mostly, thereby bring many facilities to people's work and life.In actual applications, when terminal equipment access network obtains data, usually consuming time longer, especially at the net environment of 2G or 3G, downloading process is length consuming time not only, is also prone to Network Abnormal phenomenon, cause failed download, therefore, how improving download efficiency is problem demanding prompt solution.
Summary of the invention
The embodiment of the invention discloses a kind of download optimization method and device, terminal, by reading thread and writing thread parallel deal with data, thereby make full use of bandwidth, improve download efficiency.
Embodiment of the present invention first aspect discloses a kind of download optimization method, comprising:
The download instruction that receives input, wherein, described download instruction comprises download address information;
Respond described download instruction, create and read thread and write thread;
Described in calling, read multiple data that thread sends server and write buffering area, wherein, described server is corresponding with described download address information;
Described in calling, write thread the data in described multiple data of described buffering area buffering are write to local file.
Wherein, describedly read before multiple data that thread sends corresponding described download address server write buffering area respectively by described, described method also comprises:
Detect the store status of described buffering area,
When the store status that described buffering area detected is when full, carry out the step of reading multiple data that thread sends server described in calling and write buffering area;
When the store status that described buffering area detected is when empty, carry out the step of writing thread described in calling the data in described multiple data of described buffering area buffering are write local file.
Alternatively, described method also comprises:
When the store status that described buffering area detected is when full, read thread described in time-out so that described in read thread in blocked state,
And after reading thread described in suspending, carry out the step of store status of the described buffering area of detection.
Wherein, described method also comprises:
When the store status that described buffering area detected is when empty, write thread described in time-out so that described in write thread in blocked state,
And after writing thread described in suspending, carry out the step of store status of the described buffering area of detection.
Wherein, described in calling described in, reading multiple data that thread sends server writes buffering area and comprises:
Described in calling, read thread and receive the data that described server sends;
The described data that receive are divided into multiple data cells;
Described multiple data cells are write to described buffering area according to the first preset rules.
Wherein, described in calling described in, writing thread writes local file by the data of described buffering area and comprises:
Described in calling, write thread, according to the second preset rules, the described multiple data cells in described buffering area are write to local file.
Embodiment of the present invention second aspect discloses a kind of download optimization device, comprising:
Receiver module, for receiving the download instruction of input, wherein, described download instruction comprises download address information;
Creation module, the download instruction receiving for responding described receiver module, creates and reads thread and write thread;
Read thread module, for the thread of reading that calls described creation module establishment, multiple data of server transmission are write to buffering area, wherein, described server is corresponding with described download address information;
Write thread module, for the thread of writing that calls described creation module establishment, the data of described multiple data of described buffering area buffering are write to local file.
Alternatively, described device also comprises:
Detection module, for detection of the store status of described buffering area, and in the store status that described buffering area detected when full, described in triggering, read thread module and carry out the described operation of reading multiple data that thread sends server and write buffering area of calling that described creation module creates, and in the store status that described buffering area detected when empty, write thread module described in triggering and carry out the described operation of writing thread the data in described multiple data of described buffering area buffering are write local file of calling that described creation module creates.
Alternatively, described device also comprises:
Read thread and suspend module, be used in the time that described detection module detects that described buffering area is full, described in time-out, read thread so that described in read thread in blocked state, and after reading thread described in suspending, trigger described detection module and carry out the operation of the store status of the described described buffering area of detection.
Alternatively, described device also comprises:
Write thread and suspend module, be used in the time that described detection module detects that the store status of described buffering area is empty, described in time-out, write thread so that described in write thread in blocked state, and described in suspending, trigger the operation of the store status of the detection described buffering area of described detection module described in carrying out after writing thread.
Wherein, described in, reading thread module comprises:
Receiving element, receives for the thread of reading that calls described creation module establishment the data that described server sends;
Writing unit, is divided into multiple data cells for the described data that described receiving element is received, and described multiple data cells is write to described buffering area according to the first preset rules.
Wherein, described in write thread module specifically for calling the thread of writing that described creation module creates, according to the second preset rules, the described multiple data cells in described buffering area are write to local file.
The embodiment of the present invention third aspect discloses a kind of terminal, and this terminal comprises the device described in foregoing invention embodiment.
The embodiment of the present invention can receive and respond download instruction, can create and read thread and write thread, and call and read multiple data that thread sends server and write buffering area, wherein server is corresponding with download address information, meanwhile, can also call and write thread multiple data of buffering area buffering are write to local file.Visible, the embodiment of the present invention can be simultaneously by reading thread and write the data that the operation of thread sends server corresponding download address to be written to local file, thereby make full use of bandwidth, accelerated the speed of downloading.
Brief description of the drawings
In order to be illustrated more clearly in the technical scheme in the embodiment of the present invention, to the accompanying drawing of required use in embodiment be briefly described below, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skill in the art, do not paying under the prerequisite of creative work, can also obtain according to these accompanying drawings other accompanying drawing.
Fig. 1 is the disclosed a kind of schematic flow sheet of downloading optimization method of the embodiment of the present invention;
Fig. 2 is the disclosed another kind of schematic flow sheet of downloading optimization method of the embodiment of the present invention;
Fig. 3 is the disclosed a kind of structural representation of downloading optimization device of the embodiment of the present invention;
Fig. 4 is the disclosed another kind of structural representation of downloading optimization device of the embodiment of the present invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiment.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtaining under creative work prerequisite, belong to the scope of protection of the invention.
The embodiment of the invention discloses a kind of optimization method and device, terminal downloaded, can be by reading thread and writing thread parallel deal with data, thus make full use of bandwidth, improve download efficiency.Below be elaborated respectively.
Refer to Fig. 1, Fig. 1 is the disclosed a kind of schematic flow sheet of downloading optimization method of the embodiment of the present invention.As shown in Figure 1, this download optimization method can comprise the following steps.
The download instruction of S101, reception input, wherein, this download instruction comprises download address information.
In the embodiment of the present invention, can be received by the terminal equipment of the need execution downloading task such as smart mobile phone, computer, TV and the accessible network equipment download instruction of input.Wherein, the mode of input download instruction can have multiple, as clicked or inputted download address by display screen or by phonetic entry keyword etc.
S102, response download instruction, create and read thread and write thread.
In the embodiment of the present invention, when terminal equipment receives for the download instruction of download address input, can respond this download instruction, create and read thread and write thread.
S103, call and read multiple data that thread sends server and write respectively buffering area, wherein, this server is corresponding with this download address information.
Wherein, reading the network that download address that thread can comprise according to download address information sets up between server is connected, and bufcreate, so that step S103 connects and reads multiple data of server transmission corresponding to download address and write buffering area from network.
S104, call and write thread the data in multiple data of buffering area buffering are write to local file.
In the embodiment of the present invention, terminal equipment can cardiopulmonary bypass in beating heart execution step S103 and step S104.Because buffering area adopts queue mode deal with data, when therefore terminal equipment performs step S103 and step S104, adopt the mode of first in first out to process the data that cushion in buffering area.
Particularly, read before multiple data that thread sends server write buffering area, can also carry out following steps calling:
11) store status of detection buffering area;
12) in the time detecting that the store status of this buffering area is not full, execution step S103;
13) in the time detecting that the store status of this buffering area is not empty, execution step S104;
14) in the time detecting that the store status of this buffering area is full, suspend this to read thread so that read thread in blocked state, and perform step 11);
15) in the time detecting that the store status of this buffering area is empty, suspend this to write thread so that write thread in blocked state, and perform step 11).
Wherein, thread is an entity in process, the elementary cell of independently being dispatched and assigning by terminal equipment, and thread oneself does not have processing resource, only have requisite resource in service, but thread can be shared with other other threads that belong to same process whole resources of process.Therefore, between multiple threads, can concurrently carry out, and restriction mutually, thread is in operation and presents discontinuity.
Reading thread and writing thread all has two states: blocked state and running status.
When reading thread in blocked state, suspend and call when reading multiple data that thread sends server and writing buffering area, terminal equipment can be carried out and once call the operation of writing thread the data in multiple data of buffering area buffering are write local file, just can activate and read thread so that read thread in running status by writing thread, terminal equipment continues to carry out and calls the operation of reading multiple data that thread sends server and write buffering area.Because call and write thread the data in multiple data of buffering area buffering are write after local file, in buffering area, be detected and there is idle space and can continue reading data inward, therefore, read thread and can continue to have moved.
When writing thread in blocked state, suspend and call when writing thread the data in multiple data of buffering area buffering being write to local file, terminal equipment can be carried out once to call and read after multiple data that thread sends server write buffering area, just can activate and write thread so that write thread in running status by reading thread, terminal equipment can continue to carry out and calls the step of writing thread the data in multiple data of buffering area buffering are write local file.Because call and read multiple data that thread sends server and write behind buffering area, in buffering area, be again detected newly-increased data and can be written into local file, therefore, write thread and can continue to have moved.
In the present invention, the step that detects the store status of buffering area constantly loops, and that is to say, when reading thread or writing thread after blocked state, once there be needs, can be adjusted and reworked very soon, improve the operating efficiency of reading thread and write thread.
Particularly, terminal equipment calls and reads multiple data that thread sends server and write buffering area and specifically can comprise the following steps:
21) call and read the data that thread reception server sends;
22) data of reception are divided into multiple data cells;
23) multiple data cells are write to buffering area according to the first preset rules.
Wherein, the first preset rules can be determined according to the management method of buffering area, if buffering area adopts first in first out, terminal equipment can call and read thread, according to first in first out, multiple data cells are write to buffering area, or calls and write thread, according to first in first out, the data in multiple data cells are write to local file.
Correspondingly, terminal equipment calls to be write thread and the data of buffering area are write to local file is specifically as follows to call and writes thread, according to the second preset rules, the data of multiple data cells of buffering area buffering are write to local file, wherein, this second preset rules can be determined according to the first preset rules, as the data cell by buffering area buffering of first in first out writes local file one by one.
In the described method of Fig. 1, when terminal equipment receives the download instruction of input, can create and read thread and write thread; Terminal equipment can receive data from server corresponding to download address information by reading thread, and writes buffering area, and meanwhile, terminal equipment can call to be write thread multiple data of buffering area buffering are write to local file one by one.Visible, when having data in the described method of Fig. 1 in buffering area and having available cache memory space, terminal equipment can call simultaneously to be read thread and writes thread the data of server corresponding download address are written to local file, thereby makes full use of bandwidth, has accelerated the speed of downloading.
Refer to Fig. 2, Fig. 2 is the disclosed another kind of schematic flow sheet of downloading optimization method of the embodiment of the present invention.As shown in Figure 2, this download optimization method can comprise the following steps.
The download instruction of S201, reception input.
Wherein, this download instruction comprises download address information.
S202, response download instruction, create and read thread and write thread.
The store status of S203, detection buffering area, in the time detecting that the store status of this buffering area is not full, execution step S204; In the time detecting that the store status of this buffering area is not empty, execution step S205; Meanwhile, in the time detecting that the store status of this buffering area is full, except execution step S205, can also perform step S206; In the time that the store status of this buffering area of detection is sky, except execution step S204, can also perform step S207.
S204, call and read multiple data that thread sends server and write buffering area.
Correspondingly, after terminal equipment execution of step S204, can continue to perform step the store status of S203 detection buffering area.
Wherein, this server is corresponding with the download address in download address information, can receive the data of file destination corresponding to this download address from this server.
Alternatively, terminal equipment execution step S204 can comprise step 21) to step 23).
Wherein, if read thread in blocked state, terminal equipment calls and reads multiple data that thread sends server and write buffering area and be specifically as follows: activate and read thread and make to read thread in running status by writing thread, and multiple data that server is sent write buffering area.
S205, call and write thread the data in multiple data of buffering area buffering are write to local file.
Alternatively, terminal equipment execution step S205 is specifically as follows to call and writes thread, according to the second preset rules, the data in multiple data cells of buffering area buffering are write to local file.
Wherein, if write thread in blocked state, terminal equipment calls and writes thread and the data in multiple data of buffering area buffering are write to local file be specifically as follows: activate and write thread and make to write thread in running status by reading thread, and the data in multiple data of buffering area buffering are write to local file.
S206, time-out are read thread so that read thread in blocked state, and after this reads thread at time-out, continue execution step S203;
S207, time-out are write thread so that write thread in blocked state, and after time-out is write thread, are performed step S203.
It should be noted that, the scheme of the embodiment of the present invention is the treatment step in the process of obtaining file destination corresponding to download address, and after the data of file destination corresponding to download address are all downloaded from server, terminal equipment can suspend respectively reads thread and write thread, and release read thread and write the resource that thread has.
In the described method of Fig. 2, terminal equipment creates reads thread and writing after thread, detects the store status of buffering area, can be in buffering area when full, call and read multiple data that thread sends server corresponding download address and write respectively buffering area; Or while not being empty in buffering area, call and write thread the data in multiple data of buffering area buffering are write to local file, in the data that the embodiment of the present invention can send at reception server, the data of buffering area are write to local file, make full use of bandwidth, improved download efficiency.Further, in the time that expire buffering area, can suspend and read thread to stop writing to buffering area the operation of data, and in the time writing thread execution and once the data in buffering area are write the operation of local file (being that buffering area is for full), will activate and read thread and continue to write data toward buffering area; And in the time that buffering area is sky, can suspend and write thread to stop the operation of the data that read buffering area, and write after the operation of buffering area (being that buffering area is when empty) reading data that thread execution once sends server, just can by read thread activate write thread continue the data of buffering area are write to local file, thereby can make to read thread and write thread to suspend in time in the time there is no data processing, in the time having data, can move always, reduce the processing load of terminal equipment.
Refer to Fig. 3, Fig. 3 is the disclosed a kind of structural representation of downloading optimization device of the embodiment of the present invention.Wherein, the download optimization device shown in Fig. 3 comprises with lower module.
Receiver module 1, for receiving the download instruction of input.
Wherein, download instruction comprises download address information.
Creation module 2, the download instruction receiving for responding receiver module 1, creates and reads thread and write thread;
Read thread module 3, write buffering area for the multiple data that thread sends server of reading of calling that creation module 2 creates, wherein, this server is corresponding with download address information;
Write thread module 4, write thread the data of multiple data of buffering area buffering are write to local file for calling.
Wherein, multiple data that server corresponding to download address information sends refer to the data of the file destination that download address information asks.
See also Fig. 4, Fig. 4 is the disclosed another kind of structural representation of downloading optimization device of the embodiment of the present invention.Wherein, the download optimization device shown in Fig. 4 is that download optimization device is as shown in Figure 3 optimized and obtains.Compare with the device shown in Fig. 3, the download optimization device shown in Fig. 4 can also comprise:
Detection module 5, for detection of the store status of buffering area, and in the store status that described buffering area detected when full, triggering is read thread module 3 and is carried out and call the operation of reading multiple data that thread sends server and write buffering area, and in the store status that buffering area detected when empty, trigger and write thread module 4 and carry out and call the operation of writing thread the data in multiple data of buffering area buffering are write local file.
Correspondingly, read thread module 3 and write thread module 4 and can carry out once after corresponding operation, can detection trigger module 5 detect the store status of buffering area, if this store status is not empty and for full, reads thread module 3 and write thread module 4 and can carry out corresponding operation simultaneously.
Be greater than for fear of reading speed that data that thread sends server write buffering area the speed of writing thread the data in multiple data of buffering area buffering are write local file, and causing buffer data to overflow, the download optimization device shown in Fig. 4 can also comprise that reading thread suspends module 6.
Read thread and suspend module 6, when detecting that at detection module 5 buffering area is full, suspend and read thread so that read thread in blocked state, and after time-out is read thread, detection trigger module 5 is carried out the operation of the store status that detects buffering areas.
Correspondingly, the speed that writes buffering area for avoiding reading data that thread sends server is less than the speed of writing thread the data in multiple data of buffering area buffering are write local file, and while causing buffering area there is no data, write thread and also continue to carry out the operation that writes local file, the download optimization device shown in Fig. 4 can also comprise that writing thread suspends module 7.
Write thread and suspend module 7, be used in the time that detection module 5 detects that the store status of described buffering area is empty, suspend and write thread so that write thread in blocked state, and write the thread operation of the store status of detection trigger module 5 execution detection buffering areas afterwards at time-out.
In addition, in the download optimization device shown in Fig. 4, read thread module 3 and can also comprise with lower unit:
Receiving element 31, reads for calling the data that thread reception server sends;
Particularly, receiving element 31, calls and reads the data that thread reception server sends for store status that buffering area detected at detection module 5 when full.
Writing unit 32, is divided into multiple data cells for the data that receiving element 31 is received, and multiple data cells are write to buffering area according to the first preset rules (as first-in first-out rule).
In addition, in embodiments of the present invention, write thread module 4 and write thread specifically for calling, according to the second preset rules (as first-in first-out rule), the multiple data cells that cushion in buffering area are write to local file.
In Fig. 3 and the described download optimization device of Fig. 4, can utilize the operation of reading thread and writing thread the data of server transmission are write local file, take full advantage of bandwidth, improve download process efficiency; Further, in the described download optimization device of Fig. 4, can make to read thread and write thread to suspend in time in the time there is no data processing, in the time having data, can move always, reduce the processing load of terminal equipment.
The embodiment of the invention also discloses a kind of terminal, this terminal comprises the download optimization device of describing described in Fig. 3 and embodiment corresponding to Fig. 4, and this terminal can make full use of bandwidth, improves download process efficiency, further reduces the processing load of terminal equipment.
In the description of this specification, the description of reference term " embodiment ", " some embodiment ", " example ", " concrete example " or " some examples " etc. means to be contained at least one embodiment of the present invention or example in conjunction with specific features, structure, material or the feature of this embodiment or example description.In this manual, to the schematic statement of above-mentioned term not must for be identical embodiment or example.And, specific features, structure, material or the feature of description can one or more embodiment in office or example in suitable mode combination.In addition,, not conflicting in the situation that, those skilled in the art can carry out combination and combination by the feature of the different embodiment that describe in this specification or example and different embodiment or example.
In addition, term " first ", " second " be only for describing object, and can not be interpreted as instruction or hint relative importance or the implicit quantity that indicates indicated technical characterictic.Thus, at least one this feature can be expressed or impliedly be comprised to the feature that is limited with " first ", " second ".In description of the invention, the implication of " multiple " is at least two, for example two, and three etc., unless otherwise expressly limited specifically.
Any process of otherwise describing in flow chart or at this or method are described and can be understood to, represent to comprise that one or more is for realizing module, fragment or the part of code of executable instruction of step of specific logical function or process, and the scope of the preferred embodiment of the present invention comprises other realization, wherein can be not according to order shown or that discuss, comprise according to related function by the mode of basic while or by contrary order, carry out function, this should be understood by embodiments of the invention person of ordinary skill in the field.
The logic and/or the step that in flow chart, represent or otherwise describe at this, for example, can be considered to the sequencing list of the executable instruction for realizing logic function, may be embodied in any computer-readable medium, use for instruction execution system, device or equipment (as computer based system, comprise that the system of processor or other can and carry out the system of instruction from instruction execution system, device or equipment instruction fetch), or use in conjunction with these instruction execution systems, device or equipment.With regard to this specification, " computer-readable medium " can be anyly can comprise, device that storage, communication, propagation or transmission procedure use for instruction execution system, device or equipment or in conjunction with these instruction execution systems, device or equipment.The example more specifically (non-exhaustive list) of computer-readable medium comprises following: the electrical connection section (electronic installation) with one or more wirings, portable computer diskette box (magnetic device), random access memory (RAM), read-only memory (ROM), the erasable read-only memory (EPROM or flash memory) of editing, fiber device, and portable optic disk read-only memory (CDROM).In addition, computer-readable medium can be even paper or other the suitable medium that can print described program thereon, because can be for example by paper or other media be carried out to optical scanner, then edit, decipher or process in electronics mode and obtain described program with other suitable methods if desired, be then stored in computer storage.
Should be appreciated that each several part of the present invention can realize with hardware, software, firmware or their combination.In the above-described embodiment, multiple steps or method can realize with being stored in software or the firmware carried out in memory and by suitable instruction execution system.For example, if realized with hardware, the same in another embodiment, can realize by any one in following technology well known in the art or their combination: there is the discrete logic for data-signal being realized to the logic gates of logic function, there is the application-specific integrated circuit (ASIC) of suitable combinational logic gate circuit, programmable gate array (PGA), field programmable gate array (FPGA) etc.
Those skilled in the art are appreciated that realizing all or part of step that above-described embodiment method carries is can carry out the hardware that instruction is relevant by program to complete, described program can be stored in a kind of computer-readable recording medium, this program, in the time carrying out, comprises step of embodiment of the method one or a combination set of.
In addition, the each functional unit in each embodiment of the present invention can be integrated in a processing module, can be also that the independent physics of unit exists, and also can be integrated in a module two or more unit.Above-mentioned integrated module both can adopt the form of hardware to realize, and also can adopt the form of software function module to realize.If described integrated module realizes and during as production marketing independently or use, also can be stored in a computer read/write memory medium using the form of software function module.
The above-mentioned storage medium of mentioning can be read-only memory, disk or CD etc.Although illustrated and described embodiments of the invention above, be understandable that, above-described embodiment is exemplary, can not be interpreted as limitation of the present invention, and those of ordinary skill in the art can change above-described embodiment within the scope of the invention, amendment, replacement and modification.
One of ordinary skill in the art will appreciate that all or part of flow process realizing in above-described embodiment method, can carry out the hardware that instruction is relevant by computer program to complete, described program can be stored in a computer read/write memory medium, this program, in the time carrying out, can comprise as the flow process of the embodiment of above-mentioned each side method.Wherein, described storage medium can be magnetic disc, CD, read-only store-memory body (Read-Only Memory, ROM) or random store-memory body (Random Access Memory, RAM) etc.
Above disclosed is only preferred embodiment of the present invention, certainly can not limit with this interest field of the present invention, and the equivalent variations of therefore doing according to the claims in the present invention, still belongs to the scope that the present invention is contained.

Claims (13)

1. download an optimization method, it is characterized in that, comprising:
The download instruction that receives input, wherein, described download instruction comprises download address information;
Respond described download instruction, create and read thread and write thread;
Described in calling, read multiple data that thread sends server and write buffering area, wherein, described server is corresponding with described download address information;
Described in calling, write thread the data in described multiple data of described buffering area buffering are write to local file.
2. the method for claim 1, is characterized in that, described in read described in calling before multiple data that thread sends server write buffering area, described method also comprises:
Detect the store status of described buffering area,
When the store status that described buffering area detected is when full, carry out the step of reading multiple data that thread sends server described in calling and write buffering area;
When the store status that described buffering area detected is when empty, carry out the step of writing thread described in calling the data in described multiple data of described buffering area buffering are write local file.
3. method as claimed in claim 2, is characterized in that, described method also comprises:
When the store status that described buffering area detected is when full, read thread described in time-out so that described in read thread in blocked state,
And after reading thread described in suspending, carry out the step of store status of the described buffering area of detection.
4. method as claimed in claim 2, is characterized in that, described method also comprises:
When the store status that described buffering area detected is when empty, write thread described in time-out so that described in write thread in blocked state,
And after writing thread described in suspending, carry out the step of store status of the described buffering area of detection.
5. the method for claim 1, is characterized in that, described in read multiple data that thread sends server described in calling and write buffering area and comprise:
Described in calling, read thread and receive the data that described server sends;
The described data that receive are divided into multiple data cells;
Described multiple data cells are write to described buffering area according to the first preset rules.
6. method as claimed in claim 5, is characterized in that, described in write thread described in calling and the data in described multiple data of described buffering area buffering are write to local file comprise:
Described in calling, write thread, according to the second preset rules, the data in described multiple data cells of described buffering area buffering are write to local file.
7. download an optimization device, it is characterized in that, comprising:
Receiver module, for receiving the download instruction of input, wherein, described download instruction comprises download address information;
Creation module, the download instruction receiving for responding described receiver module, creates and reads thread and write thread;
Read thread module, for the thread of reading that calls described creation module establishment, multiple data of server transmission are write to buffering area, wherein, described server is corresponding with described download address information;
Write thread module, for the thread of writing that calls described creation module establishment, the data of described multiple data of described buffering area buffering are write to local file.
8. device as claimed in claim 7, is characterized in that, described device also comprises:
Detection module, for detection of the store status of described buffering area, and in the store status that described buffering area detected when full, described in triggering, read thread module and carry out the operation of reading multiple data that thread sends server described in described calling and write buffering area, and in the store status that described buffering area detected when empty, write thread module described in triggering and carry out the operation of writing thread described in described calling the data in described multiple data of described buffering area buffering are write local file.
9. device as claimed in claim 8, is characterized in that, described device also comprises:
Read thread and suspend module, be used in the time that described detection module detects that described buffering area is full, described in time-out, read thread so that described in read thread in blocked state, and after reading thread described in suspending, trigger described detection module and carry out the operation of the store status of the described described buffering area of detection.
10. device as claimed in claim 8, is characterized in that, described device also comprises:
Write thread and suspend module, be used in the time that described detection module detects that the store status of described buffering area is empty, described in time-out, write thread so that described in write thread in blocked state, and described in suspending, trigger the operation of the store status of the detection described buffering area of described detection module described in carrying out after writing thread.
11. devices as claimed in claim 7, is characterized in that, described in read thread module and comprise:
Receiving element, receives for the thread of reading that calls described creation module establishment the data that described server sends;
Writing unit, is divided into multiple data cells for the described data that described receiving element is received, and described multiple data cells is write to described buffering area according to the first preset rules.
12. devices as claimed in claim 11, it is characterized in that, the described thread module of writing, specifically for calling the thread of writing of described creation module establishment, writes local file according to the second preset rules by the data in described multiple data cells of described buffering area buffering.
13. 1 kinds of terminals, is characterized in that, described terminal comprises the device described in claim 7 to 11 any one.
CN201410432715.4A 2014-08-28 2014-08-28 Download optimizing method and device and terminal Pending CN104184817A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410432715.4A CN104184817A (en) 2014-08-28 2014-08-28 Download optimizing method and device and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410432715.4A CN104184817A (en) 2014-08-28 2014-08-28 Download optimizing method and device and terminal

Publications (1)

Publication Number Publication Date
CN104184817A true CN104184817A (en) 2014-12-03

Family

ID=51965546

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410432715.4A Pending CN104184817A (en) 2014-08-28 2014-08-28 Download optimizing method and device and terminal

Country Status (1)

Country Link
CN (1) CN104184817A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104536932A (en) * 2015-01-23 2015-04-22 崔阳 Universal communication method of special low-speed USB equipment
CN106681658A (en) * 2016-11-25 2017-05-17 天津津航计算技术研究所 Method for achieving high-speed transfer of mass data of data recorder on basis of multithreading
CN108121822A (en) * 2018-01-09 2018-06-05 北京奇艺世纪科技有限公司 A kind of write-in data method and device
CN109684274A (en) * 2018-09-07 2019-04-26 平安科技(深圳)有限公司 Archive method, equipment and computer readable storage medium
CN113380280A (en) * 2018-12-29 2021-09-10 百度在线网络技术(北京)有限公司 Data processing method, device and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101127989A (en) * 2007-09-11 2008-02-20 中兴通讯股份有限公司 A method for supporting hypertext transmission stream media service of mobile phone
CN101188544A (en) * 2007-12-04 2008-05-28 浙江大学 File transfer method for distributed file server based on buffer
CN103873929A (en) * 2014-04-11 2014-06-18 北京鸿达以太文化发展有限公司 Method and device for playing multimedia data

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101127989A (en) * 2007-09-11 2008-02-20 中兴通讯股份有限公司 A method for supporting hypertext transmission stream media service of mobile phone
CN101188544A (en) * 2007-12-04 2008-05-28 浙江大学 File transfer method for distributed file server based on buffer
CN103873929A (en) * 2014-04-11 2014-06-18 北京鸿达以太文化发展有限公司 Method and device for playing multimedia data

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104536932A (en) * 2015-01-23 2015-04-22 崔阳 Universal communication method of special low-speed USB equipment
CN104536932B (en) * 2015-01-23 2019-01-01 崔阳 The universal communication method of dedicated low-speed USB devices
CN106681658A (en) * 2016-11-25 2017-05-17 天津津航计算技术研究所 Method for achieving high-speed transfer of mass data of data recorder on basis of multithreading
CN108121822A (en) * 2018-01-09 2018-06-05 北京奇艺世纪科技有限公司 A kind of write-in data method and device
CN109684274A (en) * 2018-09-07 2019-04-26 平安科技(深圳)有限公司 Archive method, equipment and computer readable storage medium
CN109684274B (en) * 2018-09-07 2023-04-18 平安科技(深圳)有限公司 File archiving method, device and computer readable storage medium
CN113380280A (en) * 2018-12-29 2021-09-10 百度在线网络技术(北京)有限公司 Data processing method, device and storage medium

Similar Documents

Publication Publication Date Title
US10437631B2 (en) Operating system hot-switching method and apparatus and mobile terminal
EP3584696A1 (en) Managing delivery of code and dependent data using application containers
CN111694646B (en) Resource scheduling method, device, electronic equipment and computer readable storage medium
CN104184817A (en) Download optimizing method and device and terminal
CN103646656A (en) Sound effect processing method, sound effect processing device, plug-in manager and sound effect plug-in
CN103455348A (en) Subarea adjustment method, device, terminal, server and system
EP2750042B1 (en) Method and apparatus for managing memory
CN111240834B (en) Task execution method, device, electronic equipment and storage medium
CN110377341B (en) Method, device, medium and electronic equipment for monitoring no-response exception
CN110489158B (en) Method, device, medium and electronic equipment for optimizing code hosting platform
CN103793267A (en) Queue access method and device
CN104360880A (en) Application installing method and electronic equipment
CN112363815B (en) Redis cluster processing method and device, electronic equipment and computer readable storage medium
CN105975306A (en) Application program starting management method and application program starting management apparatus for electronic device
CN105824668A (en) Process control method, process control device and terminal equipment
CN117407133A (en) Task processing method and device and computer readable storage medium
CN110515749B (en) Method, device, server and storage medium for queue scheduling of information transmission
CN105279164A (en) File processing method and device based on IOS system
US8281091B2 (en) Automatic selection of storage volumes in a data storage system
CN105630556A (en) Resource loading method and system
CN111459653B (en) Cluster scheduling method, device and system and electronic equipment
CN111078405B (en) Memory allocation method and device, storage medium and electronic equipment
CN113747423A (en) Cloud mobile phone state synchronization method, device, equipment, storage medium and program product
CN105159619A (en) Virtual memory extension method and apparatus
CN112306371A (en) Method, apparatus and computer program product for storage management

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into 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: 20141203