Processor memory method for spacial multiplex and the system of portable electric appts
Technical field
The present invention relates to portable electric appts, especially relate to the processor memory sky of portable electric apptsBetween multiplexing method.
Background technology
Increasingly powerful along with disposal ability, such as on the portable electric appts of mobile phone, panel computerCan carry out various application. Conventionally, multiple programs can be installed in portable electric appts, and at needsThe one or more programs of Shi Yunhang are to open required application. Like this, need to be just under some application scenariosTake the multiple programs of concurrent running on the processor of formula electronic equipment, go out so just need to different routine plansMeet the memory headroom of program requirements. But the memory headroom of the processor of portable electric appts under normal circumstancesMore limited, possibly cannot meet the demand of all programs. Therefore how will in limited memory space, distribute toMultiple programs, become the problem that portable electric appts need to solve.
Specifically be applied as example with one, portable electric appts uses the coprocessor outside its primary processorCarry out the multiple programs of concurrent running. Taking multimedia application as example, in the time playing media file, can need to move simultaneouslyThe codec (Codec) of video decode and audio decoder need to move in the time dialing visual telephone simultaneouslyVideo coding, decoding and audio coding, four Codec of decoding need video to compile in the time recording a videoThe Codec of code and audio coding.
Some program pin is also different to the required space size of different characteristics. Still with multimediaCodec is example, and Video coding can be supported several ranks in image resolution ratio, the having of general standardQCIF (resolution ratio 176x144), QVGA (resolution ratio 320x240), CIF (resolution ratio 352x288) etc., andThe required memory headroom of Codec is directly proportional to resolution sizes. As mentioned before, in visual telephone and video recordingIn application, all can use Video coding Codec, but different in demand, in visual telephone, only need to prop upHold QCIF resolution ratio just passable, video recording requires higher, and the highest needs supported to CIF form.
In order to carry out visual telephone and video recording business in terminal, coprocessor is necessary for this 4 CodecPlanning space. The memory requirements of supposing each Codec except Video coding is all 1, and Video coding is propping upHolding demand in the situation of QCIF is 1, and in the situation that supporting CIF, demand is 2, and coprocessor total inDepositing space is 4, as shown in Figure 1. Under limited space, cannot put into 4 Codec as seen simultaneously. ForAddress this problem, current way is that Video coding is split, and becomes a storehouse of supporting QCIFWith the storehouse of a support CIF, the space and the video that utilize the function of overlay that Video coding (CIF) is had moreThe space overlap of decoding uses different storehouses, as shown in Figure 2 under different business. But this wayHaving obvious shortcoming, is first cannot use on the processor core that there is no overlay function, is secondlyAn amendment for storehouse need to correspond on different storehouses, moreover need to go according to the needed characteristic of businessUse different storehouses, increased the complexity of calling, and newly-increased characteristic all must increase a storehouse at every turn.
Summary of the invention
Technical problem to be solved by this invention is to provide a kind of simplification and portable electric appts flexiblyProcessor memory method for spacial multiplex.
The present invention be solve the problems of the technologies described above the technical scheme adopting be propose a kind of portable electronic establishStandby processor memory method for spacial multiplex, is used to multiple programme distribution memory headrooms, and these programs compriseThe first program, the memory headroom that this first program need to take while having core, operation is first sizeThe first ability characteristic part and when operation the memory headroom that need to take be the second ability of the second sizeCharacteristic part, wherein first size is less than the second size, and the method comprises the following steps: be these program ruleDraw memory headroom, comprise the core that one first memory headroom is allocated to the first program, and be the first journeyThe reserved first exented memory space with first size of basic capacity part of order; The 3rd size will be there isThe second memory headroom is allocated at least one the second program, and first size and the 3rd size sum are not less than the second chiVery little, the second program at least not with the second ability characteristic part concurrent running of the first program. When enabling the first journeyWhen the first ability characteristic part of order, notify the first program to use the first reserved exented memory space. When openingDuring by the second ability characteristic part of the first program, notify the first program to use one second exented memory space,The second exented memory space is the merging of the first exented memory space and the second memory headroom.
In one embodiment of this invention, the second memory headroom is immediately after the first exented memory space.
In one embodiment of this invention, for the step of multiple routine plan memory headrooms also comprises: oneThree memory headrooms are allocated to one the 3rd program, and the second ability characteristic part of the 3rd program and the first program alsoShipping row.
In one embodiment of this invention, the 3rd memory headroom is before the first memory headroom. In the present inventionAnother embodiment in, the 3rd memory headroom is after the second memory headroom.
In one embodiment of this invention, notify described first to expand by the interface of the first program to the first programExhibition memory headroom and/or described the second exented memory space.
In one embodiment of this invention, this first program is video coding program.
In one embodiment of this invention, this second program is video decode program and/or audio decoder program.
The processor memory space multiplexing system of portable electric appts proposed by the invention, comprising:
Be used to the device of described multiple routine plan memory headrooms, described in one first memory headroom is allocated toThe core of the first program, and there is first size for the basic capacity part of described the first program is reservedThe first exented memory space; Second memory headroom with the 3rd size is allocated to at least one the second program;Wherein, described first size and described the 3rd size sum are not less than described the second size, described the second programAt least not with the second ability characteristic part concurrent running of described the first program;
For in the time enabling the first ability characteristic part of described the first program, notify described the first program to useThe device in reserved described the first exented memory space;
For in the time enabling the second ability characteristic part of described the first program, notify described the first program to useThe device in one second exented memory space, wherein said the second exented memory space is described the first exented memoryThe merging of space and described the second memory headroom.
The present invention is owing to only planning the sky that meets each program lowest capability characteristic when the planning procedure memory headroomBetween, the space of high-grade energy force characteristic moves front outside in program and issues a separate notice, and occupies as not usingThe memory headroom of routine plan, this scheme makes it compared with prior art, has following advantage:
1) without the support of overlay function.
2) be convenient to program maintenance, only need a storehouse just can meet various ability characteristics demands.
3) facilitate external call.
4) flexibility is strong, can carry out space planning adjustment according to different business demand, and can be compatible preferablyFollow-up newly-increased characteristic.
Brief description of the drawings
For above-mentioned purpose of the present invention, feature and advantage can be become apparent, below in conjunction with accompanying drawing to thisBright detailed description of the invention elaborates, wherein:
Fig. 1 illustrates an example to multiple programs by processor memory space planning.
Fig. 2 illustrate existing by processor memory space planning to the method for multiple programs.
Fig. 3 illustrates the memory headroom multiplexing method of one embodiment of the invention.
Fig. 4 illustrates according to embodiments of the invention to be an example of multiple routine plan memory headrooms.
Fig. 5 A, Fig. 5 B illustrate that respectively according to embodiments of the invention be one of multiple routine plan memory headroomsThe scheme of kind.
Fig. 6 A, Fig. 6 B illustrate that respectively according to embodiments of the invention be the another of multiple routine plan memory headroomsA kind of scheme.
Fig. 7 A, Fig. 7 B illustrate the actual memory space hold according to Fig. 6 A, Fig. 6 B programme.
Detailed description of the invention
The following examples will be described in the limited equipment of the such memory headroom of portable electric apptsThe method in routine plan processor memory space. At this, portable electric appts include but not limited to mobile phone,Panel computer etc.
In multiple programs in portable electric appts, some program pin is to the required sky of different characteristicsBetween vary in size. For instance, program has low-grade energy force characteristic part and high-grade energy force characteristic part. FortuneWhen row low-grade energy force characteristic part, program, except the required fundamental space in core, also needs extra expansionExhibition memory headroom. And when operation high-grade energy force characteristic part, program except core, the expansion needingMemory headroom is greater than low-grade energy force characteristic part. Therefore need in program inside in an embodiment of the present invention,Space to demand splits. With the irrelevant space (being fundamental space) of ability characteristics as existing mode thatSample is core advance planning in program inside, therefore also referred to as inner space. And it is relevant with ability characteristicsAdvance planning not of space (being extending space), carry out according to demand dynamically otherwise allocated and change by outsideOr notice, therefore also referred to as space outerpace. Certainly,, if program only has a kind of ability characteristics, canNot carry out the division of inner space and space outerpace.
In addition, in the multiple programs in portable electric appts, some program can't be concurrent with other programsOperation. That is to say, when the first program is in the time moving, the second program can't be moved. Like this, be secondThe memory headroom of program advance planning is in fact in idle state. When the first program is moved required internal memory skyBetween exceed when system is the memory headroom of its advance planning and (need as moved higher ability characteristics partWhile wanting exented memory space), it is the internal memory for the second routine plan that system first program of can informing is occupied originallySpace.
Therefore, summarily say, embodiments of the invention are taking the minimum ability characteristic of program as according to planning space,And adjust according to required ability characteristics in the concurrent situation of miscellaneous service, in the time of compiling link only with minimumAbility characteristics space be as the criterion. The main principle of space planning adjustment is to have different stage space at those to needAfter the program of asking, and then place and can not produce concurrent program with the high-grade energy force characteristic of these programs.
Supposing a processor memory space that is of a size of N, need to be the first program, the second program, the 3rdRoutine plan memory headroom. At this, the first program, except core, also has the first ability characteristic portionDivide and the second ability characteristic part. Operation core need to be of a size of the memory headroom of N0. Operation firstAbility characteristics part need to be of a size of the first exented memory space of N1. Operation the second ability characteristic part needsThe size of wanting is larger, is the second exented memory space of N1+ Δ N. Move the second program and need to be of a size of N2Memory headroom. Move the memory headroom that the 3rd program need to be of a size of N3. At portable electric apptsIn environment for use, the first program, the 3rd program possibility concurrent running, but at least the second ability spy of the first programProperty part not can with the second program concurrent running, although core and the first ability characteristic part may be withThe second program concurrent running. At this, suppose N0+N1+ Δ N+N2+N3 > N, and N0+N1+N2+N3≤N. That is to say, have such occasion: cannot can ensure highest-capacity for all program advance planningsThe memory headroom of characteristic part (the second ability characteristic part of for example the first program) operation, but can be instituteThere is program advance planning to meet the memory headroom of lowest capability characteristic part operation. For this demand, thisThe memory headroom multiplexing method of a bright embodiment as shown in Figure 3, is below described its concrete steps.
First,, in step 310, be respectively multiple routine plan memory headrooms. For example, be aforesaid firstProgram, the second program and the 3rd routine plan memory headroom. At this, as step 312, by the first internal memory skyBetween 401 (being of a size of N0) be allocated to the core of the first program, and be the first ability spy of the first programProperty reserved the first exented memory space 402 (being of a size of N1) of part; As step 314, for example will be immediatelyThe second memory headroom 404 (being of a size of N2) after the first exented memory space 402 is allocated at least the secondProgram. In addition, for example, as step 316, before the first memory headroom 401 or the second memory headroom 404Afterwards, be the 3rd routine plan the 3rd memory headroom 406, be of a size of N3. Here, the order of planning canReplace arbitrarily. The space of planning is as shown in Fig. 4 left side, and wherein the 3rd memory headroom 406 is arranged at firstBefore memory headroom 401. At this, should meet N1+N2 >=N1+ Δ N.
In step 320, judge whether the first program has opened higher the second ability characteristic part.
As step 330, only to enable in the occasion of its first ability characteristic part in the first program, system can be led toKnow that the first program is used the first reserved exented memory space 402, therefore the first program will obtain sizeThe memory headroom of N0+N1, meets the operation of the first ability characteristic part. Now processor memory space keepsPlanning general layout shown in Fig. 4 left side.
But in the time enabling the second ability characteristic part of the first program, as step 340, system can be notifiedThe first program is used the second exented memory space, and this second exented memory space is actually in the first expansionDeposit the merging of space 402 and the second memory headroom 404. Although the second memory headroom 404 is not originally to drawGive the second program, can think that in the first program inside outside provides the memory headroom of required size like this,Be the second memory headroom 404 of the second routine plan and occupy originally, using required as the second ability characteristicExtra memory headroom Δ N, actual memory space hold is as shown in Fig. 4 right side. Due to the second program nowAnd off-duty, the therefore so not impact system of occupying operation. Like this, by the notice of this outside,And do not change physical memory space planning, reach the object of dynamic adjustment memory headroom.
In an embodiment of the present invention, the interface that system can be passed through each program (for example the first program) is to journeyOrder is notified spendable external memory space. When notice, system can be informed journey by the size of memory headroom and address thereofOrder.
Although in the description of embodiment above, the first program been has only has been occupied the internal memory sky of second programBetween, but be appreciated that the quantity of the second program can be multiple. Like this, in the time of the second program off-duty, fortuneThe first program of high-grade energy force characteristic part of having gone can be occupied the memory headroom of these the second programs.
For instance, in Video coding, video decode, audio coding, 4 kinds of Codec of audio decoder,Video coding possesses 2 kinds of ability characteristics, and QCIF and CIF, in video recording application, do not need to use audio frequency solutionCode and video decode, therefore two kinds of programmes are respectively as shown in Fig. 5 A and Fig. 5 B. At the sky of Video codingBetween in be also divided into inner space and space outerpace, space outerpace be placed on bottom. In the planning shown in Fig. 5 BIn scheme, if total space requirement when video decode operation high-grade energy force characteristic is size 3, can be withTime occupy the space of audio decoder and video decode.
In addition, in the time comprising multiple first program with different ability characteristics in equipment, can be according to above-mentionedEmbodiment respectively after the first memory headroom, is and then multiple the second program rule that can concurrent runningDraw the second memory headroom.
For instance, if Fig. 5 is A, add media playing service on the basis of the example of Fig. 5 B, need to lookFrequently decoding and audio decoder. And video decode can be divided into and support QCIF and CIF to suppose QCIF according to characteristicSpace requirement be size 1, the space requirement of CIF is size 3. Can be according to shown in Fig. 6 A, Fig. 6 BDivide. Carry out the media playing service of CIF video recording and CIF under this splitting scheme time, realityThe situation that takies in space as shown in Figure 7 A, 7 B.
Adopt the multiplexing method of embodiments of the invention, on spatial reuse without the support of overlay function,Each program pin only needs a storehouse to different ability characteristics, and outside also only need to be according to traffic performance by requiredSpace size notifying program, the adjustment of space planning is also more flexible.
Although the present invention discloses as above with preferred embodiment, so it is not in order to limit the present invention, Ren HebenThose skilled in the art, without departing from the spirit and scope of the present invention, when doing a little amendment and perfect,Therefore protection scope of the present invention is worked as with being as the criterion that claims were defined.