Application switching method and device, electronic equipment and storage medium

By defining preset gestures and receiving judgments, the fast switching between front-end applications and back-end applications is directly realized in the vehicle cockpit system, solving the problems of cumbersome switching process and security risks in the existing technology, and improving user experience and interaction fluency.

CN119200914APending Publication Date: 2024-12-27GREAT WALL MOTOR CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411152402.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-21
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

In the prior art, the application switching process in the vehicle cockpit system is complicated and users need to operate frequently, especially during driving, which poses safety risks, and the process of switching from the front-end application to the back-end application is complicated and time-consuming.

Method used

By defining preset gestures (such as sliding gestures with left and right), receiving and judging gesture operations, and initiating switching commands, directly switching the display page of the current application to the display page of the target background application, simplifying the operation process and saving time and energy.

Benefits of technology

It realizes rapid switching from front-end applications to back-end applications, improves user experience and interaction fluency, simplifies the application switching process, and reduces operational complexity and security risks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119200914A_ABST
    Figure CN119200914A_ABST
Patent Text Reader

Abstract

The invention provides an application switching method and device, electronic equipment and a storage medium. The method comprises the steps that gesture operation on a screen is received; judging whether the gesture operation is a first preset gesture or not; wherein the first preset gesture is used for initiating a first switching instruction for switching a current running application into a target background running application; under the condition that the gesture operation is determined to be the first preset gesture, responding to the first switching instruction, and switching a display page corresponding to a current running application displayed in a target display area in a screen to a display page corresponding to the target background running application. According to the method, time and energy consumed by switching the foreground running application to the background running application can be saved, the process of switching one application to another application is simplified, and the switching speed of the applications is increased.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computers, and more specifically, to a switching method, device, electronic device and storage medium for applications in the field of computers. Background Art

[0002] At present, vehicles have become an indispensable part of people's daily lives. As the vehicle's cockpit system becomes more and more intelligent, the operating experience of the vehicle has also been greatly improved.

[0003] In the prior art, if you want to switch the foreground application running in the current screen to the background application, you may need to return to the main screen first, exit the current foreground application, and then find the application icon corresponding to the background application to be switched in the application list, and click the application icon to complete the application switching. It can be seen that the above process involves multiple gesture operations when switching applications, which is very cumbersome. It will be even more cumbersome when the user needs to switch applications frequently, and if the user needs to switch applications during driving, these complicated processes will undoubtedly bring safety risks. Summary of the invention

[0004] The present application provides an application switching method, device, electronic device and storage medium, which can save time and energy consumed in switching from a foreground application to a background application, simplify the process of switching from one application to another, and improve the application switching speed.

[0005] In a first aspect, a method for switching applications is provided, the method comprising: receiving a gesture operation on a screen; determining whether the gesture operation is a first preset gesture; wherein the first preset gesture is used to initiate a first switching instruction to switch a currently running application to a target background running application; when it is determined that the gesture operation is the first preset gesture, in response to the first switching instruction, switching a display page corresponding to the currently running application displayed in a target display area in the screen to a display page corresponding to the target background running application.

[0006] The above technical solution receives a gesture operation on the screen, and determines whether the gesture operation is a first preset gesture. Since the first preset gesture is used to initiate a first switching instruction to switch the current running application to the target background running application, when it is determined that the gesture operation is the first preset gesture, it means that the first switching instruction can be responded to, and the display page corresponding to the current running application is switched to the display page corresponding to the target background running application. The display page corresponding to the current running application is quickly switched to the display page corresponding to the target background running application through gesture operation. The user does not need to exit the current running application in the traditional way, and then find and open the required application one by one in the application list, which can greatly save the time and energy spent on switching from the foreground running application to the background running application. The user does not need to operate frequently, and can quickly and conveniently complete the switching between the foreground running application and the background running application through a gesture operation, which improves the user experience. Through intuitive gesture operation, users can interact with the device in a more natural way, which improves the friendliness and fluency of human-computer interaction. And the process of switching from one application to another can be simplified through gesture operation, so that users can switch between multiple applications more quickly, and improve the switching speed of applications.

[0007] In combination with the first aspect, in certain implementations of the first aspect, the target background running application is determined by: obtaining a list of background running applications; wherein the list of background running applications contains multiple background running applications arranged in chronological order of application startup; if the sliding direction of the first preset gesture is from left to right, then if there is a subsequent application of the currently running application in the list of background running applications, the subsequent application is determined as the target background running application; if the sliding direction of the first preset gesture is from right to left, then if there is a previous application of the currently running application in the list of background running applications, the previous application is determined as the target background running application.

[0008] In combination with the first aspect and the above-mentioned implementation methods, in some implementation methods of the first aspect, after receiving a gesture operation on the screen, the method also includes: determining whether the gesture operation is a second preset gesture; wherein the second preset gesture is used to initiate a second switching instruction to switch the currently running application to a list of background running applications; when it is determined that the gesture operation is the second preset gesture, in response to the second switching instruction, the display page corresponding to the currently running application displayed in the target display area is switched to the display page corresponding to the list of background running applications.

[0009] In combination with the first aspect and the above-mentioned implementation methods, in some implementation methods of the first aspect, after receiving a gesture operation on the screen, the method also includes: obtaining the number of touch points related to the gesture operation, and obtaining the first coordinate of the starting position and the second coordinate of the ending position of each touch point related to the gesture operation on the screen; judging whether the gesture operation is a first preset gesture includes: judging whether the gesture operation is a first preset gesture based on the number of touch points, the first coordinate and the second coordinate; judging whether the gesture operation is a second preset gesture includes: judging whether the gesture operation is a second preset gesture based on the number of touch points, the first coordinate and the second coordinate.

[0010] In combination with the first aspect and the above-mentioned implementation methods, in some implementation methods of the first aspect, based on the number of touch points, the first coordinates and the second coordinates, determining whether the gesture operation is a first preset gesture includes: determining whether the number of touch points is greater than or equal to the first preset number, and determining whether the number of touch points is less than or equal to a preset number threshold; when the number of touch points is greater than or equal to the first preset number and less than or equal to the preset number threshold, calculating the horizontal difference between the horizontal coordinate of the first coordinate and the horizontal coordinate of the second coordinate of each touch point, and calculating the vertical difference between the vertical coordinate of the first coordinate and the vertical coordinate of the second coordinate of each touch point; determining whether the absolute value of the horizontal difference corresponding to each touch point is greater than the absolute value of the vertical difference, and determining whether the absolute value of the horizontal difference corresponding to each touch point is greater than the preset difference threshold; if the absolute value of the horizontal difference corresponding to each touch point is greater than the absolute value of the vertical difference, and the absolute value of the horizontal difference corresponding to each touch point is greater than the preset difference threshold, then determining that the gesture operation is the first preset gesture.

[0011] In combination with the first aspect and the above-mentioned implementation manner, in some implementation manners of the first aspect, based on the number of touch points, the first coordinates and the second coordinates, determining whether the gesture operation is a second preset gesture includes: determining whether the number of touch points is greater than or equal to the second preset number, and determining whether the number of touch points is less than or equal to a preset number threshold; when the number of touch points is greater than or equal to the second preset number and less than or equal to the preset number threshold, based on the first coordinates of each touch point, calculating a first spacing between a starting position of each touch point and a starting position of an adjacent touch point to obtain a plurality of first spacings, and superimposing the plurality of first spacings to obtain a sum of first spacings; based on the second coordinates of each touch point, calculating a second spacing between an ending position of each touch point and an ending position of an adjacent touch point to obtain a plurality of second spacings, and superimposing the plurality of second spacings to obtain a sum of second spacings; determining whether the sum of the second spacings is less than or equal to a preset proportion of the sum of the first spacings; if the sum of the second spacings is less than or equal to the preset proportion of the sum of the first spacings, determining that the gesture operation is the second preset gesture.

[0012] In combination with the first aspect and the above-mentioned implementation methods, in some implementation methods of the first aspect, after switching the display page corresponding to the currently running application displayed in the target display area to the display page corresponding to the background running application list, the method also includes: when a selection operation on any application in the background running application list is detected, switching the display page corresponding to the background running application list displayed in the target display area to the application display page corresponding to the selection operation.

[0013] In a second aspect, a device for switching applications is provided, the device comprising: a receiving module for receiving a gesture operation on a screen; a judging module for judging whether the gesture operation is a first preset gesture; wherein the first preset gesture is used to initiate a first switching instruction for switching a currently running application to a target background running application; a switching module for, when determining that the gesture operation is the first preset gesture, responding to the first switching instruction, switching a display page corresponding to the currently running application displayed in a target display area of ​​the screen to a display page corresponding to the target background running application.

[0014] In combination with the second aspect, in certain implementations of the second aspect, the device also includes an application determination module, which is specifically used to: obtain a list of background running applications; wherein the list of background running applications contains multiple background running applications arranged in chronological order of application startup; if the sliding direction of the first preset gesture is from left to right, then if there is a subsequent application of the currently running application in the background running application list, the subsequent application is determined as the target background running application; if the sliding direction of the first preset gesture is from right to left, then if there is a previous application of the currently running application in the background running application list, the previous application is determined as the target background running application.

[0015] In combination with the second aspect and the above-mentioned implementation methods, in some implementation methods of the second aspect, the device also includes a second switching module, which is specifically used to: determine whether the gesture operation is a second preset gesture; wherein the second preset gesture is used to initiate a second switching instruction to switch the currently running application to a background running application list; when it is determined that the gesture operation is the second preset gesture, in response to the second switching instruction, the display page corresponding to the currently running application displayed in the target display area is switched to the display page corresponding to the background running application list.

[0016] In combination with the second aspect and the above-mentioned implementation methods, in some implementation methods of the second aspect, the device also includes an acquisition module, which is specifically used to: acquire the number of touch points related to the gesture operation, and acquire the first coordinate of the starting position and the second coordinate of the ending position of each touch point related to the gesture operation on the screen; the judgment module is specifically used to: judge whether the gesture operation is a first preset gesture based on the number of touch points, the first coordinate and the second coordinate; the second switching module includes a judgment unit, which is specifically used to: judge whether the gesture operation is a second preset gesture based on the number of touch points, the first coordinate and the second coordinate.

[0017] In combination with the second aspect and the above-mentioned implementation methods, in some implementation methods of the second aspect, the judgment module is also specifically used to: judge whether the number of touch points is greater than or equal to a first preset number, and judge whether the number of touch points is less than or equal to a preset number threshold; when the number of touch points is greater than or equal to the first preset number and less than or equal to the preset number threshold, calculate the horizontal difference between the horizontal coordinate of the first coordinate and the horizontal coordinate of the second coordinate of each touch point, and calculate the vertical difference between the vertical coordinate of the first coordinate and the vertical coordinate of the second coordinate of each touch point; judge whether the absolute value of the horizontal difference corresponding to each touch point is greater than the absolute value of the vertical difference, and judge whether the absolute value of the horizontal difference corresponding to each touch point is greater than the preset difference threshold; if the absolute value of the horizontal difference corresponding to each touch point is greater than the absolute value of the vertical difference, and the absolute value of the horizontal difference corresponding to each touch point is greater than the preset difference threshold, then determine that the gesture operation is the first preset gesture.

[0018] In combination with the second aspect and the above-mentioned implementation manner, in some implementation manners of the second aspect, the second switching module includes a judgment unit, which is specifically used to: judge whether the number of touch points is greater than or equal to a second preset number, and judge whether the number of touch points is less than or equal to a preset number threshold; when the number of touch points is greater than or equal to the second preset number and less than or equal to the preset number threshold, based on the first coordinate of each touch point, calculate the first spacing between the starting position of each touch point and the starting position of the adjacent touch point to obtain multiple first spacings, and superimpose the multiple first spacings to obtain the sum of the first spacings; based on the second coordinate of each touch point, calculate the second spacing between the end position of each touch point and the end position of the adjacent touch point to obtain multiple second spacings, and superimpose the multiple second spacings to obtain the sum of the second spacings; judge whether the sum of the second spacings is less than or equal to the sum of the first spacings of a preset proportion; if the sum of the second spacings is less than or equal to the sum of the first spacings of the preset proportion, determine that the gesture operation is the second preset gesture.

[0019] In combination with the second aspect and the above-mentioned implementation methods, in some implementation methods of the second aspect, the second switching module includes a page switching unit, which is specifically used to: when a selection operation on any application in the background running application list is detected, switch the display page corresponding to the background running application list displayed in the target display area to the application display page corresponding to the selection operation.

[0020] In a third aspect, an electronic device is provided, comprising a memory and a processor. The memory is used to store executable program code, and the processor is used to call and run the executable program code from the memory, so that the electronic device executes the application switching method in the above-mentioned first aspect and any possible implementation of the first aspect.

[0021] 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 application switching method in the above-mentioned first aspect and any possible implementation of the first aspect.

[0022] 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 application switching method in the above-mentioned first aspect and any possible implementation of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 is a schematic flow chart of a switching method for an application provided in an embodiment of the present application;

[0024] Figure 2 This is a schematic diagram of an operation of a multi-finger left-right sliding gesture provided in an embodiment of the present application;

[0025] Figure 3 is an operation diagram of a multi-finger pinch gesture provided in an embodiment of the present application;

[0026] Figure 4 This is a schematic diagram of a page corresponding to a list of background running applications provided in an embodiment of the present application;

[0027] Figure 5 is a schematic diagram of the structure of a switching device for application provided in an embodiment of the present application;

[0028] Figure 6 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] At present, vehicles have become an indispensable part of people's daily lives. As the vehicle's cockpit system becomes more and more intelligent, the operating experience of the vehicle has also been greatly improved.

[0032] In the prior art, if you want to switch the foreground application running in the current screen to the background application, you may need to return to the main screen first, exit the current foreground application, and then find the application icon corresponding to the background application to be switched in the application list, and click the application icon to complete the application switching. It can be seen that the above process involves multiple gesture operations when switching applications, which is very cumbersome. When the user needs to switch applications frequently, the above switching process will become more cumbersome, and if the user needs to switch applications during driving, these complicated processes will undoubtedly bring safety risks.

[0033] In order to solve the above technical problems, the embodiment of the present application provides a method for switching display pages, which can predefine the function of a first preset gesture, and the first preset gesture can directly initiate a first switching instruction to switch the currently running application to a target background running application. In the case of receiving a gesture operation on the screen and determining that the gesture operation is the first preset gesture, the display page corresponding to the currently running application displayed in the target display area of ​​the screen can be directly switched to the display page corresponding to the target background running application in response to the first switching instruction. In this way, the user does not need to perform frequent operations, and can quickly and conveniently complete the switching between the foreground running application and the background running application through a gesture operation.

[0034] The execution subject of the method may be an electronic device with touch and display functions, specifically a vehicle computer in a vehicle. The following takes the display page switching method applied to a vehicle computer in a vehicle as an example for explanation:

[0035] Figure 1 It is a schematic flowchart of a display page switching method provided in an embodiment of the present application.

[0036] For example, Figure 1 As shown, the method 100 includes:

[0037] S101, receiving a gesture operation on the screen.

[0038] S102: Determine whether the gesture operation is a first preset gesture.

[0039] The first preset gesture is used to initiate a first switching instruction to switch the currently running application to a target background running application.

[0040] S103, when it is determined that the gesture operation is the first preset gesture, in response to the first switching instruction, the display page corresponding to the currently running application displayed in the target display area of ​​the screen is switched to the display page corresponding to the target background running application.

[0041] In an embodiment of the present application, a gesture operation on the screen is received, and it is determined whether the gesture operation is a first preset gesture. Since the first preset gesture is used to initiate a first switching instruction to switch the currently running application to the target background running application, when it is determined that the gesture operation is the first preset gesture, it indicates that the first switching instruction can be responded to, and the display page corresponding to the currently running application is switched to the display page corresponding to the target background running application. The display page corresponding to the currently running application is quickly switched to the display page corresponding to the target background running application through gesture operation. The user does not need to exit the currently running application in the traditional way, and then find and open the required application one by one in the application list, which can greatly save the time and energy spent on switching from the foreground running application to the background running application. The user does not need to operate frequently, and can quickly and conveniently complete the switching between the foreground running application and the background running application through a gesture operation, which improves the user experience. Through intuitive gesture operation, users can interact with the device in a more natural way, which improves the friendliness and fluency of human-computer interaction. And the process of switching from one application to another can be simplified through gesture operation, so that users can switch between multiple applications more quickly and improve the switching speed of applications.

[0042] Below Figure 1 The implementation method of each step in the embodiment shown is specifically described:

[0043] Regarding the above S101, it can be understood that the above gesture operation can be an operation such as a click operation or a sliding operation on the vehicle screen by the user.

[0044] In some embodiments, a background service is created, which can run for a long time in the background. Even if the user exits the application, the background service can continue to perform tasks. The created Service is equivalent to providing a long-running background task manager, which is specifically used to manage and switch application processes.

[0045] Furthermore, in order to receive gesture operations on the screen, a gesture receiver mListener may be defined. The gesture receiver may be used to capture a touch event of the user on the screen, ie, the above-mentioned gesture operation, and process the touch event.

[0046] In some embodiments, in order to enable the gesture receiver mListener to capture the gesture operation on the screen, the gesture receiver mListener may be registered with the window manager WindowManager. In this way, no matter in which application the user performs gesture operations, these gesture operations will be captured by mListener.

[0047] Among them, WindowManager is a window manager used to manage the layout and display of windows.

[0048] Exemplarily, the definition and use of gesture receivers can be implemented in the following way: First, define an IPointerEventListener interface. Among them, the IPointerEventListener interface contains the methods required to receive gesture events, such as the onPointerEvent method. Create a class named mListener to implement the IPointerEventListener interface. This means that the mListener class needs to implement all the methods defined in the IPointerEventListener interface. Register the defined listener mListener with the WindowManager. In this way, when the user performs a touch event on the screen, the WindowManager will forward these touch events to mListener. Implement the onPointerEvent method in mListener, which will be called to handle the touch event.

[0049] For example, in the onPointerEvent method, gestures such as double-clicking, sliding, pinching, etc. can be identified based on the number of touch points, position changes, and other information. Once a gesture is identified, corresponding operations can be performed in the onPointerEvent method, such as changing the page layout, triggering a certain function, and the like.

[0050] Furthermore, after the gesture receiver captures the gesture operation, it can further determine what the gesture operation is. Specifically, it can determine whether the gesture operation is a click gesture, a slide gesture, or other gestures based on the parameters corresponding to the gesture operation.

[0051] When a gesture operation of the user on the screen is received, relevant parameter information can be extracted from the gesture operation.

[0052] Exemplarily, the above parameter information may include but is not limited to: the number of touch points (single finger, two fingers or multiple fingers), the position coordinates of the touch points (horizontal and vertical coordinates), the type of touch action (such as pressing, moving, lifting), the direction of the touch action (such as up, down, left or right), the distance of the touch action (how many pixels moved), the moving speed of the touch action and the timestamp of the touch action (start time and end time).

[0053] In some embodiments, after receiving a gesture operation on the screen from the user, the specific action of the gesture operation can be determined in the following manner:

[0054] First, after receiving the gesture operation on the screen, check whether the gesture operation is valid. Specifically, check whether the number of touch points corresponding to the gesture operation exceeds the maximum number of touch points (for example, the maximum number of touch points can be defined as 5). If it exceeds, the gesture operation can be ignored and no further processing is performed. When the first finger touches the screen, the position of the finger is recorded and the "waiting for gesture" state is entered. Whenever the touch point moves, the position information of the corresponding finger is updated. When a new finger begins to touch the screen, the position information of all fingers touching the screen is updated, and it is checked whether the current number of touch points exceeds the maximum number of touch points.

[0055] When a finger leaves the screen, the position information of all fingers before leaving is recorded, and the current gesture operation is tried to be recognized. Specifically, the gesture operation can be recognized based on the position of the current touch point and the historical position change. For example, a gesture can be recognized by calculating the distance change between two touch points, or by calculating the relative position change between multiple touch points. In addition, a threshold can be set to determine whether the gesture operation meets the recognition standard.

[0056] Furthermore, when all fingers leave the screen, or when the number of fingers is reduced to be insufficient to continue the current gesture, the current gesture recognition ends, and all information related to the current gesture is cleared, and then all related variables are reset to the initial state. In particular, when the received gesture operation is an unrecognizable gesture operation, all related variables can also be reset to the initial state.

[0057] In some embodiments, the extracted parameter information may be compared with the definition of a preset gesture to determine whether the current gesture operation is a preset gesture.

[0058] It is understandable that the above-mentioned preset gesture may be a gesture customized by the user or a gesture set by the system by default.

[0059] Exemplarily, the preset gesture may be a multi-finger left-right sliding gesture or a multi-finger pinching gesture.

[0060] In some embodiments, after extracting parameter information related to the gesture operation, it is possible to first check whether the number of touch points matches the number of touch points corresponding to the preset gesture, and then calculate the starting position and the ending position of the touch point, obtain the coordinates of the starting position and the ending position of the touch point, determine the total distance and direction of the touch point movement, and judge whether the direction of the touch point movement conforms to the movement direction of the preset gesture. Then, the average speed of the touch action is calculated by dividing the total distance of the touch point movement by the duration of the touch action, and judge whether the obtained average speed conforms to the preset sliding speed. It is also possible to obtain the start time and the end time of the touch action, and calculate the duration of the touch action based on the start time and the end time of the touch action, and judge whether the duration of the touch action conforms to the preset duration.

[0061] Among them, the above-mentioned preset sliding speed can be set according to the sliding speed corresponding to the preset gesture; the above-mentioned preset duration can be set according to the duration corresponding to the preset gesture.

[0062] It can be understood that when it is determined that the number of touch points matches the number of touch points corresponding to the preset gesture, the direction of movement of the touch points conforms to the movement direction of the preset gesture, the average speed of the touch action conforms to the preset sliding speed, and the duration of the touch action conforms to the preset duration, the gesture operation is determined to be a preset gesture.

[0063] In one possible implementation, after receiving a gesture operation on the screen, the method further includes: obtaining the number of touch points related to the gesture operation, and obtaining the first coordinate of the starting position and the second coordinate of the ending position of each touch point related to the gesture operation on the screen.

[0064] It is understandable that obtaining the number of touch points related to a gesture operation is usually for detecting how many fingers or touch points on the screen are involved in the gesture operation.

[0065] For each touch point, the first coordinate of the starting position of the touch point on the screen, ie, the position where the finger is pressed, and the second coordinate of the ending position of the touch point on the screen, ie, the position where the finger is lifted, may be recorded.

[0066] In some embodiments, the first coordinate and the second coordinate may be represented by pixel positions on the screen, and both the first coordinate and the second coordinate are two-dimensional coordinates, usually represented in the form of (X, Y), wherein the value range of X and Y depends on the resolution of the screen.

[0067] For example, if the screen resolution is 1920*1080, the value range of X is 0 to 1920, and the value range of Y is 0 to 1080. The smaller the value of X, the more to the left the touch point is; the larger the value of X, the more to the right the touch point is. The smaller the value of Y, the more to the top the touch point is; the larger the value of Y, the more to the bottom the touch point is.

[0068] Furthermore, after obtaining the number of touch points related to the gesture operation and the first coordinates and second coordinates corresponding to each touch point, it is possible to determine whether the gesture operation is a preset gesture based on the number of touch points, the coordinates of the starting position of each touch point, i.e., the first coordinate, and the coordinates of the ending position, i.e., the second coordinate.

[0069] Regarding the above S102, it can be understood that, as described above, whether the gesture operation is the first preset gesture can be determined based on the number of touch points related to the gesture operation and the coordinates of the starting position and the ending position of the touch points on the screen.

[0070] In a possible implementation, determining whether the gesture operation is a first preset gesture includes: determining whether the gesture operation is a first preset gesture based on the number of touch points, the first coordinates, and the second coordinates.

[0071] It can be understood that, as mentioned above, the above-mentioned number of touch points refers to the number of points touching the screen when the gesture operation starts; the above-mentioned first coordinates refer to the position coordinates of the touch points when the gesture operation starts; the above-mentioned second coordinates refer to the position coordinates of the touch points when the gesture operation ends.

[0072] Furthermore, it is possible to first check whether the number of points touching the screen meets the requirements of the preset gesture. For example, if the first preset gesture is a sliding operation performed with two fingers, two touch points need to be detected. Then, the position coordinates of the touch points at the beginning of the gesture operation and the position coordinates of the touch points at the end of the gesture operation are recorded for subsequent trajectory judgment. Based on the number of touch points, the first coordinates, and the second coordinates, the trajectory of the gesture operation can be analyzed to determine whether the gesture operation is consistent with the first preset gesture.

[0073] For example, in order to distinguish it from other gesture operations on the screen (such as the single-finger up and down sliding gesture or the single-finger left and right sliding gesture commonly used when sliding pages in an application), the first preset gesture can be set to a multi-finger left and right sliding gesture.

[0074] In a possible implementation, based on the number of touch points, the first coordinates and the second coordinates, determining whether the gesture operation is a first preset gesture includes: determining whether the number of touch points is greater than or equal to the first preset number, and determining whether the number of touch points is less than or equal to a preset number threshold; when the number of touch points is greater than or equal to the first preset number and less than or equal to the preset number threshold, calculating the horizontal difference between the horizontal coordinate of the first coordinate and the horizontal coordinate of the second coordinate of each touch point, and calculating the vertical difference between the vertical coordinate of the first coordinate and the vertical coordinate of the second coordinate of each touch point; determining whether the absolute value of the horizontal difference corresponding to each touch point is greater than the absolute value of the vertical difference, and determining whether the absolute value of the horizontal difference corresponding to each touch point is greater than the preset difference threshold; if the absolute value of the horizontal difference corresponding to each touch point is greater than the absolute value of the vertical difference, and the absolute value of the horizontal difference corresponding to each touch point is greater than the preset difference threshold, then determining that the gesture operation is the first preset gesture.

[0075] It can be understood that the above-mentioned first preset number can be set according to actual needs, for example, the first preset number can be set to 3.

[0076] The preset number threshold can be set according to actual needs, for example, the preset number threshold is set to 5. If the number of detected touch points is greater than 5, it is no longer determined whether the gesture operation is the first preset gesture.

[0077] Further, when it is determined that the number of touch points is greater than or equal to a first preset number and less than or equal to a preset number threshold, the lateral difference between the horizontal coordinate of the first coordinate and the horizontal coordinate of the second coordinate of each touch point, as well as the vertical difference between the vertical coordinate of the first coordinate and the vertical coordinate of the second coordinate of each touch point can be calculated, and then based on the size relationship between the lateral difference and the vertical difference, it is determined whether the gesture operation is the first preset gesture.

[0078] It can be understood that when the absolute values ​​of the horizontal differences of all touch points corresponding to a certain gesture operation are much greater than the absolute values ​​of the vertical differences, it means that the gesture operation is mainly performed in the horizontal direction. When the absolute values ​​of the horizontal differences of all touch points are greater than the preset difference threshold, it means that the action amplitude of the gesture operation has reached the preset requirement, and the gesture operation has left and right sliding behavior. If the touch points corresponding to the gesture operation are greater than or equal to the first preset number, it means that the gesture operation is the first preset gesture.

[0079] Exemplarily, the preset difference threshold can be set according to actual needs, for example, it can be set to 150 pixels.

[0080] For example, assuming that the first preset number is 3, the preset difference threshold is 150 pixels. Figure 2 As shown, three touch points A, B, and C are detected on the screen 200, and the number of touch points is equal to a first preset number and less than a preset number threshold. The horizontal difference and vertical difference between the first coordinates corresponding to the starting positions of the three touch points on the screen and the second coordinates corresponding to the ending positions on the screen can be further calculated.

[0081] like Figure 2 As shown, the first coordinate corresponding to touch point A is (x1, y1), and the second coordinate is (X1, Y1); the first coordinate corresponding to touch point B is (x2, y2), and the second coordinate is (X2, Y2); the first coordinate corresponding to touch point C is (x3, y3), and the second coordinate is (X3, Y3).

[0082] If |X1-x1|>|Y1-y1| and |X1-x1| is greater than 150, |X2-x2|>|Y2-y2| and |X2-x2| is greater than 150 and |X3-x3|>|Y3-y3| and |X3-x3| is greater than 150, then the gesture operation is a three-finger left-right sliding operation.

[0083] Furthermore, as described above, the smaller the value of the horizontal coordinate, the more to the left the touch point is; the larger the value of the horizontal coordinate, the more to the right the touch point is. The smaller the value of the vertical coordinate, the more to the top the touch point is; the larger the value of the vertical coordinate, the more to the bottom the touch point is.

[0084] For example, if X1-x1 is greater than 150, X2-x2 is greater than 150 and X3-x3 is greater than 150, then the gesture operation is a three-finger right swipe gesture; and if X1-x1 is less than -150, X2-x2 is less than -150 and X3-x3 is less than -150, then the gesture operation is a three-finger left swipe gesture.

[0085] The above method ensures that gesture recognition is triggered only when the user performs a specific number of finger slides by limiting the number of touch points (i.e., greater than or equal to the first preset number and less than or equal to the preset number threshold). By comparing the absolute values ​​of the horizontal difference and the vertical difference, it is ensured that the gesture is a horizontal slide rather than a vertical slide or movement in other directions. By setting a preset difference threshold, the accuracy of the gesture operation is further ensured to prevent slight movements from being mistakenly recognized as the first preset gesture. Through the above conditional restrictions, the possibility of unexpected gestures being mistakenly recognized as the first preset gesture can be reduced, ensuring that only gesture operations that meet the first preset gesture can trigger application switching.

[0086] Regarding the above S103, it can be understood that the above currently running application specifically refers to the application currently running in the foreground.

[0087] As mentioned above, if the gesture operation is determined to be a preset gesture, it means that the gesture operation is a gesture that has been defined and assigned a specific function. When the gesture operation is recognized, the display page corresponding to the currently running application can be automatically switched to another display page associated with the gesture operation according to the action represented by the gesture. For example, the gesture operation can trigger the opening or display of a specific application or function.

[0088] For example, if the preset gesture is a gesture of sliding inward from the edge of the screen, the preset gesture can trigger a function of switching the display page corresponding to the currently running application to the main screen page. When the gesture operation is detected to be the preset gesture, the display page corresponding to the currently running application can be switched to the main screen page.

[0089] In an embodiment of the present application, the above-mentioned first preset gesture can be assigned a specific function. For example, when it is determined that the gesture operation is the first preset gesture, the display page corresponding to the currently running application displayed in the target display area of ​​the screen is switched to the display page corresponding to the target background running application, that is, the first preset gesture is used to initiate the first switching instruction to switch the currently running application to the target background running application.

[0090] It is understandable that the target display area refers to the display area of ​​the screen that is displaying the display page of the currently running application. The target background running application may be the application currently running in the background.

[0091] Exemplarily, when it is determined that the gesture operation is the first preset gesture, it can be determined which background running application in the background running application list to switch to based on the operation direction of the gesture (from right to left or from left to right), that is, the target background running application is determined, and then the display page corresponding to the currently running application displayed in the target display area is switched to the display page corresponding to the target background running application.

[0092] In one possible implementation, the target background running application is determined in the following manner: obtaining a list of background running applications; wherein the list of background running applications includes multiple background running applications arranged in chronological order of application startup; if the sliding direction of the first preset gesture is from left to right, then if there is a subsequent application of the currently running application in the list of background running applications, the subsequent application is determined as the target background running application; if the sliding direction of the first preset gesture is from right to left, then if there is a previous application of the currently running application in the list of background running applications, the previous application is determined as the target background running application.

[0093] It is understandable that there are multiple running processes of background applications in the above background running application list, and the multiple background running applications are arranged in the order of the time of opening, such as from the last to the first. When a new application is opened, it will be added to the first place in the background running application list, that is, the later the application is opened, the higher the ranking is, and the earlier the application is opened, the lower the ranking is.

[0094] The subsequent application of the currently running application is an application that is ranked after the currently running application in the background running application list, that is, the start time of the subsequent application is earlier than the start time of the currently running application. The previous application of the currently running application is an application that is ranked before the currently running application in the background running application list, that is, the start time of the previous application is later than the start time of the currently running application.

[0095] Furthermore, if the currently running application is the first application in the background running application list, indicating that there is no previous application for the application, when the sliding direction of the first preset gesture is from right to left, the display page corresponding to the currently running application is still displayed.

[0096] Similarly, if the currently running application is the last application in the background running application list, it means that there is no subsequent application to the application. Then, when the sliding direction of the first preset gesture is from left to right, the display page corresponding to the currently running application is still displayed.

[0097] For example, if application a is currently running in the foreground, the gesture operation acting on the screen is detected to be the first preset gesture, the list of background running applications is obtained, and the sliding direction of the first preset gesture is determined to be from right to left. It is determined that application 1 is ranked second in the list of background running applications, and it is determined whether there is a previous application of application a in the list of background running applications. If so, the display page corresponding to the current application 1 is switched to the display page corresponding to the previous application of application a.

[0098] It is understandable that when an application in the background running application list is switched by the first preset gesture, the order of each application process in the background running application list will not change.

[0099] For example, the user clicks on the application icons to open application a, application b, and application c in sequence. The order in the background running application list may be that application c is ranked first, application b is ranked after application c, and application a is ranked after application b. If the foreground running application is application c, the direction of the first preset gesture performed by the user is to slide from left to right, and there is a subsequent application to application c, then the subsequent application of application c, namely application b, is determined as the target background running application.

[0100] After the display page of application c is switched to the display page of application b, the order in the background running application list is still that application c is ranked first, application b is ranked after application c, and application a is ranked after application b.

[0101] In order to quickly switch the current page to a page corresponding to a background running application when the user makes the first preset gesture, the application recently used by the user may be tracked and managed through a service.

[0102] In some embodiments, an empty application package name packageList list is created to store recently used application package names. When a user clicks an application icon to start an application, the Service is notified through a broadcast mechanism. After receiving the broadcast, the Service extracts the application package name.

[0103] Furthermore, a broadcast receiver is registered to receive broadcasts containing the application package name. When the sender sends a broadcast containing the application package name, the receiver receives the broadcast and extracts the application package name from it.

[0104] Since the packageList list can store application package names, after receiving the broadcast and extracting the application package name from the broadcast, it can be determined whether the packageList list stores the application package name. If the packageList already contains the application package name, it can be moved to the top of the list. If the packageList does not contain the application package name, it can be added to the top of the list.

[0105] At the same time, the application subscript Index can also be recorded. The value of Index can represent the position of the application in the packageNames list. For example, if the value of Index is defined as 0, it means that the application is at the top of the packageNames list. The larger the value of Index, the lower the ranking of the application in the packageNames list.

[0106] It can be understood that the role of the above-mentioned packageList list is similar to that of the background running application list described above. The value of Index can indicate the order of the application in the background running application list. For example, if the value of Index is 0, the application is at the top of the background running application list. The larger the value of Index, the later the application is ranked in the background running application list, that is, the earlier the application is started.

[0107] In some embodiments, when the gesture operation performed by the user is the first preset gesture, the Service receives the gesture operation and adjusts the value of Index according to the direction of the gesture (from left to right or from right to left).

[0108] For example, if the sliding direction of the first preset gesture is from left to right, it means that you need to switch to the next application of the currently running application, then the value of the current Index is increased; if the sliding direction of the first preset gesture is from right to left, it means that you need to switch to the previous application of the currently running application, then the value of the current Index is reduced.

[0109] The range of Index is limited to the valid index range of packageList. For example, if the value of Index is 0, it means that the application is at the first place in the packageNames list, and there are only 3 applications in packageList, then the range of Index can be limited to 0 to 2.

[0110] Furthermore, the updated Index value is used to obtain the corresponding application package name packageName from packageList. Then the Activity Manager Service (AMS) is called to obtain the recent task list. The task matching packageName is searched in the recent task list, and the found process is moved to the foreground, that is, the current page is switched to the page corresponding to the background running application.

[0111] For example, suppose there is a list packageList containing three application package names, and the current Index value is 0. We will update the Index value through the first preset gesture and switch to the corresponding application. If packageList contains three application package names: app1, app2, app3, and the currently running application is app1, set the Index value corresponding to app1 to 0, the Index value corresponding to app2 to 1, and the Index value corresponding to app3 to 2.

[0112] Through the first preset gesture, you can switch back and forth among the three applications. If the sliding direction of the first preset gesture is from left to right, it means that you need to switch to the next application after the currently running application, then increase the value of the current Index, update the value of Index to 1, use the updated value, that is, use Index = 1, get the corresponding application package name from packageList, and get the application package name app2.

[0113] Furthermore, a recently used application matching the specified package name may be found, and the application process may be moved to the foreground to run.

[0114] The above method, by utilizing the fact that the list of background running applications is arranged in the order of opening time, can ensure that the logic of gesture operation is reliable and consistent. The user can switch to the previous or next application of the currently running application according to different gesture operation directions, reducing the probability of misoperation. And the first preset gesture can be used to flexibly switch back and forth between multiple applications, improving the efficiency of application switching.

[0115] Furthermore, after receiving a gesture operation, in addition to determining whether the gesture operation is a first preset gesture, it may also be determined whether the gesture operation is a second preset gesture having a function different from that defined by the first preset gesture.

[0116] In one possible implementation, after receiving the gesture operation on the screen, the method also includes: determining whether the gesture operation is a second preset gesture; wherein the second preset gesture is used to initiate a second switching instruction to switch the currently running application to a list of background running applications; when it is determined that the gesture operation is the second preset gesture, in response to the second switching instruction, switching the display page corresponding to the currently running application displayed in the target display area to a display page corresponding to the list of background running applications.

[0117] It can be understood that, as mentioned above, the above-mentioned second preset gesture can also be assigned a specific function. For example, when the gesture operation is determined to be the second preset gesture, the display page corresponding to the currently running application can be switched to the display page corresponding to the background running application list, that is, the second preset gesture is used to initiate a second switching instruction to switch the currently running application to the background running application list.

[0118] In a possible implementation, determining whether the gesture operation is the second preset gesture includes: determining whether the gesture operation is the second preset gesture based on the number of touch points, the first coordinates, and the second coordinates.

[0119] It is understandable that, as described above, first check whether the number of points touching the screen meets the requirements of the preset gesture. For example, if the second preset gesture is a pinch operation performed with four fingers, four touch points need to be detected. Then record the position coordinates of the touch points at the beginning of the gesture operation and the position coordinates of the touch points at the end of the gesture operation for subsequent trajectory judgment. According to the number of touch points, the first coordinates and the second coordinates, the trajectory of the gesture operation can be analyzed to determine whether the gesture operation is consistent with the second preset gesture.

[0120] For example, similarly to the above, in order to distinguish it from other gesture operations on the screen (such as the single-finger up and down sliding gesture or the single-finger left and right sliding gesture commonly used when sliding pages within an application and the first preset gesture mentioned above), the second preset gesture can be set to a multi-finger pinch gesture.

[0121] The multi-finger pinch gesture is manifested as two or more fingers moving toward each other on the screen, forming a "pinch"-like action.

[0122] In a possible implementation, based on the number of touch points, the first coordinates and the second coordinates, determining whether the gesture operation is a second preset gesture includes: determining whether the number of touch points is greater than or equal to the second preset number, and determining whether the number of touch points is less than or equal to a preset number threshold; when the number of touch points is greater than or equal to the second preset number and less than or equal to the preset number threshold, based on the first coordinates of each touch point, calculating a first spacing between a starting position of each touch point and a starting position of an adjacent touch point to obtain a plurality of first spacings, and superimposing the plurality of first spacings to obtain a sum of first spacings; based on the second coordinates of each touch point, calculating a second spacing between an ending position of each touch point and an ending position of an adjacent touch point to obtain a plurality of second spacings, and superimposing the plurality of second spacings to obtain a sum of second spacings; determining whether the sum of the second spacings is less than or equal to a preset proportion of the sum of the first spacings; if the sum of the second spacings is less than or equal to the preset proportion of the sum of the first spacings, determining that the gesture operation is the second preset gesture.

[0123] It is understandable that the adjacent touch point is the previous touch point or the next touch point based on the touch point index sequence. The touch point index sequence refers to a sequential number or index assigned to each touch point when a multi-touch operation is performed on the touch screen. These indexes are usually assigned according to the order in which the touch points are detected by the system, that is, the touch point detected first has a smaller index, and the touch point detected later has a larger index.

[0124] The second preset number can be set according to actual needs. For example, the second preset number can be set to 4.

[0125] Similarly, the above-mentioned preset number threshold can be set according to actual needs, for example, the preset number threshold is set to 5. If the number of detected touch points is greater than 5, it is no longer determined whether the gesture operation is the second preset gesture.

[0126] Further, when it is determined that the number of touch points is greater than or equal to the second preset number and less than or equal to the preset number threshold, the first spacing between the starting position of each touch point and the starting position of the adjacent touch point can be calculated based on the first coordinate of each touch point to obtain multiple first spacings, and then the multiple first spacings are superimposed to obtain the sum of the first spacings.

[0127] The second distance between the end position of each touch point and the end position of any adjacent touch point may also be calculated based on the second coordinate of each touch point to obtain multiple second distances, and then the multiple second distances are superimposed to obtain the sum of the second distances.

[0128] For example, Figure 3 As shown, the adjacent touch point of touch point D is touch point E, the adjacent touch points of touch point E are touch point D and touch point F, and the adjacent touch point of touch point F is touch point G. Touch point E has two adjacent touch points, and when calculating the first interval or the second interval, if the interval between touch point D and touch point E has been calculated, only the interval between touch point E and touch point F may be calculated.

[0129] Furthermore, the first distance sum calculated above is compared with the second distance sum. If the second distance sum is less than or equal to the preset ratio of the first distance sum, it means that the distance between the touch points becomes smaller at the position where the gesture operation ends, indicating that the gesture operation involves a pinching behavior. If the number of touch points is greater than or equal to the second preset number, it means that the gesture operation is the second preset gesture.

[0130] Exemplarily, the above preset ratio can be set according to actual needs, for example, set to 80%. In this case, when the sum of the second spacings is less than or equal to 80% of the sum of the first spacings, and the number of touch points is greater than or equal to the second preset number, the gesture operation is the second preset gesture.

[0131] For example, it is assumed that the second preset number is 4 and the preset ratio is 80%. Figure 3 As shown, there are four touch points D, E, F, and G in the screen 300. The number of touch points is equal to the second preset number and is less than the preset number threshold, and the first spacing and the second spacing between each of the four touch points and the adjacent touch points can be further calculated.

[0132] like Figure 3 As shown, the first coordinate corresponding to the starting position of touch point D is (x4, y4), and the second coordinate is (X4, Y4); the first coordinate corresponding to touch point E is (x5, y5), and the second coordinate is (X5, Y5); the first coordinate corresponding to touch point F is (x6, y6), and the second coordinate is (X6, Y6); the first coordinate corresponding to touch point G is (x7, y7), and the second coordinate is (X7, Y7).

[0133] Based on the first coordinates of touch points D, E, F, and G, the first distance d1 between touch points D and E, the first distance d2 between E and F, and the first distance d3 between F and G are calculated respectively to obtain three first distances, which are then superimposed to obtain the total first distance.

[0134] It is understandable that the first distances d1, d2 and d3 can be calculated based on the first coordinates of the two touch points. First spacing First spacing The sum of the first spacing is: d1+d2+d3.

[0135] Similarly, based on the second coordinates of touch points D, E, F, and G, the second distance D1 between touch points D and E, the second distance D2 between E and F, and the second distance D3 between F and G are calculated respectively to obtain three second distances, and the three second distances are superimposed to obtain the total second distance.

[0136] The above D1, D2 and D3 can be calculated based on the second coordinates between the two touch points.

[0137] Among them, the second spacing Second spacing Second spacing The second spacing sum is: D1+D2+D3.

[0138] Further, it is determined whether the sum of the second spacing is less than or equal to the sum of the first spacing of the preset ratio, that is, it is determined whether the above D1+D2+D3 is less than or equal to 80%*(d1+d2+d3). If D1+D2+D3≤80%*(d1+d2+d3), it is determined that the gesture operation is the second preset gesture.

[0139] The above method ensures that gesture recognition is triggered only when the user performs a specific number of finger pinches by limiting the number of touch points (i.e., greater than or equal to the second preset number and less than or equal to the preset number threshold). By comparing the sum of the distances between the starting position and the ending position, it is ensured that the gesture is a pinch rather than other types of movement. By setting a preset ratio, the accuracy of the gesture operation is further ensured to prevent slight movements from being mistakenly recognized as the second preset gesture. Through the above conditional restrictions, the possibility of unexpected gestures being mistakenly recognized as the second preset gesture can be reduced, ensuring that only gesture operations that meet the second preset gesture can trigger function execution.

[0140] Further, when it is determined that the gesture operation is the second preset gesture, a list of background running applications may be obtained, and a display page corresponding to the currently running application displayed in the target display area may be switched to a display page corresponding to the list of background running applications.

[0141] It is understandable that, as described above, there are multiple running processes of background applications in the above background running application list, and the background running application list can also be called a background application process list. And the multiple background running applications in the background running application list are arranged in the order of the time of opening, such as from the back to the front according to the opening time.

[0142] In some embodiments, you can first get the running process list runningTasks, then traverse the packageList stored in the Service, find the RunningTaskInfo corresponding to each package name, and get the snapshot image of each application, then create a new window, use the Glide tool to draw the snapshot on the screen, and mark the image of the package name corresponding to the current Index with a red box to indicate the currently running process. When the user clicks the snapshot image corresponding to any process on the screen, the current page can be switched to the arbitrary process, and the arbitrary process can run in the foreground.

[0143] It is understandable that the above snapshot image refers to the last frame of image information before the application retreats to the background.

[0144] For example, Figure 4 As shown, when the gesture operation is determined to be the second preset gesture, a list of background running applications can be obtained, that is, Figure 4 The list of background running applications including process 1, process 2, process 3, process 4 and process 5 is included, and the display page of the currently running application is directly switched to Figure 4 The display page corresponding to the application process list in . Figure 4 Process 2 in the figure is the process corresponding to the currently running application (process 2 is ranked second in the list of background running applications), and the process can be marked by a dotted box.

[0145] Furthermore, after the display page corresponding to the currently running application displayed in the target display area is switched to the display page corresponding to the background running application list, the user can select and use any application in the background running application list.

[0146] In one possible implementation, after switching the display page corresponding to the currently running application displayed in the target display area to the display page corresponding to the background running application list, the method further includes: upon detecting a selection operation on any application in the background running application list, switching the display page corresponding to the background running application list displayed in the target display area to the application display page corresponding to the selection operation.

[0147] It can be understood that, as described above, when the gesture operation is determined to be the second preset gesture, the display page of the currently running application is switched to the display page corresponding to the background running application list, and the user can select an application in the background running application list. When it is detected that the user has selected an application, the display page corresponding to the background running application list can be switched to the display page corresponding to the selected application.

[0148] Exemplarily, the selection operation may be a click operation, a long press operation, or a selection operation by initiating a voice command.

[0149] The above method can quickly open the background running application list through the second preset gesture, and quickly switch to the desired application through the selection operation. In addition, it can flexibly switch back and forth between multiple applications in the background running application list, thereby improving the efficiency of application switching.

[0150] Figure 5 It is a structural diagram of a switching device of an application provided in an embodiment of the present application.

[0151] For example, Figure 5 As shown, the device 500 includes:

[0152] The receiving module 501 is used to receive gesture operations on the screen.

[0153] The determination module 502 is used to determine whether the gesture operation is a first preset gesture.

[0154] The first preset gesture is used to initiate a first switching instruction to switch the currently running application to a target background running application.

[0155] The switching module 503 is used to switch the display page corresponding to the currently running application displayed in the target display area of ​​the screen to the display page corresponding to the target background running application in response to the first switching instruction when it is determined that the gesture operation is the first preset gesture.

[0156] Optionally, the device also includes an application determination module, which is specifically used to: obtain a list of background running applications; wherein the list of background running applications contains multiple background running applications arranged in chronological order of application startup; if the sliding direction of the first preset gesture is from left to right, then if there is a subsequent application of the currently running application in the list of background running applications, the subsequent application is determined as the target background running application; if the sliding direction of the first preset gesture is from right to left, then if there is a previous application of the currently running application in the list of background running applications, the previous application is determined as the target background running application.

[0157] Optionally, the device also includes a second switching module, which is specifically used to: determine whether the gesture operation is a second preset gesture; wherein the second preset gesture is used to initiate a second switching instruction to switch the currently running application to a background running application list; when it is determined that the gesture operation is the second preset gesture, in response to the second switching instruction, switch the display page corresponding to the currently running application displayed in the target display area to the display page corresponding to the background running application list.

[0158] Optionally, the device also includes an acquisition module, which is specifically used to: acquire the number of touch points related to the gesture operation, and acquire the first coordinate of the starting position and the second coordinate of the ending position of each touch point related to the gesture operation on the screen.

[0159] In a possible implementation, the determination module is specifically configured to determine whether the gesture operation is a first preset gesture based on the number of touch points, the first coordinate, and the second coordinate.

[0160] In a possible implementation, the second switching module includes a judgment unit, which is specifically used to: judge whether the gesture operation is a second preset gesture based on the number of touch points, the first coordinates, and the second coordinates.

[0161] In a possible implementation, the judgment module is also specifically used to: judge whether the number of touch points is greater than or equal to a first preset number, and judge whether the number of touch points is less than or equal to a preset number threshold; when the number of touch points is greater than or equal to the first preset number and less than or equal to the preset number threshold, calculate the horizontal difference between the horizontal coordinate of the first coordinate and the horizontal coordinate of the second coordinate of each touch point, and calculate the vertical difference between the vertical coordinate of the first coordinate and the vertical coordinate of the second coordinate of each touch point; judge whether the absolute value of the horizontal difference corresponding to each touch point is greater than the absolute value of the vertical difference, and judge whether the absolute value of the horizontal difference corresponding to each touch point is greater than the preset difference threshold; if the absolute value of the horizontal difference corresponding to each touch point is greater than the absolute value of the vertical difference, and the absolute value of the horizontal difference corresponding to each touch point is greater than the preset difference threshold, then determine that the gesture operation is the first preset gesture.

[0162] In a possible implementation, the judgment unit is further specifically used to: judge whether the number of touch points is greater than or equal to a second preset number, and judge whether the number of touch points is less than or equal to a preset number threshold; when the number of touch points is greater than or equal to the second preset number and less than or equal to the preset number threshold, based on the first coordinate of each touch point, calculate the first spacing between the starting position of each touch point and the starting position of an adjacent touch point to obtain multiple first spacings, and superimpose the multiple first spacings to obtain the sum of the first spacings; based on the second coordinate of each touch point, calculate the second spacing between the ending position of each touch point and the ending position of the adjacent touch point to obtain multiple second spacings, and superimpose the multiple second spacings to obtain the sum of the second spacings; judge whether the sum of the second spacings is less than or equal to the sum of the first spacings of a preset proportion; if the sum of the second spacings is less than or equal to the sum of the first spacings of the preset proportion, determine that the gesture operation is the second preset gesture.

[0163] In one possible implementation, the second switching module includes a page switching unit, which is specifically used to: when a selection operation on any application in the background running application list is detected, switch the display page corresponding to the background running application list displayed in the target display area to the application display page corresponding to the selection operation.

[0164] Figure 6 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application.

[0165] For example, Figure 6 As shown, the electronic device 600 includes: a memory 601 and a processor 602, wherein the memory 601 stores an executable program code 6011, and the processor 602 is used to call and execute the executable program code 6011 to perform an application switching method.

[0166] In addition, an embodiment of the present application also protects a device, which may include a memory and a processor, wherein the memory stores an executable program code, and the processor is used to call and execute the executable program code to execute an application switching method provided by an embodiment of the present application.

[0167] In this embodiment, the functional modules of the device can be divided according to the above method example. For example, each functional module can be corresponded, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware. It should be noted that the division of modules in this embodiment is schematic and is only a logical function division. There may be other division methods in actual implementation.

[0168] In the case of dividing each functional module according to each function, the device may also include a receiving module, a judging module, a switching module, etc. It should be noted that all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module, which will not be repeated here.

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

[0170] 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 relevant program codes and data.

[0171] The processing module may be a processor or a controller, which may implement or execute various exemplary logic blocks, modules and circuits shown in conjunction with the disclosure of the present 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.

[0172] In addition, the device provided in the embodiments of the present application may 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 a switching method of an application provided in the above embodiments.

[0173] This embodiment 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 application switching method provided in the above embodiment.

[0174] This embodiment further 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 application switching method provided in the above-mentioned embodiment.

[0175] 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.

[0176] 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.

[0177] 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.

[0178] 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 switching an application, characterized in that: The method comprises: Receive gesture operations on the screen; Determine whether the gesture operation is a first preset gesture; wherein the first preset gesture is used to initiate a first switching instruction to switch the currently running application to a target background running application; When it is determined that the gesture operation is the first preset gesture, in response to the first switching instruction, the display page corresponding to the currently running application displayed in the target display area of ​​the screen is switched to the display page corresponding to the target background running application.

2. The method according to claim 1, characterized in that: The target background running application is determined in the following manner: Obtain a list of background running applications; wherein the list of background running applications includes a plurality of background running applications arranged in the order of the time when the applications were started; If the sliding direction of the first preset gesture is sliding from left to right, then if there is a subsequent application of the currently running application in the background running application list, the subsequent application is determined as the target background running application; If the sliding direction of the first preset gesture is from right to left, then in the case where there is a previous application of the currently running application in the background running application list, the previous application is determined as the target background running application.

3. The method according to claim 1, characterized in that After receiving the gesture operation on the screen, the method further includes: Determine whether the gesture operation is a second preset gesture; wherein the second preset gesture is used to initiate a second switching instruction to switch the currently running application to a background running application list; When it is determined that the gesture operation is the second preset gesture, in response to the second switching instruction, the display page corresponding to the currently running application displayed in the target display area is switched to the display page corresponding to the background running application list.

4. The method according to claim 3, characterized in that After receiving the gesture operation on the screen, the method further includes: Acquire the number of touch points related to the gesture operation, and acquire the first coordinate of the starting position and the second coordinate of the ending position of each touch point related to the gesture operation on the screen; The determining whether the gesture operation is a first preset gesture includes: Based on the number of touch points, the first coordinates, and the second coordinates, determining whether the gesture operation is a first preset gesture; The determining whether the gesture operation is a second preset gesture includes: Based on the number of touch points, the first coordinates, and the second coordinates, it is determined whether the gesture operation is a second preset gesture.

5. The method according to claim 4, characterized in that The determining whether the gesture operation is a first preset gesture based on the number of touch points, the first coordinates, and the second coordinates includes: Determining whether the number of touch points is greater than or equal to a first preset number, and determining whether the number of touch points is less than or equal to a preset number threshold; When the number of touch points is greater than or equal to the first preset number and less than or equal to the preset number threshold, calculate the horizontal difference between the abscissa of the first coordinate and the abscissa of the second coordinate of each touch point, and calculate the vertical difference between the ordinate of the first coordinate and the ordinate of the second coordinate of each touch point; Determine whether the absolute value of the horizontal difference corresponding to each touch point is greater than the absolute value of the vertical difference, and determine whether the absolute value of the horizontal difference corresponding to each touch point is greater than a preset difference threshold; If the absolute value of the lateral difference corresponding to each touch point is greater than the absolute value of the longitudinal difference, and the absolute value of the lateral difference corresponding to each touch point is greater than a preset difference threshold, the gesture operation is determined to be the first preset gesture.

6. The method according to claim 4, characterized in that The determining whether the gesture operation is a second preset gesture based on the number of touch points, the first coordinates, and the second coordinates includes: Determining whether the number of touch points is greater than or equal to a second preset number, and determining whether the number of touch points is less than or equal to a preset number threshold; When the number of touch points is greater than or equal to the second preset number and less than or equal to the preset number threshold, based on the first coordinate of each touch point, a first spacing between a starting position of each touch point and a starting position of an adjacent touch point is calculated to obtain a plurality of first spacings, and the plurality of first spacings are superimposed to obtain a sum of the first spacings; Based on the second coordinates of each touch point, calculate a second distance between an end position of each touch point and an end position of an adjacent touch point to obtain a plurality of second distances, and superimpose the plurality of second distances to obtain a sum of the second distances; Determine whether the sum of the second intervals is less than or equal to a preset ratio of the sum of the first intervals; If the second distance sum is less than or equal to the preset ratio of the first distance sum, the gesture operation is determined to be the second preset gesture.

7. The method according to claim 3, characterized in that After switching the display page corresponding to the currently running application displayed in the target display area to the display page corresponding to the background running application list, the method further includes: When a selection operation on any application program in the background running application list is detected, a display page corresponding to the background running application list displayed in the target display area is switched to an application display page corresponding to the selection operation.

8. An application switching device, characterized in that: The device comprises: A receiving module, used for receiving gesture operations on the screen; A determination module, used to determine whether the gesture operation is a first preset gesture; wherein the first preset gesture is used to initiate a first switching instruction to switch the currently running application to a target background running application; The switching module is used to switch the display page corresponding to the currently running application displayed in the target display area of ​​the screen to the display page corresponding to the target background running application in response to the first switching instruction when it is determined that the gesture operation is the first preset gesture.

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, and when the computer program is executed, the method according to any one of claims 1 to 7 is implemented.