Debugging mode starting method and device, electronic equipment, storage medium and vehicle
By identifying preset gestures on the touch screen of an electronic device and starting the debug mode application package, the problem of inability to start the debug mode when the touch screen displays abnormally is solved, and the success rate and operation efficiency of the debug mode are improved.
Patent Information
- Application Number
- CN202510120723.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-26
- Publication Date
- 2025-03-04
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
When the touch screen of an electronic device is abnormal, debug mode cannot be started from the operating system through the touch operation of the touch screen, resulting in the debug mode failure to start.
When the user enters gestures through the touch screen of the electronic device, he obtains the track information of the gesture, calls the preset function to identify the track information, obtains the recognition results, and when the recognition result characterizes the gesture as the preset gesture, the application package of the debug mode of the electronic device is activated through the preset interface to enable the debug mode.
It avoids the failure to turn on debug mode due to abnormal display of touch screen of electronic devices, improves the success rate of debug mode turning on, is easy to operate, and improves work efficiency.
Smart Images

Figure CN119556841A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of electronic equipment debugging, and in particular relates to a method and device for starting a debugging mode, an electronic equipment, a storage medium and a vehicle. Background Art
[0002] An electronic device (such as a car computer) is usually provided with a touch screen (ie, a touch panel). The operating system of the electronic device can be operated by touch operation of the touch screen, and a debugging mode can be started from the operating system.
[0003] For example, for an electronic device installed with an Android system, the Android Debug Bridge (ADB) can be started on the setting page of the Android system through touch operation of the touch screen to enter the ADB mode (ie, Android debugging mode).
[0004] However, when the touch screen of the electronic device displays an abnormality (eg, a black screen), the debugging mode cannot be started from the operating system of the electronic device through a touch operation of the touch screen, resulting in a failure in starting the debugging mode. Summary of the invention
[0005] The present invention aims to provide a method, device, electronic device, storage medium and vehicle for starting a debugging mode, which at least solves the problem in the prior art that the debugging mode cannot be started from the operating system of the electronic device through touch operation of the touch screen due to abnormal display of the touch screen of the electronic device, resulting in failure to start the debugging mode.
[0006] In order to solve the above-mentioned technical problems, the present invention is achieved as follows: In a first aspect, an embodiment of the present invention provides a method for enabling a debugging mode, the method comprising: When a user inputs a gesture through a touch screen of an electronic device, obtaining trajectory information of the gesture; Calling a preset function to identify the trajectory information and obtain an identification result; When the recognition result indicates that the gesture is a preset gesture, an application package of the debugging mode of the electronic device is started through a preset interface to enable the debugging mode.
[0007] In a second aspect, an embodiment of the present invention further provides a device for starting a debugging mode, the device comprising: An acquisition module, used for acquiring trajectory information of a gesture when a user inputs a gesture through a touch screen of an electronic device; The recognition module is used to call a preset function to recognize the trajectory information and obtain a recognition result; The processing module is used to start the application package of the debugging mode of the electronic device through a preset interface to enable the debugging mode when the recognition result indicates that the gesture is a preset gesture.
[0008] In a third aspect, an embodiment of the present invention further provides an electronic device, comprising a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the method described in the first aspect.
[0009] In a fourth aspect, an embodiment of the present invention further provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.
[0010] In a fifth aspect, an embodiment of the present invention further provides a vehicle, comprising a device for starting a debugging mode as described in the second aspect, or comprising an electronic device as described in the third aspect, or comprising a readable storage medium as described in the fourth aspect.
[0011] In an embodiment of the present invention, when a user inputs a gesture through the touch screen of an electronic device, trajectory information of the gesture is obtained, a preset function is called to identify the trajectory information, and an identification result is obtained. Then, when the identification result characterizes that the gesture is a preset gesture, an application package of the debugging mode of the electronic device is started through a preset interface to turn on the debugging mode, thereby avoiding failure to turn on the debugging mode due to abnormal display of the touch screen of the electronic device, and improving the success rate of turning on the debugging mode. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] Figure 1 It is a flowchart of a method for starting a debugging mode provided by an embodiment of the present invention; Figure 2 It is a flowchart of specific steps of a method for starting a debugging mode provided by an embodiment of the present invention; Figure 3 is a schematic diagram of a touch event processing flow provided by an embodiment of the present invention; Figure 4 It is a schematic diagram of a process flow of starting a debugging mode provided by an embodiment of the present invention; Figure 5 It is a schematic diagram of another process flow of starting a debugging mode provided by an embodiment of the present invention; Figure 6 is a block diagram of a device for starting a debugging mode provided by an embodiment of the present invention; Figure 7 It is a schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0013] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0014] The terms "first", "second", etc. in the specification and claims of the present invention are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of the same type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0015] The method for enabling the debugging mode provided by the embodiment of the present invention is described in detail below with reference to the accompanying drawings through specific embodiments and application scenarios.
[0016] Figure 1 is a flowchart of a method for starting a debugging mode provided by an embodiment of the present invention. Figure 1 As shown, the method may include: Step 101: When a user inputs a gesture through a touch screen of an electronic device, trajectory information of the gesture is obtained.
[0017] In some embodiments, a gesture is a graphic formed by a user moving a limb (such as a finger) on the touch screen; the trajectory information of the gesture includes the coordinate information of each touch point in the process of the user moving a limb (such as a finger) on the touch screen to form the graphic.
[0018] Electronic devices refer to devices that rely on electronic technology to perform functions, such as mobile phones, touch-screen computers, etc.
[0019] In some embodiments, the electronic device is a vehicle computer, and when a user inputs a gesture through the touch screen of the vehicle computer, trajectory information of the gesture is obtained.
[0020] In some embodiments, the system of the electronic device is an Android system. In the Android system, the View class is the base class of all UI components. It provides a basic interface to draw and handle user interactions; ViewGroup is the base class of all layout container classes. ViewGroup inherits from the View class. It can not only draw itself like View, but also contain other View or ViewGroup instances to build complex user interface layouts; Activity is a very important component in the application. It represents a single user interface screen in the application. Activity is the entry point for users to interact with the application. It is used to display the interface, process user input, and perform other user interface related tasks.
[0021] Reference Figure 3 In some embodiments, by processing touch events to obtain gesture trajectory information, the touch event processing flow includes: X1, touch start; X2, in the Activity page, rewrite dispatchTouchEvent; In the Android system, the dispatchTouchEvent method is used to distribute touch events in the View class. When the user touches the screen, the system will pass the touch event (MotionEvent) to the current View. The View will first call the dispatchTouchEvent method. If the rewritten dispatchTouchEvent method returns true, it means that the event has been consumed and will not be passed to other Views; if the rewritten dispatchTouchEvent method returns false, the event will continue to be passed to the child View, and the touch ends; if the rewritten dispatchTouchEvent method calls super.dispatchTouchEvent(event), the Activity is allowed to use the default event distribution mechanism to handle touch events, that is, in the ViewGroup container class view, rewrite dispatchTouchEvent; X3. In the ViewGroup container class view, override dispatchTouchEvent; if the override dispatchTouchEvent method returns false, the touch event is not consumed, and the event is not expected to continue to be transmitted in the ViewGroup. The next step is to override onTouchEvent in the Activity activity page; if the override dispatchTouchEvent method calls super.dispatchTouchEvent(event), the parent class (ie ViewGroup) handles the distribution of touch events, that is, in the ViewGroup container class view, override onInterceptTouchEvent; X4. In the ViewGroup container class view, override onInterceptTouchEvent; onInterceptTouchEvent is the ViewGroup in the Android system A method of the class that provides an opportunity for the parent view (layout container) to decide whether to intercept the touch event of the child view. If the onInterceptTouchEvent method is rewritten and returns true, the touch event is intercepted without passing it to any child view, so that the ViewGroup can fully control the handling of the event. Then, in the ViewGroup container class view, rewrite onTouchEvent; if the onInterceptTouchEvent method is rewritten and returns false, it means that the ViewGroup does not intercept the touch event and allows the event to continue to be passed to the child view. In the View control class view, rewrite dispatchTouchEvent; X5. In the View control class view, rewrite dispatchTouchEvent; if the rewritten dispatchTouchEvent method returns false, the View does not process the touch event, and the event can continue to be passed to other ViewGroups. In the ViewGroup container class view, rewrite onTouchEvent; if the rewritten dispatchTouchEvent method calls super.dispatchTouchEvent(event), it is delegated to the parent class (View class) to handle the distribution of touch events, that is, in the View control class view, rewrite onTouchEvent; X6. In the View control class view, override onTouchEvent; onTouchEvent is a method of the View class in the Android system, which is used to handle touch events. If the onTouchEvent method is rewritten and returns true, it means that the View has processed the incoming touch event, and the touch ends; if the onTouchEvent method is rewritten and returns super.onTouchEvent(event), then in the ViewGroup container class view, override onTouchEvent; X7. In the ViewGroup container class view, override onTouchEvent, that is, in the same ViewGroup, handle the intercepted touch events by overriding the onTouchEvent method. If the overridden onTouchEvent method returns true, it means that the ViewGroup has handled the incoming touch event and the touch ends; if the overridden onTouchEvent method calls super.onTouchEvent, then on the Activity page, override onTouchEvent; X8. On the Activity page, override onTouchEvent, that is, allow the touch events occurring on the Activity page to be handled; X9. The touch ends.
[0022] In the embodiment of the present invention, when a user inputs a gesture through a touch screen of an electronic device, the trajectory information of the gesture is obtained, and then a preset function is called to identify the trajectory information to obtain a recognition result.
[0023] Step 102: Call a preset function to identify the trajectory information and obtain an identification result.
[0024] In some embodiments, the preset function is a custom function, and the preset function is used to determine whether the user's gesture is a preset gesture. The preset function can be used to recognize the trajectory information of the gesture.
[0025] In an embodiment of the present invention, the trajectory information is identified by calling a preset function to obtain a recognition result, and then when the recognition result indicates that the gesture is a preset gesture, the application package of the debugging mode of the electronic device is started through a preset interface to turn on the debugging mode.
[0026] Step 103: when the recognition result indicates that the gesture is a preset gesture, start the application package of the debugging mode of the electronic device through a preset interface to enable the debugging mode.
[0027] In some embodiments, the preset interface is an interface for an application package that calls the debug mode of an electronic device. Through the preset interface, the application package that starts the debug mode of the electronic device can be realized; the preset gesture is a pre-set graphic representing the gesture, and the preset gesture is used to start the application package of the debug mode of the electronic device.
[0028] When the recognition result indicates that the gesture is a non-preset gesture, the operation of starting the application package of the debugging mode of the electronic device through the preset interface is not performed.
[0029] In the embodiment of the present invention, when the recognition result indicates that the gesture is a preset gesture, the application package of the debugging mode of the electronic device is started through a preset interface, thereby realizing starting the debugging mode through a gesture.
[0030] To sum up, in an embodiment of the present invention, when a user inputs a gesture through the touch screen of an electronic device, the trajectory information of the gesture is obtained, and then a preset function is called to identify the trajectory information to obtain a recognition result, and then when the recognition result characterizes that the gesture is a preset gesture, the application package of the debugging mode of the electronic device is started through a preset interface to turn on the debugging mode, thereby avoiding the failure of turning on the debugging mode due to abnormal display of the touch screen of the electronic device, and improving the success rate of turning on the debugging mode.
[0031] Figure 2 is a specific step flow chart of the method for starting the debugging mode provided by an embodiment of the present invention, such as Figure 2 As shown, the method may include: Step 201: When the display of the touch screen is abnormal and the user inputs the gesture through the touch screen, the trajectory information is obtained.
[0032] In some embodiments, the display abnormality of the touch screen includes the touch screen displaying a black screen, the touch screen displaying an abnormal image, etc.
[0033] In some embodiments, when the display of the touch screen is normal and the user inputs a gesture through the touch screen, a recognition operation is not performed to determine whether the user's gesture is a preset gesture through a preset function, so as to avoid accidentally turning on the debugging mode when the user touches the operating system of the electronic device on the touch screen.
[0034] In the embodiment of the present invention, when the display of the touch screen is abnormal and the user inputs a gesture through the touch screen, the trajectory information is obtained, and then a preset function is called to identify the trajectory information and obtain a recognition result.
[0035] Step 202: Call a preset function to identify the trajectory information and obtain an identification result.
[0036] The implementation of this step is similar to the implementation process in the above step 102, and will not be repeated here.
[0037] Optionally, in some embodiments, the preset function is GestureDetector.
[0038] GestureDetector is a class in the Android framework that detects and processes touch events in order to identify specific gestures. It provides a simple way to handle complex gestures, such as swipe, long press, double tap, etc., without requiring developers to directly handle the underlying MotionEvent event.
[0039] In the embodiment of the present invention, by calling GestureDetector, it is possible to recognize the user's gesture in an electronic device installed with an Android system and determine whether the user's gesture is a preset gesture.
[0040] Optionally, in some embodiments, the identifying the trajectory information and obtaining the identification result includes the following sub-steps: Sub-step 2021: generating a first shape of the gesture according to the trajectory information.
[0041] In some embodiments, the trajectory information of the gesture is the coordinate information of each touch point in the process of the user's movement of the limbs (such as fingers) on the touch screen to form a shape, and the first shape of the gesture is generated according to the coordinate information of each touch point.
[0042] In the embodiment of the present invention, a first shape of a gesture is generated according to the trajectory information, and when the first shape is the same as a second shape of a preset gesture, it is determined that the recognition result represents that the gesture is a preset gesture.
[0043] Sub-step 2022: When the first shape is the same as the second shape of the preset gesture, determine that the recognition result represents that the gesture is the preset gesture.
[0044] In an embodiment of the present invention, when the first shape is the same as the second shape of the preset gesture, it is determined that the recognition result represents the gesture as the preset gesture, and then when the recognition result represents the gesture as the preset gesture, the application package of the debugging mode of the electronic device is started through the preset interface to turn on the debugging mode.
[0045] By executing sub-steps 2021 to 2022, the trajectory information can be identified to obtain an identification result.
[0046] Step 203: When the recognition result indicates that the gesture is a preset gesture, start the application package of the debugging mode of the electronic device through a preset interface to enable the debugging mode.
[0047] The implementation of this step is similar to the implementation process in the above step 103, and will not be repeated here.
[0048] Optionally, in some embodiments, the preset interface is an Intent object.
[0049] The Intent object is a messaging object in the Android system that allows communication between different components (such as activities, services, broadcast receivers, etc.); the Intent object can be seen as a request or a notification, which describes the action to be performed (Action), the data to be operated (Data), and possible additional information (Extras).
[0050] By calling the Intent object, the ADB application package is started according to the ADB package name and class name, thereby starting the ADB mode.
[0051] In the embodiment of the present invention, the Intent object can be used to call the application package of the debugging mode of the electronic device in the Android system to turn on the debugging mode.
[0052] Optionally, in some embodiments, the second shape is a V-shape, and the method further comprises the following steps: Step 204: When the first shape includes a first line segment and a second line segment, and the end point of the first line segment coincides with the starting point of the second line segment, and the angle between the first line segment and the second line segment is less than a first angle threshold, determine that the first shape is the same as the second shape.
[0053] In some embodiments, when the first shape includes a first line segment and a second line segment, and the end point of the first line segment coincides with the starting point of the second line segment, and the angle between the first line segment and the second line segment is less than a first angle threshold, the first shape is determined to be a V-shape, and since the second shape is a V-shape, the first shape is determined to be the same as the second shape.
[0054] In some embodiments, the first angle threshold may be 90 degrees.
[0055] In an embodiment of the present invention, when the first shape includes a first line segment and a second line segment, the end point of the first line segment coincides with the starting point of the second line segment, and the angle between the first line segment and the second line segment is less than a first angle threshold, it is determined that the first shape is the same as the second shape of the preset gesture, and then when the first shape is the same as the second shape of the preset gesture, it is determined that the recognition result represents the gesture as the preset gesture.
[0056] Optionally, in some embodiments, the second shape is a W shape, and the method further comprises the following steps: Step 205: When the first shape includes a third line segment, a fourth line segment, a fifth line segment and a sixth line segment, and the end point of the third line segment coincides with the starting point of the fourth line segment, the end point of the fourth line segment coincides with the starting point of the fifth line segment, the end point of the fifth line segment coincides with the starting point of the sixth line segment, and the angle between the third line segment and the fourth line segment is less than a second angle threshold, the angle between the fourth line segment and the fifth line segment is less than a third angle threshold, and the angle between the fifth line segment and the sixth line segment is less than a fourth angle threshold, determine that the first shape is the same as the second shape.
[0057] In some embodiments, when the first shape includes a third line segment, a fourth line segment, a fifth line segment and a sixth line segment, and the endpoint of the third line segment coincides with the starting point of the fourth line segment, the endpoint of the fourth line segment coincides with the starting point of the fifth line segment, the endpoint of the fifth line segment coincides with the starting point of the sixth line segment, and the angle between the third line segment and the fourth line segment is less than a second angle threshold, the angle between the fourth line segment and the fifth line segment is less than a third angle threshold, and the angle between the fifth line segment and the sixth line segment is less than a fourth angle threshold, the first shape is determined to be a V-shape, and since the second shape is a V-shape, the first shape is determined to be the same as the second shape.
[0058] In some embodiments, the second angle threshold, the third angle threshold, and the fourth angle threshold are all 90 degrees.
[0059] In an embodiment of the present invention, when the first shape includes a third line segment, a fourth line segment, a fifth line segment and a sixth line segment, and the end point of the third line segment coincides with the starting point of the fourth line segment, the end point of the fourth line segment coincides with the starting point of the fifth line segment, the end point of the fifth line segment coincides with the starting point of the sixth line segment, and the angle between the third line segment and the fourth line segment is less than the second angle threshold, the angle between the fourth line segment and the fifth line segment is less than the third angle threshold, and the angle between the fifth line segment and the sixth line segment is less than the fourth angle threshold, it is determined that the first shape is the same as the second shape of the preset gesture, and then when the first shape is the same as the second shape of the preset gesture, it is determined that the recognition result characterizing the gesture is the preset gesture.
[0060] Optionally, in some embodiments, after step 203, the method further includes the following steps: Step 206: Obtain the log of the electronic device through the interactive interface of the debugging mode.
[0061] For example, the electronic device is a vehicle computer. After the debugging mode of the vehicle computer is turned on, the user can access the vehicle computer through a wired or wireless connection and capture logs through the interactive interface of the debugging mode.
[0062] In the embodiment of the present invention, the log of the electronic device is obtained through the interactive interface of the debugging mode, so that the staff can analyze the log and learn the abnormal situation of the electronic device.
[0063] In some embodiments, by calling a preset function, other gestures other than preset gestures such as a tap gesture, a long press gesture, a scroll gesture, a scale gesture, and a fling gesture can also be recognized, where a tap gesture is when the user quickly taps the screen once; a long press gesture is when the user presses and holds the screen for a long time; a scroll gesture is when the user presses and holds the finger on the screen and moves the finger; a scale gesture is when the user uses two fingers to zoom in or out on the screen at the same time; and a fling gesture is when the user presses and holds the finger on the screen and quickly slides the finger.
[0064] Optional, see Figure 4 In some embodiments, the debugging mode activation process includes: Y1, identifying the touch screen, that is, identifying the user input gesture through the touch screen of the electronic device; Y2, resetting the starting point and the ending point, that is, clearing the coordinate information of the starting point and the coordinate information of the end point of the gesture trajectory; Y3, starting to recognize the gesture, that is, calling the preset function, recognizing the trajectory information, and obtaining the recognition result; Y4, identifying whether the gesture is a preset gesture; Y5, identifying whether the gesture is a long press gesture; Y6, identifying whether the gesture is a zoom gesture; Y7, identifying whether the gesture is a single click gesture; Y8, identifying whether the gesture is a sliding gesture; Y9, identifying whether the gesture is a gesture of moving immediately after pressing; Y10, returning an error result, that is, the recognition result characterizes that the gesture is a non-preset gesture, and the operation of starting the debugging mode application package of the electronic device through the preset interface is not performed at this time; Y11, when the first shape of the gesture is the same as the second shape of the preset gesture, the return result is correct, that is, when the first shape is the same as the second shape of the preset gesture, it is determined that the recognition result characterizes that the gesture is a preset gesture; Y12, through the preset interface, the debugging mode application package of the electronic device is started to start the debugging mode.
[0065] Optional, see Figure 5In some embodiments, the debugging mode activation process includes: Z1. The touch screen displays abnormally, that is, when the touch screen displays abnormally, proceed to the next step; Z2. Whether the debugging mode is activated, that is, judging whether the debugging mode is activated; Z3. When the user inputs a gesture through the touch screen of the electronic device, obtaining the trajectory information of the gesture; Z4. Judging whether the gesture is a preset gesture; Z5. The debugging mode fails to be activated, that is, when the gesture is a non-preset gesture, the operation of starting the application package of the debugging mode of the electronic device through the preset interface is not performed at this time; Z6. Through the preset interface, the application package of the debugging mode of the electronic device is activated to activate the debugging mode, that is, when the gesture is a preset gesture, the application package of the debugging mode of the electronic device is activated through the preset interface to activate the debugging mode; Z7. Capturing logs or debugging analysis, that is, obtaining the logs of the electronic device through the interactive interface of the debugging mode, or providing the user with debugging and analysis of the electronic device through the interactive interface of the debugging mode.
[0066] In the related art, when the touch screen display of the vehicle computer is abnormal, the user needs to disassemble the vehicle to expose the debugging interface of the vehicle computer, and then use a serial port cable to connect the vehicle computer to start the debugging mode of the vehicle computer. The operation is cumbersome and the work efficiency is low; or the user restarts the vehicle computer to try to make the touch screen display normal, and then starts the debugging mode by touching the operating system of the vehicle computer, but there is a risk of losing the log of the abnormal touch screen display.
[0067] In an embodiment of the present invention, when a user inputs a gesture through the touch screen of an electronic device, the trajectory information of the gesture is obtained, and then a preset function is called to identify the trajectory information to obtain a recognition result. Then, when the recognition result characterizes that the gesture is a preset gesture, an application package of the debugging mode of the electronic device is started through a preset interface to turn on the debugging mode. The operation is simple, the work efficiency is improved, and the risk of losing the log of abnormal touch screen display due to restarting the vehicle computer is reduced.
[0068] In the related art, the user opens the settings application on the electronic device, selects the system, clicks the system version number nine times, enters the engineering mode application, clicks ADB and enters the password to start the ADB mode (ie, debugging mode). The operation is cumbersome and the efficiency of starting the debugging mode is low.
[0069] In an embodiment of the present invention, when a user inputs a gesture through the touch screen of an electronic device, the trajectory information of the gesture is obtained, and then a preset function is called to recognize the trajectory information to obtain a recognition result. Then, when the recognition result characterizes that the gesture is a preset gesture, the application package of the debugging mode of the electronic device is started through a preset interface to turn on the debugging mode. The operation is simple and the efficiency of turning on the debugging mode is improved.
[0070] To sum up, in an embodiment of the present invention, when a user inputs a gesture through the touch screen of an electronic device, the trajectory information of the gesture is obtained, and then a preset function is called to identify the trajectory information to obtain a recognition result, and then when the recognition result characterizes that the gesture is a preset gesture, the application package of the debugging mode of the electronic device is started through a preset interface to turn on the debugging mode, thereby avoiding the failure of turning on the debugging mode due to abnormal display of the touch screen of the electronic device, and improving the success rate of turning on the debugging mode.
[0071] Figure 6 is a block diagram of a device for starting a debugging mode provided by an embodiment of the present invention, such as Figure 6 As shown, the device 300 includes: The acquisition module 301 is used to acquire the trajectory information of the gesture when the user inputs the gesture through the touch screen of the electronic device; The recognition module 302 is used to call a preset function to recognize the trajectory information and obtain a recognition result; The processing module 303 is used to start the application package of the debugging mode of the electronic device through a preset interface to enable the debugging mode when the recognition result indicates that the gesture is a preset gesture.
[0072] Optionally, the identification module 302 specifically includes: A generating submodule, configured to generate a first shape of the gesture according to the trajectory information; The determination submodule is configured to determine, when the first shape is the same as the second shape of the preset gesture, that the recognition result represents that the gesture is the preset gesture.
[0073] Optionally, the second shape is a V-shape, and the device 300 further includes: The first determination module is used to determine that the first shape is the same as the second shape when the first shape includes a first line segment and a second line segment, the end point of the first line segment coincides with the starting point of the second line segment, and the angle between the first line segment and the second line segment is less than a first angle threshold.
[0074] Optionally, the second shape is a W shape, and the device 300 further includes: The second determination module is used to determine that the first shape is the same as the second shape when the first shape includes a third line segment, a fourth line segment, a fifth line segment and a sixth line segment, and the end point of the third line segment coincides with the starting point of the fourth line segment, the end point of the fourth line segment coincides with the starting point of the fifth line segment, the end point of the fifth line segment coincides with the starting point of the sixth line segment, and the angle between the third line segment and the fourth line segment is less than a second angle threshold, the angle between the fourth line segment and the fifth line segment is less than a third angle threshold, and the angle between the fifth line segment and the sixth line segment is less than a fourth angle threshold.
[0075] Optionally, the acquisition module 301 specifically includes: The acquisition submodule is used to acquire the trajectory information when the display of the touch screen is abnormal and the user inputs the gesture through the touch screen.
[0076] Optionally, the device 300 further includes: The log acquisition module is used to acquire the log of the electronic device through the interactive interface of the debugging mode.
[0077] Optionally, the preset function is GestureDetector, and the preset interface is an Intent object.
[0078] The debugging mode activation device in the embodiment of the present invention may be a device, or a component, integrated circuit, or chip in a terminal. The device may be a mobile electronic device or a non-mobile electronic device. Exemplarily, the mobile electronic device may be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), etc., and the non-mobile electronic device may be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), a teller machine, or a self-service machine, etc., which is not specifically limited in the embodiment of the present invention.
[0079] The debugging mode activation device in the embodiment of the present invention may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present invention.
[0080] The debugging mode activation device provided in the embodiment of the present invention can realize Figure 1In order to avoid repetition, the various processes implemented by the debugging mode activation device in the method embodiment will not be described here.
[0081] In an embodiment of the present invention, when a user inputs a gesture through the touch screen of an electronic device, trajectory information of the gesture is obtained, a preset function is called to identify the trajectory information, and an identification result is obtained. Then, when the identification result characterizes that the gesture is a preset gesture, an application package of the debugging mode of the electronic device is started through a preset interface to turn on the debugging mode, thereby avoiding failure to turn on the debugging mode due to abnormal display of the touch screen of the electronic device, and improving the success rate of turning on the debugging mode.
[0082] Optionally, an embodiment of the present invention further provides an electronic device, including a processor, a memory, and a program or instruction stored in the memory and executable on the processor. When the program or instruction is executed by the processor, each process of the above-mentioned debugging mode activation method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.
[0083] It should be noted that the electronic devices in the embodiments of the present invention include the mobile electronic devices and non-mobile electronic devices mentioned above.
[0084] Figure 7 The present invention is a schematic diagram of the hardware structure of an electronic device.
[0085] The electronic device 400 includes but is not limited to components such as a radio frequency unit 401 , a network module 402 , an audio output unit 403 , an input unit 404 , a sensor 405 , a display unit 406 , a user input unit 407 , an interface unit 408 , a memory 409 , and a processor 410 .
[0086] Those skilled in the art will appreciate that the electronic device 400 may also include a power source (such as a battery) for supplying power to various components, and the power source may be logically connected to the processor 410 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Figure 7 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.
[0087] The processor 410 is used to obtain the trajectory information of the gesture when the user inputs the gesture through the touch screen of the electronic device; Calling a preset function to identify the trajectory information and obtain an identification result; When the recognition result indicates that the gesture is a preset gesture, an application package of the debugging mode of the electronic device is started through a preset interface to enable the debugging mode.
[0088] In an embodiment of the present invention, when a user inputs a gesture through the touch screen of an electronic device, trajectory information of the gesture is obtained, a preset function is called to identify the trajectory information, and an identification result is obtained. Then, when the identification result characterizes that the gesture is a preset gesture, an application package of the debugging mode of the electronic device is started through a preset interface to turn on the debugging mode, thereby avoiding failure to turn on the debugging mode due to abnormal display of the touch screen of the electronic device, and improving the success rate of turning on the debugging mode.
[0089] Optionally, the processor 410 is further configured to generate a first shape of the gesture according to the trajectory information; and when the first shape is the same as a second shape of the preset gesture, determine that the recognition result represents that the gesture is the preset gesture.
[0090] Optionally, the processor 410 is further used to determine that the first shape is the same as the second shape when the first shape includes a first line segment and a second line segment, the end point of the first line segment coincides with the starting point of the second line segment, and the angle between the first line segment and the second line segment is less than a first angle threshold.
[0091] Optionally, the processor 410 is further used to determine that the first shape is the same as the second shape when the first shape includes a third line segment, a fourth line segment, a fifth line segment and a sixth line segment, and the end point of the third line segment coincides with the starting point of the fourth line segment, the end point of the fourth line segment coincides with the starting point of the fifth line segment, the end point of the fifth line segment coincides with the starting point of the sixth line segment, and the angle between the third line segment and the fourth line segment is less than a second angle threshold, the angle between the fourth line segment and the fifth line segment is less than a third angle threshold, and the angle between the fifth line segment and the sixth line segment is less than a fourth angle threshold.
[0092] Optionally, the processor 410 is further configured to obtain the trajectory information when the display of the touch screen is abnormal and the user inputs the gesture through the touch screen.
[0093] Optionally, the processor 410 is further configured to obtain a log of the electronic device through the interactive interface of the debugging mode.
[0094] Optionally, the preset function is GestureDetector, and the preset interface is an Intent object.
[0095] In an embodiment of the present invention, when the range extender of the vehicle is started, a first battery temperature of the battery of the vehicle is obtained, and then the matching power generation power of the range extender is determined according to the first battery temperature, and then the power generation power of the range extender is adjusted from the preset initial power generation power to the matching power generation power. Since the first battery temperature is negatively correlated with the matching power generation power, a smaller matching power generation power is selected as the power generation power of the range extender for a higher first battery temperature (i.e., the initial temperature of the battery), so that the heat generated by the components in the range extender is less, and the amount of increase in the battery temperature is smaller, so that the temperature of the batteries with different initial temperatures after the increase is less than the temperature threshold, so as to avoid excessive temperature increase of the battery causing overheating damage to the battery.
[0096] It should be understood that in the embodiment of the present invention, the input unit 404 may include a graphics processor 4041 (Graphics Processing Unit, GPU) and a microphone 4042, and the graphics processor 4041 processes the image data of the static picture or video obtained by the image capture device (such as a camera) in the video capture mode or the image capture mode. The display unit 406 may include a display panel 4061, and the display panel 4061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 407 includes a touch panel 4071 and at least one of other input devices 4072. The touch panel 4071 is also called a touch screen. The touch panel 4071 may include two parts: a touch detection device and a touch controller. Other input devices 4072 may include, but are not limited to, a physical keyboard, function keys (such as a volume control key, a switch key, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.
[0097] The memory 409 can be used to store software programs and various data. The memory 409 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 409 may include a volatile memory or a non-volatile memory, or the memory 409 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory 409 in the embodiment of the present invention includes but is not limited to these and any other suitable types of memory.
[0098] The processor 410 may include one or more processing units; optionally, the processor 410 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor 410.
[0099] An embodiment of the present invention also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the embodiment of the method for enabling the debugging mode described above is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.
[0100] The processor is a processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0101] An embodiment of the present invention further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned debugging mode activation method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0102] It should be understood that the chip mentioned in the embodiment of the present invention may also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0103] An embodiment of the present invention further provides a vehicle, including the aforementioned device for starting the debugging mode, or including the aforementioned electronic device, or including the aforementioned readable storage medium.
[0104] The specific implementation process is similar to the aforementioned implementation process and will not be repeated here.
[0105] In an embodiment of the present invention, when a user inputs a gesture through the touch screen of an electronic device, trajectory information of the gesture is obtained, a preset function is called to identify the trajectory information, and an identification result is obtained. Then, when the identification result characterizes that the gesture is a preset gesture, an application package of the debugging mode of the electronic device is started through a preset interface to turn on the debugging mode, thereby avoiding failure to turn on the debugging mode due to abnormal display of the touch screen of the electronic device, and improving the success rate of turning on the debugging mode.
[0106] It should be noted that, in this article, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the method and device in the embodiment of the present invention is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0107] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0108] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation modes, which are merely illustrative rather than restrictive. Under the guidance of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the present invention and the claims, all of which are within the protection of the present invention.
Claims
1. A method for starting a debugging mode, characterized in that: The method comprises: When a user inputs a gesture through a touch screen of an electronic device, obtaining trajectory information of the gesture; Calling a preset function to identify the trajectory information and obtain an identification result; When the recognition result indicates that the gesture is a preset gesture, an application package of the debugging mode of the electronic device is started through a preset interface to enable the debugging mode.
2. The method according to claim 1, characterized in that The identifying the trajectory information and obtaining the identification result includes: generating a first shape of the gesture according to the trajectory information; In a case where the first shape is identical to the second shape of the preset gesture, it is determined that the recognition result represents that the gesture is the preset gesture.
3. The method according to claim 2, characterized in that The second shape is a V-shape, and the method further comprises: When the first shape includes a first line segment and a second line segment, the end point of the first line segment coincides with the starting point of the second line segment, and the angle between the first line segment and the second line segment is less than a first angle threshold, it is determined that the first shape is the same as the second shape.
4. The method according to claim 2, characterized in that: The second shape is a W shape, and the method further comprises: When the first shape includes a third line segment, a fourth line segment, a fifth line segment and a sixth line segment, and the end point of the third line segment coincides with the starting point of the fourth line segment, the end point of the fourth line segment coincides with the starting point of the fifth line segment, the end point of the fifth line segment coincides with the starting point of the sixth line segment, and the angle between the third line segment and the fourth line segment is less than a second angle threshold, the angle between the fourth line segment and the fifth line segment is less than a third angle threshold, and the angle between the fifth line segment and the sixth line segment is less than a fourth angle threshold, it is determined that the first shape is the same as the second shape.
5. The method according to claim 1, characterized in that When a user inputs a gesture through a touch screen of an electronic device, obtaining the trajectory information of the gesture includes: When the display of the touch screen is abnormal and the user inputs the gesture through the touch screen, the trajectory information is acquired.
6. The method according to claim 1, characterized in that In the case where the recognition result indicates that the gesture is a preset gesture, after starting the application package of the debugging mode of the electronic device through a preset interface to turn on the debugging mode, the method further includes: The log of the electronic device is obtained through the interactive interface of the debugging mode.
7. The method according to claim 1, characterized in that The preset function is GestureDetector, and the preset interface is Intent object.
8. A device for starting a debugging mode, characterized in that: The device comprises: An acquisition module, used for acquiring trajectory information of a gesture when a user inputs a gesture through a touch screen of an electronic device; The recognition module is used to call a preset function to recognize the trajectory information and obtain a recognition result; The processing module is used to start the application package of the debugging mode of the electronic device through a preset interface to enable the debugging mode when the recognition result indicates that the gesture is a preset gesture.
9. An electronic device, characterized in that: The method comprises a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the method for enabling the debugging mode as described in any one of claims 1 to 7.
10. A readable storage medium, characterized in that: The readable storage medium stores a program or an instruction, and when the program or the instruction is executed by the processor, the steps of the method for starting the debugging mode as described in any one of claims 1 to 7 are implemented.
11. A vehicle, characterized in that: Includes the debugging mode activation device as claimed in claim 8, or includes the electronic device as claimed in claim 9, or includes the readable storage medium as claimed in claim 10.
Citation Information
Patent Citations
Debugging bridge adb function enabling method, mobile terminal and computer readable medium
CN107329865A
Blank screen gesture responding method and device, storage medium and mobile terminal
CN107450837A
Apparatus, systems, and methods for display content control at electronic user devices
US20220107774A1
Vibration driving method and apparatus, and electronic device and computer readable medium
WO2021081710A1