CN1901548B - Buffer zone managing method - Google Patents

Buffer zone managing method Download PDF

Info

Publication number
CN1901548B
CN1901548B CN200610103637A CN200610103637A CN1901548B CN 1901548 B CN1901548 B CN 1901548B CN 200610103637 A CN200610103637 A CN 200610103637A CN 200610103637 A CN200610103637 A CN 200610103637A CN 1901548 B CN1901548 B CN 1901548B
Authority
CN
China
Prior art keywords
buffering area
data
buffering
buffer management
treatment conditions
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.)
Expired - Fee Related
Application number
CN200610103637A
Other languages
Chinese (zh)
Other versions
CN1901548A (en
Inventor
白杰
李薇
鲁征宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Individual
Original Assignee
Individual
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 Individual filed Critical Individual
Priority to CN200610103637A priority Critical patent/CN1901548B/en
Publication of CN1901548A publication Critical patent/CN1901548A/en
Application granted granted Critical
Publication of CN1901548B publication Critical patent/CN1901548B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Computer And Data Communications (AREA)

Abstract

This invention discloses a buffer region management method including: setting multiple buffer regions and a data list indicating and identifying said buffer regions, in which, when a first region satisfies the first process condition, it picks up the data in it and revises said data list and renovates said buffer region, which can organize multiple buffer regions and use them to avoid the shortcoming that there are too big or too many buffer regions to give attention to the integrality and process efficiency to data.

Description

Buffer management method
Technical field
The present invention relates to a kind of management method of data buffer zone.
Background technology
In data transmission procedure; Because pretreated needs before the transfer of data; And the reasons such as difference of the data transmission capabilities of physical layer and the above application layer of physical layer, in data transmission set or in data transmission method, using buffering area to be used for temporal data almost becomes inevitable.
Usually, when the storage resources abundance of data transmission system, often only considering that bigger buffering area is set is used for temporal data, when buffering area is managed, also only is when buffering area is full, to take out data processing, refreshes buffering area then.The way to manage of so simple buffering area is difficult to guarantee the effective utilization to buffering area.For example, deal with data when buffering area is full only, may be owing to data processing equipment busy or related device fault cause deal with data in time, cause buffering area to overflow and lose owing to data; When the excessive and data volume of buffer pool size more after a little while, also can cause the utilization ratio of buffer unit to descend or data processing slow.It is thus clear that existing buffer management method is difficult to effectively utilize buffering area to be the data processing service.
The invention scheme
The technical problem that the present invention will solve is, a kind of buffer management method that can effectively utilize the data buffer zone is provided.
Buffer management method provided by the invention comprises:
The tables of data that a plurality of buffering areas is set and is provided for indicating and identifying said buffering area;
When a buffering area satisfies first treatment conditions, take out data processing wherein, and revise said tables of data and refresh said buffering area; Said treatment conditions are the combination of time conditions, status condition, characteristic condition.
Wherein, said a plurality of buffering area is set to the buffer circle formation.
Said method also comprises, judges that whether current buffering area satisfies second treatment conditions, if satisfy, changes said data buffer zone.
When the state of whole buffering areas when banning use of, increase new buffering area and go into the buffering area formation.
When the unused time of a buffering area surpasses specified threshold value, delete said buffering area.
When the number of freebuf during, increase new buffering area and go into the buffering area formation less than preset threshold value.
Buffer management device provided by the invention comprises:
The buffering area processing unit is used to the tables of data that buffering area is set and is provided for indicating and identifies said buffering area;
The buffer management unit is used to judge whether said buffering area satisfies treatment conditions, and when a buffering area satisfied treatment conditions, the data of taking out were wherein issued system handles, and revise said tables of data and refresh said buffering area; Said treatment conditions are the combination of time conditions, status condition, characteristic condition.
Said device also comprises, is used for increasing new buffering area under certain condition and goes into buffering area formation first updating block.
Said device also comprises, when the unused time of a buffering area surpasses specified threshold value, deletes second updating block of said buffering area.
Because the present invention adopts multiple buffer and is provided for indicating and identifies the scheme that the tables of data of said buffering area is managed said data buffer zone; Can organize coordination to use a plurality of buffering areas; For example tissue becomes the formation use; Can avoid buffering area but deposit excessive or too much drawback, also can make things convenient for the use of buffering area; And; The data processing of buffering area of the present invention is to start the foundation of handling with treatment conditions; Have only when a buffering area satisfies treatment conditions, take out data processing wherein, so just can take into account the integrality and the treatment effeciency of data simultaneously; Promptly avoid data and lose, by the requirement that can satisfy treatment effeciency because overflow.
In addition, the combination of multiple condition is used, and the dynamic increase and the minimizing of said buffering area, can also cause the raising of system memory unit utilance.
Description of drawings
Fig. 1 is the buffer management method flow chart of the specific embodiment according to the present invention;
Fig. 2 (1) is one and is used for buffering area is carried out dynamically and the tables of data example structure figure of static management;
Fig. 2 (2) is a buffer circle embodiment state diagram that is moving;
Fig. 3 is the flow chart of another specific embodiment according to the present invention;
Fig. 4 is the embodiment flow chart in the exchange buffering district of employing embodiment illustrated in fig. 3;
Fig. 5 is the buffer management device block diagram of the specific embodiment according to the present invention.
Embodiment
Fig. 1 is the flow chart of the specific embodiment according to the present invention.According to Fig. 1, at first buffering area should be set.Because the task of essence of buffering area is pending data such as to keep in; Therefore, the key of its setting is to take into account the demand of flexibility, efficient and the data processing of use, so the capacity of the quantity of buffering area and each buffering area should be provided with according to the data processing demand of system; For example; When the bursty data amount of system more after a little while, the capacity of each buffering area can be smaller, quantity also can be lacked; And in the kind of data or grade more for a long time, the quantity of buffering area can be more, this moment, the capacity of buffering area will be provided with according to the average temporary time of bursty data amount or data, or the like.Therefore, present embodiment is provided with plural buffering area.
Secondly, have independent between the buffering area and the combination double properties, need and effectively to manage said a plurality of buffering areas in order effectively to use buffering area, to make.Present embodiment is made into a circle queue (in another embodiment of the present invention with said buffer set; Said buffer set is made into a fifo queue); Therefore also be provided for indicating and identifying the tables of data of said buffering area in this step, be used for said buffering area is managed.In said tables of data, be provided for identifying the name field of buffering area at least, be used for as the address pointer field of pointing to this buffering area, and point to memory cell field said buffering area active cell, that be used to manage said buffering area.In additional embodiments of the present invention, tables of data is set to two, is respectively applied for the static state and the dynamic management of buffering area.In fact, said buffer set being made into that a formation manages also is through the operation of said tables of data is realized.
When said buffering area normally uses, buffering area is used and manage according to the condition of predefined service condition or data processing.Said buffering area use and inseparable when managing; Therefore to judge whether said buffering area satisfies the condition of data processing in step 12; If satisfy; Will carry out data processing at step 13 pair said buffering area, and utilize said tables of data that said buffering area is managed, otherwise continue other data processing in step 14.
Described treatment conditions embodiment illustrated in fig. 1 can make up for one in time conditions, status condition or the characteristic condition or its arbitrarily.Said time conditions refers to when buffering area begins normally to use, if the time that continues to use surpasses specified threshold value, both has been regarded as time conditions and has set up.The setting of time threshold is for preventing that external data from can not continue to import the wait ceaselessly that causes; Perhaps; It is for fear of the processing time-delay of the data of input block that time threshold is set; Therefore, whether to surpass the time threshold of setting be exactly a time conditions for the data processing in buffering area time-delay.Said status condition refers to the data of buffering area or self whether is in certain state for example, whether the data of buffer stores are full.Said characteristic condition refers to whether whether the data in the buffering area have specific characteristic, for example imported the special data with certain mark etc.In the described embodiment of Fig. 1, said treatment conditions are that time conditions and status condition use jointly, promptly when the input of the data of said buffering area surpass the threshold value that is provided with in advance and buffering area when discontented or buffering area completely be regarded as condition and set up.
In the said step 13, utilizing said tables of data that said buffering area is managed in the reality can have a lot of modes, and in the present embodiment, revising said tables of data and refreshing said buffering area is exactly a kind of mode wherein.Wherein, revise the relation that is provided with of said tables of data and said condition, then full at buffering area and data wherein still are untreated when finishing if buffering area completely is a condition, the mode field of tables of data is set to " banning use of " state; If the data processing in the buffering area is accomplished; The pointer value of memory cell field that then can tables of data is set to point to the buffering area first address; Promptly accomplish the refresh operation of current buffering area; And then mode field is set to " allow use " state, and at this moment, current buffering area just is in idle condition.
Fig. 2 (1) is one and is used for buffering area is carried out dynamically and the tables of data example structure figure of static management; Fig. 2 (2) is a buffer circle embodiment state diagram that is moving; Among Fig. 2, buffering area 21,22 has been in full state, and what current buffering area pointed to is buffering area 23, and the state of buffering area 24 to 27 is idle, and therefore, current buffering area is 23.Among Fig. 2, the length of each buffering area is A00H (hexadecimal).From the state table of Fig. 2 (1), find out; The first address pointer of freebuf and the sensing of current address pointer overlap; The first address pointer and the current address pointer of full buffering area then point to the stem of buffering area and the memory cell of afterbody respectively, and the first address pointer of current buffering area and current address pointer then point to the stem of buffering area and the memory cell at middle part respectively.
Step 12 among Fig. 1,13, the 14th is operated each buffering area.For example, for current buffering area, judge whether the time whether said buffering area satisfies the data input of full or this buffering area of data has surpassed specified threshold value in step 12; If one of them condition is set up, will carry out data processing by 13 pairs of said buffering areas of execution in step, promptly take out data wherein; After data are all taken out, the current address pointer in the said tables of data, mode field are revised as C000 and " free time " respectively, and the content of " current buffering area " field is constant; If step 12 Rule of judgment is false, just continue other data processing in step 14, promptly continue the input data; If current buffer data is full; But judge that through step 12 said condition does not still satisfy, mode field that will current buffering area is set to " expiring ", and " current buffering area " field is set to " denying "; " current buffering area " field of next buffering area in the formation then is set to " being "; So that continue to receive data, thereby accomplish the replacing of current buffering area, continue with reference to hereinafter about the scheme of the replacing of current buffering area with new buffering area.
Embodiment illustrated in fig. 1 being preferably used in the multi-task operation environment, so as the buffering area concurrent working in the formation, the process of the preferably corresponding middle step 12,13 embodiment illustrated in fig. 1 of each buffering area, 14 statements.Certainly, adopt one independently process also can use the embodiment of the invention well.
For non-current buffering area, for example buffering area 22, when judging in step 12 whether said buffering area satisfies the time that data have expired or the data of this buffering area are imported and whether set up above the condition of specified threshold value; If set up, will carry out data processing by 13 pairs of said buffering areas of execution in step, promptly take out data wherein; After data are all taken out; Current address pointer in the said tables of data, mode field are revised as B000 and " free time " respectively, and the content of " current buffering area " field is constant, if step 12 Rule of judgment is false; Just continue other data processing in step 14; The data processing of this moment is not to continue the input data, whether satisfies the data processing condition but return the current buffering area of step 12 continuation monitoring, finishes up to data processing.
It is thus clear that in an embodiment of the present invention, which buffering area can receive the state of current buffering area and its position in formation that relation is arranged for new current buffering area.If an appointed new current buffer state be empty, the completion of still being untreated of wherein data be described, specifying next buffering area in proper order at this moment is current buffering area.The control of current buffering area is best by an independent process control.
Need to prove that because the restriction that real data is handled, the position of the buffering area that said freebuf or data are full possibly not be continuous.
Fig. 3 is the flow chart of another specific embodiment according to the present invention, and this embodiment has discussed the situation of changing current buffering area.The difference of said embodiment of Fig. 3 and the said embodiment of Fig. 1 is to have increased by two steps, step 15,16.According to this embodiment; When judging in step 12 whether time that said buffering area does not satisfy the data input of full or this buffering area of data has surpassed the condition of specified threshold value; Will judge that whether current buffering area satisfies second data treatment conditions in step 15, these second data treatment conditions can make up for one in time conditions, status condition or the characteristic condition or its arbitrarily, and what present embodiment adopted is status condition; In the present embodiment; Step 15 judges whether current buffering area is full, if data are full, explains that not having memory space to continue reception needs temporary data; Therefore to promptly select a new buffering area as current data buffer zone in step 16 exchange buffering district.
In another embodiment of the present invention, step 15,16 is placed on the front of step 12, and the said embodiment of the effect of the reality of this embodiment and Fig. 3 is basic identical, does not have essential distinction.
Fig. 4 is the embodiment flow chart in the exchange buffering district of employing embodiment illustrated in fig. 3.According to Fig. 4, at first selecting next buffering area in step 40 is current buffering area, judges in step 41 whether current buffering area is empty then; If be empty; Just can carry out follow-up data manipulation, for example, deposit pending data in current buffering area in step 44.If the new current buffering area of selecting is not empty; Also will judge whether that whole buffering areas is all judged in step 42 finishes; If also have remaining buffering area not judge, just continue to select next buffering area as current buffering area in step 45, otherwise; Explain that not had buffering area in the buffering area formation available, can increase one or more buffering areas this moment in step 43 in the buffering area formation.
Adopt flow process exchange buffering shown in Figure 4 district,, can also go into the buffering area formation at the new buffering area of step 43 increase if all the state of buffering areas is when banning use of.In this embodiment, the buffering area of increase can be inserted into the back of current buffering area or other position of a front or an appointment.With Fig. 2 (2) is example, supposes that current buffering area is a buffering area 22, and the buffering area of increase can be inserted between buffering area 22 and the buffering area 23, also can be inserted between buffering area 22 and the buffering area 21.In fact, the increase of buffering area can be that unit increases one by one with " individual ", can be a plurality of buffering areas of the each increase of unit with " group " also, has just described this situation in another embodiment of the present invention.
In another embodiment of the present invention, adopt following proposal to increase buffering area: to judge that at first when the quantity of freebuf during less than preset threshold value, for example said threshold value is 3, increases new buffering area and goes into the buffering area formation.Can guarantee pending data such as enough buffering areas are temporary like this, the time-delay of data processing when avoiding buffering area full.In this embodiment, the increase of buffering area can be a unit with " individual " or " group " equally also.
What be worth explanation is, decision operation of the present invention can realize through the judgement to concrete field in the said tables of data, for example judges whether buffering area is idle, expires etc. through mode field.
In embodiment according to the invention, for fear of the waste of buffer resource, when the unused time of a buffering area surpasses specified threshold value, for example said threshold value is 100 seconds, deletes said buffering area.The concrete following proposal that adopts realizes above-mentioned functions.A time threshold (or buffering area life cycle) is set; And a timer (or counter) is set for each buffering area; If the time value of timer of fast buffering area during more than or equal to the threshold value that is provided with, just can delete corresponding buffering area, refresh simultaneously or upgrade said tables of data.Said timer can be realized with memory cell or register.Therefore, timer and said buffering area can be provided with and delete in the lump.
Buffer management device provided by the invention is with reference to figure 5; Comprise tables of data 51, buffering area formation 52; And the buffering area processing unit 53 and buffering area administrative unit 54 that are used to that buffering area is set and are provided for indicating and identify the tables of data of said buffering area; Said buffer management unit 54 is used to judge whether said buffering area satisfies treatment conditions, when a buffering area satisfies treatment conditions; The data of taking out are wherein issued system handles, and revise said tables of data and refresh said buffering area.
Present embodiment is provided with plural buffering area; And said buffer set is made into a circle queue (in another embodiment of the present invention; Said buffer set is made into a fifo queue); The tables of data that is used to indicate and identify said buffering area that is provided with is used for said buffering area is managed.In said tables of data, be provided for identifying the name field of buffering area at least, be used in reference to address pointer field, and point to memory cell field said buffering area active cell, that be used to manage said buffering area to this buffering area.
When said buffering area normally uses, buffering area is used and manage according to the condition of predefined service condition or data processing.
Said treatment conditions are the combination in any of time conditions and/or status condition and/or characteristic condition.
In a further embodiment, buffering area processing unit 53 also is used for judging whether satisfy predefined treatment conditions to current buffering area, if satisfy, change said data buffer zone, for example, when buffering area is expired, changes said data buffer zone.
In order to improve the performance of device shown in Figure 5; This device also comprises first updating block 55 and second updating block 56; Said first updating block 55 is used under certain condition; For example when the state of whole buffering areas be when banning use of or when the number of freebuf during less than preset threshold value, increase new buffering area and go into the buffering area formation.Second updating block 56 then is used for surpassing specified threshold value when the unused time of a buffering area, deletes said buffering area.
Seeing that the embodiment that is implemented in this paper of each functional unit of the said device of Fig. 5 partly has detailed description, repeat no more at this.

Claims (9)

1. buffer management method is characterized in that comprising:
The tables of data that a plurality of buffering areas is set and is provided for indicating and identifying said buffering area;
When a buffering area satisfies first treatment conditions, take out data processing wherein, and revise said tables of data and refresh the said buffering area that satisfies first treatment conditions;
Said treatment conditions are the combination of time conditions, status condition, characteristic condition.
2. buffer management method as claimed in claim 1 is characterized in that, said a plurality of buffering areas are set to the buffer circle formation.
3. according to claim 1 or claim 2 buffer management method is characterized in that also comprising, judges that whether current buffering area satisfies second treatment conditions, if satisfy, changes said current buffering area.
4. buffer management method as claimed in claim 3 is characterized in that, when the state of whole buffering areas when banning use of, increase new buffering area and go into the buffering area formation.
5. buffer management method as claimed in claim 4 is characterized in that, when the unused time of a buffering area surpasses specified threshold value, deletes the buffering area that said unused time surpasses specified threshold.
6. buffer management method as claimed in claim 5 is characterized in that, when the number of freebuf during less than preset threshold value, increases new buffering area and goes into the buffering area formation.
7. buffer management device is characterized in that comprising:
The buffering area processing unit is used to the tables of data that a plurality of buffering areas is set and is provided for indicating and identifying said buffering area;
The buffer management unit is used to judge whether said buffering area satisfies treatment conditions, and when a buffering area satisfied treatment conditions, the data of taking out were wherein issued system handles, and revise said tables of data and refresh the said buffering area that satisfies treatment conditions;
Said treatment conditions are the combination of time conditions, status condition, characteristic condition.
8. buffer management device as claimed in claim 7 is characterized in that also comprising, is used for increasing by first updating block that new buffering area is gone into the buffering area formation under certain condition.
9. like claim 7 or 8 described buffer management devices, it is characterized in that also comprising second updating block, be used for when the unused time of a buffering area surpasses specified threshold value, deleting the buffering area that said unused time surpasses specified threshold.
CN200610103637A 2006-07-26 2006-07-26 Buffer zone managing method Expired - Fee Related CN1901548B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN200610103637A CN1901548B (en) 2006-07-26 2006-07-26 Buffer zone managing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN200610103637A CN1901548B (en) 2006-07-26 2006-07-26 Buffer zone managing method

Publications (2)

Publication Number Publication Date
CN1901548A CN1901548A (en) 2007-01-24
CN1901548B true CN1901548B (en) 2012-10-03

Family

ID=37657284

Family Applications (1)

Application Number Title Priority Date Filing Date
CN200610103637A Expired - Fee Related CN1901548B (en) 2006-07-26 2006-07-26 Buffer zone managing method

Country Status (1)

Country Link
CN (1) CN1901548B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101719911A (en) 2009-11-24 2010-06-02 中兴通讯股份有限公司 Method, device and system capable of transmitting multimedia data by Bluetooth and playing in real time
CN104376096B (en) * 2014-11-24 2018-07-13 北京京东尚科信息技术有限公司 The method of asynchronous refresh based on buffering area
CN106383893A (en) * 2016-09-23 2017-02-08 上海携程商务有限公司 Time sequence data management method and system
CN109412939B (en) * 2018-12-11 2021-05-25 中冶京诚工程技术有限公司 Communication gateway for recording industrial network communication period process data and working method

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1173783A (en) * 1996-03-29 1998-02-18 松下电器产业株式会社 System and method for updating system time constant (STC) counter following discontinuity in MPEG-2 transport data stream
CN1341931A (en) * 2001-08-22 2002-03-27 吴忆韩 Selective recording method and its equipment
CN1477537A (en) * 2002-07-16 2004-02-25 ��ʽ���綫֥ Information processing device for recording stream data to memory device
CN1607844A (en) * 2003-10-16 2005-04-20 华为技术有限公司 Macro-diversity combining method in mobile communication system
CN1780254A (en) * 2004-11-17 2006-05-31 华为技术有限公司 Method for using buffer area in network processor

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1173783A (en) * 1996-03-29 1998-02-18 松下电器产业株式会社 System and method for updating system time constant (STC) counter following discontinuity in MPEG-2 transport data stream
CN1341931A (en) * 2001-08-22 2002-03-27 吴忆韩 Selective recording method and its equipment
CN1477537A (en) * 2002-07-16 2004-02-25 ��ʽ���綫֥ Information processing device for recording stream data to memory device
CN1607844A (en) * 2003-10-16 2005-04-20 华为技术有限公司 Macro-diversity combining method in mobile communication system
CN1780254A (en) * 2004-11-17 2006-05-31 华为技术有限公司 Method for using buffer area in network processor

Also Published As

Publication number Publication date
CN1901548A (en) 2007-01-24

Similar Documents

Publication Publication Date Title
CN106789726B (en) A kind of high concurrent service resource allocation method based on service priority
EP2871809B1 (en) Message processing method, device and system for internet of things
CN101211277B (en) Method of selecting one of execution schedules of guest OS and virtual machine monitor employing the method
US7441240B2 (en) Process scheduling apparatus, process scheduling method, program for process scheduling, and storage medium recording a program for process scheduling
CN110532205B (en) Data transmission method, data transmission device, computer equipment and computer readable storage medium
CN111190745B (en) Data processing method, device and computer readable storage medium
CN102096599A (en) Multi-queue task scheduling method and related system and equipment
WO2021258753A1 (en) Service processing method and apparatus, and electronic device and storage medium
CN101286143B (en) Method for supervisory unit driving cache
CN104090847A (en) Address distribution method of solid-state storage device
CN103530189A (en) Automatic scaling and migrating method and device oriented to stream data
CN105117285B (en) A kind of nonvolatile memory method for optimizing scheduling based on mobile virtual system
CN1901548B (en) Buffer zone managing method
CN101103336A (en) Data processing system and method of task scheduling
CN103024825A (en) Method and device of distributing network source among multiple applications of terminal
CN1787588A (en) Method for processing multiprogress message and method for processing multiprogress talk ticket
CN102546437A (en) Internet of things platform-oriented socket implementation method
CN102902587A (en) Distribution type task scheduling method, distribution type task scheduling system and distribution type task scheduling device
US20110107344A1 (en) Multi-core apparatus and load balancing method thereof
CN107209716A (en) Memory management apparatus and method
CN116662020B (en) Dynamic management method and system for application service, electronic equipment and storage medium
CN100472459C (en) System for automatically releasing applied programe module leaked memory in inlaid system
CN105049372A (en) Method of expanding message middleware throughput and system thereof
CN101448022B (en) Control method of system interface iSCSI receiving end window of internet small computer and device
CN102426539B (en) Timer task automatic processing method and system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
C17 Cessation of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20121003

Termination date: 20130726