[go: up one dir, main page]

CN102521149B - Optimizing polling system and optimizing polling method for collecting data from plurality of buffer zones - Google Patents

Optimizing polling system and optimizing polling method for collecting data from plurality of buffer zones Download PDF

Info

Publication number
CN102521149B
CN102521149B CN201110384059.1A CN201110384059A CN102521149B CN 102521149 B CN102521149 B CN 102521149B CN 201110384059 A CN201110384059 A CN 201110384059A CN 102521149 B CN102521149 B CN 102521149B
Authority
CN
China
Prior art keywords
buffer zone
length
buffer
polling
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.)
Active
Application number
CN201110384059.1A
Other languages
Chinese (zh)
Other versions
CN102521149A (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.)
Guochao Xi'an Computing Technology Co ltd
Original Assignee
Dawning Information Industry Beijing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Dawning Information Industry Beijing Co Ltd filed Critical Dawning Information Industry Beijing Co Ltd
Priority to CN201110384059.1A priority Critical patent/CN102521149B/en
Publication of CN102521149A publication Critical patent/CN102521149A/en
Application granted granted Critical
Publication of CN102521149B publication Critical patent/CN102521149B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Mobile Radio Communication Systems (AREA)
  • Small-Scale Networks (AREA)

Abstract

The invention provides an optimizing polling system and an optimizing polling method for collecting data from a plurality of buffer zones. The polling system comprises a polling control module and buffer zones. The polling control module can access the buffer zones and comprises a step array and static variable quantity. The polling method includes adopting polling to control the variable quantity and dynamically adjusting an initial buffer zone of each-time polling and reading step of each buffer zone according to buffer zone loading condition. The optimizing polling system and an optimizing polling method for collecting data from the plurality of buffer zones avoid loading unevenness among the buffer zones and extra expense caused by accessing an empty buffer zone frequently, and improve polling efficiency of collecting data from the plurality of buffer zones.

Description

A kind of optimization polling system and method for collecting data from multiple buffer
Technical field
The invention belongs to network data processing field, be specifically related to a kind of optimization polling system and method for collecting data from multiple buffer.
Background technology
In network data acquisition system, often need on a treatment facility, polylith data collecting card be installed, each capture card has the data buffer of oneself, or has multiple data buffers on a capture card, also just needs software to collect data from multiple buffer zones poll.
The polling mode of the General System of prior art has two kinds:
First kind of way is greedy access; Software is from first buffer zone, and the each buffer zone of poll, no matter there are how many data buffer zone, all reads out successively, until read behind an empty buffer zone, then go to access next buffer zone.Such as hypothesis has three buffer zones, software is first from first buffer zone reading out data, until all data of first buffer zone are got after sky, check again second buffer zone, reading out data, reads behind empty second buffer zone, then reads the 3rd buffer zone, read behind empty the 3rd buffer zone, then from first buffer zone reading out data.
The second way is average access; Software is from first buffer zone, and the each buffer zone of poll successively, if there are data buffer zone, no matter there are how many data buffer zone, only reads data, just goes to access next buffer zone.Such as hypothesis has three buffer zones, software is first checked first buffer zone, if there are data, just read data out, then directly check second buffer zone, if there are data, also be read-only one, and then read the 3rd buffer zone, return first buffer zone.
There is following problem in the polling mode of prior art:
Adopt the mode of the greedy access of the first, process in a period of time the data of a buffer zone, can cause the laod unbalance of processing cpu corresponding to buffer zone, that is to say, supposing has more data in each buffer zone, according to greedy access mode, software can all be handled the data of a buffer zone and just go to process the data in next buffer zone, in this processing procedure, the corresponding cpu load in pre-treatment buffer zone is very large with working as, the corresponding cpu in other buffer zones is idle simultaneously, cpu load imbalance can cause the performance of whole system low.
Adopt the mode of the second average access, in the time of load imbalance between multiple buffer zones, can cause software to check frequently buffer empty, that is to say, suppose to only have in a buffer zone and have mass data in multiple buffer zones, other are all buffer empties, according to average access mode, software can be checked each buffer zone in turn, to there being the buffer zone of data, data are only got in each access, to there is no the buffer zone of data, also to go to check at every turn, while checking buffer zone, need software exchange buffer zone, comprising connecting buffer zone, take out buffer area read-write pointer, compare the operations such as judgement, if most buffer zones are empty, buffer zone is switched the expense of bringing and can be caused unnecessary performance loss frequently.
During General System realizes, the greediness access that buffer zone poll adopts and average access module start buffer zone access at every turn, all number poll successively by buffer zone, also do not consider the unbalanced situation in buffer zone.Suppose to have n buffer zone, only have last, there are data n buffer zone, n-1 buffer zone is all empty above, and so, start poll all will be since the 1st buffer zone at every turn, all to access n-1 buffer empty, also can bring unnecessary overhead.
Summary of the invention
For overcoming above-mentioned defect, the invention provides a kind of optimization polling system and method for collecting data from multiple buffer, in the time of poll multiple buffer, in the load balancing as far as possible ensureing between multiple buffer, reduce again the overhead of checking buffer empty as far as possible.
For achieving the above object, the invention provides a kind of optimization polling system of collecting data from multiple buffer, described polling system comprises: the polling system module of buffer zone and the described buffer zone of access; Its improvements are, described polling system module comprises step-length array and static variable; Described step-length array and described static variable carry out poll access to described buffer zone respectively.
In optimal technical scheme provided by the invention, described buffer zone quantity is n.
In the second optimal technical scheme provided by the invention, described step-length array, arranges a step-length in each buffer zone, when described step-length represents to be polled to this buffer zone at every turn, and each data length from reading in buffer zone at most.
In the 3rd optimal technical scheme provided by the invention, described static variable records the initial buffer zone of each poll numbering, each while starting poll, from the last time of described static variable record buffer zone that be polled to, that have data.
In the 4th optimal technical scheme provided by the invention, described buffer zone step-length minimum is 1.
In the 5th optimal technical scheme provided by the invention, provide a kind of optimization polling method of collecting data from multiple buffer, its improvements are, described method comprises the steps:
(1). polling system module described in initialization, is wherein initialized as 0 the initial buffer zone numbering of described static variable, and the step-length of each buffer zone of described step-length array is initialized as to 1;
(2). described in poll, static variable obtains the buffer zone numbering of current beginning poll, obtains the step-length of current buffer zone from described step-length array;
(3). according to step-length, from current buffer zone, read the data of corresponding length;
(4) if. the data length in current buffer zone has exceeded its step-length, step-length corresponding this buffer zone is added to one, and initial buffer zone numbering remains unchanged; Otherwise the step-length of this buffer zone is subtracted to one, and revise initial buffer zone numbering.
Compared with the prior art, a kind of optimization polling system and method for collecting data from multiple buffer provided by the invention, adopt polling system variable, according to buffer load situation, dynamically adjust the step-length that reads of the initial buffer zone of each poll and each buffer zone, avoid the uneven overhead with frequently accessing buffer empty of load between buffer zone, improved the polling efficiency of collecting data from many bufferings.Collect optimization polling system and the method for data from multiple buffer and pass through the control to step-length, while reading out total data and average access while having avoided greedy access, only read the problem of data, behind each poll buffer zone, according to the full situation of buffer empty, the step-length variable dynamic of each buffer zone is adjusted, in the time that buffer data is more, step-length can increase gradually, making to be polled to the data that read this buffer zone can get more and more at every turn, in the time that buffer data is less, step-length can reduce gradually, and make to be polled to the data that read this buffer zone can be fewer and feweri at every turn; And do not adopt according to the buffering area code mode of poll successively, but from static variable records the buffer zone that has data being polled to last time, thereby the buffer zone that has reduced first access is the probability of buffer empty, reduce the number of times of each startup poll to buffer empty access.
Brief description of the drawings
Fig. 1 is the schematic diagram of collecting the optimization polling system of data from multiple buffer.
Embodiment
As shown in Figure 1, collect the optimization polling system of data from multiple buffer, described polling system comprises: polling system module and buffer zone, the addressable described buffer zone of described polling system module; Described polling system module comprises step-length array and static variable; Described step-length array and described static variable carry out poll access to described buffer zone respectively.
Described step-length array, by this array, the present invention askes two kinds of polling modes in conjunction with greedy poll and average wheel, for each buffer zone arranges a step-length variable, when this step-length represents to be polled to this buffer zone at every turn, each data length from reading in buffer zone at most, by this step-length control, only reads the problem of data while having avoided greedy access while reading out total data and average access.Software is behind each poll buffer zone, according to the full situation of buffer empty, the step-length variable dynamic of each buffer zone is adjusted, in the time that buffer data is more, step-length can increase gradually, and being polled to the data that read this buffer zone can get more and more at every turn, in the time that buffer data is less, step-length can reduce gradually, and be polled to the data that read this buffer zone can be fewer and feweri at every turn.
Described static variable, the present invention uses this variable to record the initial buffer zone numbering of each poll, when each startup poll, do not adopt according to the buffering area code mode of poll successively, but from static variable records the buffer zone that has data being polled to last time, thereby the buffer zone that has reduced first access is the probability of buffer empty, reduce the each number of times of poll to buffer empty access that start.
The optimization polling method of collecting data from multiple buffer, is characterized in that, specifically comprises the steps:
(1). polling system module described in initialization, is initialized as 0 the initial buffer zone numbering of described static variable, and the step-length of each buffer zone of described step-length array is initialized as to 1;
(2). described in poll, static variable obtains the buffer zone numbering of current beginning poll, obtains the step-length of current buffer zone from described step-length array;
(3). according to step-length, from current buffer zone, read the data of corresponding length;
(4) if. the data length in current buffer zone has exceeded its step-length, illustrates that this buffer zone current data is more, step-length corresponding this buffer zone is added to one, and initial buffer zone numbering remains unchanged; Otherwise the step-length of this buffer zone is subtracted to one, and revise initial buffer zone numbering.
Need statement, content of the present invention and embodiment are intended to prove the practical application of technical scheme provided by the present invention, should not be construed as limiting the scope of the present invention.Those skilled in the art inspired by the spirit and principles of the present invention, can do various amendments, be equal to and replace or improve.But in the protection domain that these changes or amendment are all awaited the reply in application.

Claims (2)

1. an optimization polling system of collecting data from multiple buffer, described polling system comprises: the polling system module of buffer zone and the described buffer zone of access; It is characterized in that, described polling system module comprises step-length array and static variable; Described step-length array and described static variable carry out poll access to described buffer zone respectively; Described buffer zone quantity is n; Described step-length array, arranges a step-length in each buffer zone, when described step-length represents to be polled to this buffer zone at every turn, and each data length from reading in buffer zone at most; Described static variable records the initial buffer zone of each poll numbering, each while starting poll, from the last time of described static variable record buffer zone that be polled to, that have data; Described buffer zone step-length minimum is 1.
2. the optimization polling method of collecting data from multiple buffer of the optimization polling system of collecting data from multiple buffer according to claim 1, is characterized in that, described method comprises the steps:
(1). polling system module described in initialization, is wherein initialized as 0 the initial buffer zone numbering of described static variable, and the step-length of each buffer zone of described step-length array is initialized as to 1;
(2). described in poll, static variable obtains the buffer zone numbering of current beginning poll, obtains the step-length of current buffer zone from described step-length array;
(3). according to step-length, from current buffer zone, read the data of corresponding length;
(4) if. the data length in current buffer zone has exceeded its step-length, step-length corresponding this buffer zone is added to one, and initial buffer zone numbering remains unchanged; Otherwise the step-length of this buffer zone is subtracted to one, and revise initial buffer zone numbering.
CN201110384059.1A 2011-11-28 2011-11-28 Optimizing polling system and optimizing polling method for collecting data from plurality of buffer zones Active CN102521149B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201110384059.1A CN102521149B (en) 2011-11-28 2011-11-28 Optimizing polling system and optimizing polling method for collecting data from plurality of buffer zones

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110384059.1A CN102521149B (en) 2011-11-28 2011-11-28 Optimizing polling system and optimizing polling method for collecting data from plurality of buffer zones

Publications (2)

Publication Number Publication Date
CN102521149A CN102521149A (en) 2012-06-27
CN102521149B true CN102521149B (en) 2014-08-27

Family

ID=46292079

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201110384059.1A Active CN102521149B (en) 2011-11-28 2011-11-28 Optimizing polling system and optimizing polling method for collecting data from plurality of buffer zones

Country Status (1)

Country Link
CN (1) CN102521149B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103778069B (en) * 2012-10-18 2017-09-08 深圳市中兴微电子技术有限公司 The cacheline length regulating method and device of cache memory
CN103885899B (en) * 2014-03-25 2018-05-15 宇龙计算机通信科技(深圳)有限公司 A kind of terminal and the method for adjusting NFC operating mode polling mechanisms
CN106604088B (en) * 2016-12-15 2020-09-11 北京小米移动软件有限公司 Method, device and device for processing data in buffer
CN109614349B (en) * 2018-12-11 2023-04-11 杭州阿姆科技有限公司 Cache management method based on binding mechanism

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102163144A (en) * 2011-05-05 2011-08-24 浙江大学 Hardware data pre-fetching method of embedded processor
CN102214146A (en) * 2011-07-28 2011-10-12 中国人民解放军国防科学技术大学 Step size adaptive Cache pre-fetching method and system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8176404B2 (en) * 2009-09-09 2012-05-08 Lsi Corporation Systems and methods for stepped data retry in a storage system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102163144A (en) * 2011-05-05 2011-08-24 浙江大学 Hardware data pre-fetching method of embedded processor
CN102214146A (en) * 2011-07-28 2011-10-12 中国人民解放军国防科学技术大学 Step size adaptive Cache pre-fetching method and system

Also Published As

Publication number Publication date
CN102521149A (en) 2012-06-27

Similar Documents

Publication Publication Date Title
EP2488929B1 (en) Memory object relocation for power savings
CN111666330B (en) Data reading and writing method and device
CN102521149B (en) Optimizing polling system and optimizing polling method for collecting data from plurality of buffer zones
JP6008265B2 (en) Alias register allocation in pipelined schedules
CN1684200A (en) semiconductor storage device
CN111209232B (en) Method, apparatus, device and storage medium for accessing static random access memory
US20200159680A1 (en) Programming and controlling compute units in an integrated circuit
Ouyang et al. Active SSD design for energy-efficiency improvement of web-scale data analysis
CN103632185B (en) A kind of mask smart card with expanded function
CN102540953A (en) Programmable logic controller and data processing method thereof
US20070226382A1 (en) Method for improving direct memory access performance
CN101341471A (en) Apparatus and method for dynamic cache management
EP2466452B1 (en) Register file and computing device using same
CN103577200A (en) Server updating method
KR101813251B1 (en) Operating apparatus and operation method based on accelerator-dsp memory sharing circumstances
EP2093669B1 (en) Apparatus and method for processing data
CN106897021A (en) A kind of method and apparatus for reading and writing data
US20030046501A1 (en) Method for interleaving memory
CN102609240B (en) The method of processor circuit and reading data
CN102279821B (en) Method and system for transmitting DDR (double data rate) controller port command
CN104182181A (en) Data processing method, device and terminal of memory card
CN103051975A (en) P2P (peer to peer) cache data elimination method
CN110727464B (en) Information processing method for multi-core processor with independent memory access space
CN101950277B (en) Data transmission method and device for micro control unit and data transmission system
WO2006080897A1 (en) Improvements in and relating to memory updating

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
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20220729

Address after: 100193 No. 36 Building, No. 8 Hospital, Wangxi Road, Haidian District, Beijing

Patentee after: Dawning Information Industry (Beijing) Co.,Ltd.

Patentee after: DAWNING INFORMATION INDUSTRY Co.,Ltd.

Address before: 100084 Beijing Haidian District City Mill Street No. 64

Patentee before: Dawning Information Industry (Beijing) Co.,Ltd.

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20231107

Address after: Room 508, 5th Floor, Xinhai International Business Center, No. 389 East Chang'an Street, National Civil Aerospace Industry Base, Xi'an City, Shaanxi Province, 710309

Patentee after: Guochao (Xi'an) Computing Technology Co.,Ltd.

Address before: 100193 No. 36 Building, No. 8 Hospital, Wangxi Road, Haidian District, Beijing

Patentee before: Dawning Information Industry (Beijing) Co.,Ltd.

Patentee before: DAWNING INFORMATION INDUSTRY Co.,Ltd.