Frequency adjustment method and device, electronic equipment, handwriting pen and storage medium
By obtaining the delay time between the electronic device and the stylus and sending data synchronization requests, the problem of inconsistent frequency between the electronic device and the stylus is solved, and the normal operation of the stylus function is achieved.
Patent Information
- Application Number
- CN202310974330.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-03
- Publication Date
- 2025-02-14
AI Technical Summary
In Bluetooth technology, the frequency inconsistency between electronic devices and stylus leads to the problem that the stylus function cannot be realized.
By obtaining the delay time consumed by the data transmission process between the electronic device and the stylus, a data synchronization request is sent to the stylus, including the first moment, the second moment and the delay time, ensuring that the electronic device and the stylus adjust the frequency at the same time.
By calibrating the frequency adjustment time by delaying the time, ensuring the working frequency of electronic devices and stylus is consistent, reducing the problem that the stylus function cannot be realized due to inconsistent frequency.
Smart Images

Figure CN119440275A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of stylus pens, and in particular to a frequency adjustment method, device, electronic device, stylus pen and storage medium. Background Art
[0002] Bluetooth technology has been widely used in various electronic devices, such as smartphones, tablets, laptops, smart watches, smart homes, smart wearable devices, etc. Bluetooth technology can be used to connect various IoT devices to achieve interconnection between devices. For example, electronic devices and styluses can be connected via Bluetooth. Summary of the invention
[0003] In order to overcome the problems existing in the related art, the present disclosure provides a frequency adjustment method, device, electronic device, stylus pen and storage medium.
[0004] According to a first aspect of an embodiment of the present disclosure, a frequency adjustment method is provided, which is performed by an electronic device, and the method includes:
[0005] Obtaining a delay duration, where the delay duration is the duration consumed in a data transmission process between the electronic device and the stylus;
[0006] Sending a data synchronization request to the stylus, wherein the data synchronization request includes a first time, a second time, and the delay duration, wherein the first time is the time when the electronic device sends the data synchronization request, and the second time is the time when the electronic device adjusts the frequency;
[0007] The frequency of the electronic device is adjusted at the second moment.
[0008] In some embodiments, the obtaining of the delay duration includes:
[0009] Sending a delay calibration request to the stylus pen, and acquiring a third time, where the third time is the time when the electronic device sends the delay calibration request;
[0010] receiving a delay calibration response sent by the stylus pen, and acquiring a sixth time, wherein the delay calibration response includes a fourth time and a fifth time, wherein the fourth time is the time when the stylus pen receives the delay calibration request, the fifth time is the time when the stylus pen sends the delay calibration response, and the sixth time is the time when the electronic device receives the delay calibration response;
[0011] The delay duration is determined based on the third moment, the fourth moment, the fifth moment and the sixth moment.
[0012] In some embodiments, determining the delay duration based on the third moment, the fourth moment, the fifth moment, and the sixth moment includes:
[0013] Determine a first time difference between the sixth moment and the third moment, and a second time difference between the fifth moment and the fourth moment;
[0014] The delay duration is obtained by dividing the difference between the first time difference and the second time difference by 2.
[0015] In some embodiments, the receiving a delay calibration response sent by the stylus comprises:
[0016] A first delay calibration response and a second delay calibration response sent by the stylus are received in sequence, the first delay calibration response includes the fourth moment, the second delay calibration response includes the fifth moment when the stylus sends the first delay calibration response, and the second delay calibration response is sent by the stylus after the first delay calibration response is sent; the sixth moment is the moment when the electronic device receives the first delay calibration response.
[0017] In some embodiments, the obtaining of the delay duration includes:
[0018] After a communication connection is established between the electronic device and the stylus, acquiring the delay time once every preset time;
[0019] The delay duration included in the data synchronization request is the most recently acquired delay duration, or the delay duration included in the data synchronization request is an average value of multiple acquired delay durations.
[0020] In some embodiments, sending a data synchronization request to the stylus includes:
[0021] A noise signal is detected, and the data synchronization request is sent to the stylus.
[0022] In some embodiments, the data synchronization request also includes a frequency value to be adjusted, and the data synchronization request is used to instruct the stylus and the electronic device to adjust the frequency to the frequency value at the same time, and adjusting the frequency of the electronic device at the second time includes:
[0023] At the second moment, a frequency hopping request is sent to the stylus pen, and the frequency of the electronic device is adjusted to the frequency value, wherein the frequency hopping request is used to instruct the stylus pen to adjust the frequency to the frequency value.
[0024] According to a second aspect of an embodiment of the present disclosure, a frequency adjustment method is provided, which is performed by a stylus pen, and the method includes:
[0025] Receiving a data synchronization request sent by an electronic device, wherein the data synchronization request includes a first time, a second time, and a delay time, wherein the first time is the time when the electronic device sends the data synchronization request, the second time is the time when the electronic device adjusts the frequency, and the delay time is the time spent in the data transmission process between the electronic device and the stylus;
[0026] Acquire a seventh time, where the seventh time is the time when the data synchronization request is received;
[0027] Determine an eighth time based on the first time, the second time, the delay duration and the seventh time;
[0028] The frequency of the stylus is adjusted at the eighth moment.
[0029] In some embodiments, determining the eighth time based on the first time, the second time, the delay duration, and the seventh time includes:
[0030] Determine a third time difference between the second moment and a ninth moment, the ninth moment being the moment of adding the delay time to the first moment;
[0031] The time obtained by adding the seventh time point and the third time difference is determined as the eighth time point.
[0032] In some embodiments, the data synchronization request also includes a frequency value to be adjusted, and the data synchronization request is used to instruct the stylus and the electronic device to adjust the frequency to the frequency value at the same time, and adjusting the frequency of the stylus at the eighth moment includes:
[0033] At the eighth moment, the frequency of the stylus is adjusted to the frequency value.
[0034] In some embodiments, the method further comprises:
[0035] receiving a delay calibration request sent by the electronic device;
[0036] A delay calibration response is sent to the electronic device, wherein the delay calibration response includes a fourth time and a fifth time, wherein the fourth time is the time when the stylus receives the delay calibration request, and the fifth time is the time when the stylus sends the delay calibration response.
[0037] In some embodiments, sending a delay calibration response to the electronic device includes:
[0038] A first delay calibration response and a second delay calibration response are sent to the electronic device in sequence, wherein the first delay calibration response includes the fourth moment, the second delay calibration response includes the fifth moment when the stylus sends the first delay calibration response, and the second delay calibration response is sent by the stylus after the first delay calibration response is sent.
[0039] According to a third aspect of an embodiment of the present disclosure, a frequency adjustment device is provided, which is configured in an electronic device, and the device includes:
[0040] A delay duration acquisition module is configured to acquire a delay duration, where the delay duration is the duration consumed in a data transmission process between the electronic device and the stylus;
[0041] a synchronization request sending module, configured to send a data synchronization request to the stylus, wherein the data synchronization request includes a first time, a second time, and the delay duration, wherein the first time is the time when the electronic device sends the data synchronization request, and the second time is the time when the electronic device adjusts the frequency;
[0042] The frequency adjustment module is configured to adjust the frequency of the electronic device at the second moment.
[0043] In some embodiments, the delay duration acquisition module is configured to:
[0044] Sending a delay calibration request to the stylus pen, and acquiring a third time, where the third time is the time when the electronic device sends the delay calibration request;
[0045] receiving a delay calibration response sent by the stylus pen, and acquiring a sixth time, wherein the delay calibration response includes a fourth time and a fifth time, wherein the fourth time is the time when the stylus pen receives the delay calibration request, the fifth time is the time when the stylus pen sends the delay calibration response, and the sixth time is the time when the electronic device receives the delay calibration response;
[0046] The delay duration is determined based on the third moment, the fourth moment, the fifth moment and the sixth moment.
[0047] In some embodiments, the delay duration acquisition module is configured to:
[0048] Determine a first time difference between the sixth moment and the third moment, and a second time difference between the fifth moment and the fourth moment;
[0049] The delay duration is obtained by dividing the difference between the first time difference and the second time difference by 2.
[0050] In some embodiments, the delay duration acquisition module is configured to:
[0051] A first delay calibration response and a second delay calibration response sent by the stylus are received in sequence, the first delay calibration response includes the fourth moment, the second delay calibration response includes the fifth moment when the stylus sends the first delay calibration response, and the second delay calibration response is sent by the stylus after the first delay calibration response is sent; the sixth moment is the moment when the electronic device receives the first delay calibration response.
[0052] In some embodiments, the delay duration acquisition module is configured to:
[0053] After a communication connection is established between the electronic device and the stylus, acquiring the delay time once every preset time;
[0054] The delay duration included in the data synchronization request is the most recently acquired delay duration, or the delay duration included in the data synchronization request is an average value of multiple acquired delay durations.
[0055] In some embodiments, the synchronization request sending module is configured to:
[0056] A noise signal is detected, and the data synchronization request is sent to the stylus.
[0057] In some embodiments, the data synchronization request also includes a frequency value to be adjusted, and the data synchronization request is used to instruct the stylus and the electronic device to adjust the frequency to the frequency value at the same time, and the frequency adjustment module is configured to:
[0058] At the second moment, a frequency hopping request is sent to the stylus pen, and the frequency of the electronic device is adjusted to the frequency value, wherein the frequency hopping request is used to instruct the stylus pen to adjust the frequency to the frequency value.
[0059] According to a fourth aspect of an embodiment of the present disclosure, a frequency adjustment device is provided, which is configured in a stylus pen, and the device includes:
[0060] a synchronization request receiving module, configured to receive a data synchronization request sent by an electronic device, wherein the data synchronization request includes a first time, a second time, and a delay time, wherein the first time is the time when the electronic device sends the data synchronization request, the second time is the time when the electronic device adjusts the frequency, and the delay time is the time spent in the data transmission process between the electronic device and the stylus;
[0061] A time acquisition module, configured to acquire a seventh time, where the seventh time is the time when the data synchronization request is received;
[0062] a time determination module, configured to determine an eighth time based on the first time, the second time, the delay duration and the seventh time;
[0063] The frequency adjustment module is configured to adjust the frequency of the stylus at the eighth moment.
[0064] In some embodiments, the time determination module is configured to:
[0065] Determine a third time difference between the second moment and a ninth moment, the ninth moment being the moment of adding the delay time to the first moment;
[0066] The time obtained by adding the seventh time point and the third time difference is determined as the eighth time point.
[0067] In some embodiments, the data synchronization request also includes a frequency value to be adjusted, and the data synchronization request is used to instruct the stylus and the electronic device to adjust the frequency to the frequency value at the same time, and the frequency adjustment module is configured to:
[0068] At the eighth moment, the frequency of the stylus is adjusted to the frequency value.
[0069] In some embodiments, the apparatus further comprises:
[0070] a calibration request receiving module, configured to receive a delay calibration request sent by the electronic device;
[0071] The response sending module is configured to send a delay calibration response to the electronic device, and the delay calibration response includes a fourth moment and a fifth moment, the fourth moment is the moment when the stylus receives the delay calibration request, and the fifth moment is the moment when the stylus sends the delay calibration response.
[0072] In some embodiments, the response sending module is configured to:
[0073] A first delay calibration response and a second delay calibration response are sent to the electronic device in sequence, wherein the first delay calibration response includes the fourth moment, the second delay calibration response includes the fifth moment when the stylus sends the first delay calibration response, and the second delay calibration response is sent by the stylus after the first delay calibration response is sent.
[0074] According to a fifth aspect of an embodiment of the present disclosure, there is provided an electronic device, including:
[0075] processor;
[0076] a memory for storing processor-executable instructions;
[0077] The processor is configured to execute the method as described in the first aspect of the embodiment of the present disclosure.
[0078] According to a sixth aspect of an embodiment of the present disclosure, there is provided a stylus pen, comprising:
[0079] processor;
[0080] a memory for storing processor-executable instructions;
[0081] The processor is configured to execute the method as described in the second aspect of the embodiment of the present disclosure.
[0082] According to the seventh aspect of an embodiment of the present disclosure, a non-temporary computer-readable storage medium is provided. When instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the method described in the first aspect of the embodiment of the present disclosure.
[0083] According to an eighth aspect of an embodiment of the present disclosure, a non-transitory computer-readable storage medium is provided. When instructions in the storage medium are executed by a processor of the stylus pen, the stylus pen is enabled to execute the method described in the second aspect of the embodiment of the present disclosure.
[0084] The above method of the present disclosure has the following beneficial effects:
[0085] According to the method provided by the embodiment of the present disclosure, the electronic device obtains the delay time consumed in the data transmission process between the electronic device and the stylus, and then sends a data synchronization request to the stylus, wherein the data synchronization request includes a first moment, a second moment and a delay time, wherein the first moment is the moment when the electronic device sends the data synchronization request, and the second moment is the moment when the electronic device adjusts the frequency, and the frequency of the electronic device is adjusted at the second moment, and at the same time, the stylus determines an eighth moment according to the received data synchronization request, and adjusts the frequency of the stylus at the eighth moment, and calibrates the frequency adjustment moments of the electronic device and the stylus through the delay time, so that the electronic device and the stylus adjust the frequencies at the same moment, thereby ensuring that the operating frequencies of the electronic device and the stylus are consistent, and reducing the problem that the stylus function cannot be realized due to inconsistent frequencies between the two.
[0086] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0087] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0088] Figure 1 is a flow chart showing a frequency adjustment method according to an exemplary embodiment;
[0089] Figure 2 is a flow chart showing another frequency adjustment method according to an exemplary embodiment;
[0090] Figure 3 is a flow chart showing a process of determining a delay duration according to an exemplary embodiment;
[0091] Figure 4 is a schematic diagram showing various moments in a process of determining a delay duration according to an exemplary embodiment;
[0092] Figure 5 is a flow chart showing another frequency adjustment method according to an exemplary embodiment;
[0093] Figure 6 is a schematic diagram showing various moments in a frequency adjustment process according to an exemplary embodiment;
[0094] Figure 7 is a flow chart showing another frequency adjustment method according to an exemplary embodiment;
[0095] Figure 8 is a block diagram of a frequency adjustment device according to an exemplary embodiment;
[0096] Fig. 9 is a block diagram of another frequency adjustment device according to an exemplary embodiment;
[0097] Fig.10 It is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0098] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of devices and methods consistent with some aspects of the present invention as detailed in the appended claims.
[0099] Electronic devices and styluses are connected via Bluetooth. Styluses can be used to write notes, record and organize ideas, and can also be used for drawing, such as painting and graffiti. At the same time, styluses also support short video remote control, virtual laser and other functions. Styluses can improve our work efficiency and quality of life, making our lives more convenient and interesting.
[0100] When an electronic device is connected to a stylus pen, it is easily interfered by noise signals in the environment. In order to improve the anti-interference ability of the stylus pen, when the interference is more serious, the electronic device and the stylus pen can be adjusted to other working frequencies.
[0101] In a related technology, the screen of the electronic device sends an uplink signal to the stylus pen to achieve frequency hopping (frequency adjustment) of the electronic device and the stylus pen.
[0102] In another related technology, the electronic device and the stylus perform frequency hopping via Bluetooth. That is, when the screen of the electronic device detects a noise signal (for example, noise is generated when the charging cable is plugged in), a frequency hopping request is initiated to notify the BSP touch (board support package touch) of the electronic device, and the frequency hopping parameters are sent to the Bluetooth module of the electronic device via the BSP touch. The frequency hopping request and frequency hopping parameters are then sent to the stylus via the Bluetooth module. After receiving the frequency hopping request and frequency hopping parameters, the stylus performs frequency hopping and replies the ACK (Acknowledgement) of the completion of the frequency hopping to the Bluetooth module of the electronic device. The ACK is returned to the BSP touch via the Bluetooth module, and the BSP touch returns the ACK to the screen, and the frequency adjustment is completed.
[0103] Although both of the above-mentioned two related technologies can realize frequency hopping of the electronic device and the stylus, since the electronic device and the stylus are two clock systems, the times of the two may not be unified. There is a delay in the frequency hopping instruction (frequency hopping request or uplink signal) sent by the electronic device to the stylus, which makes the frequency hopping response of the stylus relatively slow, resulting in the problem that the stylus function cannot be realized because the operating frequencies of the electronic device and the stylus are consistent.
[0104] In view of the above-mentioned problem, a frequency adjustment method is provided in an embodiment of the present disclosure. The electronic device first obtains a delay time consumed in a data transmission process between the electronic device and the stylus pen, and then sends a data synchronization request to the stylus pen. The data synchronization request includes a first moment, a second moment and a delay time. The first moment is the moment when the electronic device sends the data synchronization request, and the second moment is the moment when the electronic device adjusts the frequency. The frequency of the electronic device is adjusted at the second moment. At the same time, the stylus pen determines an eighth moment according to the received data synchronization request, and adjusts the frequency of the stylus pen at the eighth moment. The frequency adjustment moments of the electronic device and the stylus pen are calibrated by the delay time, so that the electronic device and the stylus pen perform frequency adjustment at the same moment, thereby ensuring that the operating frequencies of the electronic device and the stylus pen are consistent, and reducing the problem that the stylus pen function cannot be realized due to inconsistent frequencies between the two.
[0105] The disclosed embodiments are applied to an electronic device and a stylus. The electronic device may be a mobile phone, a tablet computer, a laptop computer, a television, or other device that can interact with the stylus. The stylus may also be called a touch pen or an active pen. The electronic device is connected to the stylus. The stylus may be connected to at least one electronic device at the same time. For example, the stylus may be connected to a tablet computer, a laptop computer, and a television at the same time. Optionally, the electronic device and the stylus are connected via Bluetooth.
[0106] Below through Figure 1 and Figure 2 In the embodiments, the frequency adjustment process is described from the perspectives of the electronic device and the stylus respectively.
[0107] Figure 1 is a flow chart of a frequency adjustment method according to an exemplary embodiment, which is executed by an electronic device, see Figure 1 , the method comprises the following steps:
[0108] Step S101, obtaining a delay time, where the delay time is the time taken for the data transmission process between the electronic device and the stylus.
[0109] The delay duration is obtained by the electronic device before frequency hopping and is used to calibrate the delay during the frequency hopping process. The delay duration is the duration of the data transmission process between the electronic device and the stylus, that is, the duration of the process of the electronic device sending data to the stylus once.
[0110] Optionally, considering that the time consumed by the data transmission process between the electronic device and the stylus may be different in different environments, the electronic device can calculate the delay time in real time to ensure the validity of the delay time. The implementation method of calculating the delay time is as follows: Figure 3Alternatively, in order to obtain the delay time more quickly and reduce the amount of calculation, the delay time may be pre-stored in the electronic device. In this case, the delay time may be determined by a technician based on experimental verification.
[0111] Step S102, sending a data synchronization request to the stylus, the data synchronization request includes a first time, a second time and a delay time, the first time is the time when the electronic device sends the data synchronization request, and the second time is the time when the electronic device adjusts the frequency.
[0112] The data synchronization request is used to instruct the stylus pen and the electronic device to adjust the frequency at the same time, and the same time means that the local clock of the stylus pen and the local clock of the electronic device are the same time in the external environment. For example, the local clock of the stylus pen is 8 o'clock and the local clock of the electronic device is 9 o'clock, but at this time, it is the same time in the external environment, then the 8 o'clock of the local clock of the stylus pen and the 9 o'clock of the local clock of the electronic device are the same time. In addition, the time can also be called a time point, a timestamp, a time position, etc.
[0113] The data synchronization request includes a first moment, a second moment, and a delay time. The first moment is the moment when the electronic device sends the data synchronization request, and the second moment is the moment when the electronic device adjusts the frequency. The second moment is an estimated moment. In order to allow the stylus pen and the electronic device to adjust the frequency at the same moment, the second moment must be greater than the moment after the first moment and the delay time are added. That is, the electronic device needs to adjust the frequency of the electronic device after the stylus pen receives the data synchronization request, so as to avoid the electronic device adjusting the frequency before the stylus pen receives the data synchronization request, resulting in inconsistent working frequencies of the electronic device and the stylus. Among them, the first moment and the second moment are the moments of the local clock of the electronic device.
[0114] After the electronic device sends the data synchronization request to the stylus, the stylus can determine a time that is the same as the second time according to the data included in the data synchronization request, and then adjust the frequency of the stylus at the determined time.
[0115] Step S103: adjusting the frequency of the electronic device at the second moment.
[0116] The electronic device sends a data synchronization request, and waits until a second moment to adjust the frequency of the electronic device.
[0117] According to the method provided by the embodiment of the present disclosure, the electronic device first obtains the delay time consumed in the data transmission process between the electronic device and the stylus, and then sends a data synchronization request to the stylus, so that the stylus determines the time to adjust the frequency according to the data synchronization request, and calibrates the frequency adjustment time of the electronic device and the stylus by the delay time, so that the electronic device and the stylus adjust the frequency at the same time, thereby ensuring that the operating frequencies of the electronic device and the stylus are consistent, and reducing the problem that the stylus function cannot be realized due to inconsistent frequencies between the two.
[0118] Figure 2 is a flow chart showing another frequency adjustment method according to an exemplary embodiment, which is executed by a stylus pen, see Figure 2 , the method comprises the following steps:
[0119] Step S201, receiving a data synchronization request sent by an electronic device, the data synchronization request includes a first moment, a second moment and a delay duration, the first moment is the moment when the electronic device sends the data synchronization request, the second moment is the moment when the electronic device adjusts the frequency, and the delay duration is the duration consumed by the data transmission process between the electronic device and the stylus.
[0120] The contents of the data synchronization request and the delay duration refer to the above steps S101 and S102, which will not be repeated here.
[0121] Step S202, obtaining the seventh time, where the seventh time is the time when the data synchronization request is received.
[0122] The seventh moment is the moment of the local clock of the stylus.
[0123] Step S203, determining the eighth moment based on the first moment, the second moment, the delay duration and the seventh moment.
[0124] For the stylus, after receiving the data synchronization request at the seventh moment, the time difference between the moment when the stylus receives the data synchronization request and the moment when the frequency is adjusted can be calculated according to the first moment, the second moment and the delay time carried in the data synchronization request, and then the eighth moment when the frequency is adjusted can be determined according to the time difference and the seventh moment. The eighth moment is the moment of the local clock of the stylus.
[0125] Step S204, adjusting the frequency of the stylus at the eighth moment.
[0126] The stylus waits until the eighth moment and adjusts the frequency of the stylus.
[0127] According to the method provided by the embodiment of the present disclosure, a stylus receives a data synchronization request sent by an electronic device, and the data synchronization request includes a delay time consumed by the electronic device first obtaining a data transmission process between the electronic device and the stylus, a time when the electronic device adjusts a frequency, and a time when the data synchronization request is sent. The stylus determines a time to adjust the frequency according to the data synchronization request, and calibrates the frequency adjustment time of the electronic device and the stylus by the delay time, so that the electronic device and the stylus adjust the frequency at the same time, thereby ensuring that the operating frequencies of the electronic device and the stylus are consistent, and reducing the problem that the stylus function cannot be realized due to inconsistent frequencies between the two.
[0128] The frequency adjustment method provided by the embodiment of the present disclosure includes a delay calibration phase and a frequency hopping phase. Figure 3 and Figure 5 The illustrated embodiment illustrates the process of determining the delay duration in the delay calibration phase and the process of adjusting the frequency in the frequency hopping phase:
[0129] Figure 3 is a flowchart showing a process of determining a delay time according to an exemplary embodiment, which is performed by an electronic device and a stylus, see Figure 3 , the process includes the following steps:
[0130] Step S301: the electronic device sends a delay calibration request to the stylus pen and obtains a third moment, where the third moment is the moment when the electronic device sends the delay calibration request.
[0131] The delay calibration request is used to request calibration of the delay duration between the electronic device and the stylus. While the electronic device sends the delay calibration request to the stylus, it obtains a third time when the electronic device sends the delay calibration request, and the third time is the time of the local clock of the electronic device. For example, see Figure 4 In the schematic diagram of each moment shown, the third moment is the first moment in the process of determining the delay duration.
[0132] In some embodiments, after the electronic device establishes a communication connection with the stylus, the delay calibration request is immediately sent to the stylus. Alternatively, after the electronic device establishes a communication connection with the stylus, the delay calibration request is sent once every preset time period. The preset time period is a preset time period, for example, the preset time period is 20 minutes, 30 minutes, 40 minutes or other time periods.
[0133] Step S302: the stylus receives a delay calibration request sent by the electronic device.
[0134] The stylus receives the delay calibration request sent by the electronic device, and obtains a fourth time when the delay calibration request is received, where the fourth time is the time of the local clock of the stylus. Figure 4The fourth moment is the second moment in the process of determining the delay duration.
[0135] Step S303, the stylus sends a delay calibration response to the electronic device, the delay calibration response includes a fourth moment and a fifth moment, the fourth moment is the moment when the stylus receives the delay calibration request, and the fifth moment is the moment when the stylus sends the delay calibration response.
[0136] After receiving the delay calibration request, the stylus sends a delay calibration response to the electronic device in response to the delay calibration request. The delay calibration response is used to inform the electronic device of the fourth moment and the fifth moment so that the electronic device can determine the delay duration based on the fourth moment and the fifth moment.
[0137] The fifth moment is the moment of sending the delay calibration response, and the fifth moment is the moment of the local clock of the stylus. Figure 4 The fifth moment is the third moment in the process of determining the delay duration. Optionally, it is not possible to add the fifth moment only when sending the delay calibration request. Therefore, before sending the delay calibration response, the fifth moment of sending the delay calibration response is first determined, and the fifth moment is included in the delay calibration response.
[0138] In some embodiments, the delay calibration response includes a first delay calibration response and a second delay calibration response, and step S303 includes: the stylus sequentially sends the first delay calibration response and the second delay calibration response to the electronic device, the first delay calibration response includes the fourth moment, the second delay calibration response includes the fifth moment when the stylus sends the first delay calibration response, and the second delay calibration response is sent by the stylus after the first delay calibration response is sent. That is to say, at the fifth moment, the stylus sends the first delay calibration response to the electronic device, and after sending the delay calibration response, the fifth moment when the delay calibration response is sent can be determined. At this time, the second delay calibration response is sent to the electronic device again. The stylus informs the electronic device of the fourth moment and the fifth moment through two transmissions, so that the electronic device can know the accurate fourth moment and fifth moment, thereby ensuring the accuracy of the fourth moment and the fifth moment, thereby improving the accuracy of the delay duration determined subsequently.
[0139] Step S304, the electronic device receives the delay calibration response sent by the stylus, and obtains a sixth moment, where the sixth moment is the moment when the electronic device receives the delay calibration response.
[0140] The electronic device receives the delay calibration response sent by the stylus, and obtains the sixth time when the delay calibration response is received, where the sixth time is the time of the local clock of the electronic device. Figure 4 , the sixth moment is the fourth moment in the process of determining the delay duration.
[0141] In some embodiments, when the delay calibration response includes a first delay calibration response and a second delay calibration response, step S304 includes: the electronic device sequentially receives the first delay calibration response and the second delay calibration response sent by the stylus. In this case, the sixth moment is the moment when the electronic device receives the first delay calibration response.
[0142] Step S305: The electronic device determines the delay duration based on the third moment, the fourth moment, the fifth moment, and the sixth moment.
[0143] from Figure 4 It can be seen that the delay duration is the time difference between the third moment of the electronic device and the fourth moment of the stylus, or the delay duration is the time difference between the fifth moment of the stylus and the sixth moment of the electronic device. However, since the time of the local clock of the electronic device and the local clock of the stylus are not unified, the delay duration cannot be directly calculated based on the third moment and the fourth moment, or based on the fifth moment and the sixth moment. Therefore, it is necessary to calculate the delay duration based on the third moment, the fourth moment, the fifth moment and the sixth moment.
[0144] In some embodiments, since the sixth moment and the third moment are the same clock moment, and the fifth moment and the fourth moment are the same clock moment, the first time difference between the sixth moment and the third moment and the second time difference between the fifth moment and the fourth moment are determined, and the difference between the first time difference and the second time difference is divided by 2 to obtain the delay duration. Figure 4 The difference between the first time difference and the second time difference is two delay durations, so the difference is divided by 2 to obtain the delay duration.
[0145] It should be noted that the above Figure 3 The embodiment shown is to illustrate the process of obtaining the delay time once. In another embodiment, after the communication connection is established between the electronic device and the stylus, the electronic device obtains the delay time once every preset time. The process of obtaining the delay time each time is the same as the above. Figure 3 The embodiments shown are identical.
[0146] In some embodiments, in the case where the delay duration is obtained once every preset time, the delay duration included in the data synchronization request is the latest obtained delay duration, so that the latest delay duration can be used for delay calibration. Alternatively, the delay duration included in the data synchronization request is the average value of multiple obtained delay durations, which can avoid the influence of some accidental situations and make the delay duration used in delay calibration more accurate.
[0147] According to the method provided by the embodiment of the present disclosure, the electronic device sends a delay calibration request to the stylus pen and receives a delay calibration response returned by the stylus pen, thereby obtaining a third moment when the electronic device sends the delay calibration request, a fourth moment when the stylus pen receives the delay calibration request, a fifth moment when the stylus pen returns the delay calibration response, and a sixth moment when the electronic device receives the delay calibration response. The delay duration is calculated according to the third moment, the fourth moment, the fifth moment, and the sixth moment, so that when the electronic device and the stylus pen perform frequency adjustment, the same moment for frequency adjustment can be determined according to the delay duration, thereby ensuring that the operating frequencies of the electronic device and the stylus are consistent, and reducing the problem of the stylus pen function not being able to be realized due to inconsistent frequencies between the two.
[0148] Figure 5 is a flow chart showing another frequency adjustment method according to an exemplary embodiment, which is performed by an electronic device and a stylus, see Figure 5 , the method comprises the following steps:
[0149] Step S501: the electronic device obtains a delay duration.
[0150] The implementation of step S501 is shown in the above Figure 3 The illustrated implementation will not be described in detail here.
[0151] Step S502: the electronic device detects a noise signal and sends a data synchronization request to the stylus.
[0152] The noise signal is noise that affects the function of the stylus, for example, the noise signal is noise generated when the electronic device is connected to a charger, or noise generated when the electronic device contacts other electronic devices, or environmental noise in the environment where the electronic device is located.
[0153] When the electronic device detects a noise signal, it means that the stylus has been affected by the noise. Therefore, it is necessary to adjust the frequency of the stylus and the electronic device so that the adjusted frequency is significantly different from the frequency of the noise. The less similar the frequency of the stylus and the electronic device is to the frequency of the noise, the stronger the anti-interference ability is. The more similar the frequency of the stylus and the electronic device is to the frequency of the noise, the weaker the anti-interference ability is. In order to improve the anti-interference ability and to enable the electronic device and the stylus to adjust the frequency at the same time, the electronic device first sends a data synchronization request to the stylus. The content included in the data synchronization request refers to the above step S102 and will not be repeated here.
[0154] In some embodiments, the data synchronization request also includes the frequency value to be adjusted, that is, after detecting the noise signal, the electronic device can determine the frequency value to be adjusted based on the noise signal. The data synchronization request includes the frequency value to be adjusted, so that after the stylus receives the data synchronization request, it can determine which frequency value to adjust the frequency to.
[0155] In some embodiments, the data synchronization request does not include the frequency value to be adjusted, but the electronic device and the stylus agree in advance on an adjustment method, and the electronic device and the stylus directly adjust the frequency according to the adjustment method.
[0156] Optionally, the adjustment method is: setting a correspondence between the frequency before adjustment and the frequency after adjustment, and adjusting the frequency according to the correspondence. For example, in the correspondence, the frequency 1 before adjustment corresponds to the frequency 2 after adjustment, the frequency 2 before adjustment corresponds to the frequency 3 after adjustment, and the frequency 3 before adjustment corresponds to the frequency 1 after adjustment. When the frequency needs to be adjusted, if the current frequency is frequency 1, it is determined to adjust the frequency to frequency 2; if the current frequency is frequency 2, it is determined to adjust the frequency to frequency 3; if the current frequency is frequency 3, it is determined to adjust the frequency to frequency 1.
[0157] It should be noted that when the electronic device detects a noise signal, sending a data synchronization request to the stylus is an optional step. In some embodiments, the electronic device may send a data synchronization request to the stylus at any time, not just when a noise signal is detected.
[0158] Step S503: the stylus receives a data synchronization request sent by the electronic device and obtains the seventh moment.
[0159] Step S504: the stylus determines a third time difference between the second moment and the ninth moment, and determines the eighth moment as the moment obtained by adding the seventh moment to the third time difference.
[0160] Among them, the ninth moment is the moment at which the delay time is increased by the first moment.
[0161] For example, see Figure 6 When the first moment, the second moment and the delay duration are known, the stylus can calculate the third time difference between the ninth moment and the second moment. The ninth moment of the local clock of the electronic device and the second moment of the local clock of the stylus are the same moment. In order to enable the electronic device and the stylus to adjust the frequency at the same moment, the third time difference can be used as the time difference between the seventh moment and the moment when the stylus adjusts the frequency. Therefore, the moment after adding the seventh moment and the third time difference is determined to be the eighth moment.
[0162] Step S505: the stylus adjusts the frequency of the stylus at the eighth moment.
[0163] Step S506: the electronic device adjusts the frequency of the electronic device at the second moment.
[0164] Since the eighth moment and the second moment are the same moment, the stylus adjusts its frequency at the eighth moment and the electronic device adjusts its frequency at the second moment, which can ensure that the electronic device and the stylus perform frequency hopping at the same moment.
[0165] In some embodiments, when the data synchronization request also includes a frequency value to be adjusted, the electronic device adjusts the frequency of the electronic device to the frequency value at the second moment, and the stylus adjusts the frequency of the stylus to the frequency value at the eighth moment.
[0166] In some embodiments, the electronic device also sends a frequency hopping request to the stylus at the second moment, and the frequency hopping request is used to instruct the stylus to adjust the frequency. Optionally, when the data synchronization request includes a frequency value to be adjusted, the frequency hopping request is used to instruct the stylus to adjust the frequency to the frequency value. However, for the stylus, the stylus adjusts the frequency of the stylus at the eighth moment, and does not need to wait until the frequency hopping request is received before adjusting, that is, the eighth moment when the stylus actually adjusts the frequency has nothing to do with the moment when the frequency hopping request is received.
[0167] Optionally, adjusting the frequency of the electronic device includes: adjusting the downlink frequency of the electronic device.
[0168] According to the method provided by the embodiment of the present disclosure, the electronic device obtains the delay time consumed in the data transmission process between the electronic device and the stylus, and then sends a data synchronization request to the stylus, wherein the data synchronization request includes a first moment, a second moment and a delay time, wherein the first moment is the moment when the electronic device sends the data synchronization request, and the second moment is the moment when the electronic device adjusts the frequency, and the frequency of the electronic device is adjusted at the second moment, and at the same time, the stylus determines an eighth moment according to the received data synchronization request, and adjusts the frequency of the stylus at the eighth moment, and calibrates the frequency adjustment moments of the electronic device and the stylus through the delay time, so that the electronic device and the stylus adjust the frequencies at the same moment, thereby ensuring that the operating frequencies of the electronic device and the stylus are consistent, and reducing the problem that the stylus function cannot be realized due to inconsistent frequencies between the two.
[0169] Figure 7 is a flow chart showing another frequency adjustment method according to an exemplary embodiment, which is performed by an electronic device and a stylus, see Figure 7 , the method comprises the following steps:
[0170] Step S701: The electronic device sends a Delay_Calibration_Req to the stylus pen and uses a local clock to record a timestamp T1.
[0171] Wherein, Delay_Calibration_Req is the delay calibration request mentioned above, and timestamp T1 is the third moment mentioned above.
[0172] Step S702: The stylus receives Delay_Calibration_Req and records the timestamp T2 using the local clock.
[0173] Among them, the timestamp T2 is the fourth moment mentioned above.
[0174] Step S703: The stylus generates and sends a Delay_Calibration_Resp message to the electronic device, and the Delay_Calibration_Resp message includes a timestamp T2.
[0175] Step S704: The electronic device uses the local clock to obtain the timestamp T4 when the Delay_Calibration_Resp message is received.
[0176] Among them, the timestamp T4 is the sixth moment mentioned above.
[0177] Step S705: The stylus sends a Delay_Calibration_Resp_Follow_up message to the electronic device, where the Delay_Calibration_Resp_Follow_up message includes a timestamp T3.
[0178] Among them, the timestamp T3 is the fifth moment mentioned above.
[0179] Step S706: The electronic device calculates the delay duration according to timestamp T1, timestamp T2, timestamp T3 and timestamp T4.
[0180] For example, the delay time is calculated using the following formula:
[0181]
[0182] Among them, Msg delay Indicates the delay duration.
[0183] Step S707: The electronic device records the timestamp T5 using the local clock and initiates an Info_Sync request, wherein the Info_Sync request includes the timestamp T5, the delay duration and the timestamp T7.
[0184] The Info_Sync request is the data synchronization request, the timestamp T5 is the first moment, and the timestamp T7 is the second moment.
[0185] Step S708: The stylus receives the Info_Sync request and uses the local clock to record the timestamp T6.
[0186] Among them, the timestamp T6 is the seventh moment mentioned above.
[0187] Step S709: the electronic device initiates a frequency hopping request Hop Frequency_Req at timestamp T7, and adjusts the frequency at timestamp T7.
[0188] Step S710 , the stylus calculates the time difference Tdiff according to the timestamp T5 , the delay time and the timestamp T7 , calculates the timestamp T8 according to the time difference Tdiff and the timestamp T6 , and adjusts the frequency at the timestamp T8 .
[0189] Where Tdiff is expressed as T7-(T5+Msg delay ), the timestamp T8 is expressed as T6+Tdiff, and the timestamp T8 is the eighth moment mentioned above.
[0190] Figure 7 The implementation of the embodiment shown is described above. Figure 1-Figure 6 , I will not go into details here.
[0191] Figure 8 is a block diagram of a frequency adjustment device according to an exemplary embodiment, which is configured in an electronic device, see Figure 8 , the device comprises:
[0192] The delay duration acquisition module 801 is configured to acquire the delay duration, where the delay duration is the duration of the data transmission process between the electronic device and the stylus;
[0193] The synchronization request sending module 802 is configured to send a data synchronization request to the stylus, wherein the data synchronization request includes a first time, a second time, and a delay time, wherein the first time is the time when the electronic device sends the data synchronization request, and the second time is the time when the electronic device adjusts the frequency;
[0194] The frequency adjustment module 803 is configured to adjust the frequency of the electronic device at the second moment.
[0195] In the device provided by the embodiment of the present disclosure, the electronic device first obtains the delay time consumed in the data transmission process between the electronic device and the stylus, and then sends a data synchronization request to the stylus, so that the stylus determines the time to adjust the frequency according to the data synchronization request, and calibrates the frequency adjustment time of the electronic device and the stylus through the delay time, so that the electronic device and the stylus adjust the frequency at the same time, ensuring that the operating frequencies of the electronic device and the stylus are consistent, reducing the problem of the stylus function not being able to be realized due to inconsistent frequencies between the two.
[0196] In some embodiments, the delay duration acquisition module 801 is configured to:
[0197] Sending a delay calibration request to the stylus, and acquiring a third moment, where the third moment is the moment when the electronic device sends the delay calibration request;
[0198] receiving a delay calibration response sent by the stylus pen, and acquiring a sixth time, wherein the delay calibration response includes a fourth time and a fifth time, wherein the fourth time is the time when the stylus pen receives the delay calibration request, the fifth time is the time when the stylus pen sends the delay calibration response, and the sixth time is the time when the electronic device receives the delay calibration response;
[0199] The delay duration is determined based on the third time instant, the fourth time instant, the fifth time instant, and the sixth time instant.
[0200] In some embodiments, the delay duration acquisition module 801 is configured to:
[0201] Determine a first time difference between the sixth moment and the third moment, and a second time difference between the fifth moment and the fourth moment;
[0202] The difference between the first time difference and the second time difference is divided by 2 to obtain the delay duration.
[0203] In some embodiments, the delay duration acquisition module 801 is configured to:
[0204] The first delay calibration response and the second delay calibration response sent by the stylus are received in sequence, the first delay calibration response includes the fourth moment, the second delay calibration response includes the fifth moment when the stylus sends the first delay calibration response, and the second delay calibration response is sent by the stylus after the first delay calibration response is sent; the sixth moment is the moment when the electronic device receives the first delay calibration response.
[0205] In some embodiments, the delay duration acquisition module 801 is configured to:
[0206] After a communication connection is established between the electronic device and the stylus, a delay time is obtained every preset time period;
[0207] The delay duration included in the data synchronization request is the latest acquired delay duration, or the delay duration included in the data synchronization request is an average value of multiple acquired delay durations.
[0208] In some embodiments, the synchronization request sending module 802 is configured to:
[0209] A noise signal is detected and a data synchronization request is sent to the stylus.
[0210] In some embodiments, the data synchronization request also includes a frequency value to be adjusted. The data synchronization request is used to instruct the stylus and the electronic device to adjust the frequency to the frequency value at the same time. The frequency adjustment module 803 is configured to:
[0211] At the second moment, a frequency hopping request is sent to the stylus pen, and the frequency of the electronic device is adjusted to the frequency value, where the frequency hopping request is used to instruct the stylus pen to adjust the frequency to the frequency value.
[0212] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0213] Fig. 9 is a block diagram of another frequency adjustment device according to an exemplary embodiment, which is configured in a stylus pen, see Fig. 9 , the device comprises:
[0214] The synchronization request receiving module 901 is configured to receive a data synchronization request sent by an electronic device, wherein the data synchronization request includes a first time, a second time, and a delay time, wherein the first time is the time when the electronic device sends the data synchronization request, the second time is the time when the electronic device adjusts the frequency, and the delay time is the time taken for the data transmission process between the electronic device and the stylus;
[0215] The time acquisition module 902 is configured to acquire a seventh time, where the seventh time is the time when the data synchronization request is received;
[0216] The time determination module 903 is configured to determine the eighth time based on the first time, the second time, the delay time and the seventh time;
[0217] The frequency adjustment module 904 is configured to adjust the frequency of the stylus at an eighth moment.
[0218] In the device provided by the embodiment of the present disclosure, a stylus receives a data synchronization request sent by an electronic device, and the data synchronization request includes a delay time consumed by the electronic device first obtaining a data transmission process between the electronic device and the stylus, a time when the electronic device adjusts a frequency, and a time when the data synchronization request is sent. The stylus determines a time to adjust the frequency according to the data synchronization request, and calibrates the frequency adjustment time of the electronic device and the stylus by the delay time, so that the electronic device and the stylus adjust the frequency at the same time, thereby ensuring that the operating frequencies of the electronic device and the stylus are consistent, and reducing the problem that the stylus function cannot be realized due to inconsistent frequencies between the two.
[0219] In some embodiments, the time determination module 903 is configured to:
[0220] Determine a third time difference between the second moment and a ninth moment, the ninth moment being the moment of the first moment plus the delay time;
[0221] The time obtained by adding the seventh time and the third time difference is determined as the eighth time.
[0222] In some embodiments, the data synchronization request also includes a frequency value to be adjusted. The data synchronization request is used to instruct the stylus and the electronic device to adjust the frequency to the frequency value at the same time. The frequency adjustment module 904 is configured to:
[0223] At the eighth moment, the frequency of the stylus is adjusted to the frequency value.
[0224] In some embodiments, the apparatus further comprises:
[0225] A calibration request receiving module, configured to receive a delay calibration request sent by an electronic device;
[0226] The response sending module is configured to send a delay calibration response to the electronic device. The delay calibration response includes a fourth moment and a fifth moment. The fourth moment is the moment when the stylus receives the delay calibration request, and the fifth moment is the moment when the stylus sends the delay calibration response.
[0227] In some embodiments, the response sending module is configured to:
[0228] A first delay calibration response and a second delay calibration response are sent to the electronic device in sequence, wherein the first delay calibration response includes a fourth moment, and the second delay calibration response includes a fifth moment when the stylus sends the first delay calibration response, and the second delay calibration response is sent by the stylus after the first delay calibration response is sent.
[0229] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0230] An embodiment of the present disclosure further provides an electronic device, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to execute the frequency adjustment method in the above embodiment.
[0231] Fig.10 is a block diagram of an electronic device 1000 according to an exemplary embodiment.
[0232] Reference Fig.10 , the electronic device 1000 may include one or more of the following components: a processing component 1002 , a memory 1004 , a power component 1006 , a multimedia component 1008 , an audio component 1010 , an input / output (I / O) interface 1012 , a sensor component 1014 , and a communication component 1016 .
[0233] The processing component 1002 generally controls the overall operation of the electronic device 1000, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 1002 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 1002 may include one or more modules to facilitate the interaction between the processing component 1002 and other components. For example, the processing component 1002 may include a multimedia module to facilitate the interaction between the multimedia component 1008 and the processing component 1002.
[0234] The memory 1004 is configured to store various types of data to support operations on the electronic device 1000. Examples of such data include instructions for any application or method operating on the electronic device 1000, contact data, phone book data, messages, pictures, videos, etc. The memory 1004 may be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0235] The power supply component 1006 provides power to various components of the electronic device 1000. The power supply component 1006 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 1000.
[0236] The multimedia component 1008 includes a screen that provides an output interface between the electronic device 1000 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 1008 includes a front camera and / or a rear camera. When the electronic device 1000 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and the rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0237] The audio component 1010 is configured to output and / or input audio signals. For example, the audio component 1010 includes a microphone (MIC), and when the electronic device 1000 is in an operation mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 1004 or sent via the communication component 1016. In some embodiments, the audio component 1010 also includes a speaker for outputting audio signals.
[0238] I / O interface 1012 provides an interface between processing component 1002 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: home button, volume button, start button, and lock button.
[0239] The sensor assembly 1014 includes one or more sensors for providing various aspects of status assessment for the electronic device 1000. For example, the sensor assembly 1014 can detect the open / closed state of the electronic device 1000, the relative positioning of components, such as the display and keypad of the electronic device 1000, and the sensor assembly 1014 can also detect the position change of the electronic device 1000 or a component of the electronic device 1000, the presence or absence of user contact with the electronic device 1000, the orientation or acceleration / deceleration of the electronic device 1000, and the temperature change of the electronic device 1000. The sensor assembly 1014 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 1014 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 1014 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0240] The communication component 1016 is configured to facilitate wired or wireless communication between the electronic device 1000 and other devices. The electronic device 1000 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 1016 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 1016 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0241] In an exemplary embodiment, the electronic device 1000 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.
[0242] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 1004 including instructions, and the instructions can be executed by the processor 820 of the electronic device 1000 to complete the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0243] The embodiments of the present disclosure further provide a non-transitory computer-readable storage medium. When instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute the frequency adjustment method in the above embodiment.
[0244] The embodiment of the present disclosure further provides a stylus pen, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to execute the frequency adjustment method in the above embodiment.
[0245] The embodiments of the present disclosure further provide a non-transitory computer-readable storage medium. When instructions in the storage medium are executed by a processor of the stylus pen, the stylus pen can execute the frequency adjustment method in the above embodiments.
[0246] Those skilled in the art will readily appreciate other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art that are not disclosed in this disclosure. The specification and examples are to be considered exemplary only, and the true scope and spirit of the present invention are indicated by the following claims.
[0247] It should be understood that the present invention is not limited to the exact construction that has been described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.
Claims
1. A frequency adjustment method, characterized in that: Executed by an electronic device, the method includes: Obtaining a delay duration, where the delay duration is the duration consumed in a data transmission process between the electronic device and the stylus; Sending a data synchronization request to the stylus, wherein the data synchronization request includes a first time, a second time, and the delay duration, wherein the first time is the time when the electronic device sends the data synchronization request, and the second time is the time when the electronic device adjusts the frequency; The frequency of the electronic device is adjusted at the second moment.
2. The method according to claim 1, characterized in that: The acquisition delay duration includes: Sending a delay calibration request to the stylus pen, and acquiring a third time, where the third time is the time when the electronic device sends the delay calibration request; receiving a delay calibration response sent by the stylus pen, and acquiring a sixth time, wherein the delay calibration response includes a fourth time and a fifth time, wherein the fourth time is the time when the stylus pen receives the delay calibration request, the fifth time is the time when the stylus pen sends the delay calibration response, and the sixth time is the time when the electronic device receives the delay calibration response; The delay duration is determined based on the third moment, the fourth moment, the fifth moment and the sixth moment.
3. The method according to claim 2, characterized in that The determining the delay duration based on the third moment, the fourth moment, the fifth moment, and the sixth moment includes: Determine a first time difference between the sixth moment and the third moment, and a second time difference between the fifth moment and the fourth moment; The delay duration is obtained by dividing the difference between the first time difference and the second time difference by 2.
4. The method according to claim 2, characterized in that: The receiving a delay calibration response sent by the stylus comprises: receiving in sequence a first delay calibration response and a second delay calibration response sent by the stylus, wherein the first delay calibration response includes the fourth moment, the second delay calibration response includes a fifth moment when the stylus sends the first delay calibration response, and the second delay calibration response is sent by the stylus after the first delay calibration response is sent; The sixth moment is the moment when the electronic device receives the first delay calibration response.
5. The method according to claim 1, characterized in that The acquisition delay duration includes: After a communication connection is established between the electronic device and the stylus, acquiring the delay time once every preset time; The delay duration included in the data synchronization request is the most recently acquired delay duration, or the delay duration included in the data synchronization request is an average value of multiple acquired delay durations.
6. The method according to any one of claims 1 to 5, characterized in that: The sending a data synchronization request to the stylus comprises: A noise signal is detected, and the data synchronization request is sent to the stylus.
7. The method according to any one of claims 1 to 5, characterized in that: The data synchronization request also includes a frequency value to be adjusted, and the data synchronization request is used to instruct the stylus pen and the electronic device to adjust the frequency to the frequency value at the same time, and adjusting the frequency of the electronic device at the second time includes: At the second moment, a frequency hopping request is sent to the stylus pen, and the frequency of the electronic device is adjusted to the frequency value, wherein the frequency hopping request is used to instruct the stylus pen to adjust the frequency to the frequency value.
8. A frequency adjustment method, characterized in that: Executed by a stylus pen, the method includes: Receiving a data synchronization request sent by an electronic device, wherein the data synchronization request includes a first time, a second time, and a delay time, wherein the first time is the time when the electronic device sends the data synchronization request, the second time is the time when the electronic device adjusts the frequency, and the delay time is the time spent in the data transmission process between the electronic device and the stylus; Acquire a seventh time, where the seventh time is the time when the data synchronization request is received; Determine an eighth time based on the first time, the second time, the delay duration and the seventh time; The frequency of the stylus is adjusted at the eighth moment.
9. The method according to claim 8, characterized in that The determining the eighth time based on the first time, the second time, the delay duration and the seventh time includes: Determine a third time difference between the second moment and a ninth moment, the ninth moment being the moment of adding the delay time to the first moment; The time obtained by adding the seventh time point and the third time difference is determined as the eighth time point.
10. The method according to claim 8, characterized in that The data synchronization request also includes a frequency value to be adjusted, and the data synchronization request is used to instruct the stylus pen and the electronic device to adjust the frequency to the frequency value at the same time, and adjusting the frequency of the stylus pen at the eighth moment includes: At the eighth moment, the frequency of the stylus is adjusted to the frequency value.
11. The method according to claim 8, characterized in that The method further comprises: receiving a delay calibration request sent by the electronic device; A delay calibration response is sent to the electronic device, wherein the delay calibration response includes a fourth time and a fifth time, wherein the fourth time is the time when the stylus receives the delay calibration request, and the fifth time is the time when the stylus sends the delay calibration response.
12. The method according to claim 11, characterized in that The sending a delay calibration response to the electronic device includes: A first delay calibration response and a second delay calibration response are sent to the electronic device in sequence, wherein the first delay calibration response includes the fourth moment, the second delay calibration response includes the fifth moment when the stylus sends the first delay calibration response, and the second delay calibration response is sent by the stylus after the first delay calibration response is sent.
13. A frequency adjustment device, characterized in that: The device is configured in an electronic device, and comprises: A delay duration acquisition module is configured to acquire a delay duration, where the delay duration is the duration consumed in the data transmission process between the electronic device and the stylus; a synchronization request sending module, configured to send a data synchronization request to the stylus, wherein the data synchronization request includes a first time, a second time, and the delay duration, wherein the first time is the time when the electronic device sends the data synchronization request, and the second time is the time when the electronic device adjusts the frequency; The frequency adjustment module is configured to adjust the frequency of the electronic device at the second moment.
14. A frequency adjustment device, characterized in that: Configured in a stylus, the device comprises: a synchronization request receiving module, configured to receive a data synchronization request sent by an electronic device, wherein the data synchronization request includes a first time, a second time, and a delay time, wherein the first time is the time when the electronic device sends the data synchronization request, the second time is the time when the electronic device adjusts the frequency, and the delay time is the time spent in the data transmission process between the electronic device and the stylus; A time acquisition module, configured to acquire a seventh time, where the seventh time is the time when the data synchronization request is received; a time determination module, configured to determine an eighth time based on the first time, the second time, the delay duration and the seventh time; The frequency adjustment module is configured to adjust the frequency of the stylus at the eighth moment.
15. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to execute the method as claimed in any one of claims 1 to 7.
16. A stylus pen, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to execute the method as claimed in any one of claims 8 to 12.
17. A non-transitory computer-readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the method as claimed in any one of claims 1 to 7.
18. A non-transitory computer-readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor of the stylus pen, the stylus pen is enabled to execute the method as claimed in any one of claims 8 to 12.