WO2020177070A1 - Method for executing instructions based on trajectory, electronic device and computer-readable storage medium - Google Patents

Method for executing instructions based on trajectory, electronic device and computer-readable storage medium Download PDF

Info

Publication number
WO2020177070A1
WO2020177070A1 PCT/CN2019/076954 CN2019076954W WO2020177070A1 WO 2020177070 A1 WO2020177070 A1 WO 2020177070A1 CN 2019076954 W CN2019076954 W CN 2019076954W WO 2020177070 A1 WO2020177070 A1 WO 2020177070A1
Authority
WO
WIPO (PCT)
Prior art keywords
coordinate
preset
trajectory
coordinates
coordinate set
Prior art date
Application number
PCT/CN2019/076954
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 深圳市柔宇科技有限公司
Priority to CN201980073413.3A priority Critical patent/CN113260973A/en
Priority to PCT/CN2019/076954 priority patent/WO2020177070A1/en
Publication of WO2020177070A1 publication Critical patent/WO2020177070A1/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/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0487Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser
    • 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/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0487Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser
    • G06F3/0488Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using a touch-screen or digitiser, e.g. input of commands through traced gestures

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 executing instructions based on trajectories.
  • passwords such as character passwords, fingerprint passwords, etc.
  • some functions such as launching applications, unlocking screens, and deleting files.
  • character passwords are easy to crack.
  • the fingerprint password is used in the electronic device, when the corresponding execution needs to be performed, it is generally necessary to confirm whether the fingerprint is used in the touch display screen, and then input the fingerprint to unlock, which is troublesome. Therefore, reducing operation steps and improving user operation efficiency are currently urgently needed.
  • the embodiments of the present application disclose a method, an electronic device, and a computer-readable storage medium for executing instructions based on a trajectory, which can reduce operation steps and improve user operation efficiency.
  • a method for executing instructions based on trajectories disclosed in an embodiment of the present application is applied to an electronic device, and the method includes:
  • an electronic device also disclosed in an embodiment of the present application includes a processor, a memory, and a computer program, wherein the computer program is stored in the memory and is configured to be executed by the processor, and the computer program The above method is implemented when executed by the processor.
  • an embodiment of the present application also discloses a computer-readable storage medium, on which a computer program is stored, and the computer program is executed by a processor to implement the above method.
  • the above-mentioned method, electronic equipment, and computer-readable storage medium for executing instructions based on trajectories directly use the operation trajectory to execute corresponding operation instructions, and the operation is relatively fast.
  • FIG. 1 is a schematic flowchart of a method for executing instructions based on trajectories provided by the first implementation of this application.
  • Fig. 2 is a schematic diagram of a user graphical interface of the first embodiment of the application.
  • FIG. 3 is a schematic diagram of the preset mapping table relationship table in FIG. 1 of this application.
  • Fig. 4 is a flowchart of a first embodiment of step S1031 shown in Fig. 1.
  • FIG. 5 is a partial schematic diagram of a partial sub-process of the second embodiment of step S1031 shown in FIG. 1.
  • FIG. 6 is a schematic diagram of a partial sub-process of the third embodiment of step S1031 shown in FIG. 1.
  • FIG. 7 is a schematic flowchart of the first implementation example of step S405 shown in FIG. 4.
  • FIG. 8 is a schematic diagram of a user graphical interface provided by the second embodiment of this application.
  • FIG. 9 is a schematic partial flowchart of a method for executing instructions based on trajectories provided by the second embodiment of this application.
  • FIG. 10 is a schematic diagram of the functional structure of an electronic device provided by the first embodiment of this application.
  • FIG. 11 is a schematic diagram of a computer-readable storage medium provided by the first embodiment of this application.
  • FIG. 1 is a flowchart of a method for executing instructions based on a trajectory disclosed in an embodiment of the application.
  • the method of executing instructions based on trajectories is applied to electronic devices.
  • the electronic device is an electronic device with a handwriting drawing function.
  • the electronic device includes, but is not limited to, electronic devices with touch display components in mobile phones, tablet computers, smart bracelets, notebook computers, desktop computers, and multimedia players.
  • Operating systems of electronic devices include but are not limited to Andirod operating system, IOS operating system, Symbian operating system, BlackBerry operating system, Windows Phone operating system and so on.
  • the method includes the following steps.
  • Step S101 Obtain the operation track.
  • the operation track can be obtained by detecting the touch track of the external object on the touch display component.
  • External objects are but not limited to stylus, fingers, etc. As shown in FIG. 2, when the finger slides in the touch display assembly, the corresponding touch track S can be detected to obtain the operation track TS.
  • the operation trajectory TS may also be obtained by a camera.
  • a camera is provided in an electronic device, and the movement track of an external object (such as a finger, a touch device, a palm, etc.) is acquired through the camera to obtain the operation track TS.
  • an external object such as a finger, a touch device, a palm, etc.
  • Step S103 detecting whether the operation trajectory TS matches the preset reference trajectory SS.
  • a preset mapping table relationship table P is stored in the electronic device, wherein the mapping relationship table P includes a reference trajectory set D 1 and a mapping relationship D 2 of an operation instruction set (as shown in FIG. 3) .
  • the preset reference trajectory can be found from the preset mapping table P.
  • Step S105 when the operation trajectory TS matches the preset reference trajectory SS, a corresponding operation instruction is executed.
  • the operation instruction may be, but is not limited to, opening an application in the electronic device, unlocking the electronic device, storing, deleting, replaying the track, sending signals and files to other electronic devices At least one item (as shown in Figure 3).
  • the operation track can be directly used to execute the corresponding operation instruction, and the operation is relatively quick.
  • step S103 includes: step S1031, calculating the similarity between the operation trajectory TS and the preset reference trajectory SS; step S1033, when the similarity reaches the preset threshold, detecting that the operation trajectory TS is The preset reference trajectory SS matches.
  • the preset reference trajectory SS includes a reference coordinate set, and each reference coordinate in the reference coordinate set has a unique serial number.
  • the operation trajectory TS includes a continuous set of first trajectory point coordinates.
  • step S1031 includes the following steps.
  • step S401 a number of track point coordinates are sampled from the first track point coordinate set according to a preset sampling rule to form a sample coordinate set B 1 to be verified.
  • a preset sampling rule is to sample according to a preset length, where the preset length is L/(N-1), where L is the total length of the track, and N is the preset number.
  • Step S403 Assign a unique serial number to the sampling coordinate to be verified in the sampling coordinate set B1 to be verified according to the sequence of the first track point coordinate set, so that the serial number of the sampling coordinate to be verified corresponds to the serial number of the reference coordinate, and the first track point coordinate set
  • the sequence includes the sequence from the start point to the end point of the first track point coordinate set or the sequence from the end point to the start point of the first track point coordinate set.
  • Step S405 Transform the sample coordinate set B1 to be verified into coordinates in the preset area R to form a first transformed coordinate set (as shown in FIG. 8).
  • Step S407 Acquire one coordinate in the area enclosed by the first transformed coordinate set as the first center coordinate according to the preset movement rule.
  • Step S409 Transform the first transformed coordinate set using the first center coordinates as the coordinate origin to form a coordinate set to be verified.
  • Step S411 Calculate the difference between the coordinate to be verified and the reference coordinate corresponding to the serial number.
  • step S413 the similarity is calculated according to the difference value.
  • the difference between the coordinate to be verified and the reference coordinate is: the distance between the coordinate to be verified and the corresponding reference coordinate.
  • the calculation of similarity based on the difference value is specifically:
  • s is used to indicate the degree of approximation
  • W is used to indicate the width of the preset area R
  • C[k] X is used to indicate the coordinate value of the kth coordinate to be verified on the X axis
  • d It is used to represent the average value of the distance between all the coordinates to be verified and the corresponding reference coordinates in the coordinate set to be verified and the reference coordinate value, where N is used to represent the total number of coordinates in the coordinate set to be verified or the reference coordinate set, and k is 1. To N.
  • the average difference value is first calculated according to the difference value between the coordinate to be verified and the corresponding reference coordinate, and then the similarity is determined according to the average difference value, and the obtained similarity is more accurate.
  • step S411 the method further includes the following steps.
  • Step S501 Count the number of difference values greater than the preset difference value.
  • Step S503 It is judged whether the number exceeds a preset number.
  • Step S505 When the number exceeds the preset number, the operation trajectory TS does not match the preset reference trajectory SS.
  • Step S507 When the number does not exceed the preset number, the similarity is calculated according to the difference value.
  • the preset reference trajectory encloses a closed area.
  • the closed area for example, the preset trajectory is triangle, circle, ellipse, etc., and the closed area is triangle, circle, ellipse.
  • the method further includes: step S600, detecting whether the operation track encloses a closed area, and executing step S411 when enclosing the closed area.
  • detecting whether the operation track encloses a closed area includes:
  • Step S601 detecting whether the start point coordinates and the end point coordinates of the first track point coordinate set are the same;
  • Step S603 When the start point coordinates and the end point coordinates of the first track point coordinate set are the same, the operation track encloses a closed area.
  • the trajectory enclosed by the closed area is set as the preset reference trajectory, so that by detecting whether the area enclosed by the operation trajectory is a closed area, misoperation or non-compliant operation can be further quickly eliminated.
  • step S405 specifically includes the following steps.
  • Step S701 Calculate the width w and height h of the area enclosed by the operation track TS in the X and Y coordinates.
  • Step S703 Determine the preset area R according to the largest one of the width w and the height h.
  • the preset area is a square, and the side length of the square is equal to the largest one of the width w and the height h.
  • Step S705 Scale the sample coordinate set B1 to be verified to the preset area R to form a first transformed coordinate set.
  • the operation trajectory can be changed in the preset area, and the position of the operation trajectory is not limited, and the operation is more convenient.
  • the method before step S1031, the method further includes a step of forming a reference coordinate set.
  • the step of forming the reference coordinate set is basically the same as the step of forming the coordinate set to be verified.
  • the method further includes the following steps.
  • Step S901 Obtain the preset reference trajectory, where the preset reference trajectory includes a continuous set of second trajectory point coordinates.
  • step S903 a number of track point coordinates are sampled from the second track point coordinate set according to a preset sampling rule to form the reference sampling coordinate set.
  • Step S905 Transform the reference sample coordinates in the reference sample coordinate set into coordinates in the preset area R to form a second transformed coordinate.
  • Step S907 Acquire a coordinate in the area enclosed by the second transformed coordinate set as the second center coordinate according to the movement rule.
  • Step S909 Transform the second transformed coordinate using the second center coordinate as the coordinate origin to form the reference coordinate set.
  • step S905 specifically includes:
  • Step S9051 Calculate the width and height of the area enclosed by the preset reference trajectory in X and Y coordinates;
  • Step S9053 Determine the width of the preset area R according to the largest one of the width and the height;
  • Step S9055 scaling the reference sampling coordinate set to the preset area R to form the second transformed coordinate set.
  • the method for forming the reference coordinate set and the step method for forming the coordinate set to be verified in this embodiment can ensure the consistency between the reference coordinate set and the coordinate set to be verified, and further improve the matching accuracy of the operation track.
  • FIG. 10 is a schematic diagram of the electronic device of the first embodiment.
  • the electronic device 100 includes one or more processors 30, a memory 40, and a bus 50.
  • the memory 40 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 40 may be an internal storage unit of the electronic device 100 in some embodiments, such as a hard disk of the electronic device 100. In other embodiments, the memory 40 may also be an external storage device of the electronic device 100, such as a plug-in hard disk equipped on the terminal 1, a smart media card (SMC), and a secure digital (SD) card. , Flash Card, etc. Further, the memory 40 may also include both an internal storage unit of the electronic device 100 and an external storage device.
  • the memory 40 can be used not only to store application software and various data (for example, the computer program 01) installed in the electronic device 100, but also to temporarily store data that has been output or will be output.
  • the bus 50 may be a peripheral component interconnection standard (PCI) bus or an extended industry standard architecture (EISA) bus or the like.
  • PCI peripheral component interconnection standard
  • EISA extended industry standard architecture
  • the bus can be divided into address bus, data bus, control bus, etc. For ease of representation, only a thick line is used in FIG. 50 to represent, but it does not mean that there is only one bus or one type of bus.
  • the electronic device 100 further includes a touch display assembly 10.
  • the touch display component 10 may be a touch liquid crystal display panel, an OLED (Organic Light-Emitting Diode, organic light emitting diode), etc.
  • the touch display assembly 10 may be appropriately called a touch screen or a touch screen, which is used for displaying information processed in the electronic device 100 and for displaying a visual user interface, and for the user to input instructions by touch operation.
  • the electronic device 100 further includes a camera 20.
  • the camera 20 is used to collect images.
  • the processor 30 may be a central processing unit (CPU), controller, microcontroller, microprocessor, or other data processing chip, and is used to run program codes or processes stored in the memory 40 data. Specifically, the processor 30 executes the computer program 01 to implement the aforementioned method of executing instructions based on trajectories.
  • CPU central processing unit
  • controller microcontroller
  • microprocessor microprocessor
  • FIG. 11 is a schematic diagram of the computer-readable storage medium 300 of the first embodiment.
  • the computer-readable storage medium 300 stores a computer program.
  • the computer program is executed to implement the above-mentioned method of executing instructions based on the trajectory.
  • 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 can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each unit in each embodiment 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.

Abstract

A method for executing instructions based on trajectory, which is applied to an electronic device. The method comprises: acquiring an operation trajectory (S101); detecting whether the operation trajectory matches a preset reference trajectory (S103); and, when the operation trajectory matches the reference trajectory, executing a corresponding operation instruction (S105). Further disclosed are an electronic device and a computer-readable storage medium. In the above method for executing instructions based on trajectory, electronic device and computer readable storage medium, the operation trajectory can be directly used to execute a corresponding operation instruction, and the operation is relatively fast.

Description

一种基于轨迹执行指令的方法、电子设备及计算机可读存储介质Method, electronic equipment and computer-readable storage medium for executing instructions based on trajectory 技术领域Technical field
本发明涉及电子技术领域,尤其涉及一种基于轨迹执行指令的方法、电子设备及计算机可读存储介质。The present invention relates to the field of electronic technology, and in particular to a method, electronic equipment and computer-readable storage medium for executing instructions based on trajectories.
背景技术Background technique
目前越来越多的电子设备利用密码(如字符密码,指纹密码等)执行相应的指令来实现一些功能,例如,启动应用、解锁屏幕、删除文件等。At present, more and more electronic devices use passwords (such as character passwords, fingerprint passwords, etc.) to execute corresponding instructions to implement some functions, such as launching applications, unlocking screens, and deleting files.
然而,字符密码容易破解。而电子设备中采用指纹密码,需要执行相应的执行时,一般都需要在触控显示屏中确认是否使用指纹,然后输入指纹进行解锁,操作比较麻烦。所以减少操作步骤,提高用户操作效率,是目前迫切需要的。However, character passwords are easy to crack. When the fingerprint password is used in the electronic device, when the corresponding execution needs to be performed, it is generally necessary to confirm whether the fingerprint is used in the touch display screen, and then input the fingerprint to unlock, which is troublesome. Therefore, reducing operation steps and improving user operation efficiency are currently urgently needed.
发明内容Summary of the invention
本申请实施例公开一种基于轨迹执行指令的方法、电子设备及计算机可读存储介质,能够减少操作步骤,提高用户操作效率。The embodiments of the present application disclose a method, an electronic device, and a computer-readable storage medium for executing instructions based on a trajectory, which can reduce operation steps and improve user operation efficiency.
一方面,本申请实施例公开的一种基于轨迹执行指令的方法,应用于电子设备中,该方法包括:On the one hand, a method for executing instructions based on trajectories disclosed in an embodiment of the present application is applied to an electronic device, and the method includes:
获取操作轨迹;Obtain the operation track;
检测操作轨迹与预设基准轨迹是否相匹配;以及Check whether the operation trajectory matches the preset reference trajectory; and
当操作轨迹与预设基准轨迹相匹配时,执行相应的操作指令。When the operation trajectory matches the preset reference trajectory, the corresponding operation instruction is executed.
另一方面,本申请实施例还公开的一种电子设备,包括:处理器、存储器以及计算机程序,其中所述计算机程序被存储在存储器中,并且被配置成由处理器执行,所述计算机程序被处理器执行时实现上述的方法。On the other hand, an electronic device also disclosed in an embodiment of the present application includes a processor, a memory, and a computer program, wherein the computer program is stored in the memory and is configured to be executed by the processor, and the computer program The above method is implemented when executed by the processor.
另一方面,本申请实施例还公开的一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现上述的方法。On the other hand, an embodiment of the present application also discloses a computer-readable storage medium, on which a computer program is stored, and the computer program is executed by a processor to implement the above method.
上述一种基于轨迹执行指令的方法、电子设备及计算机可读存储介质,直接使用操作轨迹执行相应的操作指令,操作比较快捷。The above-mentioned method, electronic equipment, and computer-readable storage medium for executing instructions based on trajectories directly use the operation trajectory to execute corresponding operation instructions, and the operation is relatively fast.
附图说明Description of the drawings
图1为本申请第一实施提供的一种基于轨迹执行指令的方法的流程示意图。FIG. 1 is a schematic flowchart of a method for executing instructions based on trajectories provided by the first implementation of this application.
图2为本申请第一实施例的用户图形界面示意图。Fig. 2 is a schematic diagram of a user graphical interface of the first embodiment of the application.
图3为本申请图1中的预设映射表关系表的示意图。FIG. 3 is a schematic diagram of the preset mapping table relationship table in FIG. 1 of this application.
图4为图1所示步骤S1031的第一实施例子流程。Fig. 4 is a flowchart of a first embodiment of step S1031 shown in Fig. 1.
图5为图1所示骤S1031的第二施例部分子流程的部分示意图。FIG. 5 is a partial schematic diagram of a partial sub-process of the second embodiment of step S1031 shown in FIG. 1.
图6为图1所示骤S1031的第三施例部分子流程的示意图。FIG. 6 is a schematic diagram of a partial sub-process of the third embodiment of step S1031 shown in FIG. 1.
图7为图4所示步骤S405的第一实施例子流程示意图。FIG. 7 is a schematic flowchart of the first implementation example of step S405 shown in FIG. 4.
图8为本申请第二实施例提供的用户图形界面示意图。FIG. 8 is a schematic diagram of a user graphical interface provided by the second embodiment of this application.
图9为本申请第二实施例提供的一种基于轨迹执行指令的方法的部分流程示意图。FIG. 9 is a schematic partial flowchart of a method for executing instructions based on trajectories provided by the second embodiment of this application.
图10为本申请第一实施例提供的一种电子设备的功能结构示意图。FIG. 10 is a schematic diagram of the functional structure of an electronic device provided by the first embodiment of this application.
图11为本申请第一实施例提供的一种计算机可读存储介质的示意图。FIG. 11 is a schematic diagram of a computer-readable storage medium provided by the first embodiment of this application.
具体实施方式detailed description
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in the art without creative work fall within the protection scope of this application.
需要说明的是,在本发明实施例中使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本发明。在本发明实施例和所附权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。还应当理解,本文中使用的术语“和/或”是指并包含一个或多个相关联的列出项目的任何或所有可能组合。It should be noted that the terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit the present invention. The singular forms of "a", "said" and "the" used in the embodiments of the present invention and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and/or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
请参阅图1,图1为本申请一实施例公开的基于轨迹执行指令的方法的流程图。该基于轨迹执行指令的方法应用于电子设备中。在本实施例中,该电子设备为具有手写绘图功能的电子设备。其中,该电子设备包括但不限于手机、平板电脑、智能手环、笔记本电脑、台式电脑、多媒体播放器中具有触控显示组件的电子设备。电子设备的操作系统包括但不限于Andirod操作系统、IOS操作系统、Symbian(塞班)操作系统、BlackBerry(黑莓)操作系统、Windows Phone操作系统等等。该方法包括下面步骤。Please refer to FIG. 1. FIG. 1 is a flowchart of a method for executing instructions based on a trajectory disclosed in an embodiment of the application. The method of executing instructions based on trajectories is applied to electronic devices. In this embodiment, the electronic device is an electronic device with a handwriting drawing function. Wherein, the electronic device includes, but is not limited to, electronic devices with touch display components in mobile phones, tablet computers, smart bracelets, notebook computers, desktop computers, and multimedia players. Operating systems of electronic devices include but are not limited to Andirod operating system, IOS operating system, Symbian operating system, BlackBerry operating system, Windows Phone operating system and so on. The method includes the following steps.
步骤S101,获取操作轨迹。在一些可行的实施例中,该操作轨迹可通过检测外部对象在触控显示组件上的触摸轨迹获取。外部对象为但不限于触控笔,手指等。如图2所示,手指在触控显示组件中进行滑动时,可以检测到相应的触摸轨迹S从而获得该操作轨迹TS。Step S101: Obtain the operation track. In some feasible embodiments, the operation track can be obtained by detecting the touch track of the external object on the touch display component. External objects are but not limited to stylus, fingers, etc. As shown in FIG. 2, when the finger slides in the touch display assembly, the corresponding touch track S can be detected to obtain the operation track TS.
在另一些可行的实施例中,该操作轨迹TS还可通过摄像头获取。例如,在电子设备中设置摄像头,通过摄像头获取外部对象(如手指、触控装置、手掌等)的运动轨迹从而获得该操作轨迹TS。In some other feasible embodiments, the operation trajectory TS may also be obtained by a camera. For example, a camera is provided in an electronic device, and the movement track of an external object (such as a finger, a touch device, a palm, etc.) is acquired through the camera to obtain the operation track TS.
步骤S103,检测该操作轨迹TS与预设基准轨迹SS是否相匹配。在一些可行的实施例中,电子设备中存储有预设映射表关系表P,其中,该映射关系表P包括基准轨迹集D 1和操作指令集的映射关系D 2(如图3所示)。该预设基准轨迹可从该预设映射关系表P中查找出。 Step S103, detecting whether the operation trajectory TS matches the preset reference trajectory SS. In some feasible embodiments, a preset mapping table relationship table P is stored in the electronic device, wherein the mapping relationship table P includes a reference trajectory set D 1 and a mapping relationship D 2 of an operation instruction set (as shown in FIG. 3) . The preset reference trajectory can be found from the preset mapping table P.
步骤S105,当该操作轨迹TS与预设基准轨迹SS相匹配时,执行相应的操作指令。在一些可行的实施例中,该操作指令可以为但不限于开启该电子设备中的某个应用程序、对该电子设备解锁、存储,删除,轨迹重放,向其他电子设备发送信号和文件中的至少一项(如图3所示)。Step S105, when the operation trajectory TS matches the preset reference trajectory SS, a corresponding operation instruction is executed. In some feasible embodiments, the operation instruction may be, but is not limited to, opening an application in the electronic device, unlocking the electronic device, storing, deleting, replaying the track, sending signals and files to other electronic devices At least one item (as shown in Figure 3).
上述实施例中,可以直接使用操作轨迹执行相应的操作指令,操作比较快捷。In the above-mentioned embodiment, the operation track can be directly used to execute the corresponding operation instruction, and the operation is relatively quick.
具体地,在一些可行的实例中,步骤S103包括:步骤S1031,计算操作轨迹TS与预设基准轨迹SS的相似度;步骤S1033,当该相似度达到预设阈值时,检测出操作轨迹TS与预设基准轨迹SS相匹配。在本实施例中,通过操作轨迹TS和预设基准轨迹SS的相似度判断出操作轨迹TS是否与预设基准轨迹SS相匹配,提高匹配效率和灵敏度。Specifically, in some feasible examples, step S103 includes: step S1031, calculating the similarity between the operation trajectory TS and the preset reference trajectory SS; step S1033, when the similarity reaches the preset threshold, detecting that the operation trajectory TS is The preset reference trajectory SS matches. In this embodiment, it is determined whether the operation trajectory TS matches the preset reference trajectory SS based on the similarity between the operation trajectory TS and the preset reference trajectory SS, which improves the matching efficiency and sensitivity.
在另一些可行的实施例中,还可以通过检测该操作轨迹TS与预设基准轨迹SS是否相匹配。例如,可以检测操作轨迹TS和预设基准轨迹SS中部分或者全部轨迹点是否相同来实现。In other feasible embodiments, it is also possible to detect whether the operation trajectory TS matches the preset reference trajectory SS. For example, it can be implemented by detecting whether part or all of the track points in the operation track TS and the preset reference track SS are the same.
请参看图4,在一些可行的实施例中,预设基准轨迹SS包括基准坐标集,基准坐标集中的每一基准坐标具有唯一序号。操作轨迹TS包括连续的第一轨迹点坐标集。其中,步骤S1031包括下面步骤。Referring to FIG. 4, in some feasible embodiments, the preset reference trajectory SS includes a reference coordinate set, and each reference coordinate in the reference coordinate set has a unique serial number. The operation trajectory TS includes a continuous set of first trajectory point coordinates. Among them, step S1031 includes the following steps.
步骤S401,按照预设采样规则从第一轨迹点坐标集中采样出若干轨迹点坐标来形成需验证采样坐标集B 1。其中,需验证采样坐标集B 1中需验证采样坐标的数量与基准坐标集中基准坐标的数量相同。该预设采样规则为按照预设长度进行采样,其中预设长度为L/(N-1),其中,L为轨迹的总长度,N为该预设数量。 In step S401, a number of track point coordinates are sampled from the first track point coordinate set according to a preset sampling rule to form a sample coordinate set B 1 to be verified. Among them, it is necessary to verify that the number of sampling coordinates in the sampling coordinate set B 1 is the same as the number of reference coordinates in the reference coordinate set. The preset sampling rule is to sample according to a preset length, where the preset length is L/(N-1), where L is the total length of the track, and N is the preset number.
步骤S403,根据第一轨迹点坐标集顺序给需验证采样坐标集B1中需验证 采样坐标分配唯一序号,使需验证采样坐标的序号与基准坐标的序号一一对应,其中第一轨迹点坐标集顺序包括第一轨迹点坐标集从起始点至终点的顺序或者第一轨迹点坐标集从终点至起始点的顺序。Step S403: Assign a unique serial number to the sampling coordinate to be verified in the sampling coordinate set B1 to be verified according to the sequence of the first track point coordinate set, so that the serial number of the sampling coordinate to be verified corresponds to the serial number of the reference coordinate, and the first track point coordinate set The sequence includes the sequence from the start point to the end point of the first track point coordinate set or the sequence from the end point to the start point of the first track point coordinate set.
步骤S405,将需验证采样坐标集B1变换为具有预设区域R中的坐标来形成第一变换坐标集(如图8所示)。Step S405: Transform the sample coordinate set B1 to be verified into coordinates in the preset area R to form a first transformed coordinate set (as shown in FIG. 8).
步骤S407,按照预设移动规则获取第一变换坐标集所围成的区域中的一个坐标作为第一中心坐标。Step S407: Acquire one coordinate in the area enclosed by the first transformed coordinate set as the first center coordinate according to the preset movement rule.
步骤S409,以第一中心坐标作为坐标原点对第一变换坐标集进行变换形成需验证坐标集。Step S409: Transform the first transformed coordinate set using the first center coordinates as the coordinate origin to form a coordinate set to be verified.
步骤S411,计算出序号相对应的需验证坐标和基准坐标的差异值。Step S411: Calculate the difference between the coordinate to be verified and the reference coordinate corresponding to the serial number.
步骤S413,根据差异值计算相似度。具体地,在一些实施例中,需验证坐标和基准坐标的差异值为:需验证坐标和对应的基准坐标之间的距离。根据差异值计算相似度具体为:In step S413, the similarity is calculated according to the difference value. Specifically, in some embodiments, the difference between the coordinate to be verified and the reference coordinate is: the distance between the coordinate to be verified and the corresponding reference coordinate. The calculation of similarity based on the difference value is specifically:
Figure PCTCN2019076954-appb-000001
Figure PCTCN2019076954-appb-000001
Figure PCTCN2019076954-appb-000002
Figure PCTCN2019076954-appb-000002
其中,s用于表示近似度,W用于表示预设区域R的宽度;C[k] X用于表示第k个需验证坐标在X轴的坐标值;第k个需验证坐标在Y轴的坐标值C[k]y;T[k] X用于表示第k个基准坐标在X轴的坐标值;T[k] y用于表示第k个基准坐标在Y轴的坐标值;d用于表示需验证坐标集和基准坐标值中所有需验证坐标和对应的基准坐标的距离的平均值,其中,N用于表示需验证坐标集或者基准坐标集中相应的坐标总数量,k为1至N。 Among them, s is used to indicate the degree of approximation, W is used to indicate the width of the preset area R; C[k] X is used to indicate the coordinate value of the kth coordinate to be verified on the X axis; the kth coordinate to be verified on the Y axis The coordinate value of C[k]y; T[k] X is used to represent the coordinate value of the k-th reference coordinate on the X axis; T[k] y is used to represent the coordinate value of the k-th reference coordinate on the Y axis; d It is used to represent the average value of the distance between all the coordinates to be verified and the corresponding reference coordinates in the coordinate set to be verified and the reference coordinate value, where N is used to represent the total number of coordinates in the coordinate set to be verified or the reference coordinate set, and k is 1. To N.
在本实施例中,首先根据需验证坐标和对应的基准坐标之间的差异值来计 算出平均差异值,然后根据平均差异值确定相似度,得出的相似度更加精准。In this embodiment, the average difference value is first calculated according to the difference value between the coordinate to be verified and the corresponding reference coordinate, and then the similarity is determined according to the average difference value, and the obtained similarity is more accurate.
请参看图5,在一些可行的实施例中,在步骤S411之前,该方法还包括下面步骤。Referring to FIG. 5, in some feasible embodiments, before step S411, the method further includes the following steps.
步骤S501,统计大于预设差异值的差异值的数量。Step S501: Count the number of difference values greater than the preset difference value.
步骤S503,判断该数量是否超过预设的数量。Step S503: It is judged whether the number exceeds a preset number.
步骤S505,当该数量超过预设的数量,操作轨迹TS与预设基准轨迹SS不匹配。Step S505: When the number exceeds the preset number, the operation trajectory TS does not match the preset reference trajectory SS.
步骤S507,当该数量未超过预设的数量时,根据差异值计算相似度。Step S507: When the number does not exceed the preset number, the similarity is calculated according to the difference value.
在本实施例中,还可以通过预先统计大于预设差异值的计差异值的数量,只有大于预设差异值的计差异值的数量才进行相似度计算,可以快速排除错误操作或者不合规操作。In this embodiment, it is also possible to pre-calculate the number of discrepancy values greater than the preset discrepancy value, and only the number of discrepancy values greater than the preset discrepancy value can be calculated for similarity, which can quickly eliminate incorrect operations or non-compliance. operating.
请参看图6,在一些可行的实施例中,预设基准轨迹围成闭合区域。闭合区域例如,预设轨迹为三角形,圆形,椭圆形等,其闭合区域为三角形,圆形,椭圆形。在步骤S411之前,该方法还包括:步骤S600,检测操作轨迹是否围成闭合区域,并当围成闭合区域时执行步骤S411。具体地,检测操作轨迹是否围成闭合区域包括:Referring to FIG. 6, in some feasible embodiments, the preset reference trajectory encloses a closed area. The closed area, for example, the preset trajectory is triangle, circle, ellipse, etc., and the closed area is triangle, circle, ellipse. Before step S411, the method further includes: step S600, detecting whether the operation track encloses a closed area, and executing step S411 when enclosing the closed area. Specifically, detecting whether the operation track encloses a closed area includes:
步骤S601,检测该第一轨迹点坐标集的起点坐标和终点坐标是否相同;Step S601, detecting whether the start point coordinates and the end point coordinates of the first track point coordinate set are the same;
步骤S603,当该第一轨迹点坐标集的起点坐标和终点坐标相同,该操作轨迹围成闭合区域。Step S603: When the start point coordinates and the end point coordinates of the first track point coordinate set are the same, the operation track encloses a closed area.
在本实施例中,设定围成闭合区域的轨迹作为预设基准轨迹,从而通过检测操作轨迹所围成的区域是否为闭合区域,进一步快速排除误操作或者不合规操作。In this embodiment, the trajectory enclosed by the closed area is set as the preset reference trajectory, so that by detecting whether the area enclosed by the operation trajectory is a closed area, misoperation or non-compliant operation can be further quickly eliminated.
请参看图7和图8,在一些可行的实施例中,步骤S405具体包括下面步骤。Please refer to FIG. 7 and FIG. 8. In some feasible embodiments, step S405 specifically includes the following steps.
步骤S701,计算操作轨迹TS所围成的区域在X坐标和Y坐标上的宽度w和高度h。Step S701: Calculate the width w and height h of the area enclosed by the operation track TS in the X and Y coordinates.
步骤S703,根据宽度w和高度h最大的一者确定预设区域R。在本实施例中,预设区域为正方形,正方形的边长等于宽度w和高度h中最大的一者。Step S703: Determine the preset area R according to the largest one of the width w and the height h. In this embodiment, the preset area is a square, and the side length of the square is equal to the largest one of the width w and the height h.
步骤S705,将需验证采样坐标集B1缩放到预设区域R来形成第一变换坐标集。Step S705: Scale the sample coordinate set B1 to be verified to the preset area R to form a first transformed coordinate set.
在本实施例中,可以将操作轨迹在预设区域中进行变换,对操作轨迹的位置没有进行限定,操作起来更加便捷。In this embodiment, the operation trajectory can be changed in the preset area, and the position of the operation trajectory is not limited, and the operation is more convenient.
请参看图9,在一些可行的实施例中,在步骤S1031之前,该方法还包括形成基准坐标集的步骤。其中,形成基准坐标集的步骤与形成需验证坐标集的步骤基本一致,具体地,该方法还包括下面步骤。Referring to FIG. 9, in some feasible embodiments, before step S1031, the method further includes a step of forming a reference coordinate set. Wherein, the step of forming the reference coordinate set is basically the same as the step of forming the coordinate set to be verified. Specifically, the method further includes the following steps.
步骤S901,获取该预设基准轨迹,该预设基准轨迹包括连续的第二轨迹点坐标集。Step S901: Obtain the preset reference trajectory, where the preset reference trajectory includes a continuous set of second trajectory point coordinates.
步骤S903,按照预设采样规则从该第二轨迹点坐标集中采样出若干轨迹点坐标来形成该基准采样坐标集。In step S903, a number of track point coordinates are sampled from the second track point coordinate set according to a preset sampling rule to form the reference sampling coordinate set.
步骤S905,将该基准采样坐标集中的基准采样坐标变换为预设区域R内的坐标来形成第二变换坐标。Step S905: Transform the reference sample coordinates in the reference sample coordinate set into coordinates in the preset area R to form a second transformed coordinate.
步骤S907,按照该移动规则获取将该第二变换坐标集所围成的区域中的一个坐标作为第二中心坐标。Step S907: Acquire a coordinate in the area enclosed by the second transformed coordinate set as the second center coordinate according to the movement rule.
步骤S909,以该第二中心坐标作为坐标原点对该第二变换坐标进行变换形成该基准坐标集。Step S909: Transform the second transformed coordinate using the second center coordinate as the coordinate origin to form the reference coordinate set.
其中,步骤S905,具体包括:Wherein, step S905 specifically includes:
步骤S9051,计算该预设基准轨迹所围成的区域在X坐标和Y坐标上的宽 度和高度;Step S9051: Calculate the width and height of the area enclosed by the preset reference trajectory in X and Y coordinates;
步骤S9053,根据该宽度和高度最大的一者确定预设区域R的宽度;Step S9053: Determine the width of the preset area R according to the largest one of the width and the height;
步骤S9055,将该基准采样坐标集缩放到预设区域R来形成该第二变换坐标集。Step S9055, scaling the reference sampling coordinate set to the preset area R to form the second transformed coordinate set.
本实施例的基准坐标集的形成方法与需验证坐标集的形成步骤方法,可以确保基准坐标集和需验证坐标集之间的一致性,进一步提高了操作轨迹的匹配准确性。The method for forming the reference coordinate set and the step method for forming the coordinate set to be verified in this embodiment can ensure the consistency between the reference coordinate set and the coordinate set to be verified, and further improve the matching accuracy of the operation track.
请参看图10,图10为第一实施方式的电子设备示意图。电子设备100包括一个或者多个处理器30、存储器40、总线50。Please refer to FIG. 10, which is a schematic diagram of the electronic device of the first embodiment. The electronic device 100 includes one or more processors 30, a memory 40, and a bus 50.
其中,存储器40至少包括一种类型的可读存储介质,该可读存储介质包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、磁性存储器、磁盘、光盘等。存储器40在一些实施例中可以是电子设备100的内部存储单元,例如电子设备100的硬盘。存储器40在另一些实施例中也可以是电子设备100的外部存储设备,例如终端1上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,存储器40还可以既包括电子设备100的内部存储单元也包括外部存储设备。存储器40不仅可以用于存储安装于电子设备100的应用软件及各类数据(例如,计算机程序01),还可以用于暂时地存储已经输出或者将要输出的数据。The memory 40 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 40 may be an internal storage unit of the electronic device 100 in some embodiments, such as a hard disk of the electronic device 100. In other embodiments, the memory 40 may also be an external storage device of the electronic device 100, such as a plug-in hard disk equipped on the terminal 1, a smart media card (SMC), and a secure digital (SD) card. , Flash Card, etc. Further, the memory 40 may also include both an internal storage unit of the electronic device 100 and an external storage device. The memory 40 can be used not only to store application software and various data (for example, the computer program 01) installed in the electronic device 100, but also to temporarily store data that has been output or will be output.
总线50可以是外设部件互连标准(peripheral component interconnect,简称PCI)总线或扩展工业标准结构(extended industry standard architecture,简称EISA)总线等。该总线可以分为地址总线、数据总线、控制总线等。为便于表示,图50中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。The bus 50 may be a peripheral component interconnection standard (PCI) bus or an extended industry standard architecture (EISA) bus or the like. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, only a thick line is used in FIG. 50 to represent, but it does not mean that there is only one bus or one type of bus.
进一步地,电子设备100还包括触控显示组件10。触控显示组件10可以为触控式液晶显示面板以及OLED(Organic Light-Emitting Diode,有机发光二极管)等。其中,触控显示组件10可以适当的称为触摸屏、触控屏,用于显示在电子设备100中处理的信息以及用于显示可视化的用户界面,并供用户触控操作输入指令。Further, the electronic device 100 further includes a touch display assembly 10. The touch display component 10 may be a touch liquid crystal display panel, an OLED (Organic Light-Emitting Diode, organic light emitting diode), etc. Wherein, the touch display assembly 10 may be appropriately called a touch screen or a touch screen, which is used for displaying information processed in the electronic device 100 and for displaying a visual user interface, and for the user to input instructions by touch operation.
进一步地,电子设备100还包括摄像头20。摄像头20用于采集图像。Further, the electronic device 100 further includes a camera 20. The camera 20 is used to collect images.
处理器30在一些实施例中可以是一中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器或其他数据处理芯片,用于运行存储器40中存储的程序代码或处理数据。具体地,处理器30执行计算机程序01以实现上述基于轨迹执行指令的方法。In some embodiments, the processor 30 may be a central processing unit (CPU), controller, microcontroller, microprocessor, or other data processing chip, and is used to run program codes or processes stored in the memory 40 data. Specifically, the processor 30 executes the computer program 01 to implement the aforementioned method of executing instructions based on trajectories.
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in the form of a computer program product in whole or in part.
请参看图11,图11为第一实施方式的计算机可读存储介质300的示意图。计算机可读存储介质300存储有计算机程序。计算机程序被执行以实现上述基于轨迹执行指令的方法。Please refer to FIG. 11, which is a schematic diagram of the computer-readable storage medium 300 of the first embodiment. The computer-readable storage medium 300 stores a computer program. The computer program is executed to implement the above-mentioned method of executing instructions based on the trajectory.
该计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行该计算机程序指令时,全部或部分地产生按照本发明实施例该的流程或功能。该计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。该计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一计算机可读存储介质传输,例如,该计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL)) 或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。该计算机可读存储介质可以是计算机能够存储的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。该可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘Solid State Disk(SSD))等。The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, the processes or functions according to the embodiments of the present invention are generated in whole or in part. 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. For example, 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. 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)).
需要说明的是,对于前述的各个方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领技术人员应该知悉,本申请并不受所描述的动作顺序的限制,因为依据本申请,某一些步骤可以采用其他顺序或者同时进行。其次,本领技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本申请所必须的。It should be noted that for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations, but those skilled in the art should know that this application is not limited by the described sequence of actions, because According to the application, certain steps can be performed in other order or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by this application.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详细描述的部分,可以参见其他实施例的相关描述。In the above-mentioned embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in an embodiment, reference may be made to related descriptions of other embodiments.
本申请实施例方法中的步骤可以根据实际需要进行顺序调整、合并和删减。The steps in the method of the embodiment of the present application can be adjusted, merged, and deleted in order according to actual needs.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,该单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed system, device, and method may be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the unit is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or may be Integrate into another system, or some features can be ignored or not implemented. In addition, 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 can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, the functional units in each embodiment 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.
该集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例该方法的全部或部分步骤。If 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. Based on this understanding, 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.

Claims (19)

  1. 一种基于轨迹执行指令的方法,应用于电子设备中,其特征在于,所述方法包括:A method for executing instructions based on a trajectory, applied to an electronic device, characterized in that the method includes:
    获取操作轨迹;Obtain the operation track;
    检测所述操作轨迹与预设基准轨迹是否相匹配;以及Detecting whether the operation trajectory matches a preset reference trajectory; and
    当所述操作轨迹与所述预设基准轨迹相匹配时,执行相应的操作指令。When the operation trajectory matches the preset reference trajectory, a corresponding operation instruction is executed.
  2. 根据权利要求1所述的方法,其特征在于,检测所述操作轨迹与所述预设基准轨迹的是否相匹配具体包括:The method according to claim 1, wherein detecting whether the operation trajectory matches the preset reference trajectory specifically comprises:
    计算所述操作轨迹与所述预设基准轨迹的相似度;以及Calculating the similarity between the operation trajectory and the preset reference trajectory; and
    当所述相似度达到预设阈值时,检测出所述操作轨迹与所述预设基准轨迹相匹配。When the similarity reaches a preset threshold, it is detected that the operation trajectory matches the preset reference trajectory.
  3. 根据权利要求2所述的方法,其特征在于,在计算所述操作轨迹与基准轨迹的相似度之前,所述方法还包括:The method according to claim 2, wherein before calculating the similarity between the operation trajectory and the reference trajectory, the method further comprises:
    从预设映射关系表中查找出所述预设基准轨迹,其中,所述映射关系表包括基准轨迹集和操作指令集的映射关系。The preset reference trajectory is searched out from a preset mapping relationship table, where the mapping relationship table includes a mapping relationship between a reference trajectory set and an operation instruction set.
  4. 根据权利要求3所述的方法,其特征在于,所述预设映射表关系表存储于所述电子设备中。The method according to claim 3, wherein the preset mapping table relationship table is stored in the electronic device.
  5. 根据权利要求1所述的方法,其特征在于,所述预设基准轨迹包括基准坐标集,所述基准坐标集中的每一基准坐标具有唯一序号;所述操作轨迹包括连续的第一轨迹点坐标集,计算所述操作轨迹与所述预设基准轨迹的相似度包括:The method according to claim 1, wherein the preset reference trajectory includes a reference coordinate set, and each reference coordinate in the reference coordinate set has a unique serial number; the operation trajectory includes consecutive first trajectory point coordinates Set, calculating the similarity between the operation trajectory and the preset reference trajectory includes:
    按照预设采样规则从所述第一轨迹点坐标集中采样出若干轨迹点坐标来形成需验证采样坐标集,其中,所述需验证采样坐标集中需验证采样坐标的数量与所述基准坐标集中基准坐标的数量相同;According to a preset sampling rule, several trajectory point coordinates are sampled from the first track point coordinate set to form a sampled coordinate set to be verified, wherein the number of sampled coordinates to be verified in the sampled coordinate set to be verified is the same as that of the reference coordinate set. The number of coordinates is the same;
    根据所述第一轨迹点坐标集顺序给所述需验证采样坐标集中需验证采样坐 标分配唯一序号,使所述需验证采样坐标的序号与所述基准坐标的序号一一对应,其中所述第一轨迹点坐标集顺序包括第一轨迹点坐标集从起始点至终点的顺序或者所述第一轨迹点坐标集从所述终点至所述起始点的顺序;According to the sequence of the first track point coordinate set, a unique serial number is assigned to the sampling coordinate to be verified in the sampling coordinate set to be verified, so that the serial number of the sampling coordinate to be verified corresponds to the serial number of the reference coordinate one-to-one, wherein the first A track point coordinate set sequence includes the sequence of the first track point coordinate set from the start point to the end point or the sequence of the first track point coordinate set from the end point to the start point;
    将所述需验证采样坐标集变换为预设区域R中的坐标来形成第一变换坐标集;Transforming the sample coordinate set to be verified into coordinates in the preset area R to form a first transformed coordinate set;
    按照预设移动规则获取所述第一变换坐标集所围成的区域中的一个坐标作为第一中心坐标;Acquiring, according to a preset movement rule, one coordinate in the area enclosed by the first transformed coordinate set as the first center coordinate;
    以所述第一中心坐标作为坐标原点对所述第一变换坐标集进行变换形成需验证坐标集;Transforming the first transformed coordinate set using the first center coordinates as the coordinate origin to form a coordinate set to be verified;
    计算出序号相对应的所述需验证坐标和所述基准坐标的差异值;以及Calculate the difference between the coordinate to be verified and the reference coordinate corresponding to the serial number; and
    根据所述差异值计算所述相似度。The similarity is calculated according to the difference value.
  6. 根据权利要求5所述的方法,其特征在于,计算所述操作轨迹与基准轨迹的相似度之前所述方法还包括:The method according to claim 5, wherein before calculating the similarity between the operation trajectory and the reference trajectory, the method further comprises:
    获取所述预设基准轨迹,所述预设基准轨迹包括连续的第二轨迹点坐标集;Acquiring the preset reference trajectory, where the preset reference trajectory includes a continuous set of second trajectory point coordinates;
    按照预设采样规则从所述第二轨迹点坐标集中采样出若干轨迹点坐标来形成所述基准采样坐标集;Sampling a number of track point coordinates from the second track point coordinate set according to a preset sampling rule to form the reference sampling coordinate set;
    将所述基准采样坐标集中的基准采样坐标变换为具有预设尺寸的预设区域内的坐标来形成第二变换坐标;Transforming the reference sampling coordinates in the reference sampling coordinate set into coordinates in a preset area with a preset size to form a second transformed coordinate;
    按照所述移动规则获取将所述第二变换坐标集所围成的区域中的一个坐标作为第二中心坐标;以及Acquiring one coordinate in the area enclosed by the second transformed coordinate set as the second center coordinate according to the movement rule; and
    以所述第二中心坐标作为坐标原点对所述第二变换坐标进行变换形成所述基准坐标集。Transform the second transformed coordinates using the second center coordinates as the origin of coordinates to form the reference coordinate set.
  7. 根据权利要求5或者6所述的方法,其特征在于,所述预设采样规则为按照预 设长度进行采样,其中预设长度为L/(N-1),其中,L为轨迹的总长度,N为所述预设数量。The method according to claim 5 or 6, wherein the preset sampling rule is to sample according to a preset length, wherein the preset length is L/(N-1), where L is the total length of the track , N is the preset number.
  8. 根据权利要求5所述的方法,其特征在于,将所述需验证采样坐标集变换为具有预设尺寸的预设区域的坐标,具体包括:The method according to claim 5, wherein transforming the coordinate set of samples to be verified into the coordinates of a preset area with a preset size specifically comprises:
    计算所述操作轨迹所围成的区域在X坐标和Y坐标上的宽度和高度;Calculate the width and height of the area enclosed by the operation track in X and Y coordinates;
    根据所述宽度和高度最大的一者确定所述预设区域;以及Determining the preset area according to the largest one of the width and height; and
    将所述需验证采样坐标集缩放到所述预设区域来形成所述第一变换坐标集。The sampling coordinate set to be verified is scaled to the preset area to form the first transformed coordinate set.
  9. 根据权利要求6所述的方法,其特征在于,将所述基准采样坐标集中的基准采样坐标变换为所述预设区域内的坐标以形成第二变换坐标具体包括:The method according to claim 6, wherein transforming the reference sampling coordinates in the reference sampling coordinate set into coordinates in the preset area to form the second transformed coordinates specifically comprises:
    计算所述预设基准轨迹所围成的区域在X坐标和Y坐标上的宽度和高度;Calculating the width and height of the area enclosed by the preset reference track on the X coordinate and the Y coordinate;
    根据所述宽度和高度最大的一者确定所述预设区域的宽度;Determining the width of the preset area according to the largest one of the width and height;
    将所述基准采样坐标集缩放到所述预设区域来形成所述第二变换坐标集。The reference sampling coordinate set is scaled to the preset area to form the second transformed coordinate set.
  10. 如权利要求9所述的所述方法,其特征在于,所述预设区域为正方形,所述正方形的边长等于所述宽度和高度最大的一者。The method according to claim 9, wherein the predetermined area is a square, and the side length of the square is equal to the largest one of the width and the height.
  11. 根据权利要求5所述的方法,其特征在于,需验证坐标和基准坐标的差异值为:需验证坐标和对应的基准坐标之间的距离;所述根据所述差异值计算所述相似度具体为:The method according to claim 5, wherein the difference value between the coordinate to be verified and the reference coordinate is: the distance between the coordinate to be verified and the corresponding reference coordinate; the calculation of the similarity according to the difference value is specific for:
    Figure PCTCN2019076954-appb-100001
    Figure PCTCN2019076954-appb-100001
    Figure PCTCN2019076954-appb-100002
    Figure PCTCN2019076954-appb-100002
    其中,s用于表示近似度,W用于表示所述预设区域的宽度;所述C[k] X用于表示第k个需验证坐标在X轴的坐标值;第k个需验证坐标在Y轴的坐标值C[k]y;所述T[k] X用于表示第k个基准坐标在X轴的坐标值;所述T[k] y用于表 示第k个基准坐标在Y轴的坐标值;d用于表示所述需验证坐标集和所述基准坐标值中所有需验证坐标和对应的基准坐标的距离的平均值,其中,N用于表示需验证坐标集或者基准坐标集中相应的坐标总数量,k为1至N。 Among them, s is used to indicate the degree of approximation, W is used to indicate the width of the preset area; the C[k] X is used to indicate the coordinate value of the kth coordinate to be verified on the X axis; the kth coordinate to be verified The coordinate value C[k]y on the Y axis; the T[k] X is used to represent the coordinate value of the k-th reference coordinate on the X axis; the T[k] y is used to represent the k-th reference coordinate in the The coordinate value of the Y axis; d is used to represent the average value of the distance between all the coordinate to be verified and the corresponding reference coordinate in the coordinate set to be verified and the reference coordinate value, where N is used to represent the coordinate set to be verified or the reference The total number of corresponding coordinates in the coordinate set, k is 1 to N.
  12. 根据权利要求5所述的方法,其特征在于,在根据所述差异值计算所述相似度之前,所述方法还包括:The method according to claim 5, wherein before calculating the similarity according to the difference value, the method further comprises:
    统计大于预设差异值的差异值的数量;Count the number of difference values greater than the preset difference value;
    判断所述数量是否超过预设的数量;Determine whether the quantity exceeds a preset quantity;
    当所述数量超过预设的数量,所述操作轨迹与所述预设基准轨迹不匹配;或者When the number exceeds the preset number, the operation trajectory does not match the preset reference trajectory; or
    当所述数量未超过预设的数量时,根据所述差异值计算所述相似度。When the number does not exceed the preset number, the similarity is calculated according to the difference value.
  13. 根据权利要求5所述的方法,其特征在于,所述预设基准轨迹围成闭合区域,在根据所述差异值计算所述相似度之前,所述方法还包括:The method according to claim 5, wherein the preset reference trajectory encloses a closed area, and before calculating the similarity according to the difference value, the method further comprises:
    检测所述操作轨迹是否围成闭合区域。It is detected whether the operation track encloses a closed area.
  14. 据权利要求13所述的方法,其特征在于,检测所述操作轨迹是否围成闭合区域具体为:The method according to claim 13, wherein detecting whether the operation track encloses a closed area is specifically:
    检测所述第一轨迹点坐标集的起点坐标和终点坐标是否相同;以及Detecting whether the start point coordinates and the end point coordinates of the first track point coordinate set are the same; and
    当所述第一轨迹点坐标集的起点坐标和终点坐标相同,所述操作轨迹围成闭合区域。When the start point coordinates and the end point coordinates of the first track point coordinate set are the same, the operation track encloses a closed area.
  15. 根据权利要求1所述的方法,其特征在于,所述操作指令包括存储,删除,轨迹重放,向其他电子设备发送信号和文件中的至少一项。The method according to claim 1, wherein the operation instruction includes at least one of storing, deleting, replaying the track, and sending a signal and a file to other electronic devices.
  16. 根据权利要求1所述的方法,其特征在于,所述操作轨迹通过摄像头获取,或者通过检测触控显示组件上的触摸轨迹获取。The method according to claim 1, wherein the operation track is acquired by a camera, or acquired by detecting a touch track on a touch display component.
  17. 一种电子设备,其特征在于,包括:处理器、存储器以及计算机程序,其中 所述计算机程序被存储在所述存储器中,并且被配置成由处理器执行,所述计算机程序被处理器执行时实现如权利要求1-16任意一项所述的方法。An electronic device characterized by comprising: a processor, a memory, and a computer program, wherein the computer program is stored in the memory and is configured to be executed by the processor, and when the computer program is executed by the processor Implement the method according to any one of claims 1-16.
  18. 根据权利要求17所述的电子设备,其特征在于,所述电子设备为具有手写绘图功能的电子设备。18. The electronic device of claim 17, wherein the electronic device is an electronic device with a handwriting and drawing function.
  19. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1-16任意一项所述的方法。A computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the method according to any one of claims 1-16 when the computer program is executed by a processor.
PCT/CN2019/076954 2019-03-05 2019-03-05 Method for executing instructions based on trajectory, electronic device and computer-readable storage medium WO2020177070A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201980073413.3A CN113260973A (en) 2019-03-05 2019-03-05 Method for executing instructions based on track, electronic equipment and computer-readable storage medium
PCT/CN2019/076954 WO2020177070A1 (en) 2019-03-05 2019-03-05 Method for executing instructions based on trajectory, electronic device and computer-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2019/076954 WO2020177070A1 (en) 2019-03-05 2019-03-05 Method for executing instructions based on trajectory, electronic device and computer-readable storage medium

Publications (1)

Publication Number Publication Date
WO2020177070A1 true WO2020177070A1 (en) 2020-09-10

Family

ID=72337402

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/076954 WO2020177070A1 (en) 2019-03-05 2019-03-05 Method for executing instructions based on trajectory, electronic device and computer-readable storage medium

Country Status (2)

Country Link
CN (1) CN113260973A (en)
WO (1) WO2020177070A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114721760A (en) * 2022-04-02 2022-07-08 京东科技信息技术有限公司 Operation track processing method and device, electronic equipment and computer storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103995661A (en) * 2013-02-20 2014-08-20 腾讯科技(深圳)有限公司 Method for triggering application programs or application program functions through gestures, and terminal
KR20140143555A (en) * 2013-06-07 2014-12-17 삼성전자주식회사 Method for executing application on unlocking screen of mobile terminal and the mobile terminal
US20150242613A1 (en) * 2013-11-05 2015-08-27 Google Inc. Directional touch unlocking for electronic devices
CN104978074A (en) * 2015-07-31 2015-10-14 广东小天才科技有限公司 Formula input method and apparatus
US9310929B2 (en) * 2014-06-06 2016-04-12 Lenovo Enterprise Solutions (Singapore) Pte. Ltd. Unlocking touch screen devices
CN107422963A (en) * 2017-04-18 2017-12-01 维沃移动通信有限公司 The unlocking method and mobile terminal of a kind of mobile terminal

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9251407B2 (en) * 2008-09-04 2016-02-02 Northrop Grumman Systems Corporation Security system utilizing gesture recognition
CN102141880A (en) * 2010-11-29 2011-08-03 华为终端有限公司 Mobile terminal and unlocking method of mobile terminal
US8776213B2 (en) * 2011-07-07 2014-07-08 Bottomline Technologies (De), Inc. Mobile application security system and method
CN107967100A (en) * 2017-12-06 2018-04-27 Tcl移动通信科技(宁波)有限公司 Operation control process method and storage medium based on mobile terminal camera
CN108664204B (en) * 2018-04-08 2019-12-03 维沃移动通信有限公司 A kind of unlocking method, device and mobile terminal
CN109388934A (en) * 2018-09-10 2019-02-26 平安科技(深圳)有限公司 Information Authentication method, apparatus, computer equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103995661A (en) * 2013-02-20 2014-08-20 腾讯科技(深圳)有限公司 Method for triggering application programs or application program functions through gestures, and terminal
KR20140143555A (en) * 2013-06-07 2014-12-17 삼성전자주식회사 Method for executing application on unlocking screen of mobile terminal and the mobile terminal
US20150242613A1 (en) * 2013-11-05 2015-08-27 Google Inc. Directional touch unlocking for electronic devices
US9310929B2 (en) * 2014-06-06 2016-04-12 Lenovo Enterprise Solutions (Singapore) Pte. Ltd. Unlocking touch screen devices
CN104978074A (en) * 2015-07-31 2015-10-14 广东小天才科技有限公司 Formula input method and apparatus
CN107422963A (en) * 2017-04-18 2017-12-01 维沃移动通信有限公司 The unlocking method and mobile terminal of a kind of mobile terminal

Also Published As

Publication number Publication date
CN113260973A (en) 2021-08-13

Similar Documents

Publication Publication Date Title
US10126824B2 (en) Generating a screenshot
WO2017185575A1 (en) Touch screen track recognition method and apparatus
TWI467438B (en) Gesture recognition method and touch system incorporating the same
US9423908B2 (en) Distinguishing between touch gestures and handwriting
US20120249448A1 (en) Method of identifying a gesture and device using the same
WO2019184490A1 (en) Method for use in displaying icons of hosted applications, and device and storage medium
CN110119733B (en) Page identification method and device, terminal equipment and computer readable storage medium
CN102662462A (en) Electronic device, gesture recognition method and gesture application method
KR101559502B1 (en) Method and recording medium for contactless input interface with real-time hand pose recognition
US9733826B2 (en) Interacting with application beneath transparent layer
US10732719B2 (en) Performing actions responsive to hovering over an input surface
WO2017028491A1 (en) Touch control display device and touch control display method
WO2020177070A1 (en) Method for executing instructions based on trajectory, electronic device and computer-readable storage medium
WO2015135362A1 (en) Interaction method and apparatus
CN106020471B (en) A kind of operating method and mobile terminal of mobile terminal
CN112835497A (en) Method and device for quickly entering electronic whiteboard and storage medium
CN109271543B (en) Thumbnail display method and device, terminal and computer-readable storage medium
US10222976B2 (en) Path gestures
CN107609119B (en) File processing method, mobile terminal and computer readable storage medium
WO2022134954A1 (en) Webpage bookmarking method, electronic device, and storage medium
US20140267030A1 (en) Computer and mouse cursor control method
US10191553B2 (en) User interaction with information handling systems using physical objects
CN110456978B (en) Touch control method, system, terminal and medium for touch terminal
WO2020093329A1 (en) Data input method for terminal device, terminal device, and storage medium
WO2020210975A1 (en) Sub-trajectory selection method, electronic device, and computer readable 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: 19918048

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

Country of ref document: EP

Kind code of ref document: A1