WO2020210975A1 - 选取子轨迹的方法、电子设备、计算机可读存储介质 - Google Patents

选取子轨迹的方法、电子设备、计算机可读存储介质 Download PDF

Info

Publication number
WO2020210975A1
WO2020210975A1 PCT/CN2019/082849 CN2019082849W WO2020210975A1 WO 2020210975 A1 WO2020210975 A1 WO 2020210975A1 CN 2019082849 W CN2019082849 W CN 2019082849W WO 2020210975 A1 WO2020210975 A1 WO 2020210975A1
Authority
WO
WIPO (PCT)
Prior art keywords
point
track
distance
sub
trajectory
Prior art date
Application number
PCT/CN2019/082849
Other languages
English (en)
French (fr)
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 深圳市柔宇科技有限公司
Priority to CN201980079857.8A priority Critical patent/CN113330404A/zh
Priority to PCT/CN2019/082849 priority patent/WO2020210975A1/zh
Publication of WO2020210975A1 publication Critical patent/WO2020210975A1/zh

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/03Arrangements for converting the position or the displacement of a member into a coded form
    • G06F3/041Digitisers, e.g. for touch screens or touch pads, characterised by the transducing means

Definitions

  • the present invention relates to the field of electronic technology, and in particular to a method, electronic equipment, and computer-readable storage medium for selecting sub-tracks.
  • the main purpose of the present invention is to provide a method, electronic equipment, and computer-readable storage medium for quickly selecting sub-tracks.
  • the present invention provides a method for selecting sub-trajectories, which is applied to an electronic device with a touch display component, the trace is displayed on the touch display component, and the trace includes one or more The sub-trajectory of the trajectory point, the method includes:
  • the touch display component When detecting that the touch display component has a touch operation, obtain the touch point corresponding to the touch operation; calculate the first distance between the touch point and a preset reference point; obtain A set of trajectory points whose distance from a preset reference point falls within a first distance range, and the absolute value of the difference between the first distance range and the first distance value is less than or equal to the first threshold; The target track point with the smallest distance from the touch point; and the sub-track to which the target track point belongs is selected.
  • the present invention also provides an electronic device.
  • the electronic device includes a processor and a memory, the memory stores a computer-executable program, and the processor executes the program to implement the above-mentioned method for selecting a sub-track.
  • the present invention provides a computer-readable storage medium, the computer-readable storage medium stores a computer-executable program, and the program is executed to implement the above-mentioned method of selecting a sub-track.
  • the method for selecting sub-tracks provided by the present invention can select a set of track points in a partial area for calculations according to the first distance between the touch point and the preset reference point to obtain the corresponding sub-tracks, which greatly reduces the amount of calculations. Faster.
  • FIG. 1 is a schematic diagram of the operating environment of a method for selecting sub-trajectories provided by the first embodiment of the present invention.
  • FIG. 2 is a schematic flowchart of a method for selecting sub-tracks according to the first embodiment of the present invention.
  • Fig. 3 is a schematic diagram of a trajectory provided by the first embodiment of the present invention.
  • Fig. 4 is a schematic flowchart of the first embodiment of step S207 in Fig. 2.
  • FIG. 5 is a schematic flowchart of the first implementation example of step S407 shown in FIG. 4.
  • FIG. 6 is a schematic flowchart of the first implementation example of step S209 shown in FIG. 2.
  • 7a-7c are schematic diagrams of the process of selecting the sub-track to which the target track point belongs according to the first embodiment of the present invention.
  • FIG. 8 is a schematic flowchart of the first implementation example of step S205 shown in FIG. 2.
  • FIG. 9 is a schematic flowchart of the second embodiment of step S205 shown in FIG. 2.
  • FIG. 10 is a schematic diagram of the data storage structure of track points provided by the second embodiment of the present invention.
  • FIG. 11 is a schematic flowchart of a method for selecting sub-tracks according to a second embodiment of the present invention.
  • FIG. 12 is a schematic flowchart of a method for selecting sub-tracks according to a third embodiment of the present invention.
  • FIG. 13 is a schematic structural block diagram of an electronic device provided by the first embodiment of the present invention.
  • FIG. 1 is a schematic diagram of the operating environment of a method for selecting sub-trajectories provided by the first embodiment.
  • the electronic device 1 can be an electronic paper, an electronic book, a car display, a tablet computer, a smart phone, a smart watch, a smart bracelet, and the like.
  • Exemplary embodiments of electronic devices include, but are not limited to, electronic devices equipped with iOS@ Android@Windows Phone@ or other operating systems.
  • Electronic devices usually support multiple applications, such as one or more of the following: drawing applications, rendering applications, word processing applications, web page creation applications, disk editing applications, spreadsheet applications, game applications , Phone applications, video conferencing applications, email applications, instant messaging applications, exercise support applications, photo management applications, digital camera applications, digital video camera applications, web browsing applications, digital music players Applications, and/or digital video player applications.
  • the electronic device 1 includes a touch display assembly 10.
  • FIG. 2 is a schematic flowchart of a method for selecting sub-tracks according to the first embodiment.
  • the method for selecting sub-tracks is executed by an electronic device and can select a desired sub-track from the tracks displaying the touch display assembly 10.
  • the track in the touch display component 10 includes one or more sub-tracks with one or more track points.
  • the trajectory may be a trajectory generated by the electronic device 1.
  • the trajectory may also be a trajectory formed after processing the received external trajectory.
  • the external track can be a picture containing the track or a collection of track points.
  • the trajectory is the trajectory generated by the electronic device 1, the trajectory is a collection of continuous trajectory points.
  • the electronic device 1 can detect the external The continuous track points generated by the sliding of the object are recorded and displayed to form the track.
  • the electronic device 1 may divide the trajectory in the image according to a preset rule and obtain corresponding trajectory points to form the trajectory.
  • the preset rule may be based on the trajectory in the image.
  • the feature division can also be based on the location of the trajectory in the image; when the external trajectory sent by the receiving external device is a set of data points, the trajectory can be formed by analyzing the set of trajectory points.
  • each sub-track has one or more continuous track points.
  • the method for selecting sub-tracks includes the following steps.
  • step S201 when a touch operation is detected in the touch display component, a touch point corresponding to the touch operation is acquired. Specifically, when the electronic device 1 displays a track on the touch display assembly 10, it detects whether an external object performs a touch operation on the touch display assembly 10, so as to detect whether the user performs an operation of selecting a sub-track on the track. For example, when the user clicks or long presses the touch display component 10, it can be determined that the user needs to select a sub-track, so as to obtain the corresponding touch point.
  • Step S203 Calculate the first distance between the touch point and the preset reference point.
  • a reference point is selected as the preset reference point O in the touch display assembly 10.
  • the preset reference point O can be any point in the touch display assembly 10.
  • the preset reference point O is the origin of coordinates in the coordinate system of the touch display assembly 10.
  • the electronic device 10 calculates the first distance from the preset reference point according to the coordinates of the touch point D, such as r.
  • Step S205 Obtain a set of trajectory points whose distance from the preset reference point falls within a first distance range, and the absolute value of the difference between the first distance range and the first distance value is less than or equal to a first threshold.
  • the distance between the trajectory point and the preset reference point can be calculated and saved by the electronic device 1 when the trajectory is generated, or it can be calculated when it is detected that the user needs to select a sub-trajectory, that is, it is calculated at this step. Understandably, by obtaining the set of track points whose distance from the preset reference point falls within the first distance range, the set of track points in a specific area surrounding the touch point can be obtained, for example, the track in the area R shown in FIG. 3 Point collection. Understandably, if the distance between no track point and the preset reference point falls within the first range, that is, the set of track points is 0, step S210 is executed. If the track point is not empty, step S207 is executed.
  • Step S207 Obtain the target track point with the smallest distance from the touch point in the track point set. Specifically, when selecting a target trajectory point, only the trajectory point set needs to be selected, which greatly reduces the amount of calculation. Among them, how to obtain the target track point with the smallest distance from the touch point in the track point set will be described in detail below with an example.
  • Step S209 Select the sub-track to which the target track point belongs.
  • selecting the trajectory to which the target trajectory point belongs can be by setting information that can identify the sub-trajectory to the trajectory point, and then selecting the sub-trajectory based on this information; or by setting the associated information between the track points, and then using the association
  • the information process selects sub-tracks, but it is not limited to this. Among them, how to select the sub-track to which the target track point belongs will be described in detail below with an example.
  • a prompt message is issued.
  • the prompt information can be, but is not limited to, triggering the motor of the electronic device 1 to perform a vibration prompt, can also emit a prompt sound, or display prompt information.
  • the distance between the touch point and the preset reference point is used to obtain part of the track points, so as to obtain the sub-track selected by the user according to the part of the track points, without the need to evaluate or calculate all the track points.
  • the calculation amount of the electronic device 1 is greatly reduced and faster.
  • step S207 specifically includes the following steps.
  • Step S401 Calculate the second distance between each track point in the track point set and the touch point.
  • Step S403 Sort the trajectory points in the trajectory point set according to the value of the second distance.
  • Step S405 Obtain the track point corresponding to the minimum value in the second distance.
  • Step S407 Select the target track point according to the track point corresponding to the minimum value in the second distance.
  • the second distance between each track point in the track point set and the touch point is calculated, and the smallest track point is found by sorting the second distance to obtain the target track point.
  • FIG. 5 is a flowchart of sub-steps of step S407.
  • the selection of the trajectory point as the target trajectory point specifically includes the following steps.
  • Step S501 When the number of trajectory points corresponding to the minimum value in the second distance is 1, use the trajectory point as a target trajectory point.
  • step S503 when the number of track points corresponding to the minimum value in the second distance is greater than 1, the detection time of the track points is acquired.
  • the track point includes the track point detection time (as shown in Figure 10).
  • the detection time is used to indicate the sequence of the detection time of the track points, which can also be said to be the sequence of generation of the track points.
  • Step S505 Use the track point with the latest detection time as the target track point.
  • the target trajectory point when there are multiple trajectory points corresponding to the minimum value in the second distance, the target trajectory point can be determined according to the detection time sequence of the trajectory points, which is more in line with the user's need for re-editing notes, for example, The user generally revises the trace in time when the trace drawn at the current moment is wrong.
  • the track point includes a pressure value (as shown in FIG. 10), which is used to indicate the pressure of the touch at the track point.
  • the target trajectory point can also be determined by the magnitude of the pressure, for example, the one with the smallest pressure is used as the target trajectory point.
  • the target trajectory point when there are multiple trajectory points corresponding to the minimum value in the second distance, can also be determined in other ways.
  • the target trajectory point can be determined according to the characteristics of the trajectory point, for example, causing the trajectory Track points that do not conform to the preset shape, etc.
  • FIG. 6 is a schematic flowchart of the sub-steps of step S209.
  • the detailed description is given by taking as an example the selection of the sub-track to which the target track point belongs by setting the association information between the track points.
  • the trajectory point includes a position identifier (as shown in FIG. 10) that is used to indicate the position association relationship with other trajectory points on the sub-track.
  • the position identification includes the start point, the middle point, and the end point.
  • Step S209 includes the following steps.
  • Step S601 Obtain the location identifier of the target track point.
  • the position identifier is used to indicate that the target track point is the starting point, ending point, or the intermediate point between the starting point and ending point in the sub-track.
  • the starting point is the track point with the earliest detection time in the sub-track; the ending point is the sub-track.
  • the track point with the latest detection time in the track Specifically, when the location identifier is the starting point, steps S603 to 605 are performed; when the location identifier is the end point, steps S607 to 609 are performed; when the location identifier is an intermediate point, steps S611 to 613 are performed.
  • Step S603 When the location of the target track point is identified as the starting point, the corresponding track point is detected in the direction of the ending point.
  • Step S605 When the detected track point is the end point, the sub-track composed of the detected track points is taken as the sub-track to which the target track point belongs, as shown in FIG. 7a.
  • step S607 when the target track point is identified as the end point, the corresponding track point is detected in the direction of the starting point.
  • Step S609 When the detected track point is the starting point, the sub-track composed of the detected track points is taken as the sub-track to which the target track point belongs, as shown in FIG. 7b.
  • Step S611 When the target trajectory point is identified as an intermediate point, the corresponding trajectory point is detected in both directions of the starting point and the ending point.
  • Step S613 When the detected track points are the starting point and the ending point, the sub-track composed of the detected track points is taken as the sub-track to which the target track point belongs, as shown in FIG. 7c.
  • step S205 specifically includes the following steps.
  • Step S801 Sort the third distance between each track point of the track and the preset reference point. Specifically, in this embodiment, the third distance may be sorted from largest to smallest or from smallest to largest.
  • Step S803 Find a set of trajectory points whose third distance falls within the first distance range based on the binary search method.
  • the first distance range is a range between a low limit value and a high limit value, for example, the low limit value is r 1 and the high limit value is r 2 .
  • the electronic device 1 obtains a third distance greater than or equal to r 1 and less than or equal to r 2 in the third distance by performing two binary searches; then, obtains the corresponding third distance according to the third distance falling within the first distance range. Track points.
  • the electronic device 1 performs two binary searches to obtain a third distance greater than or equal to r 1 and less than or equal to r 2 in the third distance, which specifically includes: using the dichotomy to find the first distance in the third distance The minimum value of the range, and the use of dichotomy to find the maximum value falling within the first distance range in the third distance, so that the third distance between the minimum value, maximum value, minimum value and maximum value is regarded as the third distance The third distance of a distance range.
  • the third distance is sorted, and two binary searches are performed to obtain the trajectory points that fall within the first distance range, which can quickly acquire the trajectory point set.
  • FIG. 10 is a schematic diagram of the data storage structure of track points provided by the first embodiment of the present invention.
  • each track point of the track is recorded in the electronic device 1 using the data array G1 and the index array G2.
  • Each first element in the data array G1 is each track point data, such as A-F.
  • Each second element in the index array G2 includes the third distance S in each track point and the index value I indexing the third distance to the corresponding track point data in the data array G1, such as S1 ⁇ S6, I1 ⁇ I6 .
  • Finding out the set of trajectory points whose third distance falls within the first distance range based on the binary search method specifically includes the following steps.
  • Step S901 Obtain the third distance falling in the first distance range from the index array G2 based on the binary search method, where the index array G2 is sorted according to the size of the third distance S1 to S6, that is, the second element in the index array G2 The order is sorted according to the third distance S1 to S6.
  • the arrangement order of the second elements corresponding to the multiple same third distances in the index array G2 and the first elements of the data array G1 corresponding to the second elements are The arrangement order in the data array G1 is the same.
  • S1, S2, and S3 have the same distance.
  • S1, S2, and S3 correspond to index values I1, I2, and I3 respectively.
  • I1, I2, and I3 are respectively indexed to the first elements A, B, and C of the data array G1, then the second element containing S1, S2, and S3 in the index array G2 is respectively related to the first elements A, B, and B of the data array G1.
  • the arrangement order of C is arranged.
  • Step S903 Obtain the corresponding index value I from the found third distance S.
  • Step S905 using the index value I to find the track point data from the data array G1 to obtain a track point set.
  • the third distance S is stored in the index array G2.
  • a binary search method can be used to obtain a suitable third distance in the index array G2, and the corresponding trajectory point data can be quickly indexed through the index value I to obtain the corresponding trajectory point.
  • FIG. 11 is a schematic partial flowchart of a method for selecting sub-tracks according to the second embodiment.
  • the difference between the method for selecting a sub-track provided by the second embodiment and the method for selecting a sub-track provided by the first embodiment is that the method further includes the following steps before acquiring the touch point corresponding to the touch operation.
  • Step S1101 It is detected whether the electronic device 1 enters the drawing mode.
  • step S1103 when the electronic device 1 is in the drawing mode, and when the electronic device 1 is in the drawing mode, the track point of the touch operation of the external object in the touch display assembly 10 is detected.
  • Step S1105 Obtain the coordinates of the track point, the detection time, the third distance from the preset reference point, and the location identifier.
  • the location identifier includes a starting point, an ending point, and an intermediate point, which are used to indicate the location of the track point in the track to which it belongs.
  • Step S1107 Generate a data array.
  • Each first element of the data array includes the coordinates of the track point, the detection time, and the location identifier.
  • the electronic device 1 generates a data array from the acquired data of all track points. Sort in the data array according to the detection time. Understandably, in the data array, it is possible to determine which track points belong to the same sub-track according to the position identifier.
  • Step S1109 Generate an index array.
  • Each second element in the index array includes the third distance of the track point and an index value, and the index value is used to point to the corresponding first element in the data array.
  • the electronic device 1 generates an index array according to the data array and the acquired third distance.
  • the electronic device can record track point data according to the data array and the index array, so that the corresponding track point set can be quickly found according to the data array and the index array to quickly select the sub-track.
  • the first element may also include a pressure value, which is used to indicate the pressure of touch at the track point.
  • FIG. 12 is a partial flowchart of a method for selecting sub-tracks according to the third embodiment.
  • the difference between the method for selecting a sub-track provided by the third embodiment and the method for selecting a sub-track provided by the first embodiment is that before calculating the first distance between the touch point and the preset reference point, the method further includes the following steps.
  • Step S1201 Obtain the pressure value of the touch point.
  • Step S1203 Determine whether the pressure value of the touch point reaches a preset threshold. If the preset threshold is reached, step S1205 is executed. If the preset threshold is reached, step S203 is executed.
  • Step S1205 output a prompt. This prompt is used to remind the user that the operation is invalid.
  • the first distance is calculated only when the pressure value of the touch point reaches the preset threshold, which can prevent the user from accidentally touching and causing misoperation.
  • FIG. 13 is a schematic diagram of the internal structure of the electronic device 1 provided in the first embodiment.
  • the electronic device 1 includes a memory 11, a processor 12 and a bus 13.
  • the memory 11 includes at least one type of readable storage medium, the readable storage medium includes flash memory, hard disk, multimedia card, card type memory (for example, SD or DX memory, etc.), magnetic memory, magnetic disk, optical disk, etc.
  • the memory 11 may be an internal storage unit of the electronic device 1 in some embodiments, such as a hard disk of the electronic device 1.
  • the memory 11 may also be an external storage device of the electronic device 1, for example, a plug-in hard disk equipped on the electronic device 1, a smart memory card (Smart Media Card, SMC), and a Secure Digital (SD). Card, Flash Card, etc.
  • the memory 11 may also include both an internal storage unit of the electronic device 1 and an external storage device.
  • the memory 11 can be used not only to store application software and various data installed in the electronic device 1, such as the code of the program 01, etc., but also to temporarily store data that has been output or will be output.
  • the bus 13 may be a peripheral component interconnect standard (PCI) bus or an extended industry standard architecture (EISA) bus, etc.
  • PCI peripheral component interconnect standard
  • EISA extended industry standard architecture
  • the bus can be divided into address bus, data bus, control bus, etc. For ease of presentation, only one thick line is used in FIG. 13, but it does not mean that there is only one bus or one type of bus.
  • the electronic device 1 may also include a touch display assembly 10.
  • the touch display assembly 10 may be an LED display, a liquid crystal display, a touch liquid crystal display, an OLED (Organic Light-Emitting Diode, organic light-emitting diode) touch device, etc.
  • the display component may also be appropriately called a display device or a display unit, which is used to display the information processed in the electronic device 1 and to display a visualized user interface.
  • the electronic device 1 may also include a communication component 14.
  • the communication component 14 may optionally include a wired communication component and/or a wireless communication component (such as a WI-FI communication component, a Bluetooth communication component, etc.), which is usually used in an electronic device 1 Establish a communication connection with other electronic devices.
  • a wireless communication component such as a WI-FI communication component, a Bluetooth communication component, etc.
  • the processor 12 may be a central processing unit (CPU), controller, microcontroller, microprocessor or other data processing chip in some embodiments, and is used to run the program code or processing stored in the memory 11 data. Specifically, the processor 12 executes a program to implement the above-mentioned method of selecting sub-tracks.
  • CPU central processing unit
  • controller microcontroller
  • microprocessor microprocessor or other data processing chip in some embodiments, and is used to run the program code or processing stored in the memory 11 data. Specifically, the processor 12 executes a program to implement the above-mentioned method of selecting sub-tracks.
  • FIG. 13 only shows the electronic device 1 with the components 10-14 and the first computer executable program. Those skilled in the art can understand that the structure shown in FIG. 13 does not constitute a limitation on the electronic device 1, and may include Fewer or more components than shown, or some combination of components, or different component arrangement.
  • the computer program product includes one or more computer instructions.
  • the computer may be a general-purpose computer, a dedicated computer, a computer network, or other programmable devices.
  • the computer instruction can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium.
  • the computer instruction can be transmitted from a website, computer, server, or data center through a cable (Such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) to another website site, computer, server or data center.
  • a cable such as coaxial cable, optical fiber, digital subscriber line (DSL)
  • wireless such as infrared, wireless, microwave, etc.
  • the computer-readable storage medium may be any available medium that can be stored by a computer or a data storage device such as a server or data center integrated with one or more available media.
  • the usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, and a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid state disk (SSD)).
  • the disclosed system, device, and method may be implemented in other ways.
  • the device embodiments described above are only illustrative.
  • the division of the unit is only a logical function division. In actual implementation, there may be other division methods.
  • multiple units or components may be combined or may be Integrate into another system, or some features can be ignored or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
  • the unit described as a separate component may or may not be physically separated, and the component displayed as a unit may or may not be a physical unit, that is, it may be located in one place, or may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • the functional units in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit can be implemented in the form of hardware or software functional unit.
  • the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium.
  • the technical solution of this application essentially or the part that contributes to the existing technology or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , Including several instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the method in each embodiment of the present application.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program code .

Abstract

一种选取子轨迹的方法,方法包括:在检测到触控显示组件存在触控操作时,获取触控操作所对应的触控点;计算触控点和预设参照点之间的第一距离;获取与预设参照点的距离落入第一距离范围的轨迹点集合,第一距离范围与第一距离值的差值绝对值小于或等于第一阈值;获取轨迹点集合中与触控点距离最小的目标轨迹点;以及选取目标轨迹点所属的子轨迹。本发明还提供了一种电子设备及计算机可读存储介质。根据触控点和预设参照点之间的第一距离来选择部分轨迹点进行运算而获得用户选取的子轨迹,大大减少了运算量,更加快速。

Description

选取子轨迹的方法、电子设备、计算机可读存储介质 技术领域
本发明涉及电子技术领域,尤其涉及一种选取子轨迹的方法、电子设备、计算机可读存储介质。
背景技术
随着电子技术发展和人们对记录信息的便利性要求的提高,智能手写笔记应运而生。用户在智能手写本上绘制图像或写字时往往会出现重新编辑某一笔或者几笔,包括进行包括修改、删除、拆分至其他界面等编辑操作。在上述情况下,需要先从笔记中选择需要编辑的笔划,一个笔记通常会产生大量的数据点,从大量的数据点中选取需要编辑的笔划所对应的数据点进行编辑对智能书写笔等移动电子设备的运算能力会有一定的要求。然而,由于移动电子设备的运算能力有限,因此,如何快速选取到需要编辑的笔划已成为亟需解决的问题。
发明内容
本发明的主要目的在于提供一种快速选取子轨迹的方法、电子设备、计算机可读存储介质。
为实现上述目的,本发明提供一种选取子轨迹的方法,应用于具有触控显示组件的电子设备,轨迹显示于所述触控显示组件,所述轨迹包括一个或多个具有一个或多个轨迹点的子轨迹,所述方法包括:
在检测到所述触控显示组件存在触控操作时,获取所述触控操作所对应的触控点;计算所述触控点和预设参照点之间的第一距离;获取与所述预设参照点的距离落入第一距离范围的轨迹点集合,所述第一距离范围与所述第一距离值的差值绝对值小于或等于第一阈值;获取所述轨迹点集合中与所述触控点距离最小的目标轨迹点;以及选取所述目标轨迹点所属的子轨迹。
为实现上述目的,本发明还提供了一种电子设备。该电子设备包括处理器和存储器,所述存储器存储有计算机可执行程序,所述处理器执行所述程序实现上述选取子轨迹的方法。
本发明提供的一种计算机可读存储介质,所述计算机可读存储介质存储有计算机可执行程序,所述程序被执行以实现上述选取子轨迹的方法。
本发明提供的选取子轨迹的方法,可以根据触控点和预设参照点之间的第一距离来选择部分区域内的轨迹点集合进行运算而获得相应的子轨迹,大大减少了运算量,更加快速。
附图说明
图1为本发明第一实施例提供的一种选取子轨迹的方法的运行环境示意图。
图2为本发明第一实施例提供的选取子轨迹的方法的流程示意图。
图3为本发明第一实施例提供的轨迹示意图。
图4为图2中的步骤S207的第一实施例子流程示意图。
图5为图4所示的步骤S407的第一实施例子流程示意图。
图6为图2所示的步骤S209的第一实施例子流程示意图。
图7a-图7c为本发明第一实施例提供的选取目标轨迹点所属子轨迹的过程示意图。
图8为图2所示的步骤S205的第一实施例子流程示意图。
图9为图2所示的步骤S205的第二实施例子流程示意图示意图。
图10为本发明第二实施例提供的轨迹点的数据存储结构示意图。
图11为本发明第二实施例提供的选取子轨迹的方法的流程示意图。
图12为本发明第三实施例提供的选取子轨迹的方法的流程示意图。
图13为本发明第一实施例提供的一种电子设备的结构框图示意图。
具体实施方式
为了使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本发明,并不用于限定本发明。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”、“第三”、“第四”等(如果存在)是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的实施例能够以除了在这里图示或描述的内容以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。
需要说明的是,在本发明中涉及“第一”、“第二”等的描述仅用于描述目的,而不能理解为指示或暗示其相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括至少一个该特征。另外,各个实施例之间的技术方案可以相互结合,但是必须是以本领域普通技术人员能够实现为基础,当技术方案的结合出现相互矛盾或无法实现时应当认为这种技术方案的结合不存在,也不在本发明要求的保护范围之内。
请参看图1,图1为第一实施方式提供的一种选取子轨迹的方法的运行环境示意图。电子设备1可以为电子纸、电子书、车载显示屏、平板电脑、智能手机、智能手表、智能手环等。电子设备的示例性实施例包括但不限于搭载iOS@ Android@Windows Phone@或者其它操作系统的电子设备。电子设备通常支持多种应用程序,诸如以下中的一种或多种:画图应用程序、呈现应用程序、文字处理应用程序、网页创建应用程序、盘编辑应用程序、电子表格应用程序、游戏应用程序、电话应用程序、视频会议应用程序、电子邮件应用程序、即时消息应用程序、锻炼支持应用程序、相片管理应用程序、数字相机应用程序、数字视频摄像机应用程序、网络浏览应用程序、数字音乐播放器应用程序、和/或数字视频播放器应用程序。电子设备1包括触控显示组件10。
请参看图2,图2为第一实施方式提供的一种选取子轨迹的方法的流程示意图。该选取子轨迹的方法由电子设备执行可从显示触控显示组件10的轨迹中选取所需子轨迹。其中,触控显示组件10中的轨迹包括一个或多个具有一个或多个轨迹点的子轨迹。其中,该轨迹可以为电子设备1生成的轨迹。该轨迹也可以为对接收到的外部轨迹进行处理后所形成的轨迹。其中,外部轨迹可以是包含轨迹的图片也可以是轨迹点集合。当轨迹为电子设备1生成的轨迹时,轨迹为连续轨迹点集合,例如,外部触控对象(如触控笔、手指等)在触控显示组件10中滑动时,电子设备1可以根据检测外部对象滑动所产生的连续轨迹点进行记录和显示,形成该轨迹。当接收外部设备发送的外部轨迹为图像时,电子设备1可以是根据预设规则对图像中的轨迹进行划分并获取相应的轨迹点以形成该轨迹,该预设规则可以是根据图像中轨迹的特征进行划分,也可以是根据图像中轨迹所在位置划分;当接收外部设备发送的外部轨迹为数据点集合时,可以对轨迹点集合进行分析形成该轨迹。在本实施例中,每一子轨迹具有一个或者多个连续的轨迹点。
具体地,该选取子轨迹的方法包括下面步骤。
步骤S201,在检测到触控显示组件存在触控操作时,获取触控操作所对应 的触控点。具体地,当电子设备1在触控显示组件10显示轨迹时,检测是否有外部对象在触控显示组件10上进行触控操作,从而检测用户是否对轨迹进行选取子轨迹的操作。例如,用户点击或者长按触控显示组件10时,可确定用户需要选取子轨迹,从而获取相应的触控点。
步骤S203,计算触控点和预设参照点之间的第一距离。具体地,如图3所示,在触控显示组件10中选取一个参照点作为预设参照点O。预设参照点O可以为触控显示组件10中的任意一点。优选地,预设参照点O为触控显示组件10坐标系中的坐标原点。例如,当触控点D点,电子设备10根据触控点D的坐标计算出与预设参照点之间的第一距离,如r。
步骤S205,获取与预设参照点的距离落入第一距离范围的轨迹点集合,第一距离范围与第一距离值的差值绝对值小于或等于第一阈值。例如,r 2≤|p iO|≤r 1,r 1=r+τ,r 2=r-τ,其中,第一距离范围为r 2~r 1,p iO表示轨迹点与预设参照点之间的距离;τ用于表示第一阈值;r用于表示第一距离值。具体地,轨迹点与预设参照点的距离可以由电子设备1在生成轨迹时计算并保存,也可以检测到用户需要选取子轨迹时才计算,即在此步骤计算。可以理解地,获取与预设参照点的距离落入第一距离范围的轨迹点集合即可得到环绕该触控点的特定区域内的轨迹点集合,例如,图3所示的区域R中轨迹点集合。可以理解地,如果没有轨迹点与预设参照点的距离落入第一范围内,即,轨迹点集合为0,执行步骤S210。如果轨迹点不为空,则执行步骤S207。
步骤S207,获取轨迹点集合中与触控点距离最小的目标轨迹点。具体地,在选择目标轨迹点时只需在该轨迹点集合中选择,运算量大大降低。其中,如何获取轨迹点集合中与触控点距离最小的目标轨迹点将在下文举例详细描述。
步骤S209,选取目标轨迹点所属的子轨迹。具体地,选取目标轨迹点所属轨迹可以是通过对轨迹点设置可识别子轨迹的信息,然后通过该信息进行选取子轨迹;也可以是通过设置各轨迹点之间的关联信息,然后通过该关联信息进行选取出子轨迹,但不仅限于此。其中,如何选取目标轨迹点所属子轨迹将在下文举例详细描述。
步骤S210,发出提示信息。该提示信息可以是但不限于触发电子设备1的马达进行震动提示、也可以发出提示音,也可以显示提示信息等。
上述实施中,利用触控点和预设参照点之间的距离来获取部分轨迹点,从而依据该部分轨迹点来获得用户选取的子轨迹,而无需对所有的轨迹点进行评估或者运算,从而大大降低了电子设备1的运算量,更加快速。
如图4所示,步骤S207具体包括下面步骤。
步骤S401,计算出轨迹点集合中的每一轨迹点与触控点之间的第二距离。
步骤S403,以第二距离的值大小相应地对轨迹点集合中的轨迹点进行排序。
步骤S405,获取第二距离中最小值所对应的轨迹点。
步骤S407,根据第二距离中最小值所对应的轨迹点选取目标轨迹点。
在本实施例中,计算出轨迹点集合中每一个轨迹点与触控点之间的第二距离,并通过对第二距离进行排序找到最小的轨迹点,从而得到目标轨迹点。
请参看图5,其为步骤S407的子步骤流程图。在一些可行的实施例中,第二距离中最小值所对应的轨迹点有可能出现1个,也可能出现多个,将轨迹点选为目标轨迹点具体包括下面步骤。
步骤S501,当第二距离中最小值所对应的轨迹点的数量为1时,将该轨迹点作为目标轨迹点。
步骤S503,当第二距离中最小值所对应的轨迹点的数量大于1时,获取轨 迹点的检测时间。其中,轨迹点包括轨迹点检测时间(如图10所示)。该检测时间用于表示该轨迹点检测时间的先后顺序,也可以说是轨迹点产生的先后顺序。
步骤S505,将检测时间最晚的轨迹点作为目标轨迹点。
在本实施例中,在第二距离中最小值所对应的轨迹点为多个情况下,可以根据轨迹点的检测时间先后顺序来确定目标轨迹点,更加符合用户重编笔记的需求,如,用户一般是在当前时刻绘制的轨迹有误情况下及时修订。在一些可行的实施例中,轨迹点包括压力值(如图10所示),用于表示该轨迹点触控的压力。在第二距离中最小值所对应的轨迹点为多个情况下,也可以通过压力的大小来确定目标轨迹点,如将压力最小者作为目标轨迹点。在一些可行的实施例中,在第二距离中最小值所对应的轨迹点为多个情况下,也可以通过其他方式来确定目标轨迹点,例如,可以根据轨迹点的特点,例如,导致轨迹不符预设形状的轨迹点等。
请参看图6,其为步骤S209的子步骤流程示意图。在本实施例中,以通过设置各轨迹点之间的关联信息来选取目标轨迹点所属的子轨迹为例进行详细说明。其中,轨迹点包括用于表示与其他轨迹点在子轨迹上的位置关联关系的位置标识(如图10所示)。位置标识包括起始点、中间点、终止点。步骤S209包括下面步骤。
步骤S601,获取目标轨迹点的位置标识。位置标识用于表示目标轨迹点为所属子轨迹中的起始点、终止点、或者是起始点和终止点之间的中间点,起始点为子轨迹中检测时间最早的轨迹点;终止点为子轨迹中检测时间最晚的轨迹点。具体地,当位置标识为起始点时,执行步骤S603~605;当位置标识为终止点时,执行步骤S607~609;当位置标识为中间点时,执行步骤S611~613。
步骤S603,当目标轨迹点的位置标识为起始点,往终止点的方向检测相应的轨迹点。
步骤S605,当检测到的轨迹点为终止点时,将检测到的轨迹点组成的子轨迹作为目标轨迹点所属的子轨迹,如图7a所示。
步骤S607,当目标轨迹点标识为终止点,往起始点的方向检测相应的轨迹点。
步骤S609,当检测到的轨迹点为起始点时,将检测到的轨迹点组成的子轨迹作为目标轨迹点所属的子轨迹,如图7b所示。
步骤S611,当目标轨迹点标识为中间点,往起始点和所述终止点两个方向检测相应的轨迹点。
步骤S613,当检测到的轨迹点为起始点和终止点时,将检测到的轨迹点组成的子轨迹作为目标轨迹点所属的子轨迹,如图7c所示。
请参看图8,其为步骤S205的子步骤流程示意图。在一些可行的实施例中,步骤S205具体包括下步骤。
步骤S801,将轨迹的每一轨迹点与预设参照点之间的第三距离进行排序。具体地,本实施例中,可以将第三距离按照从大到小或者从小到大进行排序。
步骤S803,基于二分查找法查找出第三距离落入第一距离范围的轨迹点集合。具体地,第一距离范围为低极限值和高极限值之间的范围,如,低极限值为r 1,高极限值为r 2。首先,电子设备1通过进行两次二分查找获得在第三距离中查找到大于或者等于r 1且小于等于r 2的第三距离;然后,根据落入第一距离范围的第三距离获取相应的轨迹点。其中,电子设备1进行两次二分查找获得在第三距离中查找到大于或者等于r 1且小于等于r 2的第三距离,具体包括:利用二分法在第三距离中找到落入第一距离范围的最小值,以及利用二分法在第 三距离中找到落入第一距离范围的最大值,从而将数值为最小值、最大值、最小值和最大值之间的第三距离作为落入第一距离范围的第三距离。
在本实施例中,对第三距离进行排序,并进行两次二分查找获得落入第一距离范围的轨迹点,可以快速地获取轨迹点集合。
请结合参看图9和图10,其为本发明第一实施例提供的步骤S205的子步骤流程示意图。图10为本发明第一实施例提供的轨迹点的数据存储结构示意图。在一些可行的实施例中,轨迹的每一轨迹点利用数据数组G1和索引数组G2记录于电子设备1。数据数组G1中的每个第一元素为每一轨迹点数据,如A-F。索引数组G2中的每个第二元素包括每一轨迹点中的第三距离S以及将第三距离索引至数据数组G1中对应的轨迹点数据的索引值I,如S1~S6,I1~I6。基于二分查找法查找出第三距离落入第一距离范围的轨迹点集合具体包括下面步骤。
步骤S901,基于二分查找法从索引数组G2中获取落入第一距离范围的第三距离,其中,索引数组G2根据第三距离S1~S6大小进行排序,即,索引数组G2中第二元素的顺序是根据第三距离S1~S6进行排序的。其中,当多个第三距离相同时,多个相同的第三距离在索引数组G2中所对应的第二元素的排列顺序和该等第二元素所对应的于数据数组G1的第一元素在数据数组G1中的排列顺序相同。例如,S1,S2,S3的距离相同。S1,S2,S3分别对应索引值为I1,I2,I3。I1,I2,I3分别索引至数据数组G1的第一元素A、B、C,则索引数组G2中含S1,S2,S3的第二元素分别与数据数组G1中的第一元素A、B、C的排列顺序排列。
步骤S903,从查找出的第三距离S获取相应的索引值I。
步骤S905,利用索引值I从数据数组G1中查找出的轨迹点数据来获得轨迹点集合。
在本实施例中,通过对轨迹点数据建立索引数组G2,在索引数组G2中保存了第三距离S。在计算出第一距离范围时可以利用二分查找法在索引数组G2中获得合适的第三距离,并可通过索引值I快速索引到相应轨迹点数据从而获得相应的轨迹点。
请参看图11,为第二实施例提供的一种选取子轨迹的方法的部分流程示意图。第二实施例提供的选取子轨迹的方法与第一实施例提供选取子轨迹的方法区别在于:在获取所述触控操作所对应的触控点之前,该方法还包括下面步骤。
步骤S1101,检测电子设备1是否进入绘制模式。
步骤S1103,当电子设备1处于绘制模式,当电子设备1处于绘制模式,检测外部对象在触控显示组件10中进行触控操作的轨迹点。
步骤S1105,获取轨迹点的坐标、检测时间、与预设参照点之间的第三距离、以及位置标识。位置标识包括起始点、终止点、中间点,分别用于表示该轨迹点在所属轨迹中位置。
步骤S1107,生成数据数组,数据数组的每一第一元素包括轨迹点的坐标、检测时间、和位置标识。具体地,电子设备1将获取到的所有轨迹点的数据生成数据数组。在数据数组中根据检测时间先后进行排序。可以理解地,在数据数组中,可以根据位置标识来确定哪些轨迹点属于同一个子轨迹。
步骤S1109,生成索引数组,索引数组中的每一第二元素包括轨迹点的第三距离和索引值,索引值用于指向数据数组中所对应的第一元素。具体地,电子设备1根据数据数组和获取的第三距离生成索引数组。
在本实施例中,电子设备可以按照数据数组和索引数组记录轨迹点数据,从而可以依据该数据数组和索引数组快速找到相应的轨迹点集合,以快速选取子轨迹。在一些可行的实施例中,第一元素还可以包括压力值,用于表示该轨 迹点触控的压力。
请参看图12,其为第三实施例提供的一种选取子轨迹的方法的部分流程示意图。第三实施例提供的选取子轨迹的方法与第一实施例提供选取子轨迹的方法区别在于,计算触控点和预设参照点之间的第一距离之前,该方法还包括下面步骤。
步骤S1201,获取触控点压力值。
步骤S1203,判断触控点压力值是否达到预设的阈值。若达到预设的阈值,执行步骤S1205。若达到预设的阈值,执行步骤S203。
步骤S1205,输出提示。该提示用于提醒用户操作无效。
在本实施例中,当触控点压力值达到预设的阈值,才计算第一距离,可以防止用户误触而发生误操作。
请参看图13,其为第一施例提供的电子设备1的内部结构示意图。电子设备1包括存储器11、处理器12和总线13。
其中,存储器11至少包括一种类型的可读存储介质,该可读存储介质包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、磁性存储器、磁盘、光盘等。存储器11在一些实施例中可以是电子设备1的内部存储单元,例如电子设备1的硬盘。存储器11在另一些实施例中也可以是电子设备1的外部存储设备,例如电子设备1上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,存储器11还可以既包括电子设备1的内部存储单元也包括外部存储设备。存储器11不仅可以用于存储安装于电子设备1的应用软件及各类数据,例如程序01的代码等,还可以用于暂时地存储已经输出或者将要输出的数据。
总线13可以是外设部件互连标准(peripheral component interconnect,简称 PCI)总线或扩展工业标准结构(extended industry standard architecture,简称EISA)总线等。该总线可以分为地址总线、数据总线、控制总线等。为便于表示,图13中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。
进一步地,电子设备1还可以包括触控显示组件10。触控显示组件10可以是LED显示器、液晶显示器、触控式液晶显示器以及OLED(Organic Light-Emitting Diode,有机发光二极管)触摸器等。其中,显示组件也可以适当的称为显示装置或显示单元,用于显示在电子设备1中处理的信息以及用于显示可视化的用户界面。
进一步地,电子设备1还可以包括通信组件14,通信组件14可选的可以包括有线通信组件和/或无线通信组件(如WI-FI通信组件、蓝牙通信组件等),通常用于在电子设备1与其他电子设备之间建立通信连接。
处理器12在一些实施例中可以是一中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器或其他数据处理芯片,用于运行存储器11中存储的程序代码或处理数据。具体地,处理器12执行程序以实现上述选取子轨迹的方法。
图13仅示出了具有组件10-14以及第一计算机可执行程序的电子设备1,本领域技术人员可以理解的是,图13示出的结构并不构成对电子设备1的限定,可以包括比图示更少或者更多的部件,或者组合某些部件,或者不同的部件布置。
该计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行该计算机程序指令时,全部或部分地产生按照本发明实施例该的流程或功能。该计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。该计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储 介质向另一计算机可读存储介质传输,例如,该计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。该计算机可读存储介质可以是计算机能够存储的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。该可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘Solid State Disk(SSD))等。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,该单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
该作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元 中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
该集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例该方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。
需要说明的是,上述本发明实施例序号仅仅为了描述,不代表实施例的优劣。并且本文中的术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、装置、物品或者方法不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、装置、物品或者方法所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、装置、物品或者方法中还存在另外的相同要素。
以上仅为本发明的优选实施例,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。

Claims (17)

  1. 一种选取子轨迹的方法,应用于具有触控显示组件的电子设备,轨迹显示于所述触控显示组件,所述轨迹包括一个或多个具有一个或多个轨迹点的子轨迹,其特征在于,所述方法包括:
    在检测到所述触控显示组件存在触控操作时,获取所述触控操作所对应的触控点;
    计算所述触控点和预设参照点之间的第一距离;
    获取与所述预设参照点的距离落入第一距离范围的轨迹点集合,所述第一距离范围与所述第一距离值的差值绝对值小于或等于第一阈值;
    获取所述轨迹点集合中与所述触控点距离最小的目标轨迹点;以及
    选取所述目标轨迹点所属的子轨迹。
  2. 根据权利要求1所述的方法,其特征在于,所述子轨迹具有一个或多个连续的轨迹点。
  3. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    若轨迹点集合为空,则发出提示信息。
  4. 根据权利要求1所述的方法,其特征在于,计算所述触控点和预设参照点之间的第一距离之前,所述方法还包括:
    获取所述触控点压力值;
    判断所述触控点压力值是否达到预设的阈值;以及
    若达到预设的阈值,则计算所述触控点和预设参照点之间的第一距离。
  5. 根据权利要求1所述的方法,其特征在于,获取所述轨迹点集合中与所述触控点距离最小的目标轨迹点,具体包括:
    计算出所述轨迹点集合中的每一轨迹点与所述触控点之间的第二距离;
    获取所述第二距离中最小值所对应的轨迹点;
    根据所述第二距离中最小值所对应的轨迹点选取所述目标轨迹点。
  6. 根据权利要求5所述的方法,其特征在于,获取所述第二距离中最小值所对应的轨迹点之前,所述方法还包括:
    以所述第二距离的值大小相应地对所述轨迹点集合中的轨迹点进行排序。
  7. 根据权利要求5所述的方法,其特征在于,所述轨迹点包括用于表示所述轨迹点时间先后顺序的检测时间,根据所述第二距离中最小值所对应的轨迹点选取所述目标轨迹点具体包括:
    当第二距离中最小值所对应的轨迹点的数量大于1时,获取所述轨迹点的检测时间;以及
    将所述检测时间最晚的轨迹点选取为所述目标轨迹点。
  8. 根据权利要求7所述的方法,其特征在于,所述子轨迹的轨迹点依照检测时间依序排列,所述子轨迹的轨迹点具有位置标识,选取所述目标轨迹点所属的子轨迹具体包括:
    获取所述目标轨迹点的位置标识,所述位置标识用于表示所述目标轨迹点为所属子轨迹中的起始点、终止点、或者是起始点和终止点之间的中间点,所述起始点为所述子轨迹中检测时间最早的轨迹点;所述终止点为所述子轨迹中检测时间最晚的轨迹点;
    当所述目标轨迹点的位置标识为起始点,往所述终止点的方向检测相应的轨迹点;以及
    当检测到的轨迹点为终止点时,将检测到的轨迹点组成的子轨迹作为目标轨迹点所属子轨迹。
  9. 根据权利要求8所述的方法,其特征在于,所述方法还包括:
    当所述目标轨迹点标识为终止点,往所述起始点的方向检测相应的轨迹点;
    当检测到的轨迹点为起始点时,将检测到的轨迹点组成的子轨迹作为目标轨迹点所属子轨迹。
  10. 根据权利要求9所述的方法,其特征在于,所述方法还包括:
    当所述目标轨迹点标识为中间点,往所述起始点和所述终止点两个方向检测相应的轨迹点;以及
    当检测到的轨迹点为起始点和终止点时,将检测到的轨迹点组成的子轨迹作为目标轨迹点所属子轨迹。
  11. 根据所述权利要求10所述的方法,其特征在于,获取与所述预设参照点的距离落入所述第一距离范围的轨迹点集合具体包括:
    将所述轨迹的每一轨迹点与所述预设参照点之间的第三距离进行排序;
    基于二分查找法查找出所述第三距离落入所述第一距离范围的轨迹点集合。
  12. 根据权利要求10所述的方法,其特征在于,所述显示轨迹的每一轨迹点利用数据数组和索引数组记录于所述电子设备,所述数据数组中的每个第一元素为所述每一轨迹点;所述索引数组中的每个第二元素包括每一轨迹点中的所述第三距离以及将所述第三距离索引至所述数据数组中对应的轨迹点的索引值;获取与所述预设参照点的距离落入所述第一距离范围的轨迹点集合具体包括:
    基于二分查找法从所述索引数组中获取落入所述第一距离范围的第三距离,其中,所述索引数组根据所述第三距离大小进行排序;
    从查找出的所述第三距离获取相应的索引值;以及
    利用所述索引值从所述数据数组中查找出的轨迹点来组成所述轨迹点集 合。
  13. 根据权利要求12所述的方法,其特征在于,所述索引数组中的第一元素依照所述第三距离的大小进行依序排列。
  14. 根据权利要求13所述的方法,其特征在于,当多个第三距离相同时,所述多个相同的第三距离在所述索引数组中所对应的第一元素的排列顺序和所述多个相同的第三距离对应的第一元素在所述数据数组中所索引的第二元素在所述数据数组中的排列顺序相同。
  15. 根据权利要求12所述的方法,其特征在于,在获取所述触控操作所对应的触控点之前,所述方法还包括:
    检测所述电子设备是否进入绘制模式;
    当所述电子设备处于绘制模式,检测外部对象在所述触控显示组件中进行触控操作的轨迹点;
    获取所述轨迹点的坐标、检测时间、与所述预设参照点之间的所述第三距离、以及所述位置标识;
    生成数据数组,所述数据数组的每一第一元素包括所述轨迹点的坐标、检测时间、位置标识;以及
    生成所述索引数组,所述索引数组中的每一第二元素包括所述轨迹点的第三距离和所述索引值。
  16. 一种电子设备,其特征在于,包括:触控显示组件、处理器、存储器以及程序,其中所述程序被存储在所述存储器中,并且被配置成由处理器执行,所述程序被处理器执行时实现如权利要求1-15任意一项所述的方法。
  17. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1-15任意一项所述的方法。
PCT/CN2019/082849 2019-04-16 2019-04-16 选取子轨迹的方法、电子设备、计算机可读存储介质 WO2020210975A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201980079857.8A CN113330404A (zh) 2019-04-16 2019-04-16 选取子轨迹的方法、电子设备、计算机可读存储介质
PCT/CN2019/082849 WO2020210975A1 (zh) 2019-04-16 2019-04-16 选取子轨迹的方法、电子设备、计算机可读存储介质

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2019/082849 WO2020210975A1 (zh) 2019-04-16 2019-04-16 选取子轨迹的方法、电子设备、计算机可读存储介质

Publications (1)

Publication Number Publication Date
WO2020210975A1 true WO2020210975A1 (zh) 2020-10-22

Family

ID=72836768

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/082849 WO2020210975A1 (zh) 2019-04-16 2019-04-16 选取子轨迹的方法、电子设备、计算机可读存储介质

Country Status (2)

Country Link
CN (1) CN113330404A (zh)
WO (1) WO2020210975A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114705214B (zh) * 2022-04-15 2023-05-23 北京龙驹易行科技有限公司 一种里程轨迹计算方法、装置、存储介质及电子设备

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8643616B1 (en) * 2011-07-29 2014-02-04 Adobe Systems Incorporated Cursor positioning on a touch-sensitive display screen
CN103902079A (zh) * 2012-12-26 2014-07-02 联想(北京)有限公司 一种信息处理的方法及电子设备
CN104423632A (zh) * 2013-08-19 2015-03-18 联想(北京)有限公司 一种对电子笔的定位的方法及系统

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI510994B (zh) * 2013-09-13 2015-12-01 Acer Inc 可攜式電子裝置及控制可攜式電子裝置的方法

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8643616B1 (en) * 2011-07-29 2014-02-04 Adobe Systems Incorporated Cursor positioning on a touch-sensitive display screen
CN103902079A (zh) * 2012-12-26 2014-07-02 联想(北京)有限公司 一种信息处理的方法及电子设备
CN104423632A (zh) * 2013-08-19 2015-03-18 联想(北京)有限公司 一种对电子笔的定位的方法及系统

Also Published As

Publication number Publication date
CN113330404A (zh) 2021-08-31

Similar Documents

Publication Publication Date Title
US20150067568A1 (en) Apparatus and method for displaying chart in electronic device
US10521105B2 (en) Detecting primary hover point for multi-hover point device
US10445417B2 (en) Entry of values into multiple fields of a form using touch screens
WO2017124795A1 (zh) 联系人分组处理方法、装置以及移动终端
JP2015233214A (ja) 情報表示処理システム、情報表示処理方法および情報表示処理プログラム
WO2013097129A1 (zh) 联系人搜索方法、装置及其应用的移动终端
US20160275095A1 (en) Electronic device, method and storage medium
JP5869179B2 (ja) 電子機器および手書き文書処理方法
TW201541340A (zh) 觸控螢幕終端中查找訊息記錄的方法及其裝置
KR20150027885A (ko) 전자 필기 운용 방법 및 이를 지원하는 전자 장치
CN113835580A (zh) 应用图标的显示方法、装置、电子设备及存储介质
US20220262339A1 (en) Audio processing method, apparatus, and device, and storage medium
US9170733B2 (en) Information processing apparatus, information processing method, and non-transitory computer readable medium
WO2020210975A1 (zh) 选取子轨迹的方法、电子设备、计算机可读存储介质
JP2015095066A (ja) 情報処理装置及び情報処理プログラム
CN105653131A (zh) 一种查找应用程序的方法及终端
CN107291564B (zh) 信息复制粘贴方法、装置和电子设备
CN106951168B (zh) 一种文字处理方法及移动终端
CN108229428A (zh) 一种文字识别方法、装置、服务器及介质
CN111602129B (zh) 针对注释和墨迹的智能搜索
TWI505173B (zh) 提高手持裝置觸碰鍵盤辨識率的系統和方法
CN112329409A (zh) 一种单元格颜色转换方法、装置及电子设备
JP2014026596A (ja) 画像処理装置、その制御方法、および制御プログラム
CN107203325B (zh) 一种搜索方法以及装置、计算机装置、可读存储介质
WO2019024507A1 (zh) 一种触摸控制方法、装置及终端

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: 19924774

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: 19924774

Country of ref document: EP

Kind code of ref document: A1