CN102495808A - Method for saving memory space - Google Patents

Method for saving memory space Download PDF

Info

Publication number
CN102495808A
CN102495808A CN2011103780463A CN201110378046A CN102495808A CN 102495808 A CN102495808 A CN 102495808A CN 2011103780463 A CN2011103780463 A CN 2011103780463A CN 201110378046 A CN201110378046 A CN 201110378046A CN 102495808 A CN102495808 A CN 102495808A
Authority
CN
China
Prior art keywords
data
memory
buffer
type
value
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.)
Granted
Application number
CN2011103780463A
Other languages
Chinese (zh)
Other versions
CN102495808B (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.)
SHENZHEN ARTEL TECHNOLOGY CO LTD
Original Assignee
SHENZHEN ARTEL 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 SHENZHEN ARTEL TECHNOLOGY CO LTD filed Critical SHENZHEN ARTEL TECHNOLOGY CO LTD
Priority to CN201110378046.3A priority Critical patent/CN102495808B/en
Publication of CN102495808A publication Critical patent/CN102495808A/en
Application granted granted Critical
Publication of CN102495808B publication Critical patent/CN102495808B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Memory System Of A Hierarchy Structure (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)
  • Memory System (AREA)

Abstract

The invention provides a method for saving memory space. The method comprises the following steps of: calculating the total quantity of data according to the length of analyzing time and the type of data to be acquired; presetting a buffer memory area of a certain size in a memory according to the total quantity of the data; determining the type of cache data according to the type of analytical data; establishing a control block for saving control block information; inserting the acquired data into the buffer memory area according to the type of the data according to a ranking algorithm specific to different cache data types, and correspondingly updating information in the control block; and acquiring, and calculating a result according to contents in the control block. Due to the adoption of a technical scheme provided by the invention, memory is required to be allocated in an amount which is only 5 percent of all data, memory required to be allocated can be greatly reduced, and the memory space is saved. The method has incomparable advantages for an embedded system with a small memory capacity.

Description

A kind of method of saving memory headroom
Technical field
The present invention relates to the power quality analysis field, relate in particular to a kind of method of saving memory headroom, this method can be applicable in the power quality analysis system based on the EN50160 agreement.
Background technology
When in embedded system is used, carrying out the analysis based on the EN50160 standard, tending to run into needs to analyze the electrical measurement data in a period of time, requires this moment to distribute corresponding memory headroom to store these data.But the time interval of analysis is long more, needs the memory headroom of distribution just big more; The internal memory limited with respect to embedded system; The memory headroom that takies is comparatively considerable, and for the analysis based on the EN50160 standard of long-time data, adopts the method for piecewise analysis usually.
But; When the above-mentioned piecewise analysis of application was machine-processed, the inventor found to have following problem in the prior art at least: be limited to the computing power of embedded system, can not carry out aggregate analysis to long-time data; The committed memory space is relatively large, easily consume system resources.
Summary of the invention
Embodiments of the invention provide a kind of method of saving memory headroom, it can be used in the analytic system based on the EN50160 standard, so that under the prerequisite in save memory space, realize long-time data are carried out aggregate analysis.
For achieving the above object, one side of the present invention provides a kind of method of saving memory headroom, and it comprises: according to the total amount of the length of analysis time and type of data computational data to be collected; Total amount according to these data presets the buffer storage (buffer) with a certain size in internal memory; Confirm data cached type according to analyzing data type; Set up controll block and preserve controll block information; Be inserted in the buffer storage according to sort algorithm gathering the data based type of data of coming, and upgrade the information in the controll block accordingly to different data cached types; And, after finishing collecting, calculate the result according to the content in the controll block.
Further, the predistribution size can be 5% internal memory for a certain proportion of internal memory of data total amount.
Further, said controll block information comprises the data total amount of needs analysis, the data number that adds analysis, the data number that satisfies the limit value of EN50160 agreement, the data buffer pointer of buffer memory maximum value data, the data buffer pointer of buffer memory minimum value data, data cached type at least.
Further, data cached type comprises: a buffer memory maximum 5%, a buffer memory minimum 5%, buffer memory maximum 2.5% and minimum 2.5% etc.;
Further, Data Update is comprised to the step in the buffer memory based on sort algorithm, based on the descending algorithm with Data Update in the maximum value data buffering area, if overflow the data buffer zone, then discard minimum value; Perhaps, based on the ascending order algorithm with Data Update in the minimum of a value data buffer zone, if overflow the data buffer zone, then discard maximum value;
Further, the step that calculates the result according to the content in the controll block comprises:
For the data type of a buffer memory maximum 5% and the data type of a buffer memory minimum 5%; Analysis module is according to the data cached buffer pointer in the controll block information; From data cached buffer zone, take out first value, this value is 100% probable value that the EN50160 analysis needs; Round after the data number multiply by 0.05 according to inserting in the controll block, draw 95% position of probable value data in the data buffer that the EN50160 analysis needs, in the data buffer, take out and value to get final product; The data number that satisfies the EN50160 limit value in the controll block is divided by inserting the qualification rate that the data number can draw data in the EN50160 analysis.
Data type for buffer memory maximum 2.5% and minimum 2.5%; Analysis module is based on the data cached buffer pointer in the controll block information; From maximum value data buffering area and minimum of a value data buffer zone, take out first value respectively; Based on the deviation algorithm that EN50160 analyzes, calculate big 100% probable value that is EN50160 analysis requirement of deviation in two values; Round after the data number multiply by 0.025 based on inserting in the controll block; From maximum, minimum of a value data buffer zone, take out the data of relevant position respectively as positional information; Based on the deviation algorithm that EN50160 analyzes, calculate big 95% probable value that is EN50160 analysis requirement of deviation in two values; The data number that satisfies the EN50160 limit value in the controll block is divided by inserting the qualification rate that the data number can draw data in the EN50160 analysis.
Beneficial effect of the present invention is; Certain space through only telling internal memory is as buffer storage; Make taking of internal memory significantly reduced; And owing to only calculate the part seldom in the tree numerical value collected, therefore, when being carried out computational analysis, index and numerical value need not to take the very large resource of processor.
Description of drawings
Fig. 1 is the distribution synoptic diagram of data buffer in an embodiment of the present invention;
Fig. 2 is the distribution synoptic diagram of data buffer among the another kind of embodiment of the present invention;
Fig. 3 is a kind of schematic flow sheet of saving the method for memory headroom of the embodiment of the invention.
Embodiment
Specific embodiments of the invention is further described with reference to the accompanying drawings.
The method of the saving memory headroom among the present invention can be applicable in the power quality analysis system based on the EN50160 agreement.
System based on the EN50160 agreement is generally embedded system, adopts RAM or FLASH etc. to use as internal memory, through an embedded controller, for example calls and data analysis, calculating based on what the controller of ARM framework was realized instructing.
In a storer of this system, can store this control program, move following steps with reference to this control program of Fig. 3:
At first, according to the total amount S101 of the length of analysis time and type of data computational data to be collected; Total amount according to these data presets buffer storage (buffer) S102 with a certain size in internal memory; Confirm data cached type S103 according to analyzing data type; Set up controll block and preserve controll block information S104; Be inserted in the buffer storage according to sort algorithm gathering the data based type of data of coming, and upgrade the information S105 in the controll block accordingly to different data cached types; And, after finishing collecting, calculate S106 as a result according to the content in the controll block.
Wherein, the predistribution size can be 5% internal memory for a certain proportion of internal memory of data total amount.
Further, said controll block information comprises the data total amount of needs analysis, the data number that adds analysis, the data number that satisfies the limit value of EN50160 agreement, the data buffer pointer of buffer memory maximum value data, the data buffer pointer of buffer memory minimum value data, data cached type at least.
With reference to Fig. 1,2 further, data cached type comprises: a buffer memory is maximum 5%, and a buffer memory is minimum 5%, buffer memory maximum 2.5% and minimum 2.5% etc.
Further, Data Update is comprised to the step in the buffer memory based on sort algorithm, based on the descending algorithm with Data Update in the maximum value data buffering area, if overflow the data buffer zone, then discard minimum value; Perhaps, based on the ascending order algorithm with Data Update in the minimum of a value data buffer zone, if overflow the data buffer zone, then discard maximum value.
Further, the step that calculates the result according to the content in the controll block comprises:
For the data type of a buffer memory maximum 5% and the data type of a buffer memory minimum 5%; Analysis module is according to the data cached buffer pointer in the controll block information; From data cached buffer zone, take out first value, this value is 100% probable value that the EN50160 analysis needs; Round after the data number multiply by 0.05 according to inserting in the controll block, draw 95% position of probable value data in the data buffer that the EN50160 analysis needs, in the data buffer, take out and value to get final product; The data number that satisfies the EN50160 limit value in the controll block is divided by inserting the qualification rate that the data number can draw data in the EN50160 analysis.
Data type for buffer memory maximum 2.5% and minimum 2.5%; Analysis module is based on the data cached buffer pointer in the controll block information; From maximum value data buffering area and minimum of a value data buffer zone, take out first value respectively; Based on the deviation algorithm that EN50160 analyzes, calculate big 100% probable value that is EN50160 analysis requirement of deviation in two values; Round after the data number multiply by 0.025 based on inserting in the controll block; From maximum, minimum of a value data buffer zone, take out the data of relevant position respectively as positional information; Based on the deviation algorithm that EN50160 analyzes, calculate big 95% probable value that is EN50160 analysis requirement of deviation in two values; The data number that satisfies the EN50160 limit value in the controll block is divided by inserting the qualification rate that the data number can draw data in the EN50160 analysis.
The data in 1 pair of week of instance are carried out the analysis based on the EN50160 standard.
With the degree of unbalancedness data instance in the electrical measurement data, the sample interval of EN50160 standard code degree of unbalancedness data is 10 minutes.The total degree of unbalancedness data number that calculates a week is 24 hours * 60 minutes/10 minutes=1008 (individual) of 7 days *.Therefore whether EN50160 only is concerned about for the degree of unbalancedness data only needs the ultra upper limit to keep 5% of maximum data and gets final product, thus predistribution 5% in save as 1008*5%=51 (individual).After beginning to analyze, can obtain degree of unbalancedness data in per 10 minutes, these data are inserted in the internal memory through descending sort, after the total amount of data of inserting was greater than 51, data in EMS memory can be overflowed, and all abandoned minimum degree of unbalancedness data at every turn.After a week, in internal memory, inserted 1008 data altogether, abandon minimum one because overflow Shi Douhui at every turn, so 5% maximum data can be retained in the internal memory, the value that is in 5% position is exactly 95% probable value that the EN50160 analysis needs.
The data in 2 pairs of weeks of instance are carried out EN50160 and are analyzed
With the voltage effective value data instance in the electrical measurement data, the sample interval of EN50160 standard code voltage effective value data is 10 minutes.Therefore can calculate total voltage effective value data number in a week is 24 hours * 60 minutes/10 minutes=1008 (individual) of 7 days *; Whether EN50160 both had been concerned about for the voltage effective value data whether the ultra upper limit also is concerned about and had therefore distributed two 2.5% memory headroom respectively by ultra lower limit.First memory headroom size is 1008*2.5%=26 (individual), is used for depositing 2.5% maximum data of 1008 data; Second memory headroom size is 1008*2.5%=26 (individual), is used for depositing 2.5% minimum number of 1008 data.After beginning to analyze; Can obtain voltage effective value data in per 10 minutes, these data are inserted in first memory headroom through descending sort, after the total amount of data of inserting is greater than 26; Data in EMS memory can be overflowed, and all abandons minimum voltage effective value data at every turn; Arrangement is inserted in second memory headroom through ascending order with these data, and after the data volume of inserting was greater than 26, data in EMS memory can be overflowed, and all abandoned maximum voltage effective value data at every turn.After a week; In first internal memory, second internal memory, 1008 data have been inserted respectively altogether; For first internal memory; All can abandon minimum data because overflow at every turn, so 2.5% maximum data can be retained in the internal memory, the value that is in 2.5% position is exactly the big value of 95% probability that the EN50160 analysis needs; For second internal memory, all can abandon maximum data because overflow at every turn, so 2.5% minimum data can be retained in the internal memory, the value that is in 2.5% position is exactly the little value of 95% probability that the EN50160 analysis needs.

Claims (5)

1. a method of saving memory headroom is characterized in that, comprising:
Total amount according to the length of analysis time and type of data computational data to be collected;
Total amount according to these data presets the buffer storage with a certain size in internal memory;
Confirm data cached type according to analyzing data type;
Set up controll block and preserve controll block information;
Be inserted in the buffer storage according to sort algorithm gathering the data based type of data of coming, and upgrade the information in the controll block accordingly to different data cached types; And
After finishing collecting, calculate the result based on the content in the controll block.
2. the method for saving memory headroom according to claim 1 is characterized in that: the predistribution size is 5% internal memory for a certain proportion of internal memory of data total amount.
3. the method for saving memory headroom according to claim 1 is characterized in that: said controll block information comprises the data total amount of needs analysis, the data number that adds analysis, the data number that satisfies the limit value of EN50160 agreement, the data buffer pointer of buffer memory maximum value data, the data buffer pointer of buffer memory minimum value data, data cached type at least.
4. the method for saving memory headroom according to claim 1 is characterized in that: data cached type comprises: a buffer memory maximum 5%, a buffer memory minimum 5%, or buffer memory maximum 2.5% and minimum 2.5%.
5. based on the method for the described saving memory headroom of claim 4; It is characterized in that: Data Update is comprised to the step in the buffer memory based on sort algorithm; Based on the descending algorithm with Data Update in the maximum value data buffering area, if overflow the data buffer zone, then discard minimum value; Perhaps, based on the ascending order algorithm with Data Update in the minimum of a value data buffer zone, if overflow the data buffer zone, then discard maximum value.
CN201110378046.3A 2011-11-24 2011-11-24 Method for saving memory space Expired - Fee Related CN102495808B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201110378046.3A CN102495808B (en) 2011-11-24 2011-11-24 Method for saving memory space

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110378046.3A CN102495808B (en) 2011-11-24 2011-11-24 Method for saving memory space

Publications (2)

Publication Number Publication Date
CN102495808A true CN102495808A (en) 2012-06-13
CN102495808B CN102495808B (en) 2014-12-17

Family

ID=46187633

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201110378046.3A Expired - Fee Related CN102495808B (en) 2011-11-24 2011-11-24 Method for saving memory space

Country Status (1)

Country Link
CN (1) CN102495808B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002319964A (en) * 2001-04-24 2002-10-31 Ando Electric Co Ltd Circuit for detecting character string and protocol analyzer
JP2004127140A (en) * 2002-10-07 2004-04-22 Hitachi Ltd Risk prediction supporting method, and information processor
CN1677934A (en) * 2004-03-31 2005-10-05 华为技术有限公司 Method and system for monitoring network service performance
US20070280277A1 (en) * 2006-05-30 2007-12-06 Martin Lund Method and system for adaptive queue and buffer control based on monitoring in a packet network switch
CN101995823A (en) * 2010-09-28 2011-03-30 吴伪亮 Energy-saving control method based on statistical forecasting technology

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002319964A (en) * 2001-04-24 2002-10-31 Ando Electric Co Ltd Circuit for detecting character string and protocol analyzer
JP2004127140A (en) * 2002-10-07 2004-04-22 Hitachi Ltd Risk prediction supporting method, and information processor
CN1677934A (en) * 2004-03-31 2005-10-05 华为技术有限公司 Method and system for monitoring network service performance
US20070280277A1 (en) * 2006-05-30 2007-12-06 Martin Lund Method and system for adaptive queue and buffer control based on monitoring in a packet network switch
CN101995823A (en) * 2010-09-28 2011-03-30 吴伪亮 Energy-saving control method based on statistical forecasting technology

Also Published As

Publication number Publication date
CN102495808B (en) 2014-12-17

Similar Documents

Publication Publication Date Title
CN102799486B (en) Data sampling and partitioning method for MapReduce system
CN110443657B (en) Client flow data processing method and device, electronic equipment and readable medium
CN106777093B (en) Skyline inquiry system based on space time sequence data flow application
CN109962856B (en) Resource allocation method, device and computer readable storage medium
EP3494624B1 (en) Distributed resource electrical demand forecasting system and method
CN103699660B (en) A kind of method of large scale network stream data caching write
WO2016165378A1 (en) Energy storage power station mass data cleaning method and system
CN107798059B (en) NCO meteorological data structured storage method and device
CN111008726B (en) Class picture conversion method in power load prediction
CN113407426A (en) Server cluster capacity evaluation method and device, electronic equipment and storage medium
CN115344207A (en) Data processing method and device, electronic equipment and storage medium
CN116827950A (en) Cloud resource processing method, device, equipment and storage medium
CN111382031B (en) Test method and device
CN111046059B (en) Low-efficiency SQL statement analysis method and system based on distributed database cluster
CN114912720A (en) Memory network-based power load prediction method, device, terminal and storage medium
CN102495808A (en) Method for saving memory space
CN107679133B (en) Mining method applicable to massive real-time PMU data
CN102984274A (en) Dynamic load optimization method for lottery cloud service system based on data mining
CN112181498B (en) Concurrency control method, device and equipment
CN103383654A (en) Method and device for adjusting mappers to execute on multi-core machine
CN108512926B (en) Big data analysis control method for dissolved oxygen in fishpond
CN109871403B (en) Industrial big data analysis method based on industrial supply chain
CN110716763B (en) Automatic optimization method and device for web container, storage medium and electronic equipment
CN111311318A (en) User loss early warning method, device, equipment and storage medium
CN116390149A (en) MR information backfilling method and system based on big data

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
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20141217

Termination date: 20151124

CF01 Termination of patent right due to non-payment of annual fee