WO2022253016A1 - Line rollback method for input panel and related apparatus - Google Patents

Line rollback method for input panel and related apparatus Download PDF

Info

Publication number
WO2022253016A1
WO2022253016A1 PCT/CN2022/094377 CN2022094377W WO2022253016A1 WO 2022253016 A1 WO2022253016 A1 WO 2022253016A1 CN 2022094377 W CN2022094377 W CN 2022094377W WO 2022253016 A1 WO2022253016 A1 WO 2022253016A1
Authority
WO
WIPO (PCT)
Prior art keywords
line
electronic device
segment
user operation
speed
Prior art date
Application number
PCT/CN2022/094377
Other languages
French (fr)
Chinese (zh)
Inventor
汤赞成
邵钰
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2022253016A1 publication Critical patent/WO2022253016A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/02Input arrangements using manually operated switches, e.g. using keyboards or dials
    • G06F3/023Arrangements for converting discrete items of information into a coded form, e.g. arrangements for interpreting keyboard generated codes as alphanumeric codes, operand codes or instruction codes
    • G06F3/0233Character input methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/02Input arrangements using manually operated switches, e.g. using keyboards or dials
    • G06F3/023Arrangements for converting discrete items of information into a coded form, e.g. arrangements for interpreting keyboard generated codes as alphanumeric codes, operand codes or instruction codes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • G06F9/44526Plug-ins; Add-ons

Definitions

  • the present application relates to the field of terminal technologies, and in particular to a method for retracting lines of an input panel and a related device.
  • applications such as handwriting input method applications and drawing applications in electronic devices can provide functions of returning and restoring input content.
  • the electronic device may display multiple lines drawn by the user in the input panel of the drawing application.
  • the electronic device may delete one or more lines displayed in the input panel according to the sequence of drawing time of the multiple lines.
  • the track of a line may 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 the user in one stroke.
  • the electronic device only supports rolling back the lines in units of bars. That is, one line is rolled back at a time. It is difficult to roll back the lines in the input panel to the state desired by the user in the above rollback method, and the rollback accuracy is low. For example, if the user wants to roll back a part of a line, he needs to operate through the eraser function or other more complicated functions. User operations are cumbersome.
  • the present application provides an input panel-based line fallback method and a related device.
  • the electronic device can detect the time length of each user operation for segmental rollback and the frequency of the user's user operation for segmental rollback to adjust the speed of the segmented rollback line, so as to realize a part of a line from the input panel remove.
  • the line rollback method can improve the precision of the line rollback, so that the user can roll back the lines to their desired state more conveniently.
  • the embodiment of the present application provides a method for rolling back lines.
  • the electronic device displays first lines on the display screen.
  • the first line is drawn by the electronic device according to the trajectory of a single sliding operation detected on the display screen.
  • the electronic device receives the first user operation, and the first user operation may be used to trigger the electronic device to perform a segmented rollback of the lines displayed on the display screen in the order of drawing time from late to early.
  • the electronic device may remove the part from the end point of the first line to the first position of the first line from the display screen according to the first user operation.
  • the user can quickly rewind a part of a line. This can improve the accuracy of line rollback, so that users can roll back the lines to their desired state more conveniently.
  • the first line may include multiple segments.
  • One of the multiple segments is the line corresponding to the trajectory of the sliding operation within the first time period during the drawing of the first line.
  • the specific method for the electronic device to remove the part from the end point of the first line to the first position of the first line from the display screen according to the first user operation may be as follows: when the first user operation starts, the electronic device may follow the steps from the first The direction from the end point of a line to the start point of the first line, with the moving step as a segment, starts from the segment where the end point of the first line is located, and removes the segments of the first line from the display screen one by one . At the end of the first user operation, the first line is segmented back to the first position.
  • 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 aforementioned first time period may be a preset segmented time period. Layers drawn with one segment can have timestamps. The timestamp can be determined from the rendering time of this segment.
  • the electronic device can determine the early and late order of the drawing time of the segments on different layers according to the time stamps of the layers.
  • the electronic device may store the multiple layers of the multiple segments drawn with the first line into the stack in order of drawing time from early to late. Among them, the storage position of the layer with the earlier drawing time is closer to the bottom of the stack. Layers with a later drawing time are stored closer to the top of the stack.
  • the electronic device can realize segmental regression of the line by moving the layer pointed to by the pointer in the stack. The layer pointed to by the pointer can be displayed as the uppermost layer among the layers in the input panel for all drawing content.
  • the input panel can be used for user input and displays the content entered by the user.
  • the display screen of the electronic device may include the above-mentioned input panel.
  • the content displayed on the input panel is the content displayed on the display screen of the electronic device.
  • the moving step is taken as a segment, starting from the segment where the end point of the first line is, and dividing the segment of the first line
  • the electronic device can follow the direction from the top of the stack of segments storing the first line to the bottom of the stack, with the moving step as one layer, from the image at the top of the stack to layer starts, move the position of the pointer.
  • the pointer is moved to the layer corresponding to the first position in the stack.
  • the electronic device can perform a segmentation rollback on a line by using a segment of a line as a unit.
  • the user can see on the display screen that the line gradually recedes to the desired position.
  • 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. Users can return the lines to their desired state more conveniently.
  • the duration of the first user operation is the second time period.
  • the speed at which the part from the end point of the first line to the first position of the first line is removed from the display screen is the first speed.
  • 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 magnitudes of the removed speeds in the d1 time intervals show an increasing trend according to the order of time.
  • the speed removed in the first time interval may be the first speed.
  • the first time interval is the first time interval in the order of time among the d1 time intervals.
  • the electronic device may gradually increase the speed of the segmented retraction line within the above-mentioned second time period, so as to improve the efficiency of retraction.
  • the first user operation is a user operation on the first control.
  • the electronic device determines that within a third time period before receiving the first user operation, a1 user operations on the first control are also received.
  • the electronic device may determine the above-mentioned first speed according to one or more of the size of a1 and the speeds of the a1 segmented retraction lines.
  • the speeds of the a1 segmented retraction lines are respectively the speeds at which the electronic device removes the lines from the display screen within the time period of the a1 user operations 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 the a1 segmented retraction lines.
  • the above-mentioned first control may be a segment rollback control.
  • the first control can also have other names.
  • a user operation acting on the first control may trigger the electronic device to backtrack the lines displayed on the display screen in order of drawing time from late to early.
  • the electronic device can roll back a line in segments
  • the user can press the roll back control in segments.
  • the user when the user is away from the user's expected position, the user usually long presses the segmented fallback control.
  • the user When approaching the desired position of the user, the user usually intermittently presses the segmented return control until the electronic device returns the line to the desired position.
  • the electronic device detects that the frequency of acting on the first control is higher (that is, the greater a1 is), the current retreat position of the first line is different from the position expected by the user. the closer.
  • the electronic device may, on the basis of one or more of the speeds of the a1 segmented retraction lines, reduce the speed of the segmented retraction line or the initial speed of the segmented retraction line within the first user operation action time period ( i.e. first speed). In this way, it is possible to avoid too many subsections that are rolled back due to the first speed being too fast.
  • the electronic device further displays second lines 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.
  • the multiple segments are lines corresponding to the track of the sliding operation in the first time period during the drawing of the second line.
  • the first user operation is a user operation on the first control. After the electronic device removes the part 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 acting on the first control.
  • the electronic device can start from the first position and move the Segments of a line are removed one by one from the display. If all segments of the first line are removed from the display screen, the electronic device moves from the end point of the second line to the start point of the second line, with the moving step as a segment, and from the end point of the second line First, the segments of the second line are removed from the display one by one.
  • the speed at which the electronic device retracts the line by segment during the time period when the second user operation is active may be determined according to the above-mentioned first speed (for example, it is 60% of the first speed).
  • the speed at which the electronic device retracts the line by segment during the time period when the second user operates may be constant.
  • the initial speed of the segmented retreat line of the electronic device during the time period of the second user operation may be determined according to the above-mentioned first speed (for example, it is 60% of the first speed).
  • the electronic device may segment the multiple lines according to the drawing time, and store the segments of the multiple lines.
  • the user can realize segmental rollback of the multiple lines through user operations acting on the first control.
  • the first line may include multiple segments.
  • One of the multiple segments is the line corresponding to the trajectory of the sliding operation within the first time period during the drawing of the first line.
  • the electronic device may calculate the drawing speeds of the plurality of segments.
  • the drawing speed of a segment can be determined according to the length of the first segment and the length in the second time period.
  • the electronic device can determine whether a segment is an abnormal segment or a normal segment according to the drawing speed of a segment.
  • Anomalous segments are segments whose rendering speed is above a first threshold.
  • a normal segment is a segment whose rendering speed is not higher than the first threshold.
  • the electronic device may determine the first position.
  • the first position is the intersection of the first abnormal segment and the normal segment in the direction from the end point of the first line to the start point of the first line in the first line.
  • the electronic device may use a clustering algorithm to cluster multiple segments of the first line according to a drawing speed of a segment.
  • the electronic device may divide the plurality of segments of the first line into a plurality of categories. Among the multiple categories, one category contains one 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 contained in a category are all normal segments.
  • the method for the electronic device to remove the end point of the first line to the first position of the first line from the display screen may specifically be: the electronic device may remove the first line from the end point to the first position of the first line All segments between the positions are simultaneously removed from the display.
  • the electronic device can estimate at which moment the user is affected by an external force based on the drawing speed of each segment in a line, causing a part of the line to deviate from the user's expected trajectory.
  • the drawing speed of the segment drawn under the influence of external force is much higher than the drawing speed of the segment in the normal drawing process (that is, the drawing process not affected by the external force).
  • the electronic device may respond to a user operation for segment rollback, and remove the abnormal segment part in the input panel.
  • the electronics did not remove the entire line from the input panel.
  • the above abnormal segment 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 return the lines in the input panel to the desired state of the user, thereby improving the user experience.
  • the duration of the first user operation is the 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, during the time period exceeding the second threshold in the second time period, the electronic device may move in a step size of A segment, with the moving speed as the second speed, removes the segments of the first line from the display one by one, starting from the first position.
  • the speed at which the electronic device retracts the lines segment by segment may vary.
  • the second speed may exceed the initial speed within the time period of the second threshold within the above-mentioned second time period.
  • the electronic device may gradually increase the speed of the segmented retraction line on the basis of the second speed.
  • the second time period in which the first user operation continues exceeds the second threshold may indicate that the cut-off point determined by the electronic device has not yet reached the position where the user expects to fall back.
  • the electronic device may continue to return the first line segmentally from the above-mentioned first position, so as to return to a position desired by the user.
  • the electronic device determines that the segment where the end point of the first line is located is not an abnormal segment, the electronic device displays the part from the end point of the first line to the first position of the first line
  • the specific method of removing the screen can be as follows: the electronic device can move from the end point of the first line to the starting point of the first line, and use the moving step as a segment, and start from the segment where the end point of the first line is located. To start, the segments of the first line are removed from the display one by one. At the end of the first user operation, the first line is segmented back to the first position.
  • the electronic device after the electronic device removes the part from the end point of the first line to the first position of the first line from the display screen, it further receives a third user operation.
  • the third user operation may be used to trigger the electronic device to recover the lines that have been rolled back but not recovered by segment in the order of the rollback time from late to early.
  • the electronic device may display the part from the first position to the second position of the first line on the display screen according to the third user operation.
  • the second location is between the first location and the end point of the first line.
  • the electronic device can recover the retracted lines segment by segment. This can make it easier for the user to recover the rolled back part if they accidentally roll back too much.
  • the method for recovering the line by segment can better help the user return the line to the state expected by the user.
  • the first line may include multiple segments.
  • One of the multiple segments is the line corresponding to the trajectory of the sliding operation within the first time period during the drawing of the first line.
  • the specific method for the electronic device to display the part from the first position to the second position of the first line on the display screen according to the third user operation may be as follows: when the third user operation starts, the electronic device follows the steps from the first position to the second position. The direction of the end point of a line. The moving step is a segment. Starting from the first position, the segments removed from the display screen in the first line are displayed on the display screen one by one. At the end of the third user operation, the first line is segmented back to the second position.
  • the duration of the third user operation is the fourth time period.
  • the partial segmental restoration speed from the first position to the second position of the first line may be the third speed.
  • the speed of partial segment recovery from the first position to the second position of the first line changes.
  • the fourth time period includes d2 time intervals.
  • the speed of subsection recovery in the d2 time intervals shows an increasing trend according to the order of time.
  • the speed of segment recovery in the second time interval is the third speed.
  • the second time interval is the first time interval in the order of time among the d2 time intervals.
  • the electronic device may gradually increase the speed of recovering the lines in segments within the fourth time period, so as to improve the recovery efficiency.
  • the third user operation is a user operation that acts on the second control.
  • the electronic device determines that within the fifth time period before receiving the third user operation, a2 user operations on the second control are also received.
  • the electronic device may determine the third speed according to one or more of the size of a2 and the speeds of the a2 segment recovery lines.
  • the speeds of the a2 segments to restore the lines are respectively the speeds of the electronic device to restore the lines in segments within the time period of the a2 user operations acting on the second control.
  • the bigger a2 is, the slower the third speed is.
  • the third speed is lower than one or more of the speeds of the a2 segment recovery lines.
  • the second control may be a segment recovery control.
  • the second control can also have other names.
  • a user operation acting on the second control may trigger the electronic device to restore the lines that have been rolled back but not restored by segment according to the order of the rollback time from late to early.
  • the user when the user is away from the location where the user expects to restore, the user usually long presses the segment restore control. When approaching the position that the user expects to restore, the user usually short-presses the segment restoration control intermittently until the electronic device restores the line to the position that the user expects to restore. Then, within a period of time (such as the fifth period of time), the electronic device detects that the frequency of acting on the second control is higher (that is, the greater a2 is), the more the current restored position of the first line is compared with the user's expected position. near.
  • the electronic device can reduce the speed of the segmented back line or the initial speed of the back line during the third user operation action time period (that is, the third speed). In this way, the third speed can be avoided as much as possible, resulting in too many segments to be recovered.
  • the electronic device can adjust the speed of the segmented recovery line by detecting the duration of each user operation on the second control and the frequency of the user operation on the second control. This can improve the efficiency of line segmentation recovery, so that users can return the lines to their desired state more conveniently.
  • all segments of the third line are removed from the display screen before the first user operation.
  • the third line is drawn by the electronic device according to the trajectory of a single sliding operation detected on the display screen.
  • the third line is drawn later than the first line.
  • the third line may include multiple segments. These multiple segments are lines corresponding to the track of the sliding operation in the first time period during the drawing process of the third line.
  • the fallback time of the third line is earlier than the fallback 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.
  • the electronic device can start from the second position and move the first line in the direction from the second position to the end point of the first line.
  • the segments of a line that have been removed from the display are shown on the display one by one. If all segments that have been removed from the display screen in the first line are displayed on the display screen, the electronic device uses the moving step as a segment in the direction from the starting point of the third line to the end point of the third line, Starting from the starting point of the third line, the segments removed from the display screen in the third line are displayed on the display screen one by one.
  • the speed at which the electronic device restores the line by segment during the time period when the fourth user operation is active may be determined according to the above-mentioned third speed (for example, it is 60% of the third speed).
  • the speed at which the electronic device restores the lines by segment during the time period of the second user operation may be constant.
  • the speed at which the electronic device restores the line segment by segment changes (for example, gradually increases) within the time period when the fourth user operation is active.
  • the initial speed at which the electronic device restores the lines segmentally during the fourth user operation period may be determined according to the above third speed (for example, it is 60% of the third speed).
  • the embodiment of the present application provides an electronic device.
  • the electronic device includes a display screen, a memory, and a processor.
  • the memory is used to store a computer program
  • the processor is used to call the computer program, so that the electronic device executes any possible implementation manner in the first 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 invoke computer instructions so that the electronic device executes any possible method in the first aspect. Method to realize.
  • the present application provides a computer program product including instructions, which is characterized in that, when the computer program product is run on an electronic device, the electronic device is made to execute any possible implementation manner in the first aspect.
  • the present application provides a computer-readable storage medium, including instructions, wherein, when the above-mentioned instructions are run on an electronic device, the electronic device is made to execute any possible implementation manner in the first aspect.
  • the electronic device provided in the second aspect above, 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. Therefore, the beneficial effects that it can achieve can refer to the beneficial effects in the corresponding method, and will not be repeated here.
  • Figures 1A to 1C are schematic diagrams of scenes of some line rollback provided by the embodiment of the present application.
  • FIG. 2 is a schematic structural diagram of an electronic device 100 provided in an embodiment of the present application.
  • Fig. 3A to Fig. 3C are schematic diagrams of other scenes of line rollback provided by the embodiment of the present application.
  • Figures 4A to 4C are schematic diagrams of other scenes of line rollback provided by the embodiment of the present application.
  • FIG. 5 is a schematic diagram of segmented storage of lines by the electronic device 100 provided by the embodiment of the present application.
  • FIG. 6A and FIG. 6B are schematic diagrams of other scenes of line rollback provided by the embodiment of the present application.
  • FIG. 7 is a schematic diagram of segmented storage of lines by the electronic device 100 provided by the embodiment of the present application.
  • FIG. 8 is a flow chart of a method for rolling back lines provided by an embodiment of the present application.
  • first and second are used for descriptive purposes only, and cannot be understood as implying or implying relative importance or implicitly specifying the quantity of indicated technical features. Therefore, the features defined as “first” and “second” may explicitly or implicitly include one or more of these features. In the description of the embodiments of the present application, unless otherwise specified, the “multiple” The meaning is two or more.
  • FIG. 1A to FIG. 1C exemplarily show a scene schematic diagram of a line retreat provided by an embodiment of the present application.
  • the electronic device 100 can open the drawing application and display the user interface 210 as shown in FIG. 1A .
  • User interface 210 may include a brush control 211 , an eraser control 212 , a rollback control 213 , a redo control 214 , a save control 217 , and an input panel 218 . in:
  • the input panel 218 can be used for the user to input and display the content input by the user.
  • the content input by the user may be text, picture and so on.
  • the content entered by the user can consist of one or more lines.
  • the trace of a line may be the trace 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 may 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.
  • the electronic device 100 may determine a pixel point where a sliding operation starts and a pixel point where a sliding operation ends.
  • the line formed by the sliding track between the pixel point at the start position and the pixel point at the end position is a line.
  • the input panel 218 shown in FIG. 1A includes two lines: a line 218A and a line 218B.
  • the drawing time of the line 218A is earlier than the drawing time of the line 218B.
  • the paintbrush control 211 can be used to trigger the electronic device 100 to enter the line input function, and to adjust attributes such as thickness and color of the "virtual paintbrush".
  • the above-mentioned "virtual paintbrush” may be presented in the user interface 210 as icons such as dots, arrows, paintbrush, and the like.
  • the sliding track of the "virtual paintbrush" on the input panel can form lines.
  • the line input function described above is a function for inputting on the input panel 218 .
  • the electronic device 100 may display a line corresponding to a track of the sliding operation according to the sliding operation detected in the input panel 218 .
  • the color of the "virtual paintbrush” is black, and the color of the lines formed by sliding the “virtual paintbrush” on the input panel is black.
  • the eraser control 212 can be used to trigger the electronic device 100 to enter the erasing function, and to adjust attributes such as the size of the "virtual eraser".
  • the above-mentioned eraser function is a function to erase lines displayed on the input panel 218 .
  • the electronic device 100 can erase content on the track of the sliding operation detected on the input panel 218 according to the sliding operation.
  • the erased content is canceled and displayed on the input panel 218 .
  • the larger the "virtual eraser" the more content erased by the electronic device 100 according to the sliding track of the "virtual eraser" on the input panel.
  • the rollback control 213 can be used to trigger the electronic device 100 to roll back the lines displayed in the input panel 218 .
  • the electronic device 100 may roll back the lines displayed on the input panel 210 according to the sequence of drawing time from late to early.
  • the input panel 218 includes a line 218A and a line 218B shown in FIG. 1A .
  • Line 218A was drawn earlier than line 218B.
  • the electronic device 100 can roll back the lines displayed in the input panel 218 to the state before the line 218B is drawn after the previous line of the line 218B is drawn.
  • the electronic device 100 may display a user interface 210 as shown in FIG. 1B . Wherein, the electronic device 100 removes the line 218B from the input panel 218 . Only line 218A is included in the input panel shown in FIG. 1B .
  • the above-mentioned one user operation acting on the back control 213 may be a user operation during a continuous period of time from when the user starts touching the back control 213 to when the user stops touching the back control 213 .
  • the electronic device 100 may determine a touch operation detected on the touch panel and acting on the back control 213 for a period of time as a user operation on the back control 213 .
  • a user operation on the rollback control 213 can be used to roll back the latest line drawn in the input panel 218 . That is to say, in response to a user operation acting on the rollback control 213 , the electronic device 100 may remove a line drawn with the latest time from the input panel 218 .
  • the restore control 214 can be used to trigger the electronic device 100 to restore the rolled back line.
  • the electronic device 100 may recover the rolled back lines according to the sequence of the rolled back time from late to early. From FIG. 1A to FIG. 1B , line 218B is regressed. Input panel 218 shown in FIG. 1B includes only line 218A.
  • electronic device 100 may restore line 218B. As shown in FIG. 1C , when the line 218B is restored, the electronic device 100 may display the line 128B on the input panel 218 .
  • a user operation on the recovery control 214 can be used to recover the line that has the latest rollback time among the lines that have been rolled back and have not been recovered. That is to say, in response to a user operation acting on the recovery control 214 , the electronic device 100 may display in the input panel 218 a line with the latest rollback time among the lines that have been rolled back but not recovered.
  • the shape and position displayed in the input panel after a line is restored are the same as the shape and position displayed in the input panel before the line is rolled back.
  • the state of the restore control 214 may be the disabled state shown in FIG. 1A . As shown in FIG. 1A , when the recovery control 214 is in an unavailable state, the color of the recovery control 214 is gray. When there are lines that can be restored, the state of the restoration control 214 can be the available state shown in FIG. 1B . As shown in FIG. 1B , when the recovery control 214 is in an available state, the color of the recovery control 214 is black.
  • the embodiment of the present application does not limit the method for the electronic device 100 to indicate the state of the restoration control 214 .
  • the save control 217 can be used to trigger the electronic device 100 to save the input content received in the input panel 218 .
  • the applications in the above scenarios are not limited to drawing applications, and may also be handwriting input applications, document editing applications, and other applications with input panels.
  • a drawing application is taken as an example for specific description.
  • the above-mentioned rollback control 213 only supports rollback of lines in units of bars, but does not support rollback of a part of a line.
  • the electronic device 100 it is difficult for the electronic device 100 to roll back the lines in the input panel to the state desired by the user, and the rollback accuracy is low.
  • the user wants to roll back a part of the line 218B shown in FIG. 1A , the user can only use the "virtual eraser" to erase the desired part of the line 218B.
  • the "virtual eraser" can easily erase other lines.
  • users need to adjust the size of the "virtual eraser". Obviously, when erasing a part of a line with an eraser, the user operation is cumbersome and the user experience is poor.
  • the electronic device 100 can cut a line.
  • the cutting position may be the position where the user expects the line to retreat. Further, the electronic device 100 may delete a cut part of the line, so as to realize that the line returns to a desired position of the user.
  • 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.
  • the above method requires the user to master the usage method of the above professional functions. The user's operation is more cumbersome.
  • the embodiment of the present application provides a method for rolling back lines.
  • the electronic device can monitor the sliding track acting on the input panel, and display the lines corresponding to the sliding track on the input panel.
  • the electronic device can store a line in segments according to the drawing time of the line.
  • This one line can consist of multiple segmented parts.
  • One of the segmented parts may be a line corresponding to the sliding trajectory within a preset segmented time period (for example, within 2 milliseconds).
  • the electronic device may roll back the lines in the input panel in segments at a speed A within a time period A when the user operation on the segmented rollback control is detected.
  • the speed A at which the electronic device rolls back the line within the time period A may be determined by the time length of one or more user operations acting on the segmented rollback control before the user operation of the segmented rollback control . If the duration of the one or more previous user operations tends to become shorter in the order of the time of action, the electronic device can reduce the Speed of rewinding lines during time period A.
  • the electronic device can roll back a line in segments
  • the user can press the roll back control in segments.
  • the user when away from the user's expected position, the user usually long presses the segmented back control.
  • the user When approaching the desired position of the user, the user usually intermittently short-presses the segmented rollback control until the electronic device rolls back the line to the desired position. It can be seen that the length of time and the frequency at which the user presses the segment back control can reflect the distance between the current back position of the line and the user's desired position.
  • the electronic device can adjust the speed of the segmented rollback line 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.
  • the above method can not only improve the accuracy of the rollback, roll back the lines in the input panel to the state expected by the user, and is easy for the user to operate.
  • the aforementioned segmentation rollback control may be newly added in the aforementioned user interface 210 . Subsequent embodiments of the present application will specifically introduce the segmentation rollback control.
  • the above line fallback method can be applied to electronic devices with display screens.
  • electronic devices with display screens.
  • mobile phone tablet computer, notebook computer, TV, ultra-mobile personal computer (ultra-mobile personal computer, UMPC), netbook, personal digital assistant (personal digital assistant, PDA) and so on.
  • UMPC ultra-mobile personal computer
  • netbook personal digital assistant
  • PDA personal digital assistant
  • FIG. 2 shows a schematic structural diagram of an electronic device 100 provided by an embodiment of the present application.
  • the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (universal serial bus, USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, and an antenna 2 , mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, earphone jack 170D, sensor module 180, button 190, motor 191, indicator 192, camera 193, display screen 194, and A subscriber identification module (subscriber identification module, SIM) card interface 195 and the like.
  • SIM subscriber identification module
  • 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, bone conduction sensor 180M, etc.
  • the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100 .
  • the electronic device 100 may include more or fewer components than shown in the figure, or combine certain components, or separate certain components, or arrange different components.
  • the illustrated components can be realized in hardware, software or a combination of software and hardware.
  • the processor 110 may include one or more processing units, for example: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processing unit (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural network processor (neural-network processing unit, NPU) Wait. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.
  • application processor application processor, AP
  • modem processor graphics processing unit
  • GPU graphics processing unit
  • image signal processor image signal processor
  • ISP image signal processor
  • controller memory
  • video codec digital signal processor
  • DSP digital signal processor
  • baseband processor baseband processor
  • neural network processor neural-network processing unit
  • a memory may also be provided in the processor 110 for storing instructions and data.
  • the memory in processor 110 is a cache memory.
  • the memory may hold instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to use the instruction or data again, it can be called directly from the memory. Repeated access is avoided, and the waiting time of the processor 110 is reduced, thereby improving the efficiency of the system.
  • the USB interface 130 is an interface conforming to the USB standard specification, specifically, it can be a Mini USB interface, a Micro USB interface, a USB Type C interface, and the like.
  • the USB interface 130 can be used to connect a charger to charge the electronic device 100 , and can also be used to transmit data between the electronic device 100 and peripheral devices. It can also be used to connect headphones and play audio through them. This interface can also be used to connect other electronic devices, such as AR devices.
  • the charging management module 140 is configured to receive a charging input from a charger. While the charging management module 140 is charging the battery 142 , it can also provide power for electronic devices through the power management module 141 .
  • the power management module 141 is used for connecting the battery 142 , the charging management module 140 and the processor 110 .
  • the power management module 141 receives the input from the battery 142 and/or the charging management module 140 to provide power for the processor 110 , the internal memory 121 , the external memory, the display screen 194 , the camera 193 , and the wireless communication module 160 .
  • the power management module 141 may also be disposed in the processor 110 .
  • the power management module 141 and the charging management module 140 may also be set in the same device.
  • the wireless communication function of the electronic device 100 can be realized by the antenna 1 , the antenna 2 , the mobile communication module 150 , the wireless communication module 160 , a modem processor, a baseband processor, and the like.
  • Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in electronic device 100 may be used to cover single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization of the antennas.
  • Antenna 1 can be multiplexed as a diversity antenna of a wireless local area network.
  • the antenna may be used in conjunction with a tuning switch.
  • the mobile communication module 150 can provide wireless communication solutions including 2G/3G/4G/5G applied on the electronic device 100 .
  • the mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (low noise amplifier, LNA) and the like.
  • the mobile communication module 150 can receive electromagnetic waves through the antenna 1, filter and amplify the received electromagnetic waves, and send them to the modem processor for demodulation.
  • the mobile communication module 150 can also amplify the signals modulated by the modem processor, and convert them into electromagnetic waves through the antenna 1 for radiation.
  • at least part of the functional modules of the mobile communication module 150 may be set in the processor 110 .
  • at least part of the functional modules of the mobile communication module 150 and at least part of the modules of the processor 110 may be set in the same device.
  • a modem processor may include a modulator and a demodulator.
  • the modulator is used for modulating the low-frequency baseband signal to be transmitted into a medium-high frequency signal.
  • the demodulator is used to demodulate the received electromagnetic wave signal into a low frequency baseband signal. Then the demodulator sends the demodulated low-frequency baseband signal to the baseband processor for processing.
  • the low-frequency baseband signal is passed to the application processor after being processed by the baseband processor.
  • the application processor outputs sound signals through audio equipment (not limited to speaker 170A, receiver 170B, etc.), or displays images or videos through display screen 194 .
  • the modem processor may be a stand-alone device.
  • the modem processor may be independent from the processor 110, and be set in the same device as the mobile communication module 150 or other functional modules.
  • the wireless communication module 160 can provide wireless local area networks (wireless local area networks, WLAN) (such as wireless fidelity (Wireless Fidelity, Wi-Fi) network), bluetooth (bluetooth, BT), global navigation satellite, etc. applied on the electronic device 100.
  • System global navigation satellite system, GNSS
  • frequency modulation frequency modulation, FM
  • near field communication technology near field communication, NFC
  • infrared technology infrared, IR
  • the wireless communication module 160 may be one or more devices integrating at least one communication processing module.
  • the wireless communication module 160 receives electromagnetic waves via the antenna 2 , frequency-modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110 .
  • the wireless communication module 160 can also receive the signal to be sent from the processor 110 , frequency-modulate it, amplify it, and convert it into electromagnetic waves through the antenna 2 for radiation.
  • the electronic device 100 realizes the display function through the GPU, the display screen 194 , and the application processor.
  • the GPU is a microprocessor for image processing, and is connected to the display screen 194 and the application processor. GPUs are used to perform mathematical and geometric calculations for graphics rendering.
  • Processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
  • the display screen 194 is used to display images, videos and the like.
  • 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 (active-matrix organic light emitting diode, AMOLED), flexible light-emitting diode (flex light-emitting diode, FLED), Miniled, MicroLed, Micro-oLed, quantum dot light emitting diodes (quantum dot light emitting diodes, QLED), etc.
  • the electronic device 100 may include 1 or N display screens 194 , where N is a positive integer greater than 1.
  • the electronic device 100 can realize the shooting function through the ISP, the camera 193 , the video codec, the GPU, the display screen 194 and the application processor.
  • the ISP is used for processing the data fed back by the camera 193 .
  • the light is transmitted to the photosensitive element of the camera through the lens, and the light signal is converted into an electrical signal, and the photosensitive element of the camera transmits the electrical signal to the ISP for processing, and converts it into an image visible to the naked eye.
  • ISP can also perform algorithm optimization on image noise, brightness, and skin color.
  • ISP can also optimize the exposure, color temperature and other parameters of the shooting scene.
  • the ISP may be located in the camera 193 .
  • Camera 193 is used to capture still images or video.
  • the object generates an optical image through the lens and projects it to the photosensitive element.
  • the photosensitive element may be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor.
  • CMOS complementary metal-oxide-semiconductor
  • the photosensitive element converts the light signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it into a digital image signal.
  • the ISP outputs the digital image signal to the DSP for processing.
  • DSP converts digital image signals into standard RGB, YUV and other image signals.
  • the electronic device 100 may include 1 or N cameras 193 , where N is a positive integer greater than 1.
  • Digital signal processors are used to process digital signals. In addition to digital image signals, they can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the energy of the frequency point.
  • Video codecs are used to compress or decompress digital video.
  • the electronic device 100 may support one or more video codecs.
  • the electronic device 100 can play or record videos in various encoding formats, for example: moving picture experts group (moving picture experts group, MPEG) 1, MPEG2, MPEG3, MPEG4 and so on.
  • MPEG moving picture experts group
  • the NPU is a neural-network (NN) computing processor.
  • NN neural-network
  • Applications such as intelligent cognition of the electronic device 100 can be realized through the NPU, such as image recognition, face recognition, speech recognition, text understanding, and the like.
  • the external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, so as 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 saving music, video and other files in the external memory card.
  • the internal memory 121 may be used to store computer-executable program codes including instructions.
  • the processor 110 executes various functional applications and data processing of the electronic device 100 by executing instructions stored in the internal memory 121 .
  • the internal memory 121 may include an area for storing programs and an area for storing data.
  • the stored program area can store an operating system, at least one application program required by a function (such as a sound playing function, an image playing function, etc.) and the like.
  • the storage data area can store data created during the use of the electronic device 100 (such as audio data, phonebook, etc.) and the like.
  • 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 magnetic disk storage device, flash memory device, universal flash storage (universal flash storage, UFS) and the like.
  • the electronic device 100 can implement audio functions through the audio module 170 , the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor. Such as music playback, recording, etc.
  • 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 signal.
  • the audio module 170 may also be used to encode and decode audio signals.
  • the audio module 170 may be set in the processor 110 , or some functional modules of the audio module 170 may be set in the processor 110 .
  • Loudspeaker 170A also called “horn” is used to convert audio electrical signals into sound signals
  • Receiver 170B also called “earpiece” is used to convert audio electrical signals into sound signals.
  • the microphone 170C also called “microphone” or “microphone”, is used to convert sound signals into electrical signals.
  • the earphone interface 170D is used for connecting wired earphones.
  • the earphone interface 170D can be a USB interface 130, or a 3.5mm open mobile terminal platform (OMTP) standard interface, or a cellular telecommunications industry association of the USA (CTIA) standard interface.
  • OMTP open mobile terminal platform
  • CTIA cellular telecommunications industry association of the USA
  • the pressure sensor 180A is used to sense the pressure signal and convert the pressure signal into an electrical signal.
  • pressure sensor 180A may be disposed on display screen 194 .
  • pressure sensors 180A such as resistive pressure sensors, inductive pressure sensors, and capacitive pressure sensors.
  • a capacitive pressure sensor may be comprised of at least two parallel plates with conductive material.
  • the electronic device 100 determines the intensity of pressure according to the change in capacitance.
  • the electronic device 100 detects the intensity of the touch operation according to the pressure sensor 180A.
  • the electronic device 100 may also calculate the touched position according to the detection signal of the pressure sensor 180A.
  • touch operations acting on the same touch position but with different touch operation intensities may 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 short messages is executed. When a touch operation whose intensity is greater than or equal to the first pressure threshold acts on the icon of the short message application, the instruction of creating a new short message is executed.
  • the gyro sensor 180B can be used to determine the motion posture of the electronic device 100 .
  • the angular velocity of the electronic device 100 around three axes ie, x, y and z axes
  • the air pressure sensor 180C is used to measure air pressure.
  • the magnetic sensor 180D includes a Hall sensor.
  • the electronic device 100 may use the magnetic sensor 180D to detect the opening and closing of the flip leather case.
  • the electronic device 100 when the electronic device 100 is a clamshell machine, the electronic device 100 can detect opening and closing of the clamshell according to the magnetic sensor 180D.
  • features such as automatic unlocking of the flip cover are set.
  • the acceleration sensor 180E can detect the acceleration of the electronic device 100 in various 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 electronic devices, and can be used in applications such as horizontal and vertical screen switching, pedometers, etc.
  • the distance sensor 180F is used to measure the distance.
  • the electronic device 100 may measure the distance by infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 may use the distance sensor 180F for distance measurement to achieve fast focusing.
  • Proximity light sensor 180G may include, for example, light emitting diodes (LEDs) and light detectors, such as photodiodes.
  • the light emitting diodes may be infrared light emitting diodes.
  • the electronic device 100 emits infrared light through the light emitting diode.
  • Electronic device 100 uses photodiodes to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it may be determined that there is an object near the electronic device 100 . When insufficient reflected light is detected, the electronic device 100 may 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 is holding the electronic device 100 close to the ear to make a call, so as to automatically turn off the screen to save power.
  • the proximity light sensor 180G can also be used in leather case mode, automatic unlock and lock screen in pocket mode.
  • the ambient light sensor 180L is used for sensing ambient light brightness.
  • the fingerprint sensor 180H is used to collect fingerprints.
  • the electronic device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access to application locks, take pictures with fingerprints, answer incoming calls with fingerprints, and the like.
  • the temperature sensor 180J is used to detect temperature.
  • Touch sensor 180K also known as "touch panel”.
  • the touch sensor 180K can be disposed 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 a touch operation 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 .
  • the touch sensor 180K may also be disposed on the surface of the electronic device 100 , which is different from the position of the display screen 194 .
  • the touch sensor 180K can detect the sliding operation on the input panel 218 in the foregoing embodiments.
  • the touch sensor 180K may transfer the above-mentioned sliding operation to the application processor.
  • the electronic device 100 When the electronic device 100 enters the line input function, the electronic device 100 may display the line determined by the track of the sliding operation on the display screen.
  • the bone conduction sensor 180M can acquire vibration signals.
  • the bone conduction sensor 180M can acquire the vibration signal of the vibrating bone mass of the human voice.
  • the bone conduction sensor 180M can also contact the human pulse and receive the blood pressure beating signal.
  • the keys 190 include a power key, a volume key and the like.
  • the key 190 may be a mechanical key. It can also be a touch button.
  • the electronic device 100 can receive key input and generate key signal input related to user settings and function control of the electronic device 100 .
  • the motor 191 can generate a vibrating reminder.
  • the indicator 192 can be an indicator light, and can be used to indicate charging status, power change, and can also be used to indicate messages, missed calls, notifications, and the like.
  • the SIM card interface 195 is used for connecting a SIM card.
  • the SIM card can be connected 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 may support 1 or N SIM card interfaces, where N is a positive integer greater than 1.
  • SIM card interface 195 can support Nano SIM card, Micro SIM card, SIM card etc. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards may be the same or different.
  • the SIM card interface 195 is also compatible with different types of SIM cards.
  • the SIM card interface 195 is also compatible with external memory cards.
  • the electronic device 100 interacts with the network through the SIM card to implement functions such as calling and data communication.
  • the electronic device 100 adopts an eSIM, that is, an embedded SIM card.
  • the eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100 .
  • FIG. 3A to FIG. 3C exemplarily show another scene schematic diagram of line retreat provided by the embodiment of the present application.
  • the electronic device 100 can open the drawing application and display the user interface 210 as shown in FIG. 3A .
  • User interface 210 may include brush control 211 , eraser control 212 , rollback control 213 , restore control 214 , segment rollback control 215 , segment restore control 216 , save control 217 , and input panel 218 . Except for the segment rollback control 215 and the segment recovery control 216 , other content in the user interface 210 can refer to the introduction of the embodiment shown in FIG. 1A , and will not be repeated here.
  • the segment rollback control 215 can be used to trigger the electronic device 100 to segment the lines displayed in the input panel 218 .
  • the electronic device 100 may roll back the lines displayed on the input panel 210 by segments according to the order of drawing time from late to early.
  • the electronic device 100 may store one or more lines in the input panel 218 in segments according to the drawing time.
  • a segment part may be a line corresponding to a sliding track within a preset time period.
  • the starting point of the 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 the line 218B is the pixel point where the sliding operation ends.
  • the drawing time is from early to late.
  • the electronic device 100 may store the line 218B in segments according to the drawing time. When a user operation acting on the segment rollback control 215 is detected, the electronic device 100 can move from the segment part where the end point of the line 218B is located to the segment where the start point of the line 218B is located in the sequence of drawing time from late to early. The segment is partially rolled back.
  • the electronic device 100 may store the line 218A in segments according to the drawing time. Line 218A was drawn earlier than line 218B. When the electronic device 100 rolls back all the segments of the line 218B (that is, the line 218B is removed in the input panel 218), the electronic device 100 can continue to process the segments of the line 218A in the order of drawing time from late to early. Partially segmented rollback.
  • the electronic device 100 when a user operation acting on the segment rollback control 215 is detected, the electronic device 100 starts segment rollback from the segment where the end point of the line 218B is located. During the time period A when the user operates on the segment rollback control 215 , the electronic device 100 can perform segment rollback according to the speed A. Referring to FIG. The above speed A is variable. When no user operation acting on the segment rollback control 215 is detected (that is, the user stops touching the segment rollback control 215), the electronic device 100 may stop performing segment rollback on the line. For example, the electronic device 100 detects a user operation acting on the segment rollback control 215 once, and the duration of this user operation is a time period A. After time period A, electronic device 100 retracts line 218B to position A shown in FIG. 3B .
  • the segment recovery control 216 can be used to trigger the electronic device 100 to segment recover the rolled back lines. Wherein, the electronic device 100 may recover the rolled back lines in segments according to the sequence of rolling back times from late to early. Line 218B is segmented back to position A as shown in FIG. 3B . It can be understood that, in the backed-off segment, the closer to the segment where the position A is located, the later the back-off time.
  • the electronic device 100 can restore the segments of the line 218B from the above-mentioned position A, and restore the segments of the line 218B to FIG. 3C shown at position B.
  • the restored segmented portion may again be displayed in the input panel 218 .
  • the restored shape of the segmented part and the displayed position in the input panel are respectively the same as the shape and displayed position in the input panel of the segmented part before being rolled back.
  • the state of the segment restoration control 216 may be the disabled state shown in FIG. 3A .
  • the color of the segment recovery control 216 is gray.
  • the state of the segment restoration control 216 can be the available state shown in FIG. 3B .
  • 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 status of the segment recovery control 214 .
  • the electronic device 100 may display the segmented rollback control 215 as an unavailable state (eg, the color of the segmented rollback control 215 is gray).
  • the electronic device 100 may display the segmented rollback control 215 as an available state (eg, the color of the segmented rollback control 215 is black).
  • Stage 1 The electronic device 100 responds to the first segmentation user operation and rolls back the lines segmented.
  • 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 .
  • the electronic device 100 displays a line 218A and a line 218B on the input panel 218 as shown in FIG. 3A according to the sliding track.
  • the electronic device 100 in response to a user operation that acts on the segment rollback control 215 and lasts for 3 seconds (second, s) (hereinafter referred to as the first segment user operation), the electronic device 100 returns the line 218B to Go back to position C.
  • the user presses the segment rollback control 215 for the first time and lasts for 3 seconds, so that the line 218B is rolled back from the end point to position C.
  • the segmented portion included from the end point of line 218B to position C ie, the line setback shown in FIG. 4A ) is removed in input panel 218 .
  • the electronic device 100 may adjust the speed of the segmented retreat line within this period of time. It can be understood that a longer duration of action on the segment rollback control 215 may indicate that more segments need to be rolled back, and the distance between the current rollback position of the line and the user's expected position is still relatively large.
  • the electronic device 100 may gradually increase the speed of segmented retraction lines during the time period of the first segmented user operation, so as to improve the efficiency of retraction.
  • the electronic device 100 may retreat segmentally from the end point of the line 218B at an initial speed of v1 .
  • the electronic device 100 may continue segmenting back the line at the speed v2 .
  • Velocity v 2 is not less than velocity v 1 .
  • the electronic device 100 may continue segmenting back the line at the speed v3 .
  • the velocity v 3 is not less than the velocity v 2 .
  • the electronic device 100 may retreat the line segmented at a constant speed. For example, when detecting the first segmented user operation, the electronic device 100 may retreat segmentally from the end point of the line 218 at a constant speed v1 . When the first user operation of segmenting ends, the electronic device 100 may stop segmenting and rewinding the lines.
  • the embodiment of the present application does not limit the specific values of the above-mentioned speed v 1 , speed v 2 , and speed v 3 , and the manner of dividing time intervals with different retraction speeds.
  • Stage 2 The electronic device 100 responds to the second segmentation user operation and rolls back the line segment by segment.
  • the electronic device 100 detects again a user operation acting on the segmented rollback control 215 with a duration of 2s (hereinafter referred to as the second segmented operation). user action). In response to the second segmented user operation, the electronic device 100 retracts the line 218B from position C shown in FIG. 4A to position D shown in FIG. 4B .
  • the electronic device 100 may adjust the speed of retracting the line during 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 segment rollback control 215 first, so that the line rolls back to the segment close to the desired position. Furthermore, the user usually intermittently short-presses the segment back control 215 to make the electronic device 100 continue to segment and roll back the line in a small range until reaching the segment part where the desired position is located.
  • the electronic device 100 may reduce the speed of retracting the line during the second segmented user operation action time period based on the initial speed of retracting the line during the first segmented user operation action period. In this way, it is possible to avoid too many segments that are rolled back due to the excessive speed of rolling back lines during the time period of the second segmented user operation.
  • the electronic device 100 may retract the line 218B segmented from the position C according to the speed v4 .
  • the initial velocity of the retracement line during the time period of the first segmented user operation is v 1 .
  • Velocity v 4 is not greater than velocity v 1 .
  • v 4 0.6*v 1 .
  • the electronic device 100 may stop segmenting the line back.
  • the embodiment of the present application does not limit the specific value of the velocity v4 .
  • the speed of retreating the lines during the second segmented user operation period may vary. It can be understood that after the first segmentation user operation, the position where the line retreats 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 speed of the retracted line during the time period of the first segmented user operation, the electronic device 100 can determine the initial speed of the retracted line within the time period of the second segmented user operation. When the duration of the second segmented user operation exceeds a preset period of time, the electronic device 100 may increase the speed of rewinding the lines. It can be seen that the long press of the segment rollback control 215 by the user may indicate that there are many segments that the user needs to roll back. The electronic device 100 can increase the speed of segmental rollback, thereby improving the efficiency of rollback.
  • the electronic device 100 may retreat segmentally from the position C of the line 218B at an initial speed of v4 .
  • the above-mentioned speed v4 may be determined according to the initial speed of the retracted line within the time period of the first segmented user operation.
  • the electronic device 100 may continue segmenting back the lines at the speed v5 .
  • the speed v 5 is not less than the speed v 4 .
  • the above-mentioned speed v 4 may also be determined according to the speed (such as speed v 3 ) of the retracted line at the end of the first user operation.
  • 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 (eg, 5s).
  • the time interval between the first segmented user operation and the second segmented user operation may be: the time difference between the time when the first segmented user operation ends and the time when the second segmented user operation starts.
  • the electronic device 100 may determine the speed of the retraction line within the second segmented user operation action time period according to the method in the above-mentioned embodiment. If it is determined that the preset time length is exceeded, the electronic device 100 may determine whether the first segmented user operation and the second segmented user operation are two consecutive user operations. Two consecutive user operations may indicate that the electronic device 100 has not detected other user operations between the two user operations. If it is determined that there are two consecutive user operations, the electronic device 100 may determine the speed of the retraction line within the time period of the second segmented user operation according to the method in the above embodiment.
  • the electronic device 100 can determine the action time of the second segmented user operation according to the method of determining the retraction line speed within the action time period of the first segmented user operation in the aforementioned embodiment. Method for backing off line speed within a segment.
  • 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 there are two consecutive user operations, the electronic device 100 may determine the speed of the retraction line within the time period of the second segmented user operation 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 action time of the second segmented user operation according to the method of determining the retraction line speed within the action time period of the first segmented user operation in the aforementioned embodiment. Method for backing off line speed within a segment.
  • the two user operations can be considered irrelevant. That is, the state in which the user performs the first segmentation user operation and expects the line to roll back is different from the state in which the user performs the second segmentation user operation and expects the line to roll back. Then, the electronic device 100 can determine the two user operations as two independent user operations, instead of determining the action time of the second segmented user operation according to the speed of the retraction line within the action time period of the first segmented user operation The speed at which lines are retracted within the segment.
  • Stage 3 The electronic device 100 responds to the third segmentation user operation and rolls back the lines segment by segment.
  • the electronic device 100 again detects a user action on the segmented back control 215 for a duration of 0.5s. operation (subsequently referred to as the third segmented user operation). In response to the third segmented user operation, the electronic device 100 retracts the line 218B from the position D shown in FIG. 4B to the position E shown in FIG. 4C .
  • the electronic device 100 may adjust the speed of rolling back the lines during the third segmented user operation time period according to the speed of the retracted line during the second segmented user operation time period.
  • the specific method can refer to the method in stage 2 of the above-mentioned embodiment, where the electronic device 100 determines the speed of the retracted line during the second segmented user operation action time period according to the speed of the retracted line during the first segmented user operation action period. . I won't go into details here.
  • the electronic device 100 may retract the line 218B segmented from the position D according to the speed v6 .
  • the initial velocity of the retracement line during the time period of the second segmented user operation is v 4 .
  • Velocity v 6 is not greater than velocity v 4 .
  • v 6 0.6*v 4 .
  • the electronic device 100 may stop segmenting the line back.
  • the embodiment of the present application does not limit the specific value of the velocity v 6 .
  • the electronic device 100 may determine the speed of the line retracted during the current segmented user operation time period according to the speed of the retracted line during the previous segmented user operation time period.
  • the above-mentioned previous segmented user operation and the current segmented user operation may be two consecutive user operations, or may be two user operations within a preset time length.
  • the electronic device 100 may rewind the line according to the speed of rewinding the lines within the time period of the user operation of the segment rewind control 215 for several times within the time period T1 before the moment when the current segment user operation starts, To determine the speed of rolling back the line during the current segmented user operation action time period.
  • the value of T 1 can be set according to experience. The embodiment of the present application does not limit the specific value of T 1 above.
  • the above-mentioned first segmented user operation and the second segmented user operation are both user operations within the time period T1 before the start of the third user operation, and the electronic device 100 may
  • the speed of the retracted line (such as speed v 1 ) within the action period of the user operation, and the speed of the retracted line (such as speed v 4 ) within the action period of the second segmented user operation are used to determine the third segmented user operation Velocity during the action time period.
  • the time length and frequency of the user's action on the segmented back control can reflect the distance between the current backed position of the line and the user's expected position.
  • the electronic device 100 can adjust the speed of the segmented rollback line 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. Wherein, the longer the duration of a user operation acting on the segmented rewind control, the electronic device 100 may gradually increase the speed of rewinding the lines within the time period of this user operation.
  • the frequency of user operations acting on the segmented rollback control is high (that is, the number of user operations acting on the segmented rollback control within the preset time length is high), which can indicate that the segmented rollback has been applied to the segmented rollback control multiple times within the preset time length
  • the duration of the user action on the control is short, and the time interval between two user actions acting on the segmented fallback control is also short.
  • the electronic device 100 may gradually reduce the speed of the retracted lines within the time period of the multiple user operations. The above embodiments can provide the accuracy of rolling back the lines, and the user can more conveniently roll back the lines in the input panel to their desired state.
  • the electronic device 100 may recover the rolled back lines segment by segment according to the order of the rollback time from late to early. It is understandable that when the user is away from the location where the user expects to restore, the user usually long presses the segment restore control. When approaching the position that the user expects to restore, the user usually short-presses the segment restoration control intermittently until the electronic device restores the line to the position that the user expects to restore. Then, the electronic device 100 can adjust the speed of the segment recovery line by detecting the duration of each user operation on the segment recovery control and the frequency of the user operation on the segment recovery control. For a specific implementation method, reference may be made to the implementation method of the electronic device 100 adjusting the speed of the segmented retraction line shown in FIGS. 4A to 4C , which will not be repeated here.
  • segmented storage lines segmented rollback lines and segmented recovery lines provided by the embodiment of the present application are introduced below.
  • Layers can be used to draw images.
  • the size of a layer can be the same as the size of the input panel in the previous embodiment. Except for the part of the image drawn on this 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. Wherein, the image superimposed on the upper layer may block the image superimposed on the lower layer. The image presented after stacking multiple layers in a certain order is the content displayed in the input panel.
  • a line is drawn on each layer.
  • a line may be determined by the trajectory of a single sliding operation detected by the electronic device 100 on the input panel.
  • the electronic device 100 can create a new layer, and draw a line determined by the trajectory of a single sliding operation detected after the new layer is created on the newly created layer .
  • the electronic device 100 may stack all the layers in order of drawing time from early to late. Among them, the layer with the earliest drawing time is superimposed on the lower layer. Layers drawn later are superimposed on top. From the embodiment shown in FIG. 1A and FIG.
  • the electronic device 100 rolls back the lines in the input panel in units of bars, and the specific method may be to roll back the layers in the order from the upper layer to the lower layer. . Lines in the layer being rolled back are removed in the input panel.
  • a segmented portion of a line may be drawn on each layer.
  • the electronic device 100 may segment the line every preset segment time period (for example, 2 milliseconds).
  • the electronic device 100 can create a new layer, and after the new layer is created, the preset segment time period starting from the initial moment when the sliding operation is detected
  • the segmented parts determined by the trajectory of the detected swipe operations are drawn on this newly created layer.
  • the electronic device 100 may stack all the layers in order of drawing time from early to late. Among them, the layer with the earliest drawing time is superimposed on the lower layer. Layers drawn later are superimposed on the lower layer. It can be seen that the electronic device 100 rolls back the layer of a segmented part drawn with a line, which can realize the segmented rollback of the line.
  • line 218B is displayed in the input panel.
  • the line 218B is determined by the trajectory of a single sliding operation detected by the electronic device 100 on the input panel.
  • the electronic device 100 may segment the line 218B according to the drawing time, and draw different segmented parts on different layers.
  • the electronic device 100 divides the line 218B into 6 segments, including: a segmented part A, a segmented part B, a segmented part C, a segmented part D, a segmented part E, and a segmented part F.
  • Segment A is the segment where the starting point of line 218B is located.
  • Segment portion F is the segment portion where the end point of line 218B is located.
  • a blank layer has been established in the electronic device 100 before the track of the sliding operation of the determined line 218B is detected.
  • the electronic device 100 will detect the segmented part (that is, the segmented part A) , draw in one of the above created blank layers, and create a new layer.
  • the segmented portion determined by the trajectory of the detected sliding operation within the preset segmented time period starting from the initial moment of the detected sliding operation (that is, the segmented portion B ), drawn on this new layer.
  • the electronic device 100 may determine that the sliding operation of segment part A and the sliding operation of segment part B are operations performed within different time periods in a single sliding operation. That is, segmented part A and segmented part B are two segmented parts in one line.
  • the method for drawing the segmented part C, the segmented part D, the segmented part E and the segmented part F by the electronic device 100 may refer to the aforementioned method for drawing the segmented part A and the segmented part B, which will not be repeated here. It can be seen that the six segmented parts can be drawn on different layers respectively.
  • the layer for drawing each segment part may also be established 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.
  • segmented part A, segmented part B, segmented part C, segmented part D, segmented part E, and segmented part F are drawn on layer A, layer B, and layer C respectively , Layer D, Layer E, and Layer F.
  • Each layer is timestamped.
  • a layer's timestamp can be determined from the drawing time of the segmented parts on this layer.
  • the electronic device 100 may determine the order of drawing times of the segmented parts on a layer according to the time stamp of a layer.
  • time stamps of layer A, layer B, layer C, layer D, layer E, and layer F are respectively time stamp t 1 , time stamp t 2 , time stamp t 3 , time stamp t 4 , Time stamp t 5 , time stamp t 6 .
  • the electronic device 100 may store a layer in which each segment of a line segment is drawn in a stack.
  • a stack is a linear table that can only be inserted and deleted at one end, and stores data according to the principle of first in, last out. Among them, 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.
  • the electronic device 100 may store the layers of the line 218B into the stack A in order of drawing time from early to late. Specifically, every time a layer on which a segmented portion of the line 218B is drawn is obtained, the electronic device 100 may store this layer into the stack A. It can be seen that segment A on layer A is the earliest segment drawn in line 218B. Electronic device 100 first stores layer A into stack A. Layer A is at the bottom of stack A. Segment F on layer F is the latest segment drawn in line 218B. Electronic device 100 finally stores layer F into stack A. Layer F is at the top of stack A. The pointer can point to the location of layer F in stack A. The layer pointed by the above pointer can be the uppermost layer among the layers displayed in the input panel for all drawing contents.
  • the electronic device 100 may move the position pointed by the pointer from the top of the stack A to the bottom of the stack. For example, in response to a user operation acting on the segment rollback control 215, the electronic device 100 moves the pointed position of the pointer to the position where the layer C is located. Then, the segmented parts drawn on layers D, E, and F are removed in the input panel. Line 218B is retracted to where segmented portion C and segmented portion D intersect.
  • the step size of the pointer movement is one layer.
  • the speed at which the electronic device 100 moves the pointer is the speed at which the lines are retracted in the foregoing embodiments.
  • the implementation method for the electronic device 100 to adjust the moving speed of the pointer may refer to the foregoing embodiments shown in FIG. 4A to FIG. 4C , which will not be repeated here.
  • the electronic device 100 may store different lines in different stacks. For example, before receiving the sliding operation to determine the line 218B, the electronic device 100 also receives the sliding operation to determine the aforementioned line 218A shown in FIG. 4A .
  • the electronic device 100 may segment the line 218A according to the drawing time, and store the segments of the line 218A into the stack B in order of drawing time from early to late.
  • Stack B and stack A are two different stacks. Obviously, the drawing time of segmented parts on all layers in stack B is earlier than the drawing time of segmented parts on all layers in stack A.
  • the electronic device 100 can stack all the layers in stack B and stack A in order of drawing time from early to late. Among them, the layer with the earliest drawing time is superimposed on the lower layer. Layers drawn later are superimposed on top.
  • the image presented after the multiple layers are stacked can refer to the lines 218A and 218B displayed in the input panel 218 shown in FIG. 3A.
  • the electronic device 100 moves the position of the pointer to the position of layer C.
  • the electronic device 100 may stack all the layers in the stack B and the layers A, B, and C in the stack A in order of drawing time from early to late.
  • the image presented after the multiple layers are stacked can refer to the content displayed in the input panel shown in FIG. 4B above.
  • the position A shown in FIG. 3B may be the position where the intersection of the segmented part C and the segmented part D is located.
  • the electronic device 100 rolls back 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 back control 215 is detected, the electronic device 100 may move the pointer from the layer A to the layer at the top of the stack B, and move from the top of the stack B to the bottom of the stack . That is to say, when all the segments of the line 218B are rolled back, the electronic device 100 can perform a segment rollback from the segment where the end point of the line 218A is located to the segment where the start point of the line 218A is located.
  • the line 218A is a line whose drawing time is before the line 218B and is closest to the drawing time of the line 218B.
  • the electronic device 100 may perform segment rollback on multiple lines according to the order of drawing time from late to early without being limited to segment rollback for a line drawn last time. This can better help the user roll back the line to the state the user expects.
  • the electronic device 100 in response to a user operation acting on the segment rollback control 215, moves the position of the pointer to the position of layer C shown in FIG. 5 . Further, the electronic device 100 enters the line input function, and detects a sliding operation on the input panel. The electronic device 100 may display a line (referred to as line C) on the input panel according to the trajectory of this sliding operation. Wherein, the electronic device 100 may divide the line C into segments according to the method of the foregoing embodiments, and store each segment of the line C into the stack C in order of drawing time from early to late. The above pointer may point to the layer located at the top of the stack C. In addition, the electronic device 100 may delete the layer D, the layer E and the layer F in the stack A.
  • the electronic device 100 may move the pointer in a direction from the top of the stack C to the bottom of the 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 (that is, layer A).
  • the electronic device 100 rolls back a line segment by segment, and receives the user's sliding operation. After the input panel displays new drawing content, the stack structure storing the segmented back line is destroyed. Wherein, the electronic device 100 deletes the layer drawn with the segment part that has been segmented back from the stack.
  • the electronic device 100 may recover the rolled back lines segment by segment according to the order of the rollback time from late to early.
  • the electronic device 100 can restore the line segment by segment by moving the pointer.
  • the moving direction of the pointer when recovering the line by segment is opposite to the moving direction of the pointer when the line is rolled back by segment in the foregoing embodiment.
  • the pointer moves to the position of layer C in stack A shown in FIG. 5 .
  • the electronic device 100 may move the pointer from the position of the layer C in a direction from the bottom of the stack to the top of the stack.
  • the electronic device 100 stops moving the pointer.
  • the electronic device 100 may display the segmented parts drawn in the layer D and the layer E in the input panel. Wherein, during the restoration process of the segmented part in the line 218B, the segmented part drawn in the first restored layer (ie layer D) is firstly displayed in the input panel.
  • the electronic device 100 may refer to the aforementioned embodiments shown in FIG. 4A to FIG. 4C for the implementation method of adjusting the moving speed of the pointer, which will not be repeated here.
  • the electronic device 100 can draw the line segments on different layers. A layer is rolled back, and the segmented parts drawn on this layer are removed in the input panel. In this way, the electronic device 100 can realize the segmented retreat of the lines.
  • the electronic device 100 may store different layers in the stack in order of drawing time from early to late.
  • the electronic device 100 can adjust the moving speed of the pointer by detecting the duration of each user operation acting on the segmented rollback control and the frequency of the user operation acting on the segmented rollback control, thereby realizing the adjustment of the segmented rollback The speed of the line.
  • the above method can improve the precision of rolling back lines, and the user can roll back the lines in the input panel to their desired state more conveniently.
  • the electronic device 100 may store segmented portions of k lines determined by trajectories of the last k sliding operations received. For the segmented parts of the lines determined by the trajectories of the sliding operations before the above k times of sliding operations, the electronic device 100 may combine the layers of the segmented parts drawn with one of the lines into one layer, and store it. This can save storage space of the electronic device 100 .
  • the electronic device 100 may roll back the line determined by the track of the sliding operation before the above k times of sliding operations in units of bars.
  • the value of the above k can be set according to empirical values.
  • the embodiment of the present application does not limit the value of k.
  • the user operation of the rollback control 213 or restore control 214 in the previous embodiments will not destroy the structure of the stack of lines shown in FIG. 5 . That is, in response to a user operation acting on the rollback control 213, the electronic device 100 rolls back one line. Further, in response to a user operation acting on the segment recovery control 216, the electronic device 100 may perform segment recovery on the aforementioned rolled back line. In response to a user operation on the restore control 214, the electronic device 100 may restore a line. Further, in response to a user operation acting on the segment rollback control 215, the electronic device 100 may perform segment rollback on the restored line.
  • the situation where the stack structure of a line is destroyed may include: some layers in the stack are lost, multiple layers in the stack are merged into one layer, and the electronic device 100 cannot index to a certain layer on which the line is drawn according to the pointer. Layers for segmented parts.
  • the electronic device 100 stores the segmented portion of the line 218A and the line 218B shown in FIG. 3A as an example for illustration.
  • Line 218A was drawn earlier than line 218B.
  • the segmented portion of line 218B is stored in stack A.
  • Stored in stack B is the segmented portion of line 218A.
  • the input panel of the electronic device 100 displays the lines 218A and 218B shown in FIG. 3A .
  • the pointer points to the layer at the top of stack A.
  • the electronic device 100 can move the pointer to the layer at the top of the stack B. That is, electronic device 100 rolls back line 218B. Line 218B is removed in the input panel. Further, in response to a user operation acting on the segment rollback control 215, the electronic device 100 can move the pointer according to the method of segment rollback lines in the foregoing embodiments. Wherein, the pointer moves in a direction from the top of the stack B to the bottom of the stack B. That is, the electronic device 100 rolls back a part of the line 218A in segments according to the user operation on the segment rollback control 215 this time. The backed-off segmented portion of line 218A is removed in the input panel.
  • the electronic device 100 may adjust the position of the pointer to the position of the layer at the top of the stack B.
  • the step size of the pointer movement may be a number of layers included between the layer pointed to after the aforementioned segmental rollback and the layer at the top of the stack B. That is, the electronic device 100 can restore all the segmented back parts in the line 218A according to the user operation acting on the restoration control 214 . The restored part is displayed again in the input panel. Further, in response to a user operation acting on the section restoration control 216, the electronic device 100 can move the pointer according to the method of section restoration line in the foregoing embodiments.
  • the pointer moves from the top of stack B to the bottom of stack A, and moves in a direction from the bottom of stack A to the top of stack A. That is, the electronic device 100 can recover a part of the line 218B segmentally according to the user operation acting on the segment recovery control 215 this time. The restored segmented portion in line 218B is again displayed in the input panel.
  • the electronic device 100 can still divide the lines in the input panel according to the received user operation acting on the segmentation rollback control 215. Rewind the segment, or perform segment recovery on the line that has been rolled back according to the received user operation on the segment recovery control 216 . That is, the user operation of the rollback control 213 or restore control 214 in the foregoing embodiments will not destroy the structure of the stack of lines shown in FIG. 5 .
  • the line displayed in the input panel will include the abnormal segmentation part.
  • the above-mentioned abnormal segmentation part is the line determined by deviating from the trajectory expected by the user in the trajectory of the above-mentioned sliding operation.
  • the above-mentioned exception segmentation part is the part that the user wants to delete.
  • the above-mentioned abnormal segment is generally caused by a sudden external force during the drawing of a line.
  • the user usually slows down the sliding speed of the sliding operation when drawing a line to close the pen. That is, the segmented portion at the end of the line is usually drawn more slowly.
  • the normal drawing process of the above line may indicate that the user is not affected by external force during the process from the start of drawing to the end of drawing, and it is determined that the trajectory of the sliding operation of this line is the same as the trajectory expected by the user.
  • the embodiment of the present application provides a method for rolling back lines.
  • the electronic device 100 may store a line in segments according to the drawing time of the line. This one line can consist of multiple segmented parts.
  • One of the segmented parts may be a line corresponding to the sliding trajectory within a preset segmented time period (for example, within 2 milliseconds).
  • the electronic device 100 may detect the drawing speed of each segment part. According to the drawing speed, the electronic device 100 may determine a boundary point of a normal segment part and an abnormal segment part. In response to a user operation acting on the segment rollback control 215, the electronic device 100 can roll back the line from the end point to the dividing point.
  • the electronic device 100 can estimate at which moment the user is affected by an external force according to the drawing speed of each segment in a line, causing a part of the line to deviate from the user's expected trajectory.
  • the electronic device 100 may remove the abnormal segment part in the input panel in response to the user operation for segment rollback.
  • the electronic device 100 does not remove the entire line from the input panel.
  • the user can continue to draw from the dividing point.
  • the above method is easy for the user to operate, and can quickly return the lines in the input panel to the desired state of the user, thereby improving the user experience.
  • the electronic device 100 may determine whether a segmented part is a normal segmented part or an abnormal segmented part according to the drawing speed of each segmented part. Wherein, the drawing speed of the abnormal segment part is much higher than that of the normal segment part.
  • the drawing speed of a segment part can be determined by the length of the segment part and the drawing time of the segment part (such as the preset segment time period mentioned above). For example, the speed of a segment portion is the length of the segment portion divided by the time length of the preset segment time period.
  • the electronic device 100 may compare the drawing speed of each segment of a line with a speed threshold.
  • the segment part whose drawing speed is greater than the speed threshold is an abnormal segment part.
  • the segmented part whose drawing speed is not greater than the speed threshold is a normal segmented part.
  • the aforementioned speed threshold can be set according to empirical values (eg, 9000 pixels/second). The embodiment of the present application does not limit the value of the above speed threshold.
  • 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. Wherein, if the drawing speed of a cluster center is greater than the speed threshold, the segmented parts included in the category to which the clustered center belongs are all abnormal segmented parts. Conversely, the segmented parts included in the category to which this cluster center belongs are aggregated into normal segmented parts.
  • the aforementioned clustering algorithm may be, for example, a k-means algorithm.
  • the embodiment of the present application does not limit the foregoing clustering algorithm.
  • the normal segment part is a line corresponding to the trajectory expected by the user.
  • the abnormal segment part is the line corresponding to the trajectory that the user is affected by external forces and deviates from the expected trajectory during the drawing process.
  • the abnormal segmentation part of a line is usually located in the second half of the line.
  • the electronic device 100 may determine the intersection of the first abnormal segment part and the normal segment part in the direction from the end point to the start point in a line as the above-mentioned boundary point.
  • the following describes a method for the electronic device 100 to roll back an abnormal segment of a line in combination with specific scenarios.
  • FIG. 6A and FIG. 6B exemplarily show another schematic diagram of a line retreat scene provided by an embodiment of the present application.
  • 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.
  • the scene shown in FIG. 6A is: the user inputs "F" by hand on the input panel 218 of the electronic device 100 .
  • the user enters line 218C, line 218D, and line 218E sequentially in input panel 218 .
  • the user is affected by an external force (for example, the elbow is bumped suddenly), and a part of the line 218E deviates from the trajectory expected by the user.
  • the electronic device 100 may store the line 218E in segments according to the method in the foregoing embodiments, and determine the drawing speed of each segment. Further, according to the drawing speed, the electronic device 100 may determine the boundary point between the normal segment part and the abnormal segment part of the line 218E (the boundary point shown in 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.
  • the electronic device 100 in response to a user operation acting on the segment rollback control 215 , can roll back the line 218E to the dividing point.
  • the electronic device 100 may remove the segmented portion of the line 218E from the end point to the boundary point (ie, the retracted portion of the line shown in FIG. 6B ) from the input panel 218 .
  • the electronic device 100 may segment the line 218E according to the aforementioned embodiment shown in FIG. 5 .
  • Line 218E may include n segmented portions: segmented portions A 1 , . . . , A i , A i+1 , . . . , An .
  • the value of n is determined by the drawing time of the line 218E and the aforementioned preset segmentation time period. i is a positive integer smaller than n.
  • Segment A 1 is the segment where the starting point of line 218E is located.
  • the segmented portion An is the segmented portion where the end point of the line 218E is located.
  • the electronic device 100 may draw the n segmented parts of the line 218E on n layers respectively. Therein, layer A 1 is drawn with segmented part A 1 . Layer A i is drawn with segmented part A i . Layer A i+1 is drawn with segmented part A i+1 . Layer A n is drawn with segmented part A n .
  • Each layer can have a timestamp.
  • the value of the timestamp of a layer can be determined by the drawing time of the segment drawn on this layer.
  • the electronic device 100 may determine, according to the time stamps, the order in which the segment parts drawn on each layer are drawn sooner or later.
  • the electronic device 100 may store the layers in a stack in order of drawing time from early to late (stack D shown in FIG. 7 ). Among them, the storage position of the layer whose drawing time is earlier is closer to the stack bottom of the stack D. The storage position of the layer whose drawing time is later is closer to the top of stack D.
  • the electronic device 100 may 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 foregoing embodiment. Exemplarily, the electronic device 100 determines that the intersection point between the segmented part A i and the segmented part A i+1 is the boundary point. That is, the segmented part A i+1 to the segmented part A n are all abnormal segmented parts.
  • the segmented part A i is a normal segmented part.
  • the pointer Before segment rollback is performed, the pointer may point to the layer at the top of the stack D (that is, the layer A n ).
  • the electronic device 100 can move the pointer in the direction from the top of the stack D to the bottom of the stack D, and move to the one drawn with a normal The location of the segmented part of the layer (that is, the layer A i ).
  • the electronic device 100 can directly move the pointer from the position of the layer A n to the position of the layer A i .
  • the segmented parts drawn in the rolled-back layers are removed in the input panel 218 . That is, in response to a user operation acting on the segment rollback control 215, the electronic device 100 can roll back the line 218E to the above-mentioned boundary point, and remove the abnormal segment from the boundary point to the end point from the input panel.
  • the electronic device 100 may first determine the intersection point y1 between the first abnormal segment part and the normal segment part in the direction from the end point to the start point in a line. Further, the electronic device 100 may determine whether the x segment parts closest to the intersection point y1 are all normal segment parts. If the x segment parts closest to the intersection point y1 are all normal segment parts, the electronic device 100 may determine the intersection point as the above-mentioned boundary point.
  • the electronic device 100 can determine the intersection point between the second abnormal segment part and the normal segment part in the direction from the intersection point y1 to the starting point in this line y2, and determine the intersection point y2 as the above-mentioned dividing point.
  • the above-mentioned value of x may be set according to empirical values (for example, 3). The embodiment of the present application does not limit the value of x.
  • the above method can reduce the inaccurate determination of the demarcation point due to misjudgment of the abnormal situation of the segmentation part.
  • the first five segment parts of the segment part A i are all abnormal segment parts.
  • the electronic device 100 may have an error in judging the segmented portion A i as a normal segmented portion.
  • the electronic device 100 can search the intersection point of the new abnormal segment part and the normal part from the intersection point of the segment part Ai and the segment part Ai +1 to the starting point, and determine the new intersection point as the demarcation point . This can improve the accuracy of determining where the user expects the line to fall back.
  • the electronic device 100 may also judge whether several segmented parts closest to the intersection point 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.
  • the electronic device 100 in response to a user operation acting on the segmentation rollback control 215, can determine whether a line (such as the line with the latest drawing time) has an abnormal score according to the method shown in FIG. 7 . segment part. If there is an abnormal segmented portion, the electronic device 100 may roll back the line to the demarcation point according to the method of the aforementioned embodiment. Further, if the duration of the user operation acting on the segmented back control 215 exceeds the preset time, the electronic device 100 may, within the time period exceeding the preset time, change the input panel according to the method shown in FIG. 5 . The lines in are backed off piecewise from the breakpoint above.
  • the aforementioned preset time may be set according to experience values (eg, 1s). The embodiment of the present application does not limit the value of the foregoing preset time.
  • the electronic device 100 in response to a user operation on the segment rollback control 215, can roll back a line with an abnormal segment part according to the method shown in FIG. Retreat to the above-mentioned dividing point. Further, the electronic device 100 again detects the user operation acting on the segment rollback control 215, and the electronic device 100 may perform segment rollback of the lines in the input panel from the above-mentioned dividing point according to the method shown in FIG. 5 .
  • the electronic device 100 rolls back a line with an abnormal segment part to the above-mentioned dividing point according to the method shown in FIG. 7 , and the electronic device 100 can also include Segment recovery of multiple segment parts.
  • the aforementioned line 218E as an example for illustration.
  • the pointer points to the layer A i in the stack D.
  • the electronic device 100 may move the pointer from the bottom of the stack D to the top of the stack, and the moving step is one layer.
  • the speed at which the electronic device 100 moves the pointer may refer to the speed at which the electronic device 100 restores the line segmentally in the foregoing embodiments. I won't go into details here.
  • the segments from the boundary point to the end point of the line 218E can be restored one by one and displayed on the input panel 218 again.
  • FIG. 8 is a flow chart of an input panel-based line fallback method provided by an embodiment of the present application.
  • the method may include steps S101-S107. in:
  • the electronic device 100 may detect a sliding operation on the input panel, and display a line Z on the input panel according to the trajectory of the sliding operation.
  • the electronic device 100 may store the line Z in segments according to the drawing time, and a segment of the line Z is a line corresponding to a trajectory of a sliding operation within a time segment t.
  • the method for the electronic device 100 to store the line Z in segments may refer to the method for storing the line 218B in segments shown in FIG. 5 . I won't go into details here.
  • the value of the time segment t segment can be set according to empirical values. This embodiment of the present application does not limit it.
  • the electronic device 100 may determine whether the segment where the end point of the line Z is located is an abnormal segment.
  • Line Z may include multiple segmented parts.
  • the electronic device 100 may detect the drawing speed of each segmented portion of the line Z.
  • the drawing speed of a segment part may be determined by the length of the segment part and the length of the time segment t segment in the above step S102.
  • the electronic device 100 may judge whether a segment part is an abnormal segment part according to the drawing speed of a segment part. For a specific determination method, reference may be made to the foregoing embodiments, which will not be repeated here.
  • the electronic device 100 may determine whether an abnormal segment occurs in a line by first determining whether the segment where the end point of a line is located is an abnormal segment.
  • the electronic device 100 may determine that there is no abnormal segment part in the line Z, and execute the following step S104.
  • the electronic device 100 may determine that there is an abnormal section in the line Z, and execute the following step S105 .
  • the electronic device 100 may determine whether the drawing speed of several segmented parts closest to the end point of the line Z exceeds a speed threshold. If the drawing speed of all or most (eg more than 80%) of the several segmented parts closest to the end point of the line Z exceeds the speed threshold, the electronic device 100 may determine that there is an abnormal segmented part in the line Z. Otherwise, the electronic device 100 may determine that there is no abnormal segmented portion in the line Z. This can reduce errors in the electronic device 100 judging whether there is an abnormal segment due to incorrect calculation of the drawing speed of the segment where the end point is located, and improve detection accuracy.
  • the electronic device 100 can remove the segmented parts of the line Z one by one in the direction from the end point to the starting point in the input panel, and the removal speed is determined by the frequency of the detected user operation for performing segment rollback , the higher the frequency of user actions for segment rollback, the slower the removal rate.
  • the aforementioned user operation for segment rollback may be a user operation acting on the segment rollback control 215 shown in FIG. 4A .
  • the speed at which the electronic device 100 retracts the line Z in segments may be constant.
  • the magnitude of the speed may be determined by the frequency of user operations detected by the electronic device 100 for segment backing.
  • the electronic device 100 may continue segmentally retracting the line whose drawing time is before the line Z and is closest to the drawing time of the line Z.
  • the speed at which the electronic device 100 retracts the line Z by segment may vary.
  • the electronic device 100 may adjust the speed of the retracted line in stages within the duration tc. For example, 0-tc1 seconds for vc1. tc1-tc2 seconds are vc2. .... tci-tc seconds for vc.
  • the electronic device 100 may increase the speed of rolling back lines. That is, the sizes of vc1, vc2, ..., vc gradually increase.
  • the electronic device 100 may perform segment return on the lines in the input panel.
  • the initial speed at which the electronic device 100 rolls back the line segment may be determined by the frequency of the detected user operation for performing segment rollback.
  • the embodiment of the present application does not limit the specific interval of the stage division of the above-mentioned duration tc.
  • the electronic device 100 may gradually increase the speed of the segmented rewinding line within the duration of one user operation of the user performing segmented rewinding, so as to improve the efficiency of rewinding.
  • the electronic device 100 may determine a boundary point between a normal segment part and an abnormal segment part of the line Z.
  • the electronic device 100 may determine whether the segmented parts of the line Z are abnormal segmented parts one by one in a direction from the end point of the line Z to the starting point. Specifically, the electronic device 100 has determined that the segment where the end point of the line Z is located is an abnormal segment. Further, the electronic device 100 may determine whether the segment part before the segment part where the end point is located is an abnormal segment part, until the first abnormal segment part in the direction from the end point to the start point in the line Z is determined to be the same as Intersection of normal segmented parts. The electronic device 100 may determine the intersection point as the boundary point between the normal segment part and the abnormal segment part of the line Z.
  • the electronic device 100 may remove the segment part contained in the line Z from the end point to the dividing point in the input panel.
  • step S107 If in step S106, the duration of the user operation of a segmented rollback by the user exceeds the preset time, within the time period exceeding the preset time, the electronic device 100 can display the segmented part of the line Z in the input panel according to The direction from the dividing point to the starting point is removed one by one.
  • the removal speed is determined by the detected frequency of user operations for segment rollback. The higher the frequency of user operations for segment rollback, the more The lower the removal rate.
  • the speed at which the electronic device 100 retracts the line Z may be constant during a time period exceeding the aforementioned preset time.
  • the magnitude of the speed may be determined by the frequency of user operations detected by the electronic device 100 for segment backing.
  • the speed at which the electronic device 100 retracts the line Z may vary within a time period exceeding the aforementioned preset time.
  • the electronic device 100 may adjust the speed of the retraction line in stages within a time period exceeding the aforementioned preset time.
  • step S107 It can be known from step S107 that if a line is abnormally segmented and the user presses the segment back control 215, the electronic device 100 can roll back the line from the end point to the above-mentioned dividing point. If the user still wants to continue to roll back this line, the user can continue to press the segmented rollback control 215 . The electronic device 100 may continue to retreat the line by segment from the above-mentioned dividing point. That is, the user may press the segment rollback control 215 again without stopping the user operation acting on the segment rollback control 215 this time.
  • the electronic device 100 can not only roll back the lines in the input panel by segments, but also adjust the rollback speed during the rollback by segments, so that the user can roll back the lines more conveniently. the desired state.
  • the electronic device 100 can also judge whether there is an abnormal part in the line according to the drawing speed of the line, and estimate the boundary point between the abnormal part and the normal part of a line, so as to quickly roll back to the boundary point between the abnormal part and the normal part during rollback . In this way, the electronic device 100 simplifies the user operation when the user returns the line and improves the user experience by estimating the position where the user expects to return, and directly returning the line to the estimated position when returning.
  • step S103 and steps S105 to S107 shown in FIG. 8 are optional. That is, the electronic device 100 may store the line Z in segments, and perform segment rollback on the line Z according to the method in step S104 when a user operation for performing segment rollback is detected.
  • the embodiment composed of the above step S101 , step S102 and step S104 is the embodiment shown in FIGS. 3A to 3C , 4A to 4C , and 5 .
  • step S104 and step S107 shown in FIG. 8 are optional. That is, when the electronic device 100 determines that the segment where the end point of the line Z is located is an abnormal segment, the line Z may be rolled back according to the methods in steps S105 and S106. Wherein, when it is judged that the segment part where the end point of the line Z is located is not an abnormal segment part, the state of the segment rollback control 215 shown in FIG. ).
  • the embodiment composed of the above-mentioned steps S101 to S106 is the embodiment shown in FIG. 6A , FIG. 6B , and FIG. 7 .
  • the electronic device 100 in response to a user operation on the segment rollback control 215, can roll back a segment portion. In response to a user operation acting on the segment recovery control 215, the electronic device 100 can recover a segment portion that was rolled back.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The present application provides a line rollback method for an input panel and a related apparatus. An electronic device can store a line drawn in an input panel in segmented fashion according to drawing times. When detecting a user operation for segmented rollback, the electronic device can perform segmented rollback on the line in a direction from an end point to a start point of the line. The electronic device can adjust a segmented line rollback speed according to the time length of each user operation for performing the segmented rollback and the frequency of the user operation for performing the segmented rollback. The method can improve the precision of line rollback, so that a user can more conveniently roll back a line to a desired state.

Description

输入面板的线条回退方法及相关装置Line back method and related device for input panel
本申请要求于2021年05月29日提交中国专利局、申请号为202110595997.X、申请名称为“输入面板的线条回退方法及相关装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with the application number 202110595997.X and the application title "The method for line retraction of the input panel and related devices" submitted to the China Patent Office on May 29, 2021, the entire contents of which are incorporated by reference incorporated in this application.
技术领域technical field
本申请涉及终端技术领域,尤其涉及一种输入面板的线条回退方法及相关装置。The present application relates to the field of terminal technologies, and in particular to a method for retracting lines of an input panel and a related device.
背景技术Background technique
目前电子设备中的手写输入法应用、绘图应用等应用均可提供对输入内容的回退和恢复的功能。示例性的,电子设备可以在绘图应用的输入面板中显示多条用户绘制的线条。响应于用于回退的用户操作,电子设备可以根据这多条线条绘制时间的先后顺序,将输入面板中显示的一条或多条线条删除。其中,一条线条的轨迹可以为电子设备在输入面板检测到单次滑动操作的轨迹。即一条线条是由用户一笔完成的线条。At present, applications such as handwriting input method applications and drawing applications in electronic devices can provide functions of returning and restoring input content. Exemplarily, the electronic device may display multiple lines drawn by the user in the input panel of the drawing application. In response to the user operation for going back, the electronic device may delete one or more lines displayed in the input panel according to the sequence of drawing time of the multiple lines. Wherein, the track of a line may 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 the user in one stroke.
可以看出,在上述方法中,电子设备仅支持以条为单位对线条进行回退。即每次回退一条线条。上述回退方法难以将输入面板中的线条回退至用户期望的状态,回退的精度低。例如用户想要回退一条线条中的一部分,就需要通过橡皮擦功能或其它更为复杂的功能进行操作。用户操作繁琐。It can be seen that, in the above method, the electronic device only supports rolling back the lines in units of bars. That is, one line is rolled back at a time. It is difficult to roll back the lines in the input panel to the state desired by the user in the above rollback method, and the rollback accuracy is low. For example, if the user wants to roll back a part of a line, he needs to operate through the eraser function or other more complicated functions. User operations are cumbersome.
发明内容Contents of the invention
本申请提供一种基于输入面板的线条回退方法及相关装置。电子设备可以检测每一次用于进行分段回退的用户操作作用的时间长度、用户进行分段回退的用户操作频率来调整分段回退线条的速度,实现将一条线条的一部分从输入面板移除。该线条回退方法可以提高线条回退的精度,使得用户可以更便捷地将线条回退至自己期望的状态。The present application provides an input panel-based line fallback method and a related device. The electronic device can detect the time length of each user operation for segmental rollback and the frequency of the user's user operation for segmental rollback to adjust the speed of the segmented rollback line, so as to realize a part of a line from the input panel remove. The line rollback method can improve the precision of the line rollback, so that the user can roll back the lines to their desired state more conveniently.
第一方面,本申请实施例提供一种线条回退方法。在该方法中,电子设备在显示屏上显示有第一线条。第一线条是电子设备根据在显示屏上检测到的单次滑动操作的轨迹绘制的。电子设备接收到第一用户操作,第一用户操作可用于触发电子设备对显示在显示屏上的线条按照绘制时间从晚到早的顺序进行分段回退。电子设备可以根据第一用户操作,将第一线条的结束点到第一线条的第一位置的部分从显示屏移除。In the first aspect, the embodiment of the present application provides a method for rolling back lines. In the method, the electronic device displays first lines on the display screen. The first line is drawn by the electronic device according to the trajectory of a single sliding operation detected on the display screen. The electronic device receives the first user operation, and the first user operation may be used to trigger the electronic device to perform a segmented rollback of the lines displayed on the display screen in the order of drawing time from late to early. The electronic device may remove the part from the end point of the first line to the first position of the first line from the display screen according to the first user operation.
通过上述方法,用户可以快速回退一条线条的一部分。这可以提高线条回退的精度,使得用户可以更便捷地将线条回退至自己期望的状态。Through the above method, the user can quickly rewind a part of a line. This can improve the accuracy of line rollback, so that users can roll back the lines to their desired state more conveniently.
结合第一方面,在一些实施例中,第一线条可包括多个分段。这多个分段中的一个分段为第一线条绘制过程中第一时间段内滑动操作的轨迹对应的线条。电子设备根据第一用户操作,将第一线条的结束点到第一线条的第一位置的部分从显示屏移除的具体方法可以为:在第一用户操作开始时,电子设备可按照从第一线条的结束点至第一线条的起始点的方向,以移动步长为一个分段,从第一线条的结束点所在的分段开始,将第一线条的分段从显示屏逐个移除。在第一用户操作结束时,第一线条被分段回退至第一位置。With reference to the first aspect, in some embodiments, the first line may include multiple segments. One of the multiple segments is the line corresponding to the trajectory of the sliding operation within the first time period during the drawing of the first line. The specific method for the electronic device to remove the part from the end point of the first line to the first position of the first line from the display screen according to the first user operation may be as follows: when the first user operation starts, the electronic device may follow the steps from the first The direction from the end point of a line to the start point of the first line, with the moving step as a segment, starts from the segment where the end point of the first line is located, and removes the segments of the first line from the display screen one by one . At the end of the first user operation, the first line is segmented back to the first position.
在一种可能的实现方式中,电子设备可以按照绘制时间对第一线条分段。在第一线条绘 制的过程中,电子设备可以将不同的分段绘制在不同的图层上。上述第一时间段可以为预设分段时间段。绘制有一个分段的图层可具有时间戳。该时间戳可以由这一个分段的绘制时间确定。电子设备可以根据图层的时间戳来确定不同图层上分段的绘制时间的早晚顺序。In a possible implementation manner, 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 aforementioned first time period may be a preset segmented time period. Layers drawn with one segment can have timestamps. The timestamp can be determined from the rendering time of this segment. The electronic device can determine the early and late order of the drawing time of the segments on different layers according to the time stamps of the layers.
电子设备可以将绘制有第一线条的多个分段的多个图层按照绘制时间从早到晚的顺序存入栈中。其中,绘制时间越早的图层存储的位置越靠近栈底。绘制时间越晚的图层存储的位置越靠近栈顶。电子设备可以通过移动指针在栈中所指向的图层来实现对线条的分段回退。指针指向的图层可以为所有绘制内容被显示在输入面板的图层中叠放在最上层的图层。The electronic device may store the multiple layers of the multiple segments drawn with the first line into the stack in order of drawing time from early to late. Among them, the storage position of the layer with the earlier drawing time is closer to the bottom of the stack. Layers with a later drawing time are stored closer to the top of the stack. The electronic device can realize segmental regression of the line by moving the layer pointed to by the pointer in the stack. The layer pointed to by the pointer can be displayed as the uppermost layer among the layers in the input panel for all drawing content.
输入面板可用于用户进行输入,并显示用户输入的内容。在一些实施例中,在运行绘图应用、手写输入应用、文档编辑应用等应用时,电子设备的显示屏可包括上述输入面板。在输入面板中显示的内容即为在电子设备的显示屏上显示的内容。The input panel can be used for user input and displays the content entered by the user. In some embodiments, when applications such as drawing applications, handwriting input applications, and document editing applications are running, the display screen of the electronic device may include the above-mentioned input panel. The content displayed on the input panel is the content displayed on the display screen of the electronic device.
在上述电子设备按照从第一线条的结束点至第一线条的起始点的方向,以移动步长为一个分段,从第一线条的结束点所在的分段开始,将第一线条的分段从显示屏逐个移除的过程中,电子设备可以按照从存储有第一线条的分段的栈的栈顶至栈底的方向,以移动步长为一个图层,从位于栈顶的图层开始,移动指针的位置。在第一用户操作结束时,指针被移动至栈中上述第一位置对应的图层处。In the above-mentioned electronic device, according to the direction from the end point of the first line to the starting point of the first line, the moving step is taken as a segment, starting from the segment where the end point of the first line is, and dividing the segment of the first line During the process of removing the segments from the display screen one by one, the electronic device can follow the direction from the top of the stack of segments storing the first line to the bottom of the stack, with the moving step as one layer, from the image at the top of the stack to layer starts, move the position of the pointer. When the first user operation ends, the pointer is moved to the layer corresponding to the first position in the stack.
由上述方法可知,电子设备可以以一条线条的一个分段为单位对线条进行分段回退。在第一用户操作持续的时间内,用户可以在显示屏上看到线条逐渐往自己期望回退的位置回退。当达到自己期望回退的位置,用户可以结束第一用户操作。上述方法不仅用户操作简便,而且可以提高线条回退的精度。用户可以更便捷地将线条回退至自己期望的状态。It can be seen from the above method that the electronic device can perform a segmentation rollback on a line by using a segment of a line as a unit. During the duration of the first user operation, the user can see on the display screen that the line gradually recedes to the desired position. When reaching the desired return position, 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. Users can return the lines to their desired state more conveniently.
结合第一方面,在一些实施例中,第一用户操作的持续时间为第二时间段。在第二时间段内,第一线条的结束点到第一线条的第一位置的部分从显示屏被移除的速度为第一速度。With reference to the first aspect, in some embodiments, the duration of the first user operation is the second time period. During the second time period, the speed at which the part from the end point of the first line to the first position of the first line is removed from the display screen is the first speed.
可选的,在另一些实施例中,在第二时间段内,第一线条的结束点到第一线条的第一位置的部分从显示屏被移除的速度是变化的。其中,第二时间段包括d1个时间区间,d1个时间区间中被移除的速度的大小按照时间的先后顺序排列是呈现增大趋势的。第一时间区间中被移除的速度可以为第一速度。第一时间区间是d1个时间区间中按时间的先后顺序排列在第一位的时间区间。Optionally, in some other embodiments, within 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. Wherein, the second time period includes d1 time intervals, and the magnitudes of the removed speeds in the d1 time intervals show an increasing trend according to the order of time. The speed removed in the first time interval may be the first speed. The first time interval is the first time interval in the order of time among the d1 time intervals.
可以理解的,第一用户操作的持续时间越长可以说明需要回退的分段部分较多,且线条当前回退的位置与用户期望的位置之间的距离仍然比较大。电子设备可以逐渐增大上述第二时间段内分段回退线条的速度,以提高回退的效率。It can be understood that the longer the duration of the first user operation may indicate that there are more segments that 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 may gradually increase the speed of the segmented retraction line within the above-mentioned second time period, so as to improve the efficiency of retraction.
结合第一方面,在一些实施例中,第一用户操作是一次作用在第一控件上的用户操作。电子设备确定在接收到第一用户操作之前的第三时间段内,还接收到a1次作用在第一控件上的用户操作。电子设备可以根据a1的大小以及a1个分段回退线条的速度中的一个或多个确定上述第一速度。a1个分段回退线条的速度分别为a1次作用在第一控件上的用户操作作用时间段内,电子设备从显示屏移除线条的速度。a1越大,上述第一速度越慢。上述第一速度低于a1个分段回退线条的速度中的一个或多个。With reference to the first aspect, in some embodiments, the first user operation is a user operation on the first control. The electronic device determines that within a third time period before receiving the first user operation, a1 user operations on the first control are also received. The electronic device may determine the above-mentioned first speed according to one or more of the size of a1 and the speeds of the a1 segmented retraction lines. The speeds of the a1 segmented retraction lines are respectively the speeds at which the electronic device removes the lines from the display screen within the time period of the a1 user operations 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 the a1 segmented retraction lines.
上述第一控件可以是分段回退控件。第一控件也可以具有其它的名字。作用在第一控件上的用户操作可以触发电子设备对显示在显示屏上的线条按照绘制时间从晚到早的顺序进行分段回退。The above-mentioned first control may be a segment rollback control. The first control can also have other names. A user operation acting on the first control may trigger the electronic device to backtrack the lines displayed on the display screen in order of drawing time from late to early.
可以理解的,在电子设备可以对一条线条进行分段回退的情况下,若用户想要删除一条线条的一部分,用户可以按下分段回退控件。其中,在远离用户期望的位置时,用户通常会长按分段回退控件。在接近用户期望的位置时,用户通常会间断短按分段回退控件,直至电 子设备将线条回退至自己期望的位置。It can be understood that, in the case that the electronic device can roll back a line in segments, if the user wants to delete a part of a line, the user can press the roll back control in segments. Among them, when the user is away from the user's expected position, the user usually long presses the segmented fallback control. When approaching the desired position of the user, the user usually intermittently presses the segmented return control until the electronic device returns the line to the desired position.
那么,在一段时间内(如上述第三时间段内),电子设备检测到作用在第一控件上的频率越高(即a1越大),第一线条当前回退的位置与用户期望的位置越接近。电子设备可以在上述a1个分段回退线条的速度中的一个或多个的基础上,降低第一用户操作作用时间段内分段回退线条的速度或分段回退线条的初始速度(即第一速度)。这样可以尽量避免第一速度过快而导致回退的分段部分过多。Then, within a period of time (such as within the third period of time), the electronic device detects that the frequency of acting on the first control is higher (that is, the greater a1 is), the current retreat position of the first line is different from the position expected by the user. the closer. The electronic device may, on the basis of one or more of the speeds of the a1 segmented retraction lines, reduce the speed of the segmented retraction line or the initial speed of the segmented retraction line within the first user operation action time period ( i.e. first speed). In this way, it is possible to avoid too many subsections that are rolled back due to the first speed being too fast.
结合第一方面,在一些实施例中,电子设备在显示屏上还显示有第二线条。第二线条是电子设备根据在显示屏上检测到的单次滑动操作的轨迹绘制的。第二线条的绘制时间早于第一线条的绘制时间。第二线条可包括多个分段。这多个分段为第二线条绘制过程中第一时间段内滑动操作的轨迹对应的线条。第一用户操作是一次作用在第一控件上的用户操作。电子设备将第一线条的结束点到第一线条的第一位置的部分从显示屏移除之后还接收到作用在第一控件上的第二用户操作。在第二用户操作作用在第一控件的时间段内,电子设备可按照从第一位置至第一线条的起始点的方向,以移动步长为一个分段,从第一位置开始,将第一线条的分段从显示屏逐个移除。若第一线条的分段全部从显示屏移除,电子设备按照从第二线条的结束点至第二线条的起始点的方向,以移动步长为一个分段,从第二线条的结束点开始,将第二线条的分段从显示屏逐个移除。With reference to the first aspect, in some embodiments, the electronic device further displays second lines 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. The multiple segments are lines corresponding to the track of the sliding operation in the first time period during the drawing of the second line. The first user operation is a user operation on the first control. After the electronic device removes the part 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 acting on the first control. During the period of time when the second user operation acts on the first control, the electronic device can start from the first position and move the Segments of a line are removed one by one from the display. If all segments of the first line are removed from the display screen, the electronic device moves from the end point of the second line to the start point of the second line, with the moving step as a segment, and from the end point of the second line First, the segments of the second line are removed from the display one by one.
电子设备在第二用户操作作用的时间段内分段回退线条的速度可以根据上述第一速度确定(例如为第一速度的60%)。其中,电子设备在第二用户操作作用的时间段内分段回退线条的速度可以是恒定的。可选的,电子设备在第二用户操作作用的时间段内分段回退线条的速度是变化的(例如是逐渐增大的)。其中,电子设备在第二用户操作作用的时间段内分段回退线条的初始速度可以根据上述第一速度确定(例如为第一速度的60%)。The speed at which the electronic device retracts the line by segment during the time period when the second user operation is active may be determined according to the above-mentioned first speed (for example, it is 60% of the first speed). Wherein, the speed at which the electronic device retracts the line by segment during the time period when the second user operates may be constant. Optionally, the electronic device changes (for example gradually increases) the speed of the segmented retraction line during the time period of the second user operation. Wherein, the initial speed of the segmented retreat line of the electronic device during the time period of the second user operation may be determined according to the above-mentioned first speed (for example, it is 60% of the first speed).
由上述实施例可知,电子设备可以按照绘制时间对多条线条进行分段,并存储多条线条的分段。用户可以通过作用在第一控件上的用户操作实现对这多条线条进行分段回退。It can be known from the foregoing embodiments that the electronic device may segment the multiple lines according to the drawing time, and store the segments of the multiple lines. The user can realize segmental rollback of the multiple lines through user operations acting on the first control.
结合第一方面,在一些实施例中,第一线条可包括多个分段。这多个分段中的一个分段为第一线条绘制过程中第一时间段内滑动操作的轨迹对应的线条。电子设备将第一线条的结束点到第一线条的第一位置的部分从显示屏移除之前,可以计算这多个分段的绘制速度。其中,一个分段的绘制速度可以根据第一个分段的长度和第二时间段内的长度确定。电子设备可以根据一个分段的绘制速度判断一个分段是异常分段还是正常分段。异常分段是绘制速度高于第一阈值的分段。正常分段是绘制速度不高于第一阈值的分段。若确定出第一线条的结束点所在的分段为异常分段,电子设备可确定第一位置。第一位置是第一线条中从第一线条的结束点至第一线条的起始点方向上第一个异常分段与正常分段的交点。With reference to the first aspect, in some embodiments, the first line may include multiple segments. One of the multiple segments is the line corresponding to the trajectory of the sliding operation within the first time period during the drawing of the first line. Before the electronic device removes the part from the end point of the first line to the first position of the first line from the display screen, it may calculate the drawing speeds of the plurality of segments. Wherein, the drawing speed of a segment can be determined according to the length of the first segment and the length in the second time period. The electronic device can determine whether a segment is an abnormal segment or a normal segment according to the drawing speed of a segment. Anomalous segments are segments whose rendering speed is above a first threshold. A normal segment is a segment whose rendering 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 may determine the first position. The first position is the intersection of the first abnormal segment and the normal segment in the direction from the end point of the first line to the start point of the first line in the first line.
在一种可能的实现方式中,电子设备可以利用聚类算法,根据一个分段的绘制速度对第一条线的多个分段进行聚类。电子设备可以将第一线条的多个分段划分为多个类别。这多个类别中,一个类别包含一个聚类中心。电子设备可以判断聚类中心的绘制速度是否高于上述第一阈值。若聚类中心的绘制速度高于上述第一阈值,电子设备可以确定这一个聚类中心所属的类别包括的分段均为异常分段。否则,一个类别包含的分段均为正常分段。In a possible implementation manner, the electronic device may use a clustering algorithm to cluster multiple segments of the first line according to a drawing speed of a segment. The electronic device may divide the plurality of segments of the first line into a plurality of categories. Among the multiple categories, one category contains one 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 contained in a category are all normal segments.
当确定了上述第一位置,电子设备将第一线条的结束点到第一线条的第一位置从显示屏移除的方法具体可以为:电子设备可以将第一线条中从结束点到第一位置之间的所有分段同时从显示屏移除。When the above-mentioned first position is determined, the method for the electronic device to remove the end point of the first line to the first position of the first line from the display screen may specifically be: the electronic device may remove the first line from the end point to the first position of the first line All segments between the positions are simultaneously removed from the display.
由上述方法可知,电子设备可以根据一条线条中各分段部分的绘制速度估计用户在哪一个时刻受到外力影响,导致这一条线条的一部分偏离用户预期的轨迹。其中,受到外力影响 而绘制的分段,绘制速度远高于正常绘制过程中(即未受到外力影响的绘制过程)分段的绘制速度。当估计出分界点(即上述第一位置),电子设备可以响应用于进行分段回退的用户操作,在输入面板中移除异常分段部分。电子设备未将整条线条从输入面板移除。当上述异常分段部分被移除,用户可以继续从分界点处进行绘制。上述方法用户操作简便,而且可以快速地将输入面板中的线条回退至用户期望的状态,提高了用户的使用体验。It can be seen from the above method that the electronic device can estimate at which moment the user is affected by an external force based on the drawing speed of each segment 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 under the influence of external force is much higher than the drawing speed of the segment in the normal drawing process (that is, the drawing process not affected by the external force). When the demarcation point (that is, the above-mentioned first position) is estimated, the electronic device may respond to a user operation for segment rollback, and remove the abnormal segment part in the input panel. The electronics did not remove the entire line from the input panel. When the above abnormal segment 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 return the lines in the input panel to the desired state of the user, thereby improving the user experience.
在一种可能的实现方式中,第一用户操作的持续时间为第二时间段。电子设备可以判断第二时间段的长度是否超过第二阈值。若第二时间段的长度超过第二阈值,在第二时间段内超过第二阈值的时间段内,电子设备可以按照从第一位置至第一线条的起始点的方向,以移动步长为一个分段,以移动速度为第二速度,从第一位置开始,将第一线条的分段从显示屏逐个移除。In a possible implementation manner, the duration of the first user operation is the 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, during the time period exceeding the second threshold in the second time period, the electronic device may move in a step size of A segment, with the moving speed as the second speed, removes the segments of the first line from the display one by one, starting from the first position.
在上述第二时间段内超过第二阈值的时间段内,电子设备分段回退线条的速度可以是变化的。其中,第二速度可以在上述第二时间段内超过第二阈值的时间段内的初始速度。在第二时间段内超过第二阈值的时间段内,电子设备可以在第二速度的基础上,逐渐增加分段回退线条的速度。During the time period exceeding the second threshold within the above-mentioned second time period, the speed at which the electronic device retracts the lines segment by segment may vary. Wherein, the second speed may exceed the initial speed within the time period of the second threshold within the above-mentioned second time period. During the time period when the second time period exceeds the second threshold, the electronic device may gradually increase the speed of the segmented retraction line on the basis of the second speed.
可以理解的,第一用户操作持续的第二时间段超过第二阈值可以表示上述电子设备确定的分界点还未达到用户期望回退的位置。在第二时间段内超过第二阈值的时间段内,电子设备可以从上述第一位置处继续对第一线条进行分段回退,以便于回退至用户期望回退的位置。It can be understood that the second time period in which the first user operation continues exceeds the second threshold may indicate that the cut-off point determined by the electronic device has not yet reached the position where the user expects to fall back. During the period of time exceeding the second threshold within the second period of time, the electronic device may continue to return the first line segmentally from the above-mentioned first position, so as to return to a position desired by the user.
在一种可能的实现方式中,若电子设备确定出第一线条的结束点所在的分段不是异常分段,电子设备将第一线条的结束点到第一线条的第一位置的部分从显示屏移除的具体方法可以为:电子设备可按照从第一线条的结束点至第一线条的起始点的方向,以移动步长为一个分段,从第一线条的结束点所在的分段开始,将第一线条的分段从显示屏逐个移除。在第一用户操作结束时,第一线条被分段回退至第一位置。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 electronic device displays the part from the end point of the first line to the first position of the first line The specific method of removing the screen can be as follows: the electronic device can move from the end point of the first line to the starting point of the first line, and use the moving step as a segment, and start from the segment where the end point of the first line is located. To start, the segments of the first line are removed from the display one by one. At the end of the first user operation, the first line is segmented back to the first position.
结合第一方面,在一些实施例中,电子设备将第一线条的结束点到第一线条的第一位置的部分从显示屏移除之后,还接收到第三用户操作。第三用户操作可用于触发电子设备对被回退且未被恢复的线条按照回退时间从晚到早的顺序进行分段恢复。电子设备可根据第三用户操作,将第一位置到第一线条的第二位置的部分显示在显示屏上。第二位置位于第一位置与第一线条的结束点之间。With reference to the first aspect, in some embodiments, after the electronic device removes the part from the end point of the first line to the first position of the first line from the display screen, it further receives a third user operation. The third user operation may be used to trigger the electronic device to recover the lines that have been rolled back but not recovered by segment in the order of the rollback time from late to early. The electronic device may display the part from the first position to the second position of the first line on the display screen according to the third user operation. The second location is between the first location and the end point of the first line.
由上述实施例可知,电子设备可以分段恢复已经被回退的线条。这可以便于用户在不小心回退过多的情况下,恢复被回退的部分。上述分段恢复线条的方法可以更好地帮助用户将线条回退至用户期望的状态。It can be known from the above embodiments that the electronic device can recover the retracted lines segment by segment. This can make it easier for the user to recover the rolled back part if they accidentally roll back too much. The method for recovering the line by segment can better help the user return the line to the state expected by the user.
在一种可能的实现方式中,第一线条可包括多个分段。这多个分段中的一个分段为第一线条绘制过程中第一时间段内滑动操作的轨迹对应的线条。电子设备根据第三用户操作,将第一位置到第一线条的第二位置的部分显示在显示屏上的具体方法可以为:在第三用户操作开始时,电子设备按照从第一位置至第一线条的结束点的方向,以移动步长为一个分段,从第一位置开始,将第一线条中已从显示屏移除的分段逐个显示在显示屏上。在第三用户操作结束时,第一线条被分段恢复至第二位置。In a possible implementation manner, the first line may include multiple segments. One of the multiple segments is the line corresponding to the trajectory of the sliding operation within the first time period during the drawing of the first line. The specific method for the electronic device to display the part from the first position to the second position of the first line on the display screen according to the third user operation may be as follows: when the third user operation starts, the electronic device follows the steps from the first position to the second position. The direction of the end point of a line. The moving step is a segment. Starting from the first position, the segments removed from the display screen in the first line are displayed on the display screen one by one. At the end of the third user operation, the first line is segmented back to the second position.
第三用户操作的持续时间为第四时间段。在一种可能的实现方式中,在第四时间段内,第一位置到第一线条的第二位置的部分分段恢复的速度可以为第三速度。The duration of the third user operation is the fourth time period. In a possible implementation manner, within the fourth time period, the partial segmental restoration speed from the first position to the second position of the first line may be the third speed.
在另一种可能的实现方式中,在第四时间段内,第一位置到第一线条的第二位置的部分分段恢复的速度是变化的。其中,第四时间段包括d2个时间区间。d2个时间区间中分段恢复的速度的大小按照时间的先后顺序排列是呈现增大趋势的。第二时间区间中分段恢复的速 度为第三速度。第二时间区间是d2个时间区间中按时间的先后顺序排列在第一位的时间区间。In another possible implementation manner, within the fourth time period, the speed of partial segment recovery from the first position to the second position of the first line changes. Wherein, the fourth time period includes d2 time intervals. The speed of subsection recovery in the d2 time intervals shows an increasing trend according to the order of time. The speed of segment recovery in the second time interval is the third speed. The second time interval is the first time interval in the order of time among the d2 time intervals.
可以理解的,第三用户操作的持续时间越长可以说明需要恢复的分段部分较多,且线条当前恢复的位置与用户期望的位置之间的距离仍然比较大。电子设备可以逐渐增大在第四时间段内分段恢复线条的速度,以提高恢复的效率。It can be understood that the longer the duration of the third user operation may indicate that more segments need to be restored, and the distance between the currently restored position of the line and the user's expected position is still relatively large. The electronic device may gradually increase the speed of recovering the lines in segments within the fourth time period, so as to improve the recovery efficiency.
在一种可能的实现方式中,第三用户操作是一次作用在第二控件上的用户操作。电子设备确定在接收到第三用户操作之前的第五时间段内,还接收到a2次作用在第二控件上的用户操作。电子设备可以根据a2的大小以及a2个分段恢复线条的速度中的一个或多个确定第三速度。a2个分段恢复线条的速度分别为a2次作用在第二控件上的用户操作作用时间段内,电子设备分段恢复线条的速度。a2越大,第三速度越慢。第三速度低于a2个分段恢复线条的速度中的一个或多个。In a possible implementation manner, the third user operation is a user operation that acts on the second control. The electronic device determines that within the fifth time period before receiving the third user operation, a2 user operations on the second control are also received. The electronic device may determine the third speed according to one or more of the size of a2 and the speeds of the a2 segment recovery lines. The speeds of the a2 segments to restore the lines are respectively the speeds of the electronic device to restore the lines in segments within the time period of the a2 user operations acting on the second control. The bigger a2 is, the slower the third speed is. The third speed is lower than one or more of the speeds of the a2 segment recovery lines.
第二控件可以是分段恢复控件。第二控件也可以具有其它的名字。作用在第二控件上的用户操作可以触发电子设备对被回退且未被恢复的线条按照回退时间从晚到早的顺序进行分段恢复。The second control may be a segment recovery control. The second control can also have other names. A user operation acting on the second control may trigger the electronic device to restore the lines that have been rolled back but not restored by segment according to the order of the rollback time from late to early.
可以理解的,在远离用户期望恢复的位置时,用户通常会长按分段恢复控件。在接近用户期望恢复的位置时,用户通常会间断短按分段恢复控件,直至电子设备将线条恢复至自己期望恢复的位置。那么,在一段时间内(如上述第五时间段内),电子设备检测到作用在第二控件上的频率越高(即a2越大),第一线条当前恢复的位置与用户期望的位置越接近。电子设备可以在上述a2个分段恢复线条的速度中的一个或多个的基础上,降低第三用户操作作用时间段内分段回退线条的速度或回退线条的初始速度(即第三速度)。这样可以尽量避免第三速度过快而导致恢复的分段部分过多。It is understandable that when the user is away from the location where the user expects to restore, the user usually long presses the segment restore control. When approaching the position that the user expects to restore, the user usually short-presses the segment restoration control intermittently until the electronic device restores the line to the position that the user expects to restore. Then, within a period of time (such as the fifth period of time), the electronic device detects that the frequency of acting on the second control is higher (that is, the greater a2 is), the more the current restored position of the first line is compared with the user's expected position. near. On the basis of one or more of the speeds of the above-mentioned a2 segmented recovery lines, the electronic device can reduce the speed of the segmented back line or the initial speed of the back line during the third user operation action time period (that is, the third speed). In this way, the third speed can be avoided as much as possible, resulting in too many segments to be recovered.
由上述实现方式可知,电子设备可以通过检测每一次作用在第二控件的用户操作的持续时间、作用在第二控件的用户操作的频率,来调整分段恢复线条的速度。这可以提高线条分段恢复的效率,使得用户可以更便捷地将线条回退至自己期望的状态。It can be known from the above implementation manner that the electronic device can adjust the speed of the segmented recovery line by detecting the duration of each user operation on the second control and the frequency of the user operation on the second control. This can improve the efficiency of line segmentation recovery, so that users can return the lines to their desired state more conveniently.
结合第一方面,在一些实施例中,在第一用户操作之前,第三线条的所有分段均从显示屏上移除。第三线条是电子设备根据在显示屏上检测到的单次滑动操作的轨迹绘制的。第三线条的绘制时间晚于第一线条的绘制时间。第三线条可包括多个分段。这多个分段为第三线条绘制过程中第一时间段内滑动操作的轨迹对应的线条。第三线条的回退时间早于第一线条的回退时间。第三用户操作是一次作用在第二控件上的用户操作。电子设备将上述第一位置到第一线条的第二位置的部分显示在显示屏上之后,还接收到作用在第二控件上的第四用户操作。在第四用户操作作用在第二控件的时间段内,电子设备可以按照从第二位置至第一线条的结束点的方向,以移动步长为一个分段,从第二位置开始,将第一线条中已从显示屏移除的分段逐个显示在显示屏上。若第一线条中已从显示屏移除的分段全部显示在显示屏上,电子设备按照从第三线条的起始点至第三线条的结束点的方向,以移动步长为一个分段,从第三线条的起始点开始,将第三线条中已从显示屏移除的分段逐个显示在显示屏上。With reference to the first aspect, in some embodiments, all segments of the third line are removed from the display screen before the first user operation. The third line is drawn by the electronic device according to the trajectory of a single sliding operation detected on the display screen. The third line is drawn later than the first line. The third line may include multiple segments. These multiple segments are lines corresponding to the track of the sliding operation in the first time period during the drawing process of the third line. The fallback time of the third line is earlier than the fallback 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 start from the second position and move the first line in the direction from the second position to the end point of the first line. The segments of a line that have been removed from the display are shown on the display one by one. If all segments that have been removed from the display screen in the first line are displayed on the display screen, the electronic device uses the moving step as a segment in the direction from the starting point of the third line to the end point of the third line, Starting from the starting point of the third line, the segments removed from the display screen in the third line are displayed on the display screen one by one.
电子设备在第四用户操作作用的时间段内分段恢复线条的速度可以根据上述第三速度确定(例如为第三速度的60%)。其中,电子设备在第二用户操作作用的时间段内分段恢复线条的速度可以是恒定的。可选的,电子设备在第四用户操作作用的时间段内分段恢复线条的速度是变化的(例如是逐渐增大的)。其中,电子设备在第四用户操作作用的时间段内分段恢复线条的初始速度可以根据上述第三速度确定(例如为第三速度的60%)。The speed at which the electronic device restores the line by segment during the time period when the fourth user operation is active may be determined according to the above-mentioned third speed (for example, it is 60% of the third speed). Wherein, the speed at which the electronic device restores the lines by segment during the time period of the second user operation may be constant. Optionally, the speed at which the electronic device restores the line segment by segment changes (for example, gradually increases) within the time period when the fourth user operation is active. Wherein, the initial speed at which the electronic device restores the lines segmentally during the fourth user operation period may be determined according to the above third speed (for example, it is 60% of the third speed).
由上述实施例可知,经过分段回退的用户操作,线条的一部分从显示屏移除后。电子设 备中仍可存储上述线条中从显示屏移除的一部分对应的分段。当接收到用于分段恢复用户操作,电子设备可以将被恢复的内容再次显示在显示屏上。并且,用户可以通过作用在上述第二控件上的用户操作实现对多条线条进行分段恢复。这可以便于用户在不小心回退过多的情况下,恢复被回退的部分。上述分段恢复线条的方法可以更好地帮助用户将线条回退至用户期望的状态。It can be known from the above embodiments that after a segmented back user operation, a part of the line is removed from the display screen. The segment corresponding to the portion of the line removed from the display screen can still be stored in the electronic device. When receiving a user operation for segment restoration, the electronic device may display the restored content on the display screen again. In addition, the user can restore segments of multiple lines through user operations acting on the above-mentioned second control. This can make it easier for the user to recover the rolled back part if they accidentally roll back too much. The method for recovering the line by segment can better help the user return the line to the state expected by the user.
第二方面,本申请实施例提供一种电子设备。该电子设备包括显示屏、存储器、处理器,存储器用于存储计算机程序,处理器用于调用计算机程序,使得电子设备执行如第一方面中任一可能的实现方式。In a second aspect, the embodiment of the present application provides an electronic device. The electronic device includes a display screen, a memory, and a processor. 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 manner in the first aspect.
第三方面,本申请提供一种芯片,该芯片应用于电子设备,该芯片包括一个或多个处理器,该处理器用于调用计算机指令以使得该电子设备执行如第一方面中任一可能的实现方式。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 invoke computer instructions so that the electronic device executes any possible method in the first aspect. Method to realize.
第四方面,本申请提供一种包含指令的计算机程序产品,其特征在于,当上述计算机程序产品在电子设备上运行时,使得该电子设备执行如第一方面中任一可能的实现方式。In a fourth aspect, the present application provides a computer program product including instructions, which is characterized in that, when the computer program product is run on an electronic device, the electronic device is made to execute any possible implementation manner in the first aspect.
第五方面,本申请提供一种计算机可读存储介质,包括指令,其特征在于,当上述指令在电子设备上运行时,使得该电子设备执行如第一方面中任一可能的实现方式。In a fifth aspect, the present application provides a computer-readable storage medium, including instructions, wherein, when the above-mentioned instructions are run on an electronic device, the electronic device is made to execute any possible implementation manner in the first aspect.
可以理解地,上述第二方面提供的电子设备、第三方面提供的芯片、第四方面提供的计算机程序产品和第五方面提供的计算机可读存储介质均用于执行本申请实施例所提供的方法。因此,其所能达到的有益效果可参考对应方法中的有益效果,此处不再赘述。It can be understood that the electronic device provided in the second aspect above, 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. Therefore, the beneficial effects that it can achieve can refer to the beneficial effects in the corresponding method, and will not be repeated here.
附图说明Description of drawings
图1A~图1C是本申请实施例提供的一些线条回退的场景示意图;Figures 1A to 1C are schematic diagrams of scenes of some line rollback provided by the embodiment of the present application;
图2是本申请实施例提供的一种电子设备100的结构示意图;FIG. 2 is a schematic structural diagram of an electronic device 100 provided in an embodiment of the present application;
图3A~图3C是本申请实施例提供的另一些线条回退的场景示意图;Fig. 3A to Fig. 3C are schematic diagrams of other scenes of line rollback provided by the embodiment of the present application;
图4A~图4C是本申请实施例提供的另一些线条回退的场景示意图;Figures 4A to 4C are schematic diagrams of other scenes of line rollback provided by the embodiment of the present application;
图5是本申请实施例提供的电子设备100对线条进行分段存储的示意图;FIG. 5 is a schematic diagram of segmented storage of lines by the electronic device 100 provided by the embodiment of the present application;
图6A和图6B是本申请实施例提供的另一些线条回退的场景示意图;FIG. 6A and FIG. 6B are schematic diagrams of other scenes of line rollback provided by the embodiment of the present application;
图7是本申请实施例提供的电子设备100对线条进行分段存储的示意图;FIG. 7 is a schematic diagram of segmented storage of lines by the electronic device 100 provided by the embodiment of the present application;
图8是本申请实施例提供的一种线条回退方法的流程图。FIG. 8 is a flow chart of a method for rolling back lines provided by an embodiment of the present application.
具体实施方式Detailed ways
下面将结合附图对本申请实施例中的技术方案进行清楚、详尽地描述。其中,在本申请实施例的描述中,除非另有说明,“/”表示或的意思,例如,A/B可以表示A或B;文本中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况,另外,在本申请实施例的描述中,“多个”是指两个或多于两个。The technical solutions in the embodiments of the present application will be described clearly and in detail below in conjunction with the accompanying drawings. Among them, in the description of the embodiments of this application, unless otherwise specified, "/" means or means, for example, A/B can mean A or B; "and/or" in the text is only a description of associated objects The association relationship indicates that there may be three kinds of relationships, for example, A and/or B, which may indicate: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiment of the present application , "plurality" means two or more than two.
以下,术语“第一”、“第二”仅用于描述目的,而不能理解为暗示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征,在本申请实施例的描述中,除非另有说明,“多个”的含义是两个或两个以上。Hereinafter, the terms "first" and "second" are used for descriptive purposes only, and cannot be understood as implying or implying relative importance or implicitly specifying the quantity of indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of these features. In the description of the embodiments of the present application, unless otherwise specified, the "multiple" The meaning is two or more.
图1A~图1C示例性示出了本申请实施例提供的一种线条回退的场景示意图。FIG. 1A to FIG. 1C exemplarily show a scene schematic diagram of a line retreat provided by an embodiment of the present application.
电子设备100可以打开绘图应用,并显示如图1A所示的用户界面210。用户界面210可包括画笔控件211、橡皮擦控件212、回退控件213、恢复控件214、保存控件217和输入面板218。其中:The electronic device 100 can open the drawing application and display the user interface 210 as shown in FIG. 1A . User interface 210 may include a brush control 211 , an eraser control 212 , a rollback control 213 , a redo control 214 , a save control 217 , and an input panel 218 . in:
输入面板218可用于用户进行输入,并显示用户输入的内容。其中,用户输入的内容可以是文字、图画等等。用户输入的内容均可由一条或多条线条组成。一条线条的轨迹可以为电子设备在输入面板检测到单次滑动操作的轨迹。即一条线条是由用户一笔完成的线条。作用在输入面板的滑动操作可以是用户手指或手写笔在电子设备100显示屏上的滑动操作。本申请实施例对电子设备100检测上述滑动操作的方法不作限定。在一种可能的实现方式中,电子设备100可以确定一次滑动操作开始所在位置的像素点和结束所在位置的像素点。开始所在位置的像素点与结束所在位置的像素点之间的滑动轨迹所形成的线条即为一条线条。The input panel 218 can be used for the user to input and display the content input by the user. Wherein, the content input by the user may be text, picture and so on. The content entered by the user can consist of one or more lines. The trace of a line may be the trace 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 may 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 manner, the electronic device 100 may determine a pixel point where a sliding operation starts and a pixel point where a sliding operation ends. The line formed by the sliding track between the pixel point at the start position and the pixel point at the end position is a line.
示例性的,图1A所示的输入面板218中包含有两条线条:线条218A和线条218B。其中,线条218A的绘制时间早于线条218B的绘制时间。Exemplarily, the input panel 218 shown in FIG. 1A includes two lines: a line 218A and a line 218B. Wherein, the drawing time of the line 218A is earlier than the drawing time of the line 218B.
画笔控件211可用于触发电子设备100进入线条输入功能,以及对“虚拟画笔”的粗细、颜色等属性进行调节。在一些实施例中,上述“虚拟画笔”可以在用户界面210中以圆点、箭头、画笔等等图标呈现。“虚拟画笔”在输入面板的滑动轨迹可以形成线条。上述线条输入功能为在输入面板218进行输入的功能。例如,响应于作用在画笔控件211的用户操作,电子设备100可以根据在输入面板218中检测到的滑动操作显示与滑动操作的轨迹对应的线条。“虚拟画笔”越粗,“虚拟画笔”在输入面板滑动所形成的线条越粗。“虚拟画笔”的颜色为黑色,则“虚拟画笔”在输入面板滑动所形成的线条的颜色为黑色。The paintbrush control 211 can be used to trigger the electronic device 100 to enter the line input function, and to adjust attributes such as thickness and color of the "virtual paintbrush". In some embodiments, the above-mentioned "virtual paintbrush" may be presented in the user interface 210 as icons such as dots, arrows, paintbrush, and the like. The sliding track of the "virtual paintbrush" on the input panel can form lines. The line input function described above is a function for inputting on the input panel 218 . For example, in response to a user operation acting on the brush control 211 , the electronic device 100 may display a line corresponding to a 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 sliding the "virtual brush" on the input panel. The color of the "virtual paintbrush" is black, and the color of the lines formed by sliding the "virtual paintbrush" on the input panel is black.
橡皮擦控件212可用于触发电子设备100进入擦除功能,以及对“虚拟橡皮擦”的大小等属性进行调节。上述擦除功能为擦除输入面板218中显示的线条的功能。例如,响应于作用在橡皮擦控件212的用户操作,电子设备100可以根据在输入面板218检测到的滑动操作将在该滑动操作的轨迹上内容擦除。被擦除的内容被取消显示在输入面板218上。“虚拟橡皮擦”越大,电子设备100根据“虚拟橡皮擦”在输入面板滑动的轨迹擦除的内容越多。The eraser control 212 can be used to trigger the electronic device 100 to enter the erasing function, and to adjust attributes such as the size of the "virtual eraser". The above-mentioned eraser function is a function to erase lines displayed on the input panel 218 . For example, in response to a user operation acting on the eraser control 212 , the electronic device 100 can erase content on the track of the sliding operation detected on the input panel 218 according to the sliding operation. The erased content is canceled and displayed on the input panel 218 . The larger the "virtual eraser", the more content erased by the electronic device 100 according to the sliding track of the "virtual eraser" on the input panel.
回退控件213可用于触发电子设备100回退输入面板218中显示的线条。其中,电子设备100可以根据绘制时间从晚到早的顺序来回退输入面板210中显示的线条。示例性的,输入面板218中包括图1A所示的线条218A和线条218B。线条218A的绘制时间早于线条218B的绘制时间。响应于一次作用在回退控件213的用户操作,电子设备100可以将输入面板218中显示的线条回退至线条218B的前一条线条被绘制之后,线条218B被绘制之前的状态。电子设备100可以显示如图1B所示用户界面210。其中,电子设备100将线条218B从输入面板218中移除。图1B所示的输入面板中仅包含线条218A。The rollback control 213 can be used to trigger the electronic device 100 to roll back the lines displayed in the input panel 218 . Wherein, the electronic device 100 may roll back the lines displayed on the input panel 210 according to the sequence of drawing time from late to early. Exemplarily, the input panel 218 includes a line 218A and a line 218B shown in FIG. 1A . Line 218A was drawn earlier than line 218B. In response to a user operation acting on the rollback control 213 , the electronic device 100 can roll back the lines displayed in the input panel 218 to the state before the line 218B is drawn after the previous line of the line 218B is drawn. The electronic device 100 may display a user interface 210 as shown in FIG. 1B . Wherein, the electronic device 100 removes the line 218B from the input panel 218 . Only line 218A is included in the input panel shown in FIG. 1B .
上述一次作用在回退控件213的用户操作可以为用户开始触碰回退控件213到停止触碰回退控件213这一连续时间段的用户操作。电子设备100可以将在触控面板检测到的作用在回退控件213上持续一段时间的触碰操作确定为一次作用在回退控件213的用户操作。一次作用在回退控件213的用户操作可用于回退输入面板218中绘制时间最晚的一条线条。也即是说,响应于一次作用在回退控件213的用户操作,电子设备100可以将绘制时间最晚的一条线条从输入面板218中移除。The above-mentioned one user operation acting on the back control 213 may be a user operation during a continuous period of time from when the user starts touching the back control 213 to when the user stops touching the back control 213 . The electronic device 100 may determine a touch operation detected on the touch panel and acting on the back control 213 for a period of time as a user operation on the back control 213 . A user operation on the rollback control 213 can be used to roll back the latest line drawn in the input panel 218 . That is to say, in response to a user operation acting on the rollback control 213 , the electronic device 100 may remove a line drawn with the latest time from the input panel 218 .
恢复控件214可用于触发电子设备100恢复被回退的线条。其中,电子设备100可以根据回退时间从晚到早的顺序来恢复被回退的线条。从图1A至图1B,线条218B被回退。图1B所示的输入面板218中仅包含线条218A。响应于一次作用在恢复控件214的用户操作,电子设备100可以恢复线条218B。如图1C所示,当线条218B被恢复,电子设备100可以 在输入面板218显示线条128B。The restore control 214 can be used to trigger the electronic device 100 to restore the rolled back line. Wherein, the electronic device 100 may recover the rolled back lines according to the sequence of the rolled back time from late to early. From FIG. 1A to FIG. 1B , line 218B is regressed. Input panel 218 shown in FIG. 1B includes only line 218A. In response to a user action acting on restore control 214, electronic device 100 may restore line 218B. As shown in FIG. 1C , when the line 218B is restored, the electronic device 100 may display the line 128B on the input panel 218 .
上述一次作用在恢复控件214的用户操作可以参考上述一次作用在回退控件213的用户操作的介绍。一次作用在恢复控件214的用户操作可用于恢复被回退且未被恢复的线条中回退时间最晚的一条线条。也即是说,响应于一次作用在恢复控件214的用户操作,电子设备100可以在输入面板218中显示被回退且未被恢复的线条中回退时间最晚的一条线条。一条线条被恢复后的形状和在输入面板中显示的位置分别与这一条线条被回退之前的形状和在输入面板中显示的位置相同。For the above-mentioned one user operation acting on the restore control 214 , reference may be made to the introduction of the above-mentioned one user operation acting on the rollback control 213 . A user operation on the recovery control 214 can be used to recover the line that has the latest rollback time among the lines that have been rolled back and have not been recovered. That is to say, in response to a user operation acting on the recovery control 214 , the electronic device 100 may display in the input panel 218 a line with the latest rollback time among the lines that have been rolled back but not recovered. The shape and position displayed in the input panel after a line is restored are the same as the shape and position displayed in the input panel before the line is rolled back.
在没有可被恢复的线条时,恢复控件214的状态可以为图1A所示不可用的状态。如图1A所示,恢复控件214为不可用的状态时,恢复控件214的颜色为灰色。在存在可被恢复的线条时,恢复控件214的状态可以为图1B所示可用的状态。如图1B所示,恢复控件214为可用的状态时,恢复控件214的颜色为黑色。本申请实施例对电子设备100表示恢复控件214的状态的方法不作限定。When there are no lines that can be restored, the state of the restore control 214 may be the disabled state shown in FIG. 1A . As shown in FIG. 1A , when the recovery control 214 is in an unavailable state, the color of the recovery control 214 is gray. When there are lines that can be restored, the state of the restoration control 214 can be the available state shown in FIG. 1B . As shown in FIG. 1B , when the recovery control 214 is in an available state, the color of the recovery control 214 is black. The embodiment of the present application does not limit the method for the electronic device 100 to indicate the state of the restoration control 214 .
保存控件217可用于触发电子设备100保存在输入面板218接收到的输入内容。The save control 217 can be used to trigger the electronic device 100 to save the input content received in the input panel 218 .
上述场景中的应用不限于是绘图应用,还可以是手写输入应用、文档编辑应用等等具有输入面板的应用。本申请后续实施例中以绘图应用为例进行具体说明。The applications in the above scenarios are not limited to drawing applications, and may also be handwriting input applications, document editing applications, and other applications with input panels. In the subsequent embodiments of the present application, a drawing application is taken as an example for specific description.
由图1A~图1C所示的场景可以看出,上述回退控件213仅支持以条为单位对线条进行回退,而不支持回退一条线条中的一部分。通过上述回退控件213,电子设备100难以将输入面板中的线条回退至用户期望的状态,回退的精度低。若用户想要回退图1A所示线条218B中的一部分,用户只能通过“虚拟橡皮擦”来擦除线条218B中想要回退的部分。但对于上述擦除功能,如果一条线条中需要回退的部分与其它线条有交点时,“虚拟橡皮擦”容易将其它线条擦除。而且针对不同粗细的线条,用户需要调节“虚拟橡皮擦”的大小。显然,用橡皮擦擦除一条线条的一部分时用户操作繁琐,用户体验较差。It can be seen from the scenes shown in FIGS. 1A to 1C that the above-mentioned rollback control 213 only supports rollback of lines in units of bars, but does not support rollback of a part of a line. Through the aforementioned rollback control 213 , it is difficult for the electronic device 100 to roll back the lines in the input panel to the state desired by the user, and the rollback accuracy is low. If the user wants to roll back a part of the line 218B shown in FIG. 1A , the user can only use the "virtual eraser" to erase the desired part of the line 218B. But for the above erase function, if the part of a line that needs to be retreated intersects with other lines, the "virtual eraser" can easily erase other lines. And for lines of different thicknesses, users need to adjust the size of the "virtual eraser". Obviously, when erasing a part of a line with an eraser, the user operation is cumbersome and the user experience is poor.
在photoshop、CAD等专业的绘图应用中,电子设备100可以对一条线条进行切割。切割的位置可以为用户期望该条线条回退的位置。进一步的,电子设备100可以删除该条线条中被切割出来的一部分,实现该条线条回退至用户期望的位置。但上述方法要求应用可以提供上述专业的功能。手机、平板等电子设备中安装的手写输入法应用、绘图应用等应用往往不具备这样的功能。并且上述方法需要用户掌握上述专业的功能的使用方法。用户的操作较为繁琐。In professional drawing applications such as photoshop and CAD, the electronic device 100 can cut a line. The cutting position may be the position where the user expects the line to retreat. Further, the electronic device 100 may delete a cut part of the line, so as to realize that the line returns to a desired position of 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 usage method of the above professional functions. The user's operation is more cumbersome.
本申请实施例提供一种线条回退的方法。在该方法中,电子设备可以监听作用在输入面板的滑动轨迹,并在输入面板显示该滑动轨迹对应的线条。电子设备可以根据一条线条的绘制时间对这一条线条进行分段存储。这一条线条可包括多个分段部分。其中一个分段部分可以是预设分段时间段内(如2毫秒内)的滑动轨迹对应的线条。响应于一次作用在分段回退控件的用户操作,电子设备可以在检测到分段回退控件上有用户操作的时间段A内按照速度A分段回退输入面板中的线条。其中,电子设备在时间段A内回退线条的速度A可以由上述一次作用在分段回退控件的用户操作之前的一次或多次作用在分段回退控件的用户操作作用的时间长度确定。若上述之前的一次或多次用户操作作用的时间长度按作用时刻的先后顺序呈现变短的趋势,电子设备可以在上述之前的一次或多次用户操作作用时回退线条速度的基础上,降低时间段A内回退线条的速度。The embodiment of the present application provides a method for rolling back lines. In this method, the electronic device can monitor the sliding track acting on the input panel, and display the lines corresponding to the sliding track on the input panel. The electronic device can store a line in segments according to the drawing time of the line. This one line can consist of multiple segmented parts. One of the segmented parts may be a line corresponding to the sliding trajectory within a preset segmented time period (for example, within 2 milliseconds). In response to a user operation acting on the segmented rollback control, the electronic device may roll back the lines in the input panel in segments at a speed A within a time period A when the user operation on the segmented rollback control is detected. Wherein, the speed A at which the electronic device rolls back the line within the time period A may be determined by the time length of one or more user operations acting on the segmented rollback control before the user operation of the segmented rollback control . If the duration of the one or more previous user operations tends to become shorter in the order of the time of action, the electronic device can reduce the Speed of rewinding lines during time period A.
可以理解的,在电子设备可以对一条线条进行分段回退的情况下,若用户想要删除一条线条的一部分,用户可以按下分段回退控件。其中,在远离用户期望的位置时,用户通常会 长按分段回退控件。在接近用户期望的位置时,用户通常会间断短按分段回退控件,直至电子设备将线条回退至自己期望的位置。可以看出,用户按下分段回退控件的时间长度以及频率可以反映线条当前回退的位置与用户期望的位置之间的距离。那么,电子设备可以通过检测每一次作用在分段回退控件的用户操作作用的时间长度、作用在分段回退控件的用户操作的频率,来调整分段回退线条的速度。上述方法既可以提高回退的精度,将输入面板中的线条回退至用户期望的状态,而且用户操作简便。It can be understood that, in the case that the electronic device can roll back a line in segments, if the user wants to delete a part of a line, the user can press the roll back control in segments. Among them, when away from the user's expected position, the user usually long presses the segmented back control. When approaching the desired position of the user, the user usually intermittently short-presses the segmented rollback control until the electronic device rolls back the line to the desired position. It can be seen that the length of time and the frequency at which the user presses the segment back control can reflect the distance between the current back position of the line and the user's desired position. Then, the electronic device can adjust the speed of the segmented rollback line 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. The above method can not only improve the accuracy of the rollback, roll back the lines in the input panel to the state expected by the user, and is easy for the user to operate.
上述分段回退控件可以是前述用户界面210中新增的。本申请后续实施例中将对分段回退控件进行具体介绍。The aforementioned segmentation rollback control may be newly added in the aforementioned user interface 210 . Subsequent embodiments of the present application will specifically introduce the segmentation rollback control.
上述线条回退方法可以适用于具有显示屏的电子设备。例如:手机、平板电脑、笔记本电脑、电视、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本、个人数字助理(personaldigital assistant,PDA)等等。本申请实施例对电子设备的具体类型不作限定。The above line fallback method can be applied to electronic devices with display screens. For example: mobile phone, tablet computer, notebook computer, TV, ultra-mobile personal computer (ultra-mobile personal computer, UMPC), netbook, personal digital assistant (personal digital assistant, PDA) and so on. The embodiment of the present application does not limit the specific type of the electronic device.
下面介绍本申请实施例涉及的电子设备的结构。The structure of the electronic device involved in the embodiment of the present application is introduced below.
图2示出了本申请实施例提供的一种电子设备100的结构示意图。FIG. 2 shows a schematic structural diagram of an electronic device 100 provided by an embodiment of the present application.
电子设备100可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。其中传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (universal serial bus, USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, and an antenna 2 , mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, earphone jack 170D, sensor module 180, button 190, motor 191, indicator 192, camera 193, display screen 194, and A subscriber identification module (subscriber identification module, SIM) card interface 195 and the like. 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, bone conduction sensor 180M, etc.
可以理解的是,本申请实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It can 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 certain components, or separate certain components, or arrange different components. The illustrated components can be realized in hardware, software or a combination of software and hardware.
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。The processor 110 may include one or more processing units, for example: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processing unit (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural network processor (neural-network processing unit, NPU) Wait. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. The memory may hold instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to use the instruction or data again, it can be called directly from the memory. Repeated access is avoided, and the waiting time of the processor 110 is reduced, thereby improving the efficiency of the system.
USB接口130是符合USB标准规范的接口,具体可以是Mini USB接口,Micro USB接口,USB Type C接口等。USB接口130可以用于连接充电器为电子设备100充电,也可以用于电子设备100与外围设备之间传输数据。也可以用于连接耳机,通过耳机播放音频。该接口还可以用于连接其他电子设备,例如AR设备等。The USB interface 130 is an interface conforming to the USB standard specification, specifically, it can be a Mini USB interface, a Micro USB interface, a USB Type C interface, and the like. The USB interface 130 can be used to connect a charger to charge the electronic device 100 , and can also be used to transmit data between the electronic device 100 and peripheral devices. It can also be used to connect headphones and play audio through them. This interface can also be used to connect other electronic devices, such as AR devices.
充电管理模块140用于从充电器接收充电输入。充电管理模块140为电池142充电的同时,还可以通过电源管理模块141为电子设备供电。The charging management module 140 is configured to receive a charging input from a charger. While the charging management module 140 is charging the battery 142 , it can also provide power for electronic devices through the power management module 141 .
电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器121,外部存储器,显示屏194,摄像头193,和无线通信模块160等供电。在其他一些实施例中,电源管理模块141也可以设置于处理器110中。在另一些实施例中,电源管理模块141和充电管理模块140也可以设置于同一个器件中。The power management module 141 is used for connecting the battery 142 , the charging management module 140 and the processor 110 . The power management module 141 receives the input from the battery 142 and/or the charging management module 140 to provide power for 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 disposed in the processor 110 . In some other embodiments, the power management module 141 and the charging management module 140 may also be set in the same device.
电子设备100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。The wireless communication function of the electronic device 100 can be realized by the antenna 1 , the antenna 2 , the mobile communication module 150 , the wireless communication module 160 , a modem processor, a baseband processor, and the like.
天线1和天线2用于发射和接收电磁波信号。电子设备100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。 Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 may be used to cover single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization of the antennas. For example: Antenna 1 can be multiplexed as a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
移动通信模块150可以提供应用在电子设备100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。The mobile communication module 150 can provide wireless communication solutions including 2G/3G/4G/5G applied on the electronic device 100 . The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (low noise amplifier, LNA) and the like. The mobile communication module 150 can receive electromagnetic waves through the antenna 1, filter and amplify the received electromagnetic waves, and send them to the modem processor for demodulation. The mobile communication module 150 can also amplify the signals modulated by the modem processor, and convert them into electromagnetic waves through the antenna 1 for radiation. In some embodiments, at least part of the functional modules of the mobile communication module 150 may be set in the processor 110 . In some embodiments, at least part of the functional modules of the mobile communication module 150 and at least part of the modules of the processor 110 may be set in the same device.
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器170A,受话器170B等)输出声音信号,或通过显示屏194显示图像或视频。在一些实施例中,调制解调处理器可以是独立的器件。在另一些实施例中,调制解调处理器可以独立于处理器110,与移动通信模块150或其他功能模块设置在同一个器件中。A modem processor may include a modulator and a demodulator. Wherein, the modulator is used for modulating the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low frequency baseband signal. Then the demodulator sends the demodulated low-frequency baseband signal to the baseband processor for processing. The low-frequency baseband signal is passed to the application processor after being processed by the baseband processor. The application processor outputs sound signals through audio equipment (not limited to speaker 170A, receiver 170B, etc.), or displays images or videos through display screen 194 . In some embodiments, the modem processor may be a stand-alone device. In some other embodiments, the modem processor may be independent from the processor 110, and be set in the same device as the mobile communication module 150 or other functional modules.
无线通信模块160可以提供应用在电子设备100上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。The wireless communication module 160 can provide wireless local area networks (wireless local area networks, WLAN) (such as wireless fidelity (Wireless Fidelity, Wi-Fi) network), bluetooth (bluetooth, BT), global navigation satellite, etc. applied on the electronic device 100. System (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field communication technology (near field communication, NFC), infrared technology (infrared, IR) and other wireless communication solutions. The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2 , frequency-modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110 . The wireless communication module 160 can also receive the signal to be sent from the processor 110 , frequency-modulate it, amplify it, and convert it into electromagnetic waves through the antenna 2 for radiation.
电子设备100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The electronic device 100 realizes the display function through the GPU, the display screen 194 , and the application processor. The GPU is a microprocessor for image processing, and is connected to the display screen 194 and the application processor. GPUs are used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
显示屏194用于显示图像,视频等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode的,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed, Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,电子设备100可以包括1个或N个显示屏194,N为大于1的正整数。The display screen 194 is used to display images, videos and the like. 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 (active-matrix organic light emitting diode, AMOLED), flexible light-emitting diode (flex light-emitting diode, FLED), Miniled, MicroLed, Micro-oLed, quantum dot light emitting diodes (quantum dot light emitting diodes, 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.
电子设备100可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。The electronic device 100 can realize the shooting function through the ISP, the camera 193 , the video codec, the GPU, the display screen 194 and the application processor.
ISP用于处理摄像头193反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将所述电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点,亮度,肤色进行算法优化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头193中。The ISP is used for processing the data fed back by the camera 193 . For example, when taking a picture, open the shutter, the light is transmitted to the photosensitive element of the camera through the lens, and the light signal is converted into an electrical signal, and the photosensitive element of the camera transmits the electrical signal to the ISP for processing, and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on image noise, brightness, and skin color. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, the ISP may be located in the camera 193 .
摄像头193用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,电子设备100可以包括1个或N个摄像头193,N为大于1的正整数。Camera 193 is used to capture still images or video. The object generates an optical image through the lens and projects it to the photosensitive element. The photosensitive element may be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. DSP converts digital image signals into standard RGB, YUV and other image signals. In some embodiments, the electronic device 100 may include 1 or N cameras 193 , where N is a positive integer greater than 1.
数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。例如,当电子设备100在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。Digital signal processors are used to process digital signals. In addition to digital image signals, they can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the energy of the frequency point.
视频编解码器用于对数字视频压缩或解压缩。电子设备100可以支持一种或多种视频编解码器。这样,电子设备100可以播放或录制多种编码格式的视频,例如:动态图像专家组(moving picture experts group,MPEG)1,MPEG2,MPEG3,MPEG4等。Video codecs are used to compress or decompress digital video. The electronic device 100 may support one or more video codecs. In this way, the electronic device 100 can play or record videos in various encoding formats, for example: moving picture experts group (moving picture experts group, MPEG) 1, MPEG2, MPEG3, MPEG4 and so on.
NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现电子设备100的智能认知等应用,例如:图像识别,人脸识别,语音识别,文本理解等。The NPU is a neural-network (NN) computing processor. By referring to the structure of biological neural networks, such as the transfer mode between neurons in the human brain, it can quickly process input information and continuously learn by itself. Applications such as intelligent cognition of the electronic device 100 can be realized through the NPU, such as image recognition, face recognition, speech recognition, text understanding, and the like.
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, so as 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 saving music, video and other files in the external memory card.
内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器110通过运行存储在内部存储器121的指令,从而执行电子设备100的各种功能应用以及数据处理。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备100使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。The internal memory 121 may be used to store computer-executable program codes including instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by executing instructions stored in the internal memory 121 . The internal memory 121 may include an area for storing programs and an area for storing data. Wherein, the stored program area can store an operating system, at least one application program required by a function (such as a sound playing function, an image playing function, etc.) and the like. The storage data area can store data created during the use of the electronic device 100 (such as audio data, phonebook, etc.) and the like. 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 magnetic disk storage device, flash memory device, universal flash storage (universal flash storage, UFS) and the like.
电子设备100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。The electronic device 100 can implement audio functions through the audio module 170 , the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor. Such as music playback, recording, etc.
音频模块170用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块170还可以用于对音频信号编码和解码。在一些实施例中,音频模块170可以设置于处理器110中,或将音频模块170的部分功能模块设置于处理器110中。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 signal. The audio module 170 may also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be set in the processor 110 , or some functional modules of the audio module 170 may be set in the processor 110 .
扬声器170A,也称“喇叭”,用于将音频电信号转换为声音信号Loudspeaker 170A, also called "horn", is used to convert audio electrical signals into sound signals
受话器170B,也称“听筒”,用于将音频电信号转换成声音信号。Receiver 170B, also called "earpiece", is used to convert audio electrical signals into sound signals.
麦克风170C,也称“话筒”,“传声器”,用于将声音信号转换为电信号。The microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals.
耳机接口170D用于连接有线耳机。耳机接口170D可以是USB接口130,也可以是3.5mm的开放移动电子设备平台(open mobile terminal platform,OMTP)标准接口,美国蜂窝电信工业协会(cellular telecommunications industry association of the USA,CTIA)标准接口。The earphone interface 170D is used for connecting wired earphones. The earphone interface 170D can be a USB interface 130, or a 3.5mm open mobile terminal platform (OMTP) standard interface, or a cellular telecommunications industry association of the USA (CTIA) standard interface.
压力传感器180A用于感受压力信号,可以将压力信号转换成电信号。在一些实施例中,压力传感器180A可以设置于显示屏194。压力传感器180A的种类很多,如电阻式压力传感器,电感式压力传感器,电容式压力传感器等。电容式压力传感器可以是包括至少两个具有导电材料的平行板。当有力作用于压力传感器180A,电极之间的电容改变。电子设备100根据电容的变化确定压力的强度。当有触摸操作作用于显示屏194,电子设备100根据压力传感器180A检测所述触摸操作强度。电子设备100也可以根据压力传感器180A的检测信号计算触摸的位置。在一些实施例中,作用于相同触摸位置,但不同触摸操作强度的触摸操作,可以对应不同的操作指令。例如:当有触摸操作强度小于第一压力阈值的触摸操作作用于短消息应用图标时,执行查看短消息的指令。当有触摸操作强度大于或等于第一压力阈值的触摸操作作用于短消息应用图标时,执行新建短消息的指令。The pressure sensor 180A is used to sense the pressure signal and convert the pressure signal into an electrical signal. In some embodiments, pressure sensor 180A may be disposed on display screen 194 . There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, and capacitive pressure sensors. A capacitive pressure sensor may be comprised of at least two parallel plates with conductive material. When a force is applied to the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of pressure according to the change in capacitance. When a touch operation acts on the display screen 194, the electronic device 100 detects the intensity of the touch operation according to the pressure sensor 180A. The electronic device 100 may also calculate the touched 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 may 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 short messages is executed. When a touch operation whose intensity is greater than or equal to the first pressure threshold acts on the icon of the short message application, the instruction of creating a new short message is executed.
陀螺仪传感器180B可以用于确定电子设备100的运动姿态。在一些实施例中,可以通过陀螺仪传感器180B确定电子设备100围绕三个轴(即,x,y和z轴)的角速度。The gyro sensor 180B can 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.
气压传感器180C用于测量气压。The air pressure sensor 180C is used to measure air pressure.
磁传感器180D包括霍尔传感器。电子设备100可以利用磁传感器180D检测翻盖皮套的开合。在一些实施例中,当电子设备100是翻盖机时,电子设备100可以根据磁传感器180D检测翻盖的开合。进而根据检测到的皮套的开合状态或翻盖的开合状态,设置翻盖自动解锁等特性。The magnetic sensor 180D includes a Hall sensor. The electronic device 100 may 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 clamshell machine, the electronic device 100 can detect opening and closing of the clamshell according to the magnetic sensor 180D. Furthermore, according to the detected opening and closing state of the leather case or the opening and closing state of the flip cover, features such as automatic unlocking of the flip cover are set.
加速度传感器180E可检测电子设备100在各个方向上(一般为三轴)加速度的大小。当电子设备100静止时可检测出重力的大小及方向。还可以用于识别电子设备姿态,应用于横竖屏切换,计步器等应用。The acceleration sensor 180E can detect the acceleration of the electronic device 100 in various 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 electronic devices, and can be used in applications such as horizontal and vertical screen switching, pedometers, etc.
距离传感器180F,用于测量距离。电子设备100可以通过红外或激光测量距离。在一些实施例中,拍摄场景,电子设备100可以利用距离传感器180F测距以实现快速对焦。The distance sensor 180F is used to measure the distance. The electronic device 100 may measure the distance by infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 may use the distance sensor 180F for distance measurement to achieve fast focusing.
接近光传感器180G可以包括例如发光二极管(LED)和光检测器,例如光电二极管。发光二极管可以是红外发光二极管。电子设备100通过发光二极管向外发射红外光。电子设备100使用光电二极管检测来自附近物体的红外反射光。当检测到充分的反射光时,可以确定电子设备100附近有物体。当检测到不充分的反射光时,电子设备100可以确定电子设备100附近没有物体。电子设备100可以利用接近光传感器180G检测用户手持电子设备100贴近耳朵通话,以便自动熄灭屏幕达到省电的目的。接近光传感器180G也可用于皮套模式,口袋模式自动解锁与锁屏。Proximity light sensor 180G may include, for example, light emitting diodes (LEDs) and light detectors, such as photodiodes. The light emitting diodes may be infrared light emitting diodes. The electronic device 100 emits infrared light through the light emitting diode. Electronic device 100 uses photodiodes to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it may be determined that there is an object near the electronic device 100 . When insufficient reflected light is detected, the electronic device 100 may 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 is holding the electronic device 100 close to the ear to make a call, so as to automatically turn off the screen to save power. The proximity light sensor 180G can also be used in leather case mode, automatic unlock and lock screen in pocket mode.
环境光传感器180L用于感知环境光亮度。The ambient light sensor 180L is used for sensing ambient light brightness.
指纹传感器180H用于采集指纹。电子设备100可以利用采集的指纹特性实现指纹解锁,访问应用锁,指纹拍照,指纹接听来电等。The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access to application locks, take pictures with fingerprints, answer incoming calls with fingerprints, and the like.
温度传感器180J用于检测温度。The temperature sensor 180J is used to detect temperature.
触摸传感器180K,也称“触控面板”。触摸传感器180K可以设置于显示屏194,由触摸传感器180K与显示屏194组成触摸屏,也称“触控屏”。触摸传感器180K用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触 摸事件类型。可以通过显示屏194提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器180K也可以设置于电子设备100的表面,与显示屏194所处的位置不同。Touch sensor 180K, also known as "touch panel". The touch sensor 180K can be disposed 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 a touch operation 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 may also be disposed on the surface of the electronic device 100 , which is different from the position of the display screen 194 .
示例性的,触摸传感器180K可以检测到前述实施例中作用于输入面板218的滑动操作。触摸传感器180K可以将上述滑动操作传递给应用处理器。在电子设备100进入线条输入功能的情况下,电子设备100可以将该滑动操作的轨迹确定的线条显示在显示屏上。Exemplarily, the touch sensor 180K can detect the sliding operation on the input panel 218 in the foregoing embodiments. The touch sensor 180K may transfer the above-mentioned sliding operation to the application processor. When the electronic device 100 enters the line input function, the electronic device 100 may display the line determined by the track of the sliding operation on the display screen.
骨传导传感器180M可以获取振动信号。在一些实施例中,骨传导传感器180M可以获取人体声部振动骨块的振动信号。骨传导传感器180M也可以接触人体脉搏,接收血压跳动信号。The bone conduction sensor 180M can acquire vibration signals. In some embodiments, the bone conduction sensor 180M can acquire the vibration signal of the vibrating bone mass of the human voice. The bone conduction sensor 180M can also contact the human pulse and receive the blood pressure beating signal.
按键190包括开机键,音量键等。按键190可以是机械按键。也可以是触摸式按键。电子设备100可以接收按键输入,产生与电子设备100的用户设置以及功能控制有关的键信号输入。The keys 190 include a power key, a volume key and the like. The key 190 may be a mechanical key. It can also be a touch button. The electronic device 100 can receive key input and generate key signal input related to user settings and function control of the electronic device 100 .
马达191可以产生振动提示。The motor 191 can generate a vibrating reminder.
指示器192可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。The indicator 192 can be an indicator light, and can be used to indicate charging status, power change, and can also be used to indicate messages, missed calls, notifications, and the like.
SIM卡接口195用于连接SIM卡。SIM卡可以通过插入SIM卡接口195,或从SIM卡接口195拔出,实现和电子设备100的接触和分离。电子设备100可以支持1个或N个SIM卡接口,N为大于1的正整数。SIM卡接口195可以支持Nano SIM卡,Micro SIM卡,SIM卡等。同一个SIM卡接口195可以同时插入多张卡。所述多张卡的类型可以相同,也可以不同。SIM卡接口195也可以兼容不同类型的SIM卡。SIM卡接口195也可以兼容外部存储卡。电子设备100通过SIM卡和网络交互,实现通话以及数据通信等功能。在一些实施例中,电子设备100采用eSIM,即:嵌入式SIM卡。eSIM卡可以嵌在电子设备100中,不能和电子设备100分离。The SIM card interface 195 is used for connecting a SIM card. The SIM card can be connected 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 may support 1 or N SIM card interfaces, where N is a positive integer greater than 1. SIM card interface 195 can support Nano SIM card, Micro SIM card, SIM card etc. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards may be the same or different. The SIM card interface 195 is also compatible with different types of SIM cards. The SIM card interface 195 is also compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as calling and data communication. In some embodiments, the electronic device 100 adopts an eSIM, that is, an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100 .
下面具体介绍本申请实施例提供的对线条进行分段回退的场景。The following specifically introduces the scene of segmented rollback of lines provided by the embodiment of the present application.
图3A~图3C示例性示出了本申请实施例提供的另一种线条回退的场景示意图。FIG. 3A to FIG. 3C exemplarily show another scene schematic diagram of line retreat provided by the embodiment of the present application.
电子设备100可以打开绘图应用,并显示如图3A所示的用户界面210。用户界面210可包括画笔控件211、橡皮擦控件212、回退控件213、恢复控件214、分段回退控件215、分段恢复控件216、保存控件217和输入面板218。除了分段回退控件215和分段恢复控件216,用户界面210中的其它内容可以参考前述图1A所示实施例的介绍,这里不再赘述。The electronic device 100 can open the drawing application and display the user interface 210 as shown in FIG. 3A . User interface 210 may include brush control 211 , eraser control 212 , rollback control 213 , restore control 214 , segment rollback control 215 , segment restore control 216 , save control 217 , and input panel 218 . Except for the segment rollback control 215 and the segment recovery control 216 , other content in the user interface 210 can refer to the introduction of the embodiment shown in FIG. 1A , and will not be repeated here.
分段回退控件215可用于触发电子设备100分段回退输入面板218中显示的线条。其中,电子设备100可以根据绘制时间从晚到早的顺序来对输入面板210中显示的线条进行分段回退。电子设备100可以根据绘制时间对输入面板218中的一条或多条线条进行分段存储。一个分段部分可以是预设时间段内的滑动轨迹对应的线条。The segment rollback control 215 can be used to trigger the electronic device 100 to segment the lines displayed in the input panel 218 . Wherein, the electronic device 100 may roll back the lines displayed on the input panel 210 by segments according to the order of drawing time from late to early. The electronic device 100 may store one or more lines in the input panel 218 in segments according to the drawing time. A segment part may be a line corresponding to a sliding track within a preset time period.
以输入面板218中的线条218B为例进行说明。线条218B的起始点为在电子设备100进入线条输入功能的情况下,电子设备100检测到一次滑动操作开始所在位置的像素点。线条218B的结束点为这一次滑动操作结束所在位置的像素点。显然,从线条218B的起始点至结束点,绘制时间是从早到晚的。电子设备100可以根据绘制时间将线条218B分段存储。当检测到作用于分段回退控件215的用户操作,电子设备100可以按照绘制时间从晚到早的顺序,从线条218B的结束点所在的分段部分依次向线条218B的起始点所在的分段部分回退。Take the line 218B in the input panel 218 as an example for illustration. The starting point of the 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 the line 218B is the pixel point where the sliding operation ends. Obviously, from the start point to the end point of the line 218B, the drawing time is from early to late. The electronic device 100 may store the line 218B in segments according to the drawing time. When a user operation acting on the segment rollback control 215 is detected, the electronic device 100 can move from the segment part where the end point of the line 218B is located to the segment where the start point of the line 218B is located in the sequence of drawing time from late to early. The segment is partially rolled back.
电子设备100可以根据绘制时间将线条218A分段存储。线条218A的绘制时间早于线条218B的绘制时间。当电子设备100将线条218B的所有分段部分均回退(即线条218B在输 入面板218中被移除),电子设备100可以继续按照绘制时间从晚到早的顺序对线条218A的各分段部分进行分段回退。The electronic device 100 may store the line 218A in segments according to the drawing time. Line 218A was drawn earlier than line 218B. When the electronic device 100 rolls back all the segments of the line 218B (that is, the line 218B is removed in the input panel 218), the electronic device 100 can continue to process the segments of the line 218A in the order of drawing time from late to early. Partially segmented rollback.
如图3A所示,当检测到作用在分段回退控件215的用户操作,电子设备100从线条218B的结束点所在的分段部分开始分段回退。在分段回退控件215上作用有用户操作的时间段A内,电子设备100可以按照速度A进行分段回退。上述速度A是可变的。当检测不到作用在分段回退控件215的用户操作(即用户停止触碰分段回退控件215),电子设备100可以停止对线条进行分段回退。例如,电子设备100检测到一次作用在分段回退控件215的用户操作,且这一次用户操作的持续时间为时间段A。经过时间段A,电子设备100将线条218B回退至图3B所示的位置A处。As shown in FIG. 3A , when a user operation acting on the segment rollback control 215 is detected, the electronic device 100 starts segment rollback from the segment where the end point of the line 218B is located. During the time period A when the user operates on the segment rollback control 215 , the electronic device 100 can perform segment rollback according to the speed A. Referring to FIG. The above speed A is variable. When no user operation acting on the segment rollback control 215 is detected (that is, the user stops touching the segment rollback control 215), the electronic device 100 may stop performing segment rollback on the line. For example, the electronic device 100 detects a user operation acting on the segment rollback control 215 once, and the duration of this user operation is a time period A. After time period A, electronic device 100 retracts line 218B to position A shown in FIG. 3B .
分段恢复控件216可用于触发电子设备100分段恢复被回退的线条。其中,电子设备100可以根据回退时间从晚到早的顺序来分段恢复被回退的线条。如图3B所示,线条218B被分段回退至位置A处。可以理解的,在被回退的分段部分中,越靠近位置A所在的分段部分,回退时间越晚。响应于一次作用在分段回退控件216且持续时间为时间段B的用户操作,电子设备100可以从上述位置A处开始对线条218B进行分段恢复,并将线条218B分段恢复至图3C所示的位置B处。被恢复的分段部分可以再次显示在输入面板218中。其中,分段部分被恢复后的形状和在输入面板中显示的位置分别与这一分段部分被回退之前的形状和在输入面板中显示的位置相同。The segment recovery control 216 can be used to trigger the electronic device 100 to segment recover the rolled back lines. Wherein, the electronic device 100 may recover the rolled back lines in segments according to the sequence of rolling back times from late to early. Line 218B is segmented back to position A as shown in FIG. 3B . It can be understood that, in the backed-off segment, the closer to the segment where the position A is located, the later the back-off time. In response to a user operation that acts on the segment back control 216 and lasts for a period of time B, the electronic device 100 can restore the segments of the line 218B from the above-mentioned position A, and restore the segments of the line 218B to FIG. 3C shown at position B. The restored segmented portion may again be displayed in the input panel 218 . Wherein, the restored shape of the segmented part and the displayed position in the input panel are respectively the same as the shape and displayed position in the input panel of the segmented part before being rolled back.
在没有可被恢复的线条时,分段恢复控件216的状态可以为图3A所示不可用的状态。如图3A所示,分段恢复控件216为不可用的状态时,分段恢复控件216的颜色为灰色。在存在可被恢复的线条时,分段恢复控件216的状态可以为图3B所示可用的状态。如图3B所示,分段恢复控件216为可用的状态时,分段恢复控件216的颜色为黑色。本申请实施例对电子设备100标识分段恢复控件214的状态的方法不作限定。When there are no lines that can be restored, the state of the segment restoration control 216 may be the disabled state shown in FIG. 3A . As shown in FIG. 3A , when the segment recovery control 216 is in an unavailable state, the color of the segment recovery control 216 is gray. When there are lines that can be restored, the state of the segment restoration control 216 can be the available state shown in FIG. 3B . As shown in FIG. 3B , when the segment recovery control 216 is enabled, 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 status of the segment recovery control 214 .
同样的,在没有可被回退的线条时,电子设备100可以将分段回退控件215显示为不可用的状态(如分段回退控件215的颜色为灰色)。在存在可被回退的线条时,电子设备100可以将分段回退控件215显示为可用的状态(如分段回退控件215的颜色为黑色)。Similarly, when there is no line that can be rolled back, the electronic device 100 may display the segmented rollback control 215 as an unavailable state (eg, the color of the segmented rollback control 215 is gray). When there is a line that can be rolled back, the electronic device 100 may display the segmented rollback control 215 as an available state (eg, the color of the segmented rollback control 215 is black).
由上述图3A~图3C所示的实施例可知,用户可以通过上述分段回退控件来回退一条线条中不需要的部分,并通过分段恢复控件来分段恢复一条线条中被回退但仍需要的部分。其中,用户作用在分段回退控件的用户操作的持续时间越长,电子设备100回退的分段部分越多。上述实施例可以提高线条回退的精度,用户可以便捷地将线条回退至自己期望的状态。It can be known from the embodiments shown in Fig. 3A to Fig. 3C above that the user can use the above-mentioned segment rollback control to roll back unnecessary parts of a line, and use the segment recovery control to segmentally restore a line that has been rolled back but parts still needed. Wherein, the longer the duration of the user operation on the segment rollback control by the user, the more segment parts the electronic device 100 rolls back. The foregoing embodiments can improve the accuracy of line rollback, and the user can conveniently roll back the lines to their desired state.
下面基于图3A~图3C所示的场景介绍电子设备调整分段回退线条的速度的过程。Based on the scenarios shown in FIGS. 3A to 3C , the process of adjusting the speed of the segmented retraction line by the electronic device will be described below.
阶段1:电子设备100响应第一次分段用户操作对线条进行分段回退。Stage 1: The electronic device 100 responds to the first segmentation user operation and rolls back the lines segmented.
在进入线条输入功能的情况下,电子设备100可以根据在输入面板218上检测到的滑动轨迹在输入面板218上显示与滑动轨迹对应的线条。例如,电子设备100根据滑动轨迹在输入面板218显示如图3A所示的线条218A和线条218B。When entering the line input function, 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 displays a line 218A and a line 218B on the input panel 218 as shown in FIG. 3A according to the sliding track.
如图4A所示,响应于一次作用在分段回退控件215且持续时间为3秒(second,s)的用户操作(后续简称第一次分段用户操作),电子设备100将线条218B回退至位置C处。As shown in FIG. 4A , in response to a user operation that acts on the segment rollback control 215 and lasts for 3 seconds (second, s) (hereinafter referred to as the first segment user operation), the electronic device 100 returns the line 218B to Go back to position C.
即在输入面板218显示有线条218A和线条218B时,用户第一次按分段回退控件215并持续3s,可以使得线条218B从结束点被回退至位置C处。从线条218B的结束点至位置C所包括的分段部分(即图4A所示的线条回退部分)在输入面板218中被移除。That is, when the input panel 218 displays the line 218A and the line 218B, the user presses the segment rollback control 215 for the first time and lasts for 3 seconds, so that the line 218B is rolled back from the end point to position C. The segmented portion included from the end point of line 218B to position C (ie, the line setback shown in FIG. 4A ) is removed in input panel 218 .
在一些实施例中,在检测到第一次分段用户操作作用的时间段内,电子设备100可以调整这一时间段内分段回退线条的速度。可以理解的,作用在分段回退控件215上的持续时间越长可以说明需要回退的分段部分较多,且线条当前回退的位置与用户期望的位置之间的距离仍然比较大。电子设备100可以逐渐增大在第一次分段用户操作作用的时间段内分段回退线条的速度,以提高回退的效率。In some embodiments, within the period of time when the first segmented user operation is detected, the electronic device 100 may adjust the speed of the segmented retreat line within this period of time. It can be understood that a longer duration of action on the segment rollback control 215 may indicate that more segments need to be rolled back, and the distance between the current rollback position of the line and the user's expected position is still relatively large. The electronic device 100 may gradually increase the speed of segmented retraction lines during the time period of the first segmented user operation, so as to improve the efficiency of retraction.
示例性的,当检测到第一次分段用户操作,电子设备100可以按照初始速度为v 1从线条218B的结束点开始分段回退。当第一次分段用户操作的持续时间超过1s,电子设备100可以按照速度v 2继续对线条进行分段回退。速度v 2不小于速度v 1。当第一次分段用户操作的持续时间超过3s,电子设备100可以按照速度v 3继续对线条进行分段回退。速度v 3不小于速度v 2。当第一次分段用户操作结束,电子设备100可以停止对线条进行分段回退。 Exemplarily, when detecting the first segmented user operation, the electronic device 100 may retreat segmentally from the end point of the line 218B at an initial speed of v1 . When the duration of the first segmented user operation exceeds 1 second, the electronic device 100 may continue segmenting back the line at the speed v2 . Velocity v 2 is not less than velocity v 1 . When the duration of the first segmented user operation exceeds 3s, the electronic device 100 may continue segmenting back the line at the speed v3 . The velocity v 3 is not less than the velocity v 2 . When the first user operation of segmenting ends, the electronic device 100 may stop segmenting and rewinding the lines.
在一些实施例中,在检测到第一次分段用户操作作用的时间段内,电子设备100可以按照一个恒定的速度对线条进行分段回退。例如,当检测到第一次分段用户操作,电子设备100可以按照恒定的速度v 1从线条218的结束点开始分段回退。当第一次分段用户操作结束,电子设备100可以停止对线条进行分段回退。 In some embodiments, within the period of time when the first segmented user operation is detected, the electronic device 100 may retreat the line segmented at a constant speed. For example, when detecting the first segmented user operation, the electronic device 100 may retreat segmentally from the end point of the line 218 at a constant speed v1 . When the first user operation of segmenting ends, the electronic device 100 may stop segmenting and rewinding the lines.
本申请实施例对上述速度v 1、速度v 2、速度v 3的具体取值,以及具有不同回退速度的时间区间划分的方式不作限定。 The embodiment of the present application does not limit the specific values of the above-mentioned speed v 1 , speed v 2 , and speed v 3 , and the manner of dividing time intervals with different retraction speeds.
阶段2:电子设备100响应第二次分段用户操作对线条进行分段回退。Stage 2: The electronic device 100 responds to the second segmentation user operation and rolls back the line segment by segment.
如图4B所示,在检测到上述第一次分段用户操作之后,电子设备100再次检测到一次作用在分段回退控件215且持续时间为2s的用户操作(后续简称第二次分段用户操作)。响应于第二次分段用户操作,电子设备100将线条218B从图4A所示的位置C处回退至图4B所示的位置D处。As shown in FIG. 4B , after detecting the above-mentioned first segmented user operation, the electronic device 100 detects again a user operation acting on the segmented rollback control 215 with a duration of 2s (hereinafter referred to as the second segmented operation). user action). In response to the second segmented user operation, the electronic device 100 retracts the line 218B from position C shown in FIG. 4A to position D shown in FIG. 4B .
即用户第一次按分段回退控件215后,再一次(第二次)按分段回退控件215并持续2s,可以使得线条218B从位置C处被回退至位置D处。从线条218B的位置C至位置D所包括的分段部分(即图4B所示的线条回退部分)在输入面板218中被移除。That is, after the user presses the segment rollback control 215 for the first time, presses the segment rollback control 215 again (for the second time) for 2 seconds, so that the line 218B is rolled back from position C to position D. The segmented portion included from position C to position D of line 218B (ie, the line setback shown in FIG. 4B ) is removed in input panel 218 .
在一些实施例中,根据第一次分段用户操作作用的时间段内回退线条的速度,电子设备100可以调整第二次分段用户操作作用的时间段内回退线条的速度。可以理解的,在用户想要删除输入面板中一条线条的一部分的场景中,用户通常会先长按一次分段回退控件215,使得线条回退至接近自己期望的位置所在的分段部分。进一步的,用户通常会间断短按分段回退控件215使得电子设备100小幅度的继续分段回退线条,直至达到自己期望的位置所在的分段部分。那么,电子设备100可以在第一次分段用户操作作用时间段内回退线条的初始速度的基础上,降低在第二次分段用户操作作用时间段内回退线条的速度。这样可以尽量避免第二次分段用户操作作用时间段内回退线条的速度过快而导致回退的分段部分过多。In some embodiments, according to the speed of retracting the line during the time period of the first segmented user operation, the electronic device 100 may adjust the speed of retracting the line during 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 segment rollback control 215 first, so that the line rolls back to the segment close to the desired position. Furthermore, the user usually intermittently short-presses the segment back control 215 to make the electronic device 100 continue to segment and roll back the line in a small range until reaching the segment part where the desired position is located. Then, the electronic device 100 may reduce the speed of retracting the line during the second segmented user operation action time period based on the initial speed of retracting the line during the first segmented user operation action period. In this way, it is possible to avoid too many segments that are rolled back due to the excessive speed of rolling back lines during the time period of the second segmented user operation.
示例性的,当检测到第二次分段用户操作,电子设备100可以按照速度v 4从位置C处对线条218B进行分段回退。第一次分段用户操作作用的时间段内回退线条的初始速度为v 1。速度v 4不大于速度v 1。例如,v 4=0.6*v 1。当第二次分段用户操作结束,电子设备100可以停止对线条进行分段回退。本申请实施例对速度v 4的具体取值不作限定。 Exemplarily, when detecting the second segmented user operation, the electronic device 100 may retract the line 218B segmented from the position C according to the speed v4 . The initial velocity of the retracement line during the time period of the first segmented user operation is v 1 . Velocity v 4 is not greater than velocity v 1 . For example, v 4 =0.6*v 1 . When the second segmentation user operation ends, the electronic device 100 may stop segmenting the line back. The embodiment of the present application does not limit the specific value of the velocity v4 .
在一些实施例中,第二次分段用户操作作用时间段内回退线条的速度可以是变化的。可以理解的,经过第一次分段用户操作,线条回退的位置不一定与用户期望的位置接近。那么,第二次分段用户操作的持续时间可能会比较长。那么,根据第一次分段用户操作作用时间段内回退线条速度,电子设备100可以确定的第二次分段用户操作作用时间段内回退线条的初 始速度。当第二次分段用户操作的持续时间超过预设时间段,电子设备100可以提高回退线条的速度。可以看出,用户长按分段回退控件215可以表示用户需要回退的分段部分较多。电子设备100可以提高分段回退的速度,从而提高回退的效率。In some embodiments, the speed of retreating the lines during the second segmented user operation period may vary. It can be understood that after the first segmentation user operation, the position where the line retreats 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 speed of the retracted line during the time period of the first segmented user operation, the electronic device 100 can determine the initial speed of the retracted line within the time period of the second segmented user operation. When the duration of the second segmented user operation exceeds a preset period of time, the electronic device 100 may increase the speed of rewinding the lines. It can be seen that the long press of the segment rollback control 215 by the user may indicate that there are many segments that the user needs to roll back. The electronic device 100 can increase the speed of segmental rollback, thereby improving the efficiency of rollback.
示例性的,当检测到第二次分段用户操作,电子设备100可以按照初始速度为v 4从线条218B的位置C开始分段回退。上述速度v 4可以是根据第一次分段用户操作作用时间段内回退线条的初始速度确定的。当第二次分段用户操作的持续时间超过1s,电子设备100可以按照速度v 5继续对线条进行分段回退。其中,速度v 5不小于速度v 4Exemplarily, when detecting the second segmented user operation, the electronic device 100 may retreat segmentally from the position C of the line 218B at an initial speed of v4 . The above-mentioned speed v4 may be determined according to the initial speed of the retracted line within the time period of the first segmented user operation. When the duration of the second segmented user operation exceeds 1 second, the electronic device 100 may continue segmenting back the lines at the speed v5 . Wherein, the speed v 5 is not less than the speed v 4 .
可选的,上述速度v 4也可以是根据第一次用户操作结束时回退线条的速度(如速度v 3)确定的。 Optionally, the above-mentioned speed v 4 may also be determined according to the speed (such as speed v 3 ) of the retracted line at the end of the first user operation.
在一种可能的实现方式中,电子设备100可以判断第一次分段用户操作和第二次分段用户操作之间的时间间隔是否超过预设时间长度(如5s)。第一次分段用户操作和第二次分段用户操作之间的时间间隔可以为:第一次分段用户操作结束的时刻与第二次分段用户操作开始的时刻之间的时间差。In a possible implementation manner, 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 (eg, 5s). The time interval between the first segmented user operation and the second segmented user operation may be: the time difference between the time when the first segmented user operation ends and the time when the second segmented user operation starts.
若判断出未超过预设时间长度,电子设备100可以根据上述实施例中的方法确定第二次分段用户操作作用时间段内回退线条的速度。若判断出超过预设时间长度,电子设备100可以判断第一次分段用户操作和第二次分段用户操作是否为两次连续的用户操作。两次连续的用户操作可以表示在这两次用户操作之间,电子设备100没有检测到其它用户操作。若判断出是两次连续的用户操作,电子设备100可以根据上述实施例中的方法确定第二次分段用户操作作用时间段内回退线条的速度。若判断出不是两次连续的用户操作,电子设备100可以按照前述实施例中确定第一次分段用户操作作用时间段内回退线条速度的方法,来确定第二次分段用户操作作用时间段内回退线条速度的方法。If it is determined that the preset time period has not been exceeded, the electronic device 100 may determine the speed of the retraction line within the second segmented user operation action time period according to the method in the above-mentioned embodiment. If it is determined that the preset time length is exceeded, the electronic device 100 may determine whether the first segmented user operation and the second segmented user operation are two consecutive user operations. Two consecutive user operations may indicate that the electronic device 100 has not detected other user operations between the two user operations. If it is determined that there are two consecutive user operations, the electronic device 100 may determine the speed of the retraction line within the time period of the second segmented user operation 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 action time of the second segmented user operation according to the method of determining the retraction line speed within the action time period of the first segmented user operation in the aforementioned embodiment. Method for backing off line speed within a segment.
在另一种可能的实现方式中,电子设备100可以直接判断第一次分段用户操作和第二次分段用户操作是否为两次连续的用户操作。若判断出是两次连续的用户操作,电子设备100可以根据上述实施例中的方法确定第二次分段用户操作作用时间段内回退线条的速度。若判断出不是两次连续的用户操作,电子设备100可以按照前述实施例中确定第一次分段用户操作作用时间段内回退线条速度的方法,来确定第二次分段用户操作作用时间段内回退线条速度的方法。In another possible implementation manner, 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 there are two consecutive user operations, the electronic device 100 may determine the speed of the retraction line within the time period of the second segmented user operation 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 action time of the second segmented user operation according to the method of determining the retraction line speed within the action time period of the first segmented user operation in the aforementioned embodiment. Method for backing off line speed within a segment.
可以理解的,如果第一次分段用户操作和第二次分段用户操作之间的时间间隔太长,或者第一次分段用户操作和第二次分段用户操作之间还存在其它用户操作,这两次用户操作可以被认为不具有相关性。即用户进行第一次分段用户操作期望线条回退的状态和进行第二次分段用户操作期望线条回退的状态是不同的。那么,电子设备100可以将两次用户操作确定为两次独立的用户操作,而不用根据第一次分段用户操作作用时间段内回退线条的速度来确定第二次分段用户操作作用时间段内回退线条的速度。Understandably, if the time interval between the first segmented user operation and the second segmented user operation is too long, or there are other users between the first segmented user operation and the second segmented user operation operation, the two user operations can be considered irrelevant. That is, the state in which the user performs the first segmentation user operation and expects the line to roll back is different from the state in which the user performs the second segmentation user operation and expects the line to roll back. Then, the electronic device 100 can determine the two user operations as two independent user operations, instead of determining the action time of the second segmented user operation according to the speed of the retraction line within the action time period of the first segmented user operation The speed at which lines are retracted within the segment.
阶段3:电子设备100响应第三次分段用户操作对线条进行分段回退。Stage 3: The electronic device 100 responds to the third segmentation user operation and rolls back the lines segment by segment.
如图4C所示,在检测到上述第一次分段用户操作和第二次分段用户操作之后,电子设备100再次检测到一次作用在分段回退控件215且持续时间为0.5s的用户操作(后续简称第三次分段用户操作)。响应于第三次分段用户操作,电子设备100将线条218B从图4B所示的位置D回退至图4C所示的位置E处。As shown in FIG. 4C , after detecting the above-mentioned first segmented user operation and the second segmented user operation, the electronic device 100 again detects a user action on the segmented back control 215 for a duration of 0.5s. operation (subsequently referred to as the third segmented user operation). In response to the third segmented user operation, the electronic device 100 retracts the line 218B from the position D shown in FIG. 4B to the position E shown in FIG. 4C .
即用户进行图4A和图4B所示两次按分段回退控件215后,再一次(第三次)按分段回退控件215并持续0.5s,可以使得线条218B从位置D处被回退至位置E处。从线条218B的 位置D至位置E所包括的分段部分(即图4C所示的线条回退部分)在输入面板218中被移除。That is, after the user presses the segment rollback control 215 twice as shown in FIG. 4A and FIG. 4B , press the segment rollback control 215 again (for the third time) for 0.5s, so that the line 218B can be returned from the position D. Go back to location E. The segmented portion included from position D to position E of line 218B (i.e., the line setback shown in FIG. 4C ) is removed in input panel 218 .
在一些实施例中,根据第二次分段用户操作作用时间段内回退线条的速度,电子设备100可以调整第三次分段用户操作作用时间段内回退线条的速度。具体方法可以参考前述实施例的阶段2中,电子设备100根据第一次分段用户操作作用时间段内回退线条的速度确定第二次分段用户操作作用时间段内回退线条速度的方法。这里不再赘述。In some embodiments, the electronic device 100 may adjust the speed of rolling back the lines during the third segmented user operation time period according to the speed of the retracted line during the second segmented user operation time period. The specific method can refer to the method in stage 2 of the above-mentioned embodiment, where the electronic device 100 determines the speed of the retracted line during the second segmented user operation action time period according to the speed of the retracted line during the first segmented user operation action period. . I won't go into details here.
示例性的,当检测到第三次分段用户操作,电子设备100可以按照速度v 6从位置D处对线条218B进行分段回退。第二次分段用户操作作用的时间段内回退线条的初始速度为v 4。速度v 6不大于速度v 4。例如,v 6=0.6*v 4。当第三次分段用户操作结束,电子设备100可以停止对线条进行分段回退。本申请实施例对速度v 6的具体取值不作限定。 Exemplarily, when detecting the third segmented user operation, the electronic device 100 may retract the line 218B segmented from the position D according to the speed v6 . The initial velocity of the retracement line during the time period of the second segmented user operation is v 4 . Velocity v 6 is not greater than velocity 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 back. The embodiment of the present application does not limit the specific value of the velocity v 6 .
由上述实施例可知,电子设备100可以根据前一次分段用户操作作用时间段内回退线条的速度来确定当前一次分段用户操作作用时间段内回退线条的速度。上述前一次分段用户操作和当前一次分段用户操作可以是两次连续的用户操作,或者可以是预设时间长度内的两次用户操作。It can be seen from the above embodiments that the electronic device 100 may determine the speed of the line retracted during the current segmented user operation time period according to the speed of the retracted line during the previous segmented user operation time period. The above-mentioned previous segmented user operation and the current segmented user operation may be two consecutive user operations, or may be two user operations within a preset time length.
在一些实施例中,电子设备100可以根据当前一次分段用户操作开始的时刻之前T 1时间段内,若干次作用在分段回退控件215的用户操作作用时间段内回退线条的速度,来确定当前一次分段用户操作作用时间段内回退线条的速度。T 1的取值可以根据经验设定。本申请实施例对上述T 1的具体取值不作限定。 In some embodiments, the electronic device 100 may rewind the line according to the speed of rewinding the lines within the time period of the user operation of the segment rewind control 215 for several times within the time period T1 before the moment when the current segment user operation starts, To determine the speed of rolling back the line during the current segmented user operation action time period. The value of T 1 can be set according to experience. The embodiment of the present application does not limit the specific value of T 1 above.
示例性的,上述第一次分段用户操作和第二次分段用户操作均为第三次用户操作开始的时刻之前T 1时间段内的用户操作,电子设备100可以根据第一次分段用户操作作用时间段内回退线条的速度(如速度v 1)、第二次分段用户操作作用时间段内回退线条的速度(如速度v 4),来确定第三次分段用户操作作用时间段内的速度。 Exemplarily, the above-mentioned first segmented user operation and the second segmented user operation are both user operations within the time period T1 before the start of the third user operation, and the electronic device 100 may The speed of the retracted line (such as speed v 1 ) within the action period of the user operation, and the speed of the retracted line (such as speed v 4 ) within the action period of the second segmented user operation are used to determine the third segmented user operation Velocity during the action time period.
前述实施例中各个速度的取值、时间区间的取值、用户操作的持续时间、线条回退的位置均为示例性说明,不应对本申请构成限定。The values of each speed, value of the time interval, duration of user operation, and position of line retreat in the above-mentioned embodiments are all exemplary descriptions, and should not be construed as limiting the present application.
由图4A~图4C所示的实施例可知,用户作用在分段回退控件上的时间长度和频率可以反映线条当前回退的位置与用户期望的位置之间的距离。电子设备100可以通过检测每一次作用在分段回退控件的用户操作的持续时间、作用在分段回退控件的用户操作的频率,来调整分段回退线条的速度。其中,一次作用在分段回退控件的用户操作的持续时间越长,电子设备100可以逐渐提高这一次用户操作作用时间段内回退线条的速度。作用在分段回退控件的用户操作的频率高(即预设时间长度内作用在分段回退控件的用户操作的次数多),可以表示预设时间长度内多次作用在分段回退控件的用户操作的持续时间较短,且两次作用在分段回退控件的用户操作之间的时间间隔也较短。电子设备100可以将这多次用户操作作用时间段内回退线条的速度逐渐降低。上述实施例可以提供回退线条的精度,用户可以更便捷地将输入面板中的线条回退至自己期望的状态。From the embodiments shown in FIG. 4A to FIG. 4C , it can be seen that the time length and frequency of the user's action on the segmented back control can reflect the distance between the current backed position of the line and the user's expected position. The electronic device 100 can adjust the speed of the segmented rollback line 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. Wherein, the longer the duration of a user operation acting on the segmented rewind control, the electronic device 100 may gradually increase the speed of rewinding the lines within the time period of this user operation. The frequency of user operations acting on the segmented rollback control is high (that is, the number of user operations acting on the segmented rollback control within the preset time length is high), which can indicate that the segmented rollback has been applied to the segmented rollback control multiple times within the preset time length The duration of the user action on the control is short, and the time interval between two user actions acting on the segmented fallback control is also short. The electronic device 100 may gradually reduce the speed of the retracted lines within the time period of the multiple user operations. The above embodiments can provide the accuracy of rolling back the lines, and the user can more conveniently roll back the lines in the input panel to their desired state.
响应于作用在分段恢复控件216的用户操作,电子设备100可以根据回退时间从晚到早的顺序来分段恢复被回退的线条。可以理解的,在远离用户期望恢复的位置时,用户通常会长按分段恢复控件。在接近用户期望恢复的位置时,用户通常会间断短按分段恢复控件,直至电子设备将线条恢复至自己期望恢复的位置。那么,电子设备100可以通过检测每一次作用在分段恢复控件的用户操作的持续时间、作用在分段恢复控件的用户操作的频率,来调整 分段恢复线条的速度。具体的实现方法可以参考前述图4A~图4C所示电子设备100调整分段回退线条的速度的实现方法,这里不再赘述。In response to a user operation acting on the segment recovery control 216 , the electronic device 100 may recover the rolled back lines segment by segment according to the order of the rollback time from late to early. It is understandable that when the user is away from the location where the user expects to restore, the user usually long presses the segment restore control. When approaching the position that the user expects to restore, the user usually short-presses the segment restoration control intermittently until the electronic device restores the line to the position that the user expects to restore. Then, the electronic device 100 can adjust the speed of the segment recovery line by detecting the duration of each user operation on the segment recovery control and the frequency of the user operation on the segment recovery control. For a specific implementation method, reference may be made to the implementation method of the electronic device 100 adjusting the speed of the segmented retraction line shown in FIGS. 4A to 4C , which will not be repeated here.
下面基于图3A~图3C所示的场景介绍本申请实施例提供的一种分段存储线条,分段回退线条和分段恢复线条的具体实现方法。Based on the scenarios shown in FIG. 3A to FIG. 3C , the specific implementation methods of segmented storage lines, segmented rollback lines and segmented recovery lines provided by the embodiment of the present application are introduced below.
上述方法涉及到“图层”的概念,为了便于理解,这里先对图层的概念进行介绍。The above method involves the concept of "layer". For the sake of easy understanding, the concept of layer is firstly introduced here.
图层:图层可用于绘制图像。一个图层的大小可以与前述实施例中输入面板的大小相同。一个图层上除了绘制在这一个图层上的图像部分,其余部分是透明的。不同的图像可以绘制在不同的图层上。多个图层可以按照一定的顺序叠放。其中,叠放在上层的图层中的图像可能会遮挡叠放在下层的图层中的图像。多个图层按照一定的顺序叠放后所呈现的图像即为输入面板中显示的内容。Layers: Layers can be used to draw images. The size of a layer can be the same as the size of the input panel in the previous embodiment. Except for the part of the image drawn on this 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. Wherein, the image superimposed on the upper layer may block the image superimposed on the lower layer. The image presented after stacking multiple layers in a certain order is the content displayed in the input panel.
在一些实施例中,每一个图层上均绘制有一条线条。一条线条可以是由电子设备100在输入面板检测到的单次滑动操作的轨迹确定。其中,每在一个图层上绘制完一条线条,电子设备100可以新建一个图层,并将新建图层后检测到的单次滑动操作的轨迹所确定的一条线条绘制在该新建的图层上。电子设备100可以将所有图层按照绘制时间从早到晚的顺序来叠放图层。其中,绘制时间早的图层被叠放在下层。绘制时间晚的图层被叠放在上层。由图1A和图1C所示的实施例可知,电子设备100以条为单位对输入面板中的线条进行回退,可具体方法可以是按照叠放在上层到下层的顺序对图层进行回退。被回退的图层中的线条在输入面板中被移除。In some embodiments, a line is drawn on each layer. A line may be determined by the trajectory of a single sliding operation detected by the electronic device 100 on the input panel. Wherein, each time a line is drawn on a layer, the electronic device 100 can create a new layer, and draw a line determined by the trajectory of a single sliding operation detected after the new layer is created on the newly created layer . The electronic device 100 may stack all the layers in order of drawing time from early to late. Among them, the layer with the earliest drawing time is superimposed on the lower layer. Layers drawn later are superimposed on top. From the embodiment shown in FIG. 1A and FIG. 1C, it can be seen that the electronic device 100 rolls back the lines in the input panel in units of bars, and the specific method may be to roll back the layers in the order from the upper layer to the lower layer. . Lines in the layer being rolled back are removed in the input panel.
在一些实施例中,每一个图层上均可绘制有一条线条的一个分段部分。其中,在一条线条绘制的过程中,电子设备100可以每隔预设分段时间段(如2毫秒)对这一条线条进行分段。其中,每在一个图层上绘制完一条线条的一个分段部分,电子设备100可以新建一个图层,并将新建图层后,从检测到滑动操作的初始时刻开始的预设分段时间段内检测到的滑动操作的轨迹所确定的分段部分绘制在该新建的图层上。电子设备100可以将所有图层按照绘制时间从早到晚的顺序来叠放图层。其中,绘制时间早的图层被叠放在下层。绘制时间晚的图层被叠放在下层。可以看出,电子设备100对绘制有一个条线的一个分段部分的图层进行回退,可以实现对线条进行分段回退。In some embodiments, a segmented portion of a line may be drawn on each layer. Wherein, during the process of drawing a line, the electronic device 100 may segment the line every preset segment time period (for example, 2 milliseconds). Wherein, each time a segment part of a line is drawn on a layer, the electronic device 100 can create a new layer, and after the new layer is created, the preset segment time period starting from the initial moment when the sliding operation is detected The segmented parts determined by the trajectory of the detected swipe operations are drawn on this newly created layer. The electronic device 100 may stack all the layers in order of drawing time from early to late. Among them, the layer with the earliest drawing time is superimposed on the lower layer. Layers drawn later are superimposed on the lower layer. It can be seen that the electronic device 100 rolls back the layer of a segmented part drawn with a line, which can realize the segmented rollback of the line.
这里具体以前述实施例中的线条218B为例进行说明。Here, the line 218B in the foregoing embodiment is taken as an example for illustration.
1、关于分段存储线条1. About segmented storage lines
如图5所示,输入面板中显示有线条218B。线条218B是由电子设备100在输入面板检测到的单次滑动操作的轨迹确定。在线条218B绘制的过程中,电子设备100可以按照绘制时间对线条218B进行分段,并将不同的分段部分绘制在不同的图层上。示例性的,电子设备100将线条218B分成6段,包括:分段部分A、分段部分B、分段部分C、分段部分D、分段部分E、分段部分F。分段部分A是线条218B的起始点所在的分段部分。分段部分F是线条218B的结束点所在的分段部分。在检测到确定线条218B的滑动操作的轨迹之前,电子设备100中已建立有一个空白的图层。在进入线条输入功能的情况下,电子设备100将从检测到滑动操作的初始时刻开始的预设分段时间段内检测到的滑动操作的轨迹所确定的分段部分(即分段部分A),绘制在上述一个已建立的空白图层中,并建立一个新的图层。电子设备100可以将这一个新的图层建立后,检测到的滑动操作的初始时刻开始的预设分段时间段内检测到的滑动操作的轨迹所确定的分段部分(即分段部分B),绘制在这一个新的图层上。 电子设备100可以确定分段部分A的滑动操作、确定分段部分B的滑动操作是一个单次滑动操作中不同时间段内进行的操作。即分段部分A和分段部分B是一条线条中的两个分段部分。As shown in FIG. 5, line 218B is displayed in the input panel. The line 218B is determined by the trajectory of a single sliding operation detected by the electronic device 100 on the input panel. During the drawing of the line 218B, the electronic device 100 may segment the line 218B according to the drawing time, and draw different segmented parts on different layers. Exemplarily, the electronic device 100 divides the line 218B into 6 segments, including: a segmented part A, a segmented part B, a segmented part C, a segmented part D, a segmented part E, and a segmented part F. Segment A is the segment where the starting point of line 218B is located. Segment portion F is the segment portion where the end point of line 218B is located. A blank layer has been established in the electronic device 100 before the track of the sliding operation of the determined line 218B is detected. In the case of entering the line input function, the electronic device 100 will detect the segmented part (that is, the segmented part A) , draw in one of the above created blank layers, and create a new layer. After the electronic device 100 establishes this new layer, the segmented portion determined by the trajectory of the detected sliding operation within the preset segmented time period starting from the initial moment of the detected sliding operation (that is, the segmented portion B ), drawn on this new layer. The electronic device 100 may determine that the sliding operation of segment part A and the sliding operation of segment part B are operations performed within different time periods in a single sliding operation. That is, segmented part A and segmented part B are two segmented parts in one line.
电子设备100绘制分段部分C、分段部分D、分段部分E和分段部分F的方法可以参考前述绘制分段部分A和分段部分B的方法,这里不再赘述。可以看出,这6个分段部分可以分别被绘制在不同的图层上。The method for drawing the segmented part C, the segmented part D, the segmented part E and the segmented part F by the electronic device 100 may refer to the aforementioned method for drawing the segmented part A and the segmented part B, which will not be repeated here. It can be seen that the six segmented parts can be drawn on different layers respectively.
用于绘制各分段部分的图层也可以是电子设备100在检测到对应的滑动操作的初始时刻建立的。本申请实施例对图层的建立时间不作限定。The layer for drawing each segment part may also be established 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.
如图5所示,分段部分A、分段部分B、分段部分C、分段部分D、分段部分E、分段部分F分别被绘制在图层A、图层B、图层C、图层D、图层E、图层F上。每一个图层均具有时间戳。一个图层的时间戳可以由这一个图层上的分段部分的绘制时间确定。电子设备100可以根据一个图层的时间戳来确定这一个图层上的分段部分绘制时间的早晚顺序。例如,图层A、图层B、图层C、图层D、图层E、图层F的时间戳分别为时间戳t 1、时间戳t 2、时间戳t 3、时间戳t 4、时间戳t 5、时间戳t 6As shown in Figure 5, segmented part A, segmented part B, segmented part C, segmented part D, segmented part E, and segmented part F are drawn on layer A, layer B, and layer C respectively , Layer D, Layer E, and Layer F. Each layer is timestamped. A layer's timestamp can be determined from the drawing time of the segmented parts on this layer. The electronic device 100 may determine the order of drawing times of the segmented parts on a layer according to the time stamp of a layer. For example, the time stamps of layer A, layer B, layer C, layer D, layer E, and layer F are respectively time stamp t 1 , time stamp t 2 , time stamp t 3 , time stamp t 4 , Time stamp t 5 , time stamp t 6 .
在一些实施例中,电子设备100可以将绘制有一条线段各分段部分的图层存储在一个栈中。栈是一种只能在一端进行插入和删除操作的线性表,按照先进后出的原则存储数据。其中,先进入栈的数据被压入栈底,最后进入栈的数据在栈顶。In some embodiments, the electronic device 100 may store a layer in which each segment of a line segment is drawn in a stack. A stack is a linear table that can only be inserted and deleted at one end, and stores data according to the principle of first in, last out. Among them, 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.
如图5所示,电子设备100可以根据绘制时间从早到晚的顺序将线条218B的各图层存入栈A。具体的,每得到一个绘制有线条218B的一个分段部分的图层,电子设备100可以将这一个图层存入栈A。可以看出,图层A上的分段部分A是线条218B中绘制时间最早的分段部分。电子设备100最先将图层A存入栈A。图层A位于栈A的栈底。图层F上的分段部分F是线条218B中绘制时间最晚的分段部分。电子设备100最后将图层F存入栈A。图层F位于栈A的栈顶。指针可以指向栈A中图层F所在的位置。上述指针指向的图层可以为所有绘制内容被显示在输入面板的图层中叠放在最上层的图层。As shown in FIG. 5 , the electronic device 100 may store the layers of the line 218B into the stack A in order of drawing time from early to late. Specifically, every time a layer on which a segmented portion of the line 218B is drawn is obtained, the electronic device 100 may store this layer into the stack A. It can be seen that segment A on layer A is the earliest segment drawn in line 218B. Electronic device 100 first stores layer A into stack A. Layer A is at the bottom of stack A. Segment F on layer F is the latest segment drawn in line 218B. Electronic device 100 finally stores layer F into stack A. Layer F is at the top of stack A. The pointer can point to the location of layer F in stack A. The layer pointed by the above pointer can be the uppermost layer among the layers displayed in the input panel for all drawing contents.
2、关于分段回退线条2. About segmented rollback lines
当接收到作用在分段回退控件215的用户操作,电子设备100可以将指针指向的位置从栈A的栈顶向栈底移动。例如,响应于一次作用在分段回退控件215的用户操作,电子设备100将指针的指向的位置移动至图层C所在的位置。那么,图层D、图层E和图层F上绘制的分段部分在输入面板中被移除。线条218B被回退至分段部分C和分段部分D的交点所在的位置处。When receiving a user operation acting on the segment rollback control 215, the electronic device 100 may move the position pointed by the pointer from the top of the stack A to the bottom of the stack. For example, in response to a user operation acting on the segment rollback control 215, the electronic device 100 moves the pointed position of the pointer to the position where the layer C is located. Then, the segmented parts drawn on layers D, E, and F are removed in the input panel. Line 218B is retracted to where segmented portion C and segmented portion D intersect.
如图5所示,指针移动的步长为一个图层。As shown in Figure 5, the step size of the pointer movement is one layer.
电子设备100移动上述指针的速度即为前述实施例中回退线条的速度。电子设备100调整指针移动的速度的实现方法可以参考前述图4A~图4C所示的实施例,这里不再赘述。The speed at which the electronic device 100 moves the pointer is the speed at which the lines are retracted in the foregoing embodiments. The implementation method for the electronic device 100 to adjust the moving speed of the pointer may refer to the foregoing embodiments shown in FIG. 4A to FIG. 4C , which will not be repeated here.
在一些实施例中,电子设备100可以将不同的线条存入不同的栈中。例如,在接收到确定线条218B的滑动操作之前,电子设备100还接收到确定前述图4A所示线条218A的滑动操作。电子设备100可以根据绘制时间对线条218A进行分段,并将线条218A的各分段部分按照绘制时间从早到晚的顺序存入栈B。栈B与栈A是两个不同的栈。显然,栈B中所有图层上分段部分的绘制时间均早于栈A中所有图层上分段部分的绘制时间。In some embodiments, the electronic device 100 may store different lines in different stacks. For example, before receiving the sliding operation to determine the line 218B, the electronic device 100 also receives the sliding operation to determine the aforementioned line 218A shown in FIG. 4A . The electronic device 100 may segment the line 218A according to the drawing time, and store the segments of the line 218A into the stack B in order of drawing time from early to late. Stack B and stack A are two different stacks. Obviously, the drawing time of segmented parts on all layers in stack B is earlier than the drawing time of segmented parts on all layers in stack A.
当指针指向栈A的图层F,电子设备100可以将栈B和栈A中的所有图层按照绘制时间从早到晚的顺序叠放。其中,绘制时间早的图层被叠放在下层。绘制时间晚的图层被叠放在上层。这多个图层被叠放后所呈现的图像可以参考前述图3A所示输入面板218中显示的线 条218A和线条218B。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 order of drawing time from early to late. Among them, the layer with the earliest drawing time is superimposed on the lower layer. Layers drawn later are superimposed on top. The image presented after the multiple layers are stacked can refer to the lines 218A and 218B displayed in the input panel 218 shown in FIG. 3A.
响应于一次作用在分段回退控件215的用户操作,电子设备100将指针的位置移至图层C的位置。电子设备100可以将栈B中的所有图层和栈A中的图层A、图层B、图层C按照绘制时间从早到晚的顺序叠放。这多个图层个被叠放后所呈现的图像可以参考前前述图4B所示输入面板中显示的内容。其中,图3B所示的位置A可以为上述分段部分C和分段部分D的交点所在的位置。In response to a user operation acting on the segment rollback control 215, the electronic device 100 moves the position of the pointer to the position of layer C. The electronic device 100 may stack all the layers in the stack B and the layers A, B, and C in the stack A in order of drawing time from early to late. The image presented after the multiple layers are stacked can refer to the content displayed in the input panel shown in FIG. 4B above. Wherein, the position A shown in FIG. 3B may be the position where the intersection of the segmented part C and the segmented part D is located.
在一些实施例中,电子设备100将图层回退至栈A的栈底。即指针指向栈A的图层A。若检测到作用在分段回退控件215的用户操作,电子设备100可以将指针从图层A移至位于栈B的栈顶的图层,并从栈B的栈顶向栈底的方向移动。也即是说,当线条218B的全部分段部分均被回退,电子设备100可以从线条218A的结束点所在的分段部分向线条218A的起始点所在的分段部分进行分段回退。其中,线条218A是绘制时间在线条218B之前且与线条218B的绘制时间最临近的一条线条。In some embodiments, the electronic device 100 rolls back 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 back control 215 is detected, the electronic device 100 may move the pointer from the layer A to the layer at the top of the stack B, and move from the top of the stack B to the bottom of the stack . That is to say, when all the segments of the line 218B are rolled back, the electronic device 100 can perform a segment rollback from the segment where the end point of the line 218A is located to the segment where the start point of the line 218A is located. Wherein, the line 218A is a line whose drawing time is before the line 218B and is closest to the drawing time of the line 218B.
可以看出,不限于对最近一次绘制的一条线条进行分段回退,电子设备100可以根据绘制时间从晚到早的顺序对多条线条进行分段回退。这样可以更好地帮助用户将线条回退至用户期望的状态。It can be seen that the electronic device 100 may perform segment rollback on multiple lines according to the order of drawing time from late to early without being limited to segment rollback for a line drawn last time. This can better help the user roll back the line to the state the user expects.
在一些实施例中,响应于一次作用在分段回退控件215的用户操作,电子设备100将指针的位置移至图5所示图层C的位置。进一步的,电子设备100进入线条输入功能,并检测到作用在输入面板上的一次滑动操作。电子设备100可以根据这一次滑动操作的轨迹在输入面板显示一条线条(简称线条C)。其中,电子设备100可以按照前述实施例的方法将线条C分段,并将线条C的各分段部分按照绘制时间从早到晚的顺序存入栈C。上述指针可以指向位于栈C的栈顶的图层。另外,电子设备100可以将栈A中的图层D、图层E和图层F删除。在指针指向位于栈C的栈顶的图层时,响应于一次作用在分段回退控件215的用户操作,电子设备100可以按照从栈C的栈顶向栈C的栈底的方向移动指针。当指针移动至栈C的栈底,指针可以从栈C的栈底移动至栈A的图层C,并按照从图层C向栈A的栈底(即图层A)的方向移动指针。可以看出,电子设备100对一条线条进行分段回退,并接收用户的滑动操作在输入面板显示新的绘制内容后,存储被分段回退的线条的栈的结构被破坏。其中,电子设备100将绘制有已经被分段回退的分段部分的图层从栈中删除。In some embodiments, in response to a user operation acting on the segment rollback control 215, the electronic device 100 moves the position of the pointer to the position of layer C shown in FIG. 5 . Further, the electronic device 100 enters the line input function, and detects a sliding operation on the input panel. The electronic device 100 may display a line (referred to as line C) on the input panel according to the trajectory of this sliding operation. Wherein, the electronic device 100 may divide the line C into segments according to the method of the foregoing embodiments, and store each segment of the line C into the stack C in order of drawing time from early to late. The above pointer may point to the layer located at the top of the stack C. In addition, the electronic device 100 may delete the layer D, the layer E and the layer F in the stack A. When the pointer points to the layer at the top of the stack C, in response to a user operation acting on the segment rollback control 215, the electronic device 100 may move the pointer in a direction from the top of the stack C to the bottom of the 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 (that is, layer A). It can be seen that the electronic device 100 rolls back a line segment by segment, and receives the user's sliding operation. After the input panel displays new drawing content, the stack structure storing the segmented back line is destroyed. Wherein, the electronic device 100 deletes the layer drawn with the segment part that has been segmented back from the stack.
也即是说,当用户分段回退一条线条的一部分,并再次绘制新的线条后,已经被回退的内容不可恢复。That is to say, when the user rolls back a part of a line in segments and draws a new line again, the content that has been rolled back cannot be recovered.
3、关于分段恢复线条3. About segmented recovery lines
响应于作用在分段恢复控件216的用户操作,电子设备100可以根据回退时间从晚到早的顺序来分段恢复被回退的线条。电子设备100可以通过移动上述指针来分段恢复线条。其中,分段恢复线条时指针的移动方向与前述实施例中分段回退线条时指针移动的方向相反。In response to a user operation acting on the segment recovery control 216 , the electronic device 100 may recover the rolled back lines segment by segment according to the order of the rollback time from late to early. The electronic device 100 can restore the line segment by segment by moving the pointer. Wherein, the moving direction of the pointer when recovering the line by segment is opposite to the moving direction of the pointer when the line is rolled back by segment in the foregoing embodiment.
示例性的,经过分段回退,指针移动至图5所示栈A中图层C的位置。响应于一次作用在分段恢复控件216的用户操作,电子设备100可以将指针从图层C所在的位置,按照从栈底向栈顶的方向移动。例如,当指针移动至图层E所在的位置,上述一次作用在分段恢复控件216的用户操作结束,电子设备100停止移动指针。那么上述已经被回退的图层D和图层E可以被恢复。电子设备100可以将图层D和图层E中绘制的分段部分显示在输入面板中。其中,在线条218B中的分段部分被恢复的过程中,先被恢复的图层(即图层D)中绘制的分段部分先显示在输入面板中。Exemplarily, after segment rollback, the pointer moves to the position of layer C in stack A shown in FIG. 5 . In response to a user operation acting on the segment restoration control 216, the electronic device 100 may move the pointer from the position of the layer C in a direction from the bottom of the stack to the top of the stack. For example, when the pointer moves to the position of the 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 layers D and E that have been rolled back above can be restored. The electronic device 100 may display the segmented parts drawn in the layer D and the layer E in the input panel. Wherein, during the restoration process of the segmented part in the line 218B, the segmented part drawn in the first restored layer (ie layer D) is firstly displayed in the input panel.
在对线条进行分段恢复的过程中,电子设备100调整指针移动的速度的实现方法可以参考前述图4A~图4C所示的实施例,这里不再赘述。In the process of recovering lines segmentally, the electronic device 100 may refer to the aforementioned embodiments shown in FIG. 4A to FIG. 4C for the implementation method of adjusting the moving speed of the pointer, which will not be repeated here.
图5所示对线条218B的分段仅为示例性说明,不应对本申请构成限定。The segmentation of the line 218B shown in FIG. 5 is only for exemplary illustration, and should not be construed as limiting the present application.
由图5所示的实施例可以看出,电子设备100可以将线条分段绘制在不同的图层上。一个图层被回退,这一个图层上绘制的分段部分在输入面板中被移除。这样,电子设备100可以实现对线条的分段回退。其中,电子设备100可以将不同的图层按照绘制时间从早到晚的顺序,存储在栈中。电子设备100可以调整通过检测每一次作用在分段回退控件的用户操作的持续时间、作用在分段回退控件的用户操作的频率,来调整指针的移动速度,从而实现调整分段回退线条的速度。上述方法可以提高回退线条的精度,用户可以更便捷地将输入面板中的线条回退至自己期望的状态。It can be seen from the embodiment shown in FIG. 5 that the electronic device 100 can draw the line segments on different layers. A layer is rolled back, and the segmented parts drawn on this layer are removed in the input panel. In this way, the electronic device 100 can realize the segmented retreat of the lines. Wherein, the electronic device 100 may store different layers in the stack in order of drawing time from early to late. The electronic device 100 can adjust the moving speed of the pointer by detecting the duration of each user operation acting on the segmented rollback control and the frequency of the user operation acting on the segmented rollback control, thereby realizing the adjustment of the segmented rollback The speed of the line. The above method can improve the precision of rolling back lines, and the user can roll back the lines in the input panel to their desired state more conveniently.
在一些实施例中,电子设备100可以存储最近接收到的k次滑动操作的轨迹确定的k条线条的分段部分。上述k次滑动操作之前的滑动操作的轨迹所确定的线条的分段部分,电子设备100可以将绘制有其中一条线条的各分段部分的图层合并为一个图层,并进行存储。这可以节省电子设备100的存储空间。In some embodiments, the electronic device 100 may store segmented portions of k lines determined by trajectories of the last k sliding operations received. For the segmented parts of the lines determined by the trajectories of the sliding operations before the above k times of sliding operations, the electronic device 100 may combine the layers of the segmented parts drawn with one of the lines into one layer, and store it. This can save storage space of the electronic device 100 .
也即是说,对与上述k次滑动操作之前的滑动操作的轨迹所确定的线条,电子设备100可以以条为单位进行回退。上述k的取值可以根据经验值设定。本申请实施例对k的取值不作限定。That is to say, the electronic device 100 may roll back the line determined by the track of the sliding operation before the above k times of sliding operations in units of bars. The value of the above k can be set according to empirical values. The embodiment of the present application does not limit the value of k.
在一些实施例中,作用在前述实施例中的回退控件213或恢复控件214的用户操作不会破坏图5所示线条的栈的结构。即响应于一次作用在回退控件213的用户操作,电子设备100回退一条线条。进一步的,响应于作用在分段恢复控件216的用户操作,电子设备100可以对上述被回退的一条线条进行分段恢复。响应于一次作用在恢复控件214的用户操作,电子设备100可以恢复一条线条。进一步的,响应于作用在分段回退控件215的用户操作,电子设备100可以对上述被恢复的一条线条进行分段回退。In some embodiments, the user operation of the rollback control 213 or restore control 214 in the previous embodiments will not destroy the structure of the stack of lines shown in FIG. 5 . That is, in response to a user operation acting on the rollback control 213, the electronic device 100 rolls back one line. Further, in response to a user operation acting on the segment recovery control 216, the electronic device 100 may perform segment recovery on the aforementioned rolled back line. In response to a user operation on the restore control 214, the electronic device 100 may restore a line. Further, in response to a user operation acting on the segment rollback control 215, the electronic device 100 may perform segment rollback on the restored line.
一条线条的栈的结构被破坏的情况可以包括:栈中的一部分图层丢失、栈中的多个图层合并为一个图层,电子设备100无法根据指针索引到绘制有这一条线条的某一个分段部分的图层。The situation where the stack structure of a line is destroyed may include: some layers in the stack are lost, multiple layers in the stack are merged into one layer, and the electronic device 100 cannot index to a certain layer on which the line is drawn according to the pointer. Layers for segmented parts.
这里以电子设备100中存储有图3A所示的线条218A和线条218B的分段部分为例进行说明。线条218A的绘制时间早于线条218B的绘制时间。栈A中存储有线条218B的分段部分。栈B中存储有线条218A的分段部分。当前,电子设备100的输入面板中显示有图3A所示的线条218A和线条218B。指针指向位于栈A的栈顶的图层。Here, the electronic device 100 stores the segmented portion of the line 218A and the line 218B shown in FIG. 3A as an example for illustration. Line 218A was drawn earlier than line 218B. The segmented portion of line 218B is stored in stack A. Stored in stack B is the segmented portion of line 218A. Currently, the input panel of the electronic device 100 displays the lines 218A and 218B shown in FIG. 3A . The pointer points to the layer at the top of stack A.
响应于一次作用在回退控件213的用户操作,电子设备100可以将指针移动至位于栈B的栈顶的图层。即电子设备100回退线条218B。线条218B在输入面板中被移除。进一步的,响应于一次作用在分段回退控件215的用户操作,电子设备100可以根据前述实施例中分段回退线条的方法移动指针。其中,指针按照从栈B的栈顶到栈B的栈底的方向移动。即电子设备100根据这一次作用在分段回退控件215的用户操作,分段回退线条218A的一部分。线条218A中被回退的分段部分在输入面板中被移除。再进一步的,响应于一次作用在恢复控件214的用户操作,电子设备100可以将指针的位置调整至位于栈B的栈顶的图层所在的位置。其中,指针移动的步长可以为从经过前述分段回退后指向的图层至位于栈B的栈顶的图层之间包含的若干个图层。即电子设备100可以根据该次作用在恢复控件214的用户操作, 恢复线条218A中所有被分段回退的部分。被恢复的部分再次显示在输入面板中。进一步的,响应于一次作用在分段恢复控件216的用户操作,电子设备100可以根据前述实施例中分段恢复线条的方法移动指针。其中,指针从栈B的栈顶移动至栈A的栈底,并按照从栈A的栈底到栈A的栈顶的方向移动。即电子设备100可以根据这一次作用在分段恢复控件215的用户操作,分段恢复线条218B的一部分。线条218B中被恢复的分段部分再次显示在输入面板中。In response to a user operation acting on the back control 213, the electronic device 100 can move the pointer to the layer at the top of the stack B. That is, electronic device 100 rolls back line 218B. Line 218B is removed in the input panel. Further, in response to a user operation acting on the segment rollback control 215, the electronic device 100 can move the pointer according to the method of segment rollback lines in the foregoing embodiments. Wherein, the pointer moves in a direction from the top of the stack B to the bottom of the stack B. That is, the electronic device 100 rolls back a part of the line 218A in segments according to the user operation on the segment rollback control 215 this time. The backed-off segmented portion of line 218A is removed in the input panel. Still further, in response to a user operation acting 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 the stack B. Wherein, the step size of the pointer movement may be a number of layers included between the layer pointed to after the aforementioned segmental rollback and the layer at the top of the stack B. That is, the electronic device 100 can restore all the segmented back parts in the line 218A according to the user operation acting on the restoration control 214 . The restored part is displayed again in the input panel. Further, in response to a user operation acting on the section restoration control 216, the electronic device 100 can move the pointer according to the method of section restoration line in the foregoing embodiments. Wherein, the pointer moves from the top of stack B to the bottom of stack A, and moves in a direction from the bottom of stack A to the top of stack A. That is, the electronic device 100 can recover a part of the line 218B segmentally according to the user operation acting on the segment recovery control 215 this time. The restored segmented portion in line 218B is again displayed in the input panel.
可以看出,在接收到作用在回退控件213或恢复控件214的用户操作之后,电子设备100仍可以根据接收到的作用在分段回退控件215的用户操作对输入面板中的线条进行分段回退,或根据接收到的作用在分段恢复控件216的用户操作对已经被回退的线条进行分段恢复。即作用在前述实施例中的回退控件213或恢复控件214的用户操作不会破坏图5所示线条的栈的结构。It can be seen that after receiving the user operation acting on the rollback control 213 or the recovery control 214, the electronic device 100 can still divide the lines in the input panel according to the received user operation acting on the segmentation rollback control 215. Rewind the segment, or perform segment recovery on the line that has been rolled back according to the received user operation on the segment recovery control 216 . That is, the user operation of the rollback control 213 or restore control 214 in the foregoing embodiments will not destroy the structure of the stack of lines shown in FIG. 5 .
在一些实施例中,用户在输入面板上进行滑动操作以输入内容时,可能会受到外力影响,而导致滑动操作的轨迹偏离用户期望的轨迹。那么输入面板中显示的线条会包括异常分段部分。上述异常分段部分即为上述滑动操作的轨迹中偏离用户期望的轨迹所确定的线条。通常,上述异常分段部分是用户想要删除的部分。In some embodiments, when the user performs a sliding operation on the input panel to input content, it may be affected by an external force, which causes 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 the abnormal segmentation part. The above-mentioned abnormal segmentation part is the line determined by deviating from the trajectory expected by the user in the trajectory of the above-mentioned sliding operation. Usually, the above-mentioned exception segmentation part is the part that the user wants to delete.
分析上述一条线条包括异常分段部分的场景可知,上述异常分段部分一般是在一条线条绘制过程中突然受到外力影响导致的。在一条线条正常绘制的过程中,用户在绘制一条线条收笔时通常会降低滑动操作滑动的速度。即位于这一条线条末端的分段部分的绘制速度通常比较慢。上述一条线条正常绘制的过程可以表示从开始绘制到结束绘制的过程中用户没有受到外力影响,确定这一条线条的滑动操作的轨迹与用户期望的轨迹相同。而如果用户在绘制一条线条的过程中突然受到外力影响,用户不会主动收笔,并且滑动操作滑动的速度比较快。即位于这一条线条末端的分段部分的绘制速度比较快,且没有速度减慢的趋势或者速度减慢趋势的分段部分很短。Analyzing the scene where the above-mentioned line includes an abnormal segment, it can be seen that the above-mentioned abnormal segment is generally caused by a sudden external force during the drawing of a line. During the normal drawing of a line, the user usually slows down the sliding speed of the sliding operation when drawing a line to close the pen. That is, the segmented portion at the end of the line is usually drawn more slowly. The normal drawing process of the above line may indicate that the user is not affected by external force during the process from the start of drawing to the end of drawing, and it is determined that the trajectory of the sliding operation of this line is the same as the trajectory expected by the user. However, if the user is suddenly affected by an external force during the process of drawing a line, the user will not take the initiative to close 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 of the trend of slowing down is very short.
本申请实施例提供一种线条回退方法。其中,电子设备100可以根据一条线条的绘制时间对这一条线条进行分段存储。这一条线条可以包括多个分段部分。其中一个分段部分可以是预设分段时间段内(如2毫秒内)的滑动轨迹对应的线条。电子设备100可以检测各分段部分的绘制速度。根据绘制速度,电子设备100可以确定正常分段部分和异常分段部分的分界点。响应于一次作用在分段回退控件215的用户操作,电子设备100可以将这一条线条从结束点回退至该分界点。The embodiment of the present application provides a method for rolling back lines. Wherein, the electronic device 100 may store a line in segments according to the drawing time of the line. This one line can consist of multiple segmented parts. One of the segmented parts may be a line corresponding to the sliding trajectory within a preset segmented time period (for example, within 2 milliseconds). The electronic device 100 may detect the drawing speed of each segment part. According to the drawing speed, the electronic device 100 may determine a boundary point of a normal segment part and an abnormal segment part. In response to a user operation acting on the segment rollback control 215, the electronic device 100 can roll back the line from the end point to the dividing point.
由上述方法可知,电子设备100可以根据一条线条中各分段部分的绘制速度估计用户在哪一个时刻受到外力影响,导致这一条线条的一部分偏离用户预期的轨迹。当估计出分界点,电子设备100可以响应用于进行分段回退的用户操作,在输入面板中移除异常分段部分。电子设备100未将整条线条从输入面板移除。当上述异常分段部分被移除,用户可以继续从分界点处进行绘制。上述方法用户操作简便,而且可以快速地将输入面板中的线条回退至用户期望的状态,提高了用户的使用体验。It can be seen from the above method that the electronic device 100 can estimate at which moment the user is affected by an external force according to the drawing speed of each segment 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 may remove the abnormal segment part in the input panel in response to the user operation for segment rollback. The electronic device 100 does not remove the entire line from the input panel. When the above abnormal segment 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 return the lines in the input panel to the desired state of the user, thereby improving the user experience.
为了便于理解,这里对一条线条的正常分段部分和异常分段部分的概念进行介绍。For ease of understanding, here is an introduction to the concepts of a normal segmented part and an abnormal segmented part of a line.
电子设备100可以根据各分段部分的绘制速度来确定一个分段部分为正常分段部分还是异常分段部分。其中,异常分段部分的绘制速度远大于正常分段部分的绘制速度。一个分段部分的绘制速度可以由这一个分段部分的长度和这一个分段部分的绘制时间(如上述预设分 段时间段)确定。例如,一个分段部分的速度为这一个分段部分的长度除以预设分段时间段的时间长度。The electronic device 100 may determine whether a segmented part is a normal segmented part or an abnormal segmented part according to the drawing speed of each segmented part. Wherein, the drawing speed of the abnormal segment part is much higher than that of the normal segment part. The drawing speed of a segment part can be determined by the length of the segment part and the drawing time of the segment part (such as the preset segment time period mentioned above). For example, the speed of a segment portion is the length of the segment portion divided by the time length of the preset segment time period.
在一种可能的实现方式中,电子设备100可以将一条线条的各分段部分的绘制速度与速度阈值比较。其中,绘制速度大于速度阈值的分段部分为异常分段部分。绘制速度不大于速度阈值的分段部分为正常分段部分。上述速度阈值可以根据经验值设定(如9000像素/秒)。本申请实施例对上述速度阈值的取值不作限定。In a possible implementation manner, the electronic device 100 may compare the drawing speed of each segment of a line with a speed threshold. Among them, the segment part whose drawing speed is greater than the speed threshold is an abnormal segment part. The segmented part whose drawing speed is not greater than the speed threshold is a normal segmented part. The aforementioned speed threshold can be set according to empirical values (eg, 9000 pixels/second). The embodiment of the present application does not limit the value of the above speed threshold.
在另一种可能的实现方式中,电子设备100可以利用聚类算法,根据分段部分的绘制速度对一条线条的各分段部分进行聚类。进一步的,电子设备100可以将各类别聚类中心的绘制速度与速度阈值比较。其中,若一个聚类中心的绘制速度大于速度阈值,则这一个聚类中心所属类别中包括的分段部分均为异常分段部分。反之,这一个聚类中心所属类别中包括的分段部分聚为正常分段部分。上述聚类算法可以例如是k-means算法。本申请实施例对上述聚类算法不作限定。电子设备100利用聚类算法对分段部分进行聚类的具体实现可以参考现有技术中聚类算法的实现方法。这里对此不作赘述。In another possible implementation manner, 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. Wherein, if the drawing speed of a cluster center is greater than the speed threshold, the segmented parts included in the category to which the clustered center belongs are all abnormal segmented parts. Conversely, the segmented parts included in the category to which this cluster center belongs are aggregated into normal segmented parts. The aforementioned clustering algorithm may be, for example, a k-means algorithm. The embodiment of the present application does not limit the foregoing clustering algorithm. For the specific implementation of the electronic device 100 using the clustering algorithm to cluster the segmented part, reference may be made to the implementation method of the clustering algorithm in the prior art. I won't go into details here.
可以理解的,正常分段部分为与用户预期的轨迹对应的线条。异常分段部分为在绘制过程中用户收到外力影响而偏离预期的轨迹对应的线条。It can be understood that the normal segment part is a line corresponding to the trajectory expected by the user. The abnormal segment part is the line corresponding to the trajectory that the user is affected by external forces and deviates from the expected trajectory during the drawing process.
由异常分段部分出现的原因可知,一条线条的异常分段部分通常位于这一条线条的后半部分。在一些实施例中,电子设备100可以将一条线条中从结束点至起始点方向上第一个异常分段部分与正常分段部分的交点确定为上述分界点。From the reasons for the appearance of the abnormal segmentation part, it can be seen that the abnormal segmentation part of a line is usually located in the second half of the line. In some embodiments, the electronic device 100 may determine the intersection of the first abnormal segment part and the normal segment part in the direction from the end point to the start point in a line as the above-mentioned boundary point.
下面结合具体的场景来介绍电子设备100回退一条线条的异常分段部分的方法。The following describes a method for the electronic device 100 to roll back an abnormal segment of a line in combination with specific scenarios.
图6A和图6B示例性示出了本申请实施例提供的另一种线条回退的场景示意图。FIG. 6A and FIG. 6B exemplarily show another schematic diagram of a line retreat scene provided by an embodiment of the present application.
如图6A所示,电子设备100根据检测到的滑动操作在输入面板218显示线条218C、线条218D和线条218E。图6A所示的场景为:用户在电子100的输入面板218中手写输入“F”。用户在输入面板218中先后输入线条218C、线条218D和线条218E。其中,在输入线条218E的过程中,用户受到外力影响(例如手肘突然被撞击),线条218E的一部分与用户预期的轨迹偏离。As shown in FIG. 6A , 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. The scene shown in FIG. 6A is: the user inputs "F" by hand on the input panel 218 of the electronic device 100 . The user enters line 218C, line 218D, and line 218E sequentially in input panel 218 . Wherein, during the process of inputting the line 218E, the user is affected by an external force (for example, the elbow is bumped suddenly), and a part of the line 218E deviates from the trajectory expected by the user.
电子设备100可以根据前述实施例中的方法对线条218E进行分段存储,并确定各分段部分的绘制速度。进一步的,根据绘制速度,电子设备100可以确定线条218E正常分段部分和异常分段部分的分界点(如图6A所示的分界点)。该分界点即为电子设备100估计用户受到外力影响的初始时刻对应的像素点。The electronic device 100 may store the line 218E in segments according to the method in the foregoing embodiments, and determine the drawing speed of each segment. Further, according to the drawing speed, the electronic device 100 may determine the boundary point between the normal segment part and the abnormal segment part of the line 218E (the boundary point shown in 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.
如图6B所示,响应于一次作用在分段回退控件215的用户操作,电子设备100可以将线条218E回退至分界点处。电子设备100可以将线条218E从结束点至分界点所包括的分段部分(即图6B所示的线条回退部分)从输入面板218移除。As shown in FIG. 6B , in response to a user operation acting on the segment rollback control 215 , the electronic device 100 can roll back the line 218E to the dividing point. The electronic device 100 may remove the segmented portion of the line 218E from the end point to the boundary point (ie, the retracted portion of the line shown in FIG. 6B ) from the input panel 218 .
由图6A和图6B所示的场景可知,电子设备100未将线条218E从输入面板全部移除。当线条218E的异常分段部分被移除,用户可以继续从分界点处进行绘制。上述方法用户操作简便,而且可以快速地将输入面板中的线条回退至用户期望的状态,提高了用户的使用体验。It can be known from the scenes shown in FIG. 6A and FIG. 6B that the electronic device 100 does not completely remove the line 218E from the input panel. When the abnormally segmented portion of line 218E is removed, the user can continue drawing from the breakpoint. The above method is easy for the user to operate, and can quickly return the lines in the input panel to the desired state of the user, thereby improving the user experience.
下面基于图6A和图6B所示的场景对电子设备100回退线条的异常分段部分的具体实现方式进行介绍。Based on the scenarios shown in FIG. 6A and FIG. 6B , the specific implementation manner of the electronic device 100 to roll back the abnormal segmentation part of the line will be introduced below.
如图7所示,电子设备100可以根据前述图5所示的实施例将线条218E分段。线条218E可包括n个分段部分:分段部分A 1、…、A i、A i+1、…、A n。n的取值由线条218E的绘制时 间和前述预设分段时间段确定。i为小于n的正整数。分段部分A 1为线条218E的起始点所在的分段部分。分段部分A n为线条218E的结束点所在的分段部分。电子设备100可以将线条218E的n个分段部分分别绘制在n个图层上。其中,图层A 1绘制有分段部分A 1。图层A i绘制有分段部分A i。图层A i+1绘制有分段部分A i+1。图层A n绘制有分段部分A nAs shown in FIG. 7 , the electronic device 100 may segment the line 218E according to the aforementioned embodiment shown in FIG. 5 . Line 218E may include n segmented portions: segmented portions A 1 , . . . , A i , A i+1 , . . . , An . The value of n is determined by the drawing time of the line 218E and the aforementioned preset segmentation time period. i is a positive integer smaller than n. Segment A 1 is the segment where the starting point of line 218E is located. The segmented portion An is the segmented portion where the end point of the line 218E is located. The electronic device 100 may draw the n segmented parts of the line 218E on n layers respectively. Therein, layer A 1 is drawn with segmented part A 1 . Layer A i is drawn with segmented part A i . Layer A i+1 is drawn with segmented part A i+1 . Layer A n is drawn with segmented part A n .
每一个图层可具有时间戳。一个图层的时间戳的取值可以由这一个图层上绘制的分段部分的绘制时间确定。电子设备100可以根据时间戳,确定各图层上绘制的分段部分绘制时间早晚的顺序。Each layer can have a timestamp. The value of the timestamp of a layer can be determined by the drawing time of the segment drawn on this layer. The electronic device 100 may determine, according to the time stamps, the order in which the segment parts drawn on each layer are drawn sooner or later.
电子设备100可以将图层按照绘制时间从早到晚的顺序存储在栈中(如图7所示的栈D)。其中,绘制时间越早的图层存储的位置越靠近栈D的栈底。绘制时间越晚的图层存储的位置越靠近栈D的栈顶。The electronic device 100 may store the layers in a stack in order of drawing time from early to late (stack D shown in FIG. 7 ). Among them, the storage position of the layer whose drawing time is earlier is closer to the stack bottom of the stack D. The storage position of the layer whose drawing time is later is closer to the top of stack D.
电子设备100可以检测线条218E的n个分段部分的绘制速度,并根据前述实施例的方法确定这n个分段部分中哪些是异常分段部分,哪些是正常分段部分。示例性的,电子设备100判断出分段部分A i和分段部分A i+1之间的交点为分界点。即分段部分A i+1~分段部分A n均为异常分段部分。分段部分A i为正常分段部分。 The electronic device 100 may 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 foregoing embodiment. Exemplarily, the electronic device 100 determines that the intersection point between the segmented part A i and the segmented part A i+1 is the boundary point. That is, the segmented part A i+1 to the segmented part A n are all abnormal segmented parts. The segmented part A i is a normal segmented part.
在未进行分段回退之前,指针可以指向位于栈D的栈顶的图层(即图层A n)的位置。当接收到作用在分段回退控件215的用户操作,电子设备100可以将指针按照从栈D的栈顶到栈D的栈底的方向移动,并移动至离分界点最近的一个绘制有正常分段部分图层(即图层A i)的位置处。其中,与图5所示指针以一个图层为步长的移动方式不同,电子设备100可以直接将指针从图层A n的位置移动至图层A i的位置处。被回退的图层(即图层A i+1~图层A n)中绘制的分段部分在输入面板218中被移除。即响应于一次作用在分段回退控件215的用户操作,电子设备100可以将线条218E回退至上述分界点处,将分界点至结束点的异常分段部分从输入面板中移除。 Before segment rollback is performed, the pointer may point to the layer at the top of the stack D (that is, the layer A n ). When receiving a user operation acting on the segmentation rollback control 215, the electronic device 100 can move the pointer in the direction from the top of the stack D to the bottom of the stack D, and move to the one drawn with a normal The location of the segmented part of the layer (that is, the layer A i ). Wherein, unlike the method of moving the pointer with a layer as a step shown in FIG. 5 , the electronic device 100 can directly move the pointer from the position of the layer A n to the position of the layer A i . The segmented parts drawn in the rolled-back layers (ie, layers A i+1 -layer A n ) are removed in the input panel 218 . That is, in response to a user operation acting on the segment rollback control 215, the electronic device 100 can roll back the line 218E to the above-mentioned boundary point, and remove the abnormal segment from the boundary point to the end point from the input panel.
在一些实施例中,电子设备100在确定上述分界点时,可以先确定一条线条中从结束点至起始点方向上第一个异常分段部分与正常分段部分的交点y1。进一步的,电子设备100可以判断离该交点y1最近的x个分段部分是否均为正常分段部分。若离该交点y1最近的x个分段部分均为正常分段部分,电子设备100可以将该交点确定为上述分界点。若离该交点y1最近的x个分段部分中存在异常分段部分,电子设备100可以确定这一条线条中从交点y1至起始点方向上第二个异常分段部分与正常分段部分的交点y2,并将该交点y2确定为上述分界点。上述x的取值可以根据经验值设定(例如为3)。本申请实施例对x的取值不作限定。In some embodiments, when determining the boundary point, the electronic device 100 may first determine the intersection point y1 between the first abnormal segment part and the normal segment part in the direction from the end point to the start point in a line. Further, the electronic device 100 may determine whether the x segment parts closest to the intersection point y1 are all normal segment parts. If the x segment parts closest to the intersection point y1 are all normal segment parts, the electronic device 100 may determine the intersection point as the above-mentioned boundary point. If there is an abnormal segment in the x segment parts closest to the intersection point y1, the electronic device 100 can determine the intersection point between the second abnormal segment part and the normal segment part in the direction from the intersection point y1 to the starting point in this line y2, and determine the intersection point y2 as the above-mentioned dividing point. The above-mentioned value of x may be set according to empirical values (for example, 3). The embodiment of the present application does not limit the value of x.
上述方法可以减少由于分段部分的异常情况判断失误而导致分界点确定不准确的情况。例如,在图7所示的场景中,分段部分A i的前5个分段部分均为异常分段部分。那么,电子设备100将分段部分A i判断为正常分段部分很有可能出现了误差。那么,电子设备100可以从分段部分A i和分段部分A i+1的交点至起始点的方向查找新的异常分段部分和正常部分的交点,并将该新的交点确定为分界点。这可以提高确定用户期望线条回退的位置的准确性。 The above method can reduce the inaccurate determination of the demarcation point due to misjudgment of the abnormal situation of the segmentation part. For example, in the scenario shown in FIG. 7 , the first five segment parts of the segment part A i are all abnormal segment parts. Then, the electronic device 100 may have an error in judging the segmented portion A i as a normal segmented portion. Then, the electronic device 100 can search the intersection point of the new abnormal segment part and the normal part from the intersection point of the segment part Ai and the segment part Ai +1 to the starting point, and determine the new intersection point as the demarcation point . This can improve the accuracy of determining where the user expects the line to fall back.
可选的,电子设备100还可以按照上述方法来判断离交点y2最近的若干个分段部分是否为正常分段部分,从而判断将y2确定为分界点是否合适。Optionally, the electronic device 100 may also judge whether several segmented parts closest to the intersection point 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.
在一些实施例中,响应于一次作用在分段回退控件215的用户操作,电子设备100可以根据前述图7所示的方法判断一条线条(如绘制时间最晚的一条线条)是否存在异常分段部分。若存在异常分段部分,电子设备100可以根据前述实施例的方法将线条回退至分界点。 进一步的,若这一次作用在分段回退控件215的用户操作的持续时间超过预设时间,电子设备100可以在超过预设时间的时间段内,按照前述图5所示的方法对输入面板中的线条从上述分界点处进行分段回退。上述预设时间可以根据经验值设定(如1s)。本申请实施例对上述预设时间的取值不作限定。In some embodiments, in response to a user operation acting on the segmentation rollback control 215, the electronic device 100 can determine whether a line (such as the line with the latest drawing time) has an abnormal score according to the method shown in FIG. 7 . segment part. If there is an abnormal segmented portion, the electronic device 100 may roll back the line to the demarcation point according to the method of the aforementioned embodiment. Further, if the duration of the user operation acting on the segmented back control 215 exceeds the preset time, the electronic device 100 may, within the time period exceeding the preset time, change the input panel according to the method shown in FIG. 5 . The lines in are backed off piecewise from the breakpoint above. The aforementioned preset time may be set according to experience values (eg, 1s). The embodiment of the present application does not limit the value of the foregoing preset time.
在一些实施例中,响应于一次作用在分段回退控件215的用户操作,电子设备100可以按照前述图7所示的方法对一条存在异常分段部分的线条进行回退,将该线条回退至上述分界点处。进一步的,电子设备100再次检测到作用在分段回退控件215的用户操作,电子设备100可以按照前述图5所示的方法对输入面板中的线条从上述分界点处进行分段回退。In some embodiments, in response to a user operation on the segment rollback control 215, the electronic device 100 can roll back a line with an abnormal segment part according to the method shown in FIG. Retreat to the above-mentioned dividing point. Further, the electronic device 100 again detects the user operation acting on the segment rollback control 215, and the electronic device 100 may perform segment rollback of the lines in the input panel from the above-mentioned dividing point according to the method shown in FIG. 5 .
在一些实施例中,电子设备100根据前述图7所示的方法将一条存在异常分段部分的线条回退至上述分界点之后,电子设备100还可以对这一条线条从分界点至结束点包含的多个分段部分进行分段恢复。以前述线条218E为例进行说明。如图7所示,经过线条回退,指针指向栈D中的图层A i。响应于作用在分段恢复控件216的用户操作,电子设备100可以将指针按照从栈D的栈底向栈顶的方向移动,且移动的步长为一个图层。电子设备100移动指针的速度可以参考前述实施例中电子设备100分段恢复线条的速度。这里不再赘述。那么,从上述线条218E的分界点至结束点的各分段部分,可以逐个被恢复,再次显示在输入面板218上。 In some embodiments, the electronic device 100 rolls back a line with an abnormal segment part to the above-mentioned dividing point according to the method shown in FIG. 7 , and the electronic device 100 can also include Segment recovery of multiple segment parts. Take the aforementioned line 218E as an example for illustration. As shown in FIG. 7 , after the line is rolled back, the pointer points to the layer A i in the stack D. In response to the user operation acting on the segment recovery control 216, the electronic device 100 may move the pointer from the bottom of the stack D to the top of the stack, and the moving step is one layer. The speed at which the electronic device 100 moves the pointer may refer to the speed at which the electronic device 100 restores the line segmentally in the foregoing embodiments. I won't go into details here. Then, the segments from the boundary point to the end point of the line 218E can be restored one by one and displayed on the input panel 218 again.
图8为本申请实施例提供的一种基于输入面板的线条回退方法的流程图。FIG. 8 is a flow chart of an input panel-based line fallback method provided by an embodiment of the present application.
如图8所示,该方法可包括步骤S101~S107。其中:As shown in FIG. 8, the method may include steps S101-S107. in:
S101、电子设备100可以检测到一次作用在输入面板的滑动操作,并根据该滑动操作的轨迹在输入面板显示线条Z。S101. The electronic device 100 may detect a sliding operation on the input panel, and display a line Z on the input panel according to the trajectory of the sliding operation.
S102、电子设备100可以根据绘制时间对线条Z进行分段存储,线条Z的一个分段部分是时间段t分段内的滑动操作的轨迹对应的线条。S102. The electronic device 100 may store the line Z in segments according to the drawing time, and a segment of the line Z is a line corresponding to a trajectory of a sliding operation within a time segment t.
电子设备100对线条Z进行分段存储的方法可以参考前述图5所示对线条218B进行分段存储的方法。这里不再赘述。其中时间段t分段的取值可以根据经验值设定。本申请实施例对此不作限定。The method for the electronic device 100 to store the line Z in segments may refer to the method for storing the line 218B in segments shown in FIG. 5 . I won't go into details here. The value of the time segment t segment can be set according to empirical values. This embodiment of the present application does not limit it.
S103、电子设备100可以判断线条Z结束点所在的分段部分是否是异常分段部分。S103. The electronic device 100 may determine whether the segment where the end point of the line Z is located is an abnormal segment.
线条Z可以包括多个分段部分。电子设备100可以检测线条Z的各分段部分的绘制速度。一个分段部分的绘制速度可以由这一个分段部分的长度与上述步骤S102中时间段t分段的长度确定。Line Z may include multiple segmented parts. The electronic device 100 may detect the drawing speed of each segmented portion of the line Z. The drawing speed of a segment part may be determined by the length of the segment part and the length of the time segment t segment in the above step S102.
电子设备100可以根据一个分段部分的绘制速度来判断这一个分段部分是否是异常分段部分,具体的判断方法可以参考前述实施例,这里不在赘述。The electronic device 100 may judge whether a segment part is an abnormal segment part according to the drawing speed of a segment part. For a specific determination method, reference may be made to the foregoing embodiments, which will not be repeated here.
根据一条线条出现异常分段部分的原因可知,如果一条线条出现异常分段部分,那么这一条线条从中间一个节点开始至这一条线条的结束点所包含的分段部分通常均为异常分段部分。如果一条线条结束点所在的分段部分为正常分段部分,那么这一条线条出现异常分段部分的可能性比较小。电子设备100可以通过先判断一条线条结束点所在的分段部分是否是异常分段部分来判断这一条线条是否出现异常分段部分。According to the reason why a line has an abnormal segmented part, if a line has an abnormal segmented part, the segmented parts from the middle node to the end point of this line are usually abnormal segmented parts . If the segment part where the end point of a line is located is a normal segment part, then the possibility of abnormal segment part of this line is relatively small. The electronic device 100 may determine whether an abnormal segment occurs in a line by first determining whether the segment where the end point of a line is located is an abnormal segment.
若线条Z结束点所在的分段部分不是异常分段判断,电子设备100可以确定线条Z不存在异常分段部分,执行下述步骤S104。If the segment part where the end point of the line Z is located is not an abnormal segment judgment, the electronic device 100 may determine that there is no abnormal segment part in the line Z, and execute the following step S104.
若线条Z结束点所在的分段部分的速度超过速度阈值,电子设备100可以确定线条Z存在异常分段部分,执行下述步骤步骤S105。If the speed of the section where the end point of the line Z is located exceeds the speed threshold, the electronic device 100 may determine that there is an abnormal section in the line Z, and execute the following step S105 .
可选的,在一些实施例中,电子设备100可以与线条Z结束点最接近的若干个分段部分的绘制速度是否超过速度阈值。若与线条Z结束点最接近的若干个分段部分中所有或者多数(如80%以上的)分段部分的绘制速度超过速度阈值,电子设备100可以确定线条Z存在异常分段部分。否则,电子设备100可以确定线条Z不存在异常分段部分。这可以减少由于结束点所在的分段部分的绘制速度计算失误而导致电子设备100判断是否存在异常分段部分出现误差的情况,提高检测的准确率。Optionally, in some embodiments, the electronic device 100 may determine whether the drawing speed of several segmented parts closest to the end point of the line Z exceeds a speed threshold. If the drawing speed of all or most (eg more than 80%) of the several segmented parts closest to the end point of the line Z exceeds the speed threshold, the electronic device 100 may determine that there is an abnormal segmented part in the line Z. Otherwise, the electronic device 100 may determine that there is no abnormal segmented portion in the line Z. This can reduce errors in the electronic device 100 judging whether there is an abnormal segment due to incorrect calculation of the drawing speed of the segment where the end point is located, and improve detection accuracy.
S104、若线条Z结束点所在的分段部分为正常分段部分(即不是异常分段部分),响应于一次用于进行分段回退且持续时间为tc的用户操作,在时间段tc内,电子设备100可以在输入面板中将线条Z的分段部分按照从结束点到起始点的方向逐个移除,移除的速度由检测到的用于进行分段回退的用户操作的频率确定,用于进行分段回退的用户操作的频率越高,移除的速度越低。S104. If the segment part where the end point of the line Z is located is a normal segment part (that is, not an abnormal segment part), in response to a user operation for segment rollback with a duration of tc, within the time period tc , the electronic device 100 can remove the segmented parts of the line Z one by one in the direction from the end point to the starting point in the input panel, and the removal speed is determined by the frequency of the detected user operation for performing segment rollback , the higher the frequency of user actions for segment rollback, the slower the removal rate.
上述用于进行分段回退的用户操作可以为作用在图4A所示分段回退控件215的用户操作。The aforementioned user operation for segment rollback may be a user operation acting on the segment rollback control 215 shown in FIG. 4A .
在一些实施例中,在该持续时间为tc的用户操作作用的时间段内,电子设备100分段回退线条Z的速度可以是恒定的。该速度的大小可以由电子设备100检测到的用于进行分段回退的用户操作的频率确定。电子设备100根据上述频率确定回退线条的速度的方法可以参考前述实施例。这里不再赘述。其中,若在该持续时间tc内,线条Z的所有分段部分均被回退,电子设备100可以继续分段回退绘制时间在线条Z之前且与线条Z的绘制时间最临近的线条。In some embodiments, during the time period of the user operation with a duration of tc, the speed at which the electronic device 100 retracts the line Z in segments may be constant. The magnitude of the speed may be determined by the frequency of user operations detected by the electronic device 100 for segment backing. For the method for the electronic device 100 to determine the speed of the receding line according to the above frequency, reference may be made to the foregoing embodiments. I won't go into details here. Wherein, if within the duration tc, all segmented portions of the line Z are retracted, the electronic device 100 may continue segmentally retracting the line whose drawing time is before the line Z and is closest to the drawing time of the line Z.
在一些实施例中,在该持续时间为tc的用户操作作用的时间段内,电子设备100分段回退线条Z的速度可以是变化的。电子设备100可以在该持续时间tc内分阶段调整回退线条的速度。例如,0-tc1秒为vc1。tc1-tc2秒为vc2。……。tci-tc秒为vc。其中,随着时间的增长,电子设备100可以将提高回退线条的速度。即vc1、vc2、……、vc的大小是逐渐变大的。电子设备100根据一次用于进行分段回退的用户操作持续时间的长度来调整回退线条的速度的具体方法可以参考前述实施例。另外,上述vc1为该持续时间tc内的初始速度。响应于一次用于进行分段回退的用户操作,电子设备100可以对输入面板中的线条进行分段回退。其中电子设备100对线条分段回退的初始速度可以由检测到的用于进行分段回退的用户操作的频率确定。In some embodiments, during the time period of the user operation with a duration of tc, the speed at which the electronic device 100 retracts the line Z by segment may vary. The electronic device 100 may adjust the speed of the retracted line in stages within the duration tc. For example, 0-tc1 seconds for vc1. tc1-tc2 seconds are vc2. .... tci-tc seconds for vc. Wherein, as time increases, the electronic device 100 may increase the speed of rolling back lines. That is, the sizes of vc1, vc2, ..., vc gradually increase. For a specific method for the electronic device 100 to adjust the speed of the rollback line according to the duration of one user operation for segment rollback, reference may be made to the foregoing embodiments. In addition, the above-mentioned vc1 is the initial velocity within the duration tc. In response to a user operation for performing segment return, the electronic device 100 may perform segment return on the lines in the input panel. The initial speed at which the electronic device 100 rolls back the line segment may be determined by the frequency of the detected user operation for performing segment rollback.
本申请实施例对上述持续时间tc的阶段划分的具体区间不作限定。The embodiment of the present application does not limit the specific interval of the stage division of the above-mentioned duration tc.
可以理解的,一次用于进行分段回退的用户操作的持续时间越长可以说明需要回退的分段部分较多,且线条当前回退的位置与用户期望的位置之间的距离仍然比较大。电子设备100可以逐渐增大在一次用户进行分段回退的用户操作的持续时间段内分段回退线条的速度,以提高回退的效率。It can be understood that the longer the duration of a user operation for segment rollback, it means that there are more segments that need to roll back, and the distance between the current rollback position of the line and the user's expected position is still relatively large. big. The electronic device 100 may gradually increase the speed of the segmented rewinding line within the duration of one user operation of the user performing segmented rewinding, so as to improve the efficiency of rewinding.
S105、若线条Z结束点所在的分段部分是异常分段部分,电子设备100可以确定线条Z的正常分段部分和异常分段部分的分界点。S105. If the segment part where the end point of the line Z is located is an abnormal segment part, the electronic device 100 may determine a boundary point between a normal segment part and an abnormal segment part of the line Z.
在一种可能的实现方式中,电子设备100可以按照从线条Z的结束点向起始点的方向,逐个确定线条Z的分段部分是否是异常分段部分。具体的,电子设备100已经判断出线条Z结束点所在的分段部分为异常分段部分。进一步的,电子设备100可以判断该结束点所在的分段部分之前的分段部分是否是异常分段部分,直至确定出线条Z中从结束点至起始点方向上第一个异常分段部分与正常分段部分的交点。电子设备100可以将该交点确定为线条Z的 正常分段部分和异常分段部分的分界点。In a possible implementation manner, the electronic device 100 may determine whether the segmented parts of the line Z are abnormal segmented parts one by one in a direction from the end point of the line Z to the starting point. Specifically, the electronic device 100 has determined that the segment where the end point of the line Z is located is an abnormal segment. Further, the electronic device 100 may determine whether the segment part before the segment part where the end point is located is an abnormal segment part, until the first abnormal segment part in the direction from the end point to the start point in the line Z is determined to be the same as Intersection of normal segmented parts. The electronic device 100 may determine the intersection point as the boundary point between the normal segment part and the abnormal segment part of the line Z.
S106、响应于一次用于进行分段回退的用户操作,电子设备100可以在输入面板中将线条Z从结束点至分界点包含的分段部分移除。S106 , in response to a user operation for segment backing, the electronic device 100 may remove the segment part contained in the line Z from the end point to the dividing point in the input panel.
电子设备100在输入面板中将线条Z从结束点至分界点包含的分段部分异常的方法可以参考前述图7所示的实施例,这里不再赘述。For the method for the electronic device 100 to abnormalize the segmented part of the line Z from the end point to the boundary point in the input panel, reference may be made to the embodiment shown in FIG. 7 , which will not be repeated here.
S107、若步骤S106中一次用户进行分段回退的用户操作的持续时间超过预设时间,在超过预设时间的时间段内,电子设备100可以在输入面板中将线条Z的分段部分按照从分界点到起始点的方向逐个移除,移除的速度由检测到的用于进行分段回退的用户操作的频率确定,用于进行分段回退的用户操作的频率越高,移除的速度越低。S107. If in step S106, the duration of the user operation of a segmented rollback by the user exceeds the preset time, within the time period exceeding the preset time, the electronic device 100 can display the segmented part of the line Z in the input panel according to The direction from the dividing point to the starting point is removed one by one. The removal speed is determined by the detected frequency of user operations for segment rollback. The higher the frequency of user operations for segment rollback, the more The lower the removal rate.
在一些实施例中,在超过上述预设时间的时间段内,电子设备100回退线条Z的速度可以是恒定的。该速度的大小可以由电子设备100检测到的用于进行分段回退的用户操作的频率确定。电子设备100根据上述频率确定回退线条的速度的方法可以参考前述实施例。这里不再赘述。In some embodiments, the speed at which the electronic device 100 retracts the line Z may be constant during a time period exceeding the aforementioned preset time. The magnitude of the speed may be determined by the frequency of user operations detected by the electronic device 100 for segment backing. For the method for the electronic device 100 to determine the speed of the receding line according to the above frequency, reference may be made to the foregoing embodiments. I won't go into details here.
在一些实施例中,在超过上述预设时间的时间段内,电子设备100回退线条Z的速度可以是变化的。电子设备100可以超过上述预设时间的时间段内分阶段调整回退线条的速度。具体的方法可以参考前述实施例。这里不再赘述。In some embodiments, the speed at which the electronic device 100 retracts the line Z may vary within a time period exceeding the aforementioned preset time. The electronic device 100 may adjust the speed of the retraction line in stages within a time period exceeding the aforementioned preset time. For specific methods, reference may be made to the foregoing embodiments. I won't go into details here.
由步骤S107可知,若一条线条异常分段部分,用户按下分段回退控件215,电子设备100可以将这一条线条从结束点回退至上述分界点。若用户仍想继续回退这一条线条,用户可以持续按下分段回退控件215。电子设备100可以继续从上述分界点处对这一条线条进行分段回退。即用户可以不用停止这一次作用在分段回退控件215的用户操作,再次按下分段回退控件215。It can be known from step S107 that if a line is abnormally segmented and the user presses the segment back control 215, the electronic device 100 can roll back the line from the end point to the above-mentioned dividing point. If the user still wants to continue to roll back this line, the user can continue to press the segmented rollback control 215 . The electronic device 100 may continue to retreat the line by segment from the above-mentioned dividing point. That is, the user may press the segment rollback control 215 again without stopping the user operation acting on the segment rollback control 215 this time.
由图8所示的方法可知,电子设备100不仅可以对输入面板中的线条进行分段回退,并调整分段回退过程中回退的速度,以便于用户更便捷地将线条回退至自己期望的状态。电子设备100还可以根据线条的绘制速度来判断线条中是否出现异常部分,并估计一条线条异常部分与正常部分的分界点,从而实现在回退时快速回退至异常部分与正常部分的分界点。这样,电子设备100通过估计用户期望回退的位置,并在回退时将线条直接回退至上述估计的位置,简化了用户回退线条时的用户操作,提高了用户体验。As can be seen from the method shown in FIG. 8 , the electronic device 100 can not only roll back the lines in the input panel by segments, but also adjust the rollback speed during the rollback by segments, so that the user can roll back the lines more conveniently. the desired state. The electronic device 100 can also judge whether there is an abnormal part in the line according to the drawing speed of the line, and estimate the boundary point between the abnormal part and the normal part of a line, so as to quickly roll back to the boundary point between the abnormal part and the normal part during rollback . In this way, the electronic device 100 simplifies the user operation when the user returns the line and improves the user experience by estimating the position where the user expects to return, and directly returning the line to the estimated position when returning.
在一些实施例中,图8所示的步骤S103、步骤S105~S107是可选的。即电子设备100可以对线条Z进行分段存储,并在检测到用于进行分段回退的用户操作时,按照步骤S104中的方法对线条Z进行分段回退。上述步骤S101、步骤S102和步骤S104组成的实施例即为前述图3A~图3C、图4A~图4C、图5所示的实施例。In some embodiments, step S103 and steps S105 to S107 shown in FIG. 8 are optional. That is, the electronic device 100 may store the line Z in segments, and perform segment rollback on the line Z according to the method in step S104 when a user operation for performing segment rollback is detected. The embodiment composed of the above step S101 , step S102 and step S104 is the embodiment shown in FIGS. 3A to 3C , 4A to 4C , and 5 .
在一些实施例中,图8所示的步骤S104和步骤S107是可选的。即电子设备100在判断出线条Z结束点所在的分段部分是异常分段部分时,可以按照步骤S105和步骤S106的中的方法对线条Z进行回退。其中,当判断出线条Z结束点所在的分段部分不是异常分段部分时,图6A所示的分段回退控件215的状态为不可用的状态(如分段回退控件215呈现为灰色)。上述步骤S101~S106组成的实施例即为前述图6A、图6B、图7所示的实施例。In some embodiments, step S104 and step S107 shown in FIG. 8 are optional. That is, when the electronic device 100 determines that the segment where the end point of the line Z is located is an abnormal segment, the line Z may be rolled back according to the methods in steps S105 and S106. Wherein, when it is judged that the segment part where the end point of the line Z is located is not an abnormal segment part, the state of the segment rollback control 215 shown in FIG. ). The embodiment composed of the above-mentioned steps S101 to S106 is the embodiment shown in FIG. 6A , FIG. 6B , and FIG. 7 .
在一些实施例中,响应于一次作用在分段回退控件215的用户操作,电子设备100可以回退一个分段部分。响应于一次作用在分段恢复控件215的用户操作,电子设备100可以恢 复一个被回退的分段部分。In some embodiments, in response to a user operation on the segment rollback control 215, the electronic device 100 can roll back a segment portion. In response to a user operation acting on the segment recovery control 215, the electronic device 100 can recover a segment portion that was rolled back.
以上所述,以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的范围。As mentioned above, the above embodiments are only used to illustrate the technical solutions of the present application, and are not intended to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: it can still understand the foregoing The technical solutions described in each embodiment are modified, or some of the technical features are replaced equivalently; and these modifications or replacements do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the various embodiments of the application.

Claims (15)

  1. 一种线条回退方法,其特征在于,所述方法包括:A line rollback method, characterized in that the method comprises:
    电子设备在显示屏上显示有第一线条,所述第一线条是所述电子设备根据在所述显示屏上检测到的单次滑动操作的轨迹绘制的;The electronic device displays a first line on the display screen, and the first line is drawn by the electronic device according to a track of a single sliding operation detected on the display screen;
    所述电子设备接收到第一用户操作,所述第一用户操作用于触发所述电子设备对显示在所述显示屏上的线条按照绘制时间从晚到早的顺序进行分段回退;The electronic device receives a first user operation, and the first user operation is used to trigger the electronic device to roll back the lines displayed on the display screen in order of drawing time from late to early;
    所述电子设备根据所述第一用户操作,将所述第一线条的结束点到所述第一线条的第一位置的部分从所述显示屏移除。The electronic device removes the part from the end point of the first line to the first position of the first line from the display screen according to the first user operation.
  2. 根据权利要求1所述的方法,其特征在于,所述第一线条包括多个分段,所述多个分段中的一个分段为所述第一线条绘制过程中第一时间段内滑动操作的轨迹对应的线条;The method according to claim 1, wherein the first line includes a plurality of segments, and one segment in the plurality of segments is a slide during the first time period during the drawing of the first line. The line corresponding to the trajectory of the operation;
    所述电子设备根据所述第一用户操作,将所述第一线条的结束点到所述第一线条的第一位置的部分从所述显示屏移除,所述方法包括:The electronic device removes the part from the end point of the first line to the first position of the first line from the display screen according to the first user operation, and the method includes:
    在所述第一用户操作开始时,所述电子设备按照从所述第一线条的结束点至所述第一线条的起始点的方向,以移动步长为所述一个分段,从所述第一线条的结束点所在的分段开始,将所述第一线条的分段从所述显示屏逐个移除;When the first user operation starts, the electronic device moves from the end point of the first line to the start point of the first line with a moving step as the one segment, from the The segment where the end point of the first line is located starts, and the segments of the first line are removed from the display screen one by one;
    在所述第一用户操作结束时,所述第一线条被分段回退至所述第一位置。When the first user operation ends, the first line is segmented back to the first position.
  3. 根据权利要求1或2所述的方法,其特征在于,所述第一用户操作的持续时间为第二时间段,在所述第二时间段内,所述第一线条的结束点到所述第一线条的第一位置的部分从所述显示屏被移除的速度为第一速度;或者,The method according to claim 1 or 2, wherein the duration of the first user operation is a second time period, and within the second time period, the end point of the first line to the the portion of the first line at the first location is removed from the display screen at a first speed; or,
    在所述第二时间段内,所述第一线条的结束点到所述第一线条的第一位置的部分从所述显示屏被移除的速度是变化的,其中,所述第二时间段包括d1个时间区间,所述d1个时间区间中所述被移除的速度的大小按照时间的先后顺序排列是呈现增大趋势的,第一时间区间中所述被移除的速度为所述第一速度,所述第一时间区间是所述d1个时间区间中按时间的先后顺序排列在第一位的时间区间。During the second time period, the speed at which the part from the end point of the first line to the first position of the first line is removed from the display screen is changed, wherein the second time The segment includes d1 time intervals, the size of the removed speeds in the d1 time intervals shows an increasing trend according to the order of time, and the removed speed in the first time interval is The first speed, the first time interval is the first time interval in the order of time among the d1 time intervals.
  4. 根据权利要求3所述的方法,其特征在于,所述第一用户操作是一次作用在第一控件上的用户操作,所述方法还包括:The method according to claim 3, wherein the first user operation is a user operation acting on the first control, and the method further comprises:
    所述电子设备确定在接收到所述第一用户操作之前的第三时间段内,还接收到a1次作用在所述第一控件上的用户操作;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;
    所述电子设备根据所述a1的大小以及a1个分段回退线条的速度中的一个或多个确定所述第一速度,所述a1个分段回退线条的速度分别为所述a1次作用在所述第一控件上的用户操作作用时间段内,所述电子设备从所述显示屏移除线条的速度;所述a1越大,所述第一速度越慢;所述第一速度低于所述a1个分段回退线条的速度中的一个或多个。The electronic device determines the first speed according to the size of the a1 and one or more of the speeds of the a1 segmented retreat lines, and the speeds of the a1 segmented retreat lines are respectively the a1 times The speed at which the electronic device removes lines from the display screen during the user operation time period acting on the first control; the larger the a1, the slower the first speed; the first speed One or more of the speeds of the a1 segmented back-off lines.
  5. 根据权利要求2-4中任一项所述的方法,其特征在于,所述电子设备在所述显示屏上还显示有第二线条,所述第二线条是所述电子设备根据在所述显示屏上检测到的单次滑动操作的轨迹绘制的,所述第二线条的绘制时间早于所述第一线条的绘制时间;所述第二线条包 括多个分段,所述多个分段为所述第二线条绘制过程中所述第一时间段内滑动操作的轨迹对应的线条;所述第一用户操作是一次作用在第一控件上的用户操作;The method according to any one of claims 2-4, wherein the electronic device further displays a second line on the display screen, and the second line is the electronic device according to the The trajectory of a single sliding operation detected on the display screen is drawn, 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, and the plurality of segments The segment is the line corresponding to the trajectory of the sliding operation within the first time period during the second line drawing process; the first user operation is a user operation acting on the first control;
    所述将所述第一线条的结束点到所述第一线条的第一位置的部分从所述显示屏移除之后,所述方法还包括:After the part from the end point of the first line to the first position of the first line is removed 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 moves in a direction from the first position to the starting point of the first line with a moving step of the one Segmenting, starting from the first position, removing segments of the first line from the display screen one by one;
    若所述第一线条的分段全部从所述显示屏移除,所述电子设备按照从所述第二线条的结束点至所述第二线条的起始点的方向,以移动步长为所述一个分段,从所述第二线条的结束点开始,将所述第二线条的分段从所述显示屏逐个移除。If all the segments of the first line are removed from the display screen, the electronic device moves from the end point of the second line to the starting point of the second line with a moving step of The segment is selected, and the segments of the second line are removed from the display screen one by one starting from the end point of the second line.
  6. 根据权利要求1所述的方法,其特征在于,所述第一线条包括多个分段,所述多个分段中的一个分段为所述第一线条绘制过程中第一时间段内滑动操作的轨迹对应的线条;The method according to claim 1, wherein the first line includes a plurality of segments, and one segment in the plurality of segments is a slide during the first time period during the drawing of the first line. The line corresponding to the trajectory of the operation;
    所述将所述第一线条的结束点到所述第一线条的第一位置的部分从所述显示屏移除之前,所述方法还包括:Before removing the part from the end point of the first line to the first position of the first line from the display screen, the method further includes:
    所述电子设备计算所述多个分段的绘制速度,所述一个分段的绘制速度根据所述第一个分段的长度和所述第二时间段内的长度确定;The electronic device calculates the drawing speed of the plurality of segments, and the drawing speed of the one segment is determined according to the length of the first segment and the length in the second time period;
    所述电子设备根据一个分段的绘制速度判断所述一个分段是异常分段还是正常分段,所述异常分段是所述绘制速度高于第一阈值的分段,所述正常分段是所述绘制速度不高于所述第一阈值的分段;The electronic device judges whether the segment is an abnormal segment or a normal segment according to the drawing speed of a segment, the abnormal segment is a segment whose drawing speed is higher than a first threshold, and the normal segment is is a segment whose rendering 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, and the first position is from the first line in the first line. The intersection point of the first abnormal segment and the normal segment in the direction from the end point of the line to the start point of the first line.
  7. 根据权利要求6所述的方法,其特征在于,所述将所述第一线条的结束点到所述第一线条的第一位置的部分从所述显示屏移除,所述方法包括:The method according to claim 6, wherein the part from the end point of the first line to the first position of the first line is removed from the display screen, the method comprising:
    所述电子设备将所述第一线条中从所述结束点到所述第一位置之间的所有分段同时从所述显示屏移除。The electronic device simultaneously removes all segments in the first line from the end point to the first position from the display screen.
  8. 根据权利要求6或7所述的方法,其特征在于,所述第一用户操作的持续时间为第二时间段,所述第二时间段的长度超过第二阈值,所述方法还包括:The method according to claim 6 or 7, wherein the duration of the first user operation is a second time period, and the length of the second time period exceeds a second threshold, and the method further comprises:
    在所述第二时间段内超过所述第二阈值的时间段内,所述电子设备按照从所述第一位置至所述第一线条的起始点的方向,以移动步长为所述一个分段,以移动速度为第二速度,从所述第一位置开始,将所述第一线条的分段从所述显示屏逐个移除。During the period of time exceeding the second threshold within the second period of time, the electronic device moves in the direction from the first position to the starting point of the first line with a moving step of the one segmenting, taking the moving speed as the second speed, starting from the first position, and removing the segments of the first line from the display screen one by one.
  9. 根据权利要求1-8中任一项所述的方法,其特征在于,所述将所述第一线条的结束点到所述第一线条的第一位置的部分从所述显示屏移除之后,所述方法还包括:The method according to any one of claims 1-8, wherein after removing the part from the end point of the first line to the first position of the first line from the display screen, , the method also includes:
    所述电子设备接收到第三用户操作,所述第三用户操作用于触发所述电子设备对被回退且未被恢复的线条按照回退时间从晚到早的顺序进行分段恢复;The electronic device receives a third user operation, and the third user operation is used to trigger the electronic device to recover the lines that have been rolled back and not recovered by segment according to the order of the rollback time from late to early;
    所述电子设备根据所述第三用户操作,将所述第一位置到所述第一线条的第二位置的部 分显示在所述显示屏上,所述第二位置位于所述第一位置与所述第一线条的结束点之间。The electronic device displays the part from the first position to the second position of the first line on the display screen according to the third user operation, and the second position is between the first position and the first line. between the end points of the first line.
  10. 根据权利要求9所述的方法,其特征在于,所述第一线条包括多个分段,所述多个分段中的一个分段为所述第一线条绘制过程中第一时间段内滑动操作的轨迹对应的线条;The method according to claim 9, wherein the first line includes a plurality of segments, and one segment in the plurality of segments is a slide during the first time period during the drawing of the first line. The line corresponding to the trajectory of the operation;
    所述电子设备根据所述第三用户操作,将所述第一位置到所述第一线条的第二位置的部分显示在所述显示屏上,所述方法包括:The electronic device displays the part from the first position to the second position of the first line on the display screen according to the third user operation, and the method includes:
    在所述第三用户操作开始时,所述电子设备按照从所述第一位置至所述第一线条的结束点的方向,以移动步长为所述一个分段,从所述第一位置开始,将所述第一线条中已从所述显示屏移除的分段逐个显示在所述显示屏上;When the third user operation starts, the electronic device moves from the first position to the end point of the first line, with the moving step as the one segment, from the first position Initially, displaying segments of the first line that have been removed from the display screen one by one on the display screen;
    在所述第三用户操作结束时,所述第一线条被分段恢复至所述第二位置。At the end of the third user operation, the first line is segmented back to the second position.
  11. 根据权利要求9或10所述的方法,其特征在于,所述第三用户操作的持续时间为第四时间段,在所述第四时间段内,所述第一位置到所述第一线条的第二位置的部分分段恢复的速度为第三速度;或者,The method according to claim 9 or 10, wherein the duration of the third user operation is a fourth time period, and within the fourth time period, the distance from the first position to the first line Partial segmental recovery of the second position at the third speed; or,
    在所述第四时间段内,所述第一位置到所述第一线条的第二位置的部分分段恢复的速度是变化的,其中,所述第四时间段包括d2个时间区间,所述d2个时间区间中所述分段恢复的速度的大小按照时间的先后顺序排列是呈现增大趋势的,第二时间区间中所述分段恢复的速度为所述第三速度,所述第二时间区间是所述d2个时间区间中按时间的先后顺序排列在第一位的时间区间。In the fourth time period, the speed of partial segment recovery from the first position to the second position of the first line is changed, wherein the fourth time period includes d2 time intervals, so The speed of segmental recovery in the d2 time intervals shows an increasing trend according to the order of time, the speed of segmental recovery in the second time interval is the third speed, and the second speed is the third speed. The second time interval is the first time interval in the order of time among the d2 time intervals.
  12. 根据权利要求11所述的方法,其特征在于,所述第三用户操作是一次作用在第二控件上的用户操作,所述方法还包括:The method according to claim 11, wherein the third user operation is a user operation acting on the second control, and the method further comprises:
    所述电子设备确定在接收到所述第三用户操作之前的第五时间段内,还接收到a2次作用在所述第二控件上的用户操作;The electronic device determines that within a fifth time period before receiving the third user operation, it also receives a2 user operations acting on the second control;
    所述电子设备根据所述a2的大小以及a2个分段恢复线条的速度中的一个或多个确定所述第三速度,所述a2个分段恢复线条的速度分别为所述a2次作用在所述第二控件上的用户操作作用时间段内,所述电子设备分段恢复线条的速度;所述a2越大,所述第三速度越慢;所述第三速度低于所述a2个分段恢复线条的速度中的一个或多个。The electronic device determines the third speed according to one or more of the size of the a2 and the speeds of the a2 segmented restoration lines, and the speeds of the a2 segmental restoration lines are respectively the a2 times acting on the During the time period during which the user operates on the second control, the electronic device restores the speed of the line segmentally; the larger the a2 is, the slower the third speed is; the third speed is lower than the a2 One or more of the velocities of the restored lines in segments.
  13. 根据权利要求10-12中任一项所述的方法,其特征在于,在所述第一用户操作之前,第三线条的所有分段均从所述显示屏上移除,所述第三线条是所述电子设备根据在所述显示屏上检测到的单次滑动操作的轨迹绘制的,所述第三线条的绘制时间晚于所述第一线条的绘制时间;所述第三线条包括多个分段,所述多个分段为所述第三线条绘制过程中所述第一时间段内滑动操作的轨迹对应的线条;所述第三线条的回退时间早于所述第一线条的回退时间;所述第三用户操作是一次作用在第二控件上的用户操作;The method according to any one of claims 10-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 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 includes multiple segments, the multiple segments are the lines corresponding to the trajectory of the sliding operation in the first time period during the third line drawing process; the rollback time of the third line is earlier than that of the first line The fallback time; the third user operation is a user operation acting on the second control;
    所述将所述第一位置到所述第一线条的第二位置的部分显示在所述显示屏上之后,所述方法还包括:After displaying the part 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 period of time when the fourth user operation acts on the second control, the electronic device moves in a step length of the one according to the direction from the second position to the end point of the first line. Segmenting, starting from the second position, displaying the segments of the first line that have been removed from the display screen one by one on the display screen;
    若所述第一线条中已从所述显示屏移除的分段全部显示在所述显示屏上,所述电子设备按照从所述第三线条的起始点至所述第三线条的结束点的方向,以移动步长为所述一个分段,从所述第三线条的起始点开始,将所述第三线条中已从所述显示屏移除的分段逐个显示在所述显示屏上。If the segments in the first line that have been removed from the display screen are all displayed on the display screen, the electronic device proceeds from the starting point of the third line to the end point of the third line direction, with the moving step as the one segment, starting from the starting point of the third line, the segments removed from the display screen in the third line are displayed on the display screen one by one superior.
  14. 一种电子设备,其特征在于,所述电子设备包括显示屏、存储器、处理器,所述存储器用于存储计算机程序,所述处理器用于调用所述计算机程序,使得所述电子设备执行权利要求1-13中任一项所述的方法。An electronic device, characterized in that the electronic device includes a display screen, a memory, and a processor, 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 claims The method described in any one of 1-13.
  15. 一种计算机可读存储介质,包括指令,其特征在于,当所述指令在电子设备上运行,使得所述电子设备执行权利要求1-13中任一项所述的方法。A computer-readable storage medium, comprising instructions, wherein when the instructions are run on an electronic device, the electronic device is made to execute the method according to any one of claims 1-13.
PCT/CN2022/094377 2021-05-29 2022-05-23 Line rollback method for input panel and related apparatus WO2022253016A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110595997.X 2021-05-29
CN202110595997.XA CN115480654A (en) 2021-05-29 2021-05-29 Line backspacing method of input panel and related device

Publications (1)

Publication Number Publication Date
WO2022253016A1 true WO2022253016A1 (en) 2022-12-08

Family

ID=84323874

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/094377 WO2022253016A1 (en) 2021-05-29 2022-05-23 Line rollback method for input panel and related apparatus

Country Status (2)

Country Link
CN (1) CN115480654A (en)
WO (1) WO2022253016A1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140101643A1 (en) * 2012-10-04 2014-04-10 International Business Machines Corporation Trace generation method, trace generation device, trace generation program product, and multi-level compilation using trace generation method
CN106445087A (en) * 2015-07-21 2017-02-22 阿里巴巴集团控股有限公司 Method and device for canceling input operation
CN109215098A (en) * 2018-08-20 2019-01-15 广州视源电子科技股份有限公司 Handwriting erasing method and apparatus
CN110415315A (en) * 2019-06-27 2019-11-05 五八有限公司 Touch method, apparatus, terminal and the storage medium in map making region

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140101643A1 (en) * 2012-10-04 2014-04-10 International Business Machines Corporation Trace generation method, trace generation device, trace generation program product, and multi-level compilation using trace generation method
CN106445087A (en) * 2015-07-21 2017-02-22 阿里巴巴集团控股有限公司 Method and device for canceling input operation
CN109215098A (en) * 2018-08-20 2019-01-15 广州视源电子科技股份有限公司 Handwriting erasing method and apparatus
CN110415315A (en) * 2019-06-27 2019-11-05 五八有限公司 Touch method, apparatus, terminal and the storage medium in map making region

Also Published As

Publication number Publication date
CN115480654A (en) 2022-12-16

Similar Documents

Publication Publication Date Title
EP4221164A1 (en) Display method for electronic device with flexible display and electronic device
WO2021000881A1 (en) Screen splitting method and electronic device
CN112394811B (en) Interaction method of air-separation gestures and electronic equipment
KR20210118168A (en) Gesture processing method and device
CN114140365B (en) Event frame-based feature point matching method and electronic equipment
US20200252502A1 (en) Method for responding to incoming call by means of fingerprint recognition, storage medium, and mobile terminal
CN112527093A (en) Gesture input method and electronic equipment
CN116069212A (en) Quick looking-up method for application card, electronic equipment and storage medium
CN113448482A (en) Sliding response control method and device of touch screen and electronic equipment
CN114979465B (en) Video processing method, electronic device and readable medium
CN117130469A (en) Space gesture recognition method, electronic equipment and chip system
CN112541861A (en) Image processing method, device, equipment and computer storage medium
WO2024045661A1 (en) Image processing method and electronic device
WO2024032124A1 (en) Method for folding and unfolding scroll screen and related product
CN116389884B (en) Thumbnail display method and terminal equipment
WO2022253016A1 (en) Line rollback method for input panel and related apparatus
WO2022062985A1 (en) Method and apparatus for adding special effect in video, and terminal device
EP4057122A1 (en) Screenshot method and related device
CN114968059B (en) Control sliding method and electronic equipment
CN116055870B (en) Photographing method and electronic equipment
CN116048236B (en) Communication method and related device
CN116521018B (en) False touch prompting method, terminal equipment and storage medium
WO2022166550A1 (en) Data transmission method and electronic device
WO2023116411A1 (en) Management method for application card, electronic device, and storage medium
CN116027919B (en) Touch screen control method, electronic device, chip and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22815063

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 22815063

Country of ref document: EP

Kind code of ref document: A1