Instruction determination method and device, electronic equipment and storage medium

By obtaining the moving trajectory on the touch screen in an electronic device and calculating its horizontal and vertical movement distances, it is possible to determine whether the moving trajectory matches the target trajectory of the preset command, the problem of high resource occupation in the prior art is solved and equipment performance and efficiency are improved.

CN119883032APending Publication Date: 2025-04-25GREAT WALL MOTOR CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411915778.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-24
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

When determining touch gestures, the prior art requires inverse trigonometric function calculations, resulting in a high system resource occupancy of electronic devices and affecting performance.

Method used

By obtaining the movement trajectory of the operating body on the touch screen, determining its horizontal and vertical movement distances, and determining whether the movement trajectory matches the target trajectory of the preset command based on the comparison relationship of these distances, there is no need to use a trigonometric function interface.

Benefits of technology

It reduces the resource occupancy rate of electronic device processors and improves the performance and instruction determination efficiency of electronic devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119883032A_ABST
    Figure CN119883032A_ABST
Patent Text Reader

Abstract

The invention provides an instruction determination method and device, electronic equipment and a storage medium, the method is applied to the field of electronic equipment, and the method comprises the following steps: determining a horizontal movement distance and a vertical movement distance of an operation body according to a movement track of the operation body on a touch screen, and judging whether the moving track is matched with a target track of a preset instruction based on a comparison relationship between the horizontal moving distance and the vertical moving distance. According to the embodiment of the invention, a trigonometric function interface is not needed, the resource occupancy rate of the processor of the electronic equipment is reduced, and the performance and instruction determination efficiency of the electronic equipment are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of electronic devices, and more specifically, to an instruction determination method, device, electronic device and storage medium in the field of electronic devices. Background Art

[0002] With the development of science and technology, more and more electronic devices are interacting with users through touch screens. In the related art, the determination of some touch gestures requires calculating the angle between the moving track of the user's finger on the touch screen and the positive direction of the horizontal line through inverse trigonometric functions. This calculation method greatly occupies the system resources of the electronic device and affects the overall performance of the electronic device. Summary of the invention

[0003] The present application provides an instruction determination method, device, electronic device and storage medium. The method does not require the use of a trigonometric function interface, reduces the resource occupancy rate of the electronic device processor, and improves the performance of the electronic device and the instruction determination efficiency.

[0004] In a first aspect, a method for determining an instruction is provided, the method comprising: obtaining a movement trajectory of an operating body on a touch screen; determining a horizontal movement distance of the operating body in a horizontal direction and a vertical movement distance of the operating body in a vertical direction based on the movement trajectory; judging whether the movement trajectory matches a target trajectory corresponding to a preset instruction based on a comparison relationship between the horizontal movement distance and the vertical movement distance; and executing the preset instruction if the movement trajectory matches the target trajectory.

[0005] Through the above technical solution, the horizontal movement distance and vertical movement distance of the operating body are determined according to the movement trajectory of the operating body on the touch screen, and whether the movement trajectory matches the target trajectory of the preset instruction is determined based on the comparison relationship between the horizontal movement distance and the vertical movement distance. This solution does not need to use the trigonometric function interface, reduces the resource usage of the electronic device processor, and improves the performance of the electronic device and the efficiency of instruction determination.

[0006] In combination with the first aspect, in some possible implementations, the step of obtaining the movement trajectory of the operating body on the touch screen includes: obtaining the starting point coordinates and the ending point coordinates of the operating body on the touch screen; and determining the line connecting the starting point coordinates and the ending point coordinates as the movement trajectory of the operating body on the touch screen.

[0007] In combination with the first aspect and the above-mentioned implementation methods, in some possible implementation methods, the step of obtaining the starting point coordinates and the ending point coordinates of the operating body in the touch screen includes: establishing a plane coordinate system in the touch screen; when a touch operation of the operating body is detected, obtaining the starting point coordinates of the touch operation in the plane coordinate system; when it is detected that the touch operation of the operating body ends or the operating body does not move within a preset time, obtaining the ending point coordinates of the touch operation in the plane coordinate system.

[0008] In combination with the first aspect and the above-mentioned implementation methods, in some possible implementation methods, the step of determining the horizontal movement distance of the operating body in the horizontal direction and the vertical movement distance of the operating body in the vertical direction based on the movement trajectory includes: obtaining the horizontal coordinate difference between the starting point horizontal coordinate of the starting point coordinate and the end point horizontal coordinate of the end point coordinate, and determining the absolute value of the horizontal coordinate difference as the horizontal movement distance of the operating body in the horizontal direction; obtaining the vertical coordinate difference between the starting point vertical coordinate of the starting point coordinate and the end point vertical coordinate of the end point coordinate, and determining the absolute value of the vertical coordinate difference as the vertical movement distance of the operating body in the vertical direction.

[0009] In combination with the first aspect and the above-mentioned implementation methods, in some possible implementation methods, the step of judging whether the moving trajectory matches the target trajectory corresponding to the preset instruction based on the comparison relationship between the horizontal moving distance and the vertical moving distance includes: if the ratio of the vertical moving distance to the horizontal moving distance is less than or equal to the target value corresponding to the preset instruction, determining that the moving trajectory matches the target trajectory corresponding to the preset instruction; if the ratio of the vertical moving distance to the horizontal moving distance is greater than the target value corresponding to the preset instruction, determining that the moving trajectory does not match the target trajectory corresponding to the preset instruction.

[0010] In combination with the first aspect and the above-mentioned implementation methods, in some possible implementation methods, the method also includes: if the horizontal moving distance is greater than or equal to the vertical moving distance, determining that the moving trajectory matches the target trajectory corresponding to the preset instruction; if the horizontal moving distance is less than the vertical moving distance, determining that the moving trajectory does not match the target trajectory corresponding to the preset instruction.

[0011] In combination with the first aspect and the above implementations, in some possible implementations, the method further includes: if the horizontal moving distance and the vertical moving distance are both less than a preset distance threshold, determining that the moving trajectory does not match the target trajectory corresponding to the preset instruction.

[0012] In a second aspect, a device for determining an instruction is provided, the device comprising:

[0013] A movement track acquisition unit, used to acquire the movement track of the operating body on the touch screen;

[0014] A moving distance acquisition unit, used to determine a horizontal moving distance of the operating body in a horizontal direction and a vertical moving distance of the operating body in a vertical direction based on the moving trajectory;

[0015] A distance comparison unit, used to determine whether the moving trajectory matches the target trajectory corresponding to the preset instruction based on the comparison relationship between the horizontal moving distance and the vertical moving distance;

[0016] The instruction execution unit is used to execute a preset instruction if the moving trajectory matches the target trajectory.

[0017] In a third aspect, an electronic device is provided, the electronic device comprising: a memory for storing executable program code;

[0018] A processor is used to call and run executable program code from a memory to execute the method in the above-mentioned first aspect or any possible implementation manner of the first aspect.

[0019] In a fourth aspect, a computer program product is provided, comprising: a computer program code, which, when executed on a computer, enables the computer to execute the method in the first aspect or any possible implementation of the first aspect.

[0020] In a fifth aspect, a computer-readable storage medium is provided, which stores a computer program code. When the computer program code runs on a computer, the computer executes the method in the above-mentioned first aspect or any possible implementation manner of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 is a scenario diagram of an instruction determination method provided in an embodiment of the present application;

[0022] Figure 2 It is a flowchart of an instruction determination method provided in an embodiment of the present application;

[0023] Figure 3 is an example schematic diagram of a movement trajectory provided in an embodiment of the present application;

[0024] Figure 4 is an example schematic diagram of a target trajectory provided in an embodiment of the present application;

[0025] Figure 5 It is a flowchart of an instruction determination method provided in an embodiment of the present application;

[0026] Figure 6 It is a flowchart of an instruction determination method provided in an embodiment of the present application;

[0027] Figure 7 is a structural diagram of an instruction determination device provided in an embodiment of the present application;

[0028] Figure 8 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

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

[0030] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features.

[0031] See also Figure 1 , Figure 1 Schematic diagram of a scenario of an instruction determination method provided in an embodiment of the present application. Figure 1 As shown, the instruction determination method provided in the embodiment of the present application is applied to an electronic device. The electronic device includes but is not limited to a terminal device with at least one touch screen, such as a mobile phone, a personal computer, a laptop computer, a wearable device, and a vehicle-mounted device. The terminal device detects whether the user's touch operation on the touch screen satisfies the preset instruction, and then determines whether to execute the preset instruction. In order to prevent the user from touching by mistake, the angle between the target trajectory corresponding to the preset instruction and the positive direction of the horizontal line must meet the preset angle. If the angle between the moving trajectory of the user's touch operation on the touch screen and the positive direction of the horizontal line is less than or equal to the preset angle corresponding to the preset instruction, it is determined that the touch operation satisfies the preset instruction; if the angle between the moving trajectory of the user's touch operation on the touch screen and the positive direction of the horizontal line is greater than the preset angle corresponding to the preset instruction, it is determined that the touch operation does not meet the preset instruction. In the related art, in order to obtain the angle between the moving trajectory and the positive direction of the horizontal line, it is necessary to calculate according to the inverse trigonometric function, which greatly occupies the processing time and memory of the terminal device processor.

[0032] Based on the above problems, the embodiment of the present application proposes a method for determining an instruction, which determines the horizontal movement distance and vertical movement distance of the operating body according to the movement trajectory of the operating body on the touch screen, and judges whether the movement trajectory matches the target trajectory of the preset instruction based on the comparison relationship between the horizontal movement distance and the vertical movement distance. The embodiment of the present application does not need to use a trigonometric function interface, reduces the resource occupancy rate of the electronic device processor, and improves the performance of the electronic device and the efficiency of instruction determination.

[0033] based on Figure 1 The scene diagram shown below will be combined with Figure 2-Figure 6 , the instruction determination method provided in the embodiment of the present application is introduced in detail.

[0034] See also Figure 2 , Figure 2 FIG. 1 is a flow chart of a method for determining an instruction provided in an embodiment of the present application. Figure 2 As shown, the method of the embodiment of the present application may include the following steps S101-S104.

[0035] S101, obtaining a moving track of an operating body on the touch screen;

[0036] Specifically, when the touch screen detects the touch operation of the operating body, the movement trajectory of the operating body is monitored until the touch operation ends or the operating body does not move within a preset time. The operating body is the user's finger or a touch accessory that is compatible with the electronic device where the touch screen is located. The touch screen is an inductive liquid crystal display device that senses the user's touch operation in different ways and converts the touch operation into an electrical signal for processing. The touch screen includes but is not limited to a variety of display screens based on different sensing methods, such as capacitive inductive touch screens, resistive touch screens, and infrared touch screens. The capacitive inductive touch screen uses the current induction of the operating body to work. When the operating body touches the touch screen, the operating body and the touch screen form a coupling capacitor, so that the capacitive inductive touch screen detects the user's touch operation. The resistive touch screen uses the principle of pressure sensing to determine the detection of the touch operation through the resistance change generated when the operating body touches the touch screen. The infrared touch screen detects the user's touch operation through the infrared detection network on the surface of the screen.

[0037] S102, determining a horizontal movement distance of the operating body in the horizontal direction and a vertical movement distance of the operating body in the vertical direction based on the movement trajectory;

[0038] Specifically, the horizontal moving distance of the operating body in the horizontal direction is determined based on the projection of the moving track in the horizontal direction, and the vertical moving distance of the operating body in the vertical direction is determined based on the projection of the moving track in the vertical direction. Figure 3 , Figure 3 is an example schematic diagram of a movement trajectory provided in an embodiment of the present application. Figure 3 As shown, if the moving trajectory of the operating body in the touch screen is a line segment AB, then a straight line is drawn in the vertical direction based on point A, and a straight line is drawn in the horizontal direction based on point B, and the intersection of the two straight lines is determined as point C. The projection of the moving trajectory AB in the horizontal direction is a line segment BC, and the horizontal moving distance is the length of the line segment BC. The projection of the moving trajectory AB in the vertical direction is a line segment AC, and the vertical moving distance is the length of the line segment AC.

[0039] S103, based on the comparison relationship between the horizontal moving distance and the vertical moving distance, determining whether the moving trajectory matches the target trajectory corresponding to the preset instruction;

[0040] Specifically, the horizontal moving distance is compared with the vertical moving distance to obtain the magnitude relationship between the horizontal moving distance and the vertical moving distance, and whether the moving trajectory of the operating body matches the target trajectory corresponding to the preset instruction is determined according to the magnitude relationship. The preset instruction is a function instruction such as a return instruction, a confirmation instruction, a switch instruction, or a screenshot instruction.

[0041] In order to prevent users from accidentally touching the target, in the embodiment of the present application, the angle between the target trajectory corresponding to the preset instruction and the positive direction of the horizontal line must meet the preset angle. Figure 4 , Figure 4 is an example schematic diagram of a target trajectory provided in an embodiment of the present application. Figure 4 As shown in the figure, if the target trajectory is line segment EF, the angle between the target trajectory and the positive direction of the horizontal line is θ, that is, the preset angle is θ. If the angle between the moving trajectory and the positive direction of the horizontal line is less than or equal to θ, it is determined that the moving trajectory matches the target trajectory; if the angle between the moving trajectory and the positive direction of the horizontal line is greater than θ, it is determined that the moving trajectory does not match the target trajectory.

[0042] In order to improve the efficiency of instruction determination and reduce the time and memory occupied by the electronic device processor, the embodiment of the present application determines the target value according to the preset angle, and judges whether the moving trajectory matches the target trajectory through the relationship between the horizontal moving distance and the vertical moving distance and the relationship between the target value.

[0043] S104: If the moving trajectory matches the target trajectory, a preset instruction is executed.

[0044] Specifically, if the moving trajectory matches the target trajectory, it is determined that the touch operation of the operator meets the preset instruction, and the electronic device is controlled to perform the function indicated by the preset instruction. If the function indicated by the preset instruction requires updating the display interface of the touch screen, the touch screen interface is updated.

[0045] In the embodiment of the present application, the horizontal movement distance and the vertical movement distance of the operating body are determined according to the movement track of the operating body on the touch screen, and whether the movement track matches the target track of the preset instruction is determined based on the comparison relationship between the horizontal movement distance and the vertical movement distance. The embodiment of the present application does not need to use the trigonometric function interface, reduces the resource occupancy rate of the electronic device processor, and improves the performance of the electronic device and the efficiency of instruction determination.

[0046] See also Figure 5 , Figure 5 FIG. 1 is a flow chart of a method for determining an instruction provided in an embodiment of the present application. Figure 5 As shown, the method of the embodiment of the present application may include the following steps S201-S206.

[0047] S201, obtaining the starting point coordinates and the ending point coordinates of the operating body on the touch screen, and determining the line connecting the starting point coordinates and the ending point coordinates as the moving track of the operating body on the touch screen;

[0048] Specifically, a plane coordinate system is established in the touch screen, and when a touch operation of an operating body is detected, the starting coordinates of the touch operation in the plane coordinate system are obtained; when it is detected that the touch operation of the operating body ends or the operating body does not move within a preset time, the end coordinates of the touch operation in the plane coordinate system are obtained. The line connecting the starting coordinates and the end coordinates is determined as the movement trajectory of the operating body on the touch screen. Among them, the operating body is the user's finger or a touch accessory that is matched with the electronic device where the touch screen is located. The touch screen is an inductive liquid crystal display device that senses the user's touch operation in different ways and converts the touch operation into an electrical signal for processing. The plane coordinate system in the touch screen can be established with any point in the touch screen as the origin, such as the vertices of each direction angle of the touch screen or the center point of the touch screen.

[0049] The touch screen includes but is not limited to capacitive touch screen, resistive touch screen, infrared touch screen and other display screens based on different sensing methods.

[0050] Capacitive induction touch screens work by using the current induction of the operating body. When the operating body touches the capacitive induction touch screen, the operating body and the capacitive induction touch screen form a coupling capacitor. At the same time, the operating body absorbs part of the current from the touch point. The current flows out from the electrodes on the four corners of the capacitive induction touch screen, and the current flowing through the four electrodes is proportional to the distance from the operating body to the four corners. The controller inside the capacitive induction touch screen measures the current flowing out of the four electrodes to obtain the current ratio, and then determines the distance from the touch point to the four corners to obtain the coordinates of the touch point, that is, the starting point coordinates. When the capacitive induction touch screen detects that the capacitance between the operating body and the touch screen disappears or the coordinates of the operating body on the touch screen do not change within a preset time, the current touch point of the operating body is determined as the end point, and the current touch point coordinates are determined as the end point coordinates.

[0051] The resistive touch screen uses the principle of pressure sensing. When the operating body touches the resistive touch screen, the resistance at the touch point changes. The controller inside the resistive touch screen detects the resistance change and applies a certain voltage to the electrodes in the horizontal and vertical directions of the plane coordinate system established in the touch screen. When the controller applies a certain voltage to the electrodes in the horizontal direction, but does not apply a certain voltage in the vertical direction, the voltage at the touch point will be reflected in the electrodes in the positive and negative directions of the vertical axis. By measuring the voltage magnitude of the electrodes in the positive and negative directions of the vertical axis to the ground, as well as the voltage distribution parameters and resistance distribution parameters inside the resistive touch screen, the coordinates of the touch point, i.e., the starting point coordinates, are calculated. Similarly, the starting point coordinates can be calculated when the controller applies a certain voltage to the electrodes in the vertical direction, but does not apply a certain voltage in the horizontal direction. When the controller detects that the resistance at the touch point of the operating body has returned to the size when it was not touched, or the coordinates of the operating body on the touch screen remain unchanged within a preset time, the current touch point of the operating body is determined as the end point, and the current touch point coordinates are determined as the end point coordinates.

[0052] The infrared touch screen detects the user's touch operation through the infrared detection network on the screen surface. When the controller inside the infrared touch screen detects that the infrared rays are blocked in the infrared detection network, the position of the touch point is determined according to the position of the blocked infrared rays in the plane coordinate system established in the touch screen, and the coordinates of the touch point are determined as the starting point coordinates. When the controller detects that the previously blocked infrared rays are restored, the coordinates of the touch point of the operating body on the touch screen before the infrared rays are restored are determined as the end point coordinates, or when the coordinates of the operating body on the touch screen remain unchanged within a preset time, the current coordinates of the touch point of the operating body are determined as the end point coordinates.

[0053] S202, obtaining a horizontal coordinate difference between a starting point horizontal coordinate of the starting point coordinate and a terminal point horizontal coordinate of the terminal coordinate, and determining an absolute value of the horizontal coordinate difference as a horizontal movement distance of the operating body in the horizontal direction;

[0054] Specifically, the horizontal movement distance of the operating body is determined based on the above-obtained starting point coordinates and end point coordinates. The horizontal coordinate difference between the starting point horizontal coordinate of the starting point coordinate and the end point horizontal coordinate of the end point coordinate is calculated, and the absolute value of the horizontal coordinate difference is determined as the horizontal movement distance of the operating body in the horizontal direction. For example, if the starting point coordinate is (80, 60) and the end point coordinate is (50, 50), the starting point horizontal coordinate is 80, the end point horizontal coordinate is 50, and the horizontal movement distance is 30.

[0055] S203, obtaining a vertical coordinate difference between a starting point vertical coordinate of the starting point coordinate and a terminal point vertical coordinate of the terminal coordinate, and determining an absolute value of the vertical coordinate difference as a vertical movement distance of the operating body in the vertical direction;

[0056] Specifically, the vertical movement distance of the operating body is determined based on the above-obtained starting point coordinates and end point coordinates. The vertical coordinate difference between the starting point vertical coordinate of the starting point coordinate and the end point vertical coordinate of the end point coordinate is calculated, and the absolute value of the vertical coordinate difference is determined as the vertical movement distance of the operating body in the horizontal direction. For example, if the starting point coordinate is (80, 60) and the end point coordinate is (50, 50), the starting point vertical coordinate is 60, the end point vertical coordinate is 50, and the horizontal movement distance is 10.

[0057] S204, if the ratio of the vertical moving distance to the horizontal moving distance is less than or equal to the target value corresponding to the preset instruction, then determining that the moving trajectory matches the target trajectory corresponding to the preset instruction;

[0058] Specifically, the ratio of the vertical moving distance to the horizontal moving distance is obtained, and the ratio of the vertical moving distance to the horizontal moving distance is compared with the target value corresponding to the preset instruction. If the ratio is less than or equal to the target value corresponding to the preset instruction, it is determined that the moving trajectory matches the target trajectory corresponding to the preset instruction. The preset instruction is a function instruction such as an instruction, a confirmation instruction, a switching instruction, or a screenshot instruction.

[0059] In order to prevent users from accidentally touching the screen, in the embodiment of the present application, the angle between the target trajectory corresponding to the preset instruction and the positive direction of the horizontal line must meet the preset angle. Figure 4 As shown in the figure, if the target trajectory is line segment EF, the angle between the target trajectory and the positive direction of the horizontal line is θ, that is, the preset angle is θ. If the angle between the moving trajectory and the positive direction of the horizontal line is less than or equal to θ, it is determined that the moving trajectory matches the target trajectory; if the angle between the moving trajectory and the positive direction of the horizontal line is greater than θ, it is determined that the moving trajectory does not match the target trajectory.

[0060] In order to improve the efficiency of instruction determination and reduce the time and memory occupied by the electronic device processor, the embodiment of the present application is based on the relationship between the vertical moving distance and the horizontal moving distance and the trigonometric function, that is, the ratio of the vertical moving distance to the horizontal moving distance is the tangent value of the angle between the moving trajectory and the positive direction of the horizontal line, and infers a method for judging whether the moving trajectory matches the target trajectory according to the target value of the preset angle. The target value is the absolute value of the tangent value of the preset angle. According to the preset angle corresponding to the preset instruction, the absolute value of the tangent value of the preset angle is pre-set in the electronic device. After the vertical moving distance and the horizontal moving distance are obtained, it can be judged whether the moving trajectory matches the target trajectory according to the comparison relationship between the ratio of the two and the tangent value of the preset angle. Therefore, when the ratio of the vertical moving distance to the horizontal moving distance is less than or equal to the absolute value of the tangent value of the preset angle, the angle between the moving trajectory and the positive direction of the horizontal line is less than or equal to the preset angle, and the moving trajectory matches the target trajectory.

[0061] S205, if the ratio of the vertical moving distance to the horizontal moving distance is greater than the target value corresponding to the preset instruction, it is determined that the moving trajectory does not match the target trajectory corresponding to the preset instruction;

[0062] Specifically, if the ratio of the vertical moving distance to the horizontal moving distance is greater than the target value corresponding to the preset instruction, it is determined that the ratio is greater than the absolute value of the tangent value of the preset angle, that is, the angle between the moving trajectory and the positive direction of the horizontal line is greater than the preset angle. It can be obtained from step S204 that when the angle between the moving trajectory and the positive direction of the horizontal line is greater than the preset angle, the moving trajectory does not match the target trajectory.

[0063] In a feasible implementation, in order to prevent accidental touches, if both the horizontal moving distance and the vertical moving distance are less than a preset distance threshold, it is determined that the moving trajectory does not match the target trajectory corresponding to the preset instruction. The preset distance threshold is the minimum distance of the target trajectory corresponding to the preset instruction set by the developer in the electronic device. If both the horizontal moving distance and the vertical moving distance are less than the preset distance threshold, it can be considered that the operator has not sent any instruction to the electronic device, or the instruction sent by the operator to the electronic device is a single-click instruction.

[0064] S206: If the moving trajectory matches the target trajectory, the preset instruction is executed.

[0065] Specifically, if the moving trajectory matches the target trajectory, it is determined that the touch operation of the operator meets the preset instruction, and the electronic device is controlled to perform the function indicated by the preset instruction. If the function indicated by the preset instruction requires updating the display interface of the touch screen, the touch screen interface is updated.

[0066] In an embodiment of the present application, the touch screen of the electronic device detects the touch operation of the operating body in real time, so that the electronic device obtains the starting point coordinates and the end point coordinates of the touch operation, and determines the horizontal movement distance and the vertical movement distance of the operating body in the touch screen according to the starting point coordinates and the end point coordinates. The ratio of the vertical movement distance to the horizontal movement distance is obtained. If the ratio is greater than the target value corresponding to the preset instruction, it is determined that the movement trajectory does not match the target trajectory corresponding to the preset instruction; if the ratio is less than or equal to the target value corresponding to the preset instruction, it is determined that the movement trajectory matches the target trajectory corresponding to the preset instruction, and the preset instruction is executed. The embodiment of the present application does not need to use a trigonometric function interface in the algorithm, but determines the instruction through a simple numerical comparison, which reduces the resource occupancy rate of the electronic device processor and improves the performance of the electronic device and the instruction determination efficiency.

[0067] See also Figure 6 , Figure 6 FIG. 1 is a flow chart of a method for determining an instruction provided in an embodiment of the present application. Figure 6 As shown, the method of the embodiment of the present application may include the following steps S301-S306.

[0068] S301, obtaining the starting point coordinates and the ending point coordinates of the operating body on the touch screen, and determining the line connecting the starting point coordinates and the ending point coordinates as the moving track of the operating body on the touch screen;

[0069] Please refer to step S201 for the specific process, which will not be described again here.

[0070] S302, obtaining a horizontal coordinate difference between a starting point horizontal coordinate of the starting point coordinate and a terminal point horizontal coordinate of the terminal coordinate, and determining an absolute value of the horizontal coordinate difference as a horizontal movement distance of the operating body in the horizontal direction;

[0071] Please refer to step S202 for the specific process, which will not be described again here.

[0072] S303, obtaining a vertical coordinate difference between a starting point vertical coordinate of the starting point coordinate and a terminal point vertical coordinate of the terminal coordinate, and determining an absolute value of the vertical coordinate difference as a vertical movement distance of the operating body in the vertical direction;

[0073] Please refer to step S203 for the specific process, which will not be described again here.

[0074] S304, if the horizontal moving distance is greater than or equal to the vertical moving distance, determining that the moving trajectory matches the target trajectory corresponding to the preset instruction;

[0075] Specifically, the horizontal moving distance is compared with the vertical moving distance, and if the horizontal moving distance is greater than or equal to the vertical moving distance, it is determined that the moving trajectory matches the target trajectory corresponding to the preset instruction. The preset instruction is a function instruction such as an instruction, a confirmation instruction, a switching instruction, or a screenshot instruction.

[0076] In order to prevent users from accidentally touching the screen, in the embodiment of the present application, the angle between the target trajectory corresponding to the preset instruction and the positive direction of the horizontal line must meet the preset angle. Figure 4 As shown in the figure, if the target trajectory is line segment EF, the angle between the target trajectory and the positive direction of the horizontal line is θ, that is, the preset angle is θ. If the angle between the moving trajectory and the positive direction of the horizontal line is less than or equal to θ, it is determined that the moving trajectory matches the target trajectory; if the angle between the moving trajectory and the positive direction of the horizontal line is greater than θ, it is determined that the moving trajectory does not match the target trajectory.

[0077] The angle between the target trajectory corresponding to the preset instruction provided in the embodiment of the present application and the positive direction of the horizontal line is 45°, that is, the preset angle θ=45°. It can be observed that when the preset angle is 45°, the horizontal moving distance is equal to the vertical moving distance. Therefore, the size of the horizontal moving distance and the vertical moving distance can be directly compared to determine whether the moving trajectory matches the target trajectory corresponding to the preset instruction. If the horizontal moving distance is greater than or equal to the vertical moving distance, the angle between the moving trajectory and the positive direction of the horizontal line is less than or equal to 45°, and it is determined that the moving trajectory matches the target trajectory corresponding to the preset instruction.

[0078] S305, if the horizontal moving distance is less than the vertical moving distance, it is determined that the moving trajectory does not match the target trajectory corresponding to the preset instruction;

[0079] S306: If the moving trajectory matches the target trajectory, the preset instruction is executed.

[0080] Specifically, if the moving trajectory matches the target trajectory, it is determined that the touch operation of the operator meets the preset instruction, and the electronic device is controlled to perform the function indicated by the preset instruction. If the function indicated by the preset instruction requires updating the display interface of the touch screen, the touch screen interface is updated.

[0081] In an embodiment of the present application, the touch screen of the electronic device detects the touch operation of the operating body in real time, so that the electronic device obtains the starting point coordinates and the end point coordinates of the touch operation, and determines the horizontal movement distance and the vertical movement distance of the operating body in the touch screen according to the starting point coordinates and the end point coordinates. Since the preset angle corresponding to the preset instruction of the embodiment of the present application is 45°, the horizontal movement distance and the vertical movement distance are compared. If the horizontal movement distance is less than the vertical movement distance, it is determined that the movement trajectory does not match the target trajectory corresponding to the preset instruction; if the horizontal movement distance is greater than or equal to the vertical movement distance, it is determined that the movement trajectory matches the target trajectory corresponding to the preset instruction, and the preset instruction is executed. The embodiment of the present application does not need to use a trigonometric function interface in the algorithm, but determines the instruction through a simple numerical comparison, which reduces the resource occupancy rate of the electronic device processor and improves the performance of the electronic device and the instruction determination efficiency.

[0082] based on Figure 1 The following is a schematic diagram of the scene. Figure 7 , the content display device provided in the embodiment of the present application is introduced in detail. It should be noted that, Figure 7 The instruction determining device in the present application is used to execute Figure 2-Figure 6 For the convenience of explanation, only the part related to the embodiment of the present application is shown. For the specific technical details not disclosed, please refer to the present application. Figure 2-Figure 6 The embodiment shown.

[0083] See also Figure 7 , Figure 7 Schematic diagram of a structure of an instruction determination device provided in an embodiment of the present application. Figure 7 As shown, the instruction determination device 1 of the embodiment of the present application may include: a movement trajectory acquisition unit 11, a movement distance acquisition unit 12, a distance comparison unit 13 and an instruction execution unit 14.

[0084] A movement track acquisition unit 11, used to acquire the movement track of the operating body on the touch screen;

[0085] A moving distance acquisition unit 12, used to determine a horizontal moving distance of the operating body in a horizontal direction and a vertical moving distance of the operating body in a vertical direction based on the moving trajectory;

[0086] A distance comparison unit 13 is used to determine whether the moving trajectory matches the target trajectory corresponding to the preset instruction based on the comparison relationship between the horizontal moving distance and the vertical moving distance;

[0087] The instruction execution unit 14 is used to execute a preset instruction if the moving trajectory matches the target trajectory.

[0088] Optionally, the movement track acquisition unit 11 is specifically used to acquire the starting point coordinates and the ending point coordinates of the operating body on the touch screen;

[0089] The line connecting the starting point coordinates and the end point coordinates is determined as the moving track of the operating body on the touch screen.

[0090] Optionally, the movement trajectory acquisition unit 11 is specifically used to establish a plane coordinate system in the touch screen;

[0091] When a touch operation of the operating body is detected, the starting point coordinates of the touch operation in the plane coordinate system are obtained;

[0092] When it is detected that the touch operation of the operating body ends or the operating body does not move within a preset time period, the end point coordinates of the touch operation in the plane coordinate system are acquired.

[0093] Optionally, the moving distance acquisition unit 12 is specifically used to acquire the abscissa difference between the starting point abscissa of the starting point coordinate and the ending point abscissa of the ending point coordinate, and determine the absolute value of the abscissa difference as the horizontal moving distance of the operating body in the horizontal direction;

[0094] The vertical coordinate difference between the starting point vertical coordinate of the starting point coordinate and the ending point vertical coordinate of the ending point coordinate is obtained, and the absolute value of the vertical coordinate difference is determined as the vertical movement distance of the operating body in the vertical direction.

[0095] Optionally, the distance comparison unit 13 is specifically configured to determine that the moving trajectory matches the target trajectory corresponding to the preset instruction if the ratio of the vertical moving distance to the horizontal moving distance is less than or equal to the target value corresponding to the preset instruction;

[0096] If the ratio of the vertical moving distance to the horizontal moving distance is greater than the target value corresponding to the preset instruction, it is determined that the moving trajectory does not match the target trajectory corresponding to the preset instruction.

[0097] Optionally, the distance comparison unit 13 is specifically configured to determine that the movement trajectory matches the target trajectory corresponding to the preset instruction if the horizontal movement distance is greater than or equal to the vertical movement distance;

[0098] If the horizontal moving distance is less than the vertical moving distance, it is determined that the moving trajectory does not match the target trajectory corresponding to the preset instruction.

[0099] Optionally, the distance comparison unit 13 is specifically configured to determine that the moving trajectory does not match the target trajectory corresponding to the preset instruction if both the horizontal moving distance and the vertical moving distance are less than a preset distance threshold.

[0100] In an embodiment of the present application, the touch screen of the electronic device detects the touch operation of the operating body in real time, so that the electronic device obtains the starting point coordinates and the end point coordinates of the touch operation, and determines the horizontal movement distance and the vertical movement distance of the operating body in the touch screen according to the starting point coordinates and the end point coordinates. The ratio of the vertical movement distance to the horizontal movement distance is obtained. If the ratio is greater than the target value corresponding to the preset instruction, it is determined that the movement trajectory does not match the target trajectory corresponding to the preset instruction; if the ratio is less than or equal to the target value corresponding to the preset instruction, it is determined that the movement trajectory matches the target trajectory corresponding to the preset instruction, and the preset instruction is executed. The embodiment of the present application does not need to use a trigonometric function interface in the algorithm, but determines the instruction through a simple numerical comparison, which reduces the resource occupancy rate of the electronic device processor and improves the performance of the electronic device and the instruction determination efficiency.

[0101] See also Figure 8 , Figure 8 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application.

[0102] For example, Figure 8 As shown, the electronic device 800 includes: a processor 801 and a memory 802, wherein the processor 801 is electrically connected to the memory 802.

[0103] The processor 801 is the control center of the electronic device 800 and may include one or more processing cores. The processor 801 uses various interfaces and lines to connect various parts of the entire electronic device, and executes various functions of the electronic device and processes data by running or calling computer programs stored in the memory 802, and calling data stored in the memory 802, so as to control the electronic device 800 as a whole. Optionally, the processor 801 can be implemented in at least one hardware form of digital signal processing (DSP), field programmable gate array (FPGA), and programmable logic array (PLA). The processor 801 can integrate one or a combination of CPU, graphics processing unit (GPU), modem, etc. Among them, the CPU mainly processes the operating system, user pages, and applications; the GPU is responsible for rendering and drawing display content; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 801, and may be implemented separately through a communication chip.

[0104] The memory 802 can be used to store software programs and modules, and the processor 801 executes various functional applications and data processing by running the computer programs and modules stored in the memory 802. The memory 802 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, a computer program required for at least one function, etc.; the data storage area can store data created according to the use of the electronic device 800, etc.

[0105] In addition, the memory 802 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 802 may also include a memory controller to provide the processor 801 with access to the memory 802.

[0106] In this embodiment, the processor 801 in the electronic device 800 loads instructions corresponding to the processes of one or more computer programs into the memory 802 according to the following steps, and the processor 801 runs the computer program stored in the memory 802 to implement various functions, as follows:

[0107] Obtaining the movement trajectory of the operating body on the touch screen;

[0108] Determine a horizontal movement distance of the operating body in a horizontal direction and a vertical movement distance of the operating body in a vertical direction based on the movement trajectory;

[0109] Based on the comparison relationship between the horizontal moving distance and the vertical moving distance, it is determined whether the moving trajectory matches the target trajectory corresponding to the preset instruction;

[0110] If the moving trajectory matches the target trajectory, the preset instructions are executed.

[0111] Optionally, when executing the acquisition of the movement track of the operating body on the touch screen, the processor 801 specifically executes:

[0112] Get the starting point coordinates and the ending point coordinates of the operating body on the touch screen;

[0113] The line connecting the starting point coordinates and the end point coordinates is determined as the moving track of the operating body on the touch screen.

[0114] Optionally, when the processor 801 executes the acquisition of the starting point coordinates and the ending point coordinates of the operating body on the touch screen, the processor 801 specifically executes:

[0115] Establish a plane coordinate system on the touch screen;

[0116] When a touch operation of the operating body is detected, the starting point coordinates of the touch operation in the plane coordinate system are obtained;

[0117] When it is detected that the touch operation of the operating body ends or the operating body does not move within a preset time period, the end point coordinates of the touch operation in the plane coordinate system are acquired.

[0118] Optionally, when the processor 801 determines the horizontal movement distance of the operating body in the horizontal direction and the vertical movement distance of the operating body in the vertical direction based on the movement trajectory, the processor 801 specifically executes:

[0119] Obtaining a horizontal coordinate difference between a starting point horizontal coordinate of the starting point coordinate and an ending point horizontal coordinate of the ending point coordinate, and determining an absolute value of the horizontal coordinate difference as a horizontal movement distance of the operating body in the horizontal direction;

[0120] The vertical coordinate difference between the starting point vertical coordinate of the starting point coordinate and the ending point vertical coordinate of the ending point coordinate is obtained, and the absolute value of the vertical coordinate difference is determined as the vertical movement distance of the operating body in the vertical direction.

[0121] Optionally, when the processor 801 determines whether the moving trajectory matches the target trajectory corresponding to the preset instruction based on the comparison relationship between the horizontal moving distance and the vertical moving distance, it specifically executes:

[0122] If the ratio of the vertical moving distance to the horizontal moving distance is less than or equal to the target value corresponding to the preset instruction, it is determined that the moving trajectory matches the target trajectory corresponding to the preset instruction;

[0123] If the ratio of the vertical moving distance to the horizontal moving distance is greater than the target value corresponding to the preset instruction, it is determined that the moving trajectory does not match the target trajectory corresponding to the preset instruction.

[0124] Optionally, when the processor 801 determines whether the moving trajectory matches the target trajectory corresponding to the preset instruction based on the comparison relationship between the horizontal moving distance and the vertical moving distance, it specifically executes:

[0125] If the horizontal moving distance is greater than or equal to the vertical moving distance, it is determined that the moving trajectory matches the target trajectory corresponding to the preset instruction;

[0126] If the horizontal moving distance is less than the vertical moving distance, it is determined that the moving trajectory does not match the target trajectory corresponding to the preset instruction.

[0127] Optionally, when the processor 801 determines whether the moving trajectory matches the target trajectory corresponding to the preset instruction based on the comparison relationship between the horizontal moving distance and the vertical moving distance, it specifically executes:

[0128] If both the horizontal moving distance and the vertical moving distance are less than the preset distance threshold, it is determined that the moving trajectory does not match the target trajectory corresponding to the preset instruction.

[0129] In an embodiment of the present application, the touch screen of the electronic device detects the touch operation of the operating body in real time, so that the electronic device obtains the starting point coordinates and the end point coordinates of the touch operation, and determines the horizontal movement distance and the vertical movement distance of the operating body in the touch screen according to the starting point coordinates and the end point coordinates. The ratio of the vertical movement distance to the horizontal movement distance is obtained. If the ratio is greater than the target value corresponding to the preset instruction, it is determined that the movement trajectory does not match the target trajectory corresponding to the preset instruction; if the ratio is less than or equal to the target value corresponding to the preset instruction, it is determined that the movement trajectory matches the target trajectory corresponding to the preset instruction, and the preset instruction is executed. The embodiment of the present application does not need to use a trigonometric function interface in the algorithm, but determines the instruction through a simple numerical comparison, which reduces the resource occupancy rate of the electronic device processor and improves the performance of the electronic device and the instruction determination efficiency.

[0130] It should be understood that the device provided in the embodiment of the present application is used to execute the above-mentioned instruction determination method, and thus can achieve the same effect as the above-mentioned implementation method.

[0131] In the case of an integrated unit, the device may include a processing module and a storage module. When the device is applied to an electronic device, the processing module may be used to control and manage the actions of the electronic device. The storage module may be used to support the electronic device in executing related program codes, etc.

[0132] The processing module may be a processor or a controller, which may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of this application. The processor may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of digital signal processing (DSP) and a microprocessor, etc. The storage module may be a memory.

[0133] In addition, the device provided in the embodiment of the present application can specifically be a chip, component or module, and the chip may include a connected processor and memory; wherein the memory is used to store instructions, and when the processor calls and executes the instructions, the chip can execute an instruction determination method provided in the above embodiment.

[0134] An embodiment of the present application also provides a computer-readable storage medium, in which a computer program code is stored. When the computer program code is executed on a computer, the computer executes the above-mentioned related method steps to implement an instruction determination method provided in the above-mentioned embodiment.

[0135] This embodiment also provides a computer program product. When the computer program product is run on a computer, the computer is caused to execute the above-mentioned related steps to implement an instruction determination method provided in the above-mentioned embodiment.

[0136] Among them, the device, computer-readable storage medium, computer program product or chip provided in this embodiment is used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method provided above, and will not be repeated here.

[0137] Through the description of the above implementation methods, technical personnel in the relevant field can understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0138] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0139] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A method for determining an instruction, characterized in that: The method comprises: Obtaining the movement trajectory of the operating body on the touch screen; Determining a horizontal movement distance of the operating body in a horizontal direction and a vertical movement distance of the operating body in a vertical direction based on the movement trajectory; Based on the comparison relationship between the horizontal moving distance and the vertical moving distance, determining whether the moving trajectory matches the target trajectory corresponding to the preset instruction; If the moving trajectory matches the target trajectory, the preset instruction is executed.

2. The method according to claim 1, characterized in that The step of obtaining the movement track of the operating body on the touch screen includes: Get the starting point coordinates and the ending point coordinates of the operating body on the touch screen; A line connecting the starting point coordinates and the end point coordinates is determined as a moving track of the operating body on the touch screen.

3. The method according to claim 2, characterized in that The step of obtaining the starting point coordinates and the ending point coordinates of the operating body on the touch screen includes: Establish a plane coordinate system on the touch screen; When a touch operation of the operating body is detected, obtaining the starting point coordinates of the touch operation in the plane coordinate system; When it is detected that the touch operation of the operating body ends or the operating body does not move within a preset time period, the end point coordinates of the touch operation in the plane coordinate system are acquired.

4. The method according to claim 2, characterized in that: The determining, based on the movement trajectory, a horizontal movement distance of the operating body in a horizontal direction and a vertical movement distance of the operating body in a vertical direction comprises: Acquire a difference between a starting point abscissa of the starting point coordinate and a terminal point abscissa of the terminal coordinate, and determine an absolute value of the abscissa difference as a horizontal movement distance of the operating body in the horizontal direction; A ordinate difference between a starting point ordinate of the starting point coordinate and an end point ordinate of the end point coordinate is obtained, and an absolute value of the ordinate difference is determined as a vertical movement distance of the operating body in the vertical direction.

5. The method according to claim 1, characterized in that The determining whether the movement trajectory matches a target trajectory corresponding to a preset instruction based on the comparison relationship between the horizontal movement distance and the vertical movement distance includes: If the ratio of the vertical moving distance to the horizontal moving distance is less than or equal to the target value corresponding to the preset instruction, it is determined that the moving trajectory matches the target trajectory corresponding to the preset instruction; If the ratio of the vertical moving distance to the horizontal moving distance is greater than the target value corresponding to the preset instruction, it is determined that the moving trajectory does not match the target trajectory corresponding to the preset instruction.

6. The method according to claim 5, characterized in that The method further comprises: If the horizontal moving distance is greater than or equal to the vertical moving distance, determining that the moving trajectory matches the target trajectory corresponding to the preset instruction; If the horizontal moving distance is less than the vertical moving distance, it is determined that the moving trajectory does not match the target trajectory corresponding to the preset instruction.

7. The method according to claim 5, characterized in that The method further comprises: If both the horizontal moving distance and the vertical moving distance are smaller than a preset distance threshold, it is determined that the moving trajectory does not match the target trajectory corresponding to the preset instruction.

8. An instruction determination device, characterized in that: The device comprises: A movement track acquisition unit, used to acquire the movement track of the operating body on the touch screen; a moving distance acquiring unit, configured to determine a horizontal moving distance of the operating body in a horizontal direction and a vertical moving distance of the operating body in a vertical direction based on the moving trajectory; a distance comparison unit, configured to determine whether the movement trajectory matches a target trajectory corresponding to a preset instruction based on a comparison relationship between the horizontal movement distance and the vertical movement distance; An instruction execution unit is used to execute the preset instruction if the movement trajectory matches the target trajectory.

9. An electronic device, characterized in that: The electronic device comprises: A memory for storing executable program codes; A processor, configured to call and run the executable program code from the memory, so that the electronic device executes the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program code, and when the computer program code is executed, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Interface display method, interface display apparatus and mobile terminal

    CN108287655A

  • Command determination method, device and touch device

    CN109508219A

  • Interface display method and device, electronic equipment and computer readable storage medium

    CN112099689A

  • Application interface control method and device, electronic equipment and storage medium

    CN117950565A