Abstract:
The present invention proposes a method for deleting messages and a related terminal. The method includes: A: recording a sliding path of a user on a terminal and mapping the sliding path as a message deleting command; B: defining a margin of error based on the sliding path; C: popping up a message prompt box when a new message is detected and must be displayed, whether the screen is locked or the terminal is being used; D: examining the sliding path of users on the screen and deciding whether it is in line with the pre-defined deleting path; and E: deleting the message directly when the sliding path is in line with the pre-defined deleting path. As such, users can immediately delete spam messages when a message is received, even if the screen is locked. The method is easy to use and provide significant convenience to users.

Description:
BACKGROUND OF THE INVENTION 
       [0001]    1. Field of the Invention 
         [0002]    The present invention relates to terminal technology, and more specifically, to a method for deleting messages and a terminal. 
         [0003]    2. Description of the Prior Art 
         [0004]    When existing terminals with screens locked are displaying messages, some terminals require the screen to be unlocked before message prompt box can be displayed. Users can browse, reply, or delete the message in the prompt box, or exit the prompt box. When messages are obviously spams, such as advertisements, or harassing or useless messages, users still must unlock the screen before accessing the message interface instead of deleting spams directly. 
         [0005]    Although some terminals do not require the screen to be unlocked first, as shown in  FIG. 1 , the prompt box can only display part of the message content; operations such as reply, delete or exit are not allowed. Users must click on the prompt box or unlock the screen by sliding across area  2  to enter the message app menu to read full content of the message and undertake other operations. They cannot delete the message directly. 
         [0006]    The abovementioned display method, although based on the idea of information security provided by the locked screen, causes inconvenience for users as they cannot directly delete messages that are obviously spams but have to undertake other operations before they can delete the message. 
         [0007]    If a message prompt box is shown when a terminal is being used, users can choose to delete it by pressing on the delete button. However, in some cases, users may choose a wrong button and fail to delete the message, or some terminals require users to confirm again whether they would like to delete the message after they have chosen to delete. If the message is a spam, this confirmation step prevents users from deleting the message directly, which is a waste of users&#39; time. 
         [0008]    Therefore, the existing technology needs to be improved. 
       SUMMARY OF THE INVENTION 
       [0009]    Given the insufficiency of the existing technology as described above, one object of the present invention is to provide a method for deleting messages and a terminal, so to solve the problem with existing terminals that cannot delete messages directly. 
         [0010]    According to the present invention, a method for deleting messages comprises: 
         [0011]    step A: popping up a message prompt box when a new message is detected and must be displayed, whether the screen is locked or the terminal is being used; 
         [0012]    step B: examining the sliding path of users on the screen and deciding whether it is in line with the pre-defined deleting path; and 
         [0013]    step C: deleting the message directly when the sliding path is in line with the pre-defined deleting path. 
         [0014]    Furthermore, before the step A, the method further comprises: 
         [0015]    step A 01 : recording a sliding path of a user on a terminal and mapping the sliding path as a message deleting command; and 
         [0016]    step A 02 : defining a margin of error based on the sliding path. 
         [0017]    Furthermore, the shape of the sliding path comprises square, circle and line, which comprises straight lines, tilted lines and curved lines. Defining the margin of error comprises defining the direction, length, and position on the screen of a linear sliding path, and the size and position on the screen of a square/circle sliding path. 
         [0018]    Furthermore, the margin of error comprises a length L of the actual sliding path, with L meeting the criteria L 1 ≦L≦L 2 ; a height H, with H meeting the criteria H 1 ≦H≦H 2 , where L 1  is a first length, L 2  is a second length, H 1  is a first height and H 2  is a second height. 
         [0019]    Furthermore, step B comprises: 
         [0020]    step B 01 : extracting and storing coordinates of all points on the sliding path and the four vertexes of the message prompt box; 
         [0021]    step B 02 : deciding whether coordinates of all points are within the message prompt box; confirming the sliding path is in line with the pre-defined deleting path if yes. 
         [0022]    Furthermore, the sliding path is a line and step B comprises: 
         [0023]    step B 1 : examining the sliding path of users on the screen, and extracting and storing coordinates of the start point and end point of the sliding path and the four vertexes of the message prompt box; 
         [0024]    step B 2 : deciding whether the sliding direction of the sliding path is the same as that of the pre-defined slide based on the abscissas of the start point and end point, and coordinates of the four vertexes of the message prompt box; step B 3  is executed if yes; a reminder of delete failure is provided if no; 
         [0025]    step B 3 : deciding whether the length of the linear sliding path falls within the defined margin of error; step B 4  is executed if yes; a reminder of delete failure is provided if no; 
         [0026]    step: B 4 : deciding whether the height of the linear sliding path falls within the defined margin of error; the sliding path is in line with the pre-defined deleting path if yes; a reminder of delete failure is provided if no. 
         [0027]    Furthermore, coordinates of the upper left corner, lower left corner, upper right corner, and lower right corner of the message prompt box are, respectively, (Xl, Yl), (Xu, Yu), (Xd, Yd) and (Xr, Yr); the coordinate of the start point of the sliding path is (Xa, Ya), and the coordinate of the end point of the sliding path is (Xb, Yb). Steps before step D 3  further comprises calculating the first length, second length, first height, second height, and length and height of the actual sliding path based on the coordinates of the four vertexes of the message prompt box, with the lengths, heights and coordinates meeting the following criteria: 
         [0000]    
       
      
       L=|Xa−Xb|;  
      
     
         [0000]        L 1=(2×| Xr−Xl |)/3;
 
         [0000]        L 2=| Xr−Xl|;    
         [0000]    
       
      
       H=|Ya−Yb|;  
      
     
         [0000]        H 1=0; 
         [0000]        H 2=| Yu−Yd|.    
         [0028]    Furthermore, the reminder of delete failure is a pop-up that blinks for a pre-defined period of time and then closes, and another sliding path on the screen or an operation to exit the message prompt box of users will be detected. 
         [0029]    In contrast to prior art, the method for deleting messages and the terminal of the present invention, when detecting a new message that needs to be displayed, pops up a message prompt box regardless whether the screen is locked or the terminal is being used. Then, users&#39; sliding path on the screen is examined to decide whether the sliding path is in line with a pre-defined deleting path. When the sliding path is in line with the pre-defined deleting path, the message is deleted directly. As such, users can immediately delete spam messages when a message is received, even if the screen is locked. The method is easy to use and provide significant convenience to users. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0030]      FIG. 1  shows a terminal showing a message. 
           [0031]      FIG. 2  shows a flowchart of a method of deleting a message according to a preferred embodiment of the present invention. 
           [0032]      FIG. 3  shows a flowchart of steps associated with steps S 100  and S 200  illustrated in the method of deleting a message according to a preferred embodiment of the present invention. 
           [0033]      FIG. 4  shows a block diagram of a terminal according to a preferred embodiment of the present invention. 
       
    
    
     DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS 
       [0034]    The present invention provides a method for deleting messages and a terminal which mainly applies message deleting path when the screen is locked. The method can also apply when the phone is being used. When a message prompt box pops up on the screen of terminals, if users&#39; sliding path on the screen is in line with the pre-defined deleting path, the message is deleted directly. In order to illustrate the technique and effects of the present invention, a detailed description will be disclosed by the following disclosure in conjunction with figures. It is noted that the same components are labeled by the same number. 
         [0035]    Please refer to  FIG. 2 . The method for deleting messages provided by the present invention comprises the following steps. 
         [0036]    Step S 100 : pop up a message prompt box when a new message needs to be displayed, whether the screen is locked or the terminal is being used. 
         [0037]    Step S 200 : decide whether users&#39; sliding path on the screen is in line with the pre-defined deleting path. 
         [0038]    Step S 300 : delete the message directly when the sliding path is in line with the pre-defined deleting path. 
         [0039]    The present embodiment compares the actual sliding path of users with the pre-defined deleting path. If the sliding path fulfills criteria related to the deleting path, the message would be deleted directly. For this purpose, users need to define a deleting path before taking step S 100 . In other words, users must pre-define a set of mapping relations, which is a sliding path (mainly parameters of the coordinates comprising the sliding path) of users recorded by the terminal. Then the sliding path is mapped as a message deleting command. 
         [0040]    Given that it is impossible to have identical sliding path every time, a margin of error must be defined based on the sliding path. If the path is a line, the margin of error can be defined according to the direction, length and position on the screen of the slide. If the path is a circle or square, then the margin of error can be defined according to the size of the circle or square. All sliding paths that fall within the margin of error are regarded as a deleting path and can execute message deleting command. 
         [0041]    For the convenience of users to pre-define the deleting path and the purpose to simplify the process of verifying a sliding path, in practice, the deleting path is defined based on the message prompt box. Given that most message prompt boxes are square, sliding paths (such as a straight line, tilted line, triangle, square or circle) that slided from the box are defined as deleting paths. Therefore, the margin of error is related to the four vertexes of the message prompt box—the deleting path cannot exceed the message prompt box. 
         [0042]    Generally, the upper left corner of a terminal screen is regarded as the origin (0,0), the width of the terminal being the x-axis and the length of the terminal being the y-axis. All coordinate values are positive. The further away from the origin, the larger the coordinate values are. Assume that the coordinates of the four vertexes of the message box are (Xl, Yl), (Xu, Yu), (Xd, Yd), (Xr, Yr), an actual sliding path would fall within the margin of error if its length L meets the criteria L 1 ≦L≦L 2 , and its height H meets the criteria H 1 ≦H≦H 2 . 
         [0043]    In practice, L 1  can be ⅔ of the width of the message prompt box, namely (2×|Xr−Xl|)/3, or larger than 0 (e.g. 0.2). L 2  is the width of the message prompt box, namely |Xr−Xl|. H 1  can be ⅓ of the height of the message prompt box, namely (1×|Yu−Yd|)/3, or larger than 0. H 2  is the height of the message prompt box, namely |Yu−Yd|. This definition can ensure that sliding paths of a similar shape in any size within the message prompt box are regarded as deleting paths, thus lowers the difficulty of verifying the conformity of a sliding path. 
         [0044]    Note that the abovementioned margin of error (namely L 1 , L 2 , H 1  and H 2 ), in practice, can be defined based on the size of the message prompt box and the habit of users. Users can also define sliding paths outside the message prompt box as deleting paths. No limit is imposed here. After the deleting path is defined, step S 100  can be initiated. 
         [0045]    When a new message is received by an existing terminal with its screen locked, some terminals require users to unlock the screen first to see the message prompt box. Other terminals, although do not require users to unlock the screen first, only show part of the message in the message prompt box with no operating keys. Therefore, in step S 100 , whether the screen is locked or the terminal is being used, a message prompt box pops up directly whenever the terminal detects a new message must be displayed. All or part of the message is shown in the message prompt box so that users, preferably, can read the message and clearly distinguish whether it is a spam. When users confirm that it is a spam, they can slide in a path similar to the pre-defined deleting path on the screen. 
         [0046]    Throughout the process of sliding, //whether the sliding path is in square, circle or line (such as a straight line, tilted line or curved line), coordinates of all points on the sliding path and the four vertexes of the message prompt box must be extracted and stored to decide whether all the points on the sliding path are within the message prompt box. If yes, the sliding path is regarded as in line with the pre-defined deleting path. The message is deleted directly in step S 300 . 
         [0047]    In the present embodiment, if the sliding path is a line, not all points on the path is recorded since it adds processing burdens to the terminal and is more time-consuming. Given that a line starts from one point and ends at another, step S 200 , more specifically, makes the decision only based on coordinates of the start point and end point so to simplify the process. In practice, step S 200  comprises the following steps: 
         [0048]    Step 1: examine the sliding path of users on the screen. Extract and store the coordinates of the start point (Xa, Ya) and end point (Xb, Yb) of the sliding path and the four vertexes of the message prompt box. 
         [0049]    A linear slide is always directional. Therefore, whether the direction of the slide is the same as that of the pre-defined slide must be verified first when deciding whether a sliding path is in line with the pre-defined deleting path. 
         [0050]    Step 2: decide whether the direction of the linear sliding path is the same as that of the pre-defined slide based on the abiscissas of the start and end points. If yes, step 3 would be taken. If no, users are reminded that the delete has failed. 
         [0051]    If the direction of the pre-defined slide is from right to left, the abiscissa of the start point is larger then that of the end point, so the coordinates of the actual start and end points should meet critarias Xb&lt;Xa, or Xb−Xa&lt;0. If the direction of the pre-defined slide is from left to right, the abiscissa of the start point is smaller then that of the end point, so the coordinates of the actual start and end points should meet the critarias Xb&gt;Xa, or Xb−Xa&gt;0. 
         [0052]    The next is to decide whether the length and height of the sliding path fall within the margin of error. The size of the message prompt box varies according to the amount of the message content. When defining the margin of error, the first thing to do is to calculate the first length, second length, first height, and second height based on the four vertexes of the present message prompt box, and the length and height of the actual sliding path. 
         [0053]    The coordinates of the upper left corner, lower left corner, upper right corner and lower right corner of the message prompt box are, respectively, (Xl, Yl), (Xu, Yu), (Xd, Yd) and (Xr, Yr). The coordinates of the start point and end point of the sliding path are, respectively, (Xa, Ya) and (Xb, Yb). The length L of the actual sliding path equals to |Xa−Xb|, the first length L 1 =(2×|Xr−Xl|)/3, and the second length L 2 =|Xr−Xl|. The height H of the actual sliding path equals to |Ya-Yb|, the first height H 1 =0, and the second height H 2 =|Yu−Yd|. 
         [0054]    Step 3: decide whether the length of the linear sliding path falls within the defined margin of error. If yes, step 4 would be taken; if no, users are reminded that the delete has failed. 
         [0055]    Step 3 decides whether the length L of the sliding path is larger than or equal to the first length L 1  and smaller than or equal to the second length L 2  (L 1 ≦L≦L 2 ). L equals to |Xa−Xb|, an absolute value so to guarantee that it is positive. L 1  equals to (2×|Xr−Xl|)/3 or larger than 0. 
         [0056]    Step 4: decide whether the height of the linear sliding path falls within the defined maring of error. If yes, the sliding path is regarded as in line with the pre-defined deleting path; if no, users are reminded that the delete has failed 
         [0057]    Step 4 decides whether the height H of the actual sliding path is larger than or equal to the first height H 1 , and smaller than or equal to the second height H 2  (H 1 ≦H≦H 2 ). H equals to |Ya−Yb|, an absoluate value so to guarantee that it is positive. H 1  equals to 0 or equals to (1×|Yu−Yd|)/3. 
         [0058]    In practice, step 3 and step 4 can make decisions without the need to follow a sequential order. As long as any one of the decisions show that a value does not fall within the margin of error, users are reminded that the delete has failed. Only when both decisions show that the values are within the margin of error, would the sliding path be regarded as in line with the pre-defined deleting path. 
         [0059]    When the sliding path is decided as being in line with the deleting path, the message is deleted directly. Users can immediately delete spam messages when receiving a new message even if the screen is locked. The operation is easy and provides significant convenience to users. 
         [0060]    If the sliding path is not in line with the deleting path, after the delete fails, a prompt box (showing that the delete fails) pops up and blinks for a pre-defined period of time (e.g. 2 seconds), and then closes automatically. The terminal continues to examine the users&#39; operations on the screen. If it is still a sliding path, the terminal again decides whether the sliding path is in line with the pre-defined deleting path. If users choose to press the exit button, the message prompt box would be closed and previous operating interface would resume. 
         [0061]    Based on the abovementioned method for deleting messages, the present invention further provides a corresponding terminal that realizes the method for deleting messages. Please refer to  FIG. 3 . The terminal comprises a display module  10 , a processing module  20 , and an execution module  30 , linked by a sequential order. The display module  10  pops up a message prompt box when the terminal detects a new message must be displayed regardless whether the screen is locked or the terminal is being used. The processing module  20  decides whether the sliding path of users on the screen is in line with the pre-defined deleting path. The execution module  30  directly deletes the message when the sliding path is in line with the pre-defined deleting path. 
         [0062]    In practice, a defining module  40  is further included. It records the sliding path of users on the screen, and maps the sliding path as a message deleting command. Namely, the defining module  40  defines the first length L 1 , second length L 2 , first height H 1  and second height H 2  of the margin of error based on the sliding path. 
         [0063]    The processing module  20  comprises: 
         [0064]    an extracting unit  201  to extract and store coordinates of all the points on the sliding path; 
         [0065]    a first deciding unit  202  to decide whether all the coordinates are within the message prompt box; if yes, then the sliding path is decided as in line with the pre-defined deleting path; 
         [0066]    a calculating unit  203  to calculate the first length, second length, first height, second height, and the length and height of the actual sliding path; 
         [0067]    a second deciding unit  204  to decide whether the direction of the sliding path is the same as that of the pre-defined slide based on abscissas of the start and end points. The result of this decision is used to decide whether the length and height of the sliding path fall within the defined margin of error. 
         [0068]    The process of deleting messages of the terminal of the present embodiment is the same as the method for deleting messages in the previous embodiment. No further explanation is provided here. 
         [0069]    To sum up, the present invention pre-defines a deleting path, and when the terminal detects a new message that must be displayed, a message prompt box pops up directly. The terminal decides whether the sliding path of users on the screen meets criteria to delete the message; if yes, the message is deleted directly. By doing so, users can immediately delete spam messages when a new message is received regardless whether the screen is locked or not. The operation is easy and provides significant convenience to users. It solves the problem with existing technology which cannot delete spam messages without first unlocking the screen or entering the message app menu. 
         [0070]    The present disclosure is described in detail in accordance with the above contents with the specific preferred examples. However, this present disclosure is not limited to the specific examples. For the ordinary technical personnel of the technical field of the present disclosure, on the premise of keeping the conception of the present disclosure, the technical personnel can also make simple deductions or replacements, and all of which should be considered to belong to the protection scope of the present disclosure.