Disclosure of Invention
In view of the above, the main objective of the present invention is to provide a method and an apparatus for automatically deleting short messages, which preferentially delete short messages with low importance and avoid the mistaken deletion of important short messages.
In order to achieve the purpose, the technical scheme of the invention is realized as follows:
the invention provides a method for automatically deleting short messages, which comprises the following steps:
when the inbox is full and new short messages exist, the mobile phone terminal inquires the short message state of the inbox, acquires and stores the short message information of the read short messages, screens and sorts the short message information of the read short messages, and deletes the short messages according to the screened and sorted short message information.
In the above scheme, the short message information includes: time for receiving the short message, receiving number and short message number.
In the above scheme, the querying the short message status of the inbox by the mobile phone terminal, and acquiring and storing the short message information of the read short message includes: the mobile phone terminal reads the number of the read short messages in the inbox; when the number of the read short messages is larger than the preset read short message threshold, selecting and storing short message information which is consistent with the number of the read short message threshold from the short message information of the read short messages according to the time sequence; and when the number of the read short messages is less than the threshold of the read short messages, selecting and storing the short message information of all the read short messages.
In the above scheme, the screening and sequencing the stored short message information of the read short message includes: in the short message information, setting the receiving number as a contact person as first type short message information; in the short message information acquisition, the length of a received number is between set digits, the short message information with a preset positioning number consistent with a number list is set as second type short message information, and the remaining short message information in the short message information acquisition is third type short message information; the three types of short message information are arranged and stored in a list according to the receiving time sequence.
In the above scheme, the deleting the short messages according to the screened and sorted short message information includes: and the mobile phone terminal deletes the third type of short message information, the second type of short message information and the short messages corresponding to the first type of short message information in sequence according to the time sequence, and stops short message deletion operation when the sum of the number of the deleted short messages reaches a preset deletion number.
The invention also provides a method for automatically deleting the short message, which comprises the following steps:
the mobile phone terminal inquires the short message state of the inbox at regular intervals, acquires and stores the short message information of the read short message, screens and sorts the short message information of the read short message, and deletes the short message according to the screened and sorted short message information.
In the above scheme, the short message information includes: time for receiving the short message, receiving number and short message number.
In the above scheme, the querying the short message status of the inbox, and acquiring and storing the short message information of the read short message includes: the mobile phone terminal reads the number of the read short messages in the inbox; when the number of the read short messages is larger than the timed deletion number, continuously comparing the read short messages with the read short message threshold, determining that the number of the read short messages is larger than the read short message threshold, and selecting and storing short message information which is consistent with the number of the read short message threshold from the short message information of the read short messages according to the time sequence; and when the number of the read short messages is less than the threshold of the read short messages, selecting and storing the short message information of all the read short messages.
In the above scheme, the screening and sequencing the stored short message information of the read short message includes: in the short message information, setting the receiving number as a contact person as first type short message information; in the short message information, the length of the received number is between the set digits, and the short message information with the preset positioning number consistent with the number list is set as second type short message information; the rest short message information is the third type short message information; the three types of short message information are sorted according to the receiving time sequence and stored in a list.
In the above scheme, the deleting the short messages according to the screened and sorted short message information includes: and the mobile phone terminal deletes the third type of short message information, the second type of short message information and the short messages corresponding to the first type of short message information in sequence according to the time sequence, and stops short message deletion operation when the sum of the number of the deleted short messages reaches a preset timed deletion number.
The invention also provides a device for automatically deleting the short message, which comprises: the device comprises a judgment processing module, a screening module, a sorting module, a deleting module and a storage module;
the judging and processing module is used for receiving the message that the inbox sent by the inbox is full and has new short messages, inquiring the state of the read short messages in the inbox, acquiring the short message information of the read short messages, storing the short message information in the storage module and notifying the screening module; or, inquiring the state of the read short message in the inbox regularly, acquiring the short message information of the read short message, storing the short message information in the storage module, and informing the screening module;
the screening module is used for screening the short message information and informing the sequencing module;
the sorting module is used for sorting the screened short message information and informing the deleting module;
the deleting module is used for deleting the short messages according to the screened and sequenced short message information;
and the storage module is used for storing the short message information.
In the foregoing solution, the judgment processing module is specifically configured to: receiving messages of which the inbox is full and has new short messages, reading the number of the read short messages in the inbox, determining that the number of the read short messages is larger than a read short message threshold, and selecting the short messages of the read short messages according to the time sequence, wherein the number of the short messages is consistent with the number of the read short message threshold and storing the short messages in a storage module; if the short message is smaller than the read short message threshold, selecting the short message information of all the read short messages and storing the short message information in a storage module; or when the state of the read short messages in the inbox is inquired regularly, the number of the read short messages in the inbox is read, the number of the read short messages is determined to be larger than the timed deletion number, the read short messages are further compared with a read short message threshold, the number of the read short messages is determined to be larger than the read short message threshold, and short message information which is consistent with the number of the read short message threshold is selected from the short message information of the read short messages and stored in the storage module according to the time sequence; if the number of the read short messages is smaller than the read short message threshold, selecting the short message information of all the read short messages and storing the short message information in a storage module; and determining that the number of the read short messages is less than the timed deletion number, and not performing any operation.
In the above scheme, the screening module is specifically configured to read the short message information in the storage module, and set the first type of short message information as the contact with the receiving number in the short message information; in the short message information acquisition, the length of the received number is between the set digits, the number of the preset digit is set as second short message information in accordance with the number list, and other short message information is set as third short message information.
In the above scheme, the deleting module is specifically configured to delete the third type of short message information, the second type of short message information, and the short messages corresponding to the first type of short message information in sequence when the inbox is full and there are new short messages, and stop the operation of deleting the short messages when the total number of the deleted short messages reaches a preset deleted number; or deleting short messages with the number consistent with the timed deletion number when the read short message state in the inbox is inquired at regular time, wherein the deletion is the same as the process of setting the deletion number.
In the above scheme, the apparatus further comprises: a timer, a user interface module; the user interface module is used for providing an interface for user operation, and a user starts a timing deletion function, starts a timer and informs the deletion module; the timer is also used for setting the timing time of the timer; the timer is used for running according to the timing time period, reaching the timing time and informing the judgment processing module; and the judging and processing module is used for inquiring the state of the read short message in the inbox when the timing time is up.
Therefore, by adopting the method and the device of the invention, the read short messages are screened and sorted according to the number of the sent short messages, unimportant short messages are deleted preferentially, and the important short messages are prevented from being deleted by mistake; furthermore, when the short messages are deleted at regular time, the short messages are deleted according to the set number of the short messages deleted at regular time, so that the short message deleting efficiency is effectively improved.
Detailed Description
The basic idea of the invention is: the inbox is full and has new short messages, or the mobile phone terminal inquires the state of the read short messages in the inbox at regular intervals, screens and sorts the short message information of the read short messages according to the number of the sent short messages, and deletes the corresponding short messages according to the screened and sorted short message information.
The present invention will be described in further detail below with reference to specific embodiments and the accompanying drawings. A method for automatically deleting short messages is disclosed, as shown in FIG. 1, and comprises the following steps:
step 101, the inbox is full and has new short messages, or the mobile phone terminal inquires the status of the read short messages in the inbox at regular intervals;
when the inbox of the mobile phone is full and new short messages arrive, or a timer is set in the mobile phone, if a user starts a timing deleting function through a mobile phone setting interface, and when the timing time of the timer is reached, the mobile phone terminal inquires the state of the read short messages in the inbox. The timing time can be set according to the requirement.
When the inbox is full and there is a new short message, the query of the status of the read short message in the inbox comprises: the mobile phone terminal reads the number of the read short messages in the inbox, after a user reads the short messages, the inbox marks the corresponding short messages as read, the mobile phone terminal compares the number of the read short messages with a preset read short message threshold, if the number of the read short messages is larger than the read short message threshold, short message information of the short messages which are stored in the inbox and are consistent with the number of the read short message threshold is selected according to the sequence of the short message receiving time from early to late and is stored in a temporary space, so that the short message information of the short messages which are selected and are consistent with the number of the read short message threshold is prevented from being too large in the number of the read short messages in the inbox, and the processing time is longer. The read short message threshold can be set according to the need, for example, 100, the temporary space can be any free storage space of the mobile phone terminal, and the short message information includes the time of receiving the short message, the number of sending the short message, that is, the receiving number, the short message number, that is, the serial number of the short message. And if the number of the read short messages is less than the read short message threshold, storing the short message information of all the read short messages in a temporary space.
If the user starts the timed deletion function, after the timer reaches the timed time, the mobile phone terminal reads the number of the read short messages in the inbox, compares the number of the read short messages with the preset timed deletion number, and if the number of the read short messages is greater than the timed deletion number, the subsequent processing of the mobile phone terminal is the same as the processing flow of the mobile phone for receiving new short messages; if the number of the read short messages is less than the timed deletion number, no operation is performed to avoid deleting the read short messages by mistake.
Step 102, screening and sorting the short message information of the read short message according to the number of the sent short message;
if the number of the sent short message is the number on the address list of the mobile phone terminal, the inbox matches the number of the sent short message with the contact persons in the address list, and the inbox displays that the number of the sent short message is the contact person. The mobile phone terminal reads the short message information in the temporary space, selects the short message information of which the number for sending the short message is a contact as first type of short message information, and stores and marks the short message information in a list form according to the time for receiving the short message from morning to evening; then selecting short message information with the length of the number for sending the short message being a set digit, such as between 8 and 11 digits, selecting a preset positioning number, such as the first three digits, of the number for sending the short message in the short message information, comparing the first three digits with a preset number list, if the number is consistent with the number in the number list, the short message information belongs to the second type of short message information, and storing and marking the second type of short message information in the list according to the sequence of the time for receiving the short message from morning to evening; the rest short message information belongs to the third type of short message information, and is stored in a list and marked according to the time for receiving the short message from morning to evening; the number list is the top set of commonly used numbers, such as the first three digits, including 139, 159, etc., and the labels are used to distinguish the three lists.
And 103, deleting the short messages according to the screened and sorted short message information.
The user starts a timing deleting function, the mobile phone terminal deletes the third type short message information, the second type short message information and the short messages corresponding to the first type short message information in sequence according to the time sequence, and when the total number of the deleted short messages reaches the timing deleting number, the short message deleting operation is stopped, and the specific process is as follows: the mobile phone terminal compares the number of the third type short message information in the list with the preset number of timed deletes, the number of the timed deletes is assumed to be X, and the number of the timed deletes is N, if the number of the third type short message information is larger than the number of the timed deletes, namely X is larger than N, the number of the read short messages in the inbox corresponding to the third type short message information and the number of the read short messages which are consistent with the number of the timed deletes are deleted according to the receiving time in the short message information and the sequence from early to late; the specific deletion process comprises the following steps: the mobile phone terminal selects the short message information with the number consistent with the number of the timed deletion in the third short message information according to the sequence of the receiving time from morning to evening, reads the number of the selected short message information, deletes the read short message with the number consistent with the number of the selected short message information in the inbox, and deletes the short message information with the number consistent with the number of the timed deletion in the inbox. And then the mobile phone terminal deletes the list stored in the temporary space. If the number of the third type of short message information is less than the timed deletion number, namely X is less than N, the mobile phone terminal deletes the read short messages corresponding to all the third type of short message information, meanwhile, the number of the second type of short message information is compared with the timed deletion number for removing the number of the third type of short message information, the number of the second type of short message information is assumed to be Y, namely Y is compared with N-X, if Y is more than N-X, the mobile phone terminal deletes N-X short messages corresponding to the second type of short message information according to the sequence of the receiving time from early to late, and the deletion process is the same as the deletion process of the short messages corresponding to the third type of short message information; further, if Y is smaller than N-X, deleting all short messages corresponding to the second type of short message information, and then deleting N-X-Y short messages corresponding to the first type of short message information according to the sequence of the receiving time from morning to night. And then the mobile phone terminal deletes the list stored in the temporary space.
If the user does not start the timed deletion function, the mobile phone terminal deletes the preset set deletion number according to the sequence of the receiving time from early to late, and the deletion method is the same as the method for deleting the timed deletion number.
The invention also provides a device for automatically deleting the short message, which comprises: the system comprises a judgment processing module 201, a screening module 202, a sorting module 203, a deleting module 204 and a storing module 205;
the judgment processing module 201 is configured to receive a message that an inbox sent by the inbox is full and has new short messages, query a state of a read short message in the inbox, acquire short message information of the read short message, store the short message information in the storage module 205, and notify the screening module 202; or, the state of the read short message in the inbox is queried regularly, the short message information of the read short message is stored in the storage module 205, the short message information of the read short message is acquired, and is stored in the storage module 205, and the screening module 202 is notified; the short message information comprises a short message number, the time for receiving the short message and the number for sending the short message;
the screening module 202 is used for screening the short message information in the storage module 205 and notifying the sorting module 203;
the sorting module 203 is used for sorting the screened short message information and notifying the deleting module 204;
a deleting module 204, configured to delete the corresponding short message according to the screened and sorted short message information;
the storage module 205 is configured to store the short message information of the read short message.
The apparatus further comprises: timer 206, user interface module 207;
a user interface module 207 for providing an interface for user operation, and starting the timer 206 when the user selects to start the timed deletion function; also for setting the time of the timer 206;
the timer 206 is configured to run according to a timing time period, and notify the judgment processing module 201 when the timing time is up; the timing time can be set by a user through the user interface module 207 according to needs;
the judgment processing module 201 is configured to query a status of the read short message in the inbox when receiving the notification from the timer 206.
The judgment processing module 201 is specifically configured to read the number of the read short messages in the inbox, compare the read short messages with a preset timed deletion number, determine that the number of the read short messages is greater than the timed deletion number, further compare the read short messages with a preset read short message threshold, determine that the number of the read short messages is greater than the read short message threshold, and select the short message information of the read short messages in the inbox, which matches the number of the read short message threshold, to store the short message information in the storage module 205 according to the sequence of the received time of the read short messages from early to late; if the short message is determined to be smaller than the read short message threshold, selecting the short message information of all the read short messages and storing the short message information in the storage module 205; determining that the number of the read short messages is less than the timed deletion number, and not doing any operation; or,
if the timer notification is not received, the number of the read short messages in the inbox is read, the read short message is compared with the read short message threshold, the number of the read short messages in the inbox is determined to be larger than the read short message threshold, and the short message information of the read short messages in the inbox, which is consistent with the number of the read short message threshold, is selected and stored in the storage module 205 according to the sequence of the receiving time of the read short messages from early to late; if the short message is determined to be smaller than the read short message threshold, selecting the short message information of all the read short messages and storing the short message information in the storage module 205; the read short message threshold can be set by self according to the requirement, for example, 100, and the number of the timed deletes can be set by self according to the requirement.
The screening module 202 is specifically configured to read the short message information in the storage module 205, and select the short message information with the sent short message number as the contact as the first type of short message information; selecting the length of the short signal sending code as a set digit, such as between 8 and 11 digits, and presetting a positioning number, wherein short message information corresponding to the first three digits and a preset number list is second short message information, and other short message information is third short message information; the list of numbers is the top set of commonly used numbers, e.g., the first three digits, including 139, 159, etc.
The sorting module 203 is specifically configured to sort the three types of numbers according to the sequence of the receiving time from early to late, and store the three types of numbers in the three lists and mark the three lists respectively.
The deleting module 204 is specifically configured to, if the user starts the timed deleting function, delete the third type of short message information, the second type of short message information, and the short messages corresponding to the first type of short message information in sequence according to the time sequence, and stop the operation of deleting the short messages when the total number of the deleted short messages reaches the timed deleting number; the specific process is as follows: comparing the number of the third type of short message information with the preset number of the timed deletes, determining that the number of the third type of short message information is larger than the number of the timed deletes, and deleting short messages which correspond to the third type of short messages and are consistent with the number of the timed deletes in the inbox according to the sequence of the receiving time in the short message information from early to late; determining that the number of the third type of short message information is smaller than the timed deletion number, deleting the short messages corresponding to all the third type of short message information, simultaneously comparing the number of the second type of short message information with the timed deletion number for removing the number of the third type of short message information, determining that the number of the second type of short message information is larger, deleting the short messages corresponding to the second type of short message information in the short messages corresponding to the second type of short message information according to the sequence of the receiving time from early to late, wherein the short messages correspond to the timed deletion number for removing the number of the third type of short message information, determining that the number of the second type of short message information is smaller, deleting the short messages corresponding to all the second type of short message information, and deleting the short messages corresponding to the first type of short message information in the sequence of the receiving time from early to late;
if the user does not start the timing deletion function, deleting the preset set deletion number according to the sequence of the receiving time from early to late, wherein the deletion method is the same as the method for deleting the timing deletion number. The deletion is that the mobile phone terminal selects short message information with the number consistent with the number of the timed deletion from the third type of short message information according to the sequence of the receiving time from morning to evening, reads the number of the selected short message information, and deletes the read short message with the number consistent with the number of the selected short message information in the inbox;
correspondingly, the user interface module 207 notifies the deleting module 204 when the user starts the timed deleting function.
The above description is only exemplary of the present invention and should not be taken as limiting the scope of the present invention, and any modifications, equivalents, improvements, etc. that are within the spirit and principle of the present invention should be included in the present invention.