Method and terminal for processing short message are provided, wherein the method includes: when a short message is received, an index identifier corresponding to the short message is created, and the index identifier is stored into a preset index file, and the short message is stored into a preset message file according to the index identifier. The method performs processes to short message in storage space of mobile terminal according to actual data length of short message, and stores as many short messages as possible in limited storage space.
|
1. A method for processing short message, comprising:
a mobile terminal receiving a short message, and creating an index identifier corresponding to the short message, wherein the index identifier comprises: an index number, an index storage address corresponding to the index number and a data length of a short message corresponding to the index number;
the mobile terminal storing the index identifier in a preset index file of an SIM card of the mobile terminal; and
the mobile terminal storing the short message in a preset message file of the SIM card of the mobile terminal according to the index identifier;
wherein the step of creating the index identifier corresponding to the short message comprises:
searching the index file;
obtaining an index number of the short message and an index storage address of the short message according to the index file; and
obtaining a data length of the short message;
wherein the step of obtaining the index number of the short message and the index storage address of the short message according to the index file comprises:
adding an index number sequentially after a previous index number in the index file to obtain the index number of the short message; and
adding a data length of a short message corresponding to the previous index number to an index storage address corresponding to the previous index number to obtain the index storage address of the short message;
wherein the step of storing the short message in the preset message file according to the index identifier comprises:
searching the message file;
shifting in the message file to the index storage address of the short message in the index identifier; and
storing the short message in the message file according to the index storage address of the short message.
4. A mobile terminal for processing short message, comprising a hardware processor configured to execute the following modules:
a receiving module, configured to receive a short message;
a creating module, configured to create an index identifier corresponding to the short message, wherein the index identifier comprises: an index number, an index storage address corresponding to the index number and a data length of a short message corresponding to the index number; and
a storing module, configured to store the index identifier in a preset index file of an SIM card of the mobile terminal, and store the short message in a preset message file of the SIM card of the mobile terminal according to the index identifier;
wherein the creating module comprises:
a first searching unit, configured to search the index file; and
an obtaining unit, configured to obtain an index number of the short message and an index storage address of the short message according to the index file, and obtain a data length of the short message;
wherein the obtaining unit comprises:
an index number obtaining subunit, configured to sequentially add an index number after a previous index number in the index file to obtain the index number of the short message; and
an index storage address obtaining subunit, configured to add a data length of a short message corresponding to the previous index number to an index storage address corresponding to the previous index number to obtain the index storage address of the short message;
wherein the storing module comprises:
a second searching unit, configured to search the message file;
an shifting subunit, configured to shift in the message file to the index storage address of the short message in the index identifier; and
a storing subunit, configured to store the short message in the message file according to the index storage address of the short message.
2. The method according to
searching, according to an index number of a short message to be deleted, for a corresponding index storage address and a data length of the corresponding short message in the index file;
deleting, from the message file, bytes of the data length of the corresponding short message at the corresponding index storage address; and
deleting, from the index file, the corresponding index storage address and the data length of the corresponding short message.
3. The method according to
after the short message to be deleted is deleted, shifting an address of a short message after the deleted short message backward by the data length of the deleted short message;
shifting backward the index number of the deleted short message in the index file.
5. The mobile terminal according to
a searching module, configured to search, according to an index number of a short message to be deleted, for a corresponding index storage address and a data length of the corresponding short message in the index file; and
a deleting module, configured to delete, from the message file, bytes of the data length of the corresponding short message at the corresponding index storage address, and delete the corresponding index storage address and the data length of corresponding the short message from the index file.
6. The mobile terminal according to
the shifting subunit is further configured to, after the short message to be deleted is deleted, shift an address of a short message after the deleted short message backward by the data length of the deleted short message, and shift backward the index number of the deleted short message in the index file.
|
The disclosure relates to the field of mobile communication, and in particular to a method and a terminal for processing short message in an intelligent subscriber identity card.
At present, with the development of mobile communication technology, the short message service has become a popularized service ranked second in frequency of use of all mobile communication services, because of the low expense and convenience in communication. Many value-added services, such as weather forecast and information delivery, of operators are increasingly introduced by taking the advantages of short message.
Therefore, the importance of the function and method of storing the short message to the mobile terminal is self-evident. The memory of mobile terminal itself can store short message. Nonetheless, because a Subscriber Identity Module (SIM) card has the unique feature of being replaceable and pluggable, users prefer to store short message in the SIM card.
According to requirement of the GSM11.11 specification, the structure of the 6F3C file of the currently used SIM cards, which is used for storing short message, is the linear fixed-length file. It means that the record length of each short message of the 6F3C file is fixed. However, in practice, data lengths of short messages are different. If space is reserved for each short message according to a fixed length, then the actually reserved space cannot be fully utilized because of different data length of each short message, thereby reducing the number of short messages actually stored in limited storage space, and inevitably wasting resources.
The disclosure mainly provides a method and a terminal for processing short message, for improving short message storage capacity of the intelligent subscriber identity card, such as the SIM card in mobile terminal to save resources.
According to an aspect of the disclosure, a method for processing short message is provided, comprising steps of:
receiving a short message, and creating an index identifier corresponding to the short message;
storing the index identifier in a preset index file; and
storing the short message in a preset message file according to the index identifier.
Furthermore, the index identifier comprises: the index identifier comprises: an index number, an index storage address corresponding to the index number and a data length of a short message corresponding to the index number.
Furthermore, creating the index identifier corresponding to the short message comprises:
searching the index file;
obtaining an index number of the short message and an index storage address of the short message according to the index file; and
obtaining a data length of the short message.
Furthermore, obtaining the index number of the short message and the index storage address of the short message according to the index file comprises:
adding an index number sequentially after a previous index number in the index file to obtain the index number of the short message; and
adding a data length of a short message corresponding to the previous index number to an index storage address corresponding to the previous index number to obtain the index storage address of the short message.
Furthermore, storing the short message in the preset message file according to the index identifier comprises:
searching the message file;
shifting forward in the message file by the index storage address of the short message in the index identifier; and
storing the short message in the message file according to the index storage address of the short message.
Furthermore, after storing the short message in the preset message file according to the index identifier, the method further comprises:
searching, according to an index number of a short message to be deleted, for a corresponding index storage address and a corresponding data length of the short message in the index file;
deleting, in the message file, bytes of the corresponding data length of the short message at the corresponding index storage address; and
deleting the corresponding index storage address and the corresponding data length of the short message in the index file.
Furthermore, after deleting the corresponding index storage address and the corresponding data length of the short message in the index file, the method further comprises:
after the short message to be deleted is deleted, shifting an address of a short message after the deleted short message backward by the data length of the deleted short message;
shifting backward the index number of the deleted short message in the index file.
According to another aspect of the disclosure, a terminal for processing short message is provided, which comprises:
a receiving module, configured to receive a short message;
a creating module, configured to create an index identifier corresponding to the short message; and
a storing module, configured to store the index identifier in a preset index file, and store the short message in a preset message file according to the index identifier.
Furthermore, the creating module comprises:
a first searching unit, configured to search the index file; and
an obtaining unit, configured to obtain an index number of the short message and an index storage address of the short message according to the index file, and obtain a data length of the short message.
Furthermore, the obtaining unit comprises:
an index number obtaining subunit, configured to sequentially add an index number after a previous index number in the index file to obtain the index number of the short message; and
an index storage address obtaining subunit, configured to add a data length of a short message corresponding to the previous index number to an index storage address corresponding to the previous index number to obtain the index storage address of the short message.
Furthermore, the storing module comprises:
a second searching unit, configured to search the message file;
an shifting subunit, configured to shift forward in the message file by the index storage address of the short message in the index identifier; and
a storing subunit, configured to store the short message in the message file according to the index storage address of the short message.
Furthermore, the terminal further comprises:
a searching module, configured to search, according to an index number of a short message to be deleted, for a corresponding index storage address and a corresponding data length of the short message in the index file; and
a deleting module, configured to delete, in the message file, bytes of the corresponding data length of the short message at the corresponding index storage address, and delete the corresponding index storage address and the corresponding data length of the short message in the index file.
Furthermore, the shifting subunit is further configured to, after the short message to be deleted is deleted, shift an address of a short message after the deleted short message backward by the data length of the deleted short message, and shift backward the index number of the deleted short message in the index file.
The method and terminal for processing short message of the disclosure store the short message in storage space of mobile terminal according to the actual data length of the short message, and delete the short message from storage space of mobile terminal according to the actual data length of the short message. Thereby, the disclosure can store as many short messages as possible in the limited storage space. The disclosure improves the utilization ratio of the storage space of mobile terminal, saves resources, and provides convenience for manufactures and users of mobile terminal.
The drawings described herein are used for providing a further understanding of the disclosure, and constitute a part of the application. The schematic embodiments of the disclosure and the description thereof are used for illustrating the disclosure and are not intended to form improper limit to the disclosure. In the drawings:
It should be noted that the embodiments and features in the embodiments in the application can be combined with each other if not conflicting. The disclosure is described hereinafter in detail with reference to the drawings and embodiments.
In the related art, the short messages are stored in the file 6F3C in the directory 7F10 of the SIM card, wherein the file is named EFSMS, the file identifier is 6F3C, and the file structure is of the linear fixed-length type. The length of each record of the short message is 176 bytes, the storage limit of records is 255, and each short message occupies one record length fixedly. If a short message only has a length of 60 bytes, then the short message wastes space of 176-60=16 bytes. If all the records are added up, more space is wasted. When the last one is to be stored, it is possible that it may not be stored, even there is space left.
The solution of embodiments of the disclosure is mainly: in mobile terminal, storing the received short message according to the actual data length of the short message, so as to improve the utilization ratio of storage space of the mobile terminal.
As shown in
Step 101: receiving the short message, and creating the index identifier corresponding to the short message;
Step 102: storing the index identifier in the preset index file; and
Step 103: storing the short message in the preset message file according to index identifier.
In the embodiment, the SIM card is taken as the example. When the mobile terminal stores the short message through the SIM card, first the message file for storing the short message is created in the SIM card, and the index file for storing the index identifier corresponding to the short message is created, wherein the index identifier comprises: the index number of the short message, the index storage address corresponding to the index number and the data length of the short message corresponding to the index number. That is to say, the index identifiers corresponding to different short messages are stored in the index file.
When a new short message is to be stored in the SIM card, first an index number is obtained by sequentially adding an index number after the previous index number, and then the data length of the short message corresponding to the previous index number is added in the index storage address corresponding to the previous index number in the index file to obtain the index storage address corresponding to this index number. At the same time, the data length of the new short message is recorded in the index file. Then, according to the calculated index storage address of the new short message, it shifts in the message file to this index storage address, and the data content of the short message is stored at the index storage address. In this case, in the SIM card, an initial index storage address is assigned to the index file by a SIM card processor, then a shifting amount of address is calculated according to the length occupied by each short message data. Each short message is correspondingly stored in the message file.
Preferably, as shown in
Step 1011: searching the index file;
Step 1012: obtaining the index number of the short message and the index storage address of the short message according to the index file; and
Step 1013: obtaining the data length of the short message. Preferably, as shown in
Step 10121: adding an index number sequentially after the previous index number in the index file to obtain the index number of the short message; and
Step 10122: adding the data length of the short message corresponding to the previous index number in the index storage address corresponding to the previous index number to obtain the index storage address of the short message.
Preferably, as shown in
Step 1031: searching the message file;
Step 1032: shifting in the message file to the index storage address of the short message in the index identifier; and
Step 1033: storing the short message in the message file according to the index storage address of the short message.
The process of storing the short message of the embodiment is illustrated below with specific examples.
In order to distinguish from the related EFSMS file, the embodiment names the message file EFEXT
In the embodiment, the index file for storing the index identifier can be named EFSMS
It is assumed that there are three index records, namely three index identifiers, in the EFSMS
When a new short message is received and is to be stored, an index number which is 4 is added in the EFSMS
It should be noted that, the method for processing short message of the embodiment can be compatible with related SIM cards and mobile terminals. In above example, when using related SIM cards and mobile terminals to store the short message, corresponding record number of the corresponding short message in the file 6F3C can be added in the index identifiers of the index file EFEXT
Furthermore, it should be noted that the method of copy of short message performed by the embodiment through mobile terminal is same as the method for storing short message introduced in the embodiment. Thus, no repeated description is given here.
The embodiment stores the short message in storage space of mobile terminal according to the actual data length of the short message, which breaks the limitation in the related art that the short message file is stored according to fixed length. The present solution efficiently utilizes storage space of the SIM card used in mobile terminal, stores as many short messages as possible in limited storage space, improves the utilization ratio of storage space of mobile terminal, saves resources, and provides convenience for manufactures and users of mobile terminals. Furthermore, the method for processing short message of the embodiment can be compatible with related SIM cards and mobile terminals, and related SIM cards and mobile terminals can still perform processes, such as storage of short messages, using the 6F3C file structure as usual.
As shown in
Step 104: searching for the corresponding index storage address and the data length of the corresponding short message in the index file, according to the index number of the short message to be deleted;
Step 105: deleting, from the message file, bytes of the data length of the corresponding short message at the corresponding index storage address;
Step 106: deleting the corresponding index storage address and the data length of the corresponding short message from the index file;
Step 107: after the short message to be deleted is deleted, shifting the address of short message after the deleted short message backward by the data length of the deleted short message; and
Step 108: shifting backward the index number of the deleted short message in the index file.
The embodiment stores the short message in storage space of mobile terminal according to the actual data length of the short message. Based on that, the embodiment can perform process of deletion of the short message. This solution breaks the limitation in the related art that the short message file is stored according to fixed length, efficiently utilizes storage space of the SIM card used in mobile terminal, stores as many short messages as possible in limited storage space, improves the utilization ratio of storage space of mobile terminal, saves resources, and provides convenience for manufactures and users of mobile terminals. Furthermore, the method for processing short message of the embodiment can be compatible with related SIM cards and mobile terminals, and related SIM cards and mobile terminals can still perform processes, such as storage of short message, using the 6F3C file structure as usual.
As shown in
a receiving module 601, configured to receive the short message;
a creating module 602, configured to create the index identifier corresponding to the short message; and
a storing module 603, configured to store the index identifier in the preset index file, and store the short message in the preset message file according to the index identifier.
Preferably, as shown in
a first searching unit 6021, configured to search the index file; and
an obtaining unit 6022, configured to obtain the index number of the short message and the index storage address of the short message according to the index file, and obtain the data length of the short message.
Preferably, as shown in
an index number obtaining subunit 60221, configured to sequentially add an index number after the previous index number in the index file to obtain the index number of the short message; and
an index storage address obtaining subunit 60222, configured to add the data length of the short message corresponding to the previous index number in the index storage address corresponding to the previous index number to obtain the index storage address of the short message.
Preferably, as shown in
a second searching unit 6031, configured to search the message file;
a shifting subunit 6032, configured to shift in the message file to the index storage address of the short message in the index identifier; and
a storing subunit 6033, configured to store the short message in the message file according to the index storage address of the short message.
Preferably, as shown in
a searching module 604, configured to search for the corresponding index storage address and the data length of the corresponding short message in the index file, according to the index number of the short message to be deleted; and
a deleting module 605, configured to delete, from the message file, bytes of the data length of the corresponding short message at the corresponding index storage address, and delete the corresponding index storage address and the data length of the corresponding short message from the index file.
Furthermore, the shifting subunit 6032 is further configured to, after the short message to be deleted is deleted, shift addresses of short messages after the deleted short message backward by the data length of the deleted short message, and shift backward the index number of the deleted short message in the index file.
It should be noted that the terminal of the embodiment can be the intelligent subscriber identity card with functions of storing short message, comprising SIM card, UIM card, USIM card or PIM card and so on.
The embodiment of the disclosure performs processes, such as storage, deletion and copy, to the short message in storage space of mobile terminal according to the actual data length of the short message, and stores as many short messages as possible in limited storage space. Thereby, this solution breaks the limitation in the related art that the short message file is stored according to fixed length, efficiently utilizes storage space of the SIM card used in mobile terminal, stores as many short messages as possible in limited storage space, improves the utilization ratio of storage space of mobile terminal, saving resources, and provides convenience for manufactures and users of mobile terminals. Furthermore, the method for processing short message of the embodiment can be compatible with related SIM cards and mobile terminals, and related SIM cards and mobile terminals can still perform processes, such as storage, deletion and copy, to the short message using the 6F3C file structure as usual.
The above is only the preferred embodiments of the disclosure and not intended to limit the scope of the claims of the disclosure. Any equivalent replacements of structure or flow based on the contents of the specification and the drawings of the disclosure, and any direct or indirect application of the disclosure in other related technical fields shall fall within the scope of the claims of the disclosure.
Patent | Priority | Assignee | Title |
Patent | Priority | Assignee | Title |
6167402, | Apr 27 1998 | Oracle America, Inc | High performance message store |
6484039, | Feb 25 1998 | Seimens Aktiengesellschaft | SIM card with directory entries for mobile telephones |
7526623, | Sep 28 2006 | EMC IP HOLDING COMPANY LLC | Optimizing reclamation of data space |
7684811, | Jun 20 2000 | Siemens Aktiengesellschaft | Method for transmitting short messages |
7844055, | Jun 26 2001 | Link Us All, LLC | Detecting and transporting dynamic presence information over a wireless and wireline communications network |
20020006784, | |||
20020059185, | |||
20020169004, | |||
20030050042, | |||
20080247390, | |||
20130024642, | |||
20130073602, | |||
20130212342, | |||
20140229521, | |||
CN101098497, | |||
CN101345945, | |||
CN101686209, |
Executed on | Assignor | Assignee | Conveyance | Frame | Reel | Doc |
Oct 15 2010 | ZTE Corporation | (assignment on the face of the patent) | / | |||
Jun 20 2012 | YANG, CUIHONG | ZTE Corporation | ASSIGNMENT OF ASSIGNORS INTEREST SEE DOCUMENT FOR DETAILS | 030632 | /0231 | |
Jun 20 2012 | PEI, XIOGANG | ZTE Corporation | ASSIGNMENT OF ASSIGNORS INTEREST SEE DOCUMENT FOR DETAILS | 030632 | /0231 |
Date | Maintenance Fee Events |
Aug 22 2019 | M1551: Payment of Maintenance Fee, 4th Year, Large Entity. |
Aug 09 2023 | M1552: Payment of Maintenance Fee, 8th Year, Large Entity. |
Date | Maintenance Schedule |
Feb 23 2019 | 4 years fee payment window open |
Aug 23 2019 | 6 months grace period start (w surcharge) |
Feb 23 2020 | patent expiry (for year 4) |
Feb 23 2022 | 2 years to revive unintentionally abandoned end. (for year 4) |
Feb 23 2023 | 8 years fee payment window open |
Aug 23 2023 | 6 months grace period start (w surcharge) |
Feb 23 2024 | patent expiry (for year 8) |
Feb 23 2026 | 2 years to revive unintentionally abandoned end. (for year 8) |
Feb 23 2027 | 12 years fee payment window open |
Aug 23 2027 | 6 months grace period start (w surcharge) |
Feb 23 2028 | patent expiry (for year 12) |
Feb 23 2030 | 2 years to revive unintentionally abandoned end. (for year 12) |