Embodiment
Below in conjunction with each accompanying drawing, embodiment of the present invention technical scheme main realized to principle, embodiment and the beneficial effect that should be able to reach is at length set forth.
The problem existing in order to solve prior art, the embodiment of the present invention provides a kind of method of processing note, and as shown in Figure 1, the method comprises:
Step 101, receive after current note, detect the note whether with the current note of storage and receive object, each note having configured in memory space receives the single ring architecture tandem array of object with unidirectional sensing;
Receive object if step 102 does not have the note of the current note of storage, judge that whether idle storage space is greater than the size of a note reception object, if so, creates note and receives object and add in single ring architecture;
Step 103, the note that current note is stored in to new establishment receive in object.
Concrete, in the memory space of telecom intelligent card, utilize multiple notes to receive the note that object storing received arrives.In prior art, the number of note reception object can not change, in the time there is no available array, empty by force an array of having placed note, deposit the note of current batch, if the note of storing in the array being cleared is not complete reception also, can cause like this note being emptied by force to be lost.
While receiving current note in the embodiment of the present invention, first detect the note reception object whether with the described current note of storage, each note having configured in memory space receives the single ring architecture tandem array of object with unidirectional sensing.While specifically detection, receive object as starting point take any one note in single ring architecture, receive the points relationship between object along each note, inquire about successively in each note reception object whether stored same batch of affiliated note of note; If store, determine 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 by note and receives in object; If not storage receives object as starting point take any one note in single ring architecture, receive the points relationship between object along each note, inquire about successively each note and receive and in object, whether there is idle note and receive object; If have, determine that idle note receives object and receives object as current note, note is stored in to current note and receives in object; If do not have, determine that the note without the current note of storage receives object.Or, receive object as starting point take any one note in single ring architecture, receive the points relationship between object along each note, inquire about successively in each note reception object whether stored same batch of affiliated note of note; Whether wherein, stored in receiving object in the process of same batch of note under note inquiring about successively each note, first idle note that mark traverses receives object; When same batch of note under not storing note, store current note into be labeled idle note and receive in object; Receive object if do not there is idle note, determine that the note without the current note of storage receives object.
Preferably, temporary object pointer is received to object as starting point to inquire about the note of initial pointed, receive the points relationship between object along each note, inquire about successively in each note reception object whether stored same batch of affiliated note of note; Wherein, inquire about initial pointer in the time of initialization for the first time, point to first note and receive object; Receive after 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 to described current note and receives in object, and will inquire about the current note reception of initial pointed object; If not storage receives object as starting point by temporary object pointer to inquire about the note of initial pointed, receive the points relationship between object along each note, inquire about successively each note and receive and in object, whether there is idle note and receive object; If have, determine that idle note receives object and receives object as current note, note is stored in to current note and receives in object, and will inquire about the current note reception of initial pointed object; If do not have, determine that the note without the described current note of storage receives object.Or described each note of inquiry receives in the process of whether having stored same batch of affiliated note of described note in object successively, first idle note that mark traverses receives object; When same batch of note under not storing described note, the idle note being labeled described in described current note is stored into receives in object; Receive object if do not there is idle note, determine that the note without the described current note of storage receives object.
In above-mentioned query script, temporary object pointer is received to object as starting point to inquire about the note of initial pointed, receive the points relationship between object along each note, inquiring about successively each note receives in the process of object, inquire about each note and receive after object, judge whether the next note reception object of short message enquiry reception objects point is the note reception object of the initial pointed of inquiry; If so, finish this inquiry, if not, inquiry continued.
In the technical scheme that the embodiment of the present invention provides, when in this memory space, the number of note reception object is at least two, first note is received to second note of objects point and receive object, by that analogy, last note is received to first note of objects point and receive object, tandem array forms the single ring architecture of unidirectional sensing; Wherein, when this first note reception object is initialization for the first time, note of first storage note receives object.As shown in Figure 2, note receives object 1 and points to note and receive object 2, note and receive object 2 and point to note and receive object 3, note and receive object 3 and point to note and receive object 4, note and receive object 4 and point to note and receive object 1, forms thus the single ring architecture of the unidirectional sensing of tandem array.Certainly, the sensing that this note receives between object is not limited to adjacent note reception object, for example, also note can be received to object 1 and point to note and receive object 3, note receives object 3 and points to note again and receive object 2, note and receive object 2 and point to note and receive object 4, note and receive object 4 and point to note and receive object 1.
In the time of initialization for the first time, inquire about above-mentioned first note of initial pointed and receive object; Receive after note, the note of this storage note of the initial pointed of this inquiry receives object.For example, the note of this reception receives object by initial this inquiry pointed the second note after being stored in the second note reception object.
After determining the note reception object without the current note of storage, judge whether idle storage space is greater than the size of a note reception object; If be greater than, create note reception object and add the single ring architecture with unidirectional sensing, tandem array to; If be not more than, any one note emptying in single ring architecture receives object, note is stored in to the note being cleared and receives in object.Preferably, the next note reception object that the note of inquiring about initial pointed is received to objects point empties as current note reception object, note is stored in to current note and receives in object, and will inquire about the current note reception of initial pointed object.
While creating new note reception object, receive object in each note of the single ring architecture tandem array with unidirectional sensing and break at least one address breach, delete and set number note reception object in address indentation, there, to between the two ends of the address breach after removal note reception object, set up points relationship, the note that forms new single ring architecture receives object structure.
While reducing note reception object, receive object in each note of the single ring architecture tandem array with unidirectional sensing and break at least one address breach, create new note and receive object, add at least one address breach to and receive object with upper and lower note and set up points relationship, the note that forms new single ring architecture receives object structure.Generally, idle note in memory space receives object when more, affect traversal speed, now can reduce several notes and receive object, note for example can be set and receive object threshold value, when detecting number that current note receives object and being greater than note and receiving object threshold value, carry out deleting short message and receive Object Operations.Certainly, can also carry out in other cases this deletion action.
Preferably, when user need to change the note reception object number for storing note, can require carrier server to send the format instruction that receives object number for changing note to telecom intelligent card terminal, this format instruction is carried first note of reshuffling and is received object number.Telecom intelligent card receives after this format instruction, resolves this format instruction, obtains the first note and receives object number.Then, this first note being received to the second note reception object number having configured in object number and memory space compares.According to comparative result, the number that the note of the single ring architecture tandem array with unidirectional sensing is received to object changes to the first note reception object number.According to different comparative results, carry out different operations, for example:
When the first note reception object number is greater than the second note reception object number, create note and receive object and add in described single ring architecture, receive object in each note of the single ring architecture tandem array with unidirectional sensing and break at least one address breach; Create new note and receive object, and add at least one address breach to and receive object with upper and lower note and set up points relationship, form have the first note receive object number, receive object structure with the note of the single ring architecture tandem array of unidirectional sensing.Suppose that the first note receives that object number is 6, to receive object number be 4 to the second note, explanation need to be added 2 new notes and receive objects.Now, as shown in Figure 3 a, note receives object 1 and points to note and receive object 2, note and receive object 2 and point to note and receive object 3, note and receive object 3 and point to note and receive object 4, note and receive object 4 and point to note and receive object 1, need to add new note reception object time, can disconnect note and receive the sensing between sensing and note reception object 3 and the note reception object 4 between object 1 and note reception object 2.As shown in Figure 3 b, create new note and receive object 5 and note reception object 6, then note is received to object 5 and add note to and receive object 1 and note and receive the address breach between object 2, and note is received to object 1 point to note and receive object 5, note is received to object 5 point to note and receive object 2; Note is received to object 6 and add the address breach between note reception object 3 and note reception object 4 to, and note is received to object 3 point to note and receive object 6, note is received to object 6 point to note and receive object 4, form thus have the first note receive object number, receive object structure with the note of the single ring architecture tandem array of unidirectional sensing.
When the first note reception object number is less than the second note reception object number, the note reducing in memory space receives object number, receives object break at least one address breach in each note of the single ring architecture tandem array with unidirectional sensing; Receive the difference between object number and the first note reception object number according to the second note, remove note receive object in address indentation, there, making remaining note receive object number is that the first note receives object number; To remove note and receive between the two ends of the address breach after object and set up points relationship, form have the first note receive object number, receive object structure with the note of the single ring architecture tandem array of unidirectional sensing.Suppose that the first note receives that object number is 4, to receive object number be 6 to the second note, explanation need to reduce by 2 notes and receive objects.As shown in Fig. 4 a, note is received to object 1 to be pointed to note and receives object 2, note and receive object 2 and point to note and receive object 3, by that analogy, note receives object 6 and points to note reception object 1, need to reduce note reception object time, can disconnect note and receive the sensing between sensing and note reception object 4 and the note reception object 5 between object 1 and note reception object 2.As shown in Figure 4 b, remove note and receive object 2, note is received to object 1 and point to note reception object 3, remove note and receive object 5, note is received to object 4 and points to note and receive object 6, form thus have the first note receive object number, receive object structure with the note of the single ring architecture tandem array of unidirectional sensing.Preferably, while removing note reception object, this note can be received to object and be set up garbage reclamation marker bit, by system the automatic recovery.
When the first note reception object number equals the second note reception object number, the number that does not need to revise note receiver address is described.
While revising the number of said short message reception object, can define the initial pointer of inquiry and temporary object pointer it is modified.In the time of initialization for the first time, above-mentioned first note of the initial pointed of this inquiry receives object; Receive after note, the note of this storage note of the initial pointed of this inquiry receives object.For example, the note of this reception receives object by initial this inquiry pointed the second note after being stored in the second note reception object.This temporary object pointer, to inquire about initial pointer as starting point, receives the sensing between object along each note, and each note of mobile enquiry receives the state of object successively.For example, in the time that the first note reception object number is greater than the second note reception object number, the note of obtaining the initial pointed of inquiry receives the next note reception object of objects point, and itself and temporary object pointer are set up to points relationship; The note that disconnects 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 object chain, note is received to object chain and add address breach to, and set up respectively the note that receives object and temporary object pointed with the note of the initial pointed of inquiry and receive the points relationship of object, form have the first note receive object number, receive object structure with the note of the single ring architecture tandem array of unidirectional sensing.Suppose that the first note receives that object number is 6, to receive object number be 4 to the second note, explanation need to be added 2 new notes and receive objects.Now, as shown in Figure 5 a, note receives object 1 and points to note and receive object 2, note and receive object 2 and point to note and receive object 3, note and receive object 3 and point to note and receive object 4, note and receive object 4 and point to note and receive object 1.Inquire about initial pointed note and receive object 1, now, temporary object pointed note is received to the note reception object that object 1 points to, note receives object 2, then disconnects note reception object 1 and note and receives the sensing between object 2.As shown in Figure 5 b, create that new note receives object 5 and note receives object 6, and note is received to object 5 point to note and receive object 6, form end to end note and receive object chain.Then, note is received to object 1 and point to note reception object 5, note is received to object 6 and point to note reception object 2.Form thus have the first note receive object number, receive object structure with the note of the single ring architecture tandem array of unidirectional sensing.
When the first note reception object number is less than the second note reception object number, the note of obtaining the initial pointed of inquiry receives the next note reception object of objects point, and itself and temporary object pointer are set up to points relationship; Receive the difference between object number and the first note reception object number according to the second note, take the note address of temporary object pointed as original position, remove successively note along the points relationship between each note address and receive object, calculated address breach; To between the two ends of address breach, set up points relationship, form have the first note receive object number, receive object structure with the note of the single ring architecture tandem array of unidirectional sensing.Suppose that the first note receives that object number is 4, to receive object number be 6 to the second note, explanation need to reduce by 2 notes and receive objects.As shown in Figure 6 a, note is received to object 1 to be pointed to note and receives object 2, note and receive object 2 and point to note and receive object 3, by that analogy, note receives object 6 and points to note reception object 1, need to reduce by 2 notes reception objects time, inquire about initial pointed note and receive object 1, now, temporary object pointed note is received to the note reception object that object 1 points to, be that note receives object 2, then disconnect note and receive the sensing between object 1 and note reception object 2.As shown in Figure 6 b, take the note address of temporary object pointed as original position, remove successively along the points relationship between each note address that note receives object 2 and note receives object 3, calculated address breach.Then, will between the two ends of address breach, set up points relationship, receive object 1 by note and point to note and receive object 4, form have the 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, the processing note that the use embodiment of the present invention provides receives the method for object, adopt loop configuration that the note in memory space is received to object tandem array, while receiving note, if desired change note and receive object number, disconnect the single ring architecture of unidirectional sensing, in the breach of address, add or remove note receiving object, can in the time receiving note, on-the-fly modify thus the number of note reception object.
The method that the processing note embodiment of the present invention being provided below by specific embodiment receives object is elaborated.
In the time that telecommunication intelligent calorie requirement change note receives object number, as shown in Figure 7, comprise the following steps:
Step 701, reception receive the format instruction of object number for changing note; Concrete, preset system application on telecom intelligent card, on java telecom intelligent card, this system applies is called applet.Applet register format instruction event, establishing and registering parameter TAR value is X.This event effect is that the format instruction that an index value TAR is X value can activate this application.
If client need to change the number that the note of telecom intelligent card receives, 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 meeting activates the application applet of telecom intelligent card, reconfigures the number of note reception object.
Step 702, resolve this format instruction, obtain the note storage number N of reshuffling;
Step 703, the note of reshuffling is received to object number N and the note that configured receives object number M and compares; If N equates with M, logs off; If N and M are unequal, perform step 704;
The sensing that step 704, the note that note reception object and the temporary pointer of inquiry pointed are pointed to receive between object disconnects; Concrete, the note of obtaining inquiry pointed receives object, and the next note of temporary pointer being pointed to this note reception objects point receives object.Disconnect these two notes and receive after the sensing between objects, annular note receives object structure and becomes note and receive object chain, and it is that first-in-chain(FIC), temporary pointer point to this note to receive object be 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 configured receives the difference between object number M, in the time that this difference is positive number, execution step 706; In the time that this difference is negative, execution step 707;
Step 706, create new note receive object according to difference, and the note of inquiry pointed is received to the note that objects point is new receive object, the note that new note is received to objects point temporary object pointed receives object.
Step 707, according to difference, receive object as starting point take the note of temporary object pointed, receive the sensing between object according to each note, the note of removing respective number receives object.
In above-mentioned steps 706, when creating and adding multiple new notes reception object, the multiple notes that create can be received to objects composition notes and receive object chains, then disposable interpolation; Also the note that can add one by one establishment receives object.Same, in 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 of changing note reception object number, while receiving note, as shown in Figure 8, comprises the following steps:
Step 801, while receiving current note, detect the note whether with the current note of storage and receive object; If have, store this current note; If do not have, perform step 802;
Step 802, judge that idle storage space is greater than note and receives the size of object; If be greater than, execution step 803; If be not more than, execution step 804;
Step 803, establishment note receive object and add the single ring architecture with unidirectional sensing, tandem array to; Detailed process refers to the description in above-described embodiment, does not repeat them here.
Step 804, the next note that the note of the initial pointed of inquiry is received to objects point receive object and empty as current note and receive object, note is stored in to current note and receives in object, and will inquire about the current note reception of initial pointed object.
Realize the detailed process of above-mentioned steps 801 as shown in Figure 9, comprise the following steps:
Step 901, temporary object pointer is received to object as starting point to inquire about the note of initial pointed, receive the points relationship between object along each note, inquire about successively each note and receive object;
Step 902, judge that each note receives the same batch of note of whether having stored in object under this note; If store, determine that the note of having stored same batch of note under this note receives object and receives object as current note, this note is stored in to described current note and receives in object, and will inquire about current note reception object described in initial pointed; If not storage, execution step 903;
Step 903, described temporary object pointer is received to object as starting point take the note of the initial pointed of described inquiry, receive the points relationship between object along each note, inquire about successively each note and receive and in object, whether there is idle note and receive object; If have, determine that idle note receives object and receives object as current note, this note is stored in to described current note and receives in object, and will inquire about current note reception object described in initial pointed; If do not have, execution step 904;
Step 904, the next note that the note of the initial pointed of inquiry is received to objects point receive object and empty as current note and receive object, this note is stored in to described current note and receives in object, and will inquire about current note reception object described in initial pointed.
Inquire about successively in the process of described each note reception object, inquire about each note and receive after object, judge whether the next note reception object of short message enquiry reception objects point is the note reception object of the initial pointed of inquiry; If so, finish this inquiry, if not, inquiry continued.
Pass through foregoing description, can find out, the method of the processing note that the use embodiment of the present invention provides, adopt loop configuration that the note in memory space is received to object tandem array, while receiving note, if desired change note and receive object number, disconnect the single ring architecture of unidirectional sensing, in the breach of address, add or remove note receiving object, can in the time receiving note, on-the-fly modify thus the number of note reception object.
Based on same inventive concept, the embodiment of the present invention also provides a kind of device of processing note, as shown in figure 10, comprising:
Detection module 1001, for receiving after current note, detects the note reception object whether with the described current note of storage, and each note having configured in memory space receives the single ring architecture tandem array of object with unidirectional sensing;
Judge module 1002, the note for detecting when detection module 1001 without the described current note of storage receives object, judges whether idle storage space is greater than the size of a note reception object;
Creation module 1003, judges that for described judge module 1002 idle storage space is greater than the size of a note reception object, creates note and receives object and add in described single ring architecture;
Memory module 1004, receives object for the note that described current note is stored in to new establishment.
Preferably, detection module 1001, as starting point, receive points relationship object between along each note specifically for any one note reception object take in described single ring architecture, in described each note reception object of inquiry, whether stored same batch of affiliated note of described note successively; If store, determine that the note of having stored same batch of affiliated note of described note receives object as current note reception object, is stored in described current note by described note and receives in object; If do not store, receive object as starting point take any one note in described single ring architecture, receive the points relationship between object along each note, in described each note reception object of inquiry, whether there is idle note successively and receive object; If have, determine that the note of described free time receives object as current note reception object, described note is stored in to described current note and receives in object; If do not have, determine that the note without the described current note of storage receives object; Or
Take any one note reception object in described single ring architecture as starting point, receive the points relationship between object along each note, in described each note reception object of inquiry, whether store same batch of affiliated note of described note successively; Whether wherein, stored in receiving object in the process of same batch of note under described note inquiring about successively described each note, first idle note that mark traverses receives object; When same batch of note under not storing described note, the idle note being labeled described in described current note is stored into receives in object; Receive object if do not there is idle note, determine that the note without the described current note of storage receives object.
Preferably, judge module 1002 judges that when idle storage space is not more than note and receives object big or small, notice empties module 1005;
Empty module 1005, receive object for any one note that empties described single ring architecture, described note is stored in to the note being cleared and receives in object.
Preferably, creation module 1003, receive object specifically for each note of the single ring architecture tandem array with unidirectional sensing and break at least one address breach, create new note and receive object, add described at least one address breach to and receive object with upper and lower note and set up points relationship, the note that forms new single ring architecture receives object structure.
Preferably, this device also comprises: reduce module 1006, break at least one address breach for receiving object in each note of the single ring architecture tandem array with unidirectional sensing, delete and set number note reception object in described address indentation, there, to between the two ends of the address breach after removal note reception object, set up points relationship, the note that forms new single ring architecture receives object structure.
Based on same inventive concept, the embodiment of the present invention also provides a kind of telecom intelligent card, comprising: the device of above-mentioned processing note.
Pass through foregoing description, can find out, method, device and the smart card of the processing note that the use embodiment of the present invention provides, adopt loop configuration that the note in memory space is received to object tandem array, while receiving note, if desired change note and receive object number, disconnect the single ring architecture of unidirectional sensing, in the breach of address, add or remove note receiving object, can in the time receiving note, on-the-fly modify thus the number of note reception object.
Those skilled in the art should understand, embodiments of the invention can be provided as method, system or computer program.Therefore, the present invention can adopt complete hardware implementation example, completely implement software example or the form in conjunction with the embodiment of software and hardware aspect.And the present invention can adopt the form at one or more upper computer programs of implementing of computer-usable storage medium (including but not limited to magnetic disc store, CD-ROM, optical memory etc.) that wherein include computer usable program code.
The present invention is with reference to describing according to flow chart and/or the block diagram of the method for the embodiment of the present invention, equipment (system) and computer program.Should understand can be by the flow process in each flow process in computer program instructions realization flow figure and/or block diagram and/or square frame and flow chart and/or 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, the instruction that makes to carry out by the processor of computer or other programmable data processing device produces the device for realizing the function of specifying at flow process of flow chart or multiple flow process and/or square frame of block diagram or multiple square frame.
These computer program instructions also can be stored in energy vectoring computer or the computer-readable memory of other programmable data processing device with ad hoc fashion work, the instruction that makes to be stored in this computer-readable memory produces the manufacture that comprises command device, and this command device is realized the function of specifying in flow process of flow chart or multiple flow process and/or square frame of block diagram or multiple square frame.
These computer program instructions also can be loaded in computer or other programmable data processing device, make to carry out sequence of operations step to produce computer implemented processing on computer or other programmable devices, thereby the instruction of carrying out is provided for realizing the step of the function of specifying in flow process of flow chart or multiple flow process and/or square frame of block diagram or multiple square frame on computer or other programmable devices.
Although described the preferred embodiments of the present invention, once those skilled in the art obtain the basic creative concept of cicada, can make other change and modification to these embodiment.So claims are intended to be interpreted as comprising preferred embodiment and fall into all changes and the modification of the scope of the invention.
Obviously, those skilled in the art can carry out various changes and modification and not depart from the spirit and scope of the present invention the present invention.Like this, if within of the present invention these are revised and modification belongs to the scope of the claims in the present invention and equivalent technologies thereof, the present invention is also intended to comprise these changes and modification interior.