CN1691637A - Method of data packet storage in communication equipment - Google Patents
Method of data packet storage in communication equipment Download PDFInfo
- Publication number
- CN1691637A CN1691637A CNA2004100349574A CN200410034957A CN1691637A CN 1691637 A CN1691637 A CN 1691637A CN A2004100349574 A CNA2004100349574 A CN A2004100349574A CN 200410034957 A CN200410034957 A CN 200410034957A CN 1691637 A CN1691637 A CN 1691637A
- Authority
- CN
- China
- Prior art keywords
- packet
- memory block
- size
- space
- communication equipment
- 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
Links
Images
Abstract
The invention relates to communication technique and discloses a storage method for data packet in communication device, can make good use of memory resource and improve stability and impact resistance of system. The method comprises follows steps: A. Pre-reserves first and second space in communication device memory, divides the first space into multiple fixed-size memory block and second space into memory block of one type of size; B. Decides whether its size overrun the threshold when receiving data packet; if yes then access to step C, or else to step D; C. In the second space, assign one or more empty memory block to data packet with entire size larger or equal to data packet; D. In the first space, assign one empty memory block to data packet with entire size larger or equal to data packet.
Description
Technical field
The present invention relates to the communication technology, particularly the memory technology of data in the communication equipment.
Background technology
Application in the multitask environment by a series of mutual independences again the task of collaborative work form.Communication in the system between the task is mainly finished by sending message.The carrier that message transmits is the message bag, and message bag described here is meant the internal storage location that is used to store message to be sent in the system.In order to adapt to the requirement of a plurality of tasks, will the give information management function of bag of system is as the configuration of message bag, application, release etc.
Specifically, above-mentioned message bag is must the careful valuable source of managing in the communication system.Though the memory size in the facility communication system is increasing now, even reach the several times of the calculator memory capacity of the early stage whole world maximum sixties, but the growth of the growth rate of program length and memory size is the same fast, and the message that beard and hair send between each task in the system is also more and more.Thereby, in a system, all need to carry out the management of message bag usually.The task of these management algorithms be follow the tracks of use those internal storage locations, which internal storage location free time, when needed be the role assignment message bag, use and finish back release message bag etc.
The quality of above-mentioned management method will directly influence the performance of real-time system of whole system-particularly.In a real-time system, but can not apply for the message bag fast and effectively when communicating by letter if desired, then can be very big influence real-time performance, even cause communication disruption.
On the other hand, at present can be divided into two classes: in run duration moves data between internal memory and disk system and the system that does not move to the management of memory.Why moving, is owing to lack the corresponding data of enough memory to a great extent.And the present invention at mainly be in the facility communication system, the Memory Allocation problem when sending message between task.Because this application is generally little to memory requirements, so need not move between internal memory and disk.
In the prior art, the message of carrying out in order to realize inter-task message to send in the facility communication system method that is responsible for assigning adopts single management method: message elements (UNIT) management method usually.In the method, with a lot of fixed sizes-be generally 128 bytes-internal storage location component units pond, application and releasing operation all are to be that unit carries out with continuous a plurality of internal storage locations that can satisfy user's size.For example, to send the message that size is 256 bytes in the supposing the system, search out continuous two internal storage locations within it during then system must deposit, distribute to this message then.The advantage of the method maximum is to realize simply, only needs few operation and overhead.
In actual applications, there is following problem in such scheme: on the one hand, the size of internal storage location is fixed as single value, is difficult to take into account the time and the space efficiency of various different application; On the other hand, after system's long-time running, big message bag and little message bag intersect, and constantly application discharges, and the suitable continuous a plurality of internal storage location efficient of search reduce in the time of can causing applying for, and are easy to generate fragment, cause some resources to be difficult to utilize again.
Cause the main cause of this situation to be that method is single, the internal storage location of single fixed size can only be provided; In the case, search that is provided and method for releasing inefficiency, and cause the wasting of resources and performance shakiness.
Summary of the invention
In view of this, main purpose of the present invention is to provide the storage means of packet in a kind of communication equipment, and the system that makes can make full use of memory source, improves the stability and the impact resistance of system.
For achieving the above object, the invention provides the storage means of packet in a kind of communication equipment, comprise following steps:
A reserves first space and second space in described communication device memory, and with described first spatial decomposition memory block that is the various fixed size, with described second spatial decomposition memory block that is a kind of identical size;
When B receives packet when described communication equipment, judge whether the size of this packet surpasses thresholding,, otherwise enter step D if then enter step C;
C distributes size of population to give described packet more than or equal to one of described packet size or continuous a plurality of idle condition memory block in described second space;
D distributes an idle condition memory block more than or equal to described packet size to give described packet in described first space.
Wherein, memory block big than memory block in described first space in described second space.
Also comprise following steps:
After the described communication equipment of E is handled described packet, the memory block of distributing to this packet is re-set as idle condition.
Described steps A also further comprises following substep:
To each big or small memory block, all memory blocks all are set to idle condition, use a chained list to preserve the position of all memory blocks that are in idle condition;
Described step C and D also further comprise following substep:
When being described allocation of packets behind the memory block, the memory block that is assigned with is set to busy state, and deletes the position of this memory block from described chained list;
Described step e also further comprises following substep:
After described memory block is re-set as idle condition, the position of these memory blocks is added described chained list.
Among the described step D, the described memory block that is assigned with is the memory block of approaching described packet of size.
Each big or small memory block number can be received the theoretical modeling value or the setting of actual count value of Various types of data bag quantity according to described communication equipment in described first space.
The size of memory block is equal to or greater than the highest packet size of frequency of utilization in the packet of described thresholding in described second space.
By relatively finding that technical scheme difference with the prior art of the present invention is, has used mixed method, little message bag is adopted block management method, according to single-track link table, sit in the right seat; Big message bag is adopted the Single Component Management method, and application and releasing operation all are to be that unit carries out with continuous a plurality of message elements that can satisfy user's size.
Difference on this technical scheme has brought comparatively significantly beneficial effect, promptly makes full use of memory source, has prevented the fragment generation; Strengthened the impact resistance of the stability of a system and long-time running simultaneously.
Description of drawings
Fig. 1 is the message according to an embodiment of the invention block management method flow process in the method that is responsible for assigning;
Fig. 2 is the message according to an embodiment of the invention Single Component Management method flow in the method that is responsible for assigning;
Fig. 3 is the be responsible for assigning workflow of mixed method in the method for message according to an embodiment of the invention.
Embodiment
For making the purpose, technical solutions and advantages of the present invention clearer, the present invention is described in further detail below in conjunction with accompanying drawing.
In general, principle of the present invention is to adopt a kind of message EMS memory management process of mixing, has promptly mixed block management (BLK_MANAGE) method and Single Component Management (UNIT_MANAGE) method.Two kinds of methods realize allocation manager at the message bag of the big or small type of difference.
Following elder generation illustrates the realization of two kinds of methods respectively, and then explanation the present invention two kinds of methods of integrated use how, thereby draws a kind of message method that is responsible for assigning.
At first, in the BLK_MANAGE method, application of message bag and releasing operation are that unit carries out with single block (BLK) all, each BLK piece constitutes a message bag alone, the BLK block type index of reference instrument of all identical sizes is managed, idle BLK piece is conspired to create a single-track link table, when distributing and discharge, only need once-through operation just passable like this.In this chained list, if a BLK piece is assigned with away, it will be marked as busy state, and delete from chained list; If a BLK piece is released, then will be marked as idle condition, and reenter chained list.
What deserves to be explained is that the prerequisite that this method is achieved is the size requirement of a BLK piece just can satisfy solicitation message of user the time, promptly the BLK piece should be more than or equal to message size, so be generally suitable for the application of little message bag; In addition, the BLK piece that is assigned with should be the most approaching BLK piece of waiting to send out message of size.Each system can be according to the quantity of BLK piece and each BLK piece of the pre-configured multiple size of actual conditions.Generally speaking, set BLK block size is suitable with system's message size commonly used.As a preferred embodiment of the present invention, be provided with the BLK piece that size is respectively 64 bytes, 128 bytes, 256 bytes, 512 bytes and 1024 bytes in the represented system of table one, the quantity of every kind of BLK piece is respectively 500,100,100,100 and 100.Those of ordinary skill in the art be appreciated that the size of set BLK piece and corresponding number thereof what do not influence the spirit and scope of the invention.
Table one
Every class piece memory size (byte) | Every class piece internal memory number |
????64 | ????500 |
????128 | ????100 |
????256 | ????100 |
????512 | ????100 |
????1024 | ????100 |
????2048 | ????2000 |
Realization below in conjunction with accompanying drawing 1 explanation BLK_MANAGE algoritic module 10: at first, in step 101, system allocates the internal memory BLK piece and the corresponding number thereof of different sizes in advance.As previously mentioned, what of the size of internal memory BLK piece and quantity thereof will be according to different system applies and different.
Then enter step 102, system sets up a single-track link table that points to idle block for each BLK piece, in this step, systemic presupposition the BLK piece of how many kinds of size just should set up what single-track link tables.
Enter step 103 at last, system, directly sits in the right seat by inquiring about corresponding chained list according to the size of message.Like this, save the generation of searching for the operation of idle packet and having prevented fragment, thereby improved the efficient and the real-time of system, particularly real-time system greatly.
The UNIT_MANAGE method then is described, it and original UNIT message elements management method are similar.It is based on the message elements pond, the distribution of message bag and to discharge all be based on continuous message elements.But it must reconfigure the message elements size according to actual needs.
What deserves to be explained is, this method mainly is to use when the big message bag of user applies, because little message bag can priority requisition arrive with the mode of BLK piece, so here the most frequently used big message bag size that arrives as the message elements size, make message elements of most of situation just constitute a message bag, special big bag just is made of a plurality of continuous meassages unit.Can improve the application efficient of big bag so greatly.
Realization below in conjunction with accompanying drawing 2 explanation UNIT_MANAGE algoritic modules 20:
At first, enter step 201, the size of systemic presupposition message elements and quantity thereof.As mentioned above, system as the message elements size, makes the most frequently used big message bag size that arrives message elements of most of situation just constitute a message bag.
Enter step 202 then, search can be satisfied one of user's size or continuous a plurality of message elements and distribute to the message bag.The application of message bag and to discharge all be to be unit with of can meet consumers' demand or continuous a plurality of message elements.The operation of this and prior art is similar.
It is to be noted, the classification of message bag size can be passed through the true environment test data, also can carry out theory analysis, thereby comprehensively both obtain the mode classification an of the best, comprise the number of classification, the size and the number of every class piece internal memory by application model.The difference of their numerical value can not influence the spirit and scope of the invention.
Below in conjunction with accompanying drawing 3 explanation the present invention two kinds of methods of integrated use how, thereby realize that message is responsible for assigning.
At first, enter step 301, two memory headrooms of system's preassignment are respectively applied for BLK_MANAGE method and UNIT_MANAGE method.Wherein, at the memory headroom that is used for the BLK_MANAGE method, system will distribute the BLK piece and the respective numbers thereof of different sizes according to practical application; At the memory headroom that is used for the UNIT_MANAGE method, system is with the size and the respective numbers thereof of presetting message unit.
Then, enter step 302, when a system sent information, whether it judged message size less than default thresholding earlier, if then enter step 303, otherwise enter step 304.The numerical value of this thresholding is default maximum BLK block size in the BLK_MANAGE method.
In step 303, enter BLK_MANAGE algoritic module 10, call the BLK_MANAGE method.Concrete steps are as described in the earlier drawings 1.
In step 304, enter UNIT_MANAGE algoritic module 20, call the UNIT_MANAGE method.Concrete steps are as described in the earlier drawings 2.
As a preferred embodiment of the present invention, in the listed system of table one, sending size if desired is the message of 256 bytes, then the BLK_MANAGE method will be called by system, size according to the message bag, find the pairing chained list of 256 byte message bags,, directly message is put into the idle message bag by inquiring about corresponding chained list; If described system need send the message that size is 4096 bytes, then the UNIT_MANAGE method will be called by system, search out two continuous message elements, and it is distributed to described message.
Though by reference some preferred embodiment of the present invention, the present invention is illustrated and describes, but those of ordinary skill in the art should be understood that, can do various changes to it in the form and details, and the spirit and scope of the present invention that do not depart from appended claims and limited.
Claims (7)
1. the storage means of packet in the communication equipment is characterized in that, comprises following steps:
A reserves first space and second space in described communication device memory, and with described first spatial decomposition memory block that is the various fixed size, with described second spatial decomposition memory block that is a kind of identical size;
When B receives packet when described communication equipment, judge whether the size of this packet surpasses thresholding,, otherwise enter step D if then enter step C;
C distributes size of population to give described packet more than or equal to one of described packet size or continuous a plurality of idle condition memory block in described second space;
D distributes an idle condition memory block more than or equal to described packet size to give described packet in described first space.
2. the storage means of packet is characterized in that in the communication equipment according to claim 1, memory block big than memory block in described first space in described second space.
3. the storage means of packet is characterized in that in the communication equipment according to claim 1, also comprises following steps:
After the described communication equipment of E is handled described packet, the memory block of distributing to this packet is re-set as idle condition.
4. the storage means of packet is characterized in that in the communication equipment according to claim 1, and described steps A also further comprises following substep:
To each big or small memory block, all memory blocks all are set to idle condition, use a chained list to preserve the position of all memory blocks that are in idle condition;
Described step C and D also further comprise following substep:
When being described allocation of packets behind the memory block, the memory block that is assigned with is set to busy state, and deletes the position of this memory block from described chained list;
Described step e also further comprises following substep:
After described memory block is re-set as idle condition, the position of these memory blocks is added described chained list.
5. the storage means of packet is characterized in that in the communication equipment according to claim 1, and among the described step D, the described memory block that is assigned with is the memory block of approaching described packet of size.
6. the storage means of packet in the communication equipment according to claim 1, it is characterized in that each big or small memory block number can be received the theoretical modeling value or the setting of actual count value of Various types of data bag quantity according to described communication equipment in described first space.
7. according to the storage means of packet in any described communication equipment in the claim 1 to 6, it is characterized in that the size of memory block is equal to or greater than the highest packet size of frequency of utilization in the packet of described thresholding in described second space.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNB2004100349574A CN100452761C (en) | 2004-04-27 | 2004-04-27 | Method of data packet storage in communication equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNB2004100349574A CN100452761C (en) | 2004-04-27 | 2004-04-27 | Method of data packet storage in communication equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN1691637A true CN1691637A (en) | 2005-11-02 |
CN100452761C CN100452761C (en) | 2009-01-14 |
Family
ID=35346772
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CNB2004100349574A Expired - Fee Related CN100452761C (en) | 2004-04-27 | 2004-04-27 | Method of data packet storage in communication equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN100452761C (en) |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101212451B (en) * | 2006-12-30 | 2010-10-13 | 北京天融信网络安全技术有限公司 | Firewall chip data packet buffer management method |
WO2012079423A1 (en) * | 2010-12-16 | 2012-06-21 | 中兴通讯股份有限公司 | Method and apparatus for data packet buffer management |
CN101630992B (en) * | 2008-07-14 | 2013-06-05 | 中兴通讯股份有限公司 | Method for managing shared memory |
WO2016082467A1 (en) * | 2014-11-24 | 2016-06-02 | 捷开通讯(深圳)有限公司 | Network-based file transfer method and system |
CN105704037A (en) * | 2015-12-31 | 2016-06-22 | 北京华为数字技术有限公司 | Table item storage method and controller |
CN111177017A (en) * | 2018-11-09 | 2020-05-19 | 炬芯(珠海)科技有限公司 | Memory allocation method and device |
CN113453276A (en) * | 2021-05-18 | 2021-09-28 | 翱捷科技股份有限公司 | Method and device for improving utilization rate of uplink and downlink memories of LTE terminal |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1181434C (en) * | 2001-06-28 | 2004-12-22 | 华为技术有限公司 | Adaptive dynamic memory management method |
CN1183453C (en) * | 2001-12-21 | 2005-01-05 | 上海贝尔有限公司 | Internal storage management system and its distribution method |
KR100474357B1 (en) * | 2001-12-26 | 2005-03-08 | 한국전자통신연구원 | A method for memory allocation using multi-level partition |
CN1307558C (en) * | 2001-12-29 | 2007-03-28 | 中兴通讯股份有限公司 | Virtual internal storage allocating and managing method of subsystem in communication system |
-
2004
- 2004-04-27 CN CNB2004100349574A patent/CN100452761C/en not_active Expired - Fee Related
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101212451B (en) * | 2006-12-30 | 2010-10-13 | 北京天融信网络安全技术有限公司 | Firewall chip data packet buffer management method |
CN101630992B (en) * | 2008-07-14 | 2013-06-05 | 中兴通讯股份有限公司 | Method for managing shared memory |
WO2012079423A1 (en) * | 2010-12-16 | 2012-06-21 | 中兴通讯股份有限公司 | Method and apparatus for data packet buffer management |
WO2016082467A1 (en) * | 2014-11-24 | 2016-06-02 | 捷开通讯(深圳)有限公司 | Network-based file transfer method and system |
CN105704037A (en) * | 2015-12-31 | 2016-06-22 | 北京华为数字技术有限公司 | Table item storage method and controller |
CN105704037B (en) * | 2015-12-31 | 2019-02-19 | 北京华为数字技术有限公司 | A kind of list item store method and controller |
CN111177017A (en) * | 2018-11-09 | 2020-05-19 | 炬芯(珠海)科技有限公司 | Memory allocation method and device |
CN113453276A (en) * | 2021-05-18 | 2021-09-28 | 翱捷科技股份有限公司 | Method and device for improving utilization rate of uplink and downlink memories of LTE terminal |
CN113453276B (en) * | 2021-05-18 | 2024-01-16 | 翱捷科技股份有限公司 | Method and device for improving uplink and downlink memory utilization rate of LTE terminal |
Also Published As
Publication number | Publication date |
---|---|
CN100452761C (en) | 2009-01-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN1064500C (en) | Method and apparatus for temporarily storing data packets | |
CN110297699B (en) | Scheduling method, scheduler, storage medium and system | |
CN1097913C (en) | ATM throttling | |
CN1819523A (en) | Parallel interchanging switching designing method | |
CN104731799B (en) | Main memory DBM device | |
CN1822564A (en) | Adaptive queue method and system for realtime packet transfer | |
CN1604051A (en) | Method and apparatus for dynamic memory management within an object-oriented program | |
CN1856148A (en) | Management of business processing resourse in communication system | |
CN1679005A (en) | Dynamic memory management | |
CN1691637A (en) | Method of data packet storage in communication equipment | |
CN1851671A (en) | Method for saving global varible internal memory space | |
CN1643874A (en) | Scheduling using quantum and deficit values | |
CN1881895A (en) | Apparatus operation method in network management system | |
CN1946225A (en) | Full distributive resource managing method and system | |
CN1192563C (en) | Band width split method using emulation weighting reasonable queue technology | |
CN1265583C (en) | Business resource distribution method | |
CN1225105C (en) | Call processing system adapted for application server and its realizing method | |
CN1744725A (en) | Method for memorying data flow in single-board | |
CN110011924A (en) | A kind of method and apparatus for removing cache congestion | |
CN116954905A (en) | Task scheduling and migration method for large Flink data | |
CN1489334A (en) | Method for storage area management with static and dynamic joint | |
CN1757206A (en) | System and method for providing differentiated services | |
CN100499581C (en) | Method for grouped issuing message in grouped telecommunication | |
CN1955990A (en) | Flow executing method and system of integral telecommunication platform | |
CN102487303A (en) | Time slot distribution management method and apparatus thereof |
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: 20090114 Termination date: 20140427 |