Touch pen control method and device, electronic equipment and storage medium

By establishing a communication connection between the stylus and electronic devices and dynamically adjusting the coding parameters, the existing stylus functions are solved and the problems of single user experience are achieved, and flexible switching of the touch screen and efficient user interaction are achieved.

CN119473027APending Publication Date: 2025-02-18BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311006544.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-08-10
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

When connecting multiple electronic devices, the existing stylus has a relatively single function and a low user experience, making it difficult to achieve flexible switching of touch screens.

Method used

Dynamic adjustment of coding parameters is achieved by establishing a communication connection between the stylus and the electronic device. The specific steps include receiving a coding parameter adjustment request sent by the electronic device, querying the preset coding parameter mapping table, obtaining the associated coding parameters, and outputting the coding signal based on the parameter.

Benefits of technology

It realizes timely adjustment of coding parameters by the stylus pen, meets the needs of different touch screens, and improves the switching flexibility and user experience of touch screens.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119473027A_ABST
    Figure CN119473027A_ABST
Patent Text Reader

Abstract

The invention provides a touch pen control method and device, electronic equipment and a storage medium, and relates to the technical field of intelligent control. Comprising the steps that a coding parameter adjusting request sent by first electronic equipment is received, and the coding parameter adjusting request comprises the current first refresh rate and the first index of a first touch screen of the first electronic equipment; querying a first preset coding parameter mapping table to obtain a first coding parameter associated with the first refresh rate and the first index; and outputting a coding signal to the first touch screen based on the first coding parameter. Therefore, the coding parameter of the coding signal currently output by the touch pen can be adjusted in time, so that the adjusted first coding parameter can meet the requirement of the touch screen, and the switching of the touch screen is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of intelligent control technology, and in particular to a stylus control method, device, electronic device and storage medium. Background Art

[0002] As users have higher and higher requirements for the experience of using electronic products, stylus pens are playing an increasingly important role, such as taking notes or drawing on tablets, and the stylus buttons can also quickly take screenshots, etc. In related technologies, a stylus can usually only be connected to one device, such as a tablet or a folding screen, with relatively single functions and low user experience. Summary of the invention

[0003] The present disclosure aims to solve one of the technical problems in the related art at least to some extent.

[0004] The first aspect of the present disclosure provides a stylus control method, which is executed by the stylus, and the method includes:

[0005] Receiving a coding parameter adjustment request sent by a first electronic device, wherein the coding parameter adjustment request includes a current first refresh rate and a first index of a first touch screen of the first electronic device;

[0006] Querying a first preset coding parameter mapping table to obtain a first coding parameter associated with the first refresh rate and the first index;

[0007] Based on the first coding parameter, a coding signal is output to the first touch screen.

[0008] A second aspect of the present disclosure provides a stylus control method, which is executed by an electronic device and includes:

[0009] When the coding parameter adjustment condition is met, determining the current first refresh rate of the touch screen;

[0010] Querying a second preset coding parameter mapping table to obtain a first index and a first coding parameter associated with the first refresh rate;

[0011] Sending a coding parameter adjustment request to the stylus, wherein the coding parameter adjustment request includes the first refresh rate and the first index;

[0012] Based on the first coding parameter, a coding signal output by the stylus pen is received.

[0013] A third aspect of the present disclosure provides a stylus control device, which is configured in a stylus, and the device includes:

[0014] A receiving module, configured to receive a coding parameter adjustment request sent by an electronic device, wherein the coding parameter adjustment request includes a current first refresh rate and a first index of a touch screen of the electronic device;

[0015] A first query module, used for querying a first preset coding parameter mapping table to obtain a first coding parameter associated with the first refresh rate and the first index;

[0016] An output module is used to output a coding signal to the touch screen based on the first coding parameter.

[0017] A fourth aspect of the present disclosure provides a stylus control device, which is configured in an electronic device, and includes:

[0018] A determination module, used to determine the current first refresh rate of the touch screen when the coding parameter adjustment condition is met;

[0019] A second query module, used for querying a second preset coding parameter mapping table to obtain a first index and a first coding parameter associated with the first refresh rate;

[0020] A sending module, configured to send a coding parameter adjustment request to the stylus pen, wherein the coding parameter adjustment request includes the first refresh rate and the first index;

[0021] A receiving module is used to receive a coding signal output by the stylus pen based on the first coding parameter.

[0022] The fifth aspect of the present disclosure proposes an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the stylus control method proposed in the embodiment of the first aspect of the present disclosure is implemented.

[0023] A sixth aspect of the present disclosure proposes a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the stylus control method proposed in the embodiment of the first aspect of the present disclosure is implemented.

[0024] The stylus pen control method, device, electronic device and storage medium provided by the present disclosure have the following

[0025] Beneficial effects:

[0026] The stylus first receives a coding parameter adjustment request sent by the first electronic device, wherein the coding parameter adjustment request includes the current first refresh rate and first index of the first touch screen of the first electronic device, and then queries a first preset coding parameter mapping table to obtain the first coding parameter associated with the first refresh rate and the first index, and then outputs a coding signal to the first touch screen based on the first coding parameter. Thus, the coding parameter of the coding signal currently output by the stylus can be adjusted in time, so that the adjusted first coding parameter can meet the needs of the touch screen, and the touch screen can be switched.

[0027] When the condition for adjusting the coding parameters is met, the electronic device determines the current first refresh rate of the touch screen, then queries the second preset coding parameter mapping table to obtain the first index and the first coding parameter associated with the first refresh rate, and then sends a coding parameter adjustment request to the stylus, wherein the coding parameter adjustment request includes the first refresh rate and the first index, and then can receive the coding signal output by the stylus based on the first coding parameter. Thus, when the condition for adjusting the coding parameters is met, the coding parameter adjustment request can be sent to the stylus, so that the stylus adjusts the coding parameters to meet the needs of the touch screen, and receives the coding signal based on the corresponding first coding parameter.

[0028] Additional aspects and advantages of the present disclosure will be given in part in the following description and in part will be obvious from the following description or learned through practice of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] The above and / or additional aspects and advantages of the present disclosure will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0030] Figure 1 A schematic diagram of a flow chart of a touch pen control method provided by an embodiment of the present disclosure;

[0031] Figure 2 A schematic flow chart of another stylus control method provided by an embodiment of the present disclosure;

[0032] Figure 3 A schematic flow chart of another stylus control method provided by an embodiment of the present disclosure;

[0033] Figure 4 A schematic flow chart of another stylus control method provided by an embodiment of the present disclosure;

[0034] Figure 5 A schematic diagram of interaction between a stylus pen and an electronic device provided by an embodiment of the present disclosure;

[0035] Figure 6A schematic diagram of the structure of a stylus control device provided by an embodiment of the present disclosure;

[0036] Figure 7 A schematic diagram of the structure of a stylus control device provided by an embodiment of the present disclosure;

[0037] Figure 8 A block diagram of an exemplary electronic device suitable for implementing embodiments of the present disclosure is shown. DETAILED DESCRIPTION

[0038] Embodiments of the present disclosure are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present disclosure, and should not be construed as limiting the present disclosure.

[0039] The embodiment of the present disclosure takes the stylus control method being configured in a stylus control device as an example. The stylus control device can be applied to any electronic device, such as a touch screen or a stylus, so that the electronic device can execute the stylus control method, which is not limited here.

[0040] The following describes the stylus pen control method, device, electronic device, and storage medium according to the embodiments of the present disclosure with reference to the accompanying drawings.

[0041] Figure 1 A schematic flow chart of a stylus pen control method provided in an embodiment of the present disclosure.

[0042] like Figure 1 As shown, the stylus pen control method is executed by the stylus pen and may include the following steps:

[0043] Step 101: receiving a coding parameter adjustment request sent by a first electronic device, wherein the coding parameter adjustment request includes a current first refresh rate and a first index of a first touch screen of the first electronic device.

[0044] The electronic device may be a tablet computer, a computer, a mobile phone, a television, or any other device with a touch screen, which is not limited here. The first electronic device may be an electronic device that currently sends a coding parameter adjustment request to the stylus.

[0045] It should be noted that, when a communication connection is established between the first electronic device and the stylus, the stylus can receive the coding parameter adjustment request sent by the first electronic device. As a possible implementation method, before receiving the coding parameter adjustment request sent by the touch screen of the first electronic device, the stylus can establish a communication connection with multiple electronic devices (including the first electronic device). The stylus can receive the coding parameter adjustment request sent by each electronic device in real time.

[0046] Optionally, the multiple electronic devices can be different types of devices. For example, the stylus can establish communication with a mobile phone and a tablet computer at the same time, so that the stylus can touch the mobile phone or tablet computer. If the stylus was originally used on a mobile phone for a period of time and then moved to a tablet computer for touch control, the tablet computer can determine whether the conditions for sending a coding parameter adjustment request are met, that is, the coding parameter adjustment conditions are met. If the coding parameter adjustment conditions are met, the tablet computer can send a coding parameter adjustment request to the stylus so that the stylus updates the current coding parameters.

[0047] For example, if the coding parameter A is used when the stylus is used on a mobile phone, when the stylus is switched to a tablet computer, the tablet computer needs to adjust the coding parameter A currently used by the stylus, thereby updating it to the coding parameter that matches the tablet computer. Therefore, a coding parameter adjustment request can be sent to the stylus at this time. Since the stylus has established communication with the tablet computer, it can receive the coding parameter adjustment request, which is not limited here.

[0048] Alternatively, if the stylus is used on a mobile phone, the current screen refresh rate of the mobile phone touch screen is A1, and the stylus uses the mobile phone touch screen through the coding parameter U matching A1. If the mobile phone touch screen changes the screen refresh rate from A1 to A2, the coding parameters U and A2 are not matching at this time, so a coding parameter adjustment request can be sent to the stylus so that the stylus can adjust the coding parameter U to meet the screen refresh rate A2, which is not limited here.

[0049] As a possible implementation method, the stylus can establish a BLE (Bluetooth Low Energy) connection with the electronic device in advance. Among them, BLE adopts a master-slave architecture, with the stylus as the master device and each electronic device as the slave device, so as to support wireless communication between the stylus and multiple electronic devices, and enable the stylus to connect to multiple electronic devices at the same time. As a result, the stylus can receive a coding parameter adjustment request sent by any electronic device that is currently establishing a communication connection.

[0050] Among them, the touch screen can be a tablet touch screen, a computer touch screen, a folding screen, a TV touch screen, etc., which is not limited here.

[0051] It should be noted that the touch screen can be a capacitive touch screen, an electromagnetic touch screen or a pressure-sensitive touch screen, which is not limited here. Among them, the capacitive touch screen can detect the position and pressure of the touch and support stylus operation. The electromagnetic touch screen uses electromagnetic induction to detect the position and pressure of the stylus, so it can support stylus operation. The pressure-sensitive touch screen can implement different operations according to the change of touch pressure, so it can support stylus operation.

[0052] The coding parameters may be parameters used for communication and interaction between the touch screen and the stylus. During the communication process between the touch screen and the stylus, some parameters need to be defined to ensure accurate touch input and response, namely, coding parameters.

[0053] The coding parameters may be resolution parameters, pressure parameters, delay parameters, sensitivity parameters, etc., which are not limited here. The pressure parameters can be used to adjust the pressure response range and sensitivity of the pen tip. The sensitivity can adapt to the touch strength and finger / pen tip size of different users. The resolution parameter of the touch screen refers to the number of pixels per inch on the screen, while the resolution of the stylus refers to the precise position of the pen tip. Accurate touch input and delicate operation can be achieved through resolution matching.

[0054] It should be noted that the coding parameters corresponding to the same touch screen at different refresh rates may be different.

[0055] The coding parameter adjustment request may be used to adjust the coding parameters of the stylus pen, so that the stylus pen can be used in the touch screen.

[0056] Among them, the first refresh rate can be the current screen refresh rate of the touch screen, such as 60 Hz, which is not limited here.

[0057] The first index may be index information between the first refresh rate and the coding parameter associated with the first refresh rate. Through the first index, the stylus pen may determine the coding parameter associated with the first refresh rate.

[0058] Step 102: query a first preset coding parameter mapping table to obtain a first coding parameter associated with a first refresh rate and a first index.

[0059] The coding parameter mapping table may include coding parameters corresponding to different refresh rates and indexes.

[0060] The first preset coding parameter mapping table may be a coding parameter mapping table stored in the stylus pen.

[0061] The first coding parameter may be a coding parameter corresponding to the first refresh rate and the first index.

[0062] Specifically, after the stylus receives the coding parameter adjustment request, it can query the coding parameter mapping table to obtain the first coding parameter corresponding to the first refresh rate and the first index.

[0063] For example, if the first refresh rate is 90 Hz and the first index is ID1, the stylus can obtain the first coding parameter corresponding to the refresh rate of 90 Hz and ID1 from the coding parameter mapping table.

[0064] It should be noted that the first preset coding parameter mapping table may store coding parameters corresponding to each refresh rate and index corresponding to each electronic device.

[0065] For example, the first preset coding parameter mapping table may be as shown in the following table:

[0066] index Refresh rate Coding parameters ID1 60Hz E1 ID2 90Hz E2 ID3 100Hz E3 ID4 60Hz E4 ID5 70Hz E5 ID6 80Hz E6

[0067] As shown in the table above, when the refresh rate is the same but the index is different, the coding parameters are also different. If the first preset coding parameter mapping table contains indexes corresponding to multiple electronic devices, then when two or more electronic devices have the same refresh rate, different indexes need to be generated. Among them, ID1, ID2, and ID3 can be for tablets, and ID4, ID5, and ID6 can be for folding screens. Different refresh rates of tablets correspond to different coding parameters E1, E2, and E3, and different refresh rates of folding screens correspond to different coding parameters E4, E5, and E6. When the tablet and folding screen both have a 60Hz refresh rate, the corresponding indexes are different, ID2 and ID4, respectively, and the corresponding coding parameters are also different, E1 and E4, respectively.

[0068] Step 103: output a coding signal to the first touch screen based on the first coding parameter.

[0069] It should be noted that the touch screen in the embodiment of the present disclosure may be a TPIC touch screen, which uses a TPIC (Touch Panel Integrated Circuit) chip to detect and process touch input. A TPIC chip is an integrated circuit with special functions and algorithms for processing touch input signals on a touch screen.

[0070] The communication and interaction between the TPIC touch screen and the stylus is achieved through coding parameters. Coding parameters refer to the parameters used when the touch screen and the stylus communicate. When the stylus moves or clicks on the TPIC touch screen, the stylus will generate corresponding coding signals based on the current position and operation action, and send them to the TPIC touch screen.

[0071] The coding signal is a specific electrical signal that contains the coordinate information of the position of the touch pen tip and other possible parameters, such as pressure sensitivity. The TPIC touch screen will receive and parse the coding signal, determine the coordinates of the touch point based on the position information in the signal, and convert it into corresponding operations or instructions. By setting and optimizing the coding parameters, the accuracy and response speed between the TPIC touch screen and the stylus can be improved, thereby enhancing the user's touch experience. The first touch screen can receive and parse the coding signal, determine the coordinates of the touch point based on the position information in the coding signal, and convert it into corresponding operations or instructions based on the first coding parameters. As a result, the user can perform precise operations on the first touch screen with the stylus, such as writing, drawing, clicking, etc.

[0072] As an optional implementation method, before outputting a coding signal to the touch screen based on the first coding parameter, the coding parameter of the stylus pen can be switched from the second coding parameter to the first coding parameter, wherein the second coding parameter is a coding parameter associated with the second touch screen of the second electronic device connected to the stylus pen.

[0073] The second coding parameter may be a coding parameter used by the stylus pen in conjunction with the second electronic device before receiving the coding parameter adjustment request.

[0074] The second touch screen may be a touch screen of a second electronic device, that is, a touch screen used by the stylus before switching to the first touch screen. The second electronic device may be an electronic device used by the stylus for touch control before receiving the coding parameter adjustment request.

[0075] For example, if the stylus was originally used for touch control on a mobile phone and then moved to a tablet for touch control, then the mobile phone can be the second electronic device, the touch screen of the mobile phone is the second touch screen, and the coding parameters used in conjunction with the stylus and the mobile phone are the second coding parameters. The stylus can switch the second coding parameters to the first coding parameters used in conjunction with the tablet, and the tablet is the first electronic device.

[0076] Alternatively, if the stylus pen does not switch the electronic device but the electronic device adjusts the refresh rate, the stylus pen can adjust the coding parameter to the coding parameter corresponding to the refresh rate adjusted by the electronic device, that is, the first coding parameter.

[0077] As an example, if the stylus originally used with the refresh rate K1 of the first electronic device has a coding parameter P1, and the first electronic device adjusts the refresh rate from K1 to K2, the stylus needs to adjust the coding parameter P1 to the first coding parameter corresponding to the refresh rate K2.

[0078] In the disclosed embodiment, the stylus first receives a coding parameter adjustment request sent by the first electronic device, wherein the coding parameter adjustment request includes the current first refresh rate and first index of the first touch screen of the first electronic device, and then queries a first preset coding parameter mapping table to obtain the first coding parameter associated with the first refresh rate and the first index, and then outputs a coding signal to the first touch screen based on the first coding parameter. Thus, the coding parameter of the coding signal currently output by the stylus can be adjusted in time, so that the adjusted first coding parameter can meet the needs of the touch screen, and the touch screen can be switched.

[0079] Figure 2 A schematic flow chart of a stylus pen control method provided in an embodiment of the present disclosure.

[0080] like Figure 2 As shown, the stylus pen control method is executed by the stylus pen and may include the following steps:

[0081] Step 201: receiving an index generation request sent by a first electronic device, wherein the index generation request includes a first refresh rate and a first coding parameter.

[0082] The index generation request is used to request the stylus to generate index information between the first refresh rate and the first coding parameter.

[0083] As an example, the first electronic device may send an index generation request to the stylus when establishing a communication connection with the stylus for the first time, so as to send the current first refresh rate and the first coding parameter associated with the first refresh rate to the stylus, so that the stylus can receive the index generation request sent by the first electronic device.

[0084] It should be noted that during the process of establishing a communication connection between the first electronic device and the stylus for the first time, when the stylus is touching the first electronic device, the first electronic device changes the refresh rate, then the first electronic device can send an index generation request to the stylus, thereby sending the changed refresh rate and the coding parameters corresponding to the changed refresh rate to the stylus, so that the stylus can receive the index generation request sent by the first electronic device.

[0085] Step 202: Generate a first index associated with a first refresh rate and a first coding parameter, wherein the first index is different from a second index in a coding parameter mapping table.

[0086] The second index may be an index that associates the remaining refresh rates except the first refresh rate with the corresponding coding parameters in the coding parameter mapping table.

[0087] Specifically, after receiving the index generation request, the stylus pen can generate a first index associated with the first refresh rate and the first coding parameter. For example, if the first refresh rate is 80 Hz and the first coding parameter is D, the index information ID2 associated with 80 Hz and D can be generated. Therefore, after the stylus pen receives a coding parameter adjustment request, if the coding parameter adjustment request includes the first refresh rate 80 Hz and the first index ID2, the stylus pen can determine the first coding parameter D associated with the first refresh rate 80 Hz according to the first index ID2.

[0088] Optionally, after generating the first index, the stylus pen may send the first index, the first refresh rate and the first coding parameter to the touch screen, whereby the touch screen may store the first index, the first refresh rate and the first coding parameter in an associated manner.

[0089] Step 203: associate the first index, the first refresh rate and the first coding parameter and store them in a first preset coding parameter mapping table.

[0090] Specifically, the first index, the first refresh rate and the first coding parameter can be associated and stored in a first preset coding parameter mapping table, so that after the stylus receives a coding parameter adjustment request, if the coding parameter adjustment request includes the first refresh rate and the first index, the stylus can determine the first coding parameter associated with the first refresh rate based on the first index.

[0091] Step 204: receiving a coding parameter adjustment request sent by the first electronic device, wherein the coding parameter adjustment request includes a current first refresh rate and a first index of the first touch screen of the first electronic device.

[0092] Step 205 , querying a first preset coding parameter mapping table to obtain a first coding parameter associated with a first refresh rate and a first index.

[0093] Step 206: output a coding signal to the first touch screen based on the first coding parameter.

[0094] It should be noted that the specific implementation of steps 204-206 can refer to the above embodiment and will not be described in detail here.

[0095] In the disclosed embodiment, the stylus first receives an index generation request sent by a first electronic device, wherein the index generation request includes a first refresh rate and a first coding parameter, then generates a first index associated with the first refresh rate and the first coding parameter, wherein the first index is different from a second index in a coding parameter mapping table, then stores the first index, the first refresh rate and the first coding parameter in association with each other in a first preset coding parameter mapping table, receives a coding parameter adjustment request sent by the first electronic device, wherein the coding parameter adjustment request includes the current first refresh rate and the first index of the first touch screen of the first electronic device, then queries the first preset coding parameter mapping table to obtain the first coding parameter associated with the first refresh rate and the first index, and then outputs a coding signal to the first touch screen based on the first coding parameter. Thus, the association relationship between the first index, the first refresh rate and the first coding parameter can be established in advance and stored, so that the associated first coding parameter can be directly obtained according to the first refresh rate and the first index.

[0096] Figure 3 A schematic flow chart of a stylus pen control method provided in an embodiment of the present disclosure.

[0097] like Figure 3 As shown, the stylus pen control method is executed by an electronic device and may include the following steps:

[0098] Step 301, when the coding parameter adjustment condition is met, determine the current first refresh rate of the touch screen.

[0099] The coding parameter adjustment condition is used to control the stylus pen to adjust the current coding parameters.

[0100] As a possible implementation method, the electronic device may determine that the coding parameter adjustment condition is met when a refresh rate adjustment instruction is received and the stylus pen is in contact with any position of the touch screen.

[0101] The refresh rate adjustment instruction is used to update the refresh rate of the touch screen, such as adjusting 60 Hz to 75 Hz, which is not limited here.

[0102] The first refresh rate may be the current refresh rate of the touch screen, or may be the refresh rate to be adjusted contained in the refresh rate. For example, if the refresh rate adjustment instruction is to adjust 60 Hz to 75 Hz, the current first refresh rate of the touch screen may be the adjusted refresh rate, i.e., 75 Hz, which is not limited here.

[0103] For example, if the current refresh rate of the touch screen is 60Hz, and the stylus is clicking on position A on the touch screen, if the touch screen receives a refresh rate adjustment instruction and needs to adjust the refresh rate from 60Hz to 75Hz, then the coding parameter adjustment conditions are currently met.

[0104] It should be noted that if the stylus pen is not currently touching the touch screen, the stylus pen may be touching another screen, so when the refresh rate adjustment instruction is received, the coding parameter adjustment condition is not met.

[0105] As another possible implementation method, the electronic device detects that the stylus pen is currently in contact with any position of the touch screen, and no coding signal output by the stylus pen is received within a preset period of time before the current moment.

[0106] It should be noted that if the stylus starts a touch operation on the touch screen, for example, if the stylus moves from touch screen A to touch screen B, and no coding signal output by the stylus is received within a preset period of time before touch screen B is touched, it can be considered that the conditions for adjusting the coding parameters are met.

[0107] Step 302: query a second preset coding parameter mapping table to obtain a first index and a first coding parameter associated with a first refresh rate.

[0108] The second preset coding parameter mapping table may be a coding parameter mapping table stored in the touch screen.

[0109] It should be noted that the second preset coding parameter mapping table may include indexes and coding parameters corresponding to various refresh rates. Specifically, the associated first index and first coding parameter may be obtained according to the first refresh rate.

[0110] For example, the second preset coding parameter mapping table may be as shown in the following table:

[0111] Refresh rate index Coding parameters 60Hz ID1 E1 90Hz ID2 E2 100Hz ID3 E3 120Hz ID4 E4

[0112] It should be noted that each refresh rate has a corresponding index and coding parameter. The above example is only an illustrative description and is not intended to limit the present disclosure.

[0113] Step 303: Send a coding parameter adjustment request to the stylus, wherein the coding parameter adjustment request includes a first refresh rate and a first index.

[0114] Specifically, the electronic device may send a coding parameter adjustment request to the stylus pen, so that the stylus pen may adjust its own first coding parameter according to the coding parameter adjustment request, and output a corresponding coding signal to the touch screen based on the first coding parameter.

[0115] Step 304: receiving a coding signal output by the stylus based on the first coding parameter.

[0116] It should be noted that when the stylus moves or clicks on the touch screen, the touch position information can be transmitted to the touch screen via a coding signal.

[0117] Specifically, the coding signal is a specific electrical signal. When the stylus pen interacts with the touch screen, the stylus pen will generate a corresponding coding signal based on the current position and operation action, as well as the coding parameters, and send it to the touch screen.

[0118] Therefore, the electronic device can receive and analyze the coding signal based on the touch screen, determine the coordinates of the touch point based on the position information in the coding signal, and convert it into a corresponding operation or instruction based on the first coding parameter. As a result, the user can use the stylus pen to perform precise operations on the touch screen, such as writing, drawing, clicking, etc.

[0119] Specifically, after the touch screen receives the coding signal, the electronic device can parse the coding signal based on the first coding parameter, display the corresponding display result on the touch screen according to the analysis result, and perform the corresponding operation according to the analysis result.

[0120] When the condition for adjusting the coding parameters is met, the electronic device determines the current first refresh rate of the touch screen, then queries the second preset coding parameter mapping table to obtain the first index and the first coding parameter associated with the first refresh rate, and then sends a coding parameter adjustment request to the stylus, wherein the coding parameter adjustment request includes the first refresh rate and the first index, and then can receive the coding signal output by the stylus based on the first coding parameter. Thus, when the condition for adjusting the coding parameters is met, the coding parameter adjustment request can be sent to the stylus, so that the stylus adjusts the coding parameters to meet the needs of the touch screen, and receives the coding signal based on the corresponding first coding parameter.

[0121] Figure 4 A schematic flow chart of a stylus pen control method provided in an embodiment of the present disclosure.

[0122] like Figure 4 As shown, the stylus pen control method is executed by an electronic device and may include the following steps:

[0123] Step 401, when the coding parameter adjustment condition is met, determine the current first refresh rate of the touch screen.

[0124] It should be noted that the specific implementation of step 401 can refer to the above embodiment and will not be described in detail here.

[0125] Step 402: Send an index generation request to the stylus, wherein the index generation request includes a first refresh rate and a first coding parameter.

[0126] The index generation request is used to request the stylus to generate index information between the first refresh rate and the first coding parameter.

[0127] As an example, the first electronic device may send an index generation request to the stylus when establishing a communication connection with the stylus for the first time, so as to send the current first refresh rate and the first coding parameter associated with the first refresh rate to the stylus, so that the stylus can receive the index generation request sent by the first electronic device.

[0128] It should be noted that during the process of establishing a communication connection between the first electronic device and the stylus for the first time, when the stylus is touching the first electronic device, the first electronic device changes the refresh rate, then the first electronic device can send an index generation request to the stylus, so that the changed refresh rate and the coding parameters corresponding to the changed refresh rate are sent to the stylus, so that the stylus can receive the index generation request sent by the first electronic device.

[0129] Step 403: Receive the first index returned by the stylus.

[0130] Step 404: associate the first index, the first refresh rate, and the first coding parameter and store them in a second preset coding parameter mapping table.

[0131] Specifically, after receiving the first index, the electronic device can store the first index, the first refresh rate and the first coding parameter in association, so that the electronic device can then obtain the first index and the first coding parameter associated with the first refresh rate according to the second preset coding parameter mapping table.

[0132] As a possible implementation method, when the touch screen supports multiple refresh rates, an index generation request can be sent to the stylus based on the second refresh rate and the second coding parameter associated with the second refresh rate, and then the second index returned by the stylus can be received. Then, the second index, the second refresh rate and the second coding parameter can be associated and stored in a second preset coding parameter mapping table.

[0133] The second refresh rate is a refresh rate among multiple refresh rates except the first refresh rate.

[0134] The second index may be index information between the second refresh rate and the coding parameter associated with the second refresh rate. Through the second index, the stylus pen may determine the coding parameter associated with the second refresh rate.

[0135] Figure 5 A schematic diagram of interaction between a stylus pen and an electronic device is shown.

[0136] like Figure 5 As shown, TPIC is a touch screen, and the stylus (stylus) can be connected to the tablet Bluetooth via BLE. The electronic device sends multiple index generation requests to the stylus via the tablet Bluetooth, which are index generation requests corresponding to 60Hz resolution, 90Hz resolution, 120Hz resolution, and 144Hz resolution, respectively, and obtains the corresponding 4 indexes, namely ID1, ID2, ID3 and ID4. After generating the index, the stylus associates and stores the 60Hz resolution, 90Hz resolution, 120Hz resolution, 144Hz resolution and the corresponding indexes ID1, ID2, ID3 and ID4, respectively, and the corresponding coding parameters.

[0137] Step 405 , querying a second preset coding parameter mapping table to obtain a first index and a first coding parameter associated with the first refresh rate.

[0138] Step 406: Send a coding parameter adjustment request to the stylus, wherein the coding parameter adjustment request includes the first refresh rate and the first index.

[0139] Step 407: receiving a coding signal output by the stylus pen based on the first coding parameter.

[0140] It should be noted that the specific implementation of steps 405, 406, and 407 can refer to the above embodiment and will not be described in detail here.

[0141] The electronic device first determines the current first refresh rate of the touch screen when the condition for adjusting the coding parameters is met, and then sends an index generation request to the stylus, wherein the index generation request includes the first refresh rate and the first coding parameter, and then receives the first index returned by the stylus, and then stores the first index, the first refresh rate and the first coding parameter in association with each other in the second preset coding parameter mapping table, and then queries the second preset coding parameter mapping table to obtain the first index and the first coding parameter associated with the first refresh rate, and then sends a coding parameter adjustment request to the stylus, wherein the coding parameter adjustment request includes the first refresh rate and the first index, and then can receive the coding signal output by the stylus based on the first coding parameter. Thus, the first index, the first refresh rate and the first coding parameter can be stored in association with each other in the second preset coding parameter mapping table in a timely manner, and the coding parameter adjustment request can be sent to the stylus when the condition for adjusting the coding parameters is met, so that the stylus adjusts the coding parameters to meet the needs of the touch screen, and receives the coding signal based on the corresponding first coding parameter.

[0142] In order to implement the above embodiments, the present disclosure also provides a stylus control device.

[0143] Figure 6 A schematic diagram of the structure of a stylus pen control device provided in an embodiment of the present disclosure.

[0144] like Figure 6 As shown, the stylus control device 600 may include:

[0145] The receiving module 610 is configured to receive a coding parameter adjustment request sent by a first electronic device, wherein the coding parameter adjustment request includes a current first refresh rate and a first index of a first touch screen of the first electronic device;

[0146] A first query module 620, configured to query a first preset coding parameter mapping table to obtain a first coding parameter associated with the first refresh rate and the first index;

[0147] The output module 630 is used to output a coding signal to the first touch screen based on the first coding parameter.

[0148] Optionally, the output module is further used for:

[0149] The coding parameters of the stylus pen are switched from the second coding parameters to the first coding parameters, wherein the second coding parameters are coding parameters associated with a second touch screen of a second electronic device connected to the stylus pen.

[0150] Optionally, the receiving module further includes:

[0151] A first receiving unit, configured to receive an index generation request sent by the first electronic device, wherein the index generation request includes the first refresh rate and a first coding parameter;

[0152] A generating unit, configured to generate a first index associated with the first refresh rate and the first coding parameter, wherein the first index is different from a second index in the coding parameter mapping table;

[0153] The first storage unit is used to associate the first index, the first refresh rate and the first coding parameter and store them in the first preset coding parameter mapping table.

[0154] Optionally, the generating unit is further used for:

[0155] The first index, the first refresh rate and the first coding parameter are sent to the first touch screen.

[0156] The stylus first receives a coding parameter adjustment request sent by the first electronic device, wherein the coding parameter adjustment request includes the current first refresh rate and first index of the first touch screen of the first electronic device, and then queries a first preset coding parameter mapping table to obtain the first coding parameter associated with the first refresh rate and the first index, and then outputs a coding signal to the first touch screen based on the first coding parameter. Thus, the coding parameter of the coding signal currently output by the stylus can be adjusted in time, so that the adjusted first coding parameter can meet the needs of the touch screen, and the touch screen can be switched.

[0157] Figure 7 A schematic diagram of the structure of a stylus pen control device provided in an embodiment of the present disclosure.

[0158] like Figure 7 As shown, the stylus control device 700 may include:

[0159] A determination module 710 is used to determine the current first refresh rate of the touch screen when the coding parameter adjustment condition is met;

[0160] A second query module 720, configured to query a second preset coding parameter mapping table to obtain a first index and a first coding parameter associated with the first refresh rate;

[0161] A sending module 730 is configured to send a coding parameter adjustment request to the stylus pen, wherein the coding parameter adjustment request includes the first refresh rate and the first index;

[0162] The receiving module 740 is configured to receive a coding signal output by the stylus pen based on the first coding parameter.

[0163] Optionally, the condition for adjusting the coding parameters includes any one of the following:

[0164] A refresh rate adjustment instruction is received, and the stylus pen is in contact with any position of the touch screen;

[0165] It is monitored that the stylus pen is currently in contact with any position of the touch screen, and no coding signal output by the stylus pen is received within a preset period of time before the current moment.

[0166] Optionally, the second query module further includes:

[0167] A sending unit, configured to send an index generation request to the stylus pen, wherein the index generation request includes the first refresh rate and the first coding parameter;

[0168] A second receiving unit, configured to receive a first index returned by the stylus;

[0169] The second storage unit is used to associate the first index, the first refresh rate and the first coding parameter and store them in the second preset coding parameter mapping table.

[0170] Optionally, the second storage unit is further used for:

[0171] In the case where the touch screen supports multiple refresh rates, sending an index generation request to the stylus based on a second refresh rate and a second coding parameter associated with the second refresh rate, wherein the second refresh rate is a refresh rate among the multiple refresh rates except the first refresh rate;

[0172] receiving a second index returned by the stylus;

[0173] The second index, the second refresh rate and the second coding parameter are associated and stored in the second preset coding parameter mapping table.

[0174] When the condition for adjusting the coding parameters is met, the electronic device determines the current first refresh rate of the touch screen, then queries the second preset coding parameter mapping table to obtain the first index and the first coding parameter associated with the first refresh rate, and then sends a coding parameter adjustment request to the stylus, wherein the coding parameter adjustment request includes the first refresh rate and the first index, and then can receive the coding signal output by the stylus based on the first coding parameter. Thus, when the condition for adjusting the coding parameters is met, the coding parameter adjustment request can be sent to the stylus, so that the stylus adjusts the coding parameters to meet the needs of the touch screen, and receives the coding signal based on the corresponding first coding parameter.

[0175] In order to implement the above embodiments, the present disclosure further proposes an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the stylus control method proposed in the above embodiments of the present disclosure is implemented.

[0176] In order to implement the above embodiments, the present disclosure further proposes a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the stylus control method proposed in the above embodiments of the present disclosure is implemented.

[0177] Figure 8 A block diagram of an exemplary electronic device suitable for implementing embodiments of the present disclosure is shown. Figure 8 The electronic device 12 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0178] like Figure 8As shown, the electronic device 12 is in the form of a general purpose computing device. The components of the electronic device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that connects various system components (including the system memory 28 and the processing unit 16).

[0179] The bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor or a local bus using any of a variety of bus structures. For example, these architectures include but are not limited to Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus and Peripheral Component Interconnection (PCI) bus.

[0180] The electronic device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the electronic device 12, including volatile and non-volatile media, removable and non-removable media.

[0181] The memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. The electronic device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be used to read and write non-removable, non-volatile magnetic media ( Figure 8 not shown, usually called a "hard drive"). Although Figure 8Not shown in the figure, a disk drive for reading and writing a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing a removable non-volatile optical disk (e.g., a compact disc read only memory (CD-ROM), a digital versatile disc read only memory (DVD-ROM), or other optical media) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the various embodiments of the present disclosure.

[0182] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in the memory 28, such program modules 42 including but not limited to an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules 42 generally perform the functions and / or methods of the embodiments described in the present disclosure.

[0183] The electronic device 12 may also communicate with one or more external devices 14 (e.g., keyboards, pointing devices, displays 24, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 12, and / or may communicate with any device that enables the electronic device 12 to communicate with one or more other computing devices (e.g., network cards, modems, etc.). Such communication may be performed via an input / output (I / O) interface 22. Furthermore, the electronic device 12 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 20. As shown, the network adapter 20 communicates with other modules of the electronic device 12 via a bus 18. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0184] The processing unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, such as implementing the methods mentioned in the above embodiments.

[0185] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present disclosure. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0186] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of the present disclosure, "plurality" means at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0187] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present disclosure includes additional implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present disclosure belong.

[0188] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute the instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purpose of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.

[0189] It should be understood that the various parts of the present disclosure can be implemented in hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. If implemented in hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0190] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.

[0191] In addition, each functional unit in each embodiment of the present disclosure may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.

[0192] The storage medium mentioned above may be a read-only memory, a disk or an optical disk, etc. Although the embodiments of the present disclosure have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limitations of the present disclosure. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present disclosure.

Claims

1. A touch pen control method, characterized in that: The method is performed by a stylus pen, and the method includes: Receiving a coding parameter adjustment request sent by a first electronic device, wherein the coding parameter adjustment request includes a current first refresh rate and a first index of a first touch screen of the first electronic device; Querying a first preset coding parameter mapping table to obtain a first coding parameter associated with the first refresh rate and the first index; Based on the first coding parameter, a coding signal is output to the first touch screen.

2. The method according to claim 1, characterized in that Before outputting a coding signal to the first touch screen based on the first coding parameter, the method further includes: The coding parameters of the stylus pen are switched from the second coding parameters to the first coding parameters, wherein the second coding parameters are coding parameters associated with a second touch screen of a second electronic device connected to the stylus pen.

3. The method according to claim 1, characterized in that Before receiving the coding parameter adjustment request sent by the first electronic device, the method further includes: Receiving an index generation request sent by the first electronic device, wherein the index generation request includes the first refresh rate and the first coding parameter; Generate a first index associated with the first refresh rate and the first coding parameter, wherein the first index is different from a second index in the coding parameter mapping table; The first index, the first refresh rate and the first coding parameter are associated and stored in the first preset coding parameter mapping table.

4. The method according to claim 3, characterized in that After generating the first index associated with the first refresh rate and the first coding parameter, the method further includes: The first index, the first refresh rate and the first coding parameter are sent to the first electronic device.

5. A touch pen control method, characterized in that: The method is performed by an electronic device, and includes: When the coding parameter adjustment condition is met, determining the current first refresh rate of the touch screen; Querying a second preset coding parameter mapping table to obtain a first index and a first coding parameter associated with the first refresh rate; Sending a coding parameter adjustment request to the stylus, wherein the coding parameter adjustment request includes the first refresh rate and the first index; Based on the first coding parameter, a coding signal output by the stylus pen is received.

6. The method according to claim 5, characterized in that The conditions for adjusting the coding parameters include any of the following: A refresh rate adjustment instruction is received, and the stylus pen is in contact with any position of the touch screen; It is monitored that the stylus pen is currently in contact with any position of the touch screen, and no coding signal output by the stylus pen is received within a preset period of time before the current moment.

7. The method according to claim 5 or 6, characterized in that Before querying the second preset coding parameter mapping table, the method further includes: Sending an index generation request to the stylus, wherein the index generation request includes the first refresh rate and the first coding parameter; receiving a first index returned by the stylus; The first index, the first refresh rate and the first coding parameter are associated and stored in the second preset coding parameter mapping table.

8. The method according to claim 7, characterized in that: After the first index, the first refresh rate and the first coding parameter are stored in association with each other in the second preset coding parameter mapping table, the method further includes: In the case where the touch screen supports multiple refresh rates, sending an index generation request to the stylus based on a second refresh rate and a second coding parameter associated with the second refresh rate, wherein the second refresh rate is a refresh rate among the multiple refresh rates except the first refresh rate; receiving a second index returned by the stylus; The second index, the second refresh rate and the second coding parameter are associated and stored in the second preset coding parameter mapping table.

9. A touch pen control device, characterized in that: The device is configured in a stylus pen, and the device includes: A receiving module, configured to receive a coding parameter adjustment request sent by a first electronic device, wherein the coding parameter adjustment request includes a current first refresh rate and a first index of a first touch screen of the first electronic device; A first query module, used for querying a first preset coding parameter mapping table to obtain a first coding parameter associated with the first refresh rate and the first index; An output module is used to output a coding signal to the first touch screen based on the first coding parameter.

10. A touch pen control device, characterized in that: The device is configured in an electronic device, and comprises: A determination module, used to determine the current first refresh rate of the touch screen when the coding parameter adjustment condition is met; A second query module, used for querying a second preset coding parameter mapping table to obtain a first index and a first coding parameter associated with the first refresh rate; A sending module, configured to send a coding parameter adjustment request to the stylus pen, wherein the coding parameter adjustment request includes the first refresh rate and the first index; A receiving module is used to receive a coding signal output by the stylus pen based on the first coding parameter.

11. An electronic device, characterized in that: The invention comprises a memory, a processor and a computer program stored in the memory and executable on the processor. When the processor executes the program, the stylus control method as described in any one of claims 1 to 4 or 5 to 8 is implemented.

12. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the stylus control method as described in any one of claims 1-4 or 5-8 is implemented.