CN102902520A - Data buffering method and device under condition of limited resources - Google Patents
Data buffering method and device under condition of limited resources Download PDFInfo
- Publication number
- CN102902520A CN102902520A CN2012103031125A CN201210303112A CN102902520A CN 102902520 A CN102902520 A CN 102902520A CN 2012103031125 A CN2012103031125 A CN 2012103031125A CN 201210303112 A CN201210303112 A CN 201210303112A CN 102902520 A CN102902520 A CN 102902520A
- Authority
- CN
- China
- Prior art keywords
- data
- buffer zone
- module
- program interface
- original program
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Landscapes
- Information Transfer Systems (AREA)
Abstract
The invention provides a data buffering method under the condition of limited resources, comprising the steps of building only one buffer zone; obtaining data by using an original program interface; copying the obtained data to the buffer zone; and accessing the data from the buffer zone. The invention also provides a data buffering device under the condition of the limited resources, comprising a buffer zone building module for building only one buffer zone, a data reading module for obtaining the data by using the original program interface, a buffer zone storing module for copying the data read by the data reading module to the buffer zone and a buffer zone reading module for accessing data from the buffer zone. According to the technical scheme of the invention, only one buffer zone is adopted, so that the problem that multi-buffer zone space is insufficient under the condition of the limited resources is avoided and the program performance is improved.
Description
Technical field
The present invention relates to the computer software optimisation technique, relate in particular to data buffering method and device under a kind of limited resources.
Background technology
Buffer zone is a kind of Performance Optimization technique, its method is: open up the polylith region of memory, data are copied to buffer zone successively, owing to there is the copy of data in the buffer zone, just read next blocks of data when making calling program needn't wait pending data no longer to use, therefore can improve the operational efficiency of program.
But, also do not have a kind of method of under the limited memory resources supplIes, using buffer technology accelerated procedure performance at present.
Summary of the invention
The technical problem to be solved in the present invention provides data buffering method and device under a kind of limited resources, realizes improving operational efficiency under the limited memory.
In order to address the above problem, the invention provides data buffering method under a kind of limited resources, comprising:
Only set up a buffer zone;
Use the original program interface to obtain data;
The described data Replica that obtains is arrived described buffer zone;
From described buffer zone, take data.
Further, said method also can have following characteristics, and described method also comprises: repeat following operation until finish:
Use described original program interface to obtain follow-up data; The current data Replica that obtains is arrived described buffer zone; From described buffer zone, take data.
Further, said method also can have following characteristics, and in described repetitive process, when taking data from described buffer zone, the described original program interface of use in the operation of executed in parallel next round obtains the step of follow-up data.
Further, said method also can have following characteristics, and described method also comprises:
When the data in copying to described buffer zone did not re-use, the follow-up data that just will use described original program interface to obtain copied to described buffer zone.
Further, said method also can have following characteristics, and described original program interface is data function reading or data output function.
The present invention also provides data buffer device under a kind of limited resources, it is characterized in that, comprising:
Set up buffer zone module, be used for only setting up a buffer zone;
The reading out data module is used for using the original program interface to obtain data;
Deposit buffer zone module in, the data Replica that is used for described reading out data module is read is to described buffer zone;
Read buffer zone module, be used for taking data from described buffer zone.
Further, said apparatus also can have following characteristics, and described reading out data module also is used for repeating following operation until finish: use described original program interface to obtain follow-up data;
The described buffer zone module that deposits in also is used for after described reading out data module is obtained data at every turn the data Replica that obtains being arrived described buffer zone;
The described buffer zone module that reads also is used for repeating to take data until finish from described buffer zone.
Further, said apparatus also can have following characteristics, and described reading out data module also is used for described when reading buffer zone module and taking data from described buffer zone, and executed in parallel uses described original program interface to obtain follow-up data.
Further, said apparatus also can have following characteristics, described deposit in buffer zone module be for: when the data that copy to described buffer zone did not re-use, the follow-up data that just the reading out data module is obtained copied to described buffer zone.
Further, said apparatus also can have following characteristics, and described original program interface is data function reading or data output function.
Compared with prior art, technical solution of the present invention is taked a buffer zone, has avoided under the condition of limited resources, and the problem of multiple buffer insufficient space has promoted program feature.
Description of drawings
Fig. 1 is data buffering method process flow diagram under the embodiment of the invention limited resources;
Fig. 2 is data buffer device block diagram under the embodiment of the invention limited resources.
Embodiment
For making the purpose, technical solutions and advantages of the present invention clearer, hereinafter in connection with accompanying drawing embodiments of the invention are elaborated.Need to prove that in the situation of not conflicting, the embodiment among the application and the feature among the embodiment be combination in any mutually.
The embodiment of the invention discloses the method that a kind of single buffer zone under the limited resources condition is realized, to improve program feature, wherein the method comprises: create single buffer zone; Obtain data; With data Replica to buffer zone; From buffer zone, take data.
The embodiment of the invention provides data buffering method under a kind of limited resources, comprising:
Only set up a buffer zone;
Use the original program interface to obtain data;
The described data Replica that obtains is arrived described buffer zone;
From described buffer zone, take data.
Wherein, the data deposited by needs of buffer size determine.
Wherein, described method also comprises: repeat following operation until finish:
Use described original program interface to obtain follow-up data; The current data Replica that obtains is arrived described buffer zone; From described buffer zone, take data.
Wherein, in described repetitive process, when taking data from described buffer zone, the described original program interface of use in the operation of executed in parallel next round obtains the step of follow-up data.
Wherein, described method also comprises:
When the data in copying to described buffer zone did not re-use, the follow-up data that just will use described original program interface to obtain copied to described buffer zone.
Wherein, described original program interface is data function reading or data output function.
The embodiment of the invention also provides data buffer device under a kind of limited resources, comprising:
Set up buffer zone module, be used for setting up a buffer zone;
The reading out data module is used for using the original program interface to obtain data;
Deposit buffer zone module in, the data Replica that is used for described reading out data module is read is to described buffer zone;
Read buffer zone module, be used for taking data from described buffer zone.
Wherein, described reading out data module also is used for repeating following operation until finish: use described original program interface to obtain follow-up data;
The described buffer zone module that deposits in also is used for after described reading out data module is obtained data at every turn the data Replica that obtains being arrived described buffer zone;
The described buffer zone module that reads also is used for repeating to take data until finish from described buffer zone.
Wherein, described reading out data module also is used for described when reading buffer zone module and taking data from described buffer zone, and executed in parallel uses described original program interface to obtain follow-up data.
Wherein, described deposit in buffer zone module be for: when the data that copy to described buffer zone did not re-use, the follow-up data that just the reading out data module is obtained copied to described buffer zone.
Wherein, described original program interface is data function reading or data output function.
The present invention is limited applicable to internal memory, can't create the situation of two or more buffer zones; Certainly, when memory source is enough, also can use the present invention.
Further specify the present invention below by specific embodiment.
The implementation method of embodiment one, single Buffer System
Present embodiment comprises the steps:
Step S110 bufcreates, and buffer size is 1024 bytes in the present embodiment;
Step S120, the data function reading read of use original program, reading out data, these data are 1024 bytes to the maximum; The data implicit expression that reads deposits in the memory headroom that the read function opens up;
Wherein, implicit expression refers to uncontrollable this space of programmer;
Step S130, the data Replica that above-mentioned read function is read is to buffer zone;
Step S140, downstream process obtain data from buffer zone;
Step S150, repeating step S120, and carry out simultaneously with step S140;
Step S160, the data in buffer zone do not re-use, and step S150 is when complete, repeating step S130, step S140.
Repeated execution of steps S150, S160 is until program is finished.
Need to prove, present embodiment is selected the data function reading is set up buffer zone, but in the actual implementation process, both can set up buffer zone to the data function reading, also can set up buffer zone to the data output function, even can set up respectively buffer zone to data function reading and data output function.
Application example
The unit that this application example is processed data is 1024 bytes, and buffer zone is set up in input.
As shown in Figure 2, set up the buffer zone that buffer zone module 210 is set up 1024 byte-sized.
Reading out data module 220 uses the reading out data interface of original program to read 1024 byte datas and deposit the uncontrollable temporary space of programmer in.
Deposit the data Replica in temporary space that buffer zone module 230 reads reading out data module 220 in buffer zone.
Read buffer zone module 240 and when needed data are read and offer the downstream module use from buffer zone.
After depositing buffer zone module 230 in copy data finished for the first time, reading buffer zone module 240 and reading out data module 220 can executed in parallel, and parallel group of reading buffer zone module 240-reading out data module 220 and deposits buffer zone module 230 execution that sequentially circulates in, until EOP (end of program).
Above-mentioned steps can be carried out in the computer system such as one group of computer executable instructions, and, in some cases, can carry out step shown or that describe to be different from above-mentioned order.
One of ordinary skill in the art will appreciate that all or part of step in the said method can come the instruction related hardware to finish by program, described program can be stored in the computer-readable recording medium, such as ROM (read-only memory), disk or CD etc.Alternatively, all or part of step of above-described embodiment also can realize with one or more integrated circuit.Correspondingly, each the module/unit in above-described embodiment can adopt the form of hardware to realize, also can adopt the form of software function module to realize.The present invention is not restricted to the combination of the hardware and software of any particular form.
Claims (10)
1. data buffering method under the limited resources is characterized in that, comprising:
Only set up a buffer zone;
Use the original program interface to obtain data;
The described data Replica that obtains is arrived described buffer zone;
From described buffer zone, take data.
2. the method for claim 1 is characterized in that, described method also comprises: repeat following operation until finish:
Use described original program interface to obtain follow-up data; The current data Replica that obtains is arrived described buffer zone; From described buffer zone, take data.
3. method as claimed in claim 2 is characterized in that, in described repetitive process, when taking data from described buffer zone, the described original program interface of use in the operation of executed in parallel next round obtains the step of follow-up data.
4. method as claimed in claim 2 is characterized in that, described method also comprises:
When the data in copying to described buffer zone did not re-use, the follow-up data that just will use described original program interface to obtain copied to described buffer zone.
5. such as the arbitrary described method of claim 1 to 4, it is characterized in that described original program interface is data function reading or data output function.
6. data buffer device under the limited resources is characterized in that, comprising:
Set up buffer zone module, be used for only setting up a buffer zone;
The reading out data module is used for using the original program interface to obtain data;
Deposit buffer zone module in, the data Replica that is used for described reading out data module is read is to described buffer zone;
Read buffer zone module, be used for taking data from described buffer zone.
7. device as claimed in claim 6 is characterized in that,
Described reading out data module also is used for repeating following operation until finish: use described original program interface to obtain follow-up data;
The described buffer zone module that deposits in also is used for after described reading out data module is obtained data at every turn the data Replica that obtains being arrived described buffer zone;
The described buffer zone module that reads also is used for repeating to take data until finish from described buffer zone.
8. device as claimed in claim 7 is characterized in that,
Described reading out data module also is used for described when reading buffer zone module and taking data from described buffer zone, and executed in parallel uses described original program interface to obtain follow-up data.
9. device as claimed in claim 7 is characterized in that,
Described deposit in buffer zone module be for: when the data that copy to described buffer zone did not re-use, the follow-up data that just the reading out data module is obtained copied to described buffer zone.
10. such as the arbitrary described device of claim 6 to 9, it is characterized in that described original program interface is data function reading or data output function.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2012103031125A CN102902520A (en) | 2012-08-23 | 2012-08-23 | Data buffering method and device under condition of limited resources |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2012103031125A CN102902520A (en) | 2012-08-23 | 2012-08-23 | Data buffering method and device under condition of limited resources |
Publications (1)
Publication Number | Publication Date |
---|---|
CN102902520A true CN102902520A (en) | 2013-01-30 |
Family
ID=47574767
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN2012103031125A Pending CN102902520A (en) | 2012-08-23 | 2012-08-23 | Data buffering method and device under condition of limited resources |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102902520A (en) |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1917553A (en) * | 2005-08-19 | 2007-02-21 | 富士施乐株式会社 | Image reading apparatus and control method therefor |
US20110271041A1 (en) * | 2010-05-03 | 2011-11-03 | Samsung Electronics Co., Ltd. | Electronic device comprising flash memory and related method of handling program failures |
-
2012
- 2012-08-23 CN CN2012103031125A patent/CN102902520A/en active Pending
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1917553A (en) * | 2005-08-19 | 2007-02-21 | 富士施乐株式会社 | Image reading apparatus and control method therefor |
US20110271041A1 (en) * | 2010-05-03 | 2011-11-03 | Samsung Electronics Co., Ltd. | Electronic device comprising flash memory and related method of handling program failures |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110135985B (en) | Parallel execution method and system for transactions on block chain | |
CN108776897B (en) | Data processing method, device, server and computer readable storage medium | |
CN110516789B (en) | Method and device for processing instruction set in convolutional network accelerator and related equipment | |
CN109032796B (en) | Data processing method and device | |
EP2945072A1 (en) | Method and apparatus for processing redo data of database | |
CN106095604A (en) | The communication method between cores of a kind of polycaryon processor and device | |
US8595726B2 (en) | Apparatus and method for parallel processing | |
US20150112934A1 (en) | Parallel scanners for log based replication | |
CN110609807B (en) | Method, apparatus and computer readable storage medium for deleting snapshot data | |
CN104657164A (en) | Method and device for updating and processing software | |
KR102166185B1 (en) | Data processing apparatus for pipeline execution acceleration and method thereof | |
CN106383667A (en) | Method and apparatus for LUN migration in business operation | |
US10466974B2 (en) | Independent expression animations | |
CN110413210B (en) | Method, apparatus and computer program product for processing data | |
US20220036206A1 (en) | Containerized distributed rules engine | |
CN109614383B (en) | Data copying method and device, electronic equipment and storage medium | |
CN102902520A (en) | Data buffering method and device under condition of limited resources | |
CN111291959A (en) | Resource allocation method, device, equipment and storage medium | |
CN102063308B (en) | Method for controlling processing flow of seismic prospecting data | |
CN111428453B (en) | Processing method, device and system in annotation synchronization process | |
US7849467B2 (en) | Handling a signal at an application context that employs a remote kernel service | |
US7804844B1 (en) | Dataflow pipeline implementing actions for manipulating packets of a communication protocol | |
CN111478949B (en) | Data processing method and device | |
CN108008981B (en) | Method and device for initializing program in system on chip (SoC) | |
CN104268013A (en) | Fast system-wide simulator certainty replaying method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C02 | Deemed withdrawal of patent application after publication (patent law 2001) | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20130130 |