[go: up one dir, main page]

CN100343826C - Method for implementing memory management - Google Patents

Method for implementing memory management Download PDF

Info

Publication number
CN100343826C
CN100343826C CNB031230490A CN03123049A CN100343826C CN 100343826 C CN100343826 C CN 100343826C CN B031230490 A CNB031230490 A CN B031230490A CN 03123049 A CN03123049 A CN 03123049A CN 100343826 C CN100343826 C CN 100343826C
Authority
CN
China
Prior art keywords
queue
memory
data
idle
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 - Fee Related
Application number
CNB031230490A
Other languages
Chinese (zh)
Other versions
CN1542623A (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 CNB031230490A priority Critical patent/CN100343826C/en
Publication of CN1542623A publication Critical patent/CN1542623A/en
Application granted granted Critical
Publication of CN100343826C publication Critical patent/CN100343826C/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明公开了一种实现内存管理的方法,该方法将内存划分为多个固定空间的内存块,并申请管理该内存块的缓冲区描述符(BD),与外界通信的数据处理程序将需要处理的数据保存在BD对应的内存块中,并通过数据处理程序处理该数据,再将处理后的数据通过与外界通信的数据处理程序发送出去。本发明解决了现有技术动态管理内存时内存地址不固定和静态管理内存时不能对内存空间统一管理的问题,实现了对内存空间的统一管理,且该统一管理对于软件系统来说是透明的,软件系统可以通过从固定地址获取全局变量来得知系统运行情况。

The invention discloses a method for realizing memory management. The method divides the memory into a plurality of memory blocks with a fixed space, and applies for managing the buffer descriptor (BD) of the memory block. The data processing program communicating with the outside will need The processed data is stored in the memory block corresponding to the BD, and the data is processed through the data processing program, and then the processed data is sent out through the data processing program communicating with the outside world. The present invention solves the problems in the prior art that the memory address is not fixed when the memory is managed dynamically and the memory space cannot be managed uniformly when the memory is managed statically, and realizes the unified management of the memory space, and the unified management is transparent to the software system , the software system can know the system operation status by obtaining global variables from fixed addresses.

Description

A kind of method that realizes memory management
Technical field
The present invention relates to memory management technology, relate to a kind of method that realizes memory management or rather.
Background technology
Internal memory is the important hardware device of computer products, and software systems realize that various functions all be unable to do without and internally deposit into row read-write.At present industry realizes by operating system the management of internal memory, so software systems all will depend on operating system when using internal memory.Operating system can be divided into two kinds of dynamic management and static managements to the management of internal memory.
At present operating system mainly is dynamic management to the management of internal memory, and software systems are by calling space application function when the operating system application internal memory, and operating system dynamically is this software systems storage allocation.From user's angle, this operating system based on dynamic management is at random to the distribution of internal memory, does not have the rule that can follow, and promptly the operating system storage allocation is transparent for the user.Based on such dynamic management, software systems need not be concerned about how operating system distributes and managing internal memory in the process that realizes its application, the method of operating system dynamic management internal memory also makes software systems can't know the administrative situation of system to internal memory, therefore the software systems memory address space that when using internal memory, can only rely on operating system fully and provided, when therefore operating system goes wrong, software systems often can't be learnt this situation, still search information according to original memory address, and owing to the information in this internal memory may not exist, therefore can cause the software systems fluctuation of service, even collapse.And, because all Memory Allocation all are at random, so the memory address of the employed global variable of software systems can not be a fixed address just, also just can not be by directly visiting the value that known memory address obtains global variable, when making operating system or operation exception of software system, be difficult to locate exactly the problem that is occurred.
The scheme of operating system static management internal memory is applied in the function realization aspect of bottom hardware mostly, this static management is that absolute internal memory is set in operating system, such as the pci bus property register or the chip interrupt register of chip are set, software systems are visible to the use of memory headroom, and software systems directly conduct interviews to the address of absolute internal memory in the operating system space.This visit is dispersed basically, generally all is independent visit, promptly only visits a fixed address at every turn.In this technical scheme to the internal memory static management, though software systems can realize the direct visit to the fixed memory address space, need dynamically apply for the problem of memory headroom when not having dynamic access by operating system, but this scheme does not propose the method that operating system is carried out unified management to memory headroom, is not the EMS memory management process of an independence, sealing therefore.
In sum, in the method for existing these two kinds of operating systems to memory management, because dynamic management is the Random assignment address, therefore the memory address of the employed global variable of software systems is unfixing, can not directly visit the value of global variable by known memory address, if program run is unusual, often be difficult to locate exactly the problem that is occurred; The static management method does not have the method for proposition to the memory headroom unified management, so it is not the EMS memory management process of an independence, sealing.
Summary of the invention
In view of this, fundamental purpose of the present invention is to provide a kind of method that realizes memory management, makes when guaranteeing that software systems can be used the fixed address internal memory, internally deposits into capable unified management.
For reaching above purpose, technical scheme of the present invention is achieved in that a kind of method that realizes memory management, and this method may further comprise the steps at least:
A. from internal memory, divide the datarams space be used for the storing software system data, and be the memory block of an above fixed size the datarams spatial division, corresponding each memory block application buffer descriptor (BD), all BD constitute idle BD formation;
B. the data processor of communicating by letter with the external world has judged whether that data need to receive, if having, then applies for BD from idle BD formation, stores data in the corresponding internal memory of this BD, and this BD is formed BD reception formation, enters next step afterwards, otherwise returns step b;
C. judge that BD receives formation and whether has the data of BD correspondence to need to handle, if have, judge further then whether the data of BD correspondence in the BD reception formation need to reply, if desired, response message after then will handling is kept in the corresponding internal memory of this BD, and, enter steps d afterwards, if do not need this BD composition BD transmit queue, then handle these data, and this BD sent to idle BD formation, otherwise, step c returned;
D. judge whether the BD transmit queue has the data of BD correspondence to need to handle, if having, then the data with this BD correspondence send, and the BD of free time is sent to idle BD formation, otherwise return steps d.
Among the described step a, comprise among the described BD that forwarding pointer, back preserve the data length of data in the memory address of the corresponding internal memory of pointer, BD and this internal memory, the BD in the formation manages by the data structure of double linked list.
Further comprise that the forwarding pointer among the initialization BD, back are preserved the data length of data before the described step b in the memory address of pointer, the corresponding internal memory of BD and this internal memory.
When treatments B D, the data length of data is preserved in the forwarding pointer, the back that are provided with among the current treatments B D in pointer and this internal memory.
Described idle BD formation, BD receive formation and the BD transmit queue meets first in first out.
Described BD receives in the formation first BD pointer and tail BD pointer is set, first BD pointer and tail BD pointer are set in the described BD transmit queue, receiving BD that the first BD pointer of formation will receive data by BD joins BD and receives formation, and from the BD transmit queue, obtain BD by the tail BD pointer of BD transmit queue, the tail BD pointer that receives formation by BD receives to obtain the formation from BD needs the BD that handles, and the BD after will handling by the first BD pointer of BD transmit queue sends to the BD transmit queue.
This method further comprises, applies for idle BD more than one, that be used as default BD in advance from idle BD formation,
The data storage that will need among the described step b to receive in this default BD, and described step b after further comprise,
B1. application is used as the idle BD of default BD from idle BD formation, and judges whether default BD is less than the number of the default BD of pre-first to file, if be less than, then returns step b1, otherwise, enter step c.
Among the described step c, when in the internal memory of original BD correspondence, preserving the response message after handling, judge whether the internal memory of original BD correspondence is enough,, then directly this BD is formed the BD transmit queue if just in time enough; If not enough, then from idle BD formation, apply for BD, in the corresponding internal memory of the BD that is applied for, preserve response message, and this BD is sent to the BD transmit queue; If idle BD is arranged, then should send to idle BD formation by free time BD, and the BD of response message correspondence is sent to the BD transmit queue.
This method may further include, and divides the static memory space that is used to store global variable and memory management data from internal memory.
This method may further include, foundation comprises BD idle more than and meets the BD extracting formation of first in first out, and the global variable pointer that this BD of record grasps the first BD of formation is set, by the global variable pointer data that BD receives in the corresponding internal memory of BD in formation or the BD transmit queue are grasped the first BD of formation from BD, copy to successively in the internal memory of BD correspondence that BD grasps formation.
This method can further include, and be provided for adding up the global variable of BD number in idle BD formation, BD reception formation or the BD transmit queue, and described initialization further comprises the initialization global variable.
This method can further include, and the sub-services program is set, and after handling the sub-services program, to the BD of idle BD formation application free time, the data storage that processing is obtained and sends to the BD transmit queue with this BD in the internal memory of BD correspondence.The present invention has following effect:
1) by from internal memory, marking off the datarams space of storing software system data, with this datarams spatial division memory block that is a plurality of fixed sizes, and the BD of corresponding each memory block is set, guarantee to provide the memory headroom of fixed address according to the data of software systems, and by the management of BD being realized unified management, and be transparent for software systems to the management of memory headroom to memory headroom.
2) by from internal memory, marking off the static memory space of storage global variable and memory management data, make software systems obtain global variable, therefore can obtain the reason etc. of software systems operation troubles according to global variable from fixed address.
3), make software systems learn the operating position of BD by calling this global variable by the global variable of BD number in the dynamic statistics BD formation is set.
4) grasp formation by setting up BD, and the global variable pointer that this BD of record grasps the first BD of formation position is set, be implemented in when the data in the corresponding internal memory of BD are checked, do not influence the processing of these data.
Description of drawings
Fig. 1 is the management synoptic diagram of the internal storage management system of present embodiment to the memory headroom after dividing;
Fig. 2 is the process flow diagram that the internal storage management system of present embodiment is realized memory management;
Fig. 3 is the synoptic diagram that BD grasps formation in the present embodiment.
Embodiment
Below in conjunction with drawings and the specific embodiments the present invention program is described in further detail.
The present invention is by the management of internal storage management system realization to internal memory, and the data processor and the data processor that are specially by communicating by letter with the external world internally deposit into line pipe reason, these two drivers that program is an internal storage management system.This internal storage management system can be independent of operating system, and software systems directly can realize read-write to internal memory by this internal storage management system.
Present embodiment is at first divided a block space and is used to store global variable and memory management data from internal memory, this segment space is called the static memory space, divide another part space and be used to store the data that various software programs form in the process of implementation, this segment space is called the datarams space, and the memory block that is a plurality of fixed sizes with this datarams spatial division further, the size of dividing memory block is as the criterion can preserve data.By such setting, software systems can obtain the health information of native system by the fixing memory address of visit, even problems such as these software systems hinder for some reason are out of service, as long as can access memory, also can from memory management data and global variable, obtain the key message that goes wrong.
Also to set the global variable relevant as required, and from operating system, apply for data structure as BD with this internal storage management system.The BD that is applied for is corresponding one by one with the memory block in datarams space, comprise among the BD that forwarding pointer (pstPre), back are to pointer (pstNext), memory address (udwAddress) and four fields of data length (udwDataLength), pstPre is used to identify the previous BD of this BD, pstNext is used to identify the back BD of this BD, udwAddress is used to identify the address of the pairing memory headroom of this BD, the length of data in the memory headroom of this BD correspondence of storage among the udwDataLength.
Internal storage management system is received formation, BD transmit queue, space application function, is formed with extraneous data processor and data processor of communicating by letter by idle BD formation, BD.Idle BD formation is made of all idle BD; BD receives formation and is made up of according to the formed BD of data that the external world transmits into the data processor of communicating by letter with the external world; The BD transmit queue is made up of according to the formed BD of data after handling data processor.Software program uses internal memory by space application function.The data processor of communicating by letter with the external world receives the data that executable program need be preserved, and the data after will handling send to executable program.Data processor is handled the data in the corresponding internal memory of BD.
Idle BD formation, BD reception formation and BD transmit queue all meet the principle of first in first out (FIFO, First In First Out), and the BD in each formation manages by the data structure of double linked list.Receive the first BD pointer and the tail BD pointer that points to from this rear of queue BD that is provided with the first BD of this formation of sensing in formation and the BD transmit queue respectively at BD, receive formation for BD, the BD that the data processor of communicating by letter with the external world will receive data by first BD pointer joins BD and receives in the formation, and data processor receives from BD by tail BD pointer and obtains the BD that needs processing the formation; For the BD transmit queue, BD after data processor will be handled by the first BD pointer of BD transmit queue sends to the BD transmit queue, and the data processor of communicating by letter with the external world sends to the external world by the tail BD pointer of BD transmit queue with the data in the corresponding internal memory of BD.
Referring to Fig. 1, corresponding management flow chart is referring to Fig. 2 to the management of the memory headroom after dividing for this internal storage management system, the corresponding following steps of its management process:
A. internal storage management system is carried out initialization.
This initialization comprises to the initialization of global variable in operating system and this internal storage management system with to the initialization of BD.During initialization BD, all BD of initialization one by one, initialization BD comprises pstPre, pstNext, udwAddress and the udwDataLength among this BD of initialization.During initialization udwAddress, be the start address of its representative internal memory of record in udwAddress, in a single day this address is set, and then later software systems are only operated the data of searching in the internal memory by this value being carried out " reading ".
B. several idle BD of the pre-first to file of the data processor of communicating by letter with the external world are as default BD.
The number of the default BD that is applied for is fixed, and is as the criterion with enough deal with data when setting.Default BD in this handling procedure of present embodiment is set to 3.
C. the data processor of communicating by letter with the external world has judged whether that data need to receive, if having, then enters next step, otherwise, return step c.
The data processor of communicating by letter with the external world may be that the situation according to timer in the system or interruption has judged whether that the data needs receive, and also may be to have judged whether that according to whether having the message needs to handle the data needs receive.
D. the data processor of communicating by letter with the external world with this data storage in the corresponding internal memory of the BD of pre-first to file, and udwDataLength, pstPre and pstNext among this BD be set, afterwards this BD is sent to BD and receive formation, and whether the idle BD that determining step b is applied for is enough, if enough, then enter next step, if not enough, then, return steps d to the BD of idle BD formation application free time.
F. the data processor of communicating by letter with the external world is applied for idle BD from idle BD formation, and this free time, BD added in this handling procedure, and judges that whether default BD in this handling procedure is less than 3 that set among the step b, if less than, then return step f, otherwise, next step entered.
G. data processor receives formation by first in first out inquiry BD, judges that the data whether the BD correspondence is wherein arranged need to handle, if having, then enters next step, otherwise, return step g.
H. data processor judges according to first in first out whether the data of BD correspondence in the BD reception formation need to reply, and if desired, then enter i, otherwise, enter step j.
I. the memory headroom of multiplexing this BD correspondence of data processor, the reply data that forms is kept in this memory headroom, and this BD sent to the BD transmit queue, and judge whether this memory headroom is enough, if it is just in time enough, then enter step k, if idle BD is arranged, then with the pstPre among the idle BD, pstNext and udwDataLength put 0, and should send to idle BD formation by free time BD, enter step k afterwards, if Insufficient memory usefulness is then applied for idle BD as required, and preserve data in the internal memory of this free time BD correspondence from idle BD formation, and the BD after will handling sends to the BD transmit queue, enters step k afterwards.
J. data processor is after executing corresponding operation, and pstPre, the pstNext and the udwDataLength that BD are received BD in the formation put 0, and this BD is sent in the idle BD formation.
K. the data processor of communicating by letter with the external world judges wherein whether have the corresponding data of BD to need to send, if having, then the data with this BD correspondence send by inquiry BD transmit queue, and the BD after will handling puts back to idle BD formation, otherwise, return step k.
Based on internal storage management system of the present invention, software systems are applied for function to operating system application internal memory by the space that this system provides when access memory, and internal storage management system is then handled by above step.
Because the limited amount of each data that send in the ambient systems, present embodiment with data processor that the external world communicates by letter in 3 BD setting in advance enough certainly, and the memory headroom of each BD correspondence is also enough placed data, so can simplify processing to said process, promptly the data processor of communicating by letter with the external world does not need to judge whether its BD that sets in advance is enough, data processor directly is kept at these data in the internal memory of this BD correspondence after handling the BD corresponding data, and does not need to judge whether the internal memory of this BD correspondence is enough again.
Idle BD formation, BD reception formation and BD transmit queue have only been set up in the present embodiment, the BD formation that can also set up other as required.Such as, for being implemented in the system applies process message of handling is observed, do not influence the normal process of this message simultaneously again, therefore can set up BD and grasp formation, this BD grasps formation need meet the FIFO principle equally.Referring to Fig. 3, it is several BD of application from idle BD formation that this BD grasps formation, and these BD are formed a belt chained list, selects one of them BD as first BD, and the position of this BD of global variable pointer record is set.If there is message to enter message sink formation or BD transmit queue, then can from the pairing internal memory of BD of BD reception formation or BD transmit queue, obtain data successively by this global variable pointer, and grasp the first BD of formation from BD, data are copied to successively in the pairing internal memory of BD of BD extracting formation, and record is correlated with in each BD pstPre, pstNext and udwDataLength.Understand the actual content of message again by the data in the corresponding internal memory of BD of checking BD extracting formation.
Can also set the global variable of each the BD formation BD number that is used for adding up this internal storage management system as required, by the current BD number of this each formation of global variable dynamic statistics, software systems can be learnt the operating position of BD by calling this global variable.
Can also carry out the function expansion to the data handling procedure, the sub-services program promptly is set in data processor as required, data processor is after handling the sub-services program, and to the BD of idle BD formation application free time, and the data storage that processing is obtained is in the internal memory of BD correspondence.Be example so that a system clock to be set below.
Internal storage management system can periodically be notified " heartbeat " of native system to outside software systems in application process if desired, a system clock then can be set, this system clock produced once every one second and interrupts, to should an interrupt service routine being set clock in data processor, data processor is after handling this interrupt service routine, can produce need be to the data of outside software systems transmission, therefore data processor is to the BD of idle BD formation application free time, the data that processing is obtained are kept in the internal memory of this free time BD correspondence, and this BD is sent to the BD transmit queue.
The direct characteristics of access memory of software systems when the inventive method combines the transparency of existing operating system dynamic management internal memory and static management internal memory, and can carry out unified management to memory headroom.Concerning software systems, the memory headroom management that this internal storage management system and traditional operating system provide all is transparent from the angle of software systems, can obtain the memory headroom that software systems need by calling corresponding space application function simply; But from native system can check internal memory operation conditions and BD formation operating position, can check important global variable by the address of appointment, can under the situation that does not influence software flow, check the angle of the data the corresponding internal memory of BD, be again visible, non-well-illuminated.

Claims (12)

1、一种实现内存管理的方法,其特征在于该方法至少包括以下步骤:1. A method for implementing memory management, characterized in that the method at least includes the following steps: a.从内存中划分用于存储软件系统数据的数据内存空间,并将数据内存空间划分为一个以上固定大小的内存块,对应每个内存块申请缓冲区描述符BD,所有BD构成空闲BD队列;a. Divide the data memory space used to store software system data from the memory, and divide the data memory space into more than one fixed-size memory block, apply for a buffer descriptor BD corresponding to each memory block, and all BDs form an idle BD queue ; b.与外界通信的数据处理程序判断是否有数据需要接收,如果有,则从空闲BD队列中申请BD,在该BD对应内存中存储数据,并把该BD组成BD接收队列,之后进入下一步,否则返回步骤b;b. The data processing program communicating with the outside world judges whether there is data to be received, and if so, applies for a BD from the idle BD queue, stores data in the corresponding memory of the BD, and forms the BD into a BD receiving queue, and then enters the next step , otherwise return to step b; c.判断BD接收队列是否有BD对应的数据需要处理,如果有,则进一步判断BD接收队列中BD对应的数据是否需要应答,如果需要,则将处理后的应答信息保存在该BD对应内存中,并把该BD组成BD发送队列,之后进入步骤d,如果不需要,则处理该数据,并将该BD发送到空闲BD队列,否则,返回步骤c;c. Determine whether the BD receiving queue has data corresponding to the BD that needs to be processed. If so, further judge whether the data corresponding to the BD in the BD receiving queue needs to be responded. If so, save the processed response information in the corresponding memory of the BD , and form the BD into a BD sending queue, then enter step d, if not needed, process the data, and send the BD to an idle BD queue, otherwise, return to step c; d.判断BD发送队列是否有BD对应的数据需要处理,如果有,则将该BD对应的数据发送出去,并将空闲的BD发送到空闲BD队列,否则返回步骤d。d. Determine whether the BD sending queue has data corresponding to the BD to be processed, if so, send the data corresponding to the BD, and send the idle BD to the idle BD queue, otherwise return to step d. 2、根据权利要求1所述的方法,其特征在于所述步骤a中,所述BD中包括前向指针、后向指针、BD对应内存的内存地址及该内存中保存数据的数据长度,队列中的BD通过双链表的数据结构进行管理。2. The method according to claim 1, characterized in that in said step a, said BD includes a forward pointer, a backward pointer, the memory address of the memory corresponding to the BD and the data length of the data stored in the memory, and the queue The BD in is managed through the data structure of double linked list. 3、根据权利要求2所述的系统,其特征在于,所述步骤b之前进一步包括,初始化BD中的前向指针、后向指针、BD对应内存的内存地址及该内存中保存数据的数据长度。3. The system according to claim 2, characterized in that before the step b, it further includes initializing the forward pointer and backward pointer in the BD, the memory address of the memory corresponding to the BD, and the data length of the data stored in the memory . 4、根据权利要求2所述的方法,其特征在于,在处理BD时,设置当前处理BD中的前向指针、后向指针及该内存中保存数据的数据长度。4. The method according to claim 2, characterized in that, when processing the BD, the forward pointer, the backward pointer and the data length of the data stored in the memory are set in the currently processed BD. 5、根据权利要求1所述的方法,其特征在于,所述空闲BD队列、BD接收队列和BD发送队列符合先进先出原则。5. The method according to claim 1, wherein the idle BD queue, BD receiving queue and BD sending queue conform to the first-in-first-out principle. 6、根据权利要求1所述的方法,其特征在于,所述BD接收队列中设置首BD指针和尾BD指针,所述BD发送队列中设置首BD指针和尾BD指针,通过BD接收队列的首BD指针将接收了数据的BD加入到BD接收队列,并通过BD发送队列的尾BD指针从BD发送队列中获取BD,通过BD接收队列的尾BD指针从BD接收队列中获取需要处理的BD,并通过BD发送队列的首BD指针将处理后的BD发送到BD发送队列。6. The method according to claim 1, characterized in that, the first BD pointer and the last BD pointer are set in the BD receiving queue, the first BD pointer and the last BD pointer are set in the BD sending queue, and through the BD receiving queue The first BD pointer adds the BD that has received the data to the BD receiving queue, and obtains the BD from the BD sending queue through the tail BD pointer of the BD sending queue, and obtains the BD that needs to be processed from the BD receiving queue through the tail BD pointer of the BD receiving queue , and send the processed BD to the BD sending queue through the head BD pointer of the BD sending queue. 7、根据权利要求1所述的方法,其特征在于该方法进一步包括,预先从空闲BD队列中申请一个或以上的、用作预设BD的空闲BD,7. The method according to claim 1, characterized in that the method further comprises: pre-applying for one or more idle BDs used as preset BDs from the idle BD queue, 所述步骤b中将需要接收的数据存储到该预设BD中,且所述步骤b之后进一步包括,In the step b, the data to be received is stored in the preset BD, and after the step b, it further includes, b1.从空闲BD队列中申请用作预设BD的空闲BD,并判断预设BD是否少于预先申请的预设BD的个数,如果少于,则返回步骤b1,否则,进入步骤c。b1. Apply for an idle BD used as a preset BD from the idle BD queue, and judge whether the preset BD is less than the number of pre-applied preset BDs, if less, return to step b1, otherwise, enter step c. 8、根据权利要求1所述的方法,其特征在于所述步骤c中,在原有BD对应的内存中保存处理后的应答信息时,判断原有BD对应的内存是否够用,如果正好够用,则直接把该BD组成BD发送队列;如果不够用,则从空闲BD队列中申请BD,在所申请的BD对应内存中保存应答信息,并将该BD发送到BD发送队列;如果有空闲的BD,则将该空闲BD发送到空闲BD队列,并将应答信息对应的BD发送到BD发送队列。8. The method according to claim 1, characterized in that in the step c, when storing the processed response information in the memory corresponding to the original BD, it is judged whether the memory corresponding to the original BD is sufficient, if it is just enough , then directly form the BD into the BD sending queue; if not enough, apply for a BD from the idle BD queue, save the response information in the memory corresponding to the applied BD, and send the BD to the BD sending queue; if there is an idle BD, send the idle BD to the idle BD queue, and send the BD corresponding to the response information to the BD sending queue. 9、根据权利要求1所述的方法,其特征在于该方法进一步包括,从内存中划分用于存储全局变量和内存管理数据的静态内存空间。9. The method according to claim 1, characterized in that the method further comprises dividing the static memory space for storing global variables and memory management data from the memory. 10、根据权利要求1所述的方法,其特征在于该方法进一步包括,建立包括一个以上空闲的BD、且符合先进先出原则的BD抓取队列,并设置记录该BD抓取队列首BD的全局变量指针,通过全局变量指针将BD接收队列或BD发送队列中BD对应内存中的数据从BD抓取队列的首BD开始,依次复制到BD抓取队列的BD对应的内存中。10. The method according to claim 1, characterized in that the method further comprises: establishing a BD capture queue that includes more than one idle BD and conforming to the first-in-first-out principle, and setting a record to record the BD capture queue head BD The global variable pointer is used to copy the data in the memory corresponding to the BD in the BD receiving queue or the BD sending queue from the first BD of the BD grabbing queue to the corresponding memory of the BD in the BD grabbing queue through the global variable pointer. 11、根据权利要求3所述的方法,其特征在于该方法进一步包括,设置用于统计空闲BD队列、BD接收队列或BD发送队列中BD数目的全局变量,且所述初始化进一步包括初始化全局变量。11. The method according to claim 3, characterized in that the method further includes setting a global variable for counting the number of BDs in the idle BD queue, BD receiving queue or BD sending queue, and the initialization further includes initializing the global variable . 12、根据权利要求1所述的方法,其特征在于该方法进一步包括,设置子服务程序,在处理子服务程序后,向空闲BD队列申请空闲的BD,将处理得到的数据存储在BD对应的内存中,并将该BD发送到BD发送队列。12. The method according to claim 1, characterized in that the method further includes setting a sub-service program, applying for an idle BD to the idle BD queue after processing the sub-service program, and storing the processed data in the corresponding BD memory, and send the BD to the BD sending queue.
CNB031230490A 2003-04-29 2003-04-29 Method for implementing memory management Expired - Fee Related CN100343826C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB031230490A CN100343826C (en) 2003-04-29 2003-04-29 Method for implementing memory management

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB031230490A CN100343826C (en) 2003-04-29 2003-04-29 Method for implementing memory management

Publications (2)

Publication Number Publication Date
CN1542623A CN1542623A (en) 2004-11-03
CN100343826C true CN100343826C (en) 2007-10-17

Family

ID=34321193

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB031230490A Expired - Fee Related CN100343826C (en) 2003-04-29 2003-04-29 Method for implementing memory management

Country Status (1)

Country Link
CN (1) CN100343826C (en)

Families Citing this family (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100361093C (en) * 2004-12-07 2008-01-09 华为技术有限公司 A method for using a cache area in a processor
CN100412800C (en) * 2004-12-25 2008-08-20 鸿富锦精密工业(深圳)有限公司 A method for managing network server memory
CN100361094C (en) * 2005-07-01 2008-01-09 华为技术有限公司 A Method of Saving Global Variable Memory Space
CN100462940C (en) * 2007-01-30 2009-02-18 金蝶软件(中国)有限公司 Method and apparatus for cache data in memory
CN101079015B (en) * 2007-06-28 2012-01-04 杭州华三通信技术有限公司 Data transmission method and system
CN101442458B (en) * 2007-11-23 2011-03-23 深圳富泰宏精密工业有限公司 System and method for sending sequence type data
CN101188560B (en) * 2007-12-18 2010-04-21 杭州华三通信技术有限公司 Method and device for dynamically detecting forward capability
CN101459599B (en) * 2008-10-30 2011-04-06 北京闪联互动网络科技有限责任公司 Method and system for implementing concurrent execution of cache data access and loading
CN101694639B (en) * 2009-10-15 2011-06-01 清华大学 Computer data caching method
CN101876922B (en) * 2009-10-30 2012-12-19 北京锐安科技有限公司 Method for improving system stability
JP4987997B2 (en) * 2010-02-26 2012-08-01 株式会社東芝 Memory system
CN103678161B (en) * 2012-09-06 2016-08-03 中兴通讯股份有限公司 EMS memory management process and device
CN103218176B (en) * 2013-04-02 2016-02-24 中国科学院信息工程研究所 Data processing method and device
CN103596067B (en) * 2013-11-26 2017-12-12 深圳创维数字技术有限公司 A kind of TV program transmission method and device based on HTTP real-time stream media protocols
CN103685068B (en) * 2013-12-06 2016-08-17 杭州华三通信技术有限公司 Receive buffer descriptor queues maintaining method and equipment
CN103685063B (en) * 2013-12-06 2016-08-17 杭州华三通信技术有限公司 Receive buffer descriptor queues maintaining method and equipment
CN108259380A (en) * 2017-12-21 2018-07-06 安凯(广州)微电子技术有限公司 Method, system and the ethernet controller of Frame processes
CN109471731A (en) * 2018-11-21 2019-03-15 阿里巴巴集团控股有限公司 A kind of data processing, EMS memory management process, device, equipment and medium
CN113312278B (en) * 2021-07-29 2021-11-05 常州楠菲微电子有限公司 Device and method for statically allocating shared multi-queue cache
CN113411237B (en) * 2021-08-18 2021-11-30 成都丰硕智能数字科技有限公司 Method, storage medium and system for detecting terminal state with low delay
CN116820785B (en) * 2023-08-30 2024-01-02 紫光同芯微电子有限公司 Method and device for managing memory, resource-constrained device and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0456275A2 (en) * 1990-05-11 1991-11-13 Fujitsu Limited A static memory allocation system
WO1994002898A1 (en) * 1992-07-24 1994-02-03 Microsoft Corporation Computer method and system for allocating and freeing memory
US5420999A (en) * 1992-03-27 1995-05-30 International Business Machines Corporation Free memory cell management
US5784699A (en) * 1996-05-24 1998-07-21 Oracle Corporation Dynamic memory allocation in a computer using a bit map index
CN1378143A (en) * 2001-03-30 2002-11-06 深圳市中兴通讯股份有限公司 Method for realizing quick data transfer
CN1393780A (en) * 2001-06-28 2003-01-29 华为技术有限公司 Adaptive dynamic memory management method

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0456275A2 (en) * 1990-05-11 1991-11-13 Fujitsu Limited A static memory allocation system
US5420999A (en) * 1992-03-27 1995-05-30 International Business Machines Corporation Free memory cell management
WO1994002898A1 (en) * 1992-07-24 1994-02-03 Microsoft Corporation Computer method and system for allocating and freeing memory
US5784699A (en) * 1996-05-24 1998-07-21 Oracle Corporation Dynamic memory allocation in a computer using a bit map index
CN1378143A (en) * 2001-03-30 2002-11-06 深圳市中兴通讯股份有限公司 Method for realizing quick data transfer
CN1393780A (en) * 2001-06-28 2003-01-29 华为技术有限公司 Adaptive dynamic memory management method

Also Published As

Publication number Publication date
CN1542623A (en) 2004-11-03

Similar Documents

Publication Publication Date Title
CN100343826C (en) Method for implementing memory management
US20180285414A1 (en) Database management system cluster node subtasking data query
US8276154B2 (en) Hash partitioning streamed data
CN1201244C (en) Method and device for co-operation agency system for target intensifying effect distribution arrangement
WO2019114128A1 (en) Block chain transaction block processing method, electronic device and readable storage medium
US5961606A (en) System and method for remote buffer allocation in exported memory segments and message passing between network nodes
CN1295621C (en) System and method for high-speed buffer storing applied data in oporating system in-kernel environment
WO2021244155A1 (en) Inter-process communication method and inter-process communication apparatus
CN1643499A (en) Thread signaling in multi-threaded network processor
US20220129464A1 (en) Re-ordered processing of read requests
CN1507594A (en) Selection of resource in a distributed computer system
CN115525417A (en) Data communication method, communication system, and computer-readable storage medium
US20240403124A1 (en) Divided main memory with computing device memory section and database memory section
WO2017086987A1 (en) In-memory data shuffling
GB2555682A (en) Repartitioning data in a distributed computing system
US20170018050A1 (en) Communication between integrated graphics processing units
CN116155828A (en) Message order keeping method and device for multiple virtual queues, storage medium and electronic equipment
US8145774B2 (en) Progressively accessing data blocks related to pages
CN116383240A (en) FPGA-based multi-database accelerated query method, device, equipment and medium
CN1295613C (en) Method for general windows program to operate journal information record
US11249916B2 (en) Single producer single consumer buffering in database systems
CN105721338B (en) A kind of processing method and processing device receiving data
US9665519B2 (en) Using a credits available value in determining whether to issue a PPI allocation request to a packet engine
CN1764905A (en) Method of addressing data in a shared memory by means of an offset
CN1645351A (en) Method for transferring data in a multiprocessor system, multiprocessor system and processor carrying out this 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
C14 Grant of patent or utility model
GR01 Patent grant
C17 Cessation of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20071017

Termination date: 20130429