CN108108307A - A kind of method for processing resource and terminal - Google Patents

A kind of method for processing resource and terminal Download PDF

Info

Publication number
CN108108307A
CN108108307A CN201611044955.2A CN201611044955A CN108108307A CN 108108307 A CN108108307 A CN 108108307A CN 201611044955 A CN201611044955 A CN 201611044955A CN 108108307 A CN108108307 A CN 108108307A
Authority
CN
China
Prior art keywords
resource block
idling
space length
address information
block
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.)
Pending
Application number
CN201611044955.2A
Other languages
Chinese (zh)
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.)
China Mobile Communications Group Co Ltd
China Mobile Hangzhou Information Technology Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Hangzhou Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Mobile Communications Group Co Ltd, China Mobile Hangzhou Information Technology Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN201611044955.2A priority Critical patent/CN108108307A/en
Publication of CN108108307A publication Critical patent/CN108108307A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • G06F12/0253Garbage collection, i.e. reclamation of unreferenced memory

Abstract

The embodiment of the invention discloses a kind of method for processing resource and terminal, the above method can include:When transmitting the first data, the first space length of the first data is obtained;First space length and pre-set space length are compared;When the first space length is less than pre-set space length, idling-resource block is traveled through according to pre-set space length, determines the first idling-resource block, the first idling-resource block is more than or equal to pre-set space length;Using the first idling-resource block storage resource is distributed to the first data.

Description

A kind of method for processing resource and terminal
Technical field
The present invention relates to the memory technology in computer realm more particularly to a kind of method for processing resource and terminals.
Background technology
Memory can be incited somebody to action for the memory device of the information such as save routine and data, computer in modern information technologies The information such as initial data, computer program, the intermediate result calculated and the final operation result of input are stored into memory, institute With the whether sufficient speed for determining computer disposal speed of the resource of, memory, in recent years, with network development increasingly Rapidly, computer carries increasingly huger calculation amount and data message, and the resource of memory storage is fixed and very Limited, so when being managed to the resource of memory, some special methods may be employed, to improve the operation of memory Efficiency reduces the waste of memory space.
At present, the operating system of terminal can be managed memory by the form of free block chained list, such as Fig. 1 institutes Show, all free blocks in memory are stored in the form of free block chained list, and during memory distribution resource, memory passes through traversal Chained list searches suitable free block;During memory Resource recovery, memory searches suitable insertion ground by traveling through chained list The resource block of location insertion recycling.
However, existing free block chained list way to manage generates largely after substantial amounts of distribution and reclaimer operation has been carried out Space junk, the very small space junk of these length cannot meet distribution requirement, but the sum of fragment in chained list again be more than Space to be allocated, the problem of resulting in space junk excessive, the wasting of resources.
The content of the invention
In order to solve the above technical problems, an embodiment of the present invention is intended to provide a kind of method for processing resource and terminals, can subtract Few space junk, reduces the wasting of resources.
The technical proposal of the invention is realized in this way:
The embodiment of the present invention provides a kind of method for processing resource, including:
When transmitting the first data, the first space length of first data is obtained;
First space length is compared with pre-set space length;
When first space length is less than the pre-set space length, traveled through according to the pre-set space length idle Resource block, determines the first idling-resource block, and the first idling-resource block is more than or equal to the pre-set space length;
Using the first idling-resource block storage resource is distributed to first data.
In said program, it is described first space length and the pre-set space length are compared after, institute It states before distributing storage resource to first data using the first idling-resource block, the method further includes:
When first space length is more than or equal to the pre-set space length, traveled through according to first space length The idling-resource block, determines the first idling-resource block, and the first idling-resource block is more than or equal to first space Length.
It is described to distribute storage resource, bag to first data using the first idling-resource block in said program It includes:
When the sum of two described pre-set space length, more than the first idling-resource block length when, determine described One idling-resource block is the storage resource block of first data;
When the sum of two described pre-set space length, less than or equal to the first idling-resource block length when, from described The resource block to be allocated that length is the pre-set space length is determined in first idling-resource block, the resource block to be allocated is institute State the storage resource block of the first data.
It is described to distribute storage resource, bag to first data using the first idling-resource block in said program It includes:
When the sum of first space length and the pre-set space length, more than the length of the first idling-resource block When, determine the storage resource block that the first idling-resource block is first data;
When the sum of first space length and the pre-set space length, less than or equal to the first idling-resource block During length, the resource block to be allocated that length is first space length is determined from the first idling-resource block, it is described to treat Distribute the storage resource block that resource block is first data.
It is described to determine that length is treated for the pre-set space length from the first idling-resource block in said program Resource block is distributed, including:
In the first idling-resource block, since the termination address of the first idling-resource block, reading length is Second idling-resource block of the pre-set space length, the second idling-resource block belong to the first idling-resource block;
The second idling-resource block is determined as the resource block to be allocated.
It is described to determine that length is treated for first space length from the first idling-resource block in said program Resource block is distributed, including:
In the first idling-resource block, since the termination address of the first idling-resource block, reading length is 3rd idling-resource block of first space length, the 3rd idling-resource block belong to the first idling-resource block;
The 3rd idling-resource block is determined as the resource block to be allocated.
It is described to travel through idling-resource block according to the pre-set space length in said program, determine the first idling-resource Block, including:
The idling-resource block is traveled through from starting idling-resource BOB(beginning of block);
By the pre-set space length compared with the second space length of current idle resource block, the current idle Resource block is an idling-resource idling-resource block in the block;
Until determine that the current idle resource block that the second space length is more than the pre-set space length is institute State the first idling-resource block.
It is described to carry out the pre-set space length and the second space length of current idle resource block in said program After comparing, the method further includes:
When traversing termination idling-resource block all without determining the first idling-resource block, terminate the default sky Between flow of the length compared with the second space length of the current idle resource block and return and determine failure command.
In said program, it is described using the first idling-resource block to first data distribution storage resource it Afterwards, the method further includes:
When being transmitted first data, first data are discharged, and obtains and releases first data Storage resource block, the storage resource block include the first address information;
According to first address information and default decision condition, the idling-resource block is traveled through, is determined and the storage The 4th adjacent idling-resource block of resource block;
According to first address information and the second address information to the storage resource block and the 4th idling-resource Block is judged that the 4th idling-resource block is idling-resource adjacent with the storage resource block in the idling-resource block Block, second address information are the address information of the 4th idling-resource block;
When judging the 4th idling-resource block and the storage resource block consecutive hours, will the 4th idling-resource block and The 4th idling-resource block of the storage resource merged block Cheng Xin.
It is described according to first address information and default decision condition in said program, travel through the idling-resource Block determines the fourth idling-resource block adjacent with the storage resource block, including:
The idling-resource block is traveled through from starting idling-resource BOB(beginning of block);
By first address information compared with the second address information of the current idle resource block;
When definite second address information is more than first address information, and second address information and described the During the difference minimum of one address information, current idle resource block is determined as the 5th idling-resource block, the 5th idling-resource block For the fourth idling-resource block adjacent with the storage resource block right side;
When definite second address information is less than first address information, and second address information and described the During the difference minimum of one address information, current idle resource block is determined as the 6th idling-resource block, the 6th idling-resource block For the fourth idling-resource block adjacent with a storage resource block left side.
It is described according to first address information and default decision condition in said program, travel through the idling-resource Block, after determining the 4th idling-resource block adjacent with the storage resource block, the method further includes:
When the current idle resource block for terminate idling-resource block, and second address information be less than first ground During the information of location, terminate to travel through the flow of the idling-resource block.
In said program, the storage resource block includes the 3rd space length, described to work as the 4th idling-resource block With the storage resource block consecutive hours, by the described 4th of the 4th idling-resource block and the storage resource merged block Cheng Xin the Idling-resource block, including:
When the storage resource block and the 5th idling-resource block consecutive hours, by the space of the 5th idling-resource block Length merges into the space length of the 5th new idling-resource block with the 3rd space length, and first address information is made For the address information for next idling-resource block that the first pointer is directed toward, the next idling-resource block that the second pointer is directed toward The address information for next idling-resource block that address information is directed toward as the 3rd new pointer, under first pointer is directed toward The address information of one idling-resource block is the corresponding pointer information of the 6th idling-resource block, what second pointer was directed toward The address information of next idling-resource block is the corresponding pointer information of the storage resource block, under the 3rd pointer is directed toward The address information of one idling-resource block is the corresponding pointer information of the 5th idling-resource block;
When the storage resource block and the 6th idling-resource block consecutive hours, by the space length of the 6th idling-resource block The space length of the 6th new idling-resource block is merged into the second space length.
In said program, it is described according to first address information and the second address information to the storage resource block with After the 4th idling-resource block is judged, the method further includes:
Idling-resource block and the 5th idling-resource block and the 6th idling-resource block are stored when judgement is described not Consecutive hours, the address information for next idling-resource block that first address information is directed toward as first pointer will Next free time that the address information for next idling-resource block that first pointer is directed toward is directed toward as the 3rd pointer The address information of resource block.
The embodiment of the present invention provides a kind of terminal, and the terminal includes:
Acquiring unit, for when transmitting the first data, obtaining the first space length of first data;
Comparison unit, for first space length to be compared with pre-set space length;
Determination unit, for when first space length be less than the pre-set space length when, according to the default sky Between length traversal idling-resource block, determine the first idling-resource block, the first idling-resource block is more than or equal to the default sky Between length;
Allocation unit, for distributing storage resource to first data using the first idling-resource block.
In above-mentioned terminal, the determination unit is additionally operable to be more than or equal to the default sky when first space length Between length when, travel through the idling-resource block according to first space length, determine the first idling-resource block, described the One idling-resource block is more than or equal to first space length.
In above-mentioned terminal, the determination unit is additionally operable to when the sum of two described pre-set space length, more than described the During the length of one idling-resource block, the storage resource block that the first idling-resource block is first data is determined;When two The sum of described pre-set space length, less than or equal to the first idling-resource block length when, from the first idling-resource block In determine resource block to be allocated that length is the pre-set space length, the resource block to be allocated is deposited for first data Store up resource block.
In above-mentioned terminal, the determination unit is additionally operable to when first space length and the pre-set space length The sum of, more than the first idling-resource block length when, determine that the first idling-resource block being deposited for first data Store up resource block;When the sum of first space length and the pre-set space length, less than or equal to the first idling-resource block Length when, from the first idling-resource block determine length be first space length resource block to be allocated, it is described Resource block to be allocated is the storage resource block of first data.
In above-mentioned terminal, the terminal further includes:Reading unit;
The reading unit, in the first idling-resource block, from the termination of the first idling-resource block Location starts, and reads the second idling-resource block that length is the pre-set space length, and the second idling-resource block belongs to described First idling-resource block;
The determination unit is additionally operable to the second idling-resource block being determined as the resource block to be allocated.
In above-mentioned terminal, the reading unit is additionally operable in the first idling-resource block, idle from described first The termination address of resource block starts, and reads the 3rd idling-resource block that length is first space length, and the described 3rd is idle Resource block belongs to the first idling-resource block;
The determination unit is additionally operable to the 3rd idling-resource block being determined as the resource block to be allocated.
In above-mentioned terminal, the terminal further includes:Traversal Unit and comparing unit;
The Traversal Unit, for traveling through the idling-resource block from starting idling-resource BOB(beginning of block);
The comparing unit, for the second space length of the pre-set space length and current idle resource block to be carried out Compare, the current idle resource block is an idling-resource idling-resource block in the block;
The determination unit, specifically for until determining that the second space length is more than the institute of the pre-set space length Current idle resource block is stated as the first idling-resource block.
In above-mentioned terminal, the terminal further includes:End unit;
The end unit, for termination idling-resource block is all no to determine the first idling-resource block when traversing When, terminate the flow compared with the second space length of the current idle resource block by the pre-set space length And it returns and determines failure command.
In above-mentioned terminal, the terminal further includes:Identifying unit and combining unit;
The acquiring unit is additionally operable to when being transmitted first data, is discharged first data, and is obtained and release The storage resource block of first data is discharged, the storage resource block includes the first address information;
The determination unit is additionally operable to according to first address information and default decision condition, travels through the idle money Source block determines the fourth idling-resource block adjacent with the storage resource block;
The identifying unit, for according to first address information and the second address information to the storage resource block with The 4th idling-resource block judged, the 4th idling-resource block be in the idling-resource block with the storage resource The adjacent idling-resource block of block, second address information are the address information of the 4th idling-resource block;
The combining unit judges the 4th idling-resource block and the storage resource block consecutive hours, by institute for working as State the 4th idling-resource block of the 4th idling-resource block and the storage resource merged block Cheng Xin.
In above-mentioned terminal, the Traversal Unit is additionally operable to travel through the idling-resource from starting idling-resource BOB(beginning of block) Block;
The comparing unit, also by the second address information of first address information and the current idle resource block into Row compares;
The determination unit is additionally operable to be more than first address information when definite second address information, and described During the difference minimum of the second address information and first address information, current idle resource block is determined as the 5th idling-resource Block, the 5th idling-resource block are and right adjacent the 4th idling-resource block of the storage resource block;It is described when determining Second address information is less than first address information, and the difference of second address information and first address information is minimum When, current idle resource block is determined as the 6th idling-resource block, the 6th idling-resource block is and the storage resource block Left adjacent the 4th idling-resource block.
In above-mentioned terminal, the end unit, it is termination idling-resource block to be additionally operable to when the current idle resource block, And second address information terminates to travel through the flow of the idling-resource block when being less than first address information.
In above-mentioned terminal, the combining unit, specifically for working as the storage resource block and the 5th idling-resource The space length of the 5th idling-resource block and the 3rd space length are merged into the idle money of new the 5th by block consecutive hours The space length of source block, the address letter for next idling-resource block that first address information is directed toward as the first pointer Breath, next free time that the address information of next idling-resource block of the second pointer direction is directed toward as the 3rd new pointer The address information of resource block, the address information for next idling-resource block that first pointer is directed toward is the described 6th idle money The corresponding pointer information of source block, the address information for next idling-resource block that second pointer is directed toward is the storage resource The corresponding pointer information of block, the address information for next idling-resource block that the 3rd pointer is directed toward is the described 5th idle money The corresponding pointer information of source block;When the storage resource block and the 6th idling-resource block consecutive hours, by the 6th idling-resource The space length of block merges into the space length of the 6th new idling-resource block with the second space length.
In above-mentioned terminal, the terminal further includes:Updating block;
The updating block, for when judging storage idling-resource block and the 5th idling-resource block and described the When six idling-resource blocks are all discontinuous, next idling-resource that first address information is directed toward as first pointer The address information of block, the address information for next idling-resource block that first pointer is directed toward refer to as the 3rd pointer To next idling-resource block address information.
An embodiment of the present invention provides a kind of method for processing resource and terminal, by when transmitting the first data, obtaining the First space length of one data;First space length and pre-set space length are compared;When the first space length is less than During pre-set space length, idling-resource block is traveled through according to pre-set space length, determines the first idling-resource block, the first idling-resource Block is more than or equal to pre-set space length;Using the first idling-resource block storage resource is distributed to the first data.Using above-mentioned technology Implementation can set minimum memory resource when memory resource is distributed so that the idling-resource block of distribution and surplus Remaining idling-resource block is not less than minimum memory resource, can reduce space junk, reduces the wasting of resources.
Description of the drawings
Fig. 1 is allocated free block and recycles schematic diagram for memory in the prior art;
Fig. 2 is a kind of method for processing resource flow chart one provided in an embodiment of the present invention;
Fig. 3 is a kind of structure diagram of illustrative free block provided in an embodiment of the present invention;
Fig. 4 is a kind of structure diagram of illustrative allocated free block provided in an embodiment of the present invention;
Fig. 5 is the schematic diagram one that a kind of illustrative free block provided in an embodiment of the present invention is allocated;
Fig. 6 is the schematic diagram two that a kind of illustrative free block provided in an embodiment of the present invention is allocated;
Fig. 7 is the schematic diagram three that a kind of illustrative free block provided in an embodiment of the present invention is allocated;
Fig. 8 is a kind of method for processing resource flowchart 2 provided in an embodiment of the present invention;
Fig. 9 a kind of has illustratively distributed the schematic diagram one that free block is recovered to be provided in an embodiment of the present invention;
Figure 10 a kind of has illustratively distributed the schematic diagram two that free block is recovered to be provided in an embodiment of the present invention;
Figure 11 a kind of has illustratively distributed the schematic diagram three that free block is recovered to be provided in an embodiment of the present invention;
Figure 12 is a kind of method for processing resource flow chart 3 provided in an embodiment of the present invention;
Figure 13 is a kind of method for processing resource flow chart four provided in an embodiment of the present invention;
Figure 14 is a kind of structure diagram one of terminal 1 provided in an embodiment of the present invention;
Figure 15 is a kind of structure diagram two of terminal 1 provided in an embodiment of the present invention;
Figure 16 is a kind of structure diagram three of terminal 1 provided in an embodiment of the present invention;
Figure 17 is a kind of structure diagram four of terminal 1 provided in an embodiment of the present invention;
Figure 18 is a kind of structure diagram five of terminal 1 provided in an embodiment of the present invention;
Figure 19 is a kind of structure diagram six of terminal 1 provided in an embodiment of the present invention;
Figure 20 is a kind of structure diagram seven of terminal 1 provided in an embodiment of the present invention.
Specific embodiment
Below in conjunction with the attached drawing in the embodiment of the present invention, the technical solution in the embodiment of the present invention is carried out clear, complete Site preparation describes.
Embodiment one
The embodiment of the present invention provides a kind of method for processing resource, as shown in Fig. 2, this method can include:
S101, when transmitting the first data, obtain the first data the first space length.
A kind of method for processing resource provided in an embodiment of the present invention is suitable for being allocated the idling-resource memory Under the scene of operation.
In the embodiment of the present invention, when terminal carries out the transmission of the first data, terminal operating system needs to call memory In idling-resource store the first data, at this point, memory gets first space length occupied required for the first data.
In the embodiment of the present invention, the idling-resource block in memory is stored in the form of free block chained list, such as Shown in Fig. 3, each idling-resource block is made of 3 parts, is LEN, Next Addr and Space respectively, wherein, LEN is represented Be the idling-resource block free space length, the value of LEN is the sum of value of Next Addr and Space, Next Addr tables What is shown is the initial address of next piece of idling-resource block, and when the idling-resource block is last block idling-resource block, the value What is represented for NULL, Space is length that the idling-resource block can actually distribute.
In the embodiment of the present invention, the occupied length of LEN and Next Addr can be set according to memory size.
Illustratively, when setting the occupied length of LEN and Next Addr and being 2 bytes, 64K sizes can be managed Idling-resource block;When setting the occupied length of LEN and Next Addr and being 4 bytes, the free time of 4G sizes can be managed Resource block.
S102, the first space length and pre-set space length are compared.
It is necessary to judging whether first space length is small after memory gets the first space length of the first data In the minimum length of memory setting.
Pre-set space length is set in the embodiment of the present invention in memory, needs occupancy when memory gets terminal During one space, memory compares the first space length and pre-set space length, judges whether the first space length is more than Equal to pre-set space length.
S103, when the first space length be less than pre-set space length when, according to pre-set space length travel through idling-resource block, Determine the first idling-resource block, which is more than or equal to the pre-set space length.
When the comparing result of the first space length and pre-set space length is that the first space length is less than pre-set space length When, it is necessary in the idling-resource block of memory find more than or equal to pre-set space length the first idling-resource block.
In the embodiment of the present invention, when the first space length is less than pre-set space length, the space that characterization terminal needs is long Degree less than the default minimum allocation of memory space length, at this point, memory according to pre-set space length from idling-resource block It is middle to find suitable first idling-resource block.
Further, when the first space length is more than or equal to pre-set space length, characterization the first space length satisfaction is deposited The length in the minimum allocation space of reservoir, at this point, memory is found from idling-resource block more than or equal to the first space length First idling-resource block.
It is understood that the first space length is avoided into Shen compared with the pre-set space length that memory is set Please memory distribution space length be less than memory set pre-set space length, can effectively avoid the life of space junk Into.
S104, using the first idling-resource block storage resource is distributed to the first data.
When memory determines the first idling-resource block to be allocated it is necessary to by the first idling-resource block according to memory Definite allocation space length is separated, and the idling-resource block to be allocated after separation is distributed to the first data storage money Source.
In the embodiment of the present invention, when the first space length is less than pre-set space length, compare two pre-set space length The sum of whether be more than the length of the first idling-resource block, if the sum of two pre-set space length is more than or equal to the first idling-resource The length of block, the first idling-resource block of characterization is after the idling-resource block of pre-set space length is isolated, remaining idle money Source block is less than pre-set space length, at this point, entire first idling-resource block is fully allocated to the first data carries out depositing for data Storage;If the sum of two pre-set space length is less than the length of the first idling-resource block, the first idling-resource block of characterization is separating Go out after the idling-resource block of pre-set space length, remaining idling-resource block is more than pre-set space length, at this point, empty by first Not busy resource block intercepts the idling-resource block of pre-set space length from afterbody and distributes to the storage that the first data carry out data.
Further, when the first space length is more than or equal to pre-set space length, the first space length is compared with presetting Whether the sum of space length is more than the length of the first idling-resource block, if the first space length and pre-set space length are with presetting The sum of space length is more than or equal to the length of the first idling-resource block, and the first idling-resource block of characterization is to isolate the first space long After the idling-resource block of degree, remaining idling-resource block is less than pre-set space length, at this point, by entire first idling-resource block It is fully allocated to the storage that the first data carry out data;If the first space length and pre-set space length and pre-set space length The sum of be less than the first idling-resource block length, characterization the first idling-resource block isolating the idling-resource of the first space length After block, remaining idling-resource block is more than pre-set space length, at this point, the first idling-resource block is empty from afterbody interception first Between length idling-resource block and distribute to the first data carry out data storage.
In the embodiment of the present invention, the data structure of allocated resource block is as shown in figure 4, by two parts of LEN and Addr Composition, wherein, LEN is used to refer to the physical length of allocation space, the value of LEN be the sum of value of Next Addr and Space, Addr is used for recording the initial address for having distributed resource block.
In the embodiment of the present invention, the first idling-resource block intercepts the idling-resource block of designated space length, such as Fig. 5 from afterbody Shown, idling-resource block is made of before dispensing LEN1, Next Addr and tri- parts of Space, when needing from the idling-resource When allocated length is 64K resources in block, the resource from Space afterbodys interception 64K as distribution is reallocated before the resource of distribution 2 bytes store the LEN2 and Addr of the resource, and the LEN1 values of idling-resource block are changed to LEN1 ' at this time, wherein, LEN1's ' It is worth the difference of the value and 64k for LEN1.
Illustratively, as shown in fig. 6, there are tri- pieces of idling-resource blocks of L1, L2, L3 in memory, carried out in the form of chained list Storage, when L2 idling-resource blocks are fully allocated to the first data by memory carries out storage operation, L2 idling-resources are in the block The value of Next Addr is changed to the value of L3 idling-resources Next Addr in the block, L1 idling-resources Next Addr's in the block Value is changed to the value of L2 idling-resources Next Addr in the block, and L2 idling-resource blocks are distributed to the first data.
Illustratively, as shown in fig. 7, there are two pieces of idling-resource blocks of L1, L2 in memory, deposited in the form of chained list Storage, when L2 idling-resources idling-resource block in part in the block is distributed to the first data by memory carries out storage operation, L2 is empty The specified idling-resource block L3 that not busy resource block is determined from afterbody interception according to the first data, the addition characterization L3 moneys before L3 resource blocks The length of source block and L3 the and Addr fields of address, at this point, in L2 idling-resource blocks characterization can the L2 values of allocated length be changed to L2 ', wherein, the value of L2 ' is L2 values and the difference of L3 values.
It is understood that when distributing to the first data to idling-resource block, ensure the dispense first idle money Source block and remaining idling-resource block are not less than the default minimum value of memory, in such manner, it is possible to reduce in resource allocation, generate Smaller space resources block causes the resource allocation after cannot continuing, and can reduce space junk, reduces resource wave Take.
Embodiment two
As shown in figure 8, based on embodiment one, the embodiment of the present invention also provides a kind of its recovery method as resource, in step S104 Afterwards, specific steps include:
S201, when being transmitted first data, discharge the first data, and obtain and release the storages of the first data Resource block, storage resource block include the first address information.
A kind of method for processing resource provided in an embodiment of the present invention is suitable for being recycled to memory to allocated resource block Scene under.
In the embodiment of the present invention, when terminal-pair first data transmission is completed, terminal will be by the related letter of the first data of storage The storage resource block of breath is discharged, at this point, memory gets the storage resource block, and the storage resource block is recycled to sky At the specified address of not busy resource block chained list.
In the embodiment of the present invention, the data structure of allocated resource block is as shown in figure 4, by two parts of LEN and Addr Composition, wherein, LEN is used to refer to the physical length of allocation space, the value of LEN be the sum of value of Next Addr and Space, Addr is used for recording the initial address for having distributed resource block.
S202, according to the first address information and default decision condition, travel through idling-resource block, determine and storage resource block phase The 4th adjacent idling-resource block.
After storage resource block is recycled in idling-resource block chained list by memory, memory will be in idling-resource block The idling-resource block adjacent with storage resource block is found in chained list, come determine whether can be by storage resource block and adjacent free time Resource block merges.
In the embodiment of the present invention, storage resource block includes the first address information and the len field expression that Addr fields represent The 3rd space length.
In the embodiment of the present invention, memory reads the len field of storage resource block and Addr fields, is then successively read sky Next Addr fields in not busy resource block chained list, when the Next Addr of the 5th idling-resource block in idling-resource block chained list are more than The value of Addr, and during the difference minimum of the value of the Next Addr and Addr of the 5th idling-resource block, determine that the 5th idling-resource block is With the right adjacent idling-resource block of storage resource block;As the Next Addr of the 6th idling-resource block in idling-resource block chained list Value less than Addr, and during the difference minimum of the value of the Next Addr and Addr of the 6th idling-resource block, determine the 6th idling-resource The idling-resource block that block is and a storage resource block left side is adjacent.
In the embodiment of the present invention, after the free block chained list of storage resource block insertion memory, the Next of storage resource block Addr field values are the value of the Next Addr fields of the 6th idling-resource block, the Next Addr fields of the 6th idling-resource block Value for storage resource block Addr fields value.
In the embodiment of the present invention, free time more than Addr is not found when memory traverses last block idling-resource block During resource block, characterization storage resource block is last block idling-resource block in idling-resource block chained list, at this point, storage resource block Next Addr value for Null, the value of the Next Addr of last block idling-resource block is the Addr's of storage resource block Value.
Illustratively, as shown in figure 9, there are two idling-resource blocks of L1 and L3 in idling-resource block chained list, it is now to L2 Resource block is recycled to the address between L1 and L3, and after recycling, the value of the Next Addr of L2 resource blocks is L1 idling-resource blocks The value of Next Addr, the value of the Next Addr of L1 idling-resource blocks are changed to the value of the Addr of L2 resource blocks.
S203, storage resource block and the 4th idling-resource block are sentenced according to the first address information and the second address information Fixed, the 4th idling-resource block is idling-resource block adjacent with storage resource block in idling-resource block, and the second address information is the The address information of four idling-resource blocks.
When storage resource block finds idling-resource block adjacent thereto in idling-resource block chained list it is necessary to judging that this is deposited It is continuous to store up resource block idling-resource block whether adjacent thereto.
In the embodiment of the present invention, memory determine respectively the 5th adjacent idling-resource block right with storage resource block and with After left the 6th adjacent idling-resource block of storage resource block, the Addr fields and len field of storage resource block are obtained respectively Value, the 5th idling-resource block and the Next Addr fields of the 6th idling-resource block and the value of len field.
In the embodiment of the present invention, memory is by comparing the sum of the Addr fields of storage resource block and len field value and Whether the value of the Next Addr of six idling-resource blocks is continuous to judge storage resource block and the 5th idling-resource block;Memory leads to Cross the value and the 6th idle money of Next Addr of the Addr fields for comparing storage resource block with being directed toward the 6th idling-resource block address Whether the value of source block len field is continuous to judge storage resource block and the 6th idling-resource block.
S204, when judging the 4th idling-resource block and storage resource block consecutive hours, by the 4th idling-resource block and storage money Source block is merged into the 4th new idling-resource block.
Memory is compared the first address information and the second address information, and determines whether to deposit according to comparative result Storing up resource block and the 4th idling-resource merged block becomes the 4th new idling-resource block.
In the embodiment of the present invention, when the sum of the Addr fields of storage resource block and len field value and the 6th idling-resource block Next Addr value consecutive hours, characterize the 5th idling-resource block and storage resource block be continuous, at this point, by storage resource block The value of len field is changed to the sum of the LEN values of storage resource block and the LEN values of the 5th idling-resource block, storage resource block The value of Next Addr fields is changed to the Next Addr values of the 5th idling-resource block, and the Next of the 6th idling-resource block The value of Addr fields is changed to the Addr values of storage resource block;When the sum of the Addr fields of storage resource block and len field value with When the value of the Next Addr of 6th idling-resource block is discontinuous, characterizes the 5th idling-resource block and storage resource block is discontinuous, this When, using the value of the Addr fields of storage resource block as the value of the Next Addr fields of the 6th new idling-resource block, by the 6th Value of the value of the Next Addr fields of idling-resource block as the Next Addr of storage resource block.
Illustratively, as shown in Figure 10, there are two pieces of idling-resource blocks of L1, L3 and L2 storage resources in idling-resource block chained list Block, wherein L2 are between L1 and L3 and L2 and L3 are continuous, at this point, L2 and L3 are merged into L2 ', the idling-resource block after merging The length of L2 ' allocatable spaces is L2+L3, and the value of the Next Addr of L2 ' is the Next Addr values of L3, LI idling-resource blocks The value of Next Addr is the Addr values of L2.
In the embodiment of the present invention, as the Addr fields of storage resource block and the Next Addr of the 6th idling-resource block of direction Value and the 6th idling-resource block the sum of len field value consecutive hours, characterize the 6th idling-resource block and storage resource block be continuous, At this point, the value of the len field of the 6th idling-resource block is changed to the LEN values and the 6th idling-resource block of storage resource block The sum of LEN values;When the Addr fields and the value of the Next Addr of the 6th idling-resource block of direction and the 6th of storage resource block are idle It when the sum of the len field value of resource block is discontinuous, characterizes the 6th idling-resource block and storage resource block is discontinuous, at this point, will Value of the value of the Addr fields of storage resource block as the Next Addr fields of the 6th new idling-resource block, it is idle by the 6th Value of the value of the Next Addr fields of resource block as the Next Addr of storage resource block.
Illustratively, as shown in figure 11, there are two pieces of idling-resource blocks of L1, L2 and L storage resources in idling-resource block chained list Block, wherein L are after L2 and L2 and L are continuous, at this point, L2 and L are merged into L2 ', the idling-resource block L2 ' after merging can be distributed The length in space is L2+L.
It is understood that when being recycled to idling-resource block chained list to allocated resource block, by with this with distribution The adjacent idling-resource merged block of resource block can reduce space junk, reduce the wasting of resources into a new idling-resource block.
It is it should be noted that provided in an embodiment of the present invention a kind of suitable for being recycled to memory to allocated resource block Method for processing resource can also be used alone.
Embodiment three
The embodiment of the present invention provides a kind of method for processing resource, and as shown in figure 12, this method can include:
S301, in the first data of terminal transmission, memory obtain the first data the first space length.
A kind of method for processing resource provided in an embodiment of the present invention is suitable for being allocated the idling-resource memory Under the scene of operation.
In the embodiment of the present invention, when terminal carries out the transmission of the first data, terminal operating system needs to call memory In idling-resource store the first data, at this point, memory gets first space length occupied required for the first data.
In the embodiment of the present invention, the idling-resource block in memory is stored in the form of free block chained list, such as Shown in Fig. 3, each idling-resource block is made of 3 parts, is LEN, Next Addr and Space respectively, wherein, LEN is represented Be the idling-resource block free space length, the value of LEN is the sum of value of Next Addr and Space, Next Addr tables What is shown is the initial address of next piece of idling-resource block, and when the idling-resource block is last block idling-resource block, the value What is represented for NULL, Space is length that the idling-resource block can actually distribute.
In the embodiment of the present invention, the occupied length of LEN and Next Addr can be set according to memory size.
Illustratively, when setting the occupied length of LEN and Next Addr and being 2 bytes, 64K sizes can be managed Idling-resource block;When setting the occupied length of LEN and Next Addr and being 4 bytes, the free time of 4G sizes can be managed Resource block.
S302, memory compare the first space length and pre-set space length.
It is necessary to judging whether first space length is small after memory gets the first space length of the first data In the minimum length of memory setting.
Pre-set space length is set in the embodiment of the present invention in memory, needs occupancy when memory gets terminal During one space, memory compares the first space length and pre-set space length, judges whether the first space length is more than Equal to pre-set space length.
S303, when the first space length be less than pre-set space length when, memory from starting idling-resource BOB(beginning of block) traversal Idling-resource block.
When the first space length is less than pre-set space length, characterization terminal is not reached to the space length of memory application To the minimum application standard of memory, at this point, memory can distribute to terminal pre-set space length, pre-set space length is storage The minimum standard of device allocation space length.
In the embodiment of the present invention, when the first space length of terminal application is less than the minimum standard of memory setting, deposit Reservoir travels through idling-resource block chained list according to the minimum standard pre-set space length of allocation space length, and it is suitable therefrom to determine Idling-resource block to be allocated.
S304, memory by pre-set space length compared with the second space length of current idle resource block, currently Idling-resource block is an idling-resource idling-resource block in the block.
Memory is according to pre-set space length and the second space length of each idling-resource block in idling-resource block chained list To determine the first idling-resource block to be allocated.
In the embodiment of the present invention, memory by pre-set space block length successively with the current idle in idling-resource block chained list The second space length of resource block is compared, so that it is determined that suitable idling-resource block to be allocated.
It is idle for first that S305, memory determine that second space length is more than the current idle resource block of pre-set space length Resource block.
When second space length is more than pre-set space length, memory provides the corresponding current idle of second space length Source block is as the first idling-resource block, so that memory is to terminal distribution memory space.
In the embodiment of the present invention, when second space length is more than pre-set space length, characterization second space length corresponds to Current idle resource block meet the requirement of idling-resource block to be allocated, at this point, the current of idling-resource block to be allocated will be met Idling-resource block is determined as the first idling-resource block, so that memory distributes memory space from the first idling-resource block.
It is understood that the first space length is avoided into Shen compared with the pre-set space length that memory is set Please memory distribution space length be less than memory set pre-set space length, can effectively avoid the life of space junk Into.
S306, when memory traverses and terminates idling-resource block all without definite first idling-resource block, terminating will be pre- If flow and return of the space length compared with the second space length of current idle resource block determine failure command.
When memory, which traverses, terminates idling-resource block all without definite first idling-resource block, illustrate the idling-resource The idling-resource block of pre-set space length is not greater than in block chained list, it is impossible to memory space is allocated to the flow of terminal, this When need to terminate the flow and return to determine failure command.
In the embodiment of the present invention, memory since idling-resource block chained list starting idling-resource block space length according to It is secondary compared with pre-set space length, when until idling-resource block chained list termination idling-resource block space length be less than with During pre-set space length, the idling-resource block that pre-set space length is not greater than in the idling-resource block chained list is characterized, is tied at this time Beam is by flow of the pre-set space length compared with the second space length of current idle resource block and returns and determines unsuccessfully to refer to Order.
S307, when the sum of two pre-set space length, more than the first idling-resource block length when, memory determines first Idling-resource block is the storage resource block of the first data.
When memory determines the first idling-resource block to be allocated it is necessary to by the first idling-resource block according to memory Definite allocation space length is separated, and the space resources block to be allocated after separation is distributed to the first data storage resource .
In the embodiment of the present invention, memory needs to judge to grow the residue length for the first idling-resource block of being outside one's consideration except pre-set space Whether pre-set space length is more than.
In the embodiment of the present invention, when the sum of two pre-set space length are more than the length of the first idling-resource block, characterization Except the be outside one's consideration residue length of the first idling-resource block of pre-set space length is less than pre-set space length, at this point, memory is by entire the One idling-resource block distributes to the first data and carries out resource storage.
Illustratively, as shown in fig. 6, there are tri- pieces of idling-resource blocks of L1, L2, L3 in memory, carried out in the form of chained list Storage, when L2 idling-resource blocks are fully allocated to the first data by memory carries out storage operation, L2 idling-resources are in the block The value of Next Addr is changed to the value of L3 idling-resources Next Addr in the block, L1 idling-resources Next Addr's in the block Value is changed to the value of L2 idling-resources Next Addr in the block, and L2 idling-resource blocks are distributed to the first data.
S308, when the sum of two pre-set space length, less than or equal to the first idling-resource block length when, memory is from The resource block to be allocated that length is pre-set space length is determined in one idling-resource block, resource block to be allocated is deposited for the first data Store up resource block.
When memory determines the first idling-resource block to be allocated it is necessary to by the first idling-resource block according to memory Definite allocation space length is separated, and the space resources block to be allocated after separation is distributed to the first data storage resource .
In the embodiment of the present invention, when the sum of two pre-set space length are less than the length of the first idling-resource block, characterization Except the residue length that pre-set space grows the first idling-resource block of being outside one's consideration is more than pre-set space length, at this point, memory is empty by first Not busy resource block intercepts the idling-resource block of pre-set space length from afterbody and distributes to the storage that the first data carry out data.
In the embodiment of the present invention, the data structure of allocated resource block is as shown in figure 4, by two parts of LEN and Addr Composition, wherein, LEN is used to refer to the physical length of allocation space, the value of LEN be the sum of value of Next Addr and Space, Addr is used for recording the initial address for having distributed resource block.
In the embodiment of the present invention, the first idling-resource block intercepts the idling-resource block of designated space length, such as Fig. 5 from afterbody Shown, idling-resource block is made of before dispensing LEN1, Next Addr and tri- parts of Space, when needing from the idling-resource When allocated length is 64K resources in block, the resource from Space afterbodys interception 64K as distribution is reallocated before the resource of distribution 2 bytes store the LEN2 and Addr of the resource, and the LEN1 values of idling-resource block are changed to LEN1 ' at this time, wherein, LEN1's ' It is worth the difference of the value and 64k for LEN1.
Illustratively, as shown in fig. 7, there are two pieces of idling-resource blocks of L1, L2 in memory, deposited in the form of chained list Storage, when L2 idling-resources idling-resource block in part in the block is distributed to the first data by memory carries out storage operation, L2 is empty The specified idling-resource block L3 that not busy resource block is determined from afterbody interception according to the first data, the addition characterization L3 moneys before L3 resource blocks The length of source block and L3 the and Addr fields of address, at this point, in L2 idling-resource blocks characterization can the L2 values of allocated length be changed to L2 ', wherein, the value of L2 ' is L2 values and the difference of L3 values.
It should be noted that S307 and S308 is two steps arranged side by side, specifically according to the sum of two preset lengths with The comparative result of the space length of first idling-resource block performs corresponding step, and the embodiment of the present invention is not specifically limited.
S309, when the first space length be more than or equal to pre-set space length when, memory is traveled through according to the first space length Idling-resource block, determines the first idling-resource block, and the first idling-resource block is more than or equal to the first space length.
When the first space length is more than pre-set space length, the space length of characterization terminal to memory application reaches The minimum application standard of memory, at this point, memory can distribute to the first space length of terminal, pre-set space length is memory The minimum standard of allocation space length.
In the embodiment of the present invention, when the first space length of terminal application is more than the minimum standard of memory setting, deposit Reservoir travels through idling-resource block chained list according to the first space length, successively will be in the first space length and idling-resource block chained list Second space length be compared, when second space length be more than the first space length when, second space length is corresponding Current idle resource block is determined as the first idling-resource block, for memory distributed from the first idling-resource block memory space to Terminal.
It should be noted that S303 and S309 is two steps arranged side by side after S302, specifically according to decision condition It performs, the embodiment of the present invention is not specifically limited.
S310, when the sum of the first space length and pre-set space length, more than the first idling-resource block length when, storage Device determines the storage resource block that the first idling-resource block is the first data.
When memory determines the first idling-resource block to be allocated it is necessary to by the first idling-resource block according to memory Definite allocation space length is separated, and the space resources block to be allocated after separation is distributed to the first data storage resource .
In the embodiment of the present invention, memory needs to judge the residue length of the first idling-resource block in addition to the first space length Whether pre-set space length is more than.
In the embodiment of the present invention, when the sum of pre-set space length and the first space length are more than the length of the first idling-resource block When spending, the residue length for characterizing the first idling-resource block in addition to the first space length is less than pre-set space length, at this point, memory Entire first idling-resource block is distributed into the first data and carries out resource storage.
S311, when the sum of the first space length and pre-set space length, less than or equal to the first idling-resource block length when, Memory determines the resource block to be allocated that length is pre-set space length from the first idling-resource block, and resource block to be allocated is the The storage resource block of one data.
When memory determines the first idling-resource block to be allocated it is necessary to by the first idling-resource block according to memory Definite allocation space length is separated, and the space resources block to be allocated after separation is distributed to the first data storage resource .
In the embodiment of the present invention, when the sum of pre-set space length and the first space length are less than the length of the first idling-resource block When spending, the residue length for characterizing the first idling-resource block in addition to the first space length is more than pre-set space length, at this point, memory First idling-resource block is intercepted the idling-resource block of the first space length from afterbody and distributes to the first data and carries out data Storage.
In the embodiment of the present invention, memory reads length as the since the termination address of the first idling-resource block Second idling-resource block of one space length, which belongs to the first idling-resource block, and the second free time was provided Source block is determined as resource block to be allocated.
It should be noted that S310 and S311 is two steps arranged side by side, specifically according to preset length and the first space The comparative result of the sum of length and second space length performs corresponding step, and the embodiment of the present invention is not specifically limited.
It is understood that when distributing to the first data to idling-resource block, ensure the dispense first idle money Source block and remaining idling-resource block are not less than the default minimum value of memory, in such manner, it is possible to reduce in resource allocation, generate Smaller space resources block causes the resource allocation after cannot continuing, and can reduce space junk, reduces resource wave Take.
Example IV
Based on embodiment three, as shown in figure 13, offer of the embodiment of the present invention also provides a kind of its recovery method as resource, in step After S309, specific steps include:
S401, terminal transmission complete the first data when, memory discharge the first data, and obtain release the first data Storage resource block, storage resource block include the first address information.
A kind of method for processing resource provided in an embodiment of the present invention is suitable for being recycled to memory to allocated resource block Scene under.
In the embodiment of the present invention, when terminal-pair first data transmission is completed, terminal will be by the related letter of the first data of storage The storage resource block of breath is discharged, at this point, memory gets the storage resource block, and the storage resource block is recycled to sky At the specified address of not busy resource block chained list.
In the embodiment of the present invention, the data structure of allocated resource block is as shown in figure 4, by two parts of LEN and Addr Composition, wherein, LEN is used to refer to the physical length of allocation space, the value of LEN be the sum of value of Next Addr and Space, Addr is used for recording the initial address for having distributed resource block.
S402, memory travel through idling-resource block from starting idling-resource BOB(beginning of block).
Memory is after the first address information of storage resource block is got it is necessary to definite in idling-resource block chained list The idling-resource block adjacent with storage resource block.
In the embodiment of the present invention, memory is found from the starting idling-resource BOB(beginning of block) of idling-resource block chained list and is provided with storage The adjacent idling-resource block of source block.
S403, memory are by the first address information compared with the second address information of current idle resource block.
Memory is by comparing the first address information and the second ground of the current idle resource block in idling-resource block chained list Location information determines the idling-resource block adjacent with storage resource block.
In the embodiment of the present invention, storage resource block includes the first address information and the len field expression that Addr fields represent The 3rd space length.
In the embodiment of the present invention, memory reads the len field of storage resource block and Addr fields, then successively with the free time Next Addr fields in resource block chained list are compared.
S404, when memory determines that the second address information is more than the first address information, and the second address information is with the first During the difference minimum of location information, current idle resource block is determined as the 5th idling-resource block, the 5th idling-resource block is and storage Right the 4th adjacent idling-resource block of resource block, the 4th idling-resource block are sky adjacent with storage resource block in idling-resource block Not busy resource block.
Memory determines adjacent with the storage resource block right side according to the relation between the first address information and the second address information The 5th idling-resource block.
In the embodiment of the present invention, when the value of the Next Addr of the 5th idling-resource block is more than the value of Addr, and the 5th free time During the difference minimum of the value of the Next Addr and Addr of resource block, it is adjacent with the storage resource block right side to determine the 5th idling-resource block Idling-resource block.
S405, when memory determines that the second address information is less than the first address information, and the second address information is with the first During the difference minimum of location information, current idle resource block is determined as the 6th idling-resource block, the 6th idling-resource block is and storage Left the 4th adjacent idling-resource block of resource block.
Memory determines adjacent with the storage resource block right side according to the relation between the first address information and the second address information The 5th idling-resource block.
In the embodiment of the present invention, when the Next Addr of the 6th idling-resource block in idling-resource block chained list are less than Addr Value, and during the difference minimum of the value of the Next Addr and Addr of the 6th idling-resource block, it is with depositing to determine the 6th idling-resource block Store up the left adjacent idling-resource block of resource block.
In the embodiment of the present invention, after the free block chained list of storage resource block insertion memory, the Next of storage resource block Addr field values are the value of the Next Addr fields of the 6th idling-resource block, the Next Addr fields of the 6th idling-resource block Value for storage resource block Addr fields value.
Illustratively, as shown in figure 9, there are two idling-resource blocks of L1 and L3 in idling-resource block chained list, it is now to L2 Resource block is recycled to the address between L1 and L3, and after recycling, the value of the Next Addr of L2 resource blocks is L1 idling-resource blocks The value of Next Addr, the value of the Next Addr of L1 idling-resource blocks are changed to the value of the Addr of L2 resource blocks.
It should be noted that S404 and S405 is two steps arranged side by side after S403, specifically according to decision condition Corresponding step is performed, the embodiment of the present invention is not done specifically to limit.
S406, when current idle resource block for terminate idling-resource block, and the second address information be less than the first address information When, memory terminates to travel through the flow of idling-resource block.
When the termination idling-resource block to idling-resource block chained list compares, and do not find more than the first address information During double-address information, memory traversal completes idling-resource block chained list.
In the embodiment of the present invention, free time more than Addr is not found when memory traverses last block idling-resource block During resource block, characterization storage resource block is last block idling-resource block in idling-resource block chained list, at this point, storage resource block Next Addr value for Null, the value of the Next Addr of last block idling-resource block is the Addr's of storage resource block Value.
S407, memory are according to the first address information and the second address information to storage resource block and the 4th idling-resource block Judged, the second address information is the address information of the 4th idling-resource block.
Memory is compared the first address information and the second address information, judges storage resource block and the 5th idle money Whether source block and the 6th idling-resource block are continuous.
In the embodiment of the present invention, the sum of Addr fields and the len field value of memory by judging storage resource block and Whether the value of the Next Addr of six idling-resource blocks is continuous to judge storage resource block and the 5th idling-resource block, and memory leads to Cross the value and the 6th idling-resource block of Next Addr of the Addr fields for judging storage resource block with being directed toward the 6th idling-resource block The sum of len field value judge whether storage resource block and the 6th idling-resource block continuous.
S408, judge the 4th idling-resource block and storage resource block consecutive hours when memory, by the 4th idling-resource block and The 4th idling-resource block of storage resource merged block Cheng Xin.
Memory is compared the first address information and the second address information, and determines whether to deposit according to comparative result Storing up resource block and the 4th idling-resource merged block becomes the 4th new idling-resource block.
In the embodiment of the present invention, when storage resource block and the 5th idling-resource block consecutive hours, by the 5th idling-resource block Space length and the 3rd space length merge into the space length of the 5th new idling-resource block, using the first address information as The address information for next idling-resource block that one pointer is directed toward, the address for next idling-resource block that the second pointer is directed toward The address information for next idling-resource block that information is directed toward as the 3rd new pointer, next free time that the first pointer is directed toward The address information of resource block be the corresponding pointer information of the 6th idling-resource block, the second pointer be directed toward next idling-resource block Address information for the corresponding pointer information of storage resource block, the address information for next idling-resource block that the 3rd pointer is directed toward For the corresponding pointer information of the 5th idling-resource block.
In the embodiment of the present invention, when storage resource block and the 6th idling-resource block consecutive hours, by the 6th idling-resource block Space length merges into the space length of the 6th new idling-resource block with second space length.
In the embodiment of the present invention, when the sum of the Addr fields of storage resource block and len field value and the 6th idling-resource block Next Addr value consecutive hours, characterize the 5th idling-resource block and storage resource block be continuous, at this point, by storage resource block The value of len field is changed to the sum of the LEN values of storage resource block and the LEN values of the 5th idling-resource block, storage resource block The value of Next Addr fields is changed to the Next Addr values of the 5th idling-resource block, and the Next of the 6th idling-resource block The value of Addr fields is changed to the Addr values of storage resource block;When the sum of the Addr fields of storage resource block and len field value with When the value of the Next Addr of 6th idling-resource block is discontinuous, characterizes the 5th idling-resource block and storage resource block is discontinuous, this When, using the value of the Addr fields of storage resource block as the value of the Next Addr fields of the 6th new idling-resource block, by the 6th Value of the value of the Next Addr fields of idling-resource block as the Next Addr of storage resource block.
Illustratively, as shown in Figure 10, there are two pieces of idling-resource blocks of L1, L3 and L2 storage resources in idling-resource block chained list Block, wherein L2 are between L1 and L3 and L2 and L3 are continuous, at this point, L2 and L3 are merged into L2 ', the idling-resource block after merging The length of L2 ' allocatable spaces is L2+L3, and the value of the Next Addr of L2 ' is the Next Addr values of L3, LI idling-resource blocks The value of Next Addr is the Addr values of L2.
In the embodiment of the present invention, as the Addr fields of storage resource block and the Next Addr of the 6th idling-resource block of direction Value and the 6th idling-resource block the sum of len field value consecutive hours, characterize the 6th idling-resource block and storage resource block be continuous, At this point, the value of the len field of the 6th idling-resource block is changed to the LEN values and the 6th idling-resource block of storage resource block The sum of LEN values;When the Addr fields and the value of the Next Addr of the 6th idling-resource block of direction and the 6th of storage resource block are idle It when the sum of the len field value of resource block is discontinuous, characterizes the 6th idling-resource block and storage resource block is discontinuous, at this point, will Value of the value of the Addr fields of storage resource block as the Next Addr fields of the 6th new idling-resource block, it is idle by the 6th Value of the value of the Next Addr fields of resource block as the Next Addr of storage resource block.
Illustratively, as shown in figure 11, there are two pieces of idling-resource blocks of L1, L2 and L storage resources in idling-resource block chained list Block, wherein L are after L2 and L2 and L are continuous, at this point, L2 and L are merged into L2 ', the idling-resource block L2 ' after merging can be distributed The length in space is L2+L.
Further, when memory judges storage idling-resource block and the 5th idling-resource block and the 6th idling-resource block all When discontinuous, the address information for next idling-resource block that the first address information is directed toward as the first pointer refers to first The address letter for next idling-resource block that the address information for next idling-resource block that pin is directed toward is directed toward as the 3rd pointer Breath.
It is it should be noted that provided in an embodiment of the present invention a kind of suitable for being recycled to memory to allocated resource block Method for processing resource can also be used alone.
It is understood that in memory distribution idling-resource, a minimum value is set so that the idling-resource of distribution Length and remaining idling-resource length avoid the generation of the too small fragment of length, can reduce sky not less than the minimum value Between fragment, reduce the wasting of resources.
Embodiment five
As shown in figure 14, the embodiment of the present invention provides a kind of terminal 1, can include to terminal 1:
Acquiring unit 10, for when transmitting the first data, obtaining the first space length of first data.
Comparison unit 11, for first space length to be compared with pre-set space length.
Determination unit 12, for when first space length is less than the pre-set space length, being preset according to described Space length travels through idling-resource block, determines the first idling-resource block, and the first idling-resource block is more than or equal to described default Space length.
Allocation unit 13, for distributing storage resource to first data using the first idling-resource block.
Optionally, the determination unit 12 is additionally operable to when first space length is long more than or equal to the pre-set space When spending, the idling-resource block is traveled through according to first space length, determines the first idling-resource block, described first is empty Not busy resource block is more than or equal to first space length.
Optionally, the determination unit 12 is additionally operable to when the sum of two described pre-set space length, empty more than described first During the length of not busy resource block, the storage resource block that the first idling-resource block is first data is determined;When described in two The sum of pre-set space length, less than or equal to the first idling-resource block length when, from the first idling-resource block really Measured length is the resource block to be allocated of the pre-set space length, and the resource block to be allocated provides for the storage of first data Source block.
Optionally, the determination unit 12 is additionally operable to when the sum of first space length and the pre-set space length, More than the first idling-resource block length when, determine the first idling-resource block be first data storage resource Block;When the sum of first space length and the pre-set space length, less than or equal to the length of the first idling-resource block When, the resource block to be allocated that length is first space length is determined from the first idling-resource block, it is described to be allocated Resource block is the storage resource block of first data.
Optionally, as shown in figure 15 based on Figure 14, which further includes:Reading unit 14.
The reading unit 14, in the first idling-resource block, from the termination of the first idling-resource block Address starts, and reads the second idling-resource block that length is the pre-set space length, and the second idling-resource block belongs to institute State the first idling-resource block.
The determination unit 12 is additionally operable to the second idling-resource block being determined as the resource block to be allocated.
Optionally, the reading unit 14 is additionally operable in the first idling-resource block, from first idling-resource The termination address of block starts, and reads the 3rd idling-resource block that length is first space length, the 3rd idling-resource Block belongs to the first idling-resource block.
The determination unit 12 is additionally operable to the 3rd idling-resource block being determined as the resource block to be allocated.
Optionally, as shown in figure 16 based on Figure 14, which further includes:Traversal Unit 15 and comparing unit 16.
The Traversal Unit 15, for traveling through the idling-resource block from starting idling-resource BOB(beginning of block).
The comparing unit 16, for by the second space length of the pre-set space length and current idle resource block into Row compares, and the current idle resource block is an idling-resource idling-resource block in the block.
The determination unit 12, specifically for until determining that the second space length is more than the pre-set space length The current idle resource block is the first idling-resource block.
Optionally, as shown in figure 17 based on Figure 16, which further includes:End unit 17.
The end unit 17, for termination idling-resource block is all no to determine the first idling-resource block when traversing When, terminate the flow compared with the second space length of the current idle resource block by the pre-set space length And it returns and determines failure command.
Optionally, as shown in figure 18 based on Figure 14, which further includes:Identifying unit 18 and combining unit 19.
The acquiring unit 10, is additionally operable to when being transmitted first data, discharges first data, and obtains The storage resource block of first data is released, the storage resource block includes the first address information.
The determination unit 12 is additionally operable to, according to first address information and default decision condition, travel through the free time Resource block determines the fourth idling-resource block adjacent with the storage resource block.
The identifying unit 18, for according to first address information and the second address information to the storage resource block Judged with the 4th idling-resource block, the 4th idling-resource block is to be provided in the idling-resource block with the storage The adjacent idling-resource block of source block, second address information are the address information of the 4th idling-resource block.
The combining unit 19 judges the 4th idling-resource block and the storage resource block consecutive hours for working as, will The 4th idling-resource block of the 4th idling-resource block and the storage resource merged block Cheng Xin.
Optionally, the Traversal Unit 15 is additionally operable to travel through the idling-resource block from starting idling-resource BOB(beginning of block).
The comparing unit 16, also by first address information and the second address information of the current idle resource block It is compared.
The determination unit 12 is additionally operable to be more than first address information, and institute when definite second address information When stating the difference minimum of the second address information and first address information, current idle resource block is determined as the 5th idling-resource Block, the 5th idling-resource block are and right adjacent the 4th idling-resource block of the storage resource block;It is described when determining Second address information is less than first address information, and the difference of second address information and first address information is minimum When, current idle resource block is determined as the 6th idling-resource block, the 6th idling-resource block is and the storage resource block Left adjacent the 4th idling-resource block.
Optionally, the end unit 17, for working as the current idle resource block to terminate idling-resource block, and it is described When second address information is less than first address information, terminate to travel through the flow of the idling-resource block.
Optionally, the combining unit 19 connects specifically for working as the storage resource block with the 5th idling-resource block When continuous, the space length of the 5th idling-resource block and the 3rd space length are merged into the 5th new idling-resource block Space length, the address information for next idling-resource block that first address information is directed toward as the first pointer, will Next idling-resource that the address information for next idling-resource block that second pointer is directed toward is directed toward as the 3rd new pointer The address information of block, the address information for next idling-resource block that first pointer is directed toward is the 6th idling-resource block Corresponding pointer information, the address information for next idling-resource block that second pointer is directed toward is the storage resource block pair The pointer information answered, the address information for next idling-resource block that the 3rd pointer is directed toward is the 5th idling-resource block Corresponding pointer information;When the storage resource block and the 6th idling-resource block consecutive hours, by the 6th idling-resource block Space length merges into the space length of the 6th new idling-resource block with the second space length.
Optionally, as shown in figure 19 based on Figure 18, the terminal 1 further includes:Updating block 110.
The updating block 111, for when the judgement storage idling-resource block and the 5th idling-resource block and institute State the 6th idling-resource block it is all discontinuous when, next free time that first address information is directed toward as first pointer The address information of resource block, the address information for next idling-resource block that first pointer is directed toward refer to as the described 3rd The address information for next idling-resource block that pin is directed toward.
As shown in figure 20, in practical applications, above-mentioned acquiring unit 10, comparison unit 11, determination unit 12, allocation unit 13rd, reading unit 14, Traversal Unit 15, comparing unit 16, end unit 17, identifying unit 18, combining unit 19 and update are single Member 110 can all realize by the processor 111 being located on server 1, can be central processing unit (CPU), microprocessor (MPU), The realizations such as digital signal processor (DSP) or field programmable gate array (FPGA), which can also include memory 112 realize, which can be connected with processor 111, wherein, memory 112 is used to store executable program code, The program code includes computer-managed instruction, and memory 112 may include high-speed RAM memory, it is also possible to further include non-easy The property lost memory, for example, at least one magnetic disk storage.
It should be understood by those skilled in the art that, the embodiment of the present invention can be provided as method, system or computer program Product.Therefore, the shape of the embodiment in terms of hardware embodiment, software implementation or combination software and hardware can be used in the present invention Formula.Moreover, the present invention can be used can use storage in one or more computers for wherein including computer usable program code The form for the computer program product that medium is implemented on (including but not limited to magnetic disk storage and optical memory etc.).
The present invention be with reference to according to the method for the embodiment of the present invention, the flow of equipment (system) and computer program product Figure and/or block diagram describe.It should be understood that it can be realized by computer program instructions every first-class in flowchart and/or the block diagram The combination of flow and/or box in journey and/or box and flowchart and/or the block diagram.These computer programs can be provided The processor of all-purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices is instructed to produce A raw machine so that the instruction performed by computer or the processor of other programmable data processing devices is generated for real The device for the function of being specified in present one flow of flow chart or one box of multiple flows and/or block diagram or multiple boxes.
These computer program instructions, which may also be stored in, can guide computer or other programmable data processing devices with spy Determine in the computer-readable memory that mode works so that the instruction generation being stored in the computer-readable memory includes referring to Make the manufacture of device, the command device realize in one flow of flow chart or multiple flows and/or one box of block diagram or The function of being specified in multiple boxes.
These computer program instructions can be also loaded into computer or other programmable data processing devices so that counted Series of operation steps is performed on calculation machine or other programmable devices to generate computer implemented processing, so as in computer or The instruction offer performed on other programmable devices is used to implement in one flow of flow chart or multiple flows and/or block diagram one The step of function of being specified in a box or multiple boxes.
The foregoing is only a preferred embodiment of the present invention, is not intended to limit the scope of the present invention.

Claims (26)

1. a kind of method for processing resource, which is characterized in that the described method includes:
When transmitting the first data, the first space length of first data is obtained;
First space length is compared with pre-set space length;
When first space length is less than the pre-set space length, idling-resource is traveled through according to the pre-set space length Block, determines the first idling-resource block, and the first idling-resource block is more than or equal to the pre-set space length;
Using the first idling-resource block storage resource is distributed to first data.
It is 2. according to the method described in claim 1, it is characterized in that, described by first space length and the pre-set space After length is compared, before the use the first idling-resource block is to first data distribution storage resource, institute The method of stating further includes:
When first space length is more than or equal to the pre-set space length, according to described in first space length traversal Idling-resource block, determines the first idling-resource block, and the first idling-resource block is more than or equal to first space length.
3. according to the method described in claim 1, it is characterized in that, described give described first using the first idling-resource block Data distribute storage resource, including:
When the sum of two described pre-set space length, more than the first idling-resource block length when, determine that described first is empty Not busy resource block is the storage resource block of first data;
When the sum of two described pre-set space length, less than or equal to the first idling-resource block length when, from described first The resource block to be allocated that length is the pre-set space length is determined in idling-resource block, the resource block to be allocated is described the The storage resource block of one data.
4. according to the method described in claim 2, it is characterized in that, described give described first using the first idling-resource block Data distribute storage resource, including:
When the sum of first space length and the pre-set space length, more than the first idling-resource block length when, Determine the storage resource block that the first idling-resource block is first data;
When the sum of first space length and the pre-set space length, less than or equal to the length of the first idling-resource block When, the resource block to be allocated that length is first space length is determined from the first idling-resource block, it is described to be allocated Resource block is the storage resource block of first data.
5. according to the method described in claim 3, it is characterized in that, described determine that length is from the first idling-resource block The resource block to be allocated of the pre-set space length, including:
In the first idling-resource block, since the termination address of the first idling-resource block, it is described to read length Second idling-resource block of pre-set space length, the second idling-resource block belong to the first idling-resource block;
The second idling-resource block is determined as the resource block to be allocated.
6. according to the method described in claim 4, it is characterized in that, described determine that length is from the first idling-resource block The resource block to be allocated of first space length, including:
In the first idling-resource block, since the termination address of the first idling-resource block, it is described to read length 3rd idling-resource block of the first space length, the 3rd idling-resource block belong to the first idling-resource block;
The 3rd idling-resource block is determined as the resource block to be allocated.
7. according to the method described in claim 1, it is characterized in that, described travel through idling-resource according to the pre-set space length Block determines the first idling-resource block, including:
The idling-resource block is traveled through from starting idling-resource BOB(beginning of block);
By the pre-set space length compared with the second space length of current idle resource block, the current idle resource Block is an idling-resource idling-resource block in the block;
Until determine that the second space length is more than the current idle resource block of the pre-set space length for described the One idling-resource block.
It is 8. the method according to the description of claim 7 is characterized in that described by the pre-set space length and current idle resource After the second space length of block is compared, the method further includes:
When traversing termination idling-resource block all without determining the first idling-resource block, terminate the pre-set space is long It spends the flow compared with the second space length of the current idle resource block and returns and determine failure command.
9. method according to any one of claims 1 to 8, which is characterized in that described to use the first idling-resource block After distributing storage resource to first data, the method further includes:
When being transmitted first data, first data are discharged, and obtain the storage for releasing first data Resource block, the storage resource block include the first address information;
According to first address information and default decision condition, the idling-resource block is traveled through, is determined and the storage resource The 4th adjacent idling-resource block of block;
According to first address information and the second address information to the storage resource block and the 4th idling-resource block into Row judges that the 4th idling-resource block is idling-resource block adjacent with the storage resource block in the idling-resource block, Second address information is the address information of the 4th idling-resource block;
When judging the 4th idling-resource block and the storage resource block consecutive hours, by the 4th idling-resource block with it is described The 4th idling-resource block of storage resource merged block Cheng Xin.
It is 10. according to the method described in claim 9, it is characterized in that, described according to first address information and default judgement Condition travels through the idling-resource block, determines the fourth idling-resource block adjacent with the storage resource block, including:
The idling-resource block is traveled through from starting idling-resource BOB(beginning of block);
By first address information compared with the second address information of the current idle resource block;
When definite second address information is more than first address information, and second address information and first ground During the difference minimum of location information, current idle resource block is determined as the 5th idling-resource block, the 5th idling-resource block be with Right adjacent the 4th idling-resource block of the storage resource block;
When definite second address information is less than first address information, and second address information and first ground During the difference minimum of location information, current idle resource block is determined as the 6th idling-resource block, the 6th idling-resource block be with Left adjacent the 4th idling-resource block of the storage resource block.
It is 11. according to the method described in claim 10, it is characterized in that, described according to first address information and default judgement Condition travels through the idling-resource block, after determining the 4th idling-resource block adjacent with the storage resource block, the method It further includes:
When the current idle resource block for terminate idling-resource block, and second address information be less than first address letter During breath, terminate to travel through the flow of the idling-resource block.
12. according to the method described in claim 10, it is characterized in that, the storage resource block includes the 3rd space length, institute It states when the 4th idling-resource block and the storage resource block consecutive hours, the 4th idling-resource block and the storage is provided Source block is merged into new the 4th idling-resource block, including:
When the storage resource block and the 5th idling-resource block consecutive hours, by the space length of the 5th idling-resource block The space length of the 5th new idling-resource block is merged into the 3rd space length, using first address information as The address information for next idling-resource block that one pointer is directed toward, the address for next idling-resource block that the second pointer is directed toward The address information for next idling-resource block that information is directed toward as the 3rd new pointer, first pointer are directed toward next The address information of idling-resource block is the corresponding pointer information of the 6th idling-resource block, and second pointer is directed toward next The address information of a idling-resource block is the corresponding pointer information of the storage resource block, and the 3rd pointer is directed toward next The address information of idling-resource block is the corresponding pointer information of the 5th idling-resource block;
When the storage resource block and the 6th idling-resource block consecutive hours, by the space length of the 6th idling-resource block and institute State the space length that second space length merges into the 6th new idling-resource block.
13. according to the method for claim 12, which is characterized in that described according to first address information and the second address After information judges the storage resource block and the 4th idling-resource block, the method further includes:
When the judgement storage idling-resource block and the 5th idling-resource block and the 6th idling-resource block are all discontinuous When, the address information for next idling-resource block that first address information is directed toward as first pointer, by described in Next idling-resource that the address information for next idling-resource block that first pointer is directed toward is directed toward as the 3rd pointer The address information of block.
14. a kind of terminal, which is characterized in that the terminal includes:
Acquiring unit, for when transmitting the first data, obtaining the first space length of first data;
Comparison unit, for first space length to be compared with pre-set space length;
Determination unit, for when first space length be less than the pre-set space length when, it is long according to the pre-set space Degree traversal idling-resource block, determines the first idling-resource block, it is long that the first idling-resource block is more than or equal to the pre-set space Degree;
Allocation unit, for distributing storage resource to first data using the first idling-resource block.
15. terminal according to claim 14, which is characterized in that
The determination unit is additionally operable to when first space length is more than or equal to the pre-set space length, according to described First space length travels through the idling-resource block, determines the first idling-resource block, the first idling-resource block is more than Equal to first space length.
16. terminal according to claim 14, which is characterized in that
The determination unit is additionally operable to when the sum of two described pre-set space length, more than the length of the first idling-resource block When spending, the storage resource block that the first idling-resource block is first data is determined;When two pre-set space length The sum of, less than or equal to the first idling-resource block length when, from the first idling-resource block determine length be described The resource block to be allocated of pre-set space length, the resource block to be allocated are the storage resource block of first data.
17. terminal according to claim 15, which is characterized in that
The determination unit is additionally operable to when the sum of first space length and the pre-set space length, more than described first During the length of idling-resource block, the storage resource block that the first idling-resource block is first data is determined;When described The sum of one space length and the pre-set space length, less than or equal to the first idling-resource block length when, from described The resource block to be allocated that length is first space length is determined in one idling-resource block, the resource block to be allocated is described The storage resource block of first data.
18. terminal according to claim 16, which is characterized in that the terminal further includes:Reading unit;
The reading unit, in the first idling-resource block, being opened from the termination address of the first idling-resource block Begin, read the second idling-resource block that length is the pre-set space length, the second idling-resource block belongs to described first Idling-resource block;
The determination unit is additionally operable to the second idling-resource block being determined as the resource block to be allocated.
19. terminal according to claim 17, which is characterized in that
The reading unit is additionally operable in the first idling-resource block, from the termination address of the first idling-resource block Start, read the 3rd idling-resource block that length is first space length, the 3rd idling-resource block belongs to described the One idling-resource block;
The determination unit is additionally operable to the 3rd idling-resource block being determined as the resource block to be allocated.
20. terminal according to claim 14, which is characterized in that the terminal further includes:Traversal Unit and comparing unit;
The Traversal Unit, for traveling through the idling-resource block from starting idling-resource BOB(beginning of block);
The comparing unit, for the pre-set space length and the second space length of current idle resource block to be compared Compared with the current idle resource block is an idling-resource idling-resource block in the block;
The determination unit, specifically for working as until the second space length is determined to be more than described in the pre-set space length Preceding idling-resource block is the first idling-resource block.
21. according to the method described in claim 20, which is characterized in that the terminal further includes:End unit;
The end unit, for when traversing termination idling-resource block all without determining the first idling-resource block, tying Beam is by flow of the pre-set space length compared with the second space length of the current idle resource block and returns Return definite failure command.
22. according to the terminal described in claim 14-21 any one, which is characterized in that the terminal further includes:Identifying unit And combining unit;
The acquiring unit is additionally operable to when being transmitted first data, is discharged first data, and is obtained and release The storage resource block of first data, the storage resource block include the first address information;
The determination unit is additionally operable to, according to first address information and default decision condition, travel through the idling-resource block, Determine the fourth idling-resource block adjacent with the storage resource block;
The identifying unit, for according to first address information and the second address information to the storage resource block with it is described 4th idling-resource block judged, the 4th idling-resource block be in the idling-resource block with the storage resource block phase Adjacent idling-resource block, second address information are the address information of the 4th idling-resource block;
The combining unit, for when judging the 4th idling-resource block and the storage resource block consecutive hours, by described the The 4th idling-resource block of four idling-resource blocks and the storage resource merged block Cheng Xin.
23. terminal according to claim 22, which is characterized in that
The Traversal Unit is additionally operable to travel through the idling-resource block from starting idling-resource BOB(beginning of block);
The comparing unit also compares first address information and the second address information of the current idle resource block Compared with;
The determination unit is additionally operable to be more than first address information, and described second when definite second address information During the difference minimum of address information and first address information, current idle resource block is determined as the 5th idling-resource block, institute Stating the 5th idling-resource block is and right adjacent the 4th idling-resource block of the storage resource block;When definite second ground Location information is less than first address information, and during the difference minimum of second address information and first address information, it will Current idle resource block is determined as the 6th idling-resource block, and the 6th idling-resource block is adjacent with the storage resource block left side The 4th idling-resource block.
24. terminal according to claim 23, which is characterized in that
The end unit, it is termination idling-resource block to be additionally operable to when the current idle resource block, and second address is believed When breath is less than first address information, terminate to travel through the flow of the idling-resource block.
25. terminal according to claim 23, which is characterized in that
The combining unit, specifically for working as the storage resource block and the 5th idling-resource block consecutive hours, by described The space length of five idling-resource blocks merges into the space length of the 5th new idling-resource block with the 3rd space length, will Second pointer is directed toward by the address information for next idling-resource block that first address information is directed toward as the first pointer The address information for next idling-resource block that the address information of next idling-resource block is directed toward as the 3rd new pointer, institute The address information for stating next idling-resource block of the first pointer direction is the corresponding pointer information of the 6th idling-resource block, The address information for next idling-resource block that second pointer is directed toward is the corresponding pointer information of the storage resource block, institute The address information for stating next idling-resource block of the 3rd pointer direction is the corresponding pointer information of the 5th idling-resource block; When the storage resource block and the 6th idling-resource block consecutive hours, by the space length of the 6th idling-resource block and described the Two space lengths merge into the space length of the 6th new idling-resource block.
26. terminal according to claim 25, which is characterized in that the terminal further includes:Updating block;
The updating block, for when the judgement storage idling-resource block and the 5th idling-resource block and the 6th sky When not busy resource block is all discontinuous, next idling-resource block for being directed toward using first address information as first pointer The address information of next idling-resource block of first pointer direction is directed toward by address information as the 3rd pointer The address information of next idling-resource block.
CN201611044955.2A 2016-11-24 2016-11-24 A kind of method for processing resource and terminal Pending CN108108307A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611044955.2A CN108108307A (en) 2016-11-24 2016-11-24 A kind of method for processing resource and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611044955.2A CN108108307A (en) 2016-11-24 2016-11-24 A kind of method for processing resource and terminal

Publications (1)

Publication Number Publication Date
CN108108307A true CN108108307A (en) 2018-06-01

Family

ID=62203798

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611044955.2A Pending CN108108307A (en) 2016-11-24 2016-11-24 A kind of method for processing resource and terminal

Country Status (1)

Country Link
CN (1) CN108108307A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110069215A (en) * 2019-03-27 2019-07-30 浙江宇视科技有限公司 A kind of method and device of the dynamic adjustment storage unit based on block storage

Citations (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5652864A (en) * 1994-09-23 1997-07-29 Ibm Concurrent storage allocations or returns without need to lock free storage chain
US5784698A (en) * 1995-12-05 1998-07-21 International Business Machines Corporation Dynamic memory allocation that enalbes efficient use of buffer pool memory segments
CN1320863A (en) * 2000-06-13 2001-11-07 深圳市中兴通讯股份有限公司 Method for quick memory allocation and release in real-time system
CN1963788A (en) * 2005-11-08 2007-05-16 中兴通讯股份有限公司 A managing method for EMS memory
CN101281491A (en) * 2008-05-12 2008-10-08 北京邮电大学 Internal memory module of space robot central processing unit based on VxWorks and management method thereof
CN101329655A (en) * 2008-07-31 2008-12-24 北京天碁科技有限公司 Memory management method and device
CN101470665A (en) * 2007-12-27 2009-07-01 Tcl集团股份有限公司 Method and system for internal memory management of application system without MMU platform
CN101630992A (en) * 2008-07-14 2010-01-20 中兴通讯股份有限公司 Method for managing shared memory
CN101853210A (en) * 2010-05-25 2010-10-06 惠州华阳通用电子有限公司 Memory management method and device
CN102156675A (en) * 2010-02-12 2011-08-17 中兴通讯股份有限公司 Method and device for allocating memory
CN102866954A (en) * 2012-08-31 2013-01-09 华为技术有限公司 Method and device for allocating internal memory
CN102915276A (en) * 2012-09-25 2013-02-06 武汉邮电科学研究院 Memory control method for embedded systems
CN103150257A (en) * 2013-02-28 2013-06-12 天脉聚源(北京)传媒科技有限公司 Memory management method and memory management device
CN103186469A (en) * 2011-12-27 2013-07-03 上海博泰悦臻电子设备制造有限公司 Memory allocation method and device, and memory recovery method
CN103389947A (en) * 2013-08-06 2013-11-13 哈尔滨工业大学 Memory manager and management method for VxWorks-based photo-etching machine double workpiece table control system
CN103699497A (en) * 2013-12-19 2014-04-02 京信通信系统(中国)有限公司 Cache allocation method and device
CN104182356A (en) * 2014-09-19 2014-12-03 深圳市茁壮网络股份有限公司 Memory management method and device and terminal device
CN104199781A (en) * 2014-08-14 2014-12-10 深圳百科信息技术有限公司 Memory fragment allocation method and device based on shared memory
CN105302738A (en) * 2015-12-09 2016-02-03 北京东土科技股份有限公司 Method and device for distributing memory
CN105404590A (en) * 2015-11-10 2016-03-16 浪潮(北京)电子信息产业有限公司 Memory block combination method and system

Patent Citations (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5652864A (en) * 1994-09-23 1997-07-29 Ibm Concurrent storage allocations or returns without need to lock free storage chain
US5784698A (en) * 1995-12-05 1998-07-21 International Business Machines Corporation Dynamic memory allocation that enalbes efficient use of buffer pool memory segments
CN1320863A (en) * 2000-06-13 2001-11-07 深圳市中兴通讯股份有限公司 Method for quick memory allocation and release in real-time system
CN1963788A (en) * 2005-11-08 2007-05-16 中兴通讯股份有限公司 A managing method for EMS memory
CN101470665A (en) * 2007-12-27 2009-07-01 Tcl集团股份有限公司 Method and system for internal memory management of application system without MMU platform
CN101281491A (en) * 2008-05-12 2008-10-08 北京邮电大学 Internal memory module of space robot central processing unit based on VxWorks and management method thereof
CN101630992A (en) * 2008-07-14 2010-01-20 中兴通讯股份有限公司 Method for managing shared memory
CN101329655A (en) * 2008-07-31 2008-12-24 北京天碁科技有限公司 Memory management method and device
CN102156675A (en) * 2010-02-12 2011-08-17 中兴通讯股份有限公司 Method and device for allocating memory
CN101853210A (en) * 2010-05-25 2010-10-06 惠州华阳通用电子有限公司 Memory management method and device
CN103186469A (en) * 2011-12-27 2013-07-03 上海博泰悦臻电子设备制造有限公司 Memory allocation method and device, and memory recovery method
CN102866954A (en) * 2012-08-31 2013-01-09 华为技术有限公司 Method and device for allocating internal memory
CN102915276A (en) * 2012-09-25 2013-02-06 武汉邮电科学研究院 Memory control method for embedded systems
CN103150257A (en) * 2013-02-28 2013-06-12 天脉聚源(北京)传媒科技有限公司 Memory management method and memory management device
CN103389947A (en) * 2013-08-06 2013-11-13 哈尔滨工业大学 Memory manager and management method for VxWorks-based photo-etching machine double workpiece table control system
CN103699497A (en) * 2013-12-19 2014-04-02 京信通信系统(中国)有限公司 Cache allocation method and device
CN104199781A (en) * 2014-08-14 2014-12-10 深圳百科信息技术有限公司 Memory fragment allocation method and device based on shared memory
CN104182356A (en) * 2014-09-19 2014-12-03 深圳市茁壮网络股份有限公司 Memory management method and device and terminal device
CN105404590A (en) * 2015-11-10 2016-03-16 浪潮(北京)电子信息产业有限公司 Memory block combination method and system
CN105302738A (en) * 2015-12-09 2016-02-03 北京东土科技股份有限公司 Method and device for distributing memory

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
M. MASMANO ET AL.: ""Implementation of a constant-time dynamic storage allocator"", 《SOFTWARE-PRACTICE&EXPERIENCE》 *
李彦峰等: ""VxWorks实时操作系统内存分配算法优化"", 《电子世界》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110069215A (en) * 2019-03-27 2019-07-30 浙江宇视科技有限公司 A kind of method and device of the dynamic adjustment storage unit based on block storage

Similar Documents

Publication Publication Date Title
CN104216767B (en) The method and device of accessing shared data between multithreading
CN103995855B (en) The method and apparatus of data storage
CN105893153A (en) Memory cleaning method and device for mobile terminal
CN103856548B (en) Dynamic resource scheduling method and dynamic resource scheduling device
CN106844041A (en) The method and internal storage management system of memory management
CN108595268A (en) A kind of data distributing method, device and computer readable storage medium based on MapReduce
CN106598495A (en) Mixed storage service quality control method and control apparatus
CN102567522B (en) Method and device for managing file system of intelligent card
CN106649146A (en) Memory release method and apparatus
CN108984295A (en) Method for recovering internal storage, computer installation and computer readable storage medium
CN108241531A (en) A kind of method and apparatus for distributing resource for virtual machine in the cluster
CN108205473A (en) Internal memory processing method and device, computer installation and computer readable storage medium
CN111552555A (en) Point cloud visualization method and device
CN108829738A (en) Date storage method and device in a kind of ceph
CN108874324A (en) A kind of access request processing method, device, equipment and readable storage medium storing program for executing
CN109857678A (en) A kind of managing embedded system memory method and device
CN108140049A (en) The parallel batch processing of data structure based on tree
CN107870922B (en) Method, equipment and system for data deduplication
CN108108307A (en) A kind of method for processing resource and terminal
CN104866375B (en) A kind of method and device for migrating virtual machine
CN110399200A (en) A kind of cloud platform resource regulating method and device
CN105426126B (en) The construction method and device of cloud storage client multichannel constant rate of speed IO cachings
CN108646987A (en) A kind of management method of file volume, device, storage medium and terminal
CN110011924A (en) A kind of method and apparatus for removing cache congestion
CN105704037B (en) A kind of list item store method and controller

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 310012 building A01, 1600 yuhangtang Road, Wuchang Street, Yuhang District, Hangzhou City, Zhejiang Province

Applicant after: CHINA MOBILE (HANGZHOU) INFORMATION TECHNOLOGY Co.,Ltd.

Applicant after: China Mobile Communications Corp.

Address before: 310012, No. 14, building three, Chang Torch Hotel, No. 259, Wensanlu Road, Xihu District, Zhejiang, Hangzhou

Applicant before: CHINA MOBILE (HANGZHOU) INFORMATION TECHNOLOGY Co.,Ltd.

Applicant before: China Mobile Communications Corp.

RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20180601