Method for detecting direction of stylus pen tip, electronic device and stylus pen
By receiving and calculating the acceleration information of the stylus, the electronic device can accurately determine the pen tip direction, solving the problem of being unable to identify the pen tip orientation in the existing technology and improving the user experience.
Patent Information
- Application Number
- CN202311243500.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-02
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2041-11-02
AI Technical Summary
Existing electronic devices cannot accurately detect the direction of the stylus tip, resulting in the inability to identify the actual direction of the pen tip during the adsorption and pairing process, affecting the user experience.
By receiving the acceleration information sent by the stylus and combining it with the acceleration sensor data of the electronic device itself, the relative value of the acceleration is calculated to determine the actual direction of the stylus tip and match the corresponding picture display.
It achieves accurate judgment of the direction of the stylus tip, enriches the picture content of the prompt window, and improves the user experience.
Smart Images

Figure CN117707349B
Abstract
Description
Technical Field
[0001] The present application relates to the field of electronic technology, and in particular to a method for detecting the direction of a stylus pen tip, an electronic device, and a stylus pen. Background Art
[0002] With the development of electronic devices, the functions of electronic devices are becoming more and more abundant, almost meeting the usage needs of users in different scenarios. For example, users can use electronic devices to take notes in daily meetings, video learning and other scenarios, thereby meeting the user's recording needs.
[0003] When users take notes through electronic devices, many people may still be keen on using traditional paper and pen. In order to bring users the traditional writing experience of paper and pen, many electronic devices are currently equipped with corresponding "stylus pens", such as Huawei's stylus (HUAWEI M-pencil). For example, taking a tablet device as an example, when the user does not need to use the stylus, the stylus can be adsorbed on the tablet device; when the user uses the stylus, the tablet device can turn on Bluetooth, search for available devices, and establish pairing and connection between the tablet device and the stylus.
[0004] In a possible implementation, during the adsorption and pairing process between the stylus and the tablet device, a prompt window may automatically pop up on the display screen of the tablet device, and the prompt window may include a picture of the stylus and / or prompt information, etc. The prompt window may remind the user that the stylus is detected to be in an adsorption state, or the stylus requests to establish a Bluetooth connection with the tablet device, etc. In the above implementation, the tablet device cannot detect and identify the direction of the stylus tip, and only displays a preset picture of the stylus in the prompt window. The picture of the stylus is fixed and single, and cannot be combined with the user's specific usage, usage habits, etc., and cannot obtain and match the actual direction of the stylus tip to display a suitable picture to the user, which affects the user's usage experience.
[0005] In another possible implementation, when the tablet device and the stylus are paired for the first time, the tablet device can save the device information and Bluetooth connection information of the stylus. During subsequent use, if the tablet device and the stylus are paired again, the tablet device will no longer pop up a prompt window and will no longer display the stylus image. This implementation cannot display the adsorption status and pairing status of the stylus to the user in a timely manner, which will also affect the user's experience. Summary of the invention
[0006] The present application provides a method for detecting the direction of a stylus pen tip, an electronic device, and a stylus. The method can accurately determine the actual orientation of the stylus pen tip, thereby avoiding the problem that the electronic device cannot identify the direction when the stylus pen is adsorbed on the electronic device. A stylus image that is consistent with the actual direction of the stylus pen tip can be displayed in a prompt window, thereby enriching pop-up images in the prompt window on the electronic device and improving the user experience.
[0007] In a first aspect, a method for detecting the direction of a stylus tip is provided, which is applied to an electronic device including a display screen, and the electronic device can support the stylus as an input device of the electronic device, and the method comprises: when the stylus is adsorbed to a preset position of a target frame of the electronic device, receiving information sent by the stylus including acceleration of the stylus in a first axis direction, acceleration in a second axis direction, and acceleration in a third axis direction, wherein the first axis is parallel to the target frame, the second axis is parallel to an adjacent frame of the target frame, and the third axis is perpendicular to a plane defined by the first axis and the second axis; obtaining Take the acceleration of the electronic device in the direction of the first axis, the acceleration in the direction of the second axis, and the acceleration in the direction of the third axis; calculate the relative values of the acceleration of the stylus pen and the acceleration of the electronic device in the direction of the first axis, the direction of the second axis, and the direction of the third axis, and determine the actual direction of the stylus pen tip; determine the target image of the stylus pen according to the actual direction of the stylus pen tip, and the direction of the stylus pen tip displayed in the target image of the stylus pen is the same as the actual direction of the stylus pen tip; display a prompt window on the display screen, and the target image of the stylus pen is displayed in the prompt window. It should be understood that in this article, "the direction of the stylus pen tip displayed in the target image of the stylus pen is the same as the actual direction of the stylus pen tip", including the situation that the direction of the stylus pen tip displayed in the target image of the stylus pen is exactly the same as the actual direction of the stylus pen tip, and also includes the situation that the direction of the stylus pen tip displayed in the target image of the stylus pen is not exactly the same as the actual direction of the stylus pen tip, such as the situation that there are some deviations. As an implementation method, as long as the general direction remains consistent.
[0008] Optionally, the acceleration may be measured by any possible sensor such as an acceleration sensor, a gyroscope, a magnetometer (M-sensor), an inertial measurement unit (IMU), etc., which is not limited in the embodiments of the present application.
[0009] Through the above method, when the stylus is adsorbed on the frame of the electronic device, the electronic device can receive the acceleration value of the pen end acceleration sensor in the direction of each coordinate axis sent by the stylus, and the electronic device determines the actual direction of the stylus tip based on the relative value between the acceleration value of the stylus in the direction of each coordinate axis and the acceleration value output by the electronic device's own acceleration sensor, so that the electronic device can match the target image for the current stylus according to the actual direction of the stylus tip.
[0010] In the above implementation process, when the stylus is adsorbed on the frame of the electronic device and paired with the electronic device, the electronic device can accurately determine the actual direction of the stylus tip, avoiding the problem that the electronic device cannot identify the direction of the stylus tip when the stylus is adsorbed; in addition, when the electronic device displays the stylus picture in a pop-up window, it can select a picture that matches the actual direction of the stylus tip, instead of displaying a single preset picture with a unique direction of the pen tip, which enriches the content and types of pop-up pictures and greatly improves the user experience when using the stylus.
[0011] In combination with the first aspect, in some implementations of the first aspect, the calculating the relative values of the acceleration of the stylus pen and the acceleration of the electronic device in the first axis direction, the second axis direction, and the third axis direction, and determining the actual direction of the stylus pen tip includes: determining the difference between the acceleration of the stylus pen and the acceleration of the electronic device in the first axis direction, the second axis direction, and the third axis direction as the relative value of the acceleration of the stylus pen and the acceleration of the electronic device; when the relative values of the acceleration of the stylus pen and the acceleration of the electronic device in the first axis direction, the second axis direction, and the third axis direction are all 0, determining the actual direction of the stylus pen tip to be the first axis direction; when the relative values of the acceleration of the stylus pen and the acceleration of the electronic device in the first axis direction and the third axis direction are not 0, determining the actual direction of the stylus pen tip to be the opposite direction of the first axis direction.
[0012] For example, taking a tablet device as an example, when the stylus is adsorbed on the long frame of the tablet device, the first axis may be parallel to the long frame of the tablet device, the second axis may be parallel to the short frame of the tablet device, and the third axis may be perpendicular to the plane where the display screen of the tablet device is located, that is, "the third axis is perpendicular to the plane determined by the first axis and the second axis."
[0013] It should be understood that the accelerometer of the tablet device and the accelerometer of the stylus can both be three-axis sensors, which can be respectively referred to as "three-axis sensor of the tablet device" and "three-axis sensor at the tip of the stylus". The embodiments of the present application do not limit the type of accelerometer.
[0014] It should also be understood that for the tablet device and the stylus, the installation position of the acceleration sensor is fixed, that is, the coordinate system corresponding to the acceleration value obtained by the acceleration sensor during operation is also fixed. Then, in the actual use of the tablet device, no matter how the tablet device is placed, such as horizontal placement, tilted placement, inverted placement, etc., after the stylus is adsorbed to the long frame of the tablet device, the position of the tablet device and the stylus is relatively fixed, that is, the position of the acceleration sensor of the tablet device and the acceleration sensor of the stylus is also relatively fixed. In other words, the magnitude of the acceleration in each direction of the coordinate axis is also fixed, that is, the first axis direction, the second axis direction, and the third axis direction are all fixed. Therefore, the actual direction of the stylus tip can be determined by the relative value of the acceleration in each direction.
[0015] For example, in the embodiment of the present application, the "relative value of acceleration in each direction" can be understood as: the difference between the acceleration value of the tablet device and the acceleration value of the stylus in that direction. Optionally, the difference (i.e., the "relative value" of the acceleration in that direction) may be a positive number, a negative number, or 0, and the tablet device can determine the actual direction of the stylus tip based on the relative value of acceleration in each direction.
[0016] For example, if the relative value of the acceleration in each axis direction is 0 only in one direction, and the relative values of the acceleration in two directions are not 0 and the numerical value of the relative value is twice the numerical value of the acceleration, then the tablet device can determine that the directions of the acceleration in the two directions are opposite, then the actual direction of the stylus tip is parallel to the long border and changes to the opposite direction of the original first axis direction.
[0017] Through the above process, the electronic device can determine the actual direction of the stylus tip based on the relative value between the acceleration value of the stylus tip acceleration sensor and the acceleration value output by the electronic device's own acceleration sensor in the direction of each coordinate axis, and can further match the target image for the current stylus based on the actual direction of the stylus tip.
[0018] In a possible implementation, the electronic device may locally store a stylus image library, which may include multiple stylus images of different manufacturers, different models, different styles, different types, and different pen tip orientations. In other words, styluses of different manufacturers and different models are configured with multiple different images to form a stylus image library, and the electronic device may select a matching target image.
[0019] Optionally, in the embodiment of the present application, first, the electronic device can select multiple pictures that are consistent with the manufacturer and product model of the current stylus from multiple pictures of styluses of different manufacturers and different models included in the stylus picture library according to the device information of the stylus obtained in the first stage. Secondly, the electronic device can continue to select a stylus picture that matches the actual orientation of the pen tip from multiple pictures of the stylus as the "target picture" according to the actual orientation of the pen tip determined in step 407.
[0020] It should be understood that the "target image" ultimately determined by the electronic device is an image that is consistent with the manufacturer, product model, and actual orientation of the stylus tip of the current stylus. The target image may include relevant information such as the manufacturer and product model, and this embodiment of the present application does not limit this.
[0021] In another possible implementation, after the electronic device determines the actual orientation of the stylus tip, it can send a request message to the server, where the request message is used to request the acquisition of the stylus image, and the request message carries indication information for indicating the actual orientation of the stylus tip. The server can select a stylus image that matches the actual orientation of the stylus tip from multiple stylus images in the stored stylus image resources as a "target image" based on the request message sent by the electronic device, and then return the "target image" to the electronic device. This embodiment of the present application does not limit the manner in which the electronic device acquires the target image of the stylus.
[0022] Optionally, the server may be a server corresponding to the electronic device, a server corresponding to the stylus, or a server corresponding to an application (eg, a third-party application), which is not limited in this embodiment of the present application.
[0023] Through the above method, when the electronic device displays a stylus picture in a pop-up window, it can select a picture that matches the actual direction of the stylus tip, instead of displaying a single preset picture with a unique pen tip direction; and the sources of stylus pictures are wide, which can enrich the content and types of pop-up pictures and greatly improve the user experience when using the stylus.
[0024] In combination with the first aspect and the above-mentioned implementation manners, in some implementation manners of the first aspect, the electronic device also includes one or more magnetic suction modules and multiple Hall sensors, the magnetic suction module is used to adsorb the stylus to a preset position of the target frame, and at least one Hall sensor is respectively arranged on both sides of each of the magnetic suction modules, and the method also includes: obtaining working status information of each of the multiple Hall sensors; and determining the actual direction of the stylus pen tip according to the working status information of each of the multiple Hall sensors.
[0025] It should be understood that in the embodiment of the present application, Hall sensors are installed on both the electronic device and the stylus, and the Hall sensors may be composed of Hall elements and auxiliary circuits, etc. On the one hand, the Hall sensors on the electronic device and the stylus can monitor changes in the magnetic field, and on the other hand, the Hall sensors on the electronic device and the stylus can also be used as switches to automatically control the information interaction (start sending handshake data, etc.) process between the electronic device and the stylus.
[0026] Through the above method, in another possible scenario, if the acceleration value of the accelerometer at the end of the stylus is not transmitted to the electronic device side, or the acceleration value transmission of the accelerometer at the end of the stylus fails, in an embodiment of the present application, the electronic device can also determine the actual direction of the stylus tip through the working state of the Hall sensor, so that the electronic device can match the target image for the current stylus according to the actual direction of the stylus tip.
[0027] In combination with the first aspect and the above-mentioned implementation methods, in some implementation methods of the first aspect, the prompt window is also used to display one or more of the device name, product model, manufacturer, current remaining power of the stylus, battery identification, charging progress bar, cancel control, and connection control of the stylus.
[0028] Optionally, the prompt window may also display the product model, manufacturer, etc. of the current stylus, as well as at least one of the remaining power of the current stylus, battery identification, charging progress bar, etc. The present application embodiment does not limit the content displayed in the prompt window popped up by the electronic device. The remaining power can be displayed in the form of a percentage to prompt the user the percentage of the current power of the stylus in the fully charged state. For simplicity, it will not be repeated here.
[0029] In combination with the first aspect and the above-mentioned implementation methods, in some implementation methods of the first aspect, displaying a prompt window on the display screen includes: determining a target display effect according to the actual direction of the stylus tip, and / or the acceleration of the stylus in the direction of the first axis, and / or the acceleration of the stylus in the direction of the second axis, and / or the acceleration of the stylus in the direction of the third axis, and / or the number of pictures included in the target picture of the stylus, and / or a preset plurality of pop-up effects; and displaying the prompt window on the display screen according to the target display effect.
[0030] Optionally, when the electronic device automatically pops up a prompt window, the prompt window may have different styles, different sizes, and the prompt window may have different pop-up animations, which is not limited in the embodiment of the present application.
[0031] Exemplarily, the display position of the prompt window may be determined according to a preset position of a target frame to which the stylus is adsorbed, for example, a long frame below the display screen close to where the stylus is adsorbed.
[0032] Optionally, the electronic device can also automatically adjust the size of the prompt window. For example, the prompt window can be close to the short border of the display screen and be a small vertical window; the electronic device can also adjust the layout in the prompt window, such as adjusting the size of the preset picture of the stylus, canceling the control, and connecting the control. This embodiment of the application is not limited to this.
[0033] In a possible implementation, when the electronic device is in the process of popping up a prompt window, it can also add a corresponding display effect during the process of popping up the prompt window.
[0034] Optionally, the display of the prompt window may have a static display effect, or a dynamic display effect, that is, the pop-up window process also has a dynamic playback effect.
[0035] Exemplarily, for example, the prompt window can move from top to bottom, from bottom to top, along a certain trajectory, or the prompt window can appear on the display screen in the form of blinds, diamond grids, etc. The embodiments of the present application do not limit the dynamic playback effects that the prompt window may have.
[0036] Optionally, the animation effect can match the acceleration of the stylus tip in any coordinate axis direction, for example, the prompt window can move at a certain rate on the display screen of the electronic device. Alternatively, the animation effect can match the user's usage habits, for example, the prompt window is set by the user to appear in a flashing manner, a bouncing manner, etc. Alternatively, the pop-up window process of the electronic device is presented with a plurality of possible default animation effects, which is not limited in the embodiments of the present application.
[0037] Optionally, the pop-up process can be accompanied by dynamic changes in the size, transparency, etc. of the target image of the stylus in the prompt window. For example, the size of the target image of the stylus can be enlarged as the playback window increases, or reduced as the playback window decreases. The animation effect of the pop-up process can further provide users with a coherent immersive experience and enhance the user's visual experience.
[0038] In combination with the first aspect and the above-mentioned implementation methods, in some implementation methods of the first aspect, when the target picture of the stylus pen includes multiple stylus pen pictures, the target picture of the stylus pen is displayed in the prompt window, including: according to a preset time length, each of the multiple stylus pen pictures is displayed in the prompt window in turn.
[0039] In another possible implementation, the "target image of the stylus pen" in the embodiment of the present application may be one image or multiple images. For example, when the "target image of the stylus pen" is multiple images, the multiple target images of the stylus pen may be replaced in turn during the pop-up prompt window, for example, each of the multiple images is displayed for a fixed time, so that the prompt window also has a dynamic playback display effect, which is not limited in the embodiment of the present application.
[0040] Through the above-mentioned implementation method, the embodiment of the present application can provide users with a variety of possible prompt window display effects, such as pop-up window animation, the change process of the prompt window on the display screen, the picture display effect inside the prompt window, etc., enriching the window content and improving the user's visual experience.
[0041] In combination with the first aspect and the above-mentioned implementation manners, in some implementation manners of the first aspect, the electronic device stores a stylus data set, and the stylus data set includes device information and Bluetooth information of one or more preset types of styluses that can be adapted to the electronic device, and the method further includes: receiving device information sent by the stylus, and performing device verification on the stylus according to the stylus data set and the device information; and / or receiving Bluetooth information sent by the stylus, and performing Bluetooth verification on the stylus according to the stylus data set and the Bluetooth information.
[0042] Optionally, the device information includes one or more of a device name, a product serial number, software system information, and product hardware information of the stylus, which is not limited in this embodiment of the present application.
[0043] Optionally, the Bluetooth information includes one or more of Bluetooth protocol information, wireless information, media access control address information during Bluetooth connection, and Internet Protocol address information of the stylus, which is not limited in this embodiment of the present application.
[0044] To summarize, through the method for detecting the direction of the stylus pen tip introduced in the embodiments of the present application, the stylus pen can send the acceleration value of the pen end acceleration sensor in the direction of each coordinate axis to the electronic device, and the electronic device determines the actual direction of the stylus pen tip based on the relative value between the acceleration value reported by the stylus pen and the acceleration value output by the electronic device's own acceleration sensor, thereby enabling the electronic device to match the target image for the current stylus pen according to the actual direction of the stylus pen tip.
[0045] Alternatively, if the acceleration value of the accelerometer at the end of the stylus pen is not transmitted to the electronic device side, or the acceleration value of the accelerometer at the end of the stylus pen fails to be transmitted, in an embodiment of the present application, the electronic device can also determine the actual direction of the stylus pen tip through the working state of the Hall sensor, so that the electronic device can match the target image for the current stylus pen according to the actual direction of the stylus pen tip.
[0046] In the above implementation process, when the stylus is adsorbed on the frame of the electronic device and paired with the electronic device, the electronic device can accurately determine the actual direction of the stylus tip, avoiding the problem that the electronic device cannot identify the direction of the stylus tip when the stylus is adsorbed; in addition, when the electronic device displays the stylus picture in a pop-up window, it can select a picture that matches the actual direction of the stylus tip, instead of displaying a single preset picture with a unique direction of the pen tip, which enriches the content and types of pop-up pictures and greatly improves the user experience when using the stylus.
[0047] A second aspect provides a method for detecting the direction of a stylus tip, which is applied to a stylus, and the stylus can be used as an input device of an electronic device including a display screen. The method comprises: when the distance between the stylus and the electronic device is less than or equal to a preset distance, sending device information to the electronic device, the device information comprising one or more of the device name, product serial number, software system information, and product hardware information of the stylus; receiving device verification information sent by the electronic device, and when the device verification information indicates that the stylus can adapt to the electronic device, determining the acceleration of the stylus in the first axis direction and the acceleration in the second axis direction when the stylus is adsorbed to a preset position of a target frame of the electronic device. and acceleration information in the direction of a third axis, wherein the first axis is parallel to the target frame, the second axis is parallel to the adjacent frame of the target frame, and the third axis is perpendicular to the plane defined by the first axis and the second axis; sending Bluetooth information, acceleration information of the stylus in the direction of the first axis, acceleration information of the second axis, and acceleration information of the third axis to the electronic device, wherein the Bluetooth information includes one or more of Bluetooth protocol information, wireless information, media access control MAC address information during Bluetooth connection, and Internet Protocol IP address information of the stylus; receiving Bluetooth verification information sent by the electronic device to determine whether the stylus can establish a Bluetooth connection with the electronic device.
[0048] In combination with the second aspect, in some implementations of the second aspect, the stylus includes at least one magnetic module and at least one Hall sensor, and the magnetic module is used to adsorb the stylus to a preset position of the target frame.
[0049] It should be understood that in the embodiment of the present application, both the electronic device and the stylus pen may have a wireless chip, and the wireless chip may support wireless communication within a preset distance, that is, the stylus pen can send handshake data to the electronic device based on the "wireless transparent transmission method". In the embodiment of the present application, the information sent by the stylus pen to the electronic device includes not only the device information and Bluetooth information of the stylus pen, but also the numerical information of the pen end acceleration sensor to the electronic device, and the numerical information of the pen end acceleration sensor can be used by the electronic device to determine the actual direction of the stylus pen tip.
[0050] It should be understood that the data volume of the numerical information of the accelerometer at the tip of the stylus is also extremely small, and can be combined with the Bluetooth information of the stylus to generate new information. The smaller amount of data can be transmitted to the electronic device through the existing wireless transparent transmission method without increasing the amount of wireless transparent transmission data.
[0051] The third aspect provides an electronic device, comprising: a display screen; one or more sensors selected from an acceleration sensor, an inertial sensing unit (IMU), and a gyroscope; one or more processors; one or more memories; a module with multiple applications installed; the memory stores one or more programs, and when the one or more programs are executed by the processor, the electronic device executes a method as described in any one of the first aspect and the first aspect.
[0052] A fourth aspect provides a stylus pen, which can be used as an input device for an electronic device including a display screen, and the stylus pen includes: a pen tip; one or more sensors selected from an acceleration sensor, an inertial detection unit IMU, and a gyroscope; one or more processors; one or more memories; the memories store one or more programs, and when the one or more programs are executed by the processor, the stylus pen executes the method described in any one of the second aspect and the second aspect.
[0053] A fifth aspect provides a system, comprising an electronic device and a stylus that can communicate with each other, the stylus can serve as an input device for an electronic device including a display screen, the electronic device can execute a method as described in any one of the first aspect and the implementation manner of the first aspect, and the stylus can execute a method as described in any one of the second aspect and the implementation manner of the second aspect.
[0054] The sixth aspect provides a graphical user interface system on an electronic device, wherein the electronic device has a touch screen, one or more memories, and one or more processors, wherein the one or more processors are used to execute one or more computer programs stored in the one or more memories, and the graphical user interface system includes a graphical user interface displayed by the electronic device when the electronic device executes the method as described in any one of the first aspect and the first aspect.
[0055] A seventh aspect provides a device, which is included in an electronic device, and has the function of implementing the electronic device behavior described in the first aspect and any possible implementation of the first aspect. Alternatively, the device is included in a stylus, and has the function of implementing the stylus behavior described in the second aspect and any possible implementation of the second aspect.
[0056] Optionally, the functions of the device can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules or units corresponding to the above functions. For example, a display module or unit, a detection module or unit, a processing module or unit, etc.
[0057] An eighth aspect provides a computer-readable storage medium storing computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the first aspect or any possible method of the first aspect, or executes a method that may be executed by the stylus pen as described in the second aspect or any possible method of the second aspect.
[0058] The ninth aspect provides a computer program product, which, when running on an electronic device, enables the electronic device to execute the above-mentioned first aspect or any possible method of the first aspect, or enables the electronic device to execute the method that may be executed by the stylus pen of the second aspect or any one of the second aspects. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] Figure 1 is a graphical user interface diagram of an example of a user attaching a stylus to a side frame of a tablet device.
[0060] Figure 2 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0061] Figure 3 This is a software structure block diagram of an electronic device according to an embodiment of the present application.
[0062] Figure 4 This is a schematic flowchart of a method for detecting the direction of a stylus tip provided in an embodiment of the present application.
[0063] Figure 5 It is a schematic diagram of the working principle of the acceleration sensor of the stylus pen and tablet device provided in the embodiment of the present application.
[0064] Figure 6 This is a schematic diagram of the operation of the Hall sensor when the stylus pen is attached to the side frame of a tablet device.
[0065] Figure 7 This is a schematic diagram of a pop-up window when a stylus pen is attached to a side frame of a tablet device, provided in an embodiment of the present application. DETAILED DESCRIPTION
[0066] In an embodiment of the present application, to implement the pairing and Bluetooth connection process between a tablet device, a mobile phone or other electronic device and a stylus, and to further implement operations such as a user using a stylus to take notes on the display screen of an electronic device, first, the user can follow the operation path of [Settings Application—"Accessibility" Option—"Stylus" Option—"Stylus" Control Switch] to set the "Stylus" control switch to the on (or "ON") state, so that the electronic device can receive and detect one or more operations performed by the user on the display screen of the electronic device using the stylus. The embodiments of the present application will not be repeated later.
[0067] In addition, electronic devices of different types or with different software system versions may be compatible with one or more fixed models of stylus pens. The embodiments of the present application do not limit the type of electronic device, software system version, and model of stylus pens, and assume that the type of electronic device, software system version, and model of stylus pens are compatible with each other, which will not be elaborated in subsequent embodiments.
[0068] For ease of understanding, the following will take a mutually compatible tablet device (such as Huawei's Mate Pad Pro) and a stylus (such as HUAWEI M-pencil) as an example, combined with the accompanying drawings, to specifically explain the adsorption, pairing, and Bluetooth connection process between the tablet device and the stylus.
[0069] Figure 1 The figure is a graphical user interface (GUI) diagram in which a user attaches a stylus pen to the side frame of a tablet device.
[0070] For example, Figure 1FIG. (a) shows an interface 101 displayed by the tablet device 10 in unlock mode, and the interface 101 can display multiple applications (applications, Apps), etc. Among them, the multiple applications can include clocks, calendars, galleries, memos, WeChat, music, and settings, etc. It should be understood that the interface 101 can also include more other content and more applications, for example, the interface 101 can also display more content such as the current time and date, weather components, etc., which is not limited in the embodiments of the present application.
[0071] In a possible implementation, if the user directly attaches the stylus pen 20 to the side frame of the tablet device 10 , the pairing process of the stylus pen 20 and the tablet device 10 can be triggered.
[0072] Optionally, when the user does not need to use the stylus 20, or the stylus 20 is not in a pairing state, or the remaining power of the stylus 20 is insufficient, the user can directly bring the stylus 20 close to the tablet device 10 and rely on "strong magnetic attraction" to adsorb the stylus 20 to the frame of the tablet device 10. For example, the stylus 20 can be adsorbed on the long frame of the tablet device 10.
[0073] It should be understood that the “strong magnetic attraction” can ensure the safe storage of the stylus 20. On the one hand, the “strong magnetic attraction” can trigger the pairing of the stylus 20 and the tablet device 10. On the other hand, it can also complete the magnetic charging process of the stylus 20. This embodiment of the present application will not be elaborated on this.
[0074] For example, when the tablet device 10 displays Figure 1 In the interface 101 shown in Figure (a), if the user directly adsorbs the stylus 20 to the target position of the long frame of the tablet device 10, the stylus 20 and the tablet device 10 can be triggered to pair and magnetically charge. Accordingly, in response to the adsorption process of the stylus 20 and the pairing process, a prompt window 101-1 can automatically pop up on the interface 101 of the tablet device 10, and the prompt window 101-1 can display: a preset picture of the stylus 20, the device name of the stylus 20, a "Cancel" control, a "Connect" control, etc. The user can click the "Connect" control in the prompt window 101-1 according to his or her needs to further trigger the stylus 20 and the tablet device 10 to establish a Bluetooth connection; or, in the prompt window 101-1, click the "Cancel" control to interrupt the process of establishing a Bluetooth connection between the stylus 20 and the tablet device 10. For simplicity, it will not be repeated here.
[0075] It should be noted here that no matter what interface is displayed on the display screen of the tablet device 10, for example Figure 1When the stylus pen 20 is adsorbed to the target position of the long frame of the tablet device 10, the stylus pen 20 and the tablet device 10 can be triggered to pair and the prompt window 101-1 can be automatically popped up. The embodiment of the present application does not limit the interface displayed by the tablet device 10.
[0076] For example, taking the setting application installed on the tablet device 10 as an example, when the tablet device 10 displays the following Figure 1 In the running interface 102 of the setting application shown in FIG. (b), if the user directly adsorbs the stylus pen 20 to the target position of the long frame of the tablet device 10, the stylus pen 20 and the tablet device 10 can be triggered to pair and perform magnetic charging. Accordingly, in response to the adsorption process of the stylus pen 20 and the pairing process, a prompt window 102-1 can be automatically popped up on the interface 102 of the tablet device 10, and the prompt window 102-1 can display the same content as the prompt window 101-1. For the sake of simplicity, it will not be repeated here one by one.
[0077] It should also be noted that the tablet device 10 includes at least four frames, such as two long frames and two short frames, and the stylus pen 20 can be attached to a target position of any frame of the tablet device 10. Here, the stylus pen 20 is attached to a target position of a long frame of the tablet device 10 as an example. It should be understood that the embodiment of the present application does not limit the frame to which the stylus pen 20 can be attached.
[0078] Optionally, when the user adsorbs the stylus pen 20 to a target position of the long frame of the tablet device 10 , the tip of the stylus pen 20 may face different directions, or in other words, the tip of the stylus pen 20 may have different “orientations”.
[0079] For example, in Figure 1 In FIG. 1 , when the tablet device 10 is placed as shown in the figure, the actual direction of the tip of the stylus pen 20 can be as shown by the black arrow, parallel to the long frame of the tablet device 10 and pointing to the left; Figure 1 In FIG. 5( b ), the actual direction of the tip of the stylus pen 20 may be as indicated by the black arrow, which is parallel to the long frame of the tablet device 10 and points to the right.
[0080] For the two different orientations of the stylus pen 20 tip listed above, when the stylus pen 20 starts to pair with the tablet device 10, a prompt window may automatically pop up on the display screen of the tablet device 10, for example Figure 1 The prompt window 101-1 shown in FIG. (a) is as follows: Figure 1The prompt window 102-1 shown in FIG. (b) of FIG. 101-1 and the prompt window 102-1 may display the same content, that is, the prompt window 101-1 and the prompt window 102-1 display the same preset picture of the stylus 20, the device name of the stylus 20, the "Cancel" control, and the "Connect" control, wherein the direction of the pen tip in the same preset picture of the stylus 20 remains consistent.
[0081] It should be understood that the prompt window 101-1 (or prompt window 102-1) is automatically popped up on the display screen of the tablet device 10 before the tablet device 10 and the stylus pen 20 establish a Bluetooth connection. In other words, when the prompt window 101-1 (or prompt window 102-1) pops up on the tablet device 10, the tablet device 10 and the stylus pen 20 have not established a Bluetooth connection. Specifically, before the tablet device 10 and the stylus pen 20 establish a Bluetooth connection, when the stylus pen 20 is infinitely close to the tablet device 10 (that is, when the distance between the stylus pen 20 and the tablet device 10 is less than or equal to the preset distance), until it is adsorbed on the frame of the tablet device 10, the stylus pen 20 can send handshake data to the tablet device 10 based on the "wireless transparent transmission method". After the tablet device 10 receives the handshake data, it displays the prompt window 101-1 (or prompt window 102-1) based on the content included in the received handshake data.
[0082] Specifically, the tablet device 10 and the stylus pen 20 may both be equipped with a wireless chip, which may support wireless communication within a preset distance. The "wireless transparent transmission method" may be based on the wireless chips of the tablet device 10 and the stylus pen 20, and may be understood as transparent transmission of data, or may be referred to as "serial port transparent transmission". The wireless transparent transmission method does not require any protocol encapsulation and processing of the data. As long as the distance between the tablet device 10 and the stylus pen 20 meets the range requirements of the serial port transmission, the stylus pen 20 may send the handshake data to the tablet device 10, that is, the stylus pen 20 described above may send the handshake data to the tablet device 10 based on the "wireless transparent transmission method". The implementation process of wireless transparent transmission is not described in detail in the embodiment of the present application.
[0083] It should also be understood that in the embodiment of the present application, when the prompt window 101-1 (or prompt window 102-1) is automatically popped up on the tablet device 10, the Bluetooth switch of the tablet device 10 and / or the stylus 20 can be in an off state or in an on state, and the embodiment of the present application does not limit this. In other words, the on or off state of the Bluetooth switch of the tablet device 10 and / or the stylus 20 does not affect the wireless transparent transmission between the tablet device 10 and the stylus 20, and the automatic pop-up process of the tablet device 10.
[0084] Optionally, the handshake data may include the device name of the stylus 20, the product serial number (SN), the version information of the software system, the product hardware information, and other content related to the device information of the stylus 20, and the amount of data included in the wirelessly transmitted handshake data is very small. The embodiment of the present application does not limit the specific content of the handshake data.
[0085] The above implementation process does not pay attention to the actual state of the stylus 20, such as the actual orientation of the stylus pen 20 tip. For example, the tablet device 10 may not be able to detect and identify the actual orientation of the stylus pen 20 tip when it is adsorbed to the frame. Or, even if the tablet device 10 is able to detect and identify the actual orientation of the stylus pen 20 tip when it is adsorbed, before the tablet device 10 and the stylus pen 20 establish a Bluetooth connection, there is no relevant channel to send the actual orientation of the stylus pen 20 tip and other related information to the tablet device 10, and the handshake data mainly relies on the wireless transparent transmission between the tablet device 10 and the stylus pen 20 before the Bluetooth connection. This wireless transparent transmission method cannot realize the transmission of a large amount of data containing information such as the actual orientation of the stylus pen tip to the tablet device 10.
[0086] Therefore, when the tablet device 10 displays the prompt window 101-1 (or prompt window 102-1), it is unable to obtain and determine the actual orientation of the tip of the stylus pen 20, and can only obtain the device name, device model and other device information related content of the stylus pen 20, and displays a preset picture of the stylus pen 20 in the prompt window 101-1 (or prompt window 102-1). The preset picture is often fixed, and the tip orientation in the preset picture is single, which cannot match the actual orientation of the tip of the stylus pen 20, that is, it is impossible to display a stylus picture that meets the user's needs in combination with the user's specific usage conditions, usage habits, etc., thereby reducing the user's visual experience and usage experience.
[0087] In response to the above problems, an embodiment of the present application will provide a method for detecting the direction of a stylus pen tip, which can detect and identify the actual direction of the stylus pen tip in different scenarios, and can match different stylus pen images according to the actual direction of the stylus pen tip, thereby taking into account the usage habits of different users and displaying stylus pen images and pop-up content that meet the actual needs of the user, thereby improving the user's usage experience.
[0088] The technical solution for detecting the direction of the stylus pen tip in the embodiment of the present application will be described below in conjunction with the drawings in the embodiment of the present application.
[0089] The method for detecting the direction of the stylus pen tip provided in the embodiment of the present application can be applied to any electronic device that can be paired with a stylus pen and can use the stylus pen as an input device, such as a mobile phone, a tablet computer, a wearable device, a vehicle-mounted device, an augmented reality (AR) / virtual reality (VR) device, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), etc. Figure 1 The tablet device 10 and the like introduced in the present application do not impose any limitation on the specific type of electronic device.
[0090] against Figure 1 The application scenario shown introduces, from the user interaction level, the pop-up display process and possible implementation methods of the display screen of the tablet device 10 before the tablet device 10 and the stylus pen 20 establish a Bluetooth connection. The following will introduce the underlying implementation process corresponding to the method for detecting the direction of the stylus pen tip provided in the embodiment of the present application from the underlying implementation strategy level.
[0091] It should be understood that the method for detecting the direction of the stylus pen tip provided in the embodiment of the present application can occur between the stylus pen 20 and electronic devices such as a tablet device 10 and a mobile phone, wherein the electronic devices such as a tablet device and a mobile phone, as well as the stylus pen 20, etc. in the embodiment of the present application can have a certain hardware structure and software structure.
[0092] Figure 2 It is a structural diagram of an electronic device 100 provided in an embodiment of the present application.
[0093] It should be understood that the electronic devices such as mobile phones and tablet devices in the embodiments of the present application may include Figure 2 The electronic device 100 shown may include partial or entire structures, or may also include more other structures not shown, which is not limited in the embodiments of the present application.
[0094] Similarly, the stylus pen 20 of the embodiment of the present application may also include Figure 2 The electronic device 100 shown may include a partial structure or the entire structure, or may also include more other structures not shown, which is not limited in the embodiments of the present application.
[0095] Exemplarily, the stylus 20 may include a pen tip portion, a pen body portion, a Hall sensor, an acceleration sensor, a wireless chip, a Bluetooth module, a magnetic module, etc. For the sake of simplicity, they are not described one by one here.
[0096] For example, Figure 2As shown, the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0097] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0098] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0099] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
[0100] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0101] In the embodiment of the present application, if the electronic device 100 represents Figure 1 If the tablet device 10 in the electronic device 100 is a tablet device 10, the device information, Bluetooth information, etc. of one or more stylus pens that can be adapted are stored in the processor 110 of the electronic device 100. Exemplarily, it is assumed that the device information of the stylus 20, such as the device name, device model, software system version information, product hardware information, etc., is stored in the processor 110 of the electronic device 100. After the electronic device 100 receives the handshake data sent by the stylus 20, it can verify whether the current stylus 20 is an adaptable stylus according to the device information of the stylus 20 included in the handshake data and the device information of the adaptable stylus stored in itself, that is, whether the stylus 20 can be used as an input device of the electronic device 100.
[0102] Similarly, it is assumed that the processor 110 of the electronic device 100 stores the Bluetooth information of the stylus pen 20, such as the Bluetooth protocol information, wireless information, media access control (MAC) address information during Bluetooth connection, Internet protocol address (IP address) and other information related to Bluetooth connection of the stylus pen 20. The electronic device 100 can also verify the Bluetooth information of the current stylus pen 20 to determine whether a Bluetooth connection can be established with the stylus pen 20, which will not be described in detail here.
[0103] In addition, in the embodiment of the present application, the processor 110 of the electronic device 100 stores a program code for executing the embodiment of the present application, and the program code enables the electronic device 100 to: receive the acceleration value information sent by the stylus 20, determine the actual orientation of the stylus tip according to the relative value between the acceleration value reported by the stylus 20 and its own acceleration value, and then match the current stylus 20 with a target image that is consistent with the orientation of the tip according to the actual orientation of the stylus tip 20. In addition, the working state of its own Hall sensor can also be obtained, and the actual orientation of the stylus tip 20 can be determined according to the working state of the Hall sensor, so that the electronic device 100 can match the target image for the current stylus according to the actual orientation of the stylus tip 20.
[0104] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0105] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL).
[0106] The I2S interface can be used for audio communication. In some embodiments, the processor 110 can include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to achieve communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 160 via the I2S interface to achieve the function of answering a call through a Bluetooth headset.
[0107] The PCM interface can also be used for audio communication, sampling, quantizing and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via a PCM bus interface.
[0108] The UART interface is a universal serial data bus for asynchronous communication. The bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is generally used to connect the processor 110 and the wireless communication module 160. In an embodiment of the present application, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to realize the Bluetooth function of the electronic device 100.
[0109] The MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to implement the shooting function of the electronic device 100. The processor 110 and the display screen 194 communicate via the DSI interface to implement the display function of the electronic device 100.
[0110] The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 with the camera 193, the display 194, the wireless communication module 160, the audio module 170, the sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.
[0111] The USB interface 130 is an interface that complies with USB standard specifications, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc.
[0112] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0113] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from the wired charger through the USB interface 130 .
[0114] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 to power the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, and the wireless communication module 160.
[0115] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0116] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0117] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G / 6G applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.
[0118] The modulation and demodulation processor may include a modulator and a demodulator, wherein the modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium-high frequency signal, and the demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal.
[0119] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0120] In the embodiment of the present application, the electronic device 100 and the stylus pen, as two different electronic devices, may both include a wireless communication module 160 .
[0121] Exemplarily, the electronic device 100 and the stylus pen may both have a wireless chip, and the wireless chip may support wireless communication within a preset distance, that is, the stylus pen may send handshake data to the electronic device 100 based on a “wireless transparent transmission method”.
[0122] In an embodiment of the present application, in addition to the Bluetooth information of the stylus, the information sent by the stylus to the electronic device 100 may also include the numerical information of the pen end acceleration sensor. The numerical information of the pen end acceleration sensor can be used by the electronic device 100 to determine the actual direction of the stylus tip.
[0123] It should be understood that the data volume of the numerical information of the accelerometer at the tip of the stylus is also extremely small, and can be combined with the Bluetooth information of the stylus to generate new information. The smaller data volume can be transmitted to the electronic device 100 through the existing wireless transparent transmission method without increasing the data volume of the wireless transparent transmission.
[0124] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, so that electronic device 100 can communicate with the network and other devices through wireless communication technology.
[0125] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
[0126] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.
[0127] In the embodiment of the present application, Figure 1 Taking the connection between the tablet device 10 and the stylus pen 20 as an example, the display screen 194 of the mobile phone can further display the handshake data sent by the stylus pen 20 on the display screen 194 after receiving the handshake data. Figure 1 The prompt window 101-1 shown in Figure (a) or the prompt window 102-1 shown in Figure (b) detects the operations performed by the user in the contents of different prompt windows and responds according to the user's operations, which will not be repeated here.
[0128] In addition, if the user can take notes on the electronic device with a stylus in daily meetings, video learning and other scenarios, the display screen 194 can also receive the operations performed by the user with the stylus and respond according to the user's operations, which will not be repeated here.
[0129] The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.
[0130] The ISP is used to process data fed back by the camera 193. For example, when taking a photo, the shutter is opened, light is transmitted to the camera photosensitive element through the lens, and the light signal is converted into an electrical signal. The camera photosensitive element transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye.
[0131] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element converts the optical signal into an electrical signal, which is then transmitted to the ISP for conversion into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.
[0132] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.
[0133] The video codec is used to compress or decompress digital video. The electronic device 100 may support one or more video codecs. In this way, the electronic device 100 may play or record videos in multiple coding formats.
[0134] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of electronic device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.
[0135] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 via the external memory interface 120 to implement a data storage function.
[0136] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory and may also include a non-volatile memory.
[0137] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0138] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110.
[0139] The speaker 170A, also called a "speaker", is used to convert an audio electrical signal into a sound signal. The receiver 170B, also called a "earpiece", is used to convert an audio electrical signal into a sound signal. The microphone 170C, also called a "microphone" or "microphone", is used to convert a sound signal into an electrical signal.
[0140] The earphone interface 170D is used to connect a wired earphone. The pressure sensor 180A is used to sense a pressure signal and convert the pressure signal into an electrical signal.
[0141] The gyro sensor 180B can be used to determine the motion posture of the electronic device 100. In some embodiments, the gyro sensor 180B can also be called a "three-axis sensor", and the angular velocity of the electronic device 100 around three axes (i.e., x, y, and z axes) is determined by the gyro sensor 180B. The gyro sensor 180B can be used for anti-shake shooting. For example, when the shutter is pressed, the gyro sensor 180B detects the angle of the electronic device 100 shaking, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the electronic device 100 through reverse movement to achieve anti-shake. The gyro sensor 180B can also be used for navigation and somatosensory game scenes.
[0142] The air pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates the altitude through the air pressure value measured by the air pressure sensor 180C to assist positioning and navigation.
[0143] The magnetic sensor 180D includes a Hall sensor. The electronic device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip leather case. Exemplarily, in the embodiment of the present application, the stylus 20 mainly relies on the strong adsorption function of the magnetic module to be adsorbed at a fixed position of the side frame of the electronic device 100. Optionally, the magnetic module between the stylus and the electronic device 100 can be a group of magnets, which is not limited in the embodiment of the present application.
[0144] In addition, in the embodiment of the present application, the stylus and the electronic device 100 are both equipped with Hall sensors, which can be composed of Hall elements and auxiliary circuits, etc. On the one hand, the Hall sensors on the electronic device 100 and the stylus can monitor the changes in the magnetic field and play a certain adsorption role; on the other hand, the Hall sensors on the electronic device 100 and the stylus can also be used as switches, which can automatically control the information interaction between the electronic device 100 and the stylus (start sending handshake data, etc.) and other processes, which will not be repeated here.
[0145] The acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in all directions (generally three axes). When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of the electronic device and is applied to applications such as horizontal and vertical screen switching and pedometers.
[0146] Illustratively, in the embodiment of the present application, both the stylus and the electronic device 100 are equipped with an acceleration sensor 180E. The acceleration sensor 180E can be used to determine the acceleration of the stylus on each axis, as well as the acceleration of the electronic device 100 on each axis, so that the electronic device 100 can determine the actual orientation of the stylus tip based on the relative values between the accelerations on each axis, which will not be elaborated here.
[0147] It should be understood that in the embodiment of the present application, the gyro sensor 180B and the acceleration sensor 180E can cooperate with each other so that the tablet device 10 and the stylus pen 20 can accurately obtain information on the acceleration value on each coordinate axis.
[0148] The distance sensor 180F is used to measure the distance. The electronic device 100 can measure the distance by infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 can use the distance sensor 180F to measure the distance to achieve fast focusing.
[0149] The proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device 100 emits infrared light to the outside through the light emitting diode.
[0150] The ambient light sensor 180L is used to sense the brightness of ambient light.
[0151] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application locks, fingerprint photography, fingerprint call answering, etc.
[0152] The temperature sensor 180J is used to detect temperature. In some embodiments, the electronic device 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy.
[0153] The touch sensor 180K may be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 may form a touch screen. The touch sensor 180K is used to detect a touch operation acting on or near the touch sensor 180K. The touch sensor may transmit the detected touch operation to the application processor to determine the type of touch event. A visual output related to the touch operation may be provided through the display screen 194. In other embodiments, the touch sensor 180K may also be disposed on the surface of the electronic device 100, which is different from the position of the display screen 194.
[0154] Optionally, in an embodiment of the present application, the touch sensor 180K can detect user operations such as touch and click, generate an operation event, and pass the operation event to the processor 110. The processor 110 determines that the operation event includes relevant parameters such as the coordinates of the touch point and the touch status, and responds according to the operation event.
[0155] The bone conduction sensor 180M can obtain a vibration signal. In some embodiments, the bone conduction sensor 180M can obtain a vibration signal of a vibrating bone block of a human vocal part.
[0156] The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The electronic device 100 may receive key input and generate key signal input related to user settings and function control of the electronic device 100.
[0157] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback.
[0158] Indicator 192 may be an indicator light, which may be used to indicate charging status, power changes, messages, missed calls, notifications, etc.
[0159] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to or disconnected from the electronic device 100 by inserting the SIM card interface 195 or removing the SIM card from the SIM card interface 195 .
[0160] The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. Taking the system as an example, the software structure of the electronic device 100 is exemplified.
[0161] Figure 3 This is a software structure block diagram of an electronic device according to an embodiment of the present application.
[0162] Optionally, the electronic device 100 of the embodiment of the present application may have system, that is, Figure 3 The layered architecture shown may include several layers, each layer has a clear role and division of labor, and the layers communicate with each other through software interfaces.
[0163] For example, in some embodiments, Figure 3 As shown, it can be The system is divided into four layers, from top to bottom: application layer, application framework layer, Android runtime ( runtime) and system libraries, as well as the kernel layer.
[0164] The application layer may include a series of application packages. For example, Figure 3 As shown, the application layer may include application packages corresponding to applications such as camera, Bluetooth, and settings, which is not limited in this embodiment of the present application.
[0165] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.
[0166] For example, Figure 3 As shown, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like.
[0167] The window manager is used to manage window programs. The window manager can obtain the size of the display screen, determine whether the screen has a status bar, or participate in operations such as locking the screen and taking screenshots.
[0168] Content providers are used to store and retrieve data and make it accessible to applications. The stored data may include video data, image data, audio data, etc. It may also include call log data, user browsing history and bookmarks, etc., which will not be described in detail here.
[0169] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.
[0170] The phone manager is used to provide communication functions of the electronic device 100, such as the management of call status (including call connection, hang-up, etc.).
[0171] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0172] The notification manager enables applications to display notification information in the status bar of the screen, which can be used to convey messages to users. The notification information can automatically disappear after a short stay in the status bar, without the need for the user to perform interactive processes such as closing operations. For example, the notification manager can inform users of messages such as download completion. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as a notification of an application running in the background; or, the notification manager can also be a notification that appears on the screen in the form of a dialog window, such as a text message prompt in the status bar, etc.; or, the notification manager can also control the electronic device to emit a prompt sound, the electronic device to vibrate, the electronic device's indicator light flashes, etc., which will not be repeated here.
[0173] The runtime includes the core library and the virtual machine. The runtime is responsible for scheduling and management of the Android system.
[0174] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.
[0175] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
[0176] The system library may include multiple functional modules, such as surface manager, media libraries, three-dimensional (3D) graphics processing library (such as OpenGL ES), two-dimensional (2D) graphics engine, image processing library, etc.
[0177] The surface manager is used to manage the display subsystem of the electronic device and provides the fusion of 2D and 3D layers for multiple applications.
[0178] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0179] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0180] A 2D graphics engine is a drawing engine for 2D drawings.
[0181] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.
[0182] It should be understood that the embodiments of the present application do not impose strict requirements on the software structure of the electronic device 100. As long as the electronic device 100 can determine the actual orientation of the stylus pen tip based on the received information, and after matching the target image of the stylus pen based on the actual orientation of the stylus pen tip, a pop-up window can be displayed on the display screen of the electronic device 100 to show the user a stylus image that matches the actual orientation of the stylus pen tip; or, when the pop-up window is displayed, an animation effect can be added to the prompt window; or, within the prompt window, a dynamic playback effect can be added to one or more stylus images, etc., which will not be elaborated here.
[0183] For ease of understanding, the following embodiments of the present application will be described in detail with Figure 2 and Figure 3 Taking the tablet device 10 of the structure shown as an example, the method for detecting the direction of the stylus tip provided in the embodiment of the present application is specifically described in combination with the drawings and application scenarios.
[0184] Figure 4 This is a schematic flowchart of a method for detecting the direction of a stylus tip provided in an embodiment of the present application.
[0185] For example, the above Figure 1Taking the pairing process between the tablet device 10 and the stylus pen 20 as an example, the implementation process of detecting the direction of the stylus pen tip provided in the embodiment of the present application may include three different stages, each stage including different steps. Figure 4 As shown, the method 400 may include the following different stages:
[0186] Phase 1: Pairing
[0187] 401 , when the distance between the stylus pen 20 and the tablet device 10 is less than or equal to a preset distance, the stylus pen 20 sends handshake data to the tablet device 10 .
[0188] 402 , the tablet device 10 performs device verification according to the received handshake data.
[0189] 403 , the tablet device 10 returns the device verification result to the stylus pen 20 .
[0190] Optionally, the tablet device 10 and the stylus pen 20 may both have a wireless chip, which may support wireless communication within a preset distance. Specifically, in step 401 of the first stage, the stylus pen 20 may send handshake data to the tablet device 10 based on wireless transparent transmission.
[0191] It should be understood that the "preset distance" may be the maximum transmission distance between the wireless chip of the stylus 20 and the tablet device 10, such as within 10 mm. In addition, please refer to the relevant description of the aforementioned embodiment for the implementation process of wireless transparent transmission, which will not be repeated here for simplicity.
[0192] Optionally, the handshake data may include the device name of the stylus 20 , the product serial number (SN), software system information, product hardware information, and other content related to the device information of the stylus 20 , which is not limited in the embodiment of the present application.
[0193] In a possible implementation, the tablet device 10 stores device information of the stylus that can be adapted thereto when it leaves the factory, so that the tablet device 10 can accurately know the device information of the stylus that can be adapted thereto, such as the device name, device model, software system version information, product hardware information, etc. It should be understood that the stylus that can be adapted thereto by the tablet device 10 can be of one or more types, and the tablet device 10 can store device information of each type of stylus that can be adapted thereto, which is not limited in the embodiments of the present application.
[0194] For example, taking Huawei's Mate Pad Pro as an example, Mate Pad Pro can support the first-generation M-pencil and the second-generation M-pencil, and the operations performed by users on the display screen of Mate Pad Pro using these two styluses can be detected and received. Therefore, Mate Pad Pro stores device information such as the device name, device model, software system version information, product hardware information, etc. of the first-generation M-pencil and the second-generation M-pencil since leaving the factory.
[0195] In the first stage of the embodiment of the present application, after the tablet device 10 receives the handshake data sent by the stylus 20, it can obtain the device information of the current stylus 20 included in the handshake data, such as the device name, device model, software system version information, product hardware information, etc., and then the tablet device 10 compares the device information of the stylus 20 with the device information of the adaptable stylus stored in itself, which is the "device verification" process of step 402.
[0196] In one possible scenario, in step 402, when the tablet device 10 detects that the current stylus 20 is an adaptable stylus, the verification is passed, that is, in step 403, the tablet device 10 may return a verification result indicating to the stylus 20 that the device information of the stylus 20 has passed the verification.
[0197] In another possible situation, in step 402, when the tablet device 10 detects that the current stylus 20 is an unmatched stylus, the verification fails, that is, in step 403, the tablet device 10 may return a verification result to the stylus 20 indicating that the device information verification of the stylus 20 fails. At this point, the current pairing process may be terminated, and other subsequent steps will not be executed, or other subsequent stages such as Bluetooth connection will not be entered, which will not be described in detail here.
[0198] Phase 2: Bluetooth information transmission phase
[0199] 404 , when the result of the device verification returned by the tablet device 10 to the stylus pen 20 indicates that the verification is passed, the stylus pen 20 sends the Bluetooth information of the stylus pen 20 and the numerical information of the pen tip acceleration sensor to the tablet device 10 .
[0200] 405 , the tablet device 10 performs Bluetooth information verification according to the received Bluetooth information.
[0201] 406 , the tablet device 10 returns the result of the Bluetooth information verification to the stylus 20 .
[0202] It should be understood that in the embodiment of the present application, the tablet device 10 and the stylus pen 20 both include a Bluetooth module integrated with a Bluetooth function, for communicating via Bluetooth transmission. Optionally, the Bluetooth module may include a chip, a circuit assembly, and other peripheral devices, etc., which will not be described in detail here.
[0203] Optionally, the Bluetooth module may include a classic Bluetooth (BT) module or a Bluetooth low energy module (BLE). The embodiment of the present application does not limit the implementation form of the Bluetooth module.
[0204] It should also be understood that in the embodiment of the present application, the "Bluetooth information of the stylus 20" may include the Bluetooth protocol information, wireless information, media access control (MAC) address information during Bluetooth connection, Internet protocol address (IP address) and other information related to the Bluetooth connection of the stylus 20. The embodiment of the present application is referred to as "Bluetooth information". The "Bluetooth information" can be used to support the tablet device 10 and the stylus 20 to establish a Bluetooth channel. The embodiment of the present application does not limit the specific content of the "Bluetooth information".
[0205] Exemplarily, when the Bluetooth module is a BLE module, in step 404, the “Bluetooth information” of the stylus 20 sent by the stylus 20 to the tablet device 10 may include BLE-MAC address information, BLE-model information, etc., which is not limited in this embodiment of the present application.
[0206] In the second stage of the embodiment of the present application, after the tablet device 10 receives the Bluetooth information sent by the stylus 20, it can obtain the Bluetooth information such as the BLE-MAC address information and the BLE-model information of the stylus 20, and then the tablet device 10 compares the Bluetooth information such as the BLE-MAC address information and the BLE-model information with the Bluetooth information corresponding to the adaptable stylus 20 stored in itself, which is the "Bluetooth information verification" process of step 405.
[0207] In one possible scenario, in step 405 of the second stage, after the tablet device 10 determines that the Bluetooth information verification such as the BLE-MAC address information and the BLE-model information of the stylus 20 has passed, it can return the result of the Bluetooth information verification to the stylus 20 in step 406. The result of the Bluetooth information verification is used to indicate that the Bluetooth information verification of the stylus 20 has passed.
[0208] In another possible situation, in step 405 of the second stage, when the tablet device 10 determines that the Bluetooth information verification such as the BLE-MAC address information and the BLE-model information of the stylus 20 fails, the tablet device 10 may return the result of the Bluetooth information verification to the stylus 20 in step 406, and the result of the Bluetooth information verification is used to indicate that the Bluetooth information verification of the stylus 20 fails. At this point, the current Bluetooth information transmission stage can be terminated, and other subsequent stages such as Bluetooth connection will not be entered, or other subsequent steps will not be executed, which will not be repeated here.
[0209] In one possible implementation, in step 404 of the second stage of the embodiment of the present application, the information sent by the stylus pen 20 to the tablet device 10 may include, in addition to the Bluetooth information of the stylus pen 20, also the numerical information of the pen end acceleration sensor to the tablet device 10. The numerical information of the pen end acceleration sensor can be used by the tablet device 10 to determine the actual direction of the tip of the stylus pen 20.
[0210] It should be understood that when the Bluetooth information of the stylus pen 20 and the numerical information of the pen-end accelerometer are sent to the tablet device 10 at the same time, the data volume of the numerical information of the pen-end accelerometer of the stylus pen 20 is also very small, and can be combined with the Bluetooth information of the stylus pen 20 to generate new information. The small amount of data can be transmitted to the tablet device 10 through the existing wireless transparent transmission method, and the amount of wireless transparent transmission data will not be increased. In addition, how the tablet device 10 determines the actual direction of the tip of the stylus pen 20 based on the numerical information of the pen-end accelerometer will be described in detail in the subsequent third stage (step 407, etc.).
[0211] Through the above two-stage verification process, it can be ensured that the stylus 20 that passes the device verification and Bluetooth information verification is a device that can match the tablet device 10 and can connect to the tablet device 10 through Bluetooth. When both the device verification and the Bluetooth information verification are passed, the following third stage process can be continued.
[0212] The third stage: pop-up stage
[0213] 407 , when the result of the Bluetooth information verification indicates that the verification is passed, the tablet device 10 determines the actual direction of the stylus pen tip according to the value of the pen end acceleration sensor.
[0214] Optionally, the acceleration sensor of the tablet device 10 and the acceleration sensor of the stylus 20 may both be three-axis sensors, which may be respectively referred to as “three-axis sensor of the tablet device 10 ” and “three-axis sensor at the tip of the stylus 20 ”. The embodiment of the present application does not limit the type of the acceleration sensor.
[0215] It should be understood that for the tablet device 10 and the stylus 20, the installation position of the acceleration sensor is fixed, that is, the coordinate system corresponding to the acceleration value obtained by the acceleration sensor during operation is also fixed. Then, in the actual use of the tablet device 10, no matter how the tablet device 10 is placed, such as horizontal placement, tilted placement, inverted placement, etc., after the stylus 20 is adsorbed to the long frame of the tablet device 10, the positions of the tablet device 10 and the stylus 20 are relatively fixed, that is, the positions of the acceleration sensors of the tablet device 10 and the stylus 20 are also relatively fixed. In other words, the magnitude of the acceleration in each direction of the coordinate axis is also fixed. Therefore, the actual direction of the tip of the stylus 20 can be determined by the relative value of the acceleration in each direction.
[0216] For example, in the embodiment of the present application, the "relative value of acceleration in each direction" can be understood as: the difference obtained by subtracting the acceleration value of the stylus 20 from the acceleration value of the tablet device 10 in that direction. Optionally, the difference (i.e., the "relative value" of the acceleration in that direction) may be a positive number, a negative number, or 0, and the tablet device 10 can determine the actual direction of the stylus 20 tip according to the relative value of the acceleration in each direction.
[0217] Figure 5 The schematic diagram of the working principle of the stylus pen and the acceleration sensor of the tablet device provided in the embodiment of the present application is shown below. Figure 5 Introduce the working process of acceleration sensor.
[0218] For example, Figure 5 As shown in FIG. 1( a), it is assumed that the acceleration sensor of the tablet device 10 is installed at 1 The position of the center of gravity (geometric center) of the acceleration sensor is O 1 , and after the position of the acceleration sensor of the tablet device 10 is fixed, determine as follows Figure 5 The coordinate system O shown in Figure (a) 1 -X 1 Y 1 Z 1 Assume that the acceleration sensor of the stylus pen 20 is installed at O 2 The position of the center of gravity (geometric center) of the acceleration sensor is O 2 , and after the position of the acceleration sensor of the stylus 20 is fixed, the coordinate system O shown in FIG. 2 -X 2 Y 2 Z 2 .
[0219] The placement position of "the display screen of the tablet device 10 faces the user, the straight line where the long border is located is the horizontal reference line, the straight line where the short border is located is the vertical reference line, and the camera of the tablet device 10 is located in the upper left corner of the display screen" is taken as the reference position, which can be called the "positive position", such as Figure 5 The tablet device 10 shown in (a) or (b) is in a forward position.
[0220] Assuming that the tablet device 10 is in the forward position, the coordinate system O determined by the acceleration sensor of the tablet device 10 is 1 -X 1 Y 1 Z 1 In Figure 5 As shown in Figure (a), X 1 The axis is parallel to the long frame of the tablet device 10 and points to the right side of the long frame. 1 The Y axis is parallel to the short frame of the tablet device 10 and points to the top of the tablet device display screen. 1 The axis is perpendicular to the plane where the display screen of the tablet device 10 is located and points to the outside of the display screen. 1 Axis and Z 1 The plane formed by the Y axis is the plane where the display screen of the tablet device 10 is located. 1 The straight line where the axis is located is perpendicular to the plane where the display screen of the tablet device 10 is located.
[0221] Accordingly, the placement position of “when the tablet device 10 is in the forward position, the stylus pen 20 is adsorbed on the long frame of the tablet device 10, and the tip of the stylus pen 20 is facing the camera” is referred to as the “forward position” of the stylus pen 20. Figure 5 The current position of the stylus pen 20 shown in FIG. 8 (a) is the forward position.
[0222] Assume that the stylus pen 20 is in the forward position and is adsorbed on the tablet device 10. In the coordinate system O determined by the acceleration sensor of the stylus pen 20, 2 -X 2 Y 2 Z 2 In Figure 5 As shown in Figure (a), X 2 The axis is parallel to the central axis of the stylus pen 20 and points to the end of the stylus pen 20 away from the tip (the opposite end of the tip). 2 The axis is parallel to the short frame of the tablet device 10 to which the stylus pen 20 is attached and points to the outside of the long frame of the tablet device 10. 2 The axis is perpendicular to the plane where the display screen of the tablet device 10 is located and points to the outside of the display screen (or to the top of the display screen). 2 Axis and Z 2The plane formed by the axis and the plane where the display screen of the tablet device 10 is located are the same plane, or a plane parallel to the plane where the display screen is located, Y 2 The straight line where the axis is located is perpendicular to the plane where the display screen of the tablet device 10 is located.
[0223] From the coordinate system O introduced above 1 -X 1 Y 1 Z 1 and coordinate system O 2 -X 2 Y 2 Z 2 It is known that in Figure 5 In the scenario shown in Figure (a), X 1 Axis and X 2 The directions of the axes are consistent, Z 1 Axis and Z 2 The directions of the axes are consistent, Y 1 Axis and Y 2 The directions of the axes are consistent.
[0224] For example, when the user brings the stylus 20 infinitely close to the tablet device 10 and follows Figure 5 In the direction shown in FIG. (a) of FIG. 1 , the stylus pen 20 is attached to the long border of the tablet device 10. Assuming that the tablet device 10 has returned the result of device verification to the stylus pen 20 through step 403 of the first stage, in step 404 of the second stage, the stylus pen 20 can send the acceleration value of the current pen tip acceleration sensor of the stylus pen 20 to the tablet device 10 while sending the Bluetooth information of the stylus pen 20 to the tablet device 10. The tablet device 10 can calculate the relative value of acceleration in each direction according to the pen tip acceleration of the stylus pen 20 and the value of its own acceleration sensor, and then determine the actual direction of the tip of the stylus pen 20 according to the relative values of acceleration in the three directions.
[0225] Table 1 is an example of acceleration values output by the acceleration sensors of the stylus pen 20 and the tablet device 10 listed in an embodiment of the present application.
[0226] For example, when the stylus 20 is Figure 5 When the positional relationship shown in FIG. (a) is adsorbed on the long frame of the tablet device 10, as shown in Table 1, assuming that the acceleration value output by the acceleration sensor of the tablet device 10 is a x 、a y and a z , and the tablet device 10 obtains the acceleration value of the stylus 20 in step 404 as a x 、a y and a z, the relative value of acceleration in the X-axis direction is 0, the relative value of acceleration in the Y-axis direction is 0, and the relative value of acceleration in the Z-axis direction is 0. Figure 5 In the positional relationship shown in FIG. 2 (a), the actual direction of the tip of the stylus pen 20 is along the long border of the tablet device 10 and points to the left direction.
[0227] It should be understood that if the relative values of acceleration in each direction are all 0 as listed in Table 1, it can be determined that the direction of acceleration in each direction is the same, that is, X 1 Axis and X 2 The directions of the axes are consistent, Z 1 Axis and Z 2 The directions of the axes are consistent, Y 1 Axis and Y 2 Then, the stylus 20 and the tablet device 10 are both in the aforementioned assumed “positive position”, and the tablet device 10 can determine Figure 5 In the scene shown in FIG. 2 (a), the actual direction of the tip of the stylus pen 20 is parallel to the long frame and points to the left.
[0228] Table 1
[0229]
[0230] Table 2 is another example of acceleration values output by the acceleration sensors of the stylus pen 20 and the tablet device 10 listed in the embodiment of the present application.
[0231] For example, when the stylus 20 is Figure 5 When the positional relationship shown in FIG. (b) is adsorbed on the long frame of the tablet device 10, as shown in Table 2, assuming that the acceleration value output by the acceleration sensor of the tablet device 10 is a x 、a y and a z , and the tablet device 10 obtains the acceleration value of the stylus 20 in step 404 as -a x , -a y and a z , the relative value of the acceleration in the X-axis direction is calculated to be 2a x , the relative value of acceleration in the Y-axis direction is 2a y , the relative value of the acceleration in the Z-axis direction is 0, so it can be determined Figure 5 In the positional relationship shown in FIG. 2 (b), the actual direction of the tip of the stylus pen 20 is along the long border of the tablet device 10 and points to the right direction.
[0232] It should be understood that if the relative value of the acceleration in each direction is 0 in only one direction as listed in Table 2, and the relative values of the acceleration in the two directions are not 0 and the magnitude of the relative values is twice the magnitude of the acceleration, then the tablet device 10 can determine that the directions of the acceleration in the two directions are opposite, that is, X 1 Axis and X 2 The direction of the axis is opposite, Y 1 Axis and Y 2 The directions of the axes are opposite, Z 1 Axis and Z 2 Then, the stylus 20 starts from the "positive position" and moves in the X 2 Axis and Y 2 The plane defined by the axis is rotated 180°, and the tablet device 10 can determine Figure 5 In the scene shown in FIG. 2 (b), the actual direction of the tip of the stylus pen 20 is parallel to the long frame and points to the right.
[0233] Table 2
[0234]
[0235] Through the above process, according to the relative value between the acceleration value of the accelerometer at the end of the stylus 20 and the acceleration value output by the accelerometer of the tablet device 10 itself in the direction of each coordinate axis, the tablet device 10 can determine the actual orientation of the tip of the stylus 20, and can further execute the process of step 408 to match the target image for the current stylus 20 according to the actual orientation of the tip of the stylus 20.
[0236] In another possible scenario, if the acceleration value of the pen tip accelerometer of the stylus pen 20 is not transmitted to the tablet device 10 side, or the acceleration value transmission of the pen tip accelerometer of the stylus pen 20 fails, the embodiment of the present application also provides another possible method, and the tablet device 10 can determine the actual direction of the tip of the stylus pen 20 through the working status of the Hall sensor.
[0237] It should be understood that in the embodiment of the present application, both the tablet device 10 and the stylus pen 20 are equipped with Hall sensors, which may be composed of Hall elements and auxiliary circuits, etc. On the one hand, the Hall sensors on the tablet device 10 and the stylus pen 20 can monitor changes in the magnetic field, and on the other hand, the Hall sensors on the tablet device 10 and the stylus pen 20 can also be used as switches to automatically control the information interaction process between the tablet device 10 and the stylus pen 20 (start sending handshake data, etc.).
[0238] Exemplarily, both the tablet device 10 and the stylus pen 20 include one or more Hall sensors. When the distance between the tablet device 10 and the stylus pen 20 is less than or equal to a preset distance, the Hall sensors of the tablet device 10 and the stylus pen 20 start to work, connect related circuits and trigger the stylus pen 20 to start sending handshake data to the tablet device 10 via wireless transparent transmission. It can be seen that the Hall sensors of the tablet device 10 and the stylus pen 20 can be understood as switches that can automatically control the information exchange between the tablet device 10 and the stylus pen 20.
[0239] It should also be understood that the stylus 20 mainly relies on the strong adsorption function of the magnetic module to be adsorbed at a fixed position of the side frame of the tablet device 10. Optionally, the magnetic module between the tablet device 10 and the stylus 20 can be a group of magnets, which is not limited in the present embodiment.
[0240] Figure 6 This is a schematic diagram of the operation of the Hall sensor when the stylus pen is attached to the side frame of a tablet device.
[0241] For example, Figure 6 As shown in FIG. (a), a magnetic module 30 is included between the tablet device 10 and the stylus pen 20, and the magnetic module 30 includes at least a first portion installed at a fixed position of the stylus pen 20, and a second portion installed at a fixed position of the tablet device 10. The first portion and the second portion can be close to and adsorbed together, thereby ensuring that the stylus pen 20 can be adsorbed at a fixed position of the frame of the tablet device 10 without misalignment.
[0242] In one possible scenario, when the stylus 20 is Figure 6 When the position relationship shown in Figure (a) is adsorbed on the long frame of the tablet device 10, the first part and the second part of the magnetic module 30 are adsorbed together, and the distance between the Hall sensor 1 of the stylus 20 and the Hall sensor 2 of the tablet device 10 is less than or equal to the preset distance, thereby triggering the Hall sensor 1 and the Hall sensor 2 to enter the working state, that is, the Hall sensor 1 and the Hall sensor 2 are connected to the relevant control circuit, and the stylus 20 is automatically controlled to start sending handshake data to the tablet device 10, and the Hall sensor 3 of the tablet device 10 is in a non-working state (idle state), or the Hall sensor 3 of the tablet device 10 does not participate in the process as a switching device.
[0243] In another possible scenario, when the stylus pen 20 is Figure 6When the position relationship shown in Figure (b) is adsorbed on the long frame of the tablet device 10, the first part and the second part of the magnetic module 30 are adsorbed together, and the distance between the Hall sensor 1 of the stylus 20 and the Hall sensor 3 of the tablet device 10 is less than or equal to the preset distance, thereby triggering the Hall sensor 1 and the Hall sensor 3 to enter the working state, that is, the Hall sensor 1 and the Hall sensor 3 are connected to the relevant control circuit, and the stylus 20 is automatically controlled to start sending handshake data to the tablet device 10, and the Hall sensor 2 of the tablet device 10 is in a non-working state (idle state), or the Hall sensor 2 of the tablet device 10 does not participate in the process as a switching device.
[0244] It should be understood that for the above possible scenarios, no matter which Hall sensor is in working state, the tablet device 10 can accurately obtain the working state of each Hall sensor, and then determine the actual direction of the tip of the stylus 20 according to the working state of each Hall sensor.
[0245] For example, Table 3 is a schematic diagram of the working states of the Hall sensors of the stylus 20 and the tablet device 10 listed in an embodiment of the present application. For example, as shown in Table 3, when any Hall sensor is in a working state, it is recorded as "1", and when a Hall sensor is in an idle state, it is recorded as "0". The tablet device 10 can determine the actual direction of the tip of the stylus 20 according to the working state of its own Hall sensor.
[0246] Table 3
[0247]
[0248] Through the above scheme, the tablet device 10 can determine the actual orientation of the tip of the stylus pen 20 based on the relative value between the acceleration value of the pen end acceleration sensor sent by the stylus pen 20 and the acceleration value output by the acceleration sensor of the tablet device 10 itself; or, when the tablet device 10 cannot obtain the acceleration value of the pen end acceleration sensor of the stylus pen 20 or does not receive the acceleration value of the pen end acceleration sensor of the stylus pen 20, it can also determine the actual orientation of the tip of the stylus pen 20 in real time based on the adsorption state and working state of the Hall sensor, so that the process of step 408 can be further executed to match the target image for the current stylus pen 20 according to the actual orientation of the tip of the stylus pen 20.
[0249] At 408 , the tablet device 10 determines a target image of the stylus that matches the actual orientation of the stylus tip according to the actual orientation of the stylus tip.
[0250] 409 , the tablet device 10 obtains a target image of the stylus pen and displays the target image of the stylus pen in a pop-up window.
[0251] In a possible implementation, the tablet device 10 may locally store a stylus image library, which may include multiple stylus images of different manufacturers, different models, different styles, different types, and different pen tip orientations. In other words, styluses of different manufacturers and different models are configured with multiple different images to form a stylus image library, and the tablet device 10 may select a matching target image.
[0252] Optionally, in the embodiment of the present application, first, the tablet device 10 can select multiple pictures that are consistent with the manufacturer and product model of the current stylus 20 from multiple pictures of styluses of different manufacturers and models included in the stylus picture library according to the device information of the stylus 20 obtained in the first stage. Secondly, the tablet device 10 can continue to select a stylus picture that matches the actual orientation of the pen tip from the multiple stylus pictures as the "target picture" according to the actual orientation of the pen tip determined in step 407.
[0253] It should be understood that the "target image" finally determined by the tablet device 10 is a picture that is consistent with the manufacturer, product model, and actual orientation of the stylus tip of the current stylus 20. The target image may include relevant information such as the manufacturer and product model, which is not limited in this embodiment of the present application. In another possible implementation, after the tablet device 10 determines the actual orientation of the stylus tip of the stylus 20, it can send a request message to the server, which is used to request to obtain the stylus image, and the request message carries indication information for indicating the actual orientation of the stylus tip of the stylus 20. The server can select a stylus image that matches the actual orientation of the stylus tip from multiple stylus images stored in the stylus image resource as the "target image" according to the request message sent by the tablet device 10, and then return the "target image" to the tablet device 10. This embodiment of the present application does not limit the way in which the tablet device 10 obtains the target image of the stylus.
[0254] Optionally, the server may be a server corresponding to the tablet device 10 , or a server corresponding to the stylus 20 , or a server corresponding to an application (eg, a third-party application), which is not limited in this embodiment of the present application.
[0255] Through the above method, when the electronic device displays a stylus picture in a pop-up window, it can select a picture that matches the actual direction of the stylus tip, instead of displaying a single preset picture with a unique pen tip direction; and the sources of stylus pictures are wide, which can enrich the content and types of pop-up pictures and greatly improve the user experience when using the stylus.
[0256] Optionally, after the tablet device 10 obtains a target image that matches the actual orientation of the tip of the stylus pen 20, a prompt window may automatically pop up on the display screen, and display one or more contents of the device name, target image, cancel control, and connect control of the stylus pen 20 in the prompt window.
[0257] Optionally, the prompt window may also display the product model and manufacturer of the current stylus pen 20, as well as at least one of the remaining power of the current stylus pen 20, a battery identifier, a charging progress bar, etc. The present embodiment of the application does not limit the content displayed in the prompt window popped up by the tablet device 10. The remaining power can be displayed in the form of a percentage to prompt the user the percentage of the current power of the stylus pen in the fully charged state. For simplicity, it will not be repeated here.
[0258] Optionally, when the tablet device 10 automatically pops up a prompt window, the prompt window may have different styles, different sizes, and the prompt window may have different pop-up animations, which is not limited in this embodiment of the present application.
[0259] Figure 7 This is a schematic diagram of a pop-up window when a stylus pen is attached to a side frame of a tablet device, provided in an embodiment of the present application.
[0260] In one possible scenario, when the tablet device 10 displays Figure 7 When the user directly adsorbs the stylus pen 20 to the target position of the upper long border of the tablet device 10, the pairing of the stylus pen 20 and the tablet device 10 can be triggered, and the adsorption process and pairing process of the stylus pen 20 described above are executed, and a prompt window 701-1 can automatically pop up on the interface 701 of the tablet device 10.
[0261] Exemplarily, the display position of the prompt window 701-1 can be determined according to the target position where the stylus pen 20 is adsorbed, for example, the long frame below the display screen close to the stylus pen 20 adsorbed can be displayed as follows: Figure 7 In addition, the prompt window 701-1 may display a target image of the stylus pen 20, a device name of the stylus pen 20 (HUAWEI M-Pencil), a "Cancel" control, and a "Connect" control.
[0262] In another possible scenario, if the user directly adsorbs the stylus pen 20 to the target position of the lower long border of the tablet device 10, it can trigger the pairing of the stylus pen 20 and the tablet device 10, and executes the adsorption process and pairing process of the stylus pen 20 described above, and a prompt window 702-1 can automatically pop up on the interface 702 of the tablet device 10.
[0263] For example, the display position of the prompt window 702-1 can be determined according to the target position where the stylus pen 20 is adsorbed, for example, the long frame below the display screen close to the stylus pen 20 adsorbed can be displayed as follows: Figure 7 As shown in Figure (b).
[0264] In addition, since the prompt window 702-1 is close to the long border below the display screen, it may easily block the application icon. Accordingly, the tablet device 10 can also automatically adjust the color, transparency, image style, etc. of the prompt window 702-1 to better adapt to different display styles on the display screen, which will not be elaborated here.
[0265] Contrast with Figure 1 In FIG. (b), the method for detecting the direction of the stylus tip described in the embodiment of the present application is used. Figure 7 In Figure (b), the preset image of the stylus pen 20 displayed can be consistent with the actual orientation of the tip of the stylus pen 20, thereby improving the user's visual experience.
[0266] In another possible scenario, if the user adsorbs the stylus pen 20 to a target position on the left short border of the tablet device 10 , pairing of the stylus pen 20 and the tablet device 10 may be triggered, and a prompt window 703 - 1 may automatically pop up on the interface 703 of the tablet device 10 .
[0267] Exemplarily, the display position of the prompt window 703-1 can be determined according to the target position where the stylus pen 400 is adsorbed, for example, the short border on the left side of the display screen close to the stylus pen 400 adsorbed, showing Figure 7 In addition, the prompt window 703-1 may display a target image of the stylus pen 20, a device name of the stylus pen 20 (HUAWEI M-Pencil), a "Cancel" control, and a "Connect" control.
[0268] In addition, the tablet device 10 can also automatically adjust the size of the prompt window 703-1. For example, Figure 7 The prompt window 703-1 in (c) of FIG. 1 can be close to the short border of the display screen and be a small vertical window. The tablet device 10 can also adjust the layout in the prompt window 703-1, such as adjusting the size of the preset picture of the stylus 20, canceling the control, and connecting the control size, which is not limited in the embodiment of the present application.
[0269] In another possible scenario, if the user adsorbs the stylus pen 20 to a target position on the right short border of the tablet device 10 , pairing of the stylus pen 20 and the tablet device 10 may be triggered, and a prompt window 704 - 1 may automatically pop up on the interface 704 of the tablet device 10 .
[0270] Exemplarily, the display position of the prompt window 704-1 may also be set by default as follows: Figure 7 The prompt window 704-1 is displayed in the center as shown in (d) of FIG. 1 , so that the user can view the prompt window and perform operations on the prompt window. In addition, the prompt window 704-1 can display the target image of the stylus 20, the device name of the stylus 20 (HUAWEI M-Pencil), the "Cancel" control, and the "Connect" control. The tablet device 10 can make appropriate modifications to the content layout of the prompt window 704-1, which will not be described in detail in the embodiment of the present application.
[0271] In a possible implementation, the tablet device 10 may add corresponding display effects in the process of popping up a prompt window (e.g., prompt window 701-1, prompt window 702-1, prompt window 703-1, and prompt window 704-1). Optionally, the display of the prompt window may have a static display effect or a dynamic display effect, that is, the pop-up window process also has a dynamic playback effect.
[0272] Exemplarily, for example, the prompt window can move from top to bottom, from bottom to top, along a certain trajectory, or the prompt window can appear on the display screen in the form of blinds, diamond grids, etc. The embodiments of the present application do not limit the dynamic playback effects that the prompt window may have.
[0273] Optionally, the animation effect can match the tip acceleration of the stylus 20, for example, the prompt window can move at a certain rate on the display screen of the tablet device 10. Alternatively, the animation effect can match the user's usage habits, for example, the prompt window is set by the user to appear in a flashing manner, a bouncing manner, etc. Alternatively, the pop-up window process of the tablet device 10 is presented with a plurality of possible default animation effects, which is not limited in the embodiment of the present application.
[0274] Optionally, the pop-up process can be accompanied by dynamic changes in the size, transparency, etc. of the target image of the stylus in the prompt window. For example, the size of the target image of the stylus can be enlarged as the playback window increases, or reduced as the playback window decreases. The animation effect of the pop-up process can further provide users with a coherent immersive experience and enhance the user's visual experience.
[0275] In another possible implementation, the "target image of the stylus pen" in the embodiment of the present application may be one image or multiple images. For example, when the "target image of the stylus pen" is multiple images, the multiple target images of the stylus pen may be replaced in turn during the pop-up prompt window, for example, each of the multiple images is displayed for a fixed time, so that the prompt window also has a dynamic playback display effect, which is not limited in the embodiment of the present application.
[0276] Through the above-mentioned implementation method, the embodiment of the present application can provide users with a variety of possible prompt window display effects, such as pop-up window animation, the change process of the prompt window on the display screen, the picture display effect inside the prompt window, etc., enriching the window content and improving the user's visual experience.
[0277] 410. Determine whether to establish a Bluetooth connection based on the user's operation.
[0278] Optionally, the prompt window pops up on the display screen of the tablet device 10, and the prompt window includes a preset picture of the stylus pen 20, a device name of the stylus pen 20, a "cancel" control, a "connect" control, etc. The user can click the "connect" control in the prompt window according to his needs to further trigger the stylus pen 20 and the tablet device 10 to establish a Bluetooth connection; or, in the prompt window, click the "cancel" control to interrupt the process of establishing a Bluetooth connection between the stylus pen 20 and the tablet device 10. For simplicity, it will not be described one by one here.
[0279] To summarize, through the method for detecting the direction of the tip of the stylus pen 20 introduced in the embodiment of the present application, the stylus pen 20 can send the acceleration value of the pen end acceleration sensor in the direction of each coordinate axis to the tablet device 10, and the tablet device 10 determines the actual direction of the tip of the stylus pen 20 based on the relative value between the acceleration value reported by the stylus pen 20 and the acceleration value output by the acceleration sensor of the tablet device 10 itself, so that the tablet device 10 can match the target image for the current stylus pen 20 according to the actual direction of the tip of the stylus pen 20.
[0280] Alternatively, if the acceleration value of the pen tip accelerometer of the stylus pen 20 is not transmitted to the tablet device 10 side, or the acceleration value of the pen tip accelerometer of the stylus pen 20 fails to be transmitted, in an embodiment of the present application, the tablet device 10 can also determine the actual orientation of the tip of the stylus pen 20 through the working state of the Hall sensor, so that the tablet device 10 can match the target image for the current stylus pen 20 according to the actual orientation of the tip of the stylus pen 20.
[0281] In the above implementation process, when the stylus is adsorbed on the border of the tablet device and paired with the electronic device, the tablet device can accurately determine the actual direction of the stylus tip, avoiding the problem that the tablet device cannot identify the direction of the stylus tip when the stylus is adsorbed; in addition, when the tablet device displays the stylus picture in a pop-up window, it can select a picture that matches the actual direction of the stylus tip, instead of displaying a single preset picture with a unique pen tip direction, which enriches the content and types of pop-up pictures and greatly improves the user experience when using the stylus.
[0282] It should be noted that, 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 this article 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.
[0283] It should be understood that the methods, situations, categories and divisions of the embodiments in the present application are only for the convenience of description and should not constitute special limitations. The features of various methods, categories, situations and embodiments can be combined without contradiction.
[0284] It should also be understood that the terms "first", "second" and "third" in the embodiments of the present application are only for distinction and should not constitute any limitation to the present application. For example, "first operation", "second operation" and the like represent different operations performed by a user on the touch screen of an electronic device.
[0285] It should also be understood that in the various embodiments of the present application, the size of the serial number of each process does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0286] It should also be noted that in the embodiments of the present application, "preset", "fixed value", etc. can be implemented by pre-saving corresponding codes, tables or other methods that can be used to indicate relevant information in electronic devices (such as transmitting end devices and receiving end devices, etc.), and the present application does not limit the specific implementation method. For example, in the embodiments of the present application, "preset distance", "preset duration", etc.
[0287] It is understandable that, in order to realize the above functions, the electronic device includes hardware and / or software modules corresponding to the execution of each function. In combination with the algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in combination with the embodiments, but such implementation should not be considered to be beyond the scope of the present application.
[0288] In this embodiment, the electronic device can be divided into functional modules according to the above method example. For example, each functional module can be divided according to each function, 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.
[0289] In the case of dividing each functional module according to each function, a possible composition diagram of the electronic device involved in the above embodiment, the electronic device may include: a display unit, a detection unit and a processing unit. The display unit, the detection unit and the processing unit cooperate with each other to support the electronic device to perform the above steps, etc., and / or other processes of the technology described in this article.
[0290] 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 and will not be repeated here.
[0291] The electronic device provided in this embodiment is used to execute the above-mentioned video playback method, and thus can achieve the same effect as the above-mentioned implementation method.
[0292] In the case of using integrated units, the electronic device may include a processing module, a storage module and a communication module. Among them, the processing module can be used to control and manage the actions of the electronic device, for example, it can be used to support the electronic device to execute the steps performed by the above-mentioned display unit, detection unit and processing unit. The storage module can be used to support the electronic device to execute stored program codes and data, etc. The communication module can be used to support the communication between the electronic device and other devices.
[0293] Among them, the processing module can be a processor or a controller. It can implement or execute various exemplary logic boxes, modules and circuits described in conjunction with the disclosure of this application. The processor can 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 can be a memory. The communication module can specifically be a device that interacts with other electronic devices, such as a radio frequency circuit, a Bluetooth chip, a Wi-Fi chip, etc.
[0294] In one embodiment, when the processing module is a processor and the storage module is a memory, the electronic device involved in this embodiment may be a Figure 2 Device of the structure shown.
[0295] This embodiment also provides a computer-readable storage medium, which stores computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the above-mentioned related method steps to implement the method for detecting the direction of the stylus tip in the above embodiment.
[0296] This embodiment further provides a computer program product. When the computer program product is run on a computer, the computer is enabled to execute the above-mentioned related steps to implement the method for detecting the direction of the stylus pen tip in the above-mentioned embodiment.
[0297] In addition, an embodiment of the present application also provides a device, which may specifically be a chip, a component or a module, and the device may include a connected processor and a memory; wherein the memory is used to store computer-executable instructions, and when the device is running, the processor may execute the computer-executable instructions stored in the memory, so that the chip executes the method of detecting the direction of the stylus tip in the above-mentioned method embodiments.
[0298] Among them, the electronic device, computer-readable storage medium, computer program product or chip provided in this embodiment are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above and will not be repeated here.
[0299] 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.
[0300] In the several 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.
[0301] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0302] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0303] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.
[0304] 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 detecting the direction of a stylus tip, It is characterized in that Applied to an electronic device including a display screen, the electronic device can support a stylus pen as an input device of the electronic device, the method comprising: When the stylus is adsorbed to a preset position of a target frame of the electronic device, determining the actual direction of the stylus tip according to a relative value between the acceleration of the stylus and the acceleration of the electronic device; Determining a target image of the stylus according to the actual direction of the stylus tip, wherein the direction of the stylus tip displayed in the target image of the stylus is the same as the actual direction of the stylus tip; A prompt window is displayed on the display screen, and a target image of the stylus is dynamically displayed in the prompt window.
2. The method according to claim 1, It is characterized in that The determining the actual direction of the stylus tip according to the relative value between the acceleration of the stylus and the acceleration of the electronic device comprises: Receiving information sent by the stylus pen including acceleration of the stylus pen in a first axis direction, acceleration in a second axis direction, and acceleration in a third axis direction, wherein the first axis is parallel to the target frame, the second axis is parallel to an adjacent frame of the target frame, and the third axis is perpendicular to a plane defined by the first axis and the second axis; Acquire the acceleration of the electronic device in the direction of the first axis, the acceleration in the direction of the second axis, and the acceleration in the direction of the third axis; Relative values of the acceleration of the stylus pen and the acceleration of the electronic device are calculated in the first axis direction, the second axis direction, and the third axis direction respectively, and the actual direction of the stylus pen tip is determined.
3. The method according to claim 2, It is characterized in that The calculating the relative values of the acceleration of the stylus pen and the acceleration of the electronic device in the first axis direction, the second axis direction, and the third axis direction, and determining the actual direction of the stylus pen tip includes: Determine the difference between the acceleration of the stylus pen and the acceleration of the electronic device in the first axis direction, the second axis direction, and the third axis direction as the relative value of the acceleration of the stylus pen and the acceleration of the electronic device; When the relative values of the acceleration of the stylus pen and the acceleration of the electronic device in the first axis direction, the second axis direction, and the third axis direction are all 0, determining that the actual direction of the stylus pen tip is the first axis direction; When the relative values of the acceleration of the stylus pen and the acceleration of the electronic device in the first axis direction and the third axis direction are not 0, it is determined that the actual direction of the stylus pen tip is the opposite direction of the first axis direction.
4. The method according to any one of claims 1 to 3, It is characterized in that The electronic device further includes one or more magnetic modules and a plurality of Hall sensors, wherein the magnetic modules are used to adsorb the stylus to a preset position of the target frame, and at least one Hall sensor is disposed on both sides of each magnetic module. The method further includes: Acquire working status information of each Hall sensor of the plurality of Hall sensors; The actual direction of the stylus pen tip is determined according to the working state information of each Hall sensor of the plurality of Hall sensors.
5. The method according to any one of claims 1 to 3, It is characterized in that The prompt window is also used to display one or more of the device name, product model, manufacturer, current remaining power of the stylus, battery identification, charging progress bar, cancel control, and connection control of the stylus.
6. The method according to any one of claims 1 to 3, It is characterized in that The step of displaying a prompt window on the display screen comprises: Determine a target display effect according to the actual direction of the stylus pen tip, and / or the acceleration of the stylus pen in the direction of the first axis, and / or the acceleration of the stylus pen in the direction of the second axis, and / or the acceleration of the stylus pen in the direction of the third axis, and / or the number of pictures included in the target picture of the stylus pen, and / or a plurality of preset pop-up window effects; The prompt window is displayed on the display screen according to the target display effect.
7. The method according to any one of claims 1 to 3, It is characterized in that When the target image of the stylus pen includes multiple stylus pen images, the target image of the stylus pen is dynamically displayed in the prompt window, including: According to a preset time length, each of the plurality of stylus images is sequentially displayed in the prompt window.
8. The method according to any one of claims 1 to 3, It is characterized in that The electronic device stores a stylus data set, wherein the stylus data set includes device information and Bluetooth information of one or more preset types of styluses that can be adapted to the electronic device, and the method further includes: receiving device information sent by the stylus, and performing device verification on the stylus according to the stylus data set and the device information; and / or The Bluetooth information sent by the stylus is received, and a Bluetooth verification is performed on the stylus according to the stylus data set and the Bluetooth information.
9. An electronic device, It is characterized in that include: Display screen; One or more sensors selected from the group consisting of an accelerometer, an inertial measurement unit (IMU), and a gyroscope; one or more processors; one or more memories; The memory stores one or more programs, and when the one or more programs are executed by the processor, the electronic device executes the method according to any one of claims 1 to 8.
10. A readable storage medium, It is characterized in that The readable storage medium stores a program, and when the program is executed on an electronic device, the electronic device executes the method according to any one of claims 1 to 8.
