Interaction method, electronic equipment and computer readable storage medium
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-14
- Publication Date
- 2026-04-07
AI Technical Summary
When a user uses a stylus to write on an electronic device, the end line of the handwriting displayed on the display screen is thicker when the pen tip is quickly lifted, and the pen tip disappears, which reduces the writing experience.
The stylus sends a message to the electronic device requesting to shorten the data transmission cycle. The electronic device determines that the concurrent communication service set only includes services corresponding to frequency bands other than 2.4GHz, shortens the data transmission cycle to optimize handwriting display and reduce the disappearance of pen tips.
By shortening the data transmission cycle, the interaction between the stylus and the electronic device is faster, the information corresponding to the pen tip is transmitted in a timely manner, the handwriting on the display screen is optimized, and the disappearance of the pen tip is reduced.
Smart Images

Figure CN121816767A_ABST
Abstract
Description
Interaction method, electronic device, and computer-readable storage medium
[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on March 15, 2024, with application number 202410295238.5 and application name “Interactive Method, Electronic Device and Computer-readable Storage Medium”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the technical field of electronic devices, and in particular to an interaction method, an electronic device, and a computer-readable storage medium. Background Art
[0003] A stylus is an input device for electronic devices like tablets and smartphones. It connects to these devices via Bluetooth. It can be used to write and draw on the display of an electronic device. The thickness of the handwriting displayed on the display varies depending on the touch pressure.
[0004] Currently, when a user writes with a stylus and quickly lifts the pen tip, the end line of the handwriting displayed on the display screen is thicker and there appears to be no pen tip, which reduces the user's writing experience.
[0005] Summary of the Invention
[0006] The present application provides an interactive method, an electronic device, and a computer-readable storage medium, which can optimize handwriting and reduce the disappearance of pen tips.
[0007] In a first aspect, the present application provides an interaction method, which is applied to a first electronic device that communicates with a stylus via Bluetooth, the method comprising: obtaining a first request; the first request is a message sent by the stylus to the first electronic device when the stylus switches to a writing state, requesting to shorten the period of data transmission between the first electronic device and the first electronic device; in response to the first request, determining a set of services other than the stylus writing that communicate with the first electronic device in real time and concurrently; when the service set only includes services corresponding to frequency bands other than 2.4 GHz, in response to the first request, transmitting data with the stylus at a shortened period. The transmitted data includes pressure-sensitive data, and the thickness of the handwriting displayed on the first electronic device is proportional to the pressure-sensitive data received from the stylus.
[0008] In this embodiment, when the stylus is in a writing state, the stylus sends a message to a first electronic device requesting a shortened data transmission period between the stylus and the first electronic device. The first electronic device determines a set of services other than stylus writing services for real-time concurrent communication with the first electronic device, and if the service set only includes services corresponding to frequency bands other than 2.4 GHz, the first electronic device responds to the first request and transmits data with the stylus at the shortened period. By shortening the data transmission period, the first electronic device can interact with the stylus more quickly, facilitating timely transmission of information corresponding to the pen tip to the first electronic device, optimizing the handwriting displayed on the first electronic device's display screen, and reducing the disappearance of the pen tip.
[0009] In combination with the first aspect, in certain implementations of the first aspect, the method further includes: when the service set includes services corresponding to the 2.4 GHz frequency band and only includes low-bit rate services, in response to the first request, data is transmitted with the stylus at a shortened period; the low-bit rate service is: a service in which the period of data transmission with the first electronic device via the 2.4 GHz frequency band is greater than a first preset value.
[0010] When this embodiment is used, when the service set includes services corresponding to the 2.4GHz frequency band and only includes low-bitrate services, data is transmitted with the stylus in a shortened period; this operation has no obvious impact on the low-bitrate services, and the first electronic device can interact with the stylus more quickly, which is conducive to timely transmission of information corresponding to the pen tip to the first electronic device, and is conducive to optimizing the handwriting displayed on the display screen of the first electronic device and reducing the disappearance of the pen tip.
[0011] In combination with the first aspect, in certain implementations of the first aspect, the method further includes: when the service set includes services corresponding to the 2.4 GHz frequency band, and the services corresponding to the 2.4 GHz frequency band include a first high code rate service, in response to the first request, sending a message to the stylus indicating that the period of data transmission between the first electronic device and the stylus is not agreed to be adjusted; the first high code rate service is: a service in which the period of data transmission with the first electronic device via the 2.4 GHz frequency band is less than a second preset value, and the period of data transmission with the first electronic device via the 2.4 GHz frequency band is not adjustable.
[0012] Using this embodiment, when the service set includes services corresponding to the 2.4GHz frequency band and the services corresponding to the 2.4GHz frequency band include the first high-rate service, in order not to affect the performance of the first high-rate service, this scenario responds to the first request and does not adjust the period of data transmission between the first electronic device and the stylus.
[0013] In combination with the first aspect, in certain implementations of the first aspect, the method further includes: when the service set includes services corresponding to the 2.4 GHz frequency band, the services corresponding to the 2.4 GHz frequency band do not include the first high code rate service, the services corresponding to the 2.4 GHz frequency band include a second high code rate service, and the period of data transmission between the second electronic device corresponding to the current second high code rate service and the first electronic device is not the maximum value of the adjustable data transmission period, sending a second request to the second electronic device, the second request being used to request an increase in the period of data transmission between the second electronic device and the first electronic device; the second high code rate service is: a service in which the period of data transmission with the first electronic device via the 2.4 GHz frequency band is less than a third preset value, and the period of data transmission with the first electronic device via the 2.4 GHz frequency band is an adjustable service.
[0014] Using this embodiment, when the service set includes services corresponding to the 2.4GHz frequency band, the services corresponding to the 2.4GHz frequency band do not include the first high code rate service, the services corresponding to the 2.4GHz frequency band include the second high code rate service, and the period of data transmission between the second electronic device corresponding to the current second high code rate service and the first electronic device is not the maximum value of the adjustable data transmission period, a second request is sent to the second electronic device, requesting to increase the period of data transmission between the second electronic device and the first electronic device; by sending the request to increase the data transmission period, negotiation is conducted with the second electronic device, and increasing the transmission period of the second electronic device is conducive to reducing the conflict between the second electronic device and the stylus when using the 2.4GHz frequency band, and is conducive to optimizing the interaction performance between the stylus and the first electronic device.
[0015] In combination with the first aspect, in certain implementations of the first aspect, the method may further include: upon receiving a feedback message from the second electronic device in response to the second request, wherein the feedback message indicates that the second electronic device agrees to increase the period for data transmission between the second electronic device and the first electronic device, responding to the first request, transmitting data with the stylus at the shortened period.
[0016] By adopting this embodiment, when the service set includes services corresponding to the 2.4GHz frequency band, the services corresponding to the 2.4GHz frequency band do not include the first high code rate service, the services corresponding to the 2.4GHz frequency band include the second high code rate service, and the data transmission period between the second electronic device corresponding to the current second high code rate service and the first electronic device is not the maximum value of the adjustable data transmission period, a second request is sent to the second electronic device, and the second electronic device agrees to increase the communication period with the first electronic device, which is beneficial to reducing the resources of the 2.4GHz frequency band occupied by the second electronic device and is beneficial to optimizing the interaction performance between the stylus and the first electronic device.
[0017] In combination with the first aspect, in certain implementations of the first aspect, the method may further include: upon receiving a feedback message sent by the second electronic device in response to the second request, wherein the feedback message indicates that the second electronic device does not agree to increase the period of data transmission between the second electronic device and the first electronic device, in response to the first request, sending a message to the stylus indicating that the second electronic device does not agree to adjust the period of data transmission between the first electronic device and the stylus.
[0018] Using this embodiment, when the service set includes services corresponding to the 2.4GHz frequency band, the services corresponding to the 2.4GHz frequency band do not include the first high code rate service, the services corresponding to the 2.4GHz frequency band include the second high code rate service, and the period of data transmission between the second electronic device corresponding to the current second high code rate service and the first electronic device is not the maximum value of the adjustable data transmission period, a second request is sent to the second electronic device. When a message is received from the second electronic device that it does not agree to increase the period of communication between the second electronic device and the first electronic device, a message is sent to the stylus that it does not agree to adjust the period of data transmission between the first electronic device and the stylus, which is conducive to reducing the impact on the transmission performance of the second electronic device.
[0019] In combination with the first aspect, in certain implementations of the first aspect, the second high bit rate service includes: a call service, a music playback service, or a file transfer service, etc.
[0020] The second high bit rate service can communicate with the first electronic device with multiple communication cycles. Normally, the second electronic device automatically adjusts according to the network conditions. In the embodiment of the present application, the second electronic device can determine whether to adjust according to the request of the first electronic device. For example, in the related art, when the network conditions are good, the music playback service can use a high bit rate to communicate with the first electronic device. When the network conditions are poor, the music playback service can use a medium bit rate or a low bit rate to communicate with the first electronic device. Using the technical solution provided by the present application, a request can be sent to the second electronic device related to the music playback service, requesting the second electronic device to increase the communication cycle between the second electronic device and the first electronic device. In response to the request to increase the communication cycle, the second electronic device can agree or disagree.
[0021] In conjunction with the first aspect, in certain implementations of the first aspect, the shortened period is shorter than the period during which the pressure-sensing signal is generated. In this manner, pressure-sensing data generated by the stylus can be promptly transmitted to the first electronic device, reducing pen tip loss. For example, transmitting data with the stylus at the shortened period includes transmitting data with the stylus at a period of 3.75 milliseconds.
[0022] In a second aspect, the present application provides an electronic device, comprising: one or more processors, and a memory; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors call the computer instructions to enable the electronic device to execute any one of the methods in the technical solution described in the first aspect.
[0023] In a third aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium includes instructions. When the instructions are executed on an electronic device, the electronic device executes any one of the methods in the technical solution described in the first aspect.
[0024] It should be understood that the technical solutions provided in the second and third aspects above have technical features that can correspond to the interactive methods provided in the first aspect and its possible implementation methods, so the beneficial effects that can be achieved are similar and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] FIG1A is a schematic diagram of a stylus being lifted when writing on a display screen of an electronic device;
[0026] FIG1B is a schematic diagram of handwriting displayed on a display screen when a stylus is used for writing in the related art;
[0027] FIG1C is a schematic diagram of handwriting displayed on a display screen when the interactive method provided by the present application is used;
[0028] FIG2 is a flow chart of an interaction method provided in an embodiment of the present application;
[0029] FIG3 is a schematic diagram of the interaction process between a tablet computer and a stylus pen in one embodiment of the present application;
[0030] FIG4 is a schematic diagram of the interaction process between a tablet computer and a stylus pen in one embodiment of the present application;
[0031] FIG5 is a schematic diagram of the interaction process between a tablet computer and a stylus pen in one embodiment of the present application;
[0032] FIG6 is a schematic diagram of the interaction process between a tablet computer, a stylus pen, and a second electronic device according to an embodiment of the present application;
[0033] FIG7 is a schematic structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0034] The technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying drawings in the embodiments of the present application. 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 merely a description of the association relationship of associated objects, indicating that three relationships can exist, 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.
[0035] In the following, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the quantity of the technical features indicated. Therefore, a feature specified as "first," "second," or "third" may explicitly or implicitly include one or more of the features.
[0036] FIG1A is a schematic diagram of an application scenario in which the interactive method provided by an embodiment of the present application is applicable. When writing, the stylus moves on the display screen of the electronic device, and the stylus is lifted after writing is completed. FIG1B is a diagram of handwriting displayed on the display screen after the stylus interacts with an electronic device (such as a tablet computer, smartphone, etc.) in the prior art and writes multiple horizontal lines on the surface of the electronic device. As can be seen from FIG1B, when the relevant technology is used, the pen tip at the end of the handwriting sometimes disappears, and sometimes is not obvious, which is different from the actual writing target.
[0037] Through testing and analysis, R&D personnel discovered that the problem shown in Figure 1B occurs due to a mismatch between the data transmission cycle and the cycle of the pressure-sensitive data generated when the stylus is writing. Styluses and electronic devices usually communicate via Bluetooth, using the 2.4GHz frequency band. The default cycle for data transmission between the stylus and the electronic device is approximately 11 milliseconds. The cycle of the pressure-sensitive data generated by the stylus when writing on the display screen is approximately 4 milliseconds. It can be seen that the two cycles do not match, and after the stylus is lifted, the data that has not had time to be transmitted is lost, especially when the pen is lifted quickly, the loss of the pen tip is more obvious.
[0038] The idea of this application includes: limiting the usage scenarios, and shortening the data transmission cycle between the stylus and the electronic device while having little impact on other existing businesses, so that the pressure data generated by the stylus can be transmitted to the electronic device in a timely manner, and the display screen of the electronic device displays lines that match the data transmitted by the stylus. This is conducive to optimizing the handwriting displayed on the display screen of the electronic device and reducing the disappearance of the pen tip. In some embodiments, after adopting the technical solution provided by this application, the handwriting is shown in Figure 1C. For example, the period of stylus transmission can be set to be less than the period of pressure data generation. The period of handwriting pressure data generation is usually about 4ms. When adopting the technical solution provided by this application, when certain conditions are met, the period of data transmission from the stylus to the electronic device (such as the parameter Connection_Interval) can be changed to 3.75ms. This application solves the problem of pen tip disappearance by making private modifications to the current BLE protocol (the value range of Connection_Interval in the traditional BLE protocol is 7.5ms to 4s) without increasing hardware costs separately.
[0039] The interaction method provided in the embodiments of the present application can be applied to electronic devices that can interact with a stylus, such as mobile phones, tablet computers, personal digital assistants (PDAs), laptop computers, ultra-mobile personal computers (UMPCs), and netbooks. The embodiments of the present application do not impose any restrictions on the specific types of electronic devices.
[0040] As shown in FIG. 2 , in one embodiment of the present application, the interaction method is applied to a first electronic device that communicates with a stylus via Bluetooth. The interaction method includes the following steps: 201 to 203 .
[0041] 201. Obtain a first request; the first request is a message sent by the stylus to the first electronic device when the stylus is switched to a writing state, for requesting to shorten a data transmission period with the first electronic device.
[0042] The data transmitted by the stylus to the first electronic device includes pressure data. The thickness of the handwriting displayed on the first electronic device is proportional to the pressure data received from the stylus. The greater the pressure, the thicker the handwriting, and the smaller the pressure, the thinner the handwriting.
[0043] 202. In response to the first request, determine a service set other than stylus writing that is communicated with the first electronic device in real time and concurrently.
[0044] 203. When the service set only includes services corresponding to frequency bands other than 2.4 GHz, in response to the first request, perform data transmission with the stylus at a shortened period.
[0045] It should be noted that the service set mentioned here is a set of services other than stylus writing, such as Wi-Fi communication, audio playback, etc. Wi-Fi can operate in both the 2.4 GHz and 5 GHz frequency bands.
[0046] For example, if the service set does not include services using the 2.4GHz frequency band other than the stylus, such as when the service set only includes WiFi working in the 5GHz frequency band, the preset condition is met: only services corresponding to frequency bands other than 2.4GHz are included in the service set. Then, in response to the first request, data is transmitted with the stylus at a shortened period. If a pressure sensor is provided on the stylus, the stylus can obtain pressure data of the stylus pressing the display screen of the first electronic device through the pressure sensor. Usually, the pressure data generation period is 4ms. In the related art, the period for the stylus to transmit data to the first electronic device is 11.225ms. In the embodiment of the present application, when the preset conditions are met, the first electronic device transmits data with the stylus at a shortened period.
[0047] In this embodiment, when the stylus is in a writing state, the stylus sends a message to a first electronic device requesting a shortened data transmission period between the stylus and the first electronic device. The first electronic device determines a set of services other than stylus writing services for real-time concurrent communication with the first electronic device, and if the service set only includes services corresponding to frequency bands other than 2.4 GHz, the first electronic device responds to the first request and transmits data with the stylus at the shortened period. By shortening the data transmission period, the first electronic device can interact with the stylus more quickly, facilitating timely transmission of information corresponding to the pen tip to the first electronic device, optimizing the handwriting displayed on the first electronic device's display screen, and reducing the disappearance of the pen tip.
[0048] As shown in Figure 3, in one embodiment of the present application, the interaction method is applied to a first electronic device that communicates with a stylus via Bluetooth. For the convenience of description, in this embodiment, the first electronic device is described as a tablet computer. It can be understood that the first electronic device can also be other electronic devices. In this embodiment, the interaction method includes the following steps: 301 to 305.
[0049] 301. The stylus determines whether the current state is a writing state.
[0050] If the judgment result is yes, execute step 302; if the judgment result is no, execute step 301.
[0051] 302. The stylus sends a first request to the tablet computer, requesting to shorten a data transmission period between the stylus and the tablet computer.
[0052] The first request is a message sent by the stylus to the tablet computer when the stylus is switched to the writing state, and is used to request to shorten the data transmission period between the stylus and the tablet computer.
[0053] The data transmitted by the stylus to the tablet computer includes pressure data. The thickness of the handwriting displayed on the tablet computer is proportional to the pressure data received from the stylus. The greater the pressure, the thicker the handwriting, and the smaller the pressure, the thinner the handwriting.
[0054] 303. The tablet computer determines a set of services other than stylus writing that communicate with the tablet computer in real time and concurrently.
[0055] 304. When the service set only includes services corresponding to frequency bands other than 2.4 GHz, in response to the first request, the tablet computer shortens the period of data transmission between the tablet computer and the stylus pen, and transmits data with the stylus pen at the shortened period.
[0056] It should be noted that the service set mentioned here is a set of services other than stylus writing, such as Wi-Fi communication, audio playback, etc. Wi-Fi can operate in both the 2.4 GHz and 5 GHz frequency bands.
[0057] For example, if the service set does not include services using the 2.4GHz frequency band other than the stylus, such as when the service set only includes WiFi operating in the 5GHz frequency band, the preset condition is met: only services corresponding to frequency bands other than 2.4GHz are included in the service set. Then, in response to the first request, data is transmitted with the stylus at a shortened period. If a pressure sensor is provided on the stylus, the stylus can obtain pressure data of the stylus pressing the tablet display through the pressure sensor. Usually, the pressure data generation period is 4ms. In the related art, the period for the stylus to transmit data to the tablet is 11.225ms. In the embodiment of the present application, when the preset conditions are met, the tablet computer transmits data with the stylus at a shortened period.
[0058] 305. The stylus pen transmits data to the tablet computer in a shortened cycle.
[0059] In this embodiment, when the stylus is in the writing state, the stylus sends a message to the tablet computer requesting a shortened data transmission cycle between the stylus and the tablet computer. The tablet computer then determines a set of services other than stylus writing services that communicate concurrently with the tablet computer in real time, and if the service set only includes services corresponding to frequency bands other than 2.4 GHz, the tablet computer responds to the first request and transmits data with the stylus at the shortened cycle. This shortened data transmission cycle allows the tablet computer to interact with the stylus more quickly, facilitates timely transmission of information corresponding to pen strokes to the tablet computer, optimizes the display of handwriting on the tablet computer's screen, and reduces the disappearance of pen strokes.
[0060] As shown in Figure 4, in one embodiment of the present application, the interaction method is applied to a first electronic device that communicates with a stylus via Bluetooth. For the convenience of description, in this embodiment, the first electronic device is described using a tablet computer as an example. It can be understood that the first electronic device can also be other electronic devices. In this embodiment, the interaction method includes the following steps: 401 to 405.
[0061] 401. The stylus determines whether the current state is a writing state.
[0062] If the judgment result is yes, execute step 402; if the judgment result is no, execute step 401.
[0063] 402. The stylus sends a first request to the tablet computer, requesting to shorten the data transmission period between the stylus and the tablet computer.
[0064] The first request is a message sent by the stylus to the tablet computer when the stylus is switched to the writing state, and is used to request to shorten the data transmission period between the stylus and the tablet computer.
[0065] The data transmitted by the stylus to the tablet computer includes pressure data. The thickness of the handwriting displayed on the tablet computer is proportional to the pressure data received from the stylus. The greater the pressure, the thicker the handwriting, and the smaller the pressure, the thinner the handwriting.
[0066] 403. The tablet computer determines a set of services other than stylus writing that communicate with the tablet computer in real time and concurrently.
[0067] 404. When the service set includes services corresponding to the 2.4 GHz frequency band and only includes low bit rate services, in response to the first request, the tablet computer shortens the period of data transmission between the tablet computer and the stylus pen, and transmits data with the stylus pen at the shortened period.
[0068] The low-bitrate service corresponding to the 2.4 GHz frequency band is a service whose data transmission period with the tablet computer via the 2.4 GHz frequency band is greater than a first preset value. The first preset value can be set as needed. For example, the first preset value can be slightly less than the period during which the wristband transmits acquired heart pulse information to the tablet computer via the 2.4 GHz frequency band.
[0069] It should be noted that the service set mentioned here is a set of services other than stylus writing, for example, it may include a wristband transmitting the user's heart pulse information obtained through a sensor to a tablet computer.
[0070] For example, if the service set includes transmitting acquired heart pulse information to a tablet computer via a 2.4 GHz frequency band, data transmission is performed with the stylus at a shortened cycle in response to the first request.
[0071] 405. The stylus pen transmits data to the tablet computer in a shortened cycle.
[0072] In this embodiment, when the stylus is in the writing state, the stylus sends a message to the tablet computer requesting a shortened data transmission cycle between the stylus and the tablet computer. The tablet computer then determines a set of services, excluding stylus writing services, that are communicating concurrently with the tablet computer in real time. If the service set includes services corresponding to the 2.4 GHz frequency band and only includes low-bitrate services, the tablet computer responds to the first request and transmits data with the stylus at the shortened cycle. This shortened data transmission cycle allows the tablet computer to interact with the stylus more quickly, facilitates timely transmission of information corresponding to pen strokes to the tablet computer, optimizes the display of handwriting on the tablet computer's screen, and reduces the disappearance of pen strokes.
[0073] As shown in Figure 5, in one embodiment of the present application, the interaction method is applied to a first electronic device that communicates with a stylus via Bluetooth. For the convenience of description, in this embodiment, the first electronic device is described using a tablet computer as an example. It can be understood that the first electronic device can also be other electronic devices. In this embodiment, the interaction method includes the following steps: 501 to 505.
[0074] 501. The stylus determines whether the current state is a writing state.
[0075] If the judgment result is yes, execute step 502; if the judgment result is no, execute step 501.
[0076] 502. The stylus sends a first request to the tablet computer, requesting to shorten a data transmission period between the stylus and the tablet computer.
[0077] The first request is a message sent by the stylus to the tablet computer when the stylus is switched to the writing state, and is used to request to shorten the data transmission period between the stylus and the tablet computer.
[0078] The data transmitted by the stylus to the tablet computer includes pressure data. The thickness of the handwriting displayed on the tablet computer is proportional to the pressure data received from the stylus. The greater the pressure, the thicker the handwriting, and the smaller the pressure, the thinner the handwriting.
[0079] 503. The tablet computer determines a set of services other than stylus writing that communicate with the tablet computer in real time and concurrently.
[0080] 504. When the service set includes services corresponding to the 2.4 GHz frequency band, and the services corresponding to the 2.4 GHz frequency band include a first high-code-rate service, in response to a first request, the tablet computer does not adjust the period of data transmission between the tablet computer and the stylus, and sends a message to the stylus indicating that it does not agree to adjust the period of data transmission between the tablet computer and the stylus; the first high-code-rate service is: a service in which the period of data transmission with the tablet computer via the 2.4 GHz frequency band is less than a second preset value, and the period of data transmission with the tablet computer via the 2.4 GHz frequency band is not adjustable.
[0081] The second preset value may be set as needed. For example, the second preset value may be slightly smaller than the period for the Bluetooth headset to transmit audio data to the tablet computer.
[0082] It should be noted that the service set mentioned here is a set of services other than stylus writing.
[0083] 505. When the stylus pen transmits data to the tablet computer, the data transmission cycle is not changed.
[0084] For example, if the default transmission period between the stylus and the tablet computer is 11.25 ms, then in this embodiment, the handwriting continues to transmit data to the tablet computer at a period of 11.25 ms.
[0085] With this embodiment, when the stylus is in a writing state, the stylus sends a message to the tablet computer requesting to shorten the period of data transmission between the stylus and the tablet computer. The tablet computer determines a set of services other than stylus writing that communicate with the tablet computer in real time and concurrently. When the service set includes services corresponding to the 2.4 GHz frequency band, the service set includes services corresponding to the 2.4 GHz frequency band, and the services corresponding to the 2.4 GHz frequency band include the first high code rate service, in response to the first request, the tablet computer sends a message to the stylus indicating that it does not agree to adjust the period of data transmission between the tablet computer and the stylus. In this embodiment, in order to reduce the impact on the performance of the first high code rate service, the stylus does not change the period of data transmission.
[0086] As shown in Figure 6, in one embodiment of the present application, the interaction method is applied to a first electronic device that communicates with a stylus via Bluetooth. For the convenience of description, in this embodiment, the first electronic device is described using a tablet computer as an example. It can be understood that the first electronic device can also be other electronic devices. In this embodiment, the interaction method includes the following steps: 601 to 609.
[0087] 601. The stylus determines whether the current state is a writing state.
[0088] If the judgment result is yes, execute step 602; if the judgment result is no, execute step 601.
[0089] 602. The stylus sends a first request to the tablet computer, requesting to shorten a data transmission period between the stylus and the tablet computer.
[0090] The first request is a message sent by the stylus to the tablet computer when the stylus is switched to the writing state, and is used to request to shorten the data transmission period between the stylus and the tablet computer.
[0091] The data transmitted from the stylus to the tablet includes pressure data and data related to the requested shortened data transmission period. The thickness of the handwriting displayed on the tablet is proportional to the pressure data received from the stylus: greater pressure results in thicker handwriting, while less pressure results in thinner handwriting.
[0092] 603. The tablet computer determines a set of services other than stylus writing that communicate with the tablet computer in real time and concurrently.
[0093] 604. When the service set includes services corresponding to the 2.4 GHz frequency band, the services corresponding to the 2.4 GHz frequency band do not include the first high bit rate service, the services corresponding to the 2.4 GHz frequency band include the second high bit rate service, and the data transmission period between the second electronic device corresponding to the current second high bit rate service and the tablet computer is not the maximum value of the adjustable data transmission period, a second request is sent to the second electronic device.
[0094] The second request is used to request an increase in the period for data transmission between the second electronic device and the tablet computer. The second high-bitrate service is a service in which the period for data transmission with the tablet computer via the 2.4 GHz frequency band is less than a third preset value, and the period for data transmission with the tablet computer via the 2.4 GHz frequency band is adjustable. The second high-bitrate service may include a call service, a music playback service, or a file transfer service.
[0095] 605. The tablet computer obtains a feedback message sent by the second electronic device in response to the second request.
[0096] 606. The tablet computer determines, based on the feedback message, whether the second electronic device agrees to increase the cycle of data transmission between the tablet computer and the second electronic device.
[0097] If the judgment result is yes, execute step 608; if the judgment result is no, execute step 607.
[0098] 607. In response to the first request, send a message to the stylus indicating that the adjustment of the data transmission cycle between the tablet computer and the stylus is not agreed.
[0099] 608. In response to the feedback message, the tablet computer transmits data with the second electronic device using the increased data transmission cycle.
[0100] 609. In response to the first request, the tablet computer transmits data to the stylus at a shortened period.
[0101] In this embodiment, when the stylus is in a writing state, the stylus sends a message to the tablet computer requesting a shortened data transmission cycle between the stylus and the tablet computer. The tablet computer determines a set of services, excluding stylus writing services, that are concurrently communicating with the tablet computer in real time. If the service set includes services corresponding to the 2.4 GHz frequency band, does not include the first high-rate service, and includes the second high-rate service, and the data transmission cycle between the second electronic device and the first electronic device corresponding to the second high-rate service is not the maximum adjustable data transmission cycle, the tablet computer sends a second request to the second electronic device. The tablet computer receives a feedback message sent by the second electronic device in response to the second request. If the feedback message determines that the second electronic device agrees to increase the data transmission cycle between the tablet computer and the first electronic device, the tablet computer transmits data to the stylus at the shortened cycle in response to the first request. If the feedback message determines that the second electronic device disagrees with increasing the data transmission cycle between the tablet computer and the stylus, the tablet computer transmits a message to the stylus computer indicating that the tablet computer disagrees with adjusting the data transmission cycle between the tablet computer and the stylus. This embodiment reduces the data transmission period between the stylus and the electronic device and improves the problem of the pen tip disappearing by limiting the usage scenarios while having little impact on other existing services.
[0102] The above description, in conjunction with Figures 1A to 6 , introduces embodiments of the interaction methods applicable to the present application. The present application also provides an electronic device comprising: one or more processors and a memory; the memory is coupled to the one or more processors, the memory being configured to store computer program code, the computer program code comprising computer instructions, and the one or more processors invoking the computer instructions to cause the electronic device to execute the various interaction methods of the aforementioned embodiments of the present application.
[0103] Specifically, the interaction method in which the electronic device as the first electronic device communicates with the stylus via Bluetooth includes the following steps:
[0104] Obtain a first request; the first request is a message sent by the stylus to the first electronic device when the stylus is switched to a writing state, for requesting to shorten a data transmission period with the first electronic device.
[0105] In response to the first request, a service set other than stylus writing that is communicated with the first electronic device in real time and concurrently is determined.
[0106] When the service set includes only services corresponding to frequency bands other than 2.4 GHz, data transmission is performed with the stylus at a shortened period in response to the first request.
[0107] In some possible implementations, the interaction method for the first electronic device and the stylus to communicate via Bluetooth further includes:
[0108] When the service set includes services corresponding to the 2.4GHz frequency band and only includes low-bit-rate services, data is transmitted with the stylus at a shortened period in response to the first request; the low-bit-rate service is a service in which the period for transmitting data with the first electronic device via the 2.4GHz frequency band is greater than a first preset value.
[0109] In some possible implementations, the interaction method for the first electronic device and the stylus to communicate via Bluetooth further includes:
[0110] When the service set includes services corresponding to the 2.4GHz frequency band and the services corresponding to the 2.4GHz frequency band include a first high-code-rate service, in response to a first request, a message is sent to the stylus indicating that the period of data transmission between the first electronic device and the stylus is not agreed to be adjusted; the first high-code-rate service is: a service in which the period of data transmission with the first electronic device through the 2.4GHz frequency band is less than a second preset value, and the period of data transmission with the first electronic device through the 2.4GHz frequency band is not adjustable.
[0111] In some possible embodiments, the interaction method for the first electronic device to communicate with the stylus via Bluetooth further includes: when the service set includes services corresponding to the 2.4 GHz frequency band, the services corresponding to the 2.4 GHz frequency band do not include the first high code rate service, the services corresponding to the 2.4 GHz frequency band include the second high code rate service, and the period of data transmission between the second electronic device corresponding to the current second high code rate service and the first electronic device is not the maximum value of the adjustable data transmission period, sending a second request to the second electronic device, the second request being used to request an increase in the period of data transmission between the second electronic device and the first electronic device; the second high code rate service is: the period of data transmission with the first electronic device via the 2.4 GHz frequency band is less than a third preset value, and the period of data transmission with the first electronic device via the 2.4 GHz frequency band is an adjustable service.
[0112] In some possible implementations, the interaction method for the first electronic device and the stylus to communicate via Bluetooth further includes: upon receiving a feedback message from the second electronic device in response to the second request, the feedback message indicating that the second electronic device agrees to increase the period for data transmission between the first electronic device and the first electronic device, responding to the first request, transmitting data with the stylus at the shortened period.
[0113] In some possible implementations, the interaction method for the first electronic device and the stylus to communicate via Bluetooth further includes: upon receiving a feedback message sent by the second electronic device in response to the second request, the feedback message indicating that the second electronic device does not agree to increase the period of data transmission between the first electronic device and the first electronic device, sending a message to the stylus in response to the first request indicating that the second electronic device does not agree to increase the period of data transmission between the first electronic device and the stylus.
[0114] The second high bit rate service may include: a call service, a music playing service, or a file transfer service.
[0115] In some possible implementations, the shortened period is less than the period of pressure-sensing signal generation. If the period of pressure-sensing data generated by the stylus is approximately 4 ms, the technical solution provided in this application can be used to adjust the period of data transmission from the stylus to the electronic device to 3.75 ms if certain conditions are met.
[0116] In this embodiment, when the stylus is in a writing state, the stylus sends a message to a first electronic device requesting a shortened data transmission period between the stylus and the first electronic device. The first electronic device determines a set of services other than stylus writing services for real-time concurrent communication with the first electronic device, and if the service set only includes services corresponding to frequency bands other than 2.4 GHz, the first electronic device responds to the first request and transmits data with the stylus at the shortened period. By shortening the data transmission period, the first electronic device can interact with the stylus more quickly, facilitating timely transmission of information corresponding to the pen tip to the first electronic device, optimizing the handwriting displayed on the first electronic device's display screen, and reducing the disappearance of the pen tip.
[0117] The present application also provides a computer program product, which, when executed by a processor, implements the interactive method of any method embodiment in the present application.
[0118] This application also provides a computer-readable storage medium comprising instructions that, when executed on an electronic device, cause the electronic device to perform an interaction method as described in any of the preceding method embodiments. The specific steps of the interaction method are described in the preceding method embodiments and are not repeated here.
[0119] As an example, please refer to Figure 7, which is a schematic diagram of the structure of an electronic device 700 provided in an embodiment of the present application. As shown in Figure 7, the electronic device 700 may include: a stylus (not shown), a processor 701, a communication module 702, and a display screen 703.
[0120] The processor 701 may include one or more processing units. Different processing units may be independent devices or integrated into one or more processors 701. The controller may serve as the nerve center and command center of the electronic device 700. The controller may generate operation control signals based on instruction opcodes and timing signals to control instruction fetching and execution. The processor 701 may also include a memory for storing instructions and data.
[0121] In some embodiments, the processor 701 may include one or more interfaces. The interfaces may include an integrated circuit interface, an integrated circuit internal audio interface, a pulse code modulation interface, a universal asynchronous receiver and transmitter interface, a mobile industry processor interface, a general purpose input and output interface, a subscriber identity module interface, and / or a universal serial bus interface 711, etc.
[0122] The electronic device 700 implements a display function through a GPU, a display screen 703, and an application processor 701. The GPU is a microprocessor for image processing, which connects the display screen 703 and the application processor 701. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 701 may include one or more GPUs, which execute program instructions to generate or change display information. The display screen 703 is used to display images, video streams, etc. The communication module 702 may include an antenna x, an antenna y, a mobile communication module 702A, and / or a wireless communication module 702B. Take the example of the communication module 702 including an antenna x, an antenna y, a mobile communication module 702A and a wireless communication module 702B at the same time. In addition, the receiving module provided in the embodiment of the present application can also be arranged in the communication module 702.
[0123] The wireless communication function of the electronic device 700 can be implemented through antenna x, antenna y, mobile communication module 702A, wireless communication module 702B, a modem processor, and a baseband processor.
[0124] The mobile communication module 702A can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 700. The mobile communication module 702A may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 702A can receive electromagnetic waves from the antenna x, filter, amplify, and process the received electromagnetic waves, and transmit them to the modem processor for demodulation. The mobile communication module 702A can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation through the antenna x. In some embodiments, at least some of the functional modules of the mobile communication module 702A can be set in the processor 701. In some embodiments, at least some of the functional modules of the mobile communication module 702A can be set in the same device as at least some of the modules of the processor 701.
[0125] The application processor outputs audio signals through an audio device (not limited to speaker 706A, receiver 706B, etc.) or displays images or video streams through display screen 703. In some embodiments, the modem processor can be a separate device. In other embodiments, the modem processor can be independent of processor 701 and be provided in the same device as mobile communication module 702A or other functional modules.
[0126] Wireless communication module 702B can provide a wireless communication solution for electronic device 700. Wireless communication module 702B can be one or more devices integrating at least one communication processing module. Wireless communication module 702B receives electromagnetic waves via antenna y, frequency-modulates and filters the electromagnetic wave signals, and transmits the processed signals to processor 701. Wireless communication module 702B can also receive signals to be transmitted from processor 701, frequency-modulate and amplify them, and then convert them into electromagnetic waves for radiation via antenna y.
[0127] The antenna x of the electronic device 700 is coupled to the mobile communication module 702A, and the antenna y is coupled to the wireless communication module 702B, so that the electronic device 700 can communicate with the network and other devices through wireless communication technology.
[0128] The electronic device 700 may also include an external memory interface 710, an internal memory 704, a universal serial bus (USB) interface 711, a charging management module 712, a power management module 713, a battery 714, an audio module 706, a speaker 706A, a receiver 706B, a microphone 706C, an earphone jack 706D, a sensor module 705, a button 709, a motor, an indicator 708, a camera 707, and a subscriber identification module (SIM) card interface. The electronic device 700 may implement audio functions such as music playback and recording through the audio module 706, the speaker 706A, the receiver 706B, the microphone 706C, the earphone jack 706D, and the application processor 701. The sensor module 705 in the electronic device 700 may implement the functions of sensing and / or acquiring various signals.
[0129] The electronic device provided in the embodiments of the present application is described above. It should be understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device 700. In other embodiments, the electronic device 700 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0130] 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.
[0131] In the several embodiments provided in this 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 merely 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, the replaced units may or may not be physically separated, and the components displayed as units may be one physical unit or multiple physical units, that is, they may be located in one place, or they may be distributed in multiple different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the scheme of this embodiment.
[0132] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0133] 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 and includes several instructions for enabling a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0134] The above content is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.
Claims
1. An interactive method, characterized in that: The method is applied to a first electronic device that communicates with a stylus via Bluetooth, comprising: Obtaining a first request; the first request is a message sent by the stylus to the first electronic device when the stylus is switched to a writing state, for requesting to shorten a data transmission period between the stylus and the first electronic device; In response to the first request, determining a service set other than the stylus writing service that is to be communicated with the first electronic device in real time and concurrently; When the service set includes only services corresponding to frequency bands other than 2.4 GHz, data transmission is performed with the stylus at a shortened period in response to the first request.
2. The method according to claim 1, characterized in that The method further comprises: When the service set includes services corresponding to the 2.4 GHz frequency band and only includes low-bit-rate services, in response to the first request, data is transmitted with the stylus at a shortened period; the low-bit-rate service is: a service in which the period for data transmission with the first electronic device via the 2.4 GHz frequency band is greater than a first preset value.
3. The method according to claim 1, characterized in that The method further comprises: When the service set includes services corresponding to the 2.4GHz frequency band, and the services corresponding to the 2.4GHz frequency band include a first high-code-rate service, in response to the first request, a message is sent to the stylus indicating that the period of data transmission between the first electronic device and the stylus is not agreed to be adjusted; the first high-code-rate service is: a service in which the period of data transmission with the first electronic device via the 2.4GHz frequency band is less than a second preset value, and the period of data transmission with the first electronic device via the 2.4GHz frequency band is not adjustable.
4. The method according to claim 3, characterized in that The method further comprises: When the service set includes services corresponding to the 2.4 GHz frequency band, the services corresponding to the 2.4 GHz frequency band do not include the first high code rate service, the services corresponding to the 2.4 GHz frequency band include a second high code rate service, and the period of data transmission between the second electronic device corresponding to the second high code rate service and the first electronic device is not the maximum value of the adjustable data transmission period, a second request is sent to the second electronic device, and the second request is used to request to increase the period of data transmission between the second electronic device and the first electronic device; the second high code rate service is: the period of data transmission with the first electronic device through the 2.4 GHz frequency band is less than a third preset value, and the period of data transmission with the first electronic device through the 2.4 GHz frequency band is an adjustable service.
5. The method according to claim 4, characterized in that The method further comprises: Upon receiving a feedback message from the second electronic device in response to the second request, wherein the feedback message indicates that the second electronic device agrees to increase the period for data transmission between the second electronic device and the first electronic device, the second electronic device transmits data with the stylus at the shortened period in response to the first request.
6. The method according to claim 4, characterized in that The method further comprises: Upon receiving a feedback message sent by the second electronic device in response to the second request, wherein the feedback message indicates that the second electronic device does not agree to increase the period of data transmission between the second electronic device and the first electronic device, in response to the first request, a message is sent to the stylus indicating that the second electronic device does not agree to adjust the period of data transmission between the first electronic device and the stylus.
7. The method according to any one of claims 4 to 6, characterized in that The second high bit rate service includes: a call service, a music playing service or a file transfer service.
8. The method according to any one of claims 1 to 6, characterized in that The shortened period is smaller than the period during which the pressure sensing signal is generated.
9. An electronic device, characterized in that: The electronic device includes: one or more processors, and a memory; The memory is coupled to the one or more processors, and the memory is used to store computer program code, where the computer program code includes computer instructions. The one or more processors call the computer instructions to enable the electronic device to execute the interaction method according to any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium includes instructions, and when the instructions are executed on an electronic device, the electronic device executes the interaction method according to any one of claims 1 to 8.