CN103744626A - Data writing method based on memory replacement - Google Patents

Data writing method based on memory replacement Download PDF

Info

Publication number
CN103744626A
CN103744626A CN201410015855.1A CN201410015855A CN103744626A CN 103744626 A CN103744626 A CN 103744626A CN 201410015855 A CN201410015855 A CN 201410015855A CN 103744626 A CN103744626 A CN 103744626A
Authority
CN
China
Prior art keywords
internal memory
memory
capacity
data
state
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
CN201410015855.1A
Other languages
Chinese (zh)
Other versions
CN103744626B (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.)
Inspur Electronic Information Industry Co Ltd
Original Assignee
Inspur Electronic Information Industry 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 Inspur Electronic Information Industry Co Ltd filed Critical Inspur Electronic Information Industry Co Ltd
Priority to CN201410015855.1A priority Critical patent/CN103744626B/en
Publication of CN103744626A publication Critical patent/CN103744626A/en
Application granted granted Critical
Publication of CN103744626B publication Critical patent/CN103744626B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

The invention discloses a data writing method based on memory replacement. The data writing method includes the following steps: firstly, generating a memory structure, designing a part which is used for reading and writing data in the memory independently and integrating two integrated circuits with the same capacity with each other; secondly, processing the memory replacement, starting a system with a general model at the beginning and testing available capacity of stacks according to a replacement model set by the system by a memory managing unit when related applications of the system are completely loaded after the system runs for a period of time; thirdly, adding a certain amount of redundant stack areas according to actual capacity, testing memory for reading and adding a certain amount of redundant reading memory; fourthly, completely mapping the rest of the memory to writing memory so as to complete the process of memory replacement. Compared with the prior art, the memory replacement in writing files enables the overall writing process to be smoother, and the writing performance is improved. The data writing method based on the memory replacement has the advantages of being high in practicality and easy to promote.

Description

A kind ofly based on internal memory, replace and carry out the method that data write
Technical field
The present invention relates to computer memory system technical field, more specifically say based on internal memory and replace and carry out the method that data write.
Background technology
In actual life, increasing and the Informationization Equipment of people is come into contacts with, it is exactly obtaining information that people use a main object of these equipment, is but information come wherefrom? this just relates to information and preserves, if information is not preserved, obtaining information is not just known where to begin, and therefore information is preserved for whole message area and played the effect of supporting.The information of mentioning is preserved, what people were easy to expect is oneself to use mobile phone or PC to preserve the file of oneself, for this preservation, because data volume is few, also generally there is time enough slowly to deposit by pc machine, what therefore in storing process, generally there will not be problems such as loss of data.
But in actual life, some situation can produce a large amount of data and need memory device to store timely these a large amount of data.Video Surveillance Industry just has so a kind of feature, in some middle-size and small-size video monitoring projects, camera has the thousands of roads of hundreds of, large-scale or the superhuge camera that has roads up to ten thousand, particularly camera has become high Qinghua now, this that is to say for video monitoring can produce a large amount of data at short notice, and if these data can not within a short time, store and will lose.
A lot of video manufacturers is used some general memory devices now, and video data is stored, and often sees that frame losing phenomenon has appearred in monitoring manufacturer complaint video.Namely there is video data loss in video frame losing, and to storage when checking, the network bandwidth can be satisfied the demand completely, and disk I/O waits and do not occur bottleneck.This is usually that technician has a headache very much.
Because data volume is large, way is many, but also usually realizes the problems such as the outburst of data stream.In the process of Video Data Storage, kernel usually first deposits data in buffer memory in, and then call and write with a brush dipped in Chinese ink thread data are brushed into memory devices such as disks, and internal memory to be a lot of process share, kernel need to carry out Memory Allocation to data stream, apply for that relevant page expends the plenty of time, and do not have enough internal memories to deposit when likely data stream is come in the time of internal memory application, this has just caused video frame losing.
In video monitoring (data backup) application, the feature that has a highly significant is exactly that the amount of writing is far longer than the probability of reading, and data write relatively steady, but the data volume that each moment writes is all very large, and write rear substantially needs and read at once, also, after being write memory, can writing disk and not worry that this can affect the efficiency reading.For these application characteristics, propose one and replace based on internal memory, the process writing so that whole becomes smoothly, improves the method for write performance.
Summary of the invention
Technical assignment of the present invention is to solve the deficiencies in the prior art, provides a kind of and replaces and carry out the method that data write based on internal memory.
Technical scheme of the present invention realizes in the following manner, this kind of based on internal memory replace carry out the method that data write, its implementation procedure is:
Internal memory framework is set, part for reading and writing data in internal memory is carried out to independent design, two identical integrated circuit of capacity are integrated, every circuit includes the part and the part of writing data of read data, set memory size is the total size of stack region, the capacity of each piece is all equivalent to the capacity in internal memory Zhong Dui district, Ba Zhan district capacity is drawn one of percentage of actual stack district desired volume 120, at this moment remaining capacity is just all for piling district, and Gai Dui reads in district capacity and the capacity of writing forms heap district all told jointly.
Carrying out internal memory switching first, is internal memory switch mode by default.
Then system starts with common-mode when just starting, a period of time to be moved, system related application has loaded completely, by can Dui Zhan district, rdma read district, write memory management unit that the capacity of memory field carries out dynamically adjusting according to the switch mode of default, the capacity that stack is used detects, then according to actual capacity, add certain redundancy setting stack district, then for reading used internal memory, detect, and add that certain redundancy sets rdma read, remaining internal memory Complete Mappings is write internal memory, completes internal memory handoff procedure.
Described internal memory switches and refers to the switching of writing internal memory, and it comprises two states, 0 state and 1 state, and 0 state representation outside data are toward the state of writing in internal memory, the state that the memory device of 1 state representation from internal memory toward disk write with a brush dipped in Chinese ink.
The capacity service condition in described memory management unit Dui Ge district is followed the tracks of, and when the redundancy capacity in a certain district is less than preset value, memory management unit internally deposits into row adjustment, when the capacity of redundancy is greater than default value, equally internally deposits into row adjustment.
In every internal memory, be all provided with " full state " hardware position: when writing internal memory in 0 state, namely during the state in outside data write memory, when data, filled up 80% the internal memory of writing, " data are full " hardware position will be set to 1; And the internal storage data of another piece in 1 state be when write with a brush dipped in Chinese ink completely, " full state " position is set to 0.
Memory management unit can also carry out state switching according to " full state " position and the residing situation of data stream situation of two internal memories, and state switches use edge triggered flip flop and triggers switching.
The beneficial effect that the present invention compared with prior art produced is:
Of the present inventionly a kind ofly based on internal memory, replace and carry out the method that data write and at file, write fashionable by replacing internal memory so that the whole process writing becomes level and smooth, improve write performance, data write steadily, video is preserved complete and difficult loss, the process of transferring is convenient easily to be realized, practical, be easy to promote.
Accompanying drawing explanation
Accompanying drawing 1 is replaced read-write under situation for internal memory in the present invention and is used internal memory schematic diagram.
Embodiment
Below in conjunction with accompanying drawing, to of the present invention, a kind ofly based on internal memory, replace and carry out the method that data write and be described in detail below.
As shown in Figure 1, now provide a kind of and replace and carry out the method that data write based on internal memory, its implementation procedure is:
Internal memory framework is set, the part for reading and writing data in internal memory is carried out to independent design, in region, have as shown in Figure 1 two identical VLSI (very large scale integrated circuit) of capacity to integrate.The capacity of each piece is all equivalent to the capacity in internal memory Zhong Dui district.Heap district capacity is for traditional EMS memory management process, and heap district capacity does not have fixed value, is a region of variable size.For convenient, can be that set memory size is the total size of stack region.
Due to more single for applied business amounts such as video monitoring storage or data backups, the needed capacity in stack district is also more fixing, be assumed to n, in order there to be certain redundancy, capacity can be drawn to one of percentage of actual stack district desired volume 120, at this moment remaining capacity just all for piling district.
Because considerably less for reading needed capacity in heap district, can draw a little part and be used for reading, be assumed to R.
Then last remaining internal memory, all for writing internal memory, supposes that total capacity is W.
Complete the step that internal memory switches.
Internal memory switches and refers to the switching of writing internal memory, in writing, has two states, 0 state and 1 state, and 0 state representation outside data, toward the state of writing in internal memory, are write internal storage state; The state that the memory device of 1 state representation from internal memory toward disk write with a brush dipped in Chinese ink, writes Disk State.
In the middle of using for reality, whether need to carry out internal memory replacement, can use relevant order internally to deposit into row and control, if do not need to carry out internal memory alternative patterns, only use internal memory 1, under this situation, identical with common use, as broad as long.
Memory management unit can Dui Zhan district, and rdma read district, writes the capacity of memory field and dynamically adjust.Adjustment can be adjusted as follows.
1) default is internal memory switch mode.
2) system is all to start with common-mode when just starting, Deng having moved a period of time, also be that system related application has loaded completely, at this moment can memory manager according to the switch mode of default, the capacity that stack is used detects, and then according to actual capacity, adds certain redundancy (as 20%) setting stack district, then for reading used internal memory, detects, and adding certain redundancy setting rdma read, remaining internal memory Complete Mappings is given and is write internal memory.
3) memory management unit needs the capacity service condition in Dui Ge district to follow the tracks of, but the redundancy capacity in a certain district is less than preset value, and memory management unit need to internally deposit into row adjustment, when the capacity of redundancy is greater than default value, also needs internally to deposit into row adjustment.
In every internal memory, be all provided with " full state " hardware position, when writing the state of internal memory in writing, during 0 state, namely during the state in outside data write memory, when data, filled up 80% the internal memory of writing, " data are full " hardware position will be set to 1.And another piece is in writing with a brush dipped in Chinese ink state, internal storage data during 1 state has been write with a brush dipped in Chinese ink completely, and " full state " position is set to 0.
Memory management unit also needs to carry out state switching according to " full state " position and the residing situation of data stream situation of two internal memories.State switches use edge triggered flip flop and triggers switching.In order better to set forth idea, hardware position is used following letter to arrange:
The full mode bit M1 of internal memory 1;
The full mode bit M2 of internal memory 2;
Internal memory 1 is write state X1;
Internal memory 2 is write state X2;
Data stream edge B;
Concrete situation is as shown in the table:
Situation M1 M2 B X1 X2
1 0 1 Rising edge By 1 change 0 There is 0 change 1
2 1 0 Rising edge There is 0 change 1 By 1 change 0
3 0 0 Any state 0 1
4 1 1 Any state 0 0
For this form, it should be noted that the 4th kind of situation must avoid.The first situation shows that internal memory 1 is initially located in the state of writing disk, and internal memory 2 is initially located in and writes internal storage state.Internal memory 1 is after having write with a brush dipped in Chinese ink, and full state becomes 0, if now internal memory 2 data have write 80%, if data stream is in rising edge, internal memory will be replaced.
When data are write with a brush dipped in Chinese ink, can also as common writing with a brush dipped in Chinese ink, can merge to relevant write operation the speed writing to improve disk.
At internal memory, become and write with a brush dipped in Chinese ink disk,, after 1 state, will empty the whole internal memory of writing, therefore writing with a brush dipped in Chinese ink thread does not need to consider whether also need to wait for that some write operation is to write merging.
File system metadata is read into rdma read, when data are write with a brush dipped in Chinese ink, can determine the particular location writing according to the mapping relations of the relevant various data structures in rdma read (as address_space).
After replacing by internal memory, internal memory has become sky, often carries out an internal memory and replaces, just as obtaining a new internal memory, therefore when external data is write internal memory, when carrying out Memory Allocation, just do not need to carry out internal memory traversal, inquiry free memory, can make internal memory traversal relatively easy in other words.
For internal memory, write full, and write with a brush dipped in Chinese ink situation about not completing, need to avoid, therefore the speed that the speed that disk system writes can not write toward internal memory lower than data, when disk is selected, must calculate speed and the disk writing speed of writing internal memory, otherwise system to improve be howsoever also of no avail.
The foregoing is only embodiments of the invention, within the spirit and principles in the present invention all, any modification of doing, be equal to replacement, improvement etc., within all should being included in protection scope of the present invention.

Claims (5)

1. based on internal memory, replace and carry out the method that data write, it is characterized in that its implementation procedure is:
Internal memory framework is set, part for reading and writing data in internal memory is carried out to independent design, two identical integrated circuit of capacity are integrated, every circuit includes the part and the part of writing data of read data, set memory size is the total size of stack region, the capacity of each piece is all equivalent to the capacity in internal memory Zhong Dui district, Ba Zhan district capacity is drawn one of percentage of actual stack district desired volume 120, at this moment remaining capacity is just all for piling district, and Gai Dui reads in district capacity and the capacity of writing forms heap district all told jointly;
Carry out internal memory switching,
First by default, be internal memory switch mode;
Then system starts with common-mode when just starting, a period of time to be moved, system related application has loaded completely, by can Dui Zhan district, rdma read district, write memory management unit that the capacity of memory field carries out dynamically adjusting according to the switch mode of default, the capacity that stack is used detects, then according to actual capacity, add certain redundancy setting stack district, then for reading used internal memory, detect, and add that certain redundancy sets rdma read, remaining internal memory Complete Mappings is write internal memory, completes internal memory handoff procedure.
2. according to claim 1ly a kind ofly based on internal memory, replace and carry out the method that data write, it is characterized in that: described internal memory switching refers to the switching of writing internal memory, it comprises two states, 0 state and 1 state, 0 state representation outside data are toward the state of writing in internal memory, the state that the memory device of 1 state representation from internal memory toward disk write with a brush dipped in Chinese ink.
3. according to claim 2ly a kind ofly based on internal memory, replace and carry out the method that data write, it is characterized in that: the capacity service condition in described memory management unit Dui Ge district is followed the tracks of, when the redundancy capacity in a certain district is less than preset value, memory management unit internally deposits into row adjustment, when the capacity of redundancy is greater than default value, equally internally deposits into row adjustment.
4. according to claim 3ly a kind ofly based on internal memory, replace and carry out the method that data write, it is characterized in that: in every internal memory, be all provided with " full state " hardware position: when writing internal memory in 0 state, namely during the state in outside data write memory, when data, filled up 80% the internal memory of writing, " data are full " hardware position will be set to 1; And the internal storage data of another piece in 1 state be when write with a brush dipped in Chinese ink completely, " full state " position is set to 0.
5. according to claim 3ly a kind ofly based on internal memory, replace and carry out the method that data write, it is characterized in that: memory management unit can also carry out state switching according to " full state " position and the residing situation of data stream situation of two internal memories, and state switches use edge triggered flip flop and triggers switching.
CN201410015855.1A 2014-01-14 2014-01-14 It is a kind of that the method for carrying out data write-in is replaced based on internal memory Active CN103744626B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410015855.1A CN103744626B (en) 2014-01-14 2014-01-14 It is a kind of that the method for carrying out data write-in is replaced based on internal memory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410015855.1A CN103744626B (en) 2014-01-14 2014-01-14 It is a kind of that the method for carrying out data write-in is replaced based on internal memory

Publications (2)

Publication Number Publication Date
CN103744626A true CN103744626A (en) 2014-04-23
CN103744626B CN103744626B (en) 2017-08-11

Family

ID=50501647

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410015855.1A Active CN103744626B (en) 2014-01-14 2014-01-14 It is a kind of that the method for carrying out data write-in is replaced based on internal memory

Country Status (1)

Country Link
CN (1) CN103744626B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107124570A (en) * 2017-05-08 2017-09-01 青岛海信电器股份有限公司 Individual video video recording PVR method for recording and device
CN107885672A (en) * 2017-11-07 2018-04-06 杭州顺网科技股份有限公司 Internal storage management system and method
CN110119132A (en) * 2019-04-09 2019-08-13 吴怡文 A kind of diversified method and system of controller realization function setting
CN110515745A (en) * 2019-08-15 2019-11-29 广东浪潮大数据研究有限公司 A kind of shared drive data processing method, device, system, equipment and medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103019617A (en) * 2012-11-25 2013-04-03 向志华 Establishing method for efficiently realizing internal RAID of SSD, data reading and writing method and device
US20130332690A1 (en) * 2012-06-12 2013-12-12 Research & Business Foundation Sungkyunkwan University Memory Systems and Memory Managing Methods of Managing Memory in a Unit of Memory Chunk

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130332690A1 (en) * 2012-06-12 2013-12-12 Research & Business Foundation Sungkyunkwan University Memory Systems and Memory Managing Methods of Managing Memory in a Unit of Memory Chunk
CN103019617A (en) * 2012-11-25 2013-04-03 向志华 Establishing method for efficiently realizing internal RAID of SSD, data reading and writing method and device

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107124570A (en) * 2017-05-08 2017-09-01 青岛海信电器股份有限公司 Individual video video recording PVR method for recording and device
CN107885672A (en) * 2017-11-07 2018-04-06 杭州顺网科技股份有限公司 Internal storage management system and method
CN110119132A (en) * 2019-04-09 2019-08-13 吴怡文 A kind of diversified method and system of controller realization function setting
CN110515745A (en) * 2019-08-15 2019-11-29 广东浪潮大数据研究有限公司 A kind of shared drive data processing method, device, system, equipment and medium

Also Published As

Publication number Publication date
CN103744626B (en) 2017-08-11

Similar Documents

Publication Publication Date Title
CN104461391B (en) A kind of storage device metadata management approach and system
CN104407933B (en) A kind of backup method and device of data
CN104331478B (en) Data consistency management method for self-compaction storage system
US20130254514A1 (en) Wear-leveling method, storage device, and information system
WO2016086819A1 (en) Method and apparatus for writing data into shingled magnetic record smr hard disk
CN104077380B (en) A kind of data de-duplication method, apparatus and system
US9576019B2 (en) Increasing distributed database capacity
CN105549905A (en) Method for multiple virtual machines to access distributed object storage system
US11010079B2 (en) Concept for storing file system metadata within solid-stage storage devices
CN103077121B (en) The method of data management in a kind of flash memory device and device
CN104361030A (en) Distributed cache architecture with task distribution function and cache method
CN106066890B (en) Distributed high-performance database all-in-one machine system
CN106095337A (en) A kind of cloud disk based on SAN network storage is quickly shared method
CN103838853A (en) Mixed file system based on different storage media
CN105677251A (en) Storage system based on Redis cluster
US8296270B2 (en) Adaptive logging apparatus and method
CN103744626A (en) Data writing method based on memory replacement
CN106155915A (en) The processing method and processing device of data storage
CN103218305A (en) Distribution method of memory space
US10592138B1 (en) Avoiding storage device overlap in raid extent sub group and keeping relationship balance on mapped raid system and method
CN104063284A (en) Method and device operating application program
KR102089291B1 (en) Method for moving data extent
CN105450704A (en) Network storage device for flash memories and processing method thereof
CN103823634A (en) Data processing method and system supporting non-random write mode
CN102917036A (en) Memcached-based distributed cache data synchronization realization 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
GR01 Patent grant
GR01 Patent grant