Line retraction method and related device of input panel

By detecting the time length and frequency in user operations and adjusting the speed of segmented fallback lines, the problem of inaccurate line backing in the existing technology is solved, and more efficient and convenient line backing is achieved.

CN115480654BActive Publication Date: 2025-04-25HUAWEI TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202110595997.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-05-29
Publication Date
2025-04-25
Estimated Expiration
2041-05-29

AI Technical Summary

Technical Problem

The prior art is difficult to implement precise segmented rollback of lines in the input panel, and users are cumbersome to operate, making it difficult to achieve the desired rollback state.

Method used

By detecting the length and frequency of time during user operations, adjusting the speed of segmented fallback lines, we can perform segmented fallback part of a line, and improve the fallback accuracy.

Benefits of technology

Improves the accuracy of line fallback, allowing users to fallback lines to their desired state more easily, simplifying user operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115480654B_ABST
    Figure CN115480654B_ABST
Patent Text Reader

Abstract

The present application provides a line rewinding method and related device for an input panel. An electronic device can store a line drawn in an input panel in segments according to the drawing time. When a user operation for segmented rewinding is detected, the electronic device can segmentally rewind the line in the direction from the end point to the starting point of the line. The electronic device can adjust the speed of segmented rewinding of the line according to the duration of each user operation for segmented rewinding and the frequency of the user operation for segmented rewinding. The above method can improve the accuracy of line rewinding, so that users can more conveniently rewind the line to their desired state.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of terminal technology, and in particular to a line retraction method for an input panel and a related device. Background Art

[0002] Currently, handwriting input method applications, drawing applications and other applications in electronic devices can provide the function of rolling back and restoring input content. For example, the electronic device can display multiple lines drawn by the user in the input panel of the drawing application. In response to the user operation for rolling back, the electronic device can delete one or more lines displayed in the input panel according to the order of the drawing time of the multiple lines. Among them, the track of a line can be the track of a single sliding operation detected by the electronic device on the input panel. That is, a line is a line completed by a user in one stroke.

[0003] It can be seen that in the above method, the electronic device only supports rewinding the lines in units of bars. That is, rewinding one line at a time. The above rewinding method is difficult to rewind the lines in the input panel to the state expected by the user, and the rewinding accuracy is low. For example, if the user wants to rewind part of a line, it is necessary to operate through the eraser function or other more complex functions. The user operation is cumbersome. Summary of the invention

[0004] The present application provides a line retraction method based on an input panel and a related device. The electronic device can detect the duration of each user operation for segmented retraction and the user operation frequency of the segmented retraction to adjust the speed of the segmented retraction line, thereby removing a portion of a line from the input panel. The line retraction method can improve the accuracy of line retraction, so that the user can more conveniently retract the line to the desired state.

[0005] In a first aspect, an embodiment of the present application provides a line rewinding method. In the method, an electronic device displays a first line on a display screen. The first line is drawn by the electronic device according to a trajectory of a single sliding operation detected on the display screen. The electronic device receives a first user operation, and the first user operation can be used to trigger the electronic device to rewind the lines displayed on the display screen in segments in the order of drawing time from late to early. The electronic device can remove the portion from the display screen from the end point of the first line to the first position of the first line according to the first user operation.

[0006] Through the above method, the user can quickly rewind a part of a line, which can improve the accuracy of line rewinding and enable the user to rewind the line to the desired state more conveniently.

[0007] In combination with the first aspect, in some embodiments, the first line may include multiple segments. One of the multiple segments is a line corresponding to the trajectory of the sliding operation within the first time period during the drawing process of the first line. The specific method for the electronic device to remove the portion from the display screen from the end point of the first line to the first position of the first line according to the first user operation may be: when the first user operation starts, the electronic device may follow the direction from the end point of the first line to the starting point of the first line, with a moving step length of one segment, and start from the segment where the end point of the first line is located, and remove the segments of the first line from the display screen one by one. When the first user operation ends, the first line is segmented and retracted to the first position.

[0008] In a possible implementation, the electronic device may segment the first line according to the drawing time. During the drawing of the first line, the electronic device may draw different segments on different layers. The first time period may be a preset segmentation time period. A layer drawn with a segment may have a timestamp. The timestamp may be determined by the drawing time of the segment. The electronic device may determine the order of drawing time of the segments on different layers according to the timestamp of the layer.

[0009] The electronic device may store multiple layers with multiple segments of the first line drawn in a stack in order from earliest to latest drawing time. The layers with earlier drawing time are stored closer to the bottom of the stack. The layers with later drawing time are stored closer to the top of the stack. The electronic device may implement segmented retraction of the line by moving the layer pointed to by the pointer in the stack. The layer pointed to by the pointer may be the layer stacked on the top of the layers displayed on the input panel for all drawn contents.

[0010] The input panel can be used for user input and display the content input by the user. In some embodiments, when running applications such as drawing applications, handwriting input applications, document editing applications, etc., the display screen of the electronic device may include the above-mentioned input panel. The content displayed in the input panel is the content displayed on the display screen of the electronic device.

[0011] In the process of removing the segments of the first line from the display screen one by one by the electronic device in the direction from the end point of the first line to the starting point of the first line, with a moving step length of one segment, starting from the segment where the end point of the first line is located, the electronic device may move the position of the pointer in the direction from the top of the stack storing the segments of the first line to the bottom of the stack, with a moving step length of one layer, starting from the layer at the top of the stack. When the first user operation ends, the pointer is moved to the layer corresponding to the first position in the stack.

[0012] It can be seen from the above method that the electronic device can retract the line in segments based on a segment of a line. During the duration of the first user operation, the user can see on the display screen that the line gradually retracts to the position he or she expects to retract. When the position he or she expects to retract is reached, the user can end the first user operation. The above method is not only easy for the user to operate, but also can improve the accuracy of line retraction. The user can more conveniently retract the line to the state he or she expects.

[0013] In combination with the first aspect, in some embodiments, the duration of the first user operation is a second time period. In the second time period, the speed at which the portion from the end point of the first line to the first position of the first line is removed from the display screen is a first speed.

[0014] Optionally, in other embodiments, in the second time period, the speed at which the portion from the end point of the first line to the first position of the first line is removed from the display screen varies. The second time period includes d1 time intervals, and the magnitude of the speed of removal in the d1 time intervals is increasing in chronological order. The speed of removal in the first time interval may be the first speed. The first time interval is the time interval that is first in the d1 time intervals in chronological order.

[0015] It is understandable that the longer the duration of the first user operation is, the more segmented parts need to be retracted, and the distance between the current retracted position of the line and the user's expected position is still relatively large. The electronic device can gradually increase the speed of the segmented retracted line in the second time period to improve the efficiency of retraction.

[0016] In combination with the first aspect, in some embodiments, the first user operation is a user operation acting on the first control. The electronic device determines that within a third time period before receiving the first user operation, a1 user operations acting on the first control are also received. The electronic device can determine the above-mentioned first speed according to the size of a1 and one or more of the speeds of a1 segmented retracted lines. The speeds of a1 segmented retracted lines are the speeds at which the electronic device removes the lines from the display screen within the time period of a1 user operations acting on the first control. The larger a1 is, the slower the above-mentioned first speed is. The above-mentioned first speed is lower than one or more of the speeds of a1 segmented retracted lines.

[0017] The first control may be a segmented rollback control. The first control may also have other names. The user operation on the first control may trigger the electronic device to segmentally roll back the lines displayed on the display screen in the order of drawing time from the latest to the earliest.

[0018] It is understandable that, in the case where the electronic device can rewind a line in sections, if the user wants to delete a part of a line, the user can press the section rewind control. When the line is far away from the user's desired position, the user usually long presses the section rewind control. When the line is close to the user's desired position, the user usually intermittently short presses the section rewind control until the electronic device rewinds the line to the desired position.

[0019] Then, within a period of time (such as the third time period mentioned above), the higher the frequency of the electronic device detecting the first control (i.e., the larger a1 is), the closer the current retracted position of the first line is to the position expected by the user. The electronic device can reduce the speed of the segmented retracted line or the initial speed of the segmented retracted line (i.e., the first speed) within the first user operation action time period based on one or more of the speeds of the a1 segmented retracted lines mentioned above. This can avoid as much as possible the first speed being too fast and causing too many segmented parts to retract.

[0020] In combination with the first aspect, in some embodiments, the electronic device further displays a second line on the display screen. The second line is drawn by the electronic device according to the trajectory of a single sliding operation detected on the display screen. The drawing time of the second line is earlier than the drawing time of the first line. The second line may include multiple segments. One of the multiple segments is a line corresponding to the trajectory of the sliding operation in the first time period during the drawing process of the second line. The first user operation is a user operation that acts on the first control once. After the electronic device removes the portion from the end point of the first line to the first position of the first line from the display screen, it also receives a second user operation that acts on the first control. During the time period when the second user operation acts on the first control, the electronic device may remove the segments of the first line from the display screen one by one in the direction from the first position to the starting point of the first line, with a moving step length as one segment, starting from the first position. If all the segments of the first line are removed from the display screen, the electronic device removes the segments of the second line from the display screen one by one in the direction from the end point of the second line to the starting point of the second line, with a moving step length as one segment, starting from the end point of the second line.

[0021] The speed of the electronic device retracting the line in segments during the time period of the second user operation can be determined according to the above-mentioned first speed (for example, 60% of the first speed). The speed of the electronic device retracting the line in segments during the time period of the second user operation can be constant. Optionally, the speed of the electronic device retracting the line in segments during the time period of the second user operation is variable (for example, gradually increasing). The initial speed of the electronic device retracting the line in segments during the time period of the second user operation can be determined according to the above-mentioned first speed (for example, 60% of the first speed).

[0022] As can be seen from the above embodiments, the electronic device can segment the multiple lines according to the drawing time and store the segments of the multiple lines. The user can implement segmented rollback of the multiple lines through a user operation on the first control.

[0023] In combination with the first aspect, in some embodiments, the first line may include multiple segments. One of the multiple segments is a line corresponding to the trajectory of the sliding operation within the first time period during the drawing process of the first line. Before the electronic device removes the portion from the display screen from the end point of the first line to the first position of the first line, it can calculate the drawing speed of the multiple segments. Among them, the drawing speed of a segment can be determined according to the length of the segment and the length of the first time period. The electronic device can determine whether a segment is an abnormal segment or a normal segment according to the drawing speed of the segment. The abnormal segment is a segment whose drawing speed is higher than the first threshold. The normal segment is a segment whose drawing speed is not higher than the first threshold. If it is determined that the segment where the end point of the first line is located is an abnormal segment, the electronic device can determine the first position. The first position is the intersection of the first abnormal segment and the normal segment in the first line from the end point of the first line to the starting point of the first line.

[0024] In a possible implementation, the electronic device may cluster the multiple segments of the first line according to the drawing speed of a segment using a clustering algorithm. The electronic device may divide the multiple segments of the first line into multiple categories. Among the multiple categories, one category includes a cluster center. The electronic device may determine whether the drawing speed of the cluster center is higher than the above-mentioned first threshold. If the drawing speed of the cluster center is higher than the above-mentioned first threshold, the electronic device may determine that the segments included in the category to which the cluster center belongs are all abnormal segments. Otherwise, the segments included in a category are all normal segments.

[0025] When the first position is determined, the electronic device may remove all segments of the first line from the end point to the first position from the display screen at the same time.

[0026] It can be seen from the above method that the electronic device can estimate at which moment the user is affected by external force based on the drawing speed of each segmented part in a line, causing a part of the line to deviate from the user's expected trajectory. Among them, the drawing speed of the segment drawn due to the influence of external force is much higher than the drawing speed of the segment in the normal drawing process (i.e., the drawing process not affected by external force). When the dividing point (i.e., the first position mentioned above) is estimated, the electronic device can respond to the user operation for segment rollback and remove the abnormal segmented part in the input panel. The electronic device does not remove the entire line from the input panel. When the above abnormal segmented part is removed, the user can continue to draw from the dividing point. The above method is easy for the user to operate, and can quickly roll back the lines in the input panel to the state expected by the user, thereby improving the user experience.

[0027] In a possible implementation, the duration of the first user operation is a second time period. The electronic device may determine whether the length of the second time period exceeds a second threshold. If the length of the second time period exceeds the second threshold, the electronic device may remove the segments of the first line from the display screen one by one in a direction from the first position to the starting point of the first line, with a moving step length as one segment and a moving speed as a second speed, starting from the first position.

[0028] During the time period exceeding the second threshold in the second time period, the speed of the electronic device retracting the line in sections may be variable. The second speed may be the initial speed during the time period exceeding the second threshold in the second time period. During the time period exceeding the second threshold in the second time period, the electronic device may gradually increase the speed of the retracting line in sections based on the second speed.

[0029] It is understandable that the second time period during which the first user operation continues exceeds the second threshold value, which may indicate that the demarcation point determined by the electronic device has not yet reached the position to which the user desires to rewind. During the time period during which the second time period exceeds the second threshold value, the electronic device may continue to rewind the first line in sections from the first position, so as to rewind to the position to which the user desires to rewind.

[0030] In a possible implementation, if the electronic device determines that the segment where the end point of the first line is located is not an abnormal segment, the specific method for the electronic device to remove the portion from the end point of the first line to the first position of the first line from the display screen may be: the electronic device may remove the segments of the first line from the display screen one by one, starting from the segment where the end point of the first line is located, in a direction from the end point of the first line to the starting point of the first line, with a moving step length of one segment. When the first user operation ends, the first line is segmented and retracted to the first position.

[0031] In combination with the first aspect, in some embodiments, after the electronic device removes the portion from the end point of the first line to the first position of the first line from the display screen, a third user operation is also received. The third user operation can be used to trigger the electronic device to perform segmented restoration of the lines that have been rolled back and not restored in the order of the rollback time from the latest to the earliest. The electronic device can display the portion from the first position to the second position of the first line on the display screen according to the third user operation. The second position is between the first position and the end point of the first line.

[0032] As can be seen from the above embodiments, the electronic device can restore the retracted line in sections. This can facilitate the user to restore the retracted part when the line is accidentally retracted too much. The above method of restoring the line in sections can better help the user to retract the line to the state desired by the user.

[0033] In a possible implementation, the first line may include multiple segments. One of the multiple segments is a line corresponding to the trajectory of the sliding operation within the first time period during the drawing process of the first line. The specific method for the electronic device to display the portion from the first position to the second position of the first line on the display screen according to the third user operation may be: when the third user operation starts, the electronic device displays the segments of the first line that have been removed from the display screen one by one on the display screen in the direction from the first position to the end point of the first line, with a moving step length of one segment. When the third user operation ends, the first line is restored to the second position in segments.

[0034] The duration of the third user operation is the fourth time period. In a possible implementation, within the fourth time period, the speed of partially segmented recovery from the first position to the second position of the first line may be the third speed.

[0035] In another possible implementation, in the fourth time period, the speed of the partial segment recovery from the first position to the second position of the first line is variable. The fourth time period includes d2 time intervals. The speed of the segment recovery in the d2 time intervals is increasing in chronological order. The speed of the segment recovery in the second time interval is the third speed. The second time interval is the time interval that is ranked first in chronological order among the d2 time intervals.

[0036] It is understandable that the longer the duration of the third user operation is, the more segmented parts need to be restored, and the distance between the current restored position of the line and the user's expected position is still relatively large. The electronic device can gradually increase the speed of segmented restoration of the line within the fourth time period to improve the efficiency of restoration.

[0037] In a possible implementation, the third user operation is a user operation acting on the second control. The electronic device determines that within the fifth time period before receiving the third user operation, a2 user operations acting on the second control are also received. The electronic device can determine the third speed according to the size of a2 and one or more of the speeds of the a2 segmented restoration lines. The speeds of the a2 segmented restoration lines are respectively the speeds of the electronic device segmented restoration lines within the time period of the a2 user operations acting on the second control. The larger a2 is, the slower the third speed is. The third speed is lower than one or more of the a2 segmented restoration line speeds.

[0038] The second control may be a segmented restoration control. The second control may also have other names. The user operation on the second control may trigger the electronic device to perform segmented restoration of the retracted and unrestored lines in the order of the retraction time from the latest to the earliest.

[0039] It is understandable that when the user is far away from the position where the user expects to restore, the user usually long presses the segmented restoration control. When approaching the position where the user expects to restore, the user usually intermittently short presses the segmented restoration control until the electronic device restores the line to the position where the user expects to restore. Then, within a period of time (such as the fifth time period mentioned above), the higher the frequency (i.e., the larger a2) detected by the electronic device acting on the second control, the closer the current restored position of the first line is to the position expected by the user. The electronic device can reduce the speed of the segmented retraction line or the initial speed of the retraction line (i.e., the third speed) within the third user operation action time period based on one or more of the speeds of the a2 segmented restoration lines mentioned above. In this way, it is possible to avoid the third speed being too fast and causing too many segmented parts to be restored.

[0040] From the above implementation, it can be seen that the electronic device can adjust the speed of segmented restoration of the line by detecting the duration of each user operation acting on the second control and the frequency of the user operation acting on the second control. This can improve the efficiency of segmented restoration of the line, so that the user can more conveniently return the line to the desired state.

[0041] In combination with the first aspect, in some embodiments, before the first user operation, all segments of the third line are removed from the display screen. The third line is drawn by the electronic device according to the trajectory of a single sliding operation detected on the display screen. The drawing time of the third line is later than the drawing time of the first line. The third line may include multiple segments. One of the multiple segments is a line corresponding to the trajectory of the sliding operation in the first time period during the drawing process of the third line. The retreat time of the third line is earlier than the retreat time of the first line. The third user operation is a user operation acting on the second control. After the electronic device displays the part from the first position to the second position of the first line on the display screen, it also receives a fourth user operation acting on the second control. During the time period when the fourth user operation acts on the second control, the electronic device can display the segments of the first line that have been removed from the display screen one by one on the display screen in the direction from the second position to the end point of the first line, with a moving step length as one segment, starting from the second position. If all the segments in the first line that have been removed from the display screen are displayed on the display screen, the electronic device displays the segments in the third line that have been removed from the display screen one by one on the display screen starting from the starting point of the third line, in a direction from the starting point of the third line to the ending point of the third line, with a moving step length of one segment.

[0042] The speed at which the electronic device restores the line in segments during the time period of the fourth user operation can be determined according to the third speed (for example, 60% of the third speed). The speed at which the electronic device restores the line in segments during the time period of the second user operation can be constant. Optionally, the speed at which the electronic device restores the line in segments during the time period of the fourth user operation is variable (for example, gradually increasing). The initial speed at which the electronic device restores the line in segments during the time period of the fourth user operation can be determined according to the third speed (for example, 60% of the third speed).

[0043] It can be seen from the above embodiments that after a part of a line is removed from the display screen through a user operation of segmented rewind, the electronic device can still store the segment corresponding to the part of the line removed from the display screen. When receiving a user operation for segmented recovery, the electronic device can display the recovered content on the display screen again. In addition, the user can implement segmented recovery of multiple lines through the user operation acting on the above second control. This can facilitate the user to recover the rewound part in case of accidentally rewinding too much. The above method of segmented recovery of lines can better help users to rewind the lines to the state desired by the user.

[0044] In a second aspect, an embodiment of the present application provides an electronic device, which includes a display screen, a memory, and a processor, wherein the memory is used to store a computer program, and the processor is used to call the computer program, so that the electronic device executes any possible implementation method in the first aspect.

[0045] In a third aspect, the present application provides a chip, which is applied to an electronic device, and the chip includes one or more processors, and the processor is used to call computer instructions to enable the electronic device to execute any possible implementation method as in the first aspect.

[0046] In a fourth aspect, the present application provides a computer program product comprising instructions, characterized in that when the above-mentioned computer program product is run on an electronic device, the electronic device executes any possible implementation method as in the first aspect.

[0047] In a fifth aspect, the present application provides a computer-readable storage medium, comprising instructions, characterized in that when the above instructions are executed on an electronic device, the electronic device executes any possible implementation method as in the first aspect.

[0048] It can be understood that the electronic device provided in the second aspect, the chip provided in the third aspect, the computer program product provided in the fourth aspect, and the computer-readable storage medium provided in the fifth aspect are all used to execute the method provided in the embodiment of the present application. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method, which will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1A to Figure 1C It is a schematic diagram of some line rollback scenarios provided in the embodiments of the present application;

[0050] Figure 2 is a structural diagram of an electronic device 100 provided in an embodiment of the present application;

[0051] Figure 3A to Figure 3C Schematic diagrams of other line rollback scenarios provided in embodiments of the present application;

[0052] Figure 4A to Figure 4C Schematic diagrams of other line rollback scenarios provided in embodiments of the present application;

[0053] Figure 5 is a schematic diagram of the electronic device 100 provided in an embodiment of the present application storing lines in segments;

[0054] Fig. 6A and Figure 6B Schematic diagrams of other line rollback scenarios provided in embodiments of the present application;

[0055] Figure 7is a schematic diagram of the electronic device 100 provided in an embodiment of the present application storing lines in segments;

[0056] Figure 8 It is a flow chart of a line retraction method provided in an embodiment of the present application. DETAILED DESCRIPTION

[0057] The technical solutions in the embodiments of the present application will be described clearly and in detail below in conjunction with the accompanying drawings. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in the text is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.

[0058] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features, and in the description of the embodiments of the present application, unless otherwise specified, "plurality" means two or more.

[0059] Figure 1A to Figure 1C A schematic diagram of a line rollback scenario provided in an embodiment of the present application is exemplarily shown.

[0060] The electronic device 100 may open a drawing application and display the following Figure 1A The user interface 210 shown in FIG. The user interface 210 may include a brush control 211, an eraser control 212, a back control 213, a restore control 214, a save control 217, and an input panel 218. Among them:

[0061] The input panel 218 can be used for user input and display the content input by the user. Among them, the content input by the user can be text, pictures, etc. The content input by the user can be composed of one or more lines. The trajectory of a line can be the trajectory of a single sliding operation detected by the electronic device on the input panel. That is, a line is a line completed by the user in one stroke. The sliding operation acting on the input panel can be a sliding operation of the user's finger or stylus on the display screen of the electronic device 100. The embodiment of the present application does not limit the method for the electronic device 100 to detect the above sliding operation. In a possible implementation, the electronic device 100 can determine the pixel point at the starting position and the pixel point at the ending position of a sliding operation. The line formed by the sliding trajectory between the pixel point at the starting position and the pixel point at the ending position is a line.

[0062] For example, Figure 1A The input panel 218 shown includes two lines: line 218A and line 218B, wherein the drawing time of line 218A is earlier than the drawing time of line 218B.

[0063] The brush control 211 can be used to trigger the electronic device 100 to enter the line input function, and to adjust the thickness, color and other properties of the "virtual brush". In some embodiments, the above-mentioned "virtual brush" can be presented in the user interface 210 as icons such as dots, arrows, brushes, etc. The sliding track of the "virtual brush" on the input panel can form a line. The above-mentioned line input function is a function for inputting in the input panel 218. For example, in response to a user operation acting on the brush control 211, the electronic device 100 can display a line corresponding to the track of the sliding operation according to the sliding operation detected in the input panel 218. The thicker the "virtual brush", the thicker the line formed by the sliding of the "virtual brush" on the input panel. If the color of the "virtual brush" is black, the color of the line formed by the sliding of the "virtual brush" on the input panel is black.

[0064] The eraser control 212 can be used to trigger the electronic device 100 to enter the erase function, and to adjust the properties such as the size of the "virtual eraser". The above-mentioned erase function is a function of erasing the lines displayed in the input panel 218. For example, in response to the user operation acting on the eraser control 212, the electronic device 100 can erase the content on the track of the sliding operation according to the sliding operation detected in the input panel 218. The erased content is cancelled from being displayed on the input panel 218. The larger the "virtual eraser", the more content the electronic device 100 erases according to the track of the "virtual eraser" sliding on the input panel.

[0065] The rewind control 213 can be used to trigger the electronic device 100 to rewind the lines displayed in the input panel 218. The electronic device 100 can rewind the lines displayed in the input panel 210 according to the order of drawing time from late to early. Exemplarily, the input panel 218 includes Figure 1A The line 218A and the line 218B are shown in FIG. The drawing time of the line 218A is earlier than the drawing time of the line 218B. In response to a user operation on the back control 213, the electronic device 100 can back the lines displayed in the input panel 218 to a state after the previous line of the line 218B is drawn and before the line 218B is drawn. The electronic device 100 can display the following Figure 1B The user interface 210 is shown in which the electronic device 100 removes the line 218B from the input panel 218 . Figure 1B The input panel is shown to contain only line 218A.

[0066] The above-mentioned user operation acting on the back control 213 once may be a user operation for a continuous period of time from when the user starts to touch the back control 213 to when the user stops touching the back control 213. The electronic device 100 may determine the touch operation acting on the back control 213 for a period of time detected by the touch panel as a user operation acting on the back control 213 once. The user operation acting on the back control 213 once may be used to roll back a line drawn the latest in the input panel 218. That is, in response to a user operation acting on the back control 213 once, the electronic device 100 may remove the line drawn the latest from the input panel 218.

[0067] The restore control 214 can be used to trigger the electronic device 100 to restore the retracted line. The electronic device 100 can restore the retracted line in the order of the retracted time from the latest to the earliest. Figure 1A to Figure 1B , line 218B is rolled back. Figure 1B The input panel 218 shown contains only line 218A. In response to a user operation on the restore control 214, the electronic device 100 can restore line 218B. Figure 1C As shown, when line 218B is restored, electronic device 100 may display line 128B on input panel 218 .

[0068] The user operation acting on the restore control 214 once mentioned above can refer to the introduction of the user operation acting on the rollback control 213 once mentioned above. The user operation acting on the restore control 214 once can be used to restore the line with the latest rollback time among the lines that have been rolled back and not restored. That is to say, in response to the user operation acting on the restore control 214 once, the electronic device 100 can display the line with the latest rollback time among the lines that have been rolled back and not restored in the input panel 218. The shape of a line after being restored and the position displayed in the input panel are respectively the same as the shape and the position displayed in the input panel before the line is rolled back.

[0069] When there are no lines to be restored, the state of the restore control 214 may be Figure 1A The status shown is unavailable. Figure 1A As shown, when the restore control 214 is in an unavailable state, the color of the restore control 214 is gray. When there are lines that can be restored, the state of the restore control 214 can be Figure 1B The available states are shown. Figure 1B As shown, when the restore control 214 is in an available state, the color of the restore control 214 is black. The embodiment of the present application does not limit the method by which the electronic device 100 indicates the state of the restore control 214.

[0070] The save control 217 may be used to trigger the electronic device 100 to save input content received in the input panel 218 .

[0071] The application in the above scenario is not limited to a drawing application, but can also be an application with an input panel such as a handwriting input application, a document editing application, etc. The following embodiments of this application are specifically described by taking a drawing application as an example.

[0072] Depend on Figure 1A to Figure 1C As can be seen from the scenario shown, the above-mentioned rollback control 213 only supports rolling back the lines in units of bars, but does not support rolling back a part of a line. Through the above-mentioned rollback control 213, it is difficult for the electronic device 100 to roll back the lines in the input panel to the state expected by the user, and the rollback accuracy is low. Figure 1A As shown in FIG. 2 , the user can only use the “virtual eraser” to erase the portion of the line 218B that the user wants to retract. However, for the above-mentioned erasing function, if the portion of a line that needs to be retracted intersects with other lines, the “virtual eraser” can easily erase the other lines. Moreover, for lines of different thicknesses, the user needs to adjust the size of the “virtual eraser”. Obviously, when the user erases a portion of a line with an eraser, the operation is cumbersome and the user experience is poor.

[0073] In professional drawing applications such as Photoshop and CAD, the electronic device 100 can cut a line. The cutting position can be the position where the user expects the line to return. Furthermore, the electronic device 100 can delete the cut portion of the line to achieve the line returning to the position expected by the user. However, the above method requires that the application can provide the above professional functions. Applications such as handwriting input method applications and drawing applications installed in electronic devices such as mobile phones and tablets often do not have such functions. In addition, the above method requires the user to master the use of the above professional functions. The user's operation is relatively cumbersome.

[0074] The embodiment of the present application provides a method for rewinding a line. In this method, an electronic device can monitor a sliding track acting on an input panel, and display a line corresponding to the sliding track on the input panel. The electronic device can store a line in segments according to the drawing time of a line. This line may include multiple segmented parts. One of the segmented parts may be a line corresponding to the sliding track within a preset segmented time period (such as within 2 milliseconds). In response to a user operation acting on a segmented rewind control once, the electronic device can rewind the line in the input panel at a speed A in a segmented time period A when a user operation is detected on the segmented rewind control. Among them, the speed A of the electronic device rewinding the line in the time period A can be determined by the time length of one or more user operations acting on the segmented rewind control before the user operation acting on the segmented rewind control once. If the time length of the one or more user operations before the above-mentioned one time shows a trend of shortening in the order of the action time, the electronic device can reduce the speed of rewinding the line in the time period A on the basis of the speed of rewinding the line when the one or more user operations before the above-mentioned one time act.

[0075] It is understandable that in the case where the electronic device can rewind a line in segments, if the user wants to delete a part of a line, the user can press the segmented rewind control. Among them, when far away from the user's desired position, the user usually long presses the segmented rewind control. When approaching the user's desired position, the user usually intermittently short presses the segmented rewind control until the electronic device rewinds the line to the desired position. It can be seen that the length of time and frequency of the user pressing the segmented rewind control can reflect the distance between the current rewind position of the line and the user's desired position. Then, the electronic device can adjust the speed of the segmented rewind line by detecting the length of time each user operation acting on the segmented rewind control and the frequency of the user operation acting on the segmented rewind control. The above method can not only improve the accuracy of the rewind, rewind the lines in the input panel to the user's desired state, but also is easy for the user to operate.

[0076] The above-mentioned segmented rollback control may be newly added to the above-mentioned user interface 210. The segmented rollback control will be specifically introduced in the subsequent embodiments of this application.

[0077] The above line retreat method can be applied to electronic devices with display screens, such as mobile phones, tablet computers, laptop computers, televisions, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), etc. The embodiments of the present application do not limit the specific types of electronic devices.

[0078] The structure of the electronic device involved in the embodiments of the present application is introduced below.

[0079] Figure 2 A schematic structural diagram of an electronic device 100 provided in an embodiment of the present application is shown.

[0080] The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0081] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0082] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0083] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0084] The USB interface 130 is an interface that complies with the USB standard specification, and specifically can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transfer data between the electronic device 100 and a peripheral device. It can also be used to connect headphones to play audio through the headphones. The interface can also be used to connect other electronic devices, such as AR devices, etc.

[0085] The charging management module 140 is used to receive charging input from a charger. While the charging management module 140 is charging the battery 142 , it can also power the electronic device through the power management module 141 .

[0086] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, and the wireless communication module 160. In some other embodiments, the power management module 141 may also be provided in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 may also be provided in the same device.

[0087] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

[0088] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0089] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.

[0090] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.

[0091] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0092] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.

[0093] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.

[0094] The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.

[0095] ISP is used to process the data fed back by camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to ISP for processing and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, ISP can be set in camera 193.

[0096] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0097] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0098] Video codecs are used to compress or decompress digital videos. The electronic device 100 may support one or more video codecs. Thus, the electronic device 100 may play or record videos in a variety of coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

[0099] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of electronic device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.

[0100] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.

[0101] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.

[0102] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0103] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110.

[0104] Speaker 170A, also called a "horn", is used to convert audio electrical signals into sound signals

[0105] The receiver 170B, also called a "handset", is used to convert audio electrical signals into sound signals.

[0106] Microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals.

[0107] The earphone interface 170D is used to connect a wired earphone and can be a USB interface 130 or a 3.5 mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.

[0108] The pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be set on the display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. The capacitive pressure sensor can be a parallel plate including at least two conductive materials. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of the pressure according to the change in capacitance. When a touch operation acts on the display screen 194, the electronic device 100 detects the touch operation intensity according to the pressure sensor 180A. The electronic device 100 can also calculate the touch position according to the detection signal of the pressure sensor 180A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities can correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold acts on the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.

[0109] The gyro sensor 180B may be used to determine the motion posture of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (ie, x, y, and z axes) may be determined by the gyro sensor 180B.

[0110] The air pressure sensor 180C is used to measure air pressure.

[0111] The magnetic sensor 180D includes a Hall sensor. The electronic device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip leather case. In some embodiments, when the electronic device 100 is a flip phone, the electronic device 100 can detect the opening and closing of the flip cover according to the magnetic sensor 180D. Then, according to the detected opening and closing state of the leather case or the opening and closing state of the flip cover, the flip cover can be automatically unlocked.

[0112] The acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in all directions (generally three axes). When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of the electronic device and is applied to applications such as horizontal and vertical screen switching and pedometers.

[0113] The distance sensor 180F is used to measure the distance. The electronic device 100 can measure the distance by infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 can use the distance sensor 180F to measure the distance to achieve fast focusing.

[0114] The proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device 100 emits infrared light outward through the light emitting diode. The electronic device 100 uses a photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100. The electronic device 100 can use the proximity light sensor 180G to detect that the user holds the electronic device 100 close to the ear to talk, so as to automatically turn off the screen to save power. The proximity light sensor 180G can also be used in leather case mode and pocket mode to automatically unlock and lock the screen.

[0115] The ambient light sensor 180L is used to sense the brightness of ambient light.

[0116] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application locks, fingerprint photography, fingerprint call answering, etc.

[0117] The temperature sensor 180J is used to detect the temperature.

[0118] The touch sensor 180K is also called a "touch panel". The touch sensor 180K can be set on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen". The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be set on the surface of the electronic device 100, which is different from the position of the display screen 194.

[0119] For example, the touch sensor 180K can detect the sliding operation on the input panel 218 in the above embodiment. The touch sensor 180K can transmit the above sliding operation to the application processor. When the electronic device 100 enters the line input function, the electronic device 100 can display the line determined by the trajectory of the sliding operation on the display screen.

[0120] The bone conduction sensor 180M can obtain vibration signals. In some embodiments, the bone conduction sensor 180M can obtain vibration signals of vibrating bones of the human body. The bone conduction sensor 180M can also contact the human body's pulse to receive blood pressure beating signals.

[0121] The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The electronic device 100 may receive key input and generate key signal input related to user settings and function control of the electronic device 100.

[0122] Motor 191 can generate vibration prompts.

[0123] Indicator 192 may be an indicator light, which may be used to indicate charging status, power changes, messages, missed calls, notifications, etc.

[0124] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to and separated from the electronic device 100 by inserting it into the SIM card interface 195 or pulling it out from the SIM card interface 195. The electronic device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, and the like. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as calls and data communications. In some embodiments, the electronic device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.

[0125] The following specifically introduces the scenario of segmented retraction of lines provided by an embodiment of the present application.

[0126] Figure 3A to Figure 3C Another schematic diagram of a line rollback scenario provided in an embodiment of the present application is exemplarily shown.

[0127] The electronic device 100 may open a drawing application and display the following Figure 3AThe user interface 210 shown in FIG. The user interface 210 may include a brush control 211, an eraser control 212, a back control 213, a restore control 214, a segmented back control 215, a segmented restore control 216, a save control 217, and an input panel 218. In addition to the segmented back control 215 and the segmented restore control 216, other contents in the user interface 210 may refer to the aforementioned Figure 1A The description of the illustrated embodiment will not be repeated here.

[0128] The segmented rewind control 215 can be used to trigger the electronic device 100 to segmentally rewind the lines displayed in the input panel 218. The electronic device 100 can segmentally rewind the lines displayed in the input panel 210 according to the order of drawing time from late to early. The electronic device 100 can segment and store one or more lines in the input panel 218 according to the drawing time. A segmented part can be a line corresponding to the sliding track within a preset time period.

[0129] Take line 218B in input panel 218 as an example for explanation. The starting point of line 218B is the pixel point where the electronic device 100 detects the start of a sliding operation when the electronic device 100 enters the line input function. The end point of line 218B is the pixel point where the sliding operation ends. Obviously, from the starting point to the end point of line 218B, the drawing time is from early to late. The electronic device 100 can store line 218B in segments according to the drawing time. When a user operation acting on the segmented fallback control 215 is detected, the electronic device 100 can fall back from the segmented part where the end point of line 218B is located to the segmented part where the starting point of line 218B is located in the order of drawing time from late to early.

[0130] The electronic device 100 may store the line 218A in segments according to the drawing time. The drawing time of the line 218A is earlier than the drawing time of the line 218B. When the electronic device 100 rolls back all the segmented parts of the line 218B (i.e., the line 218B is removed from the input panel 218), the electronic device 100 may continue to roll back the segmented parts of the line 218A in segments according to the order of drawing time from the latest to the earliest.

[0131] like Figure 3AAs shown, when a user operation acting on the segmented rewind control 215 is detected, the electronic device 100 starts to rewind in segments from the segmented part where the end point of the line 218B is located. During the time period A when the user operation acts on the segmented rewind control 215, the electronic device 100 can rewind in segments at a speed A. The above speed A is variable. When no user operation acting on the segmented rewind control 215 is detected (that is, the user stops touching the segmented rewind control 215), the electronic device 100 can stop rewinding the line in segments. For example, the electronic device 100 detects a user operation acting on the segmented rewind control 215, and the duration of this user operation is time period A. After time period A, the electronic device 100 rewinds the line 218B to Figure 3B At position A shown.

[0132] The segmented restoration control 216 can be used to trigger the electronic device 100 to restore the retracted line segment by segment. The electronic device 100 can restore the retracted line segment by segment according to the order of the retracted time from the latest to the earliest. Figure 3B As shown, line 218B is segmented and retracted to position A. It is understandable that, in the retracted segmented portion, the closer the segmented portion is to position A, the later the retraction time is. In response to a user operation on the segmented retraction control 216 for a duration of time period B, the electronic device 100 can start to segmentally restore line 218B from position A, and segmentally restore line 218B to Figure 3C The restored segmented part can be displayed again in the input panel 218. The shape of the restored segmented part and the position displayed in the input panel are respectively the same as the shape and the position displayed in the input panel before the segmented part is rolled back.

[0133] When there are no lines to be restored, the state of the segment restoration control 216 may be Figure 3A The status shown is unavailable. Figure 3A As shown, when the segment recovery control 216 is in an unavailable state, the color of the segment recovery control 216 is gray. When there is a line that can be recovered, the state of the segment recovery control 216 can be Figure 3B The available states are shown. Figure 3B As shown, when the segment recovery control 216 is in an available state, the color of the segment recovery control 216 is black. The embodiment of the present application does not limit the method for the electronic device 100 to identify the state of the segment recovery control 214.

[0134] Similarly, when there is no line that can be rolled back, the electronic device 100 can display the segmented rollback control 215 as an unavailable state (e.g., the color of the segmented rollback control 215 is gray). When there is a line that can be rolled back, the electronic device 100 can display the segmented rollback control 215 as an available state (e.g., the color of the segmented rollback control 215 is black).

[0135] By the above Figure 3A to Figure 3C As can be seen from the illustrated embodiment, the user can use the above segmented rewind control to rewind the unnecessary part of a line, and use the segmented restore control to segmentally restore the rewinded but still necessary part of a line. The longer the user operation on the segmented rewind control lasts, the more segmented parts the electronic device 100 rewinds. The above embodiment can improve the accuracy of line rewinding, and the user can easily rewind the line to the desired state.

[0136] The following is based on Figure 3A to Figure 3C The scenario shown describes the process of an electronic device adjusting the speed of a segmented retreat line.

[0137] Phase 1: the electronic device 100 responds to the first segmentation user operation and performs segmented retraction of the line.

[0138] When the line input function is entered, the electronic device 100 may display a line corresponding to the sliding track on the input panel 218 according to the sliding track detected on the input panel 218. For example, the electronic device 100 may display a line corresponding to the sliding track on the input panel 218 according to the sliding track. Figure 3A Shown are line 218A and line 218B.

[0139] like Figure 4A As shown, in response to a user operation on the segmented rewind control 215 lasting for 3 seconds (hereinafter referred to as the first segmented user operation), the electronic device 100 rewinds the line 218B to position C.

[0140] That is, when the input panel 218 displays the line 218A and the line 218B, the user presses the segmented rewind control 215 for the first time and keeps pressing for 3 seconds, so that the line 218B is rewound from the end point to the position C. The segmented portion from the end point of the line 218B to the position C (i.e. Figure 4A The line back portion shown) is removed in the input panel 218.

[0141] In some embodiments, during the time period when the first segmented user operation is detected, the electronic device 100 can adjust the speed of the segmented rewind line during this time period. It is understandable that the longer the duration of the action on the segmented rewind control 215 is, the more segmented parts need to be retracted, and the distance between the current retracted position of the line and the user's desired position is still relatively large. The electronic device 100 can gradually increase the speed of the segmented rewind line during the time period when the first segmented user operation is applied to improve the efficiency of the rewind.

[0142] For example, when the first segmented user operation is detected, the electronic device 100 may 1 Start to rewind in segments from the end point of line 218B. When the duration of the first segmented user operation exceeds 1s, the electronic device 100 can rewind in segments at a speed v 2 Continue to retract the line in segments. Speed ​​v 2 Not less than speed v 1 When the duration of the first segmented user operation exceeds 3 seconds, the electronic device 100 may 3 Continue to retract the line in segments. Speed ​​v 3 Not less than speed v 2 When the first segmentation user operation ends, the electronic device 100 may stop segmenting and retracting the line.

[0143] In some embodiments, during the time period when the first segmented user operation is detected, the electronic device 100 may retract the line in segments at a constant speed. For example, when the first segmented user operation is detected, the electronic device 100 may retract the line in segments at a constant speed v 1 The segmented retraction starts from the end point of the line 218. When the first segmented user operation ends, the electronic device 100 may stop retracting the line segment by segment.

[0144] In the embodiment of the present application, the above speed v 1 , speed v 2 , speed v 3 The specific value of and the method of dividing the time intervals with different fallback speeds are not limited.

[0145] Phase 2: the electronic device 100 responds to the second segmentation user operation and retracts the line in segments.

[0146] like Figure 4B As shown, after detecting the first segmented user operation, the electronic device 100 detects a user operation on the segmented back control 215 for 2 seconds (hereinafter referred to as the second segmented user operation). In response to the second segmented user operation, the electronic device 100 moves the line 218B from Figure 4A Return to position C as shown Figure 4B At position D shown.

[0147] That is, after the user presses the segmented back control 215 for the first time, the user presses the segmented back control 215 again (for the second time) and continues for 2 seconds, so that the line 218B can be retracted from position C to position D. The segmented portion from position C to position D of the line 218B (i.e. Figure 4B The line back portion shown) is removed in the input panel 218.

[0148] In some embodiments, according to the speed of the retracted line in the time period of the first segmented user operation, the electronic device 100 can adjust the speed of the retracted line in the time period of the second segmented user operation. It can be understood that in the scenario where the user wants to delete a part of a line in the input panel, the user usually long presses the segmented retract control 215 once to make the line retract to the segmented part close to the desired position. Further, the user usually intermittently short presses the segmented retract control 215 to make the electronic device 100 continue to retract the line in segments by a small amplitude until the segmented part of the desired position is reached. Then, the electronic device 100 can reduce the speed of the retracted line in the second segmented user operation time period based on the initial speed of the retracted line in the first segmented user operation time period. In this way, it can be avoided as much as possible that the speed of the retracted line in the second segmented user operation time period is too fast, resulting in too many retracted segmented parts.

[0149] For example, when the second segmented user operation is detected, the electronic device 100 may 4 Line 218B is retracted in segments from position C. The initial speed of the retracted line during the time period of the first segment user operation is v 1 . Speed ​​v 4 No greater than speed v 1 For example, v 4 =0.6*v 1 When the second segmentation user operation ends, the electronic device 100 can stop segmenting and retracting the line. 4 There is no restriction on the specific value of .

[0150] In some embodiments, the speed of the retracted line in the second segmented user operation time period can be variable. It is understandable that after the first segmented user operation, the position where the line is retracted is not necessarily close to the position expected by the user. Then, the duration of the second segmented user operation may be relatively long. Then, according to the retracted line speed in the first segmented user operation time period, the electronic device 100 can determine the initial speed of the retracted line in the second segmented user operation time period. When the duration of the second segmented user operation exceeds the preset time period, the electronic device 100 can increase the speed of the retracted line. It can be seen that the user long presses the segmented retracted control 215 to indicate that the user needs to retract more segmented parts. The electronic device 100 can increase the speed of the segmented retracted, thereby improving the efficiency of retracting.

[0151] For example, when the second segmented user operation is detected, the electronic device 100 may 4 The stepwise retreat starts from position C of line 218B. The above speed v 4 It can be determined according to the initial speed of the retracted line during the first segmented user operation time period. When the duration of the second segmented user operation exceeds 1s, the electronic device 100 can be adjusted according to the speed v 5 Continue to retract the line in segments. Among them, the speed v 5 Not less than speed v 4 .

[0152] Optionally, the above speed v 4 It can also be based on the speed of the retracted line at the end of the first user operation (such as speed v 3 ) is confirmed.

[0153] In a possible implementation, the electronic device 100 may determine whether the time interval between the first segmented user operation and the second segmented user operation exceeds a preset time length (e.g., 5 seconds). The time interval between the first segmented user operation and the second segmented user operation may be: the time difference between the moment when the first segmented user operation ends and the moment when the second segmented user operation begins.

[0154] If it is determined that the preset time length is not exceeded, the electronic device 100 can determine the speed of the retracted line in the second segmented user operation action time period according to the method in the above embodiment. If it is determined that the preset time length is exceeded, the electronic device 100 can determine whether the first segmented user operation and the second segmented user operation are two consecutive user operations. Two consecutive user operations can mean that the electronic device 100 does not detect other user operations between the two user operations. If it is determined that it is two consecutive user operations, the electronic device 100 can determine the speed of the retracted line in the second segmented user operation action time period according to the method in the above embodiment. If it is determined that it is not two consecutive user operations, the electronic device 100 can determine the method of retracting the line speed in the second segmented user operation action time period according to the method of determining the speed of the retracted line in the first segmented user operation action time period in the above embodiment.

[0155] In another possible implementation, the electronic device 100 may directly determine whether the first segmented user operation and the second segmented user operation are two consecutive user operations. If it is determined that they are two consecutive user operations, the electronic device 100 may determine the speed of the retracted line within the time period of the second segmented user operation according to the method in the above embodiment. If it is determined that they are not two consecutive user operations, the electronic device 100 may determine the speed of the retracted line within the time period of the second segmented user operation according to the method for determining the speed of the retracted line within the time period of the first segmented user operation in the above embodiment.

[0156] It is understandable that if the time interval between the first segmented user operation and the second segmented user operation is too long, or there are other user operations between the first segmented user operation and the second segmented user operation, the two user operations can be considered to have no correlation. That is, the state in which the user expects the line to retract when performing the first segmented user operation and the state in which the user expects the line to retract when performing the second segmented user operation are different. Then, the electronic device 100 can determine the two user operations as two independent user operations, without determining the speed of the retracted line in the second segmented user operation action time period based on the speed of the retracted line in the first segmented user operation action time period.

[0157] Stage 3: the electronic device 100 responds to the third segmentation user operation and retracts the line in segments.

[0158] like Figure 4C As shown, after detecting the first segmented user operation and the second segmented user operation, the electronic device 100 detects a user operation on the segmented back control 215 for a duration of 0.5s (hereinafter referred to as the third segmented user operation). In response to the third segmented user operation, the electronic device 100 moves the line 218B from Figure 4B Position D shown returns to Figure 4C At position E shown.

[0159] That is, the user Figure 4A and Figure 4B After pressing the segmented rewind control 215 twice, the segmented rewind control 215 is pressed once (for the third time) and lasts for 0.5 seconds, so that the line 218B is retracted from position D to position E. The segmented portion (i.e., the segmented portion) from position D to position E of the line 218B is Figure 4C The line back portion shown) is removed in the input panel 218.

[0160] In some embodiments, the electronic device 100 can adjust the speed of the retracted line in the third segmented user operation action time period according to the speed of the retracted line in the second segmented user operation action time period. The specific method can refer to the method in stage 2 of the aforementioned embodiment, in which the electronic device 100 determines the speed of the retracted line in the second segmented user operation action time period according to the speed of the retracted line in the first segmented user operation action time period. It will not be repeated here.

[0161] For example, when the third segmented user operation is detected, the electronic device 100 may 6 Line 218B is retracted in segments from position D. The initial speed of the retracted line during the second segment user operation period is v 4 . Speed ​​v 6 No greater than speed v 4 For example, v 6 =0.6*v 4 When the third segmentation user operation ends, the electronic device 100 may stop segmenting the line. 6 There is no restriction on the specific value of .

[0162] As can be seen from the above embodiments, the electronic device 100 can determine the speed of the rewind line in the current segmented user operation time period according to the speed of the rewind line in the previous segmented user operation time period. The previous segmented user operation and the current segmented user operation can be two consecutive user operations, or can be two user operations within a preset time length.

[0163] In some embodiments, the electronic device 100 can be configured to generate a segmented user operation based on the time T before the start of the current segmented user operation. 1 The speed of the rewind line in the current segmented user operation time period is determined by the speed of the rewind line in the segmented user operation time period of the user operation several times acting on the segmented rewind control 215. 1The value of can be set based on experience. 1 There is no restriction on the specific value of .

[0164] Exemplarily, the first segmented user operation and the second segmented user operation are both T before the time when the third user operation starts. 1 The electronic device 100 can adjust the speed of the retracted line (such as the speed v) according to the user operation within the first segmented user operation time period. 1 ), the speed of the retracted line during the second segmented user operation period (such as speed v 4 ) to determine the speed during the third segmented user operation time period.

[0165] The values ​​of the various speeds, the values ​​of the time intervals, the duration of the user operation, and the positions of the line retraction in the aforementioned embodiments are all exemplary descriptions and should not constitute limitations on the present application.

[0166] Depend on Figure 4A to Figure 4C As can be seen from the illustrated embodiment, the length of time and frequency of the user's action on the segmented rewind control can reflect the distance between the current position of the line and the position expected by the user. The electronic device 100 can adjust the speed of the segmented rewind line by detecting the duration of each user operation acting on the segmented rewind control and the frequency of the user operation acting on the segmented rewind control. Among them, the longer the duration of the user operation acting on the segmented rewind control, the electronic device 100 can gradually increase the speed of the rewind line within the time period of this user operation. The frequency of the user operation acting on the segmented rewind control is high (i.e., the number of user operations acting on the segmented rewind control within the preset time length is large), which can indicate that the duration of the user operation acting on the segmented rewind control multiple times within the preset time length is short, and the time interval between the user operations acting on the segmented rewind control twice is also short. The electronic device 100 can gradually reduce the speed of the rewind line within the time period of these multiple user operations. The above embodiment can provide the accuracy of the rewind line, and the user can more conveniently rewind the line in the input panel to the desired state.

[0167] In response to the user operation on the segmented restoration control 216, the electronic device 100 can restore the rewound lines in segments according to the order of the rewind time from late to early. It can be understood that when the user is far away from the position where the user wants to restore, the user usually long presses the segmented restoration control. When approaching the position where the user wants to restore, the user usually intermittently short presses the segmented restoration control until the electronic device restores the line to the position where the user wants to restore. Then, the electronic device 100 can adjust the speed of the segmented restoration line by detecting the duration of each user operation on the segmented restoration control and the frequency of the user operation on the segmented restoration control. The specific implementation method can refer to the aforementioned Figure 4A to Figure 4C The implementation method of the electronic device 100 adjusting the speed of the segmented retreat line will not be described in detail here.

[0168] The following is based on Figure 3A to Figure 3C The scenario shown introduces a specific implementation method of segmented storage lines, segmented rollback lines and segmented recovery lines provided in an embodiment of the present application.

[0169] The above method involves the concept of "layer". To facilitate understanding, the concept of layer is first introduced here.

[0170] Layer: A layer can be used to draw an image. The size of a layer can be the same as the size of the input panel in the aforementioned embodiment. Except for the image portion drawn on a layer, the rest of a layer is transparent. Different images can be drawn on different layers. Multiple layers can be stacked in a certain order. Among them, the image in the layer stacked on the upper layer may obscure the image in the layer stacked on the lower layer. The image presented after multiple layers are stacked in a certain order is the content displayed in the input panel.

[0171] In some embodiments, a line is drawn on each layer. A line can be determined by the trajectory of a single sliding operation detected by the electronic device 100 on the input panel. After drawing a line on a layer, the electronic device 100 can create a new layer and draw a line determined by the trajectory of the single sliding operation detected after the new layer is created on the new layer. The electronic device 100 can stack all layers in order of drawing time from early to late. The layers with early drawing time are stacked on the lower layer. The layers with late drawing time are stacked on the upper layer. Figure 1A and Figure 1C As can be seen from the embodiment shown, the electronic device 100 rolls back the lines in the input panel in units of strips, and the specific method may be to roll back the layers in the order of stacking from the upper layer to the lower layer. The lines in the rolled back layers are removed from the input panel.

[0172] In some embodiments, a segmented portion of a line may be drawn on each layer. In the process of drawing a line, the electronic device 100 may segment the line every preset segmentation time period (such as 2 milliseconds). In each layer, after drawing a segmented portion of a line on a layer, the electronic device 100 may create a new layer, and draw the segmented portion determined by the trajectory of the sliding operation detected within the preset segmentation time period starting from the initial moment of detecting the sliding operation after the new layer is created on the new layer. The electronic device 100 may stack all layers in the order of drawing time from early to late. In particular, the layer with an early drawing time is stacked on the lower layer. The layer with a late drawing time is stacked on the lower layer. It can be seen that the electronic device 100 rolls back the layer on which a segmented portion of a line is drawn, and segmented rollback of the line can be achieved.

[0173] Here, the line 218B in the above embodiment is taken as an example for explanation.

[0174] 1. About segmented storage lines

[0175] like Figure 5 As shown, line 218B is displayed in the input panel. Line 218B is determined by the trajectory of a single sliding operation detected by the electronic device 100 in the input panel. During the drawing process of line 218B, the electronic device 100 can segment line 218B according to the drawing time, and draw different segmented parts on different layers. Exemplarily, the electronic device 100 divides line 218B into 6 segments, including: segmented part A, segmented part B, segmented part C, segmented part D, segmented part E, and segmented part F. Segmented part A is the segmented part where the starting point of line 218B is located. Segmented part F is the segmented part where the ending point of line 218B is located. Before the trajectory of the sliding operation to determine line 218B is detected, a blank layer has been established in the electronic device 100. When entering the line input function, the electronic device 100 draws the segmented portion (i.e., segmented portion A) determined by the trajectory of the sliding operation detected within the preset segmented time period starting from the initial moment of detecting the sliding operation in the above-mentioned established blank layer, and establishes a new layer. After establishing this new layer, the electronic device 100 can draw the segmented portion (i.e., segmented portion B) determined by the trajectory of the sliding operation detected within the preset segmented time period starting from the initial moment of detecting the sliding operation on this new layer. The electronic device 100 can determine that the sliding operation of segmented portion A and the sliding operation of segmented portion B are operations performed in different time periods in a single sliding operation. That is, segmented portion A and segmented portion B are two segmented portions in a line.

[0176] The method for the electronic device 100 to draw segmented portion C, segmented portion D, segmented portion E and segmented portion F can refer to the method for drawing segmented portion A and segmented portion B, which will not be repeated here. It can be seen that these six segmented portions can be drawn on different layers respectively.

[0177] The layer used to draw each segmented part may also be created by the electronic device 100 at the initial moment when the corresponding sliding operation is detected. The embodiment of the present application does not limit the creation time of the layer.

[0178] like Figure 5 As shown, segmented portion A, segmented portion B, segmented portion C, segmented portion D, segmented portion E, and segmented portion F are drawn on layer A, layer B, layer C, layer D, layer E, and layer F, respectively. Each layer has a timestamp. The timestamp of a layer can be determined by the drawing time of the segmented portion on this layer. The electronic device 100 can determine the early and late order of the drawing time of the segmented portion on this layer according to the timestamp of a layer. For example, the timestamps of layer A, layer B, layer C, layer D, layer E, and layer F are timestamp t respectively. 1 , timestamp t 2 , timestamp t 3 , timestamp t 4 , timestamp t 5 , timestamp t 6 .

[0179] In some embodiments, the electronic device 100 can store the layer with each segmented part of a line segment drawn in a stack. A stack is a linear table that can only perform insertion and deletion operations at one end, and stores data according to the first-in-last-out principle. The data that enters the stack first is pushed to the bottom of the stack, and the data that enters the stack last is at the top of the stack.

[0180] like Figure 5 As shown, the electronic device 100 can store the layers of the line 218B into stack A according to the order of drawing time from earliest to latest. Specifically, each time a layer with a segmented portion of the line 218B is obtained, the electronic device 100 can store this layer into stack A. It can be seen that the segmented portion A on layer A is the segmented portion with the earliest drawing time in line 218B. The electronic device 100 first stores layer A into stack A. Layer A is located at the bottom of stack A. The segmented portion F on layer F is the segmented portion with the latest drawing time in line 218B. The electronic device 100 finally stores layer F into stack A. Layer F is located at the top of stack A. The pointer can point to the position of layer F in stack A. The layer pointed to by the above pointer can be the layer that is stacked on the top layer among the layers of all drawn contents displayed in the input panel.

[0181] 2. About segmented retreat lines

[0182] When receiving a user operation on the segmented back control 215, the electronic device 100 may move the position pointed to by the pointer from the top of stack A to the bottom of stack A. For example, in response to a user operation on the segmented back control 215, the electronic device 100 moves the position pointed to by the pointer to the position where layer C is located. Then, the segmented parts drawn on layers D, E, and F are removed from the input panel. Line 218B is retracted to the position where the intersection of segmented part C and segmented part D is located.

[0183] like Figure 5 As shown, the pointer moves in steps of one layer.

[0184] The speed at which the electronic device 100 moves the pointer is the speed of the retracted line in the above embodiment. The method for implementing the electronic device 100 to adjust the speed of the pointer movement can refer to the above Figure 4A to Figure 4C The embodiments shown will not be described in detail here.

[0185] In some embodiments, the electronic device 100 may store different lines in different stacks. For example, before receiving a sliding operation to determine line 218B, the electronic device 100 also receives a sliding operation to determine the aforementioned Figure 4A The electronic device 100 can segment the line 218A according to the drawing time, and store the segmented parts of the line 218A in the order of drawing time from earliest to latest into the stack B. Stack B and stack A are two different stacks. Obviously, the drawing time of the segmented parts on all layers in stack B is earlier than the drawing time of the segmented parts on all layers in stack A.

[0186] When the pointer points to layer F of stack A, the electronic device 100 can stack all the layers in stack B and stack A in the order of drawing time from earliest to latest. The layers with earlier drawing time are stacked on the lower layer. The layers with later drawing time are stacked on the upper layer. The image presented after these multiple layers are stacked can refer to the above Figure 3A Input panel 218 is shown with line 218A and line 218B displayed therein.

[0187] In response to a user operation on the segmented rewind control 215, the electronic device 100 moves the pointer to the position of layer C. The electronic device 100 can stack all layers in stack B and layer A, layer B, and layer C in stack A in the order of drawing time from earliest to latest. The image presented after these multiple layers are stacked can refer to the above-mentioned Figure 4B The content displayed in the input panel shown. Among them, Figure 3B The position A shown may be the position where the intersection of the segmented portion C and the segmented portion D is located.

[0188] In some embodiments, the electronic device 100 rewinds the layer to the bottom of stack A. That is, the pointer points to layer A of stack A. If a user operation acting on the segmented rewind control 215 is detected, the electronic device 100 can move the pointer from layer A to the layer at the top of stack B, and move from the top of stack B to the bottom of stack B. In other words, when all segmented parts of line 218B are retracted, the electronic device 100 can retract segment by segment from the segmented part where the end point of line 218A is located to the segmented part where the starting point of line 218A is located. Among them, line 218A is a line drawn before line 218B and closest to the drawing time of line 218B.

[0189] It can be seen that the electronic device 100 is not limited to rewinding the line drawn most recently, and can rewind multiple lines in sections according to the order of drawing time from late to early, which can better help the user to rewind the line to the state desired by the user.

[0190] In some embodiments, in response to a user operation on the segmented back control 215, the electronic device 100 moves the pointer to Figure 5 The position of layer C shown. Further, the electronic device 100 enters the line input function and detects a sliding operation on the input panel. The electronic device 100 can display a line (referred to as line C) on the input panel according to the trajectory of this sliding operation. Among them, the electronic device 100 can segment line C according to the method of the aforementioned embodiment, and store the segmented parts of line C in stack C in the order of drawing time from early to late. The above pointer can point to the layer at the top of stack C. In addition, the electronic device 100 can delete layer D, layer E and layer F in stack A. When the pointer points to the layer at the top of stack C, in response to a user operation acting on the segmented backoff control 215, the electronic device 100 can move the pointer in the direction from the top of stack C to the bottom of stack C. When the pointer moves to the bottom of stack C, the pointer can move from the bottom of stack C to layer C of stack A, and move the pointer in the direction from layer C to the bottom of stack A (i.e., layer A). It can be seen that after the electronic device 100 performs segmented retraction on a line and receives a sliding operation from the user and displays new drawing content on the input panel, the structure of the stack storing the segmented retracted line is destroyed. The electronic device 100 deletes the layer having the segmented portion that has been segmented retracted from the stack.

[0191] That is to say, when the user retracts a part of a line and draws a new line again, the retracted content cannot be restored.

[0192] 3. About segmented restoration of lines

[0193] In response to the user operation acting on the segmented restoration control 216, the electronic device 100 can segmentally restore the retracted line according to the order of the retraction time from the latest to the earliest. The electronic device 100 can segmentally restore the line by moving the above-mentioned pointer. The moving direction of the pointer when the line is segmented restored is opposite to the direction of the pointer when the line is segmented retracted in the above-mentioned embodiment.

[0194] For example, after segmented rollback, the pointer moves to Figure 5 The position of layer C in stack A is shown. In response to a user operation on the segment recovery control 216, the electronic device 100 can move the pointer from the position of layer C in the direction from the bottom of the stack to the top of the stack. For example, when the pointer moves to the position of layer E, the above-mentioned user operation on the segment recovery control 216 ends, and the electronic device 100 stops moving the pointer. Then the above-mentioned layers D and E that have been rolled back can be restored. The electronic device 100 can display the segmented parts drawn in layers D and E in the input panel. Among them, in the process of restoring the segmented parts in line 218B, the segmented parts drawn in the layer that is restored first (i.e., layer D) are first displayed in the input panel.

[0195] In the process of segmented restoration of the line, the method for implementing the electronic device 100 to adjust the speed of the pointer movement can refer to the aforementioned Figure 4A to Figure 4C The embodiments shown will not be described in detail here.

[0196] Figure 5 The segmentation of line 218B shown is for exemplary purposes only and should not be construed as limiting the present application.

[0197] Depend on Figure 5 It can be seen from the illustrated embodiment that the electronic device 100 can draw line segments on different layers. When a layer is rolled back, the segmented portion drawn on this layer is removed in the input panel. In this way, the electronic device 100 can implement segmented rollback of lines. Among them, the electronic device 100 can store different layers in a stack in the order of drawing time from early to late. The electronic device 100 can adjust the movement speed of the pointer by detecting the duration of each user operation acting on the segmented rollback control and the frequency of user operations acting on the segmented rollback control, thereby adjusting the speed of the segmented rollback line. The above method can improve the accuracy of the rollback line, and the user can more conveniently roll back the lines in the input panel to the desired state.

[0198] In some embodiments, the electronic device 100 may store the segmented parts of k lines determined by the trajectories of the k sliding operations received most recently. For the segmented parts of the lines determined by the trajectories of the sliding operations before the k sliding operations, the electronic device 100 may merge the layers with the segmented parts of one of the lines drawn into one layer and store it. This can save the storage space of the electronic device 100.

[0199] That is to say, for the line determined by the track of the sliding operation before the k sliding operations, the electronic device 100 can retract in units of bars. The value of k can be set according to an empirical value. The embodiment of the present application does not limit the value of k.

[0200] In some embodiments, the user operation of the back control 213 or the restore control 214 in the above-mentioned embodiments does not destroy Figure 5 The structure of the stack of lines shown. That is, in response to a user operation on the rewind control 213, the electronic device 100 rewinds a line. Further, in response to a user operation on the segmented restore control 216, the electronic device 100 can perform segmented restore of the above-mentioned rewinded line. In response to a user operation on the restore control 214, the electronic device 100 can restore a line. Further, in response to a user operation on the segmented rewind control 215, the electronic device 100 can perform segmented rewind of the above-mentioned restored line.

[0201] The situation where the structure of the stack of a line is destroyed may include: a part of the layers in the stack are lost, multiple layers in the stack are merged into one layer, and the electronic device 100 cannot index the layer where a certain segmented part of the line is drawn according to the pointer.

[0202] Here, the electronic device 100 stores Figure 3A The line 218A and the segmented portion of the line 218B shown in FIG. 2 are drawn earlier than the line 218B. The segmented portion of the line 218B is stored in stack A. The segmented portion of the line 218A is stored in stack B. Currently, the input panel of the electronic device 100 displays Figure 3A Line 218A and line 218B are shown. The pointer points to the layer at the top of stack A.

[0203] In response to a user operation on the back control 213, the electronic device 100 may move the pointer to the layer at the top of stack B. That is, the electronic device 100 rewinds line 218B. Line 218B is removed from the input panel. Further, in response to a user operation on the segmented back control 215, the electronic device 100 may move the pointer according to the method for segmented back lines in the aforementioned embodiment. Wherein, the pointer moves in a direction from the top of stack B to the bottom of stack B. That is, the electronic device 100 rewinds a portion of line 218A in segments according to the user operation on the segmented back control 215 this time. The segmented portion of line 218A that is retracted is removed from the input panel. Further, in response to a user operation on the restore control 214, the electronic device 100 may adjust the position of the pointer to the position of the layer at the top of stack B. Wherein, the step length of the pointer movement may be a number of layers contained between the layer pointed to after the aforementioned segmented back to the layer at the top of stack B. That is, the electronic device 100 can restore all the segmented retracted parts of the line 218A according to the user operation acting on the restore control 214 this time. The restored part is displayed again in the input panel. Further, in response to a user operation acting on the segment restore control 216, the electronic device 100 can move the pointer according to the method of segment restore line in the aforementioned embodiment. Among them, the pointer moves from the top of stack B to the bottom of stack A, and moves in the direction from the bottom of stack A to the top of stack A. That is, the electronic device 100 can restore part of the line 218B in segments according to the user operation acting on the segment restore control 215 this time. The restored segmented part of the line 218B is displayed again in the input panel.

[0204] It can be seen that after receiving the user operation on the back control 213 or the restore control 214, the electronic device 100 can still rewind the line in the input panel in sections according to the received user operation on the segmented back control 215, or restore the rewinded line in sections according to the received user operation on the segmented restore control 216. That is, the user operation on the back control 213 or the restore control 214 in the above embodiment will not destroy the Figure 5 The structure of the stack of lines shown.

[0205] In some embodiments, when a user performs a sliding operation on the input panel to input content, the user may be affected by external forces, causing the trajectory of the sliding operation to deviate from the trajectory expected by the user. Then the line displayed in the input panel will include an abnormal segmented portion. The abnormal segmented portion is the line determined by the deviation of the trajectory of the sliding operation from the trajectory expected by the user. Usually, the abnormal segmented portion is the portion that the user wants to delete.

[0206] From the analysis of the above scenario where a line includes an abnormal segmented part, it can be known that the above abnormal segmented part is generally caused by a sudden external force during the drawing process of a line. In the normal drawing process of a line, the user usually reduces the speed of the sliding operation when drawing a line. That is, the drawing speed of the segmented part at the end of this line is usually slow. The above process of normal drawing of a line can mean that the user is not affected by external force from the beginning to the end of drawing, and the trajectory of the sliding operation of this line is determined to be the same as the trajectory expected by the user. If the user is suddenly affected by external force during the drawing process of a line, the user will not take the initiative to finish the pen, and the sliding speed of the sliding operation is relatively fast. That is, the drawing speed of the segmented part at the end of this line is relatively fast, and there is no trend of slowing down or the segmented part with the trend of slowing down is very short.

[0207] An embodiment of the present application provides a line rewind method. Among them, the electronic device 100 can store a line in segments according to the drawing time of the line. This line may include multiple segmented parts. One of the segmented parts may be a line corresponding to a sliding track within a preset segmented time period (such as within 2 milliseconds). The electronic device 100 can detect the drawing speed of each segmented part. According to the drawing speed, the electronic device 100 can determine the dividing point between the normal segmented part and the abnormal segmented part. In response to a user operation acting on the segmented rewind control 215, the electronic device 100 can rewind the line from the end point to the dividing point.

[0208] It can be seen from the above method that the electronic device 100 can estimate at which moment the user is affected by external force based on the drawing speed of each segmented part in a line, causing a part of the line to deviate from the user's expected trajectory. When the demarcation point is estimated, the electronic device 100 can respond to the user operation for segmented rollback and remove the abnormal segmented part in the input panel. The electronic device 100 does not remove the entire line from the input panel. When the above abnormal segmented part is removed, the user can continue to draw from the demarcation point. The above method is easy for the user to operate, and can quickly roll back the lines in the input panel to the state expected by the user, thereby improving the user's experience.

[0209] For ease of understanding, the concepts of normal segmented parts and abnormal segmented parts of a line are introduced here.

[0210] The electronic device 100 can determine whether a segmented portion is a normal segmented portion or an abnormal segmented portion according to the drawing speed of each segmented portion. The drawing speed of the abnormal segmented portion is much greater than the drawing speed of the normal segmented portion. The drawing speed of a segmented portion can be determined by the length of the segmented portion and the drawing time of the segmented portion (such as the above-mentioned preset segmented time period). For example, the speed of a segmented portion is the length of the segmented portion divided by the length of the preset segmented time period.

[0211] In a possible implementation, the electronic device 100 may compare the drawing speed of each segmented portion of a line with a speed threshold. Among them, the segmented portion whose drawing speed is greater than the speed threshold is an abnormal segmented portion. The segmented portion whose drawing speed is not greater than the speed threshold is a normal segmented portion. The above speed threshold can be set according to an empirical value (such as 9000 pixels / second). The embodiment of the present application does not limit the value of the above speed threshold.

[0212] In another possible implementation, the electronic device 100 may use a clustering algorithm to cluster the segmented parts of a line according to the drawing speed of the segmented parts. Further, the electronic device 100 may compare the drawing speed of the cluster centers of each category with a speed threshold. Among them, if the drawing speed of a cluster center is greater than the speed threshold, the segmented parts included in the category to which this cluster center belongs are all abnormal segmented parts. On the contrary, the segmented parts included in the category to which this cluster center belongs are clustered into normal segmented parts. The above clustering algorithm may be, for example, a k-means algorithm. The embodiment of the present application does not limit the above clustering algorithm. The specific implementation of the electronic device 100 using a clustering algorithm to cluster the segmented parts can refer to the implementation method of the clustering algorithm in the prior art. This will not be elaborated here.

[0213] It can be understood that the normal segmented part is a line corresponding to the trajectory expected by the user, and the abnormal segmented part is a line corresponding to the trajectory deviated from the expected trajectory by the user due to the influence of external force during the drawing process.

[0214] According to the reason why the abnormal segmented part appears, the abnormal segmented part of a line is usually located in the second half of the line. In some embodiments, the electronic device 100 can determine the intersection of the first abnormal segmented part and the normal segmented part in the direction from the end point to the start point of a line as the above-mentioned demarcation point.

[0215] The following describes a method for the electronic device 100 to retract an abnormal segmented portion of a line in conjunction with a specific scenario.

[0216] Fig. 6A and Figure 6B Another schematic diagram of a line rollback scenario provided in an embodiment of the present application is exemplarily shown.

[0217] like Fig. 6A As shown, the electronic device 100 displays a line 218C, a line 218D, and a line 218E on the input panel 218 according to the detected sliding operation. Fig. 6A The scenario shown is: the user hand-writes "F" in the input panel 218 of the electronic device 100. The user successively inputs line 218C, line 218D, and line 218E in the input panel 218. During the process of inputting line 218E, the user is affected by an external force (for example, the elbow is suddenly hit), and a part of line 218E deviates from the trajectory expected by the user.

[0218] The electronic device 100 can store the line 218E in segments according to the method in the above embodiment, and determine the drawing speed of each segment. Further, according to the drawing speed, the electronic device 100 can determine the dividing point between the normal segment and the abnormal segment of the line 218E (such as Fig. 6A The demarcation point is the pixel point corresponding to the initial moment when the electronic device 100 estimates that the user is affected by the external force.

[0219] like Figure 6B As shown, in response to a user operation on the segmented rewind control 215, the electronic device 100 can rewind the line 218E to the dividing point. The electronic device 100 can rewind the segmented portion (i.e., Figure 6B The line retreat portion shown) is removed from the input panel 218.

[0220] Depend on Fig. 6A and Figure 6B As can be seen from the scene shown, the electronic device 100 has not completely removed the line 218E from the input panel. When the abnormal segmented portion of the line 218E is removed, the user can continue to draw from the dividing point. The above method is easy for the user to operate, and can quickly roll back the lines in the input panel to the state desired by the user, thereby improving the user experience.

[0221] The following is based on Fig. 6A and Figure 6B The scenario shown introduces a specific implementation method of the abnormal segmented portion of the retraction line of the electronic device 100.

[0222] like Figure 7 As shown, the electronic device 100 can be configured according to the aforementioned Figure 5 The embodiment shown divides line 218E into segments. Line 218E may include n segmented portions: Segment A 1 , …, A i , A i+1 , …, A nThe value of n is determined by the drawing time of line 218E and the aforementioned preset segment time period. i is a positive integer less than n. Segment A 1 The segment portion where the starting point of line 218E is located. Segment portion A n The electronic device 100 can draw the n segmented parts of the line 218E on n layers respectively. 1 Draw the segmented part A 1 Layer A i Draw the segmented part A i Layer A i+1 Draw the segmented part A i+1 Layer A n Draw the segmented part A n .

[0223] Each layer may have a timestamp. The value of the timestamp of a layer may be determined by the drawing time of the segmented parts drawn on this layer. The electronic device 100 may determine the order of the drawing time of the segmented parts drawn on each layer according to the timestamp.

[0224] The electronic device 100 may store the layers in a stack in the order of drawing time from earliest to latest (eg Figure 7 The stack D shown in FIG. 1 is a stack of layers with an earlier drawing time. The layers with a later drawing time are stored closer to the top of the stack D.

[0225] The electronic device 100 can detect the drawing speed of the n segmented parts of the line 218E, and determine which of the n segmented parts are abnormal segmented parts and which are normal segmented parts according to the method of the above embodiment. i and segment A i+1 The intersection point between them is the dividing point. i+1 ~Section A n All of them are abnormal segmented parts. Segmented part A i This is the normal segmentation part.

[0226] Before the segment rollback is performed, the pointer can point to the layer at the top of stack D (that is, layer A n When receiving a user operation on the segment rewind control 215, the electronic device 100 can move the pointer from the top of stack D to the bottom of stack D, and move it to the layer with a normal segmented portion drawn closest to the dividing point (i.e., layer A). i ) is located at the position. Figure 5The pointer shown in FIG. 1 is moved in a different manner with a step length of one layer. The electronic device 100 can directly move the pointer from layer A to layer B. n Move to layer A i The layer that is rolled back (i.e. layer A i+1 ~Layer A n ) is removed from the input panel 218. That is, in response to a user operation on the segment rewind control 215, the electronic device 100 can rewind the line 218E to the above-mentioned dividing point, and remove the abnormal segmented part from the dividing point to the end point from the input panel.

[0227] In some embodiments, when determining the above-mentioned demarcation point, the electronic device 100 may first determine the intersection y1 of the first abnormal segmented part and the normal segmented part in a line from the end point to the starting point. Further, the electronic device 100 may determine whether the x segmented parts closest to the intersection y1 are all normal segmented parts. If the x segmented parts closest to the intersection y1 are all normal segmented parts, the electronic device 100 may determine the intersection as the above-mentioned demarcation point. If there is an abnormal segmented part among the x segmented parts closest to the intersection y1, the electronic device 100 may determine the intersection y2 of the second abnormal segmented part and the normal segmented part in the line from the intersection y1 to the starting point, and determine the intersection y2 as the above-mentioned demarcation point. The value of the above-mentioned x may be set according to an empirical value (for example, 3). The embodiment of the present application does not limit the value of x.

[0228] The above method can reduce the situation where the demarcation point is inaccurate due to misjudgment of abnormal conditions in the segmented part. Figure 7 In the scenario shown, the first five segments of the segment part Ai are all abnormal segments. Then, the electronic device 100 i It is judged that the normal segmented part is likely to have an error. Then, the electronic device 100 can i+1 The new intersection of the abnormal segmented part and the normal part is found in the direction from the intersection of the abnormal segmented part to the starting point, and the new intersection is determined as the dividing point. This can improve the accuracy of determining the position where the user expects the line to fall back.

[0229] Optionally, the electronic device 100 may also determine whether several segmented parts closest to the intersection y2 are normal segmented parts according to the above method, so as to determine whether it is appropriate to determine y2 as the dividing point.

[0230] In some embodiments, in response to a user operation on the segmented back control 215, the electronic device 100 may Figure 7The method shown in the figure determines whether a line (such as a line drawn the latest) has an abnormal segmented portion. If there is an abnormal segmented portion, the electronic device 100 can roll back the line to the dividing point according to the method of the above embodiment. Further, if the duration of the user operation on the segmented rollback control 215 exceeds the preset time, the electronic device 100 can, within the time period exceeding the preset time, roll back the line according to the above embodiment. Figure 5 The method shown is to retract the lines in the input panel from the above-mentioned dividing points in sections. The above-mentioned preset time can be set according to an empirical value (such as 1s). The embodiment of the present application does not limit the value of the above-mentioned preset time.

[0231] In some embodiments, in response to a user operation on the segmented back control 215, the electronic device 100 may perform the above Figure 7 The method shown in the figure rewinds a line with an abnormal segmented portion to the above-mentioned demarcation point. Further, the electronic device 100 detects the user operation acting on the segment rewind control 215 again, and the electronic device 100 can rewind the line according to the above-mentioned Figure 5 The method shown is to retract the lines in the input panel in segments from the above-mentioned dividing points.

[0232] In some embodiments, the electronic device 100 is configured according to the aforementioned Figure 7 After the method shown in the figure rewinds a line with an abnormal segmented part to the above-mentioned demarcation point, the electronic device 100 can also perform segmented recovery on the multiple segmented parts of the line from the demarcation point to the end point. The above-mentioned line 218E is used as an example for explanation. Figure 7 As shown, after the line is retracted, the pointer points to the layer Ai in the stack D. In response to the user operation acting on the segment recovery control 216, the electronic device 100 can move the pointer from the bottom of the stack D to the top of the stack, and the step length of the movement is one layer. The speed at which the electronic device 100 moves the pointer can refer to the speed at which the electronic device 100 segmentally recovers the line in the aforementioned embodiment. It will not be repeated here. Then, each segmented part from the dividing point to the end point of the above-mentioned line 218E can be recovered one by one and displayed on the input panel 218 again.

[0233] Figure 8 A flowchart of a line retraction method based on an input panel provided in an embodiment of the present application.

[0234] like Figure 8 As shown, the method may include steps S101 to S107. Among them:

[0235] S101. The electronic device 100 may detect a sliding operation on an input panel and display a line Z on the input panel according to a track of the sliding operation.

[0236] S102: The electronic device 100 may store the line Z in segments according to the drawing time, where a segment of the line Z is a line corresponding to the trajectory of the sliding operation within the segment of the time period t.

[0237] The method for electronic device 100 to store line Z in segments can refer to the aforementioned Figure 5 The method for storing the line 218B in segments is shown. It will not be described here. The value of the time period t segment can be set according to the empirical value. The embodiment of the present application does not limit this.

[0238] S103: The electronic device 100 may determine whether the segmented portion where the end point of the line Z is located is an abnormal segmented portion.

[0239] The line Z may include multiple segmented parts. The electronic device 100 may detect the drawing speed of each segmented part of the line Z. The drawing speed of a segmented part may be determined by the length of the segmented part and the length of the time period t segment in the above step S102.

[0240] The electronic device 100 can determine whether a segmented portion is an abnormal segmented portion according to the drawing speed of the segmented portion. The specific determination method can refer to the above embodiment and will not be described in detail here.

[0241] According to the reason why an abnormal segmented portion appears in a line, it can be known that if an abnormal segmented portion appears in a line, then the segmented portions of the line starting from a middle node to the end point of the line are usually abnormal segmented portions. If the segmented portion where the end point of a line is located is a normal segmented portion, then the possibility that an abnormal segmented portion appears in the line is relatively small. The electronic device 100 can determine whether an abnormal segmented portion appears in the line by first determining whether the segmented portion where the end point of a line is located is an abnormal segmented portion.

[0242] If the segmented portion where the end point of the line Z is located is not an abnormal segmented portion, the electronic device 100 may determine that the line Z does not have an abnormal segmented portion, and execute the following step S104.

[0243] If the speed of the segmented portion where the end point of line Z is located exceeds the speed threshold, the electronic device 100 may determine that there is an abnormal segmented portion in line Z, and execute the following step S105.

[0244] Optionally, in some embodiments, the electronic device 100 may determine whether the drawing speed of several segmented parts closest to the end point of line Z exceeds the speed threshold. If the drawing speed of all or most (such as more than 80%) of the segmented parts closest to the end point of line Z exceeds the speed threshold, the electronic device 100 may determine that there is an abnormal segmented part in line Z. Otherwise, the electronic device 100 may determine that there is no abnormal segmented part in line Z. This can reduce the situation where the electronic device 100 makes errors in judging whether there is an abnormal segmented part due to miscalculation of the drawing speed of the segmented part where the end point is located, thereby improving the accuracy of detection.

[0245] S104. If the segmented portion where the end point of line Z is located is a normal segmented portion (i.e., not an abnormal segmented portion), in response to a user operation for segmented rollback with a duration of tc, within the time period tc, the electronic device 100 can remove the segmented portions of line Z one by one in the direction from the end point to the starting point in the input panel. The speed of removal is determined by the frequency of the detected user operation for segmented rollback. The higher the frequency of the user operation for segmented rollback, the lower the speed of removal.

[0246] The above user operation for performing segmented rollback can be used to Figure 4A User operation of the segmented back control 215 is shown.

[0247] In some embodiments, during the time period of the user operation of duration tc, the speed of the electronic device 100 retracting the line Z in segments can be constant. The magnitude of the speed can be determined by the frequency of the user operation for segmented retraction detected by the electronic device 100. The method for the electronic device 100 to determine the speed of retracting the line according to the above frequency can refer to the above embodiment. It will not be repeated here. Among them, if all segmented parts of the line Z are retracted within the duration tc, the electronic device 100 can continue to retract the lines whose drawing time is before the line Z and closest to the drawing time of the line Z in segments.

[0248] In some embodiments, within the time period of the user operation of the duration tc, the speed of the electronic device 100 retracting the line Z in sections may be variable. The electronic device 100 may adjust the speed of the retracting line in stages within the duration tc. For example, 0-tc1 seconds is vc1. tc1-tc2 seconds is vc2. .... tci-tc seconds is vc. Wherein, as time grows, the electronic device 100 may increase the speed of the retracting line. That is, the size of vc1, vc2, ..., vc is gradually increasing. The specific method for the electronic device 100 to adjust the speed of the retracting line according to the length of the duration of the user operation for retracting in sections can refer to the aforementioned embodiment. In addition, the above-mentioned vc1 is the initial speed within the duration tc. In response to a user operation for retracting in sections, the electronic device 100 may retract the lines in the input panel in sections. Wherein the initial speed of the electronic device 100 for retracting the lines in sections can be determined by the frequency of the user operation for retracting in sections detected.

[0249] The embodiment of the present application does not limit the specific intervals for dividing the above-mentioned duration tc into stages.

[0250] It is understandable that the longer the duration of a user operation for performing segmented rewinding is, the more segmented parts need to be rewound, and the distance between the current rewinding position of the line and the user's desired position is still relatively large. The electronic device 100 can gradually increase the speed of segmented rewinding of the line within the duration of a user operation for performing segmented rewinding to improve the efficiency of rewinding.

[0251] S105 . If the segmented portion where the end point of line Z is located is an abnormal segmented portion, the electronic device 100 may determine a boundary point between the normal segmented portion and the abnormal segmented portion of line Z.

[0252] In a possible implementation, the electronic device 100 may determine whether the segmented parts of the line Z are abnormal segmented parts one by one in the direction from the end point to the starting point of the line Z. Specifically, the electronic device 100 has determined that the segmented part where the end point of the line Z is located is an abnormal segmented part. Further, the electronic device 100 may determine whether the segmented part before the segmented part where the end point is located is an abnormal segmented part, until the intersection of the first abnormal segmented part and the normal segmented part in the direction from the end point to the starting point in the line Z is determined. The electronic device 100 may determine the intersection as the dividing point between the normal segmented part and the abnormal segmented part of the line Z.

[0253] S106. In response to a user operation for performing segmented rollback, the electronic device 100 may remove the segmented portion of the line Z from the end point to the dividing point in the input panel.

[0254] The method for the electronic device 100 to make the segmented part of the line Z from the end point to the demarcation point abnormal in the input panel can refer to the aforementioned Figure 7 The embodiments shown will not be described in detail here.

[0255] S107. If the duration of a user operation for segmented rewind in step S106 exceeds a preset time, within a time period exceeding the preset time, the electronic device 100 can remove the segmented parts of line Z one by one in the direction from the dividing point to the starting point in the input panel. The speed of removal is determined by the frequency of the user operation for segmented rewind detected. The higher the frequency of the user operation for segmented rewind, the lower the speed of removal.

[0256] In some embodiments, during a time period exceeding the above-mentioned preset time, the speed of the electronic device 100 retracting the line Z may be constant. The magnitude of the speed may be determined by the frequency of the user operation for performing segmented retraction detected by the electronic device 100. The method for the electronic device 100 to determine the speed of the retracting line according to the above-mentioned frequency may refer to the above-mentioned embodiment. No further description is given here.

[0257] In some embodiments, within a time period exceeding the above-mentioned preset time, the speed at which the electronic device 100 retracts the line Z may be variable. The electronic device 100 may adjust the speed of the retracted line in stages within a time period exceeding the above-mentioned preset time. The specific method may refer to the above-mentioned embodiment. No further description is given here.

[0258] As can be seen from step S107, if a line is abnormally segmented, the user presses the segment rewind control 215, and the electronic device 100 can rewind the line from the end point to the above-mentioned dividing point. If the user still wants to continue to rewind the line, the user can continue to press the segment rewind control 215. The electronic device 100 can continue to rewind the line from the above-mentioned dividing point. That is, the user does not need to stop the user operation acting on the segment rewind control 215 this time, and can press the segment rewind control 215 again.

[0259] Depend on Figure 8 As can be seen from the method shown, the electronic device 100 can not only rewind the lines in the input panel in sections, but also adjust the rewinding speed during the sectioned rewinding process, so that the user can more conveniently rewind the lines to the desired state. The electronic device 100 can also determine whether an abnormal part appears in the line according to the drawing speed of the line, and estimate the dividing point between the abnormal part and the normal part of a line, so as to achieve rapid rewinding to the dividing point between the abnormal part and the normal part when rewinding. In this way, the electronic device 100 estimates the position where the user expects to rewind, and directly rewinds the line to the above-mentioned estimated position when rewinding, thereby simplifying the user operation when the user rewinds the line and improving the user experience.

[0260] In some embodiments, Figure 8 Step S103 and steps S105 to S107 are optional. That is, the electronic device 100 can store the line Z in segments, and when a user operation for segmented retraction is detected, the line Z is segmented and retracted according to the method in step S104. The above-mentioned embodiment composed of steps S101, S102 and S104 is the aforementioned Figure 3A to Figure 3C , Figure 4A to Figure 4C , Figure 5 The embodiment shown.

[0261] In some embodiments, Figure 8 Steps S104 and S107 are optional. That is, when the electronic device 100 determines that the segmented portion where the end point of line Z is located is an abnormal segmented portion, the electronic device 100 can roll back line Z according to the method in steps S105 and S106. Fig. 6A The state of the segmented rollback control 215 is shown as being unavailable (eg, the segmented rollback control 215 is grayed out). The above-mentioned steps S101 to S106 constitute the embodiment of the above-mentioned Fig. 6A , Figure 6B , Figure 7 The embodiment shown.

[0262] In some embodiments, in response to a user operation on the segment rewind control 215, the electronic device 100 can rewind a segment portion. In response to a user operation on the segment restore control 215, the electronic device 100 can restore a rewinded segment portion.

[0263] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A line retreat method, characterized in that: The method comprises: The electronic device detects a first sliding operation on the display screen, determines a first line according to a trajectory of the first sliding operation, and divides the first line into a plurality of segments according to a sliding time of the first sliding operation, wherein the trajectory of the first line is the trajectory of the first sliding operation; The electronic device draws the multiple segments in multiple layers, and one layer of the multiple layers is used to draw one segment of the multiple segments; The electronic device displays the first line on the display screen according to the multiple layers; The electronic device receives a first user operation, where the first user operation is used to trigger the electronic device to retract the lines displayed on the display screen in sections in order of drawing time from the latest to the earliest; According to the first user operation, the electronic device removes the segments drawn on m layers among the multiple layers from the display screen, where the segments drawn on the m layers are the parts from the end point of the first line to the first position of the first line, and m is a positive integer.

2. The method according to claim 1, characterized in that The electronic device removes the segments drawn on m layers of the multiple layers from the display screen according to the first user operation, and the method includes: When the first user operation starts, the electronic device removes the segments of the first line from the display screen one by one, starting from the segment where the end point of the first line is located, in a direction from the end point of the first line to the start point of the first line, with a moving step length of one segment; When the first user operation ends, the first line is retracted in sections to the first position.

3. The method according to claim 1 or 2, characterized in that: The duration of the first user operation is a second time period, and within the second time period, the speed at which the segments drawn on the m layers are removed from the display screen is a first speed; or, During the second time period, the speed at which the segments drawn on the m layers are removed from the display screen varies, wherein the second time period includes d1 time intervals, and the magnitude of the speed at which the segments are removed in the d1 time intervals shows an increasing trend when arranged in chronological order, and the speed at which the segments are removed in the first time interval is the first speed, and the first time interval is the time interval that is arranged first in chronological order among the d1 time intervals.

4. The method according to claim 3, characterized in that The first user operation is a user operation acting on the first control, and the method further includes: The electronic device determines that within a third time period before receiving the first user operation, a1 user operations acting on the first control are received; The electronic device determines the first speed according to the size of a1 and one or more of the speeds of a1 segmented retracting lines, wherein the speeds of a1 segmented retracting lines are the speeds at which the electronic device removes lines from the display screen within the time period of a1 user operations on the first control; the larger a1 is, the slower the first speed is; the first speed is lower than one or more of the speeds of a1 segmented retracting lines.

5. The method according to any one of claims 2 to 4, characterized in that: The display screen also displays a second line, the second line is drawn by the electronic device according to a track of a second sliding operation detected on the display screen, and the drawing time of the second line is earlier than the drawing time of the first line; the second line includes a plurality of segments divided according to the sliding time of the second sliding operation; the first user operation is a user operation acting on the first control once; After removing the segments drawn on m layers among the multiple layers from the display screen, the method further includes: The electronic device receives a second user operation acting on the first control; During the time period when the second user operation acts on the first control, the electronic device removes the segments of the first line from the display screen one by one, starting from the first position, in a direction from the first position to the starting point of the first line, with a moving step length of one segment of the first line; If all segments of the first line are removed from the display screen, the electronic device removes the segments of the second line from the display screen one by one, starting from the end point of the second line, in a direction from the end point of the second line to the starting point of the second line, with a moving step of one segment in the second line.

6. The method according to claim 1, characterized in that One of the multiple segments is a line corresponding to the sliding track within the first time period in the first sliding operation; Before removing the segments drawn on the m layers among the multiple layers from the display screen, the method further includes: The electronic device calculates the drawing speeds of the multiple segments, wherein the drawing speed of one segment is determined according to the length of the one segment and the length of the first time period; The electronic device determines whether a segment is an abnormal segment or a normal segment according to a drawing speed of the segment, wherein the abnormal segment is a segment whose drawing speed is higher than a first threshold, and the normal segment is a segment whose drawing speed is not higher than the first threshold; If it is determined that the segment where the end point of the first line is located is the abnormal segment, the electronic device determines the first position, which is the first intersection of the abnormal segment and the normal segment in the direction from the end point of the first line to the starting point of the first line.

7. The method according to claim 6, characterized in that The method of removing the segments drawn on m layers of the plurality of layers from the display screen comprises: The electronic device removes the segments drawn on the m layers from the display screen simultaneously.

8. The method according to claim 6 or 7, characterized in that: The duration of the first user operation is a second time period, and the length of the second time period exceeds a second threshold. The method further includes: During the time period exceeding the second threshold within the second time period, the electronic device removes the segments of the first line from the display screen one by one starting from the first position, in the direction from the first position to the starting point of the first line, with a moving step length as one segment and a moving speed as the second speed.

9. The method according to any one of claims 1 to 8, characterized in that After removing the segments drawn on m layers among the multiple layers from the display screen, the method further includes: The electronic device receives a third user operation, wherein the third user operation is used to trigger the electronic device to restore the lines that have been rolled back and not restored in sections in the order of the rollback time from the latest to the earliest; The electronic device displays a portion from the first position to a second position of the first line on the display screen according to the third user operation, where the second position is between the first position and an end point of the first line.

10. The method according to claim 9, characterized in that The electronic device displays, according to the third user operation, a portion from the first position to the second position of the first line on the display screen, and the method includes: When the third user operation starts, the electronic device displays the segments of the first line that have been removed from the display screen one by one on the display screen starting from the first position in a direction from the first position to an end point of the first line, with a moving step length of one segment; When the third user operation ends, the first line is restored to the second position in sections.

11. The method according to claim 9 or 10, characterized in that: The duration of the third user operation is a fourth time period, and within the fourth time period, the speed of partially segmented recovery from the first position to the second position of the first line is a third speed; or, In the fourth time period, the speed of partial segmented recovery from the first position to the second position of the first line varies, wherein the fourth time period includes d2 time intervals, and the speeds of the segmented recovery in the d2 time intervals show an increasing trend when arranged in chronological order, the speed of the segmented recovery in the second time interval is the third speed, and the second time interval is the time interval that is arranged first in chronological order among the d2 time intervals.

12. The method according to claim 11, characterized in that The third user operation is a user operation acting on the second control, and the method further includes: The electronic device determines that within a fifth time period before receiving the third user operation, a2 user operations acting on the second control are received; The electronic device determines the third speed according to the size of a2 and one or more of the speeds of a2 segmented restoration lines, wherein the a2 segmented restoration line speeds are respectively the speeds of the electronic device segmented restoration lines within the a2 times of the user operation on the second control; the larger the a2, the slower the third speed; the third speed is lower than one or more of the a2 segmented restoration line speeds.

13. The method according to any one of claims 10 to 12, characterized in that: Before the first user operation, all segments of the third line are removed from the display screen; the third line is drawn by the electronic device according to the trajectory of the third sliding operation detected on the display screen; the drawing time of the third line is later than the drawing time of the first line; the third line includes a plurality of segments divided according to the sliding time of the third sliding operation; the retreat time of the third line is earlier than the retreat time of the first line; the third user operation is a user operation acting on the second control; After displaying the portion from the first position to the second position of the first line on the display screen, the method further includes: The electronic device receives a fourth user operation acting on the second control; During the time period when the fourth user operation acts on the second control, the electronic device displays the segments of the first line that have been removed from the display screen one by one on the display screen, starting from the second position, in a direction from the second position to an end point of the first line, with a moving step length of one segment of the first line; If all the segments of the first line that have been removed from the display screen are displayed on the display screen, the electronic device displays the segments of the third line that have been removed from the display screen one by one on the display screen, starting from the starting point of the third line, in a direction from the starting point of the third line to the ending point of the third line, with a moving step of one segment in the third line.

14. An electronic device, characterized in that: The electronic device comprises a display screen, a memory, and a processor, wherein the memory is used to store a computer program, and the processor is used to call the computer program so that the electronic device executes the method described in any one of claims 1-13.

15. A computer-readable storage medium comprising instructions, characterized in that: When the instructions are executed on an electronic device, the electronic device executes the method according to any one of claims 1 to 13.

Citation Information

Patent Citations

  • Method and device for drawing map area through touch, terminal and storage medium

    CN110415315A

  • Drawing device, drawing method, and drawing program

    US20140300588A1

  • Devices, methods, and systems for performing content manipulation operations

    US20200326841A1