CN1073724C - Method for maintaining memory of computer - Google Patents

Method for maintaining memory of computer Download PDF

Info

Publication number
CN1073724C
CN1073724C CN97108834A CN97108834A CN1073724C CN 1073724 C CN1073724 C CN 1073724C CN 97108834 A CN97108834 A CN 97108834A CN 97108834 A CN97108834 A CN 97108834A CN 1073724 C CN1073724 C CN 1073724C
Authority
CN
China
Prior art keywords
chain
detection
storage block
detection head
pointer
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 - Lifetime
Application number
CN97108834A
Other languages
Chinese (zh)
Other versions
CN1191347A (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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN97108834A priority Critical patent/CN1073724C/en
Publication of CN1191347A publication Critical patent/CN1191347A/en
Application granted granted Critical
Publication of CN1073724C publication Critical patent/CN1073724C/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Images

Abstract

The present invention discloses a maintaining method for a memory of a computer. The present invention comprises a detecting chain, a storage management module and an error detecting module, wherein the initial state of the detecting chain is set to be empty, the storage management module sets a detecting head for each storage block, a legal sign is set in each detecting head, the detecting chain is established, the error detecting module detects the detecting head of each storage block according to a sequence in the detecting chain, and whether a value stored in each detecting head is corresponding to the legal sign is used for determining whether the storage block is legally operated. Through the maintaining method for a memory of a computer, which is provided by the present invention, software methods can be used for conveniently detecting the occurrence of off-normal logic error in the storage of a computer.

Description

The maintaining method of computer memory
The present invention relates to computer technology, specifically, relate to the maintenance and the error detection techniques of computer memory.
In the operational process of program, each program segment all may be applied for one or more storage spaces frequently, with the intermediate data and/or the final data of stored programme needs in service and/or generation, discharges this storage space again after finishing using.Like this, a storer just is divided out some dynamic storage blocks, and each storage block should only be carried out accessing operation by corresponding program segment.But, in some cases, to storage block storage data " crossing the border " phenomenon can take place.That is to say, originally, the data of program segment A should be stored among the corresponding storage block A ', the data of program segment B should be stored among the corresponding storage block B ', but, because programmer's maloperation or because the mistake of program itself, program segment A is stored in the data among the storage block A ', crossed the border by program segment B and to have revised, the mistake of the illegal storage of this class belongs to usually said logic error.
In the prior art, many error-detecting and modification methods about storer are also arranged, be 5 for example in the patent No., 291,498, name is called in the United States Patent (USP) of " error-detecting method and device with computer memory of multidigit output memory circuit ", has just introduced a kind of detection method of memory error.This method is with a testing circuit, the mistake that takes place in the detection of stored process.There is following defective in this method: the physical error in the just storer that (1) is detected, and promptly storer is changed by physics by the data of physical damage, storage and the mistake that takes place etc., can not detect above-mentioned logic error; (2) testing circuit need be set, will change on the hardware, implement inconvenience, dumb.
Purpose of the present invention overcomes above-mentioned deficiency of the prior art exactly, and a kind of software implementation method of using is provided, and the logic error of " crossing the border " takes place in the detection computations machine storage easily and flexibly.
For this reason, by the maintaining method of a kind of storer provided by the invention, be provided with one and be initially empty detection chain, a memory management module and an error detection module, memory management module is provided with detection head for each storage block, and legal mark is set in detection head, and sets up and detect chain; Whether error detection module is that legal mark judges that whether this storage block is by legal operation according to the detection head that detects each storage block of sequence detection in the chain according to the value of storing in the detection head.
Described memory management module may further comprise the steps:
(1), distributes a free memory blocks;
(2), detection head and legal mark are set;
(3), add the detection chain;
(4), return back one address of described detection head; Wherein step (2) can be exchanged with the order of step (3).Described error detection module may further comprise the steps:
A, the begin chain detection head pointed in the described detection chain is decided to be detection head to be checked;
Data in b, the described detection head to be checked of extraction;
Whether c, the data of judging said extracted be consistent with the set legal mark of step (2);
If the judged result of d c is inconsistent, then provides the mistakenly complain alarming information and withdraw from signal;
If the judged result of e c is consistent, whether what then judge the described detection head to be checked of sensing is the last-of-chain of described detection chain;
If the judged result of f e for not being last-of-chain, then is changed to detection head to be checked, execution in step b with the next detection head in the described detection chain;
If the judged result of g e is for being last-of-chain, detection of end then.
The alleged storer of the present invention mainly refers to the calculator memory device, also can be applicable to storer, the hard disc of computer of web server computer, perhaps external memory storage, and as floppy disk etc., and other can be used as the medium of memory function.
Maintaining method by computer memory provided by the present invention, need not to increase any hardware, also need not existing hardware is carried out any transformation, just can detect the logic error in the memory stores easily, can detect the storage border-crossing error that takes place in programming and the computer program operational process in time, prompting exploitation, maintainer follow the tracks of solution, need in the environment of continuous working procedure at some, in the Maintenance of Program Control Exchange management, have very practical meaning and good effect.
Below in conjunction with drawings and Examples, further specify technical scheme of the present invention.
Fig. 1 is an overall process synoptic diagram of implementing the inventive method;
Fig. 2 a is the structural representation that memory management module manages background storage and storage block in application the inventive method to storer;
Fig. 2 b is one of the present invention and detects the chain structure synoptic diagram;
Fig. 3 is a program flow diagram of realizing memory management module of the present invention;
Fig. 4 is a program flow diagram of realizing error detection module of the present invention;
Fig. 5 is a program flow diagram of realizing a storage block is carried out error-detecting.
Fig. 1 has illustrated the whole process in the concrete enforcement of the present invention.When storage block of program segment 101 application, memory management module 103 is called in the accept applications instruction of storage block of the CPU102 of computing machine, distributes, is provided with storage block 106, adds and detects chain 104; When needs detection of stored device mistake, call error detection module 105 carries out error-detecting according to the address that detection chain 104 provides to storage block 106, when detecting storage errors, notifies CPU, and is sent alarm prompt and withdrawed from information by CPU.
Before storage administration and error-detecting, set up an initial detecting chain earlier, its initial pointer is a null pointer.
As Fig. 2 a, Fig. 2 b and shown in Figure 3, in memory management module, when storage block of program segment application, elder generation's execution in step 301 is distributed storage block Si (i=1,2 of a free time, M), then in step 302, in first address 210 (as the address of this storage block detection head) the access detection chain with storage block.In step 303, n position before this storage block is made as detection head, is changed to fixing character string, for example preceding 4 bytes (n=32) can be set to " CHCK ", as legal mark.In general, all storage blocks should be provided with identical legal mark, but also can as required different legal marks be set.After detection head 201 is provided with, return after the detection head i.e. the 33rd bit address 211, as the entry address of this storage block being carried out accessing operation, to the data storage of this storage block, read, just from the address 211.Like this, whole storage block just is divided into two parts: a part is detection head 201, and the right and wrong free core pool can not be toward wherein writing data under legal ruuning situation; Another part is free core pool 202, needs the data of storage freely to deposit in wherein.Applying for the result of storage block each time, is to distribute the storage block of being made up of 201 and free core pools 202, a non-free core pool (detection head) like this, and adds the address of new storage block detection head in detecting chain.Like this, after repeatedly applying for, just form one storage block group S1, S2 ..., SM and a detection chain of forming by the address of all detection heads.
When discharging storage block, non-free core pool (detection head) 201 and free core pool 202 are discharged simultaneously, non-free core pool becomes again and can delete the address of pointing to this storage block detection head simultaneously from detect chain for the space of freely using.
Set up the operation of initial detecting chain, memory management module, release storage block, realize by the program of operation system of computer level.
When needs carry out error-detecting to storage block, the call error detection module, in step 401, with the begin chain in the detection pointer 220 direct detection chains of detection chain among Fig. 2, the detection head pointed to the chain leading address detects.Fig. 5 is the specific implementation of step 402 among Fig. 4, promptly a certain specific memory piece is judged that whether it is by legal use.
Under the situation of legal storage, the storage of data is that back from detection head is address 211 beginning Fig. 2 a, the content of storing in the detection head remain default, fixing legal mark, when data are illegally stored, should be stored in data in other storage block may cross the border and store in the current storage block, illegal storage then is to begin storage from storage block start address (210 Fig. 2 a), thereby the content of original storage in the covering detection head, destroy legal mark, make that the content of current storage in the detection head is inconsistent with default legal mark.Therefore, detecting some storage blocks, that whether this type of wrong step takes place is as follows: at first carry out 501, extract the content of current storage in this storage block detection head, carry out 502, the content of being extracted is compared with the legal mark of being scheduled to " CHCK "; If both unanimities then show not destroyedly, it is legal that current storage block is used, and both are inconsistent else if, show that border-crossing error appears in current storage block, then demonstrate warning information, quit a program, the programmer follows the tracks of again according to prompting, finds, revises error routine.
After having detected current storage block,, check whether withdraw from signal,, then withdraw from error detection module if withdraw from signal in step 403, otherwise, carry out 404.Withdrawing from signal can be the compulsory withdrawal order that the programmer imports, and also can be to detect the withdraw from signal of wrong back in step 503 generation.If the current detection pointer is not the last-of-chain that detects chain, then detect the next detection head of pointed, detect next storage block; Otherwise, will detect the begin chain that pointed detects chain, begin new one and take turns the round-robin detection.
The step of error-detecting can on-line operation among the present invention, carries out error-detecting in real time, i.e. operation in other program run is set by CPU and to be carried out this error-detecting step several times within a certain period of time; Also can after being finished, other program call this error-detecting step, in time mistake in the discovery procedure; Also can call in other occasion as required.The execution that can circulate is promptly carried out being automatically brought to when detecting chain last-of-chain place and is detected the chain begin chain and continue to carry out, and also can be begun to carry out and be finished by people's control and carry out.The embodiment of the invention is an example real-time, that circulation is carried out, and as shown in Figure 4, begins to detect from detecting chain begin chain storage block S1 pointed, after detection finishes, search whether withdraw from signal, if having, then withdraw from circulation, detection of end, otherwise, judge whether the current detection pointer is the last-of-chain that detects chain,, then continue to detect next storage block Si (i=2 if not last-of-chain,, M-1), if last-of-chain, then detect the begin chain that pointed detects chain, begin new one and take turns the round-robin detection.
The detection chain of the embodiment of the invention is an address table of being made up of in order the first address of each storage block detection head, but those skilled in the art are easy to find out, can also take the detection chain of alternate manner, for example can be one and point to all detection heads, end to end pointer chain; Also can be in detection head, to be provided with two to detect pointer, one of them forwarding pointer points to the detection head of next storage block, after one on pointed the detection head of a storage block, back forwarding pointer to pointer and last storage block in first storage block all is changed to null pointer, detects front and back that pointer (comprise forwarding pointer and afterwards to pointer) the forms pointer chain that links to each other by each storage block.
Above steps all is to realize by computer program, finishes by the operation of program.

Claims (9)

1, a kind of maintaining method of computer memory comprises that being provided with one is initially empty detection chain, a memory management module and an error detection module; Memory management module is provided with detection head for each storage block, and legal mark is set in detection head, and sets up and detect chain; Whether error detection module is that described legal mark judges that whether this storage block is by illegal operation according to the detection head that detects each storage block of sequence detection in the chain according to the data of storing in the detection head.
2, the method for claim 1, described memory management module may further comprise the steps:
(1), distributes a free memory blocks;
(2), detection head and legal mark are set;
(3), add the detection chain;
(4), return back one address of described detection head; Wherein step (2) can be exchanged with the order of step (3).
3, the method for claim 1, described error detection module may further comprise the steps:
A, the begin chain detection head pointed in the described detection chain is decided to be detection head to be checked;
Data in b, the described detection head to be checked of extraction;
Whether c, the data of judging described extraction be consistent with the set legal mark of step (2);
If the judged result of d c is inconsistent, then provides the mistakenly complain alarming information and withdraw from signal;
If the judged result of e c is consistent, whether what then judge the described detection head to be checked of sensing is the last-of-chain of described detection chain;
If the judged result of f e for not being last-of-chain, then is changed to detection head to be checked with the next detection head in the described detection chain, then execution in step b;
If the judged result of g e is for being last-of-chain, detection of end then.
4, the maintaining method of storer as claimed in claim 1 or 2 is characterized in that described being included as of detection head and legal markers step that be provided with: the preceding n position (1<n<m, wherein m is the total bit of described storage block) of described storage block is changed to a fixed sequence program.
5, the maintaining method of storer as claimed in claim 4 is characterized in that described each storage block all has identical legal mark.
6, the maintaining method of storer as claimed in claim 4 is characterized in that: comprising also squatting to chase after in the n+3 gull road that described storage is situated between helps complete female essence to cough up the female return address of allusion quotation; And when this storage block is stored data legally, store since the n+1 position.
7, as the maintaining method of claim 2 or 3 described storeies, it is characterized in that described detection chain can be one and point to all detection heads, end to end pointer chained list also can be an address table of being made up of in order the detection head first address of all storage blocks.
8, as claim 1 or 2 or 3 described methods, it is characterized in that to be provided with in the described detection head two and detect pointer, one of them forwarding pointer points to the detection head of next storage block, after one on pointed the detection head of a storage block, back forwarding pointer to pointer and last storage block in first storage block all is changed to null pointer, and described each storage block detects pointer (comprising that forwarding pointer and back are to pointer) and forms the detection chain that front and back link to each other.
9, memory maintenance method as claimed in claim 3, it is characterized in that described step g can also for: if the judged result of e is for being last-of-chain, execution in step a then.
CN97108834A 1997-02-19 1997-02-19 Method for maintaining memory of computer Expired - Lifetime CN1073724C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN97108834A CN1073724C (en) 1997-02-19 1997-02-19 Method for maintaining memory of computer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN97108834A CN1073724C (en) 1997-02-19 1997-02-19 Method for maintaining memory of computer

Publications (2)

Publication Number Publication Date
CN1191347A CN1191347A (en) 1998-08-26
CN1073724C true CN1073724C (en) 2001-10-24

Family

ID=5170680

Family Applications (1)

Application Number Title Priority Date Filing Date
CN97108834A Expired - Lifetime CN1073724C (en) 1997-02-19 1997-02-19 Method for maintaining memory of computer

Country Status (1)

Country Link
CN (1) CN1073724C (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5291498A (en) * 1991-01-29 1994-03-01 Convex Computer Corporation Error detecting method and apparatus for computer memory having multi-bit output memory circuits
US5455939A (en) * 1992-06-17 1995-10-03 Intel Corporation Method and apparatus for error detection and correction of data transferred between a CPU and system memory
US5475693A (en) * 1994-12-27 1995-12-12 Intel Corporation Error management processes for flash EEPROM memory arrays

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5291498A (en) * 1991-01-29 1994-03-01 Convex Computer Corporation Error detecting method and apparatus for computer memory having multi-bit output memory circuits
US5455939A (en) * 1992-06-17 1995-10-03 Intel Corporation Method and apparatus for error detection and correction of data transferred between a CPU and system memory
US5475693A (en) * 1994-12-27 1995-12-12 Intel Corporation Error management processes for flash EEPROM memory arrays

Also Published As

Publication number Publication date
CN1191347A (en) 1998-08-26

Similar Documents

Publication Publication Date Title
US6823436B2 (en) System for conserving metadata about data snapshots
Ozkarahan et al. RAP: an associative processor for data base management
US7698419B2 (en) Automatic tracking of usage of a software application having different versions
CN101561775B (en) Method and device for monitoring memory
US7634496B1 (en) Techniques for managing state changes of a data storage system utilizing the object oriented paradigm
CN101206692B (en) Method and equipment for detecting course
CN1223947C (en) Safe memory element and its manufacture
Huebner et al. Data hiding in the NTFS file system
CN1095115C (en) Apparatus for detecting and executing traps in a superscalar processor
CN1110065A (en) Document framework system
JP3180038B2 (en) Method and system for mass storage device configuration management
CN1760875A (en) Transparent migration of files among various types of storage volumes based on file access properties
CN101067835A (en) Trusted platform module data harmonization method and data processing system
JP2001142751A (en) Method and device for data base management and storage medium with recorded database managing program
CN101183418A (en) Windows concealed malevolence software detection method
CN101154185A (en) Method for performing recovery and playback when running software
CN110891000A (en) GPU bandwidth performance detection method, system and related device
US6513133B1 (en) Uniformly distributed induction of exceptions for testing computer software
CN1073724C (en) Method for maintaining memory of computer
JP2007206068A (en) System and method for accumulating summary of test data
CN117112522A (en) Concurrent process log management method, device, equipment and storage medium
CN1581100A (en) Data aging method for network processor
US5898875A (en) Method and computer system for loading objects
JPS63500547A (en) Circular context addressable memory
CN103049372A (en) Maintaining method of computer memory

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C53 Correction of patent for invention or patent application
COR Change of bibliographic data

Free format text: CORRECT: APPLICANT; FROM: SHENZHEN HUAWEI TECHNOLOGY CO., LTD TO: HUAWEI TECHNOLOGY CO., LTD.

CP03 Change of name, title or address

Address after: Guo Shizhan, Department of intellectual property, HUAWEI Technology Co., Ltd., HUAWEI Service Center building, road, Shenzhen science and Technology Park, Zhejiang Province

Applicant after: Huawei Technologies Co., Ltd.

Address before: Shenzhen, Guangdong science and Technology Park, HUAWEI road service building, Guo Xiang, turn

Applicant before: Huawei Technology Co., Ltd., Shenzhen City

C14 Grant of patent or utility model
GR01 Patent grant
CX01 Expiry of patent term
CX01 Expiry of patent term

Granted publication date: 20011024

DD01 Delivery of document by public notice
DD01 Delivery of document by public notice

Addressee: Huawei Technologies Co., Ltd.

Document name: Notification of Expiration of Patent Right Duration