Embodiment
At length set forth to the main realization principle of embodiment of the invention technical scheme, embodiment and to the beneficial effect that should be able to reach below in conjunction with each accompanying drawing.
In order to solve the problem that prior art exists, the embodiment of the invention provides a kind of method of handling note, and is as shown in Figure 1, and this method comprises:
Step 101, receive current note after, detect the note whether have the current note of storage and receive object, each note that has disposed in the memory space receives the single ring architecture tandem array of object with unidirectional sensing;
Step 102, receive object, judge that then whether idle storage space receives the size of object greater than a note, if then create note and receive object and add in the single ring architecture if do not have the note of the current note of storage;
Step 103, the note that current note is stored in new establishment receive in the object.
Concrete, in the memory space of telecom intelligent card, utilize a plurality of notes to receive the note that object storage receives.The number of note reception object can not change in the prior art; When not having available array, empty an array of having placed note by force, deposit current batch note; If the also not complete reception of short messages stored in the array that is cleared, the note that can cause like this being emptied is by force lost.
When receiving current note in the embodiment of the invention, detect the note that whether has the said current note of storage earlier and receive object, each note that has disposed in the memory space receives the single ring architecture tandem array of object with unidirectional sensing.When specifically detecting, receiving object with any note in the single ring architecture is starting point, receives the points relationship between object along each note, inquires about each note successively and receives whether stored same batch of affiliated note of note in object; If store, confirm that the note of having stored same batch of affiliated note of note receives object as current note reception object, is stored in current note with note and receives in the object; If do not store, receiving object with any note in the single ring architecture is starting point, receives the points relationship between object along each note, inquires about each note successively and receives whether have idle note reception object in object; If have, confirm that then idle note receives object and receives object as current note, note is stored in current note receives in the object; If do not have, confirm that then the note that does not have the current note of storage receives object.Perhaps, receiving object with any note in the single ring architecture is starting point, receives the points relationship between the object along each note, inquires about each note successively and receives whether stored same batch of affiliated note of note in the object; Wherein, receive in the process of whether having stored same batch of note under the note in object inquiring about each note successively, first idle note that mark traverses receives object; During same batch of note under not storing note, store current note into be labeled idle note and receive in the object; Do not receive object if do not have idle note, confirm that then the note that does not have the current note of storage receives object.
Preferable, it is starting point that the temporary object pointer is received object with the note of inquiring about initial pointed, receives the points relationship between the object along each note, inquires about each note successively and receives whether stored same batch of affiliated note of note in the object; Wherein, inquire about initial pointer when first time initialization, point to first note and receive object; After receiving note, the note of inquiring about this storage note of initial pointed receives object; If store, definite note of having stored same batch of affiliated note of note receives object and receives object as current note, note is stored in said current note receives in the object, and will inquire about the current note reception of initial pointed object; If do not store, it is starting point that the temporary object pointer is received object with the note of inquiring about initial pointed, receives the points relationship between object along each note, inquires about each note successively and receives whether have idle note reception object in object; If have, then definite idle note receives object and receives object as current note, note is stored in current note receives in the object, and will inquire about the current note reception of initial pointed object; If do not have, confirm that then the note that does not have the said current note of storage receives object.Perhaps inquire about said each note successively and receive in the process of whether having stored same batch of affiliated note of said note in the object, first idle note that mark traverses receives object; During same batch of note under not storing said note, store said current note into the said idle note that is labeled and receive in the object; Do not receive object if do not have idle note, confirm that then the note that does not have the said current note of storage receives object.
In the above-mentioned query script; It is starting point that the temporary object pointer is received object with the note of inquiring about initial pointed; Receive the points relationship between the object along each note; Inquire about each note successively and receive in the process of object, inquire about after each note receives object, judge that whether next note that short message enquiry receives objects point receives object is that the note of the initial pointed of inquiry receives object; If, finish this inquiry, if not, inquiry continued.
In the technical scheme that the embodiment of the invention provides; When the number of note reception object is at least two in this memory space; First note is received second note of objects point receive object; By that analogy, last note is received first note of objects point receive object, tandem array constitutes the single ring architecture of unidirectional sensing; Note of first storage note received object when wherein, this first note reception object was initialization for the first time.As shown in Figure 2; Note reception object 1 sensing note reception object 2, note receive object 2 sensing notes reception objects 3, note reception object 3 sensing notes receive objects 4, note reception object 4 sensing notes reception objects 1, constitute the single ring architecture of the unidirectional sensing of tandem array thus.Certainly; The sensing that this note receives between the object is not limited to adjacent note reception object; For example; Also can note be received object 1 and point to note reception object 3, note reception object 3 points to note reception object 2 again, note reception object 2 points to note reception object 4, note reception object 4 sensing notes reception objects 1.
When first time initialization, inquire about above-mentioned first note of initial pointed and receive object; After receiving note, this note of inquiring about this storage note of initial pointed receives object.For example, the note of this reception is stored in second note and receives after the object, should inquire about initial pointed second note and receive object.
After the note of confirming not have the current note of storage receives object, judge that idle storage space is whether greater than the size of a note reception object; If greater than, then create note reception object and add single ring architecture to unidirectional sensing, tandem array; If be not more than, any note that then empties in the single ring architecture receives object, note is stored in the note that is cleared receives in the object.Preferable, the next note reception object that the note of inquiring about initial pointed is received objects point empties as current note reception object, note is stored in current note receives in the object, and will inquire about the current note reception of initial pointed object.
When creating new note reception object; Receive object in each note and break at least one address breach with the single ring architecture tandem array of unidirectional sensing; The indentation, there deletion is set the number note and is received object in the address; Set up points relationship between the two ends with the address breach behind the removal note reception object, the note that forms new single ring architecture receives object structure.
When reducing note reception object; Receive object in each note and break at least one address breach with the single ring architecture tandem array of unidirectional sensing; Create new note and receive object; Add at least one address breach to and receive object and set up points relationship, forms the note reception object structure of new single ring architecture with note up and down.Generally speaking; Idle note in the memory space receives object more for a long time; Influence traversal speed, can reduce several notes this moment and receive object, note for example can be set receive the object threshold value; When detecting number that current note receives object and receiving the object threshold value, carry out the deletion note and receive Object Operations greater than note.Certainly, can also carry out this deletion action in other cases.
Preferable; The user need change when being used for storing the note reception object number of note; Can require carrier server to send to the telecom intelligent card terminal and be used to change the format instruction that note receives object number, this format instruction is carried first note of reshuffling and is received object number.Telecom intelligent card is resolved and should format be instructed after receiving this format instruction, obtains first note and receives object number.Then, this first note being received second note reception object number that has disposed in object number and the memory space compares.According to comparative result, the number that will receive object with the note of the single ring architecture tandem array of unidirectional sensing changes to first note and receives object number.According to different comparative results, carry out different operation, for example:
When first note receives object number greater than second note reception object number; Promptly create note and receive object and add in the said single ring architecture, receive object in each note and break at least one address breach with the single ring architecture tandem array of unidirectional sensing; Create new note and receive object, and add at least one address breach to and receive object and set up points relationship with note up and down, form have first note receive object number, receive object structure with the note of the single ring architecture tandem array of unidirectional sensing.Suppose that it is that 6, second note reception object number is 4 that first note receives object number, explains that needing to add 2 new notes receives objects.At this moment; Shown in Fig. 3 a; Note reception object 1 sensing note reception object 2, note receive object 2 sensing notes reception objects 3, note reception object 3 sensing notes receive objects 4, note reception object 4 sensing notes reception objects 1; When needing the new note of interpolation to receive object, sensing and the note that can break off between note reception object 1 and the note reception object 2 receive the sensing between object 3 and the note reception object 4.Shown in Fig. 3 b; Create new note and receive object 5 and note reception object 6; Then note is received object 5 and add the address breach between note reception object 1 and the note reception object 2 to, and note is received object 1 sensing note reception object 5, note is received object 5 sensing notes reception objects 2; Note is received object 6 add the address breach between note reception object 3 and the note reception object 4 to; And note is received object 3 point to notes and receive objects 6, note is received object 6 point to notes and receive objects 4, form thus have first note receive object number, receive object structure with the note of the single ring architecture tandem array of unidirectional sensing.
When first note received object number and receives object number less than second note, the note that reduces in the memory space received object number, received object in each note with the single ring architecture tandem array of unidirectional sensing and broke at least one address breach; Receive the difference between object number and first note reception object number according to second note, indentation, there is removed note and is received object in the address, and making remaining note receive object number is that first note receives object number; Receive between the two ends of the address breach behind the object and set up points relationship removing note, form have first note receive object number, receive object structure with the note of the single ring architecture tandem array of unidirectional sensing.Suppose that it is that 4, second note reception object number is 6 that first note receives object number, explains that needing to reduce 2 notes receives objects.Shown in Fig. 4 a; Note is received object 1 to be pointed to note and receives object 2, note and receive object 2 and point to notes and receive objects 3, by that analogy; Note receives object 6 and points to note reception object 1; When needing the minimizing note to receive object, sensing and the note that can break off between note reception object 1 and the note reception object 2 receive the sensing between object 4 and the note reception object 5.Shown in Fig. 4 b; Remove note and receive object 2; Note is received object 1 point to note reception object 3; Remove note and receive object 5, note is received object 4 point to notes and receive objects 6, form thus have first note receive object number, receive object structure with the note of the single ring architecture tandem array of unidirectional sensing.Preferable, when removing note reception object, can this note be received object and put the garbage reclamation marker bit, reclaim automatically by system.
When first note reception object number equals second note reception object number, the number that need not revise the note receiver address is described.
When revising the number of said short message reception object, can define initial pointer of inquiry and temporary object pointer it is made amendment.When first time initialization, this is inquired about above-mentioned first note of initial pointed and receives object; After receiving note, this note of inquiring about this storage note of initial pointed receives object.For example, the note of this reception is stored in second note and receives after the object, should inquire about initial pointed second note and receive object.This temporary object pointer is a starting point to inquire about initial pointer, receives the sensing between the object along each note, and each note of mobile enquiry receives the state of object successively.For example, when first note received object number greater than second note reception object number, the note of obtaining the initial pointed of inquiry received the next note reception object of objects point, and itself and temporary object pointer are set up points relationship; The note of breaking off the initial pointed of inquiry receives the sensing between object and its next note reception object, forms an address breach; Create end to end note and receive the object chain; Note is received the object chain add the address breach to; And set up the points relationship that note that note with the initial pointed of inquiry receives object and temporary object pointed receives object respectively, form have first note receive object number, with the note reception object structure of the single ring architecture tandem array of unidirectional sensing.Suppose that it is that 6, second note reception object number is 4 that first note receives object number, explains that needing to add 2 new notes receives objects.At this moment, shown in Fig. 5 a, note reception object 1 sensing note reception object 2, note receive object 2 sensing notes reception objects 3, note reception object 3 sensing notes receive objects 4, note reception object 4 sensing notes reception objects 1.Inquire about initial pointed note and receive object 1, at this moment, the note that temporary object pointed note reception object 1 is pointed to receives object, and promptly note receives object 2, breaks off note then and receives the sensing between object 1 and the note reception object 2.Shown in Fig. 5 b, create new note and receive object 5 and note reception object 6, and note is received object 5 sensing notes reception objects 6, form end to end note and receive the object chain.Then, note is received object 1 point to note reception object 5, note is received object 6 point to notes reception objects 2.Form thus have first note receive object number, receive object structure with the note of the single ring architecture tandem array of unidirectional sensing.
When first note received object number less than second note reception object number, the note of obtaining the initial pointed of inquiry received the next note reception object of objects point, and itself and temporary object pointer are set up points relationship; Receive the difference between object number and first note reception object number according to second note; Note address with the temporary object pointed is an original position; Remove note successively along the points relationship between each note address and receive object, calculated address breach; Set up points relationship between the two ends with the address breach, form have first note receive object number, receive object structure with the note of the single ring architecture tandem array of unidirectional sensing.Suppose that it is that 4, second note reception object number is 6 that first note receives object number, explains that needing to reduce 2 notes receives objects.Shown in Fig. 6 a, note is received object 1 point to note and receive object 2, note and receive object 2 and point to notes and receive objects 3, by that analogy, note receives object 6 and points to notes and receive objects 1; When needing to reduce 2 notes reception objects; Inquire about initial pointed note and receive object 1, at this moment, temporary object pointed note is received the note reception object that object 1 points to; Be that note receives object 2, break off note then and receive the sensing between object 1 and the note reception object 2.Shown in Fig. 6 b, be original position with the note address of temporary object pointed, remove note successively along the points relationship between each note address and receive object 2 and receive object 3, calculated address breach with note.Then, set up points relationship between the two ends with the address breach, be about to note and receive object 1 and point to note and receive object 4, form have first note receive object number, receive object structure with the note of the single ring architecture tandem array of unidirectional sensing.
Pass through foregoing description; Can find out that the processing note of using the embodiment of the invention to provide receives the method for object, adopt loop configuration that the note in the memory space is received the object tandem array; Receive object number if need to change note when receiving note; Break off the single ring architecture of unidirectional sensing, in the breach of address, add or remove note receiving object, can when receiving note, on-the-fly modify the number that note receives object thus.
The method that the processing note that through specific embodiment the embodiment of the invention is provided below receives object is elaborated.
When telecommunication intelligent calorie requirement change note receives object number, as shown in Figure 7, may further comprise the steps:
Step 701, reception are used to change the format instruction that note receives object number; Concrete, preset system is used on the telecom intelligent card, and this system applies is called applet on the java telecom intelligent card.Applet register format instruction incident is established registration parameter TAR value and is X.This incident effect is that the format instruction that an index value TAR is the X value can activate this application.
If the client need change the number that the note of telecom intelligent card receives, then require the server of operator to send a wiht strip-lattice type instruction to telecom intelligent card, the form of the secure data part in this format instruction is:
This wiht strip-lattice type instruction can activate the application applet of telecom intelligent card, reconfigures the number that note receives object.
Step 702, parsing should be instructed in format, obtain the note storage number N of reshuffling;
Step 703, the note of reshuffling is received object number N and the note that disposed receives object number M and compares; If N equates with M, then log off; If N and M are unequal, then execution in step 704;
The sensing that the note of step 704, the note reception object that will inquire about pointed and temporary pointer sensing receives between the object is broken off; Concrete, the note of obtaining the inquiry pointed receives object, and temporary pointer is pointed to the next note reception object that this note receives objects point.After breaking off the sensing between these two notes reception objects, annular note reception object structure becomes note and receives the object chain, and it is that first-in-chain(FIC), this note reception object of temporary pointer sensing are last-of-chain that the note of inquiry pointed receives object.
Step 705, obtain that the note of reshuffling receives object number N and the note that disposed receives the difference between the object number M, when this difference is positive number, execution in step 706; When this difference is negative, execution in step 707;
Step 706, create new note according to difference and receive object, and the note that will inquire about pointed receives the new note of objects point and receive object, new note is received the note reception object of objects point temporary object pointed.
Step 707, according to difference, receiving object with the note of temporary object pointed is starting point, receives the sensing between object according to each note, the note of removing respective number receives object.
In the above-mentioned steps 706, create and add a plurality of new notes when receiving object, can a plurality of notes of creating be received objects and form notes and receive object chains, disposable then the interpolation; The note that also can add establishment one by one receives object.Same, in the above-mentioned steps 707, note that can disposable removal respective number receives object, also can remove one by one.
Telecom intelligent card adopts the above-mentioned loop configuration that note receives object number of changing, and is as shown in Figure 8 when receiving note, may further comprise the steps:
Step 801, when receiving current note, detect the note that whether has the current note of storage and receive object; If have, then store this current note; If do not have, then execution in step 802;
Step 802, judgement idle storage space receive the size of object greater than a note; If greater than, execution in step 803; If be not more than execution in step 804;
Step 803, establishment note receive object and add the single ring architecture with unidirectional sensing, tandem array to; Detailed process sees also the description in the foregoing description, repeats no more at this.
The next note that step 804, the note that will inquire about initial pointed receive objects point receives object and empties as current note and receive object, note is stored in current note receives in the object, and will inquire about the current note reception of initial pointed object.
The detailed process that realizes above-mentioned steps 801 is as shown in Figure 9, may further comprise the steps:
Step 901, the temporary object pointer is received object with the note of inquiring about initial pointed is starting point, receives the points relationship between object along each note, inquires about each note successively and receives object;
Step 902, judge that each note receives the same batch of note of whether having stored in object under this note; If store, definite note of having stored same batch of affiliated note of this note receives object and receives object as current note, this note is stored in said current note receives in the object, and will inquire about the said current note reception object of initial pointed; If not storage, execution in step 903;
Step 903, said temporary object pointer is received object with the note of the initial pointed of said inquiry is starting point, receives the points relationship between object along each note, inquires about each note successively and receives and whether have idle note in object and receive object; If have, then definite idle note receives object and receives object as current note, this note is stored in said current note receives in the object, and will inquire about the said current note reception object of initial pointed; If do not have execution in step 904;
The next note that step 904, the note that will inquire about initial pointed receive objects point receives object and empties as current note and receive object; This note is stored in said current note receives in the object, and will inquire about the said current note reception object of initial pointed.
Inquire about said each note successively and receive in the process of object, inquire about after each note receives object, judge that whether next note that short message enquiry receives objects point receives object is that the note of the initial pointed of inquiry receives object; If, finish this inquiry, if not, inquiry continued.
Pass through foregoing description; Can find out that the method for the processing note that the use embodiment of the invention provides adopts loop configuration that the note in the memory space is received the object tandem array; Receive object number if need to change note when receiving note; Break off the single ring architecture of unidirectional sensing, in the breach of address, add or remove note receiving object, can when receiving note, on-the-fly modify the number that note receives object thus.
Based on same inventive concept, the embodiment of the invention also provides a kind of device of handling note, and is shown in figure 10, comprising:
Detection module 1001, be used to receive current note after, detect the note whether have the said current note of storage and receive object, each note that has disposed in the memory space receives the single ring architecture tandem array of object with unidirectional sensing;
Judge module 1002 is used for receiving object when detection module 1001 detects the note that does not have the said current note of storage, judges that idle storage space is whether greater than the size of a note reception object;
Create module 1003, be used for said judge module 1002 and judge that idle storage space receive the size of object greater than a note, then create note and receive object and add in the said single ring architecture;
Memory module 1004, the note that is used for said current note is stored in new establishment receives object.
Preferable; Detection module 1001; Any note reception object that specifically is used for said single ring architecture is a starting point, receives the points relationship between object along each note, inquires about said each note successively and receives whether stored same batch of affiliated note of said note in object; If store, confirm that the note of having stored same batch of affiliated note of said note receives object as current note reception object, is stored in said current note with said note and receives in the object; If do not store, receiving object with any note in the said single ring architecture is starting point, receives the points relationship between object along each note, inquires about said each note successively and receives whether have idle note reception object in object; If have, confirm that then the note of said free time receives object as current note reception object, said note is stored in said current note receives in the object; If do not have, confirm that then the note that does not have the said current note of storage receives object; Perhaps
Receiving object with any note in the said single ring architecture is starting point, receives the points relationship between the object along each note, inquires about said each note successively and receives whether stored same batch of affiliated note of said note in the object; Wherein, receive in the process of whether having stored same batch of note under the said note in object inquiring about said each note successively, first idle note that mark traverses receives object; During same batch of note under not storing said note, store said current note into the said idle note that is labeled and receive in the object; Do not receive object if do not have idle note, confirm that then the note that does not have the said current note of storage receives object.
Preferable, judge module 1002 judges that notice emptied module 1005 when idle storage space were not more than a note and receive object big or small;
Empty module 1005, be used for emptying any note reception object of said single ring architecture, said note is stored in the note that is cleared receives in the object.
Preferable; Create module 1003; Specifically be used for receiving object and break at least one address breach in each note with the single ring architecture tandem array of unidirectional sensing; Create new note and receive object, add said at least one address breach to and receive object and set up points relationship, forms the note reception object structure of new single ring architecture with note up and down.
Preferable; This device also comprises: reduce module 1006; Be used for receiving object and break at least one address breach in each note with the single ring architecture tandem array of unidirectional sensing; The indentation, there deletion is set the number note and is received object in said address, sets up points relationship between the two ends with the address breach behind the removal note reception object, and the note that forms new single ring architecture receives object structure.
Based on same inventive concept, the embodiment of the invention also provides a kind of telecom intelligent card, comprising: the device of above-mentioned processing note.
Pass through foregoing description; Can find out that method, device and the smart card of the processing note that the use embodiment of the invention provides adopt loop configuration that the note in the memory space is received the object tandem array; Receive object number if need to change note when receiving note; Break off the single ring architecture of unidirectional sensing, in the breach of address, add or remove note receiving object, can when receiving note, on-the-fly modify the number that note receives object thus.
Those skilled in the art should understand that embodiments of the invention can be provided as method, system or computer program.Therefore, the present invention can adopt the form of the embodiment of complete hardware embodiment, complete software implementation example or combination software and hardware aspect.And the present invention can be employed in the form that one or more computer-usable storage medium (including but not limited to magnetic disc store, CD-ROM, optical memory etc.) that wherein include computer usable program code go up the computer program of implementing.
The present invention is that reference is described according to the flow chart and/or the block diagram of method, equipment (system) and the computer program of the embodiment of the invention.Should understand can be by the flow process in each flow process in computer program instructions realization flow figure and/or the block diagram and/or square frame and flow chart and/or the block diagram and/or the combination of square frame.Can provide these computer program instructions to the processor of all-purpose computer, special-purpose computer, Embedded Processor or other programmable data processing device to produce a machine, make the instruction of carrying out through the processor of computer or other programmable data processing device produce to be used for the device of the function that is implemented in flow process of flow chart or a plurality of flow process and/or square frame of block diagram or a plurality of square frame appointments.
These computer program instructions also can be stored in ability vectoring computer or the computer-readable memory of other programmable data processing device with ad hoc fashion work; Make the instruction that is stored in this computer-readable memory produce the manufacture that comprises command device, this command device is implemented in the function of appointment in flow process of flow chart or a plurality of flow process and/or square frame of block diagram or a plurality of square frame.
These computer program instructions also can be loaded on computer or other programmable data processing device; Make on computer or other programmable devices and to carry out the sequence of operations step producing computer implemented processing, thereby the instruction of on computer or other programmable devices, carrying out is provided for being implemented in the step of the function of appointment in flow process of flow chart or a plurality of flow process and/or square frame of block diagram or a plurality of square frame.
Although described the preferred embodiments of the present invention, in a single day those skilled in the art get the basic inventive concept could of cicada, then can make other change and modification to these embodiment.So accompanying claims is intended to be interpreted as all changes and the modification that comprises preferred embodiment and fall into the scope of the invention.
Obviously, those skilled in the art can carry out various changes and modification to the present invention and not break away from the spirit and scope of the present invention.Like this, belong within the scope of claim of the present invention and equivalent technologies thereof if of the present invention these are revised with modification, then the present invention also is intended to comprise these changes and modification interior.