CN114356124B - Cycle self-adaption method, device, active pen and computer readable storage medium - Google Patents
Cycle self-adaption method, device, active pen and computer readable storage medium Download PDFInfo
- Publication number
- CN114356124B CN114356124B CN202111514213.2A CN202111514213A CN114356124B CN 114356124 B CN114356124 B CN 114356124B CN 202111514213 A CN202111514213 A CN 202111514213A CN 114356124 B CN114356124 B CN 114356124B
- Authority
- CN
- China
- Prior art keywords
- signal
- period
- screen
- active pen
- receiving function
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 61
- 238000004891 communication Methods 0.000 claims abstract description 46
- 230000000737 periodic effect Effects 0.000 claims abstract description 22
- 230000006870 function Effects 0.000 claims description 89
- 230000006978 adaptation Effects 0.000 claims description 28
- 230000000630 rising effect Effects 0.000 claims description 23
- 230000003044 adaptive effect Effects 0.000 claims description 20
- 230000008569 process Effects 0.000 description 7
- 238000004590 computer program Methods 0.000 description 5
- 238000013461 design Methods 0.000 description 4
- 230000005540 biological transmission Effects 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 230000007488 abnormal function Effects 0.000 description 2
- 230000008859 change Effects 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 230000004044 response Effects 0.000 description 2
- 230000001360 synchronised effect Effects 0.000 description 2
- 238000012790 confirmation Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000001914 filtration Methods 0.000 description 1
- 230000007257 malfunction Effects 0.000 description 1
- 238000005259 measurement Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
- XLYOFNOQVPJJNP-UHFFFAOYSA-N water Substances O XLYOFNOQVPJJNP-UHFFFAOYSA-N 0.000 description 1
Landscapes
- Position Input By Displaying (AREA)
- User Interface Of Digital Computer (AREA)
Abstract
The invention discloses a period self-adapting method, a device, an active pen and a computer readable storage medium, wherein a screen end device is taken as a host, a period timer is started at the beginning of capturing an external signal, and a signal receiving function is firstly closed for a period of time when the external signal is judged to be a screen signal, and the active pen can ignore irrelevant signals possibly detected in a screen signal sending interval because the screen signal is a periodic signal; stopping the timer when the screen signal is detected again, so that the timer can record the interval between two times of occurrence time of the screen signal, and further a signal period of the screen signal is obtained; the communication period of the active pen is adjusted through the signal period, so that the self-adaption of the active pen to the screen signal period is realized, the active pen can autonomously identify the period of the screen signal sent by the screen end in the mode no matter whether the screen end equipment is of the same manufacturer or of the same kind, and the communication period is consistent with the signal period adjustment, so that the active pen can be normally used for all the screen end equipment.
Description
Technical Field
The present invention relates to the field of embedded technologies, and in particular, to a period adaptive method, apparatus, active pen, and computer readable storage medium.
Background
With the rapid development of electronic technology, active pens are also becoming common electronic devices in people's daily lives. The active pen writes on the electronic screen, essentially the process of pen and screen communication interaction. Similar to most communication modes, the wireless communication of the active pen and the screen is distinguished from the master and slave. At present, the communication protocol of the active pen comprises two types of a pen and a screen, and the communication stability and the normal function can be ensured only under the condition that the processing periods of the pen and the screen are synchronous (the error is very small). And the screen signal period of the electronic screen produced by different screens or different screen factories has certain deviation. In some communication protocols, the period error is required to be smaller than 0.4us, and when the error is larger than the error, if the pen end cannot be adaptively adjusted, the active pen can be used on the screen to cause abnormal functions, so that the problem that the active pen is difficult to write normally on the screen due to the deviation of screen signal periods of screen equipment of different factories or types is reflected.
Disclosure of Invention
The invention mainly aims to provide a period self-adaptive method, a period self-adaptive device, an active pen and a computer readable storage medium, and aims to solve the technical problem that the active pen is difficult to write normally on a screen due to the fact that screen signal periods of screen devices of different factories or types are deviated.
To achieve the above object, the present invention provides a cycle adaptive method, including:
after the active pen starts the signal receiving function, if the existence identification of the external signal is captured, the external signal is determined to be received, and a period timer is started to start timing;
if the external signal is analyzed to be a screen signal sent by the screen terminal equipment, the signal receiving function is closed and then is opened again after the preset first time is at most;
after the signal receiving function is restarted, if the existence identification of the external signal is captured again, determining that the external signal is received again, and stopping the period timer;
and if the external signal is analyzed to be the screen signal, obtaining the signal period of the screen signal based on the current count of the period timer, so as to adjust the communication period of the active pen according to the signal period.
Optionally, before the step of turning off the signal receiving function at most for a preset first time period and then turning on again if the external signal is analyzed to be the screen signal sent by the screen terminal device, the method further includes:
judging whether the external signal is the screen signal or not;
after the step of determining whether the external signal is the screen signal, the method further includes:
if not, closing the signal receiving function, stopping and resetting the period timer;
and returning to the step of determining that the external signal is received if the existence identification of the external signal is captured after the active pen starts the signal receiving function.
Optionally, after the step of turning off the signal receiving function at most for a preset first period of time and then turning on again, the method further includes:
within a preset second time length after the signal receiving function is restarted, if the existence mark is not detected, the signal receiving function is closed, and the period timer is stopped and cleared;
and returning to the step of determining that the external signal is received if the existence identification of the external signal is captured after the active pen starts the signal receiving function.
Optionally, after the step of determining that the external signal is received again and stopping the period timer, the method further includes:
and if the external signal is not the screen signal, returning to execute the step of closing the signal receiving function, stopping and resetting the period timer.
Optionally, if the external signal is analyzed to be the screen signal, the step of obtaining a signal period of the screen signal based on the current count of the period timer, so as to adjust the communication period of the active pen according to the signal period includes:
if the external signal is analyzed to be the screen signal, the current count is used as the single period duration of the signal period to determine the signal period;
the communicated period is adjusted to be consistent with the signal period.
Optionally, if the external signal is analyzed to be the screen signal, the step of determining the signal period by using the current count as a single period duration of the signal period further includes:
and modifying the coding time sequence of the active pen according to the signal period.
Optionally, after the active pen starts the signal receiving function, if the presence identifier of the external signal is captured, determining that the external signal is received, and starting the period timer to start timing includes:
after the active pen starts a signal receiving function, judging whether a signal rising edge can be captured in real time;
if yes, judging that the existence mark is captured, and determining that the external signal is received;
the period timer is started to start timing in an event triggering mode.
In addition, to achieve the above object, the present invention also provides a period adaptive device, including:
the period timing starting module is used for determining that the external signal is received and starting a period timer to start timing if the existence mark of the external signal is captured after the active pen starts the signal receiving function;
the signal receiving and closing module is used for closing the signal receiving function and restarting the signal receiving function after the preset first time length is at most if the external signal is analyzed to be a screen signal sent by the screen terminal equipment;
the periodic timing stopping module is used for determining to receive the external signal again and stopping the periodic timer if the existence mark of the external signal is captured again after the signal receiving function is restarted;
and the communication period adjusting module is used for obtaining the signal period of the screen signal based on the current count of the period timer if the external signal is analyzed to be the screen signal, so as to adjust the communication period of the active pen according to the signal period.
In addition, to achieve the above object, the present invention also provides an active pen including: a memory, a processor, and a cycle adaptation program stored on the memory and executable on the processor, which when executed by the processor, implements the steps of the cycle adaptation method as described above.
In addition, in order to achieve the above object, the present invention also provides a computer-readable storage medium having stored thereon a period-adaptive program which, when executed by a processor, implements the steps of the period-adaptive method as described above.
Furthermore, to achieve the above object, the present invention provides a computer program product comprising a computer program which, when being executed by a processor, implements the steps of the cycle adaptation method as described above.
The invention takes the screen end equipment as a host, starts the periodic timer at the beginning of capturing the external signal, and then turns off the signal receiving function for a period of time when judging that the external signal is the screen signal, and the screen signal is the periodic signal, so that the active pen can ignore irrelevant signals possibly detected in the transmission interval of the screen signal; by stopping the periodic timer when the screen signal is detected again, the periodic timer can record the interval between the occurrence time of the screen signal twice, so that the active pen can obtain the signal period of the screen signal; finally, the communication period of the active pen is adjusted through the signal period, so that the self-adaption of the active pen to the screen signal period is realized, whether the screen end equipment is of the same manufacturer or of the same type or not is realized, the active pen can autonomously identify the screen signal period sent by the screen end equipment in the mode, and the communication period is consistent with the signal period adjustment, so that the active pen can be normally used on each screen end equipment, and the problem that the active pen is difficult to write normally on a screen due to the fact that the screen signal periods of the screen equipment of different manufacturers or types deviate is solved. Meanwhile, in the prior art, some protocols prescribe that the period of the screen is a fixed value, but the fixed values designed by different screen factories are different (the screen factories have own design consideration), if the pen cannot adapt to the period difference of screen signals sent by the screens produced by the different screen factories, the designed pen can only be used on a specific screen matched with the period of the pen, and the invention can adapt to the period difference of the screen signals of equipment produced by the different screen factories independently, thereby breaking the use limit of the active pen.
Drawings
FIG. 1 is a schematic diagram of a device architecture of a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a flow chart of a first embodiment of the cycle adaptation method of the present invention;
FIG. 3 is a flow chart of a second embodiment of the cycle adaptive method according to the present invention;
fig. 4 is a schematic functional block diagram of the cycle adaptive device of the present invention.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
With the rapid development of electronic technology, active pens are also becoming common electronic devices in people's daily lives. The active pen writes on the electronic screen, essentially the process of pen and screen communication interaction. Similar to most communication modes, the wireless communication of the active pen and the screen is distinguished from the master and slave. At present, the communication protocol of the active pen comprises two types of a pen and a screen, and the communication stability and the normal function can be ensured only under the condition that the processing periods of the pen and the screen are synchronous (the error is very small). And the screen signal period of the electronic screen produced by different screens or different screen factories has certain deviation. In some communication protocols, the period error is required to be smaller than 0.4us, and when the error is larger than the error, if the pen end cannot be adaptively adjusted, the active pen can be used on the screen to cause abnormal functions, so that the problem that the active pen is difficult to write normally on the screen due to the deviation of screen signal periods of screen equipment of different factories or types is reflected.
In order to solve the above problems, the present invention provides a cycle adaptive method, in which a screen end device is used as a host, a cycle timer is started at the beginning of capturing an external signal, and then a signal receiving function is turned off for a period of time when the external signal is determined to be a screen signal, and since the screen signal is a cycle signal, an active pen can ignore irrelevant signals possibly detected in a transmission interval of the screen signal; by stopping the periodic timer when the screen signal is detected again, the periodic timer can record the interval between the occurrence time of the screen signal twice, so that the active pen can obtain the signal period of the screen signal; finally, the communication period of the active pen is adjusted through the signal period, so that the self-adaption of the active pen to the screen signal period is realized, whether the screen end equipment is of the same manufacturer or of the same type or not is realized, the active pen can autonomously identify the screen signal period sent by the screen end equipment in the mode, and the communication period is consistent with the signal period adjustment, so that the active pen can be normally used on each screen end equipment, and the problem that the active pen is difficult to write normally on a screen due to the fact that the screen signal periods of the screen equipment of different manufacturers or types deviate is solved. Meanwhile, in the prior art, some protocols prescribe that the period of the screen is a fixed value, but the fixed values designed by different screen factories are different (the screen factories have own design consideration), if the pen cannot adapt to the period difference of screen signals sent by the screens produced by the different screen factories, the designed pen can only be used on a specific screen matched with the period of the pen, and the invention can adapt to the period difference of the screen signals of equipment produced by the different screen factories independently, thereby breaking the use limit of the active pen.
Referring to fig. 1, fig. 1 is a schematic device structure of a hardware running environment according to an embodiment of the present invention.
As shown in fig. 1, the period adaptation means may include: a processor 1001, such as a CPU, a user interface 1003, a network interface 1004, a memory 1005, a communication bus 1002. Wherein the communication bus 1002 is used to enable connected communication between these components. The user interface 1003 may include a Display, an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may further include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also optionally be a storage device separate from the processor 1001 described above.
It will be appreciated by those skilled in the art that the device structure shown in fig. 1 is not limiting of the device and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components.
As shown in fig. 1, an operating system, a network communication module, a user interface module, and a cycle adaptation program may be included in the memory 1005, which is a type of computer storage medium.
In the device shown in fig. 1, the network interface 1004 is mainly used for connecting to a background server, and performing data communication with the background server; the user interface 1003 is mainly used for connecting a client (programmer end) and communicating data with the client; and the processor 1001 may be used to call the period adaptation program stored in the memory 1005 and perform operations in the period adaptation method described below.
Based on the above hardware structure, the embodiment of the cycle self-adaptive method of the invention is provided.
Referring to fig. 2, fig. 2 is a flowchart of a first embodiment of the cycle adaptation method according to the present invention. The period self-adaption method comprises the following steps:
step S10, after the active pen starts a signal receiving function, if the existence identification of an external signal is captured, the external signal is determined to be received, and a period timer is started to start timing;
in this embodiment, the invention is applied to a single chip microcomputer in an active pen. The signal receiving function may be partially or fully on, as the case may be. The partial start refers to that the active pen only starts a signal searching function, the signal searching function is only used for determining whether the existence mark of the external signal appears or not without using a CPU, and when the active pen determines that the external signal exists based on the signal searching function, the signal receiving function (needing to use the CPU) is fully started to completely receive the external signal; all on means that external signal reception is directly started. The presence flag may be a rising edge or a high level, etc., which may be captured in particular by an analog-to-digital converter ADC or comparator in the active pen. The external signal refers to an electric signal sent by the non-active pen, which may be an electric signal sent by the screen end device or a clutter signal sent by other irrelevant devices. The period timer refers to a timer (also called as a timer) started by the singlechip and used for recording the period of the screen signal.
Specifically, the user writes on a certain screen device by using the active pen, and after the active pen is started, part of the signal receiving function is started (namely, only the signal searching function is started), if the rising edge is captured after the signal searching function is started, the external signal is considered to be detected, the period timer is started at the same time when the rising edge is captured, and all the signal receiving functions are started immediately at the same time, so that the external signal is continuously received based on all the signal receiving functions.
Step S20, if the external signal is analyzed to be a screen signal sent by the screen terminal equipment, the signal receiving function is closed at most for a preset first time period, and then the signal receiving function is opened again;
in this embodiment, since the screen signal is a periodic signal and does not appear continuously for a long period of time, the active pen should receive a shut down signal for a period of time after successful start of the timer to ignore extraneous signals in the middle. The closing time depends on the time when the screen signal is possible to reappear at the earliest time, so the preset first time length refers to a time length slightly shorter than the time interval when the screen signal is possible to reappear at the earliest time, and the preset first time length can be specifically preset in the active pen according to practical experience by related personnel.
After receiving a certain amount of external signals, the active pen can analyze whether the external signals are screen signals sent by the screen terminal equipment according to the signal characteristics (frequency, appearance time interval, amplitude and the like) of the external signals. If the driving pen analyzes a certain amount of external signals and then judges that the external signals are screen signals, the signal receiving function is turned off for a preset first time at most, and then the driving pen is turned on again to capture the screen signals which possibly appear again.
In addition, if the start timing is started by mistake, the timing needs to be cleared and the signal receiving function is restarted. False opening refers to opening at other signals or noise than the screen signal, and also belongs to false opening if the screen signal reception is incomplete because a period of time has been lost. Since the active pen knows the signal (correct length of the data), when the active pen receives a signal with a length less than the length of the standard signal, the screen signal received at this time can be judged to be incomplete.
Step S30, after the signal receiving function is restarted, if the existence mark of the external signal is captured again, determining that the external signal is received again, and stopping the period timer;
and step S40, if the external signal is analyzed to be the screen signal, obtaining the signal period of the screen signal based on the current count of the period timer, so as to adjust the communication period of the active pen according to the signal period.
In this embodiment, after the signal receiving function is restarted (still can be partially started or completely started), the active pen continues to detect whether an external signal exists, if a signal rising edge is captured (specifically, a period of time may be set, and a signal rising edge is captured within the period of time), it may be determined that an external signal exists at this time, and then the reappeared external signal is continuously received, so as to determine whether the reappeared external signal is still the screen signal received previously. Simultaneously with this, the active pen stops the periodic timer count at the same time that the rising edge is captured.
In addition, it should be noted that, due to the consistency problem of different screen periods, the screen signal periods of different screen factory designs may also be different, so that the period synchronization (adaptation) with the screen signal should be completed before the active pen enters the paired state from the unpaired state, and the active pen should not transmit the data signal (Tx signal) before the period adaptation is completed, because the transmission signal may be erroneously recognized by the screen under the condition of the period synchronization, so that a malfunction (such as water leakage) occurs.
The periodic self-adaption function should be reset after the active pen loses the screen signal, so that the screen is conveniently re-adapted before next pairing, and the screen signal is possibly immediately paired with another screen with a different period for writing after the screen signal is lost.
If the active pen analyzes that the reappeared external signal is still a screen signal, the signal period of the screen signal can be obtained according to the count of the period timer when the period timer stops, if the signal period is inconsistent with the communication period currently executed by the active pen, the communication period of the active pen is adjusted, so that the period of the active pen is consistent with the period of the screen device, and the active pen can write normally on the screen device.
The embodiment provides a period self-adaptive method, which uses a screen terminal device as a host, starts a period timer at the beginning of capturing an external signal, and then turns off a signal receiving function for a period of time when the external signal is determined to be a screen signal, and the screen signal is a period signal, so that an active pen can ignore irrelevant signals possibly detected in a screen signal sending interval; by stopping the periodic timer when the screen signal is detected again, the periodic timer can record the interval between the occurrence time of the screen signal twice, so that the active pen can obtain the signal period of the screen signal; finally, the communication period of the active pen is adjusted through the signal period, so that the self-adaption of the active pen to the screen signal period is realized, whether the screen end equipment is of the same manufacturer or of the same type or not is realized, the active pen can autonomously identify the screen signal period sent by the screen end equipment in the mode, and the communication period is consistent with the signal period adjustment, so that the active pen can be normally used on each screen end equipment, and the problem that the active pen is difficult to write normally on a screen due to the fact that the screen signal periods of the screen equipment of different manufacturers or types deviate is solved.
Meanwhile, in the prior art, some protocols prescribe that the period of the screen is a fixed value, but the fixed values designed by different screen factories are different (the screen factories have own design consideration), if the pen cannot adapt to the period difference of screen signals sent by the screens produced by the different screen factories, the designed pen can only be used on a specific screen matched with the period of the pen, and the invention can adapt to the period difference of the screen signals of equipment produced by the different screen factories independently, thereby breaking the use limit of the active pen and improving the universality of the active pen.
Further, based on the first embodiment shown in fig. 2 described above, a second embodiment of the cycle adaptation method of the present invention is proposed. In this embodiment, before step S20, the method further includes:
a1, judging whether the external signal is the screen signal or not;
after step A1, the method further comprises:
a2, if not, closing the signal receiving function, stopping and resetting the period timer;
and step A3, returning to the step of determining that the external signal is received if the existence identification of the external signal is captured after the active pen starts the signal receiving function.
In this embodiment, the active pen distinguishes whether the external signal is a screen signal from a screen-side device or other extraneous clutter signals by analyzing the signal characteristics of the external signal currently received. Because the signal characteristics of different signals are different, the active pen can compare the signal characteristics of the analyzed external signal with the pre-stored screen signal characteristics, if the external signal is not matched, the external signal is other irrelevant signals, the screen signal detected last time is not continuously appeared, the need of continuous reception is avoided, the signal receiving function is immediately closed, the period timer is stopped and cleared, and then the initial execution step is returned.
Further, after step S20, the method further includes:
step B1, in a preset second time length after the signal receiving function is restarted, if the existence mark is not detected, closing the signal receiving function, and stopping and resetting the period timer;
and step B2, returning to the step of determining that the external signal is received if the existence identification of the external signal is captured after the active pen starts the signal receiving function.
In this embodiment, the preset second duration refers to a duration slightly longer than a time interval in which the screen signal may reappear at the latest, and may specifically be preset in the active pen by a relevant person according to actual experience.
Specifically, the presence of a signal-rising edge is taken as an example. After the signal receiving function is restarted, the active pen signal continues to monitor the rising edge of the signal, if the rising edge of the signal cannot be detected within the preset second time period after the signal receiving function is restarted, the screen signal detected before the signal receiving function is indicated to be possibly disappeared (for example, the active pen is separated from the screen signal range), and the signal receiving function is immediately closed, the periodic timer is stopped and cleared without continuing to receive the signal and timing at the moment, and the initial execution step is returned.
Further, after step S30, the method further includes:
and step C1, if the external signal is not the screen signal, returning to execute the step of closing the signal receiving function, stopping and resetting the period timer.
In this embodiment, if the active pen detects the external signal within the preset second period, but the external signal is not the screen signal, the period of the signal still cannot be measured smoothly, and at this time, the signal receiving function is immediately turned off, the period timer is stopped and cleared, and the initial execution step is returned.
As a specific example, fig. 3 shows. After the active pen starts the signal receiving function, judging whether a signal rising edge is captured or not, and if not, continuously detecting the signal rising edge; if yes, starting a high-speed timer t0 (namely the periodic timer) in an event triggering mode, analyzing the currently received external signal to judge whether the external signal is a screen signal or not, if not, closing a signal receiving function, stopping and resetting the timer t0, and returning to the initial step; if the signal is the screen signal, the signal receiving function is immediately turned off, meanwhile, the waiting timer t1 is turned on until the count of t1 is greater than or equal to the earliest occurrence time interval of the screen signal (i.e. the preset first time), the continuous capturing timer t2 is turned on, the signal receiving function is turned on again, and the timer t1 is turned off and cleared. Continuing to detect the rising edge of the signal in real time, judging whether the rising edge of the signal is captured before the continuous combination time after restarting exceeds t2 (namely the preset second time), if not, closing the signal receiving function, stopping and resetting the timers t0 and t2; if the external signal is captured, stopping the high-speed timer t0 in an event triggering mode, continuously receiving the external signal to analyze the external signal, judging whether the external signal is still a screen signal, and if the external signal is not the screen signal, returning to close the receiving, stopping and resetting the timers t0 and t2; if the external signal is a screen signal, the signal receiving function is closed, a timer t0 is cleared, a signal period is obtained according to the count of t0, and the communication period of the active pen is adjusted based on the signal period, so that the period self-adaption of the active pen to the screen signal is realized.
Further, based on the above-described first embodiment, a third embodiment of the cycle adaptation method of the present invention is proposed. In the present embodiment, step S40 includes:
step S41, if the external signal is analyzed to be the screen signal, the current count is used as the single period duration of the signal period to determine the signal period;
step S42, the communication period is adjusted to be consistent with the signal period.
In this embodiment, to accurately measure the period and the occurrence position of the signal, the first rising edge of the signal needs to be found, but it cannot be determined whether the signal is a screen signal or not only by one rising edge, so the signal analysis step is performed after the start of the timing. The signal analysis needs to be carried out twice, and after the signal starts timing and the signal stops timing, the process ensures that the starting and stopping of timing are operated at the first rising edge of the correct screen signal, and the interval time between the first rising edges of the screen signals appearing twice is the period time of the screen signal. After the period measurement of the screen signal is completed, the active pen should adjust its own communication period so as to be consistent with the screen period.
Further, after step S41, the method further includes:
and step S43, modifying the coding time sequence of the active pen according to the signal period.
In this embodiment, the coding timing sequence specifies when the active pen transmits a signal to the screen end and when not transmits a signal, and the timing sequence is specified by the protocol, so that the period change will necessarily affect the timing sequence change, and what kind of effect is specified by the protocol, and the specific timing sequence modification mode can be controlled and modified by the Timer of the singlechip in the active pen.
Further, step S10 includes:
step S11, after the active pen starts a signal receiving function, judging whether a signal rising edge can be captured in real time;
step S12, if yes, judging that the existence mark is captured, and determining that the external signal is received;
and S13, starting the periodic timer in an event triggering mode to start timing.
In this embodiment, the active pen and the screen are in wireless communication, data is usually transmitted through "coding", and the "coding" signal (i.e. the screen signal) that is printed out by the screen is amplified and filtered by the hardware circuit of the active pen and then is connected to the single chip ADC or the comparator to input the Pin interface. The single chip microcomputer captures the rising edge of the signal in the form of ADC or comparator, the timer is started to count immediately after the rising edge of the signal is captured, the single chip microcomputer response time is required to be minimized in the form of event triggering, CPU intervention is not required, and the peripheral is directly triggered.
In addition, the singlechip of the active pen can be also provided with an analog-digital converter ADC and a comparator for filtering the received signals, and the lag time is counteracted as the two times of receiving (starting timing and stopping timing) have the same lag time delay although the lag response to the received signals is caused.
As shown in fig. 4, the present invention further provides a period adaptive device, including:
the period timing starting module 10 is configured to determine that an external signal is received and start a period timer to start timing if a presence identifier of the external signal is captured after the active pen starts a signal receiving function;
the signal receiving and closing module 20 is configured to close the signal receiving function to at most a preset first time period and then re-open the signal receiving function if the external signal is analyzed to be a screen signal sent by a screen terminal device;
a cycle timing stopping module 30, configured to determine to receive the external signal again and stop the cycle timer if the presence flag of the external signal is captured again after the signal receiving function is turned on again;
and the communication period adjustment module 40 is configured to obtain a signal period of the screen signal based on the current count of the period timer if the external signal is analyzed to be the screen signal, so as to adjust the communication period of the active pen according to the signal period.
Optionally, the period adaptive device further includes:
the external signal judging module is used for judging whether the external signal is the screen signal or not;
the first function closing module is used for closing the signal receiving function if not, stopping and resetting the period timer;
and the first return execution module is used for returning to execute the step of determining that the external signal is received if the existence identification of the external signal is captured after the active pen starts the signal receiving function.
Optionally, the period adaptive device further includes:
the second function closing module is used for closing the signal receiving function and stopping and resetting the period timer if the existence mark is not detected within the preset second duration after the signal receiving function is restarted;
and the second return execution module is used for returning to execute the step of determining that the external signal is received if the existence identification of the external signal is captured after the active pen starts the signal receiving function.
Optionally, the period adaptive device further includes:
and the third return execution module is used for returning to execute the step of closing the signal receiving function, stopping and resetting the period timer if the external signal is analyzed to be not the screen signal.
Optionally, the communication period adjustment module 40 includes:
a signal period determining unit, configured to, if the external signal is analyzed to be the screen signal, take the current count as a single period duration of the signal period, so as to determine the signal period;
and the communication period adjusting unit is used for adjusting the communication period to be consistent with the signal period.
Optionally, the communication period adjustment module 40 further includes:
and the coding time sequence modifying unit is used for modifying the coding time sequence of the active pen according to the signal period.
Optionally, the cycle timing start module 10 includes:
the rising edge capturing unit is used for judging whether the rising edge of the signal can be captured in real time after the signal receiving function is started by the active pen;
a signal confirmation receiving unit, configured to determine that the presence flag is captured and determine that the external signal is received if the presence flag is captured;
and the period timing starting unit is used for starting the period timer to start timing in an event triggering mode.
The invention also provides an active pen.
The active pen comprises a processor, a memory and a period adaptation program stored on the memory and executable on the processor, wherein the period adaptation program, when executed by the processor, implements the steps of the period adaptation method as described above.
The method implemented when the period adaptive program is executed may refer to various embodiments of the period adaptive method of the present invention, which are not described herein.
The invention also provides a computer readable storage medium.
The computer readable storage medium of the present invention has stored thereon a period adaptation program which, when executed by a processor, implements the steps of the period adaptation method as described above.
The method implemented when the period adaptive program is executed may refer to various embodiments of the period adaptive method of the present invention, which are not described herein.
The invention also provides a computer program product comprising a computer program which, when executed by a processor, implements the steps of a cycle adaptation method as described above.
The method implemented when the computer program is executed may refer to various embodiments of the periodic adaptive method of the present invention, which are not described herein.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) as described above, comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server or a network device, etc.) to perform the method according to the embodiments of the present invention.
The foregoing description is only of the preferred embodiments of the present invention, and is not intended to limit the scope of the invention, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein or in the alternative, which may be employed directly or indirectly in other related arts.
Claims (10)
1. A periodic adaptation method, the periodic adaptation method comprising:
after the active pen starts the signal receiving function, if the existence identification of the external signal is captured, the external signal is determined to be received, and a period timer is started to start timing;
if the external signal is analyzed to be a screen signal sent by the screen terminal equipment, the signal receiving function is closed and then is opened again after the preset first time is at most;
wherein the first time period comprises a time period shorter than a time interval during which the screen signal is earliest possible to reappear;
after the signal receiving function is restarted, if the existence identification of the external signal is captured again, determining that the external signal is received again, and stopping the period timer;
and if the external signal is analyzed to be the screen signal, obtaining the signal period of the screen signal based on the current count of the period timer, so as to adjust the communication period of the active pen according to the signal period.
2. The cycle adaptive method as defined in claim 1, wherein, if the external signal is analyzed to be a screen signal sent by a screen device, before the step of turning off the signal receiving function at most for a preset first time period and then turning on again, the method further comprises:
judging whether the external signal is the screen signal or not;
after the step of determining whether the external signal is the screen signal, the method further includes:
if not, closing the signal receiving function, stopping and resetting the period timer;
and returning to the step of determining that the external signal is received if the existence identification of the external signal is captured after the active pen starts the signal receiving function.
3. The cycle adaptive method of claim 1, wherein after the step of turning off the signal receiving function at most for a preset first time period and then turning on again, further comprising:
within a preset second time length after the signal receiving function is restarted, if the existence mark is not detected, the signal receiving function is closed, and the period timer is stopped and cleared;
and returning to the step of determining that the external signal is received if the existence identification of the external signal is captured after the active pen starts the signal receiving function.
4. The cycle adaptation method of claim 3, wherein after the step of determining that the external signal is received again and stopping the cycle timer, further comprising:
and if the external signal is not the screen signal, returning to execute the step of closing the signal receiving function, stopping and resetting the period timer.
5. The cycle adaptive method of claim 1, wherein the step of obtaining a signal cycle of the screen signal based on a current count of the cycle timer to adjust the communication cycle of the active pen according to the signal cycle if the external signal is analyzed as the screen signal comprises:
if the external signal is analyzed to be the screen signal, the current count is used as the single period duration of the signal period to determine the signal period;
the communicated period is adjusted to be consistent with the signal period.
6. The cycle adaptive method of claim 5, wherein the step of determining the signal cycle by taking the current count as a single cycle duration of the signal cycle if the external signal is analyzed as the screen signal, further comprises:
and modifying the coding time sequence of the active pen according to the signal period.
7. The cycle adaptive method as claimed in any one of claims 1-6, wherein the step of determining that the external signal is received and starting the cycle timer to start timing if the presence flag of the external signal is captured after the active pen turns on the signal receiving function comprises:
after the active pen starts a signal receiving function, judging whether a signal rising edge can be captured in real time;
if yes, judging that the existence mark is captured, and determining that the external signal is received;
the period timer is started to start timing in an event triggering mode.
8. A cycle adaptation device, the cycle adaptation device comprising:
the period timing starting module is used for determining that the external signal is received and starting a period timer to start timing if the existence mark of the external signal is captured after the active pen starts the signal receiving function;
the signal receiving and closing module is used for closing the signal receiving function and restarting the signal receiving function after the preset first time length is at most if the external signal is analyzed to be a screen signal sent by the screen terminal equipment;
wherein the first time period comprises a time period shorter than a time interval during which the screen signal is earliest possible to reappear;
the periodic timing stopping module is used for determining to receive the external signal again and stopping the periodic timer if the existence mark of the external signal is captured again after the signal receiving function is restarted;
and the communication period adjusting module is used for obtaining the signal period of the screen signal based on the current count of the period timer if the external signal is analyzed to be the screen signal, so as to adjust the communication period of the active pen according to the signal period.
9. An active pen, the active pen comprising: memory, a processor and a cycle adaptation program stored on the memory and executable on the processor, which when executed by the processor implements the steps of the cycle adaptation method according to any one of claims 1 to 7.
10. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon a cycle adaptation program, which when executed by a processor, implements the steps of the cycle adaptation method according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111514213.2A CN114356124B (en) | 2021-12-06 | 2021-12-06 | Cycle self-adaption method, device, active pen and computer readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111514213.2A CN114356124B (en) | 2021-12-06 | 2021-12-06 | Cycle self-adaption method, device, active pen and computer readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114356124A CN114356124A (en) | 2022-04-15 |
CN114356124B true CN114356124B (en) | 2023-09-29 |
Family
ID=81099003
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111514213.2A Active CN114356124B (en) | 2021-12-06 | 2021-12-06 | Cycle self-adaption method, device, active pen and computer readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114356124B (en) |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1251439A (en) * | 1998-10-19 | 2000-04-26 | 富士通株式会社 | Input processing method and input controlling apparatus |
CN108227980A (en) * | 2016-12-13 | 2018-06-29 | 乐金显示有限公司 | Electronic device with touch sensor and driving method thereof |
CN109901734A (en) * | 2019-01-31 | 2019-06-18 | 京东方科技集团股份有限公司 | A kind of active capacitance pen, display panel, touch-control system and method for transmitting signals |
CN111381734A (en) * | 2018-12-28 | 2020-07-07 | 乐金显示有限公司 | Touch display device and touch sensing circuit |
CN111638814A (en) * | 2020-06-02 | 2020-09-08 | 深圳市汇顶科技股份有限公司 | Synchronization method, wireless communication chip, touch control chip and coding chip |
WO2021179167A1 (en) * | 2020-03-10 | 2021-09-16 | 深圳市汇顶科技股份有限公司 | Wireless communication method, active pen, touch screen, electronic device, and communication system |
WO2021184221A1 (en) * | 2020-03-17 | 2021-09-23 | 深圳市汇顶科技股份有限公司 | Coding control and coding method, coding system, chip, electronic device, and storage medium |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9483129B1 (en) * | 2015-05-12 | 2016-11-01 | Atmel Corporation | Active stylus with fractional clock-cycle timing |
WO2019118532A1 (en) * | 2017-12-12 | 2019-06-20 | Bigfoot Biomedical, Inc. | Medicine injection and disease management systems, devices, and methods |
-
2021
- 2021-12-06 CN CN202111514213.2A patent/CN114356124B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1251439A (en) * | 1998-10-19 | 2000-04-26 | 富士通株式会社 | Input processing method and input controlling apparatus |
CN108227980A (en) * | 2016-12-13 | 2018-06-29 | 乐金显示有限公司 | Electronic device with touch sensor and driving method thereof |
CN111381734A (en) * | 2018-12-28 | 2020-07-07 | 乐金显示有限公司 | Touch display device and touch sensing circuit |
CN109901734A (en) * | 2019-01-31 | 2019-06-18 | 京东方科技集团股份有限公司 | A kind of active capacitance pen, display panel, touch-control system and method for transmitting signals |
WO2021179167A1 (en) * | 2020-03-10 | 2021-09-16 | 深圳市汇顶科技股份有限公司 | Wireless communication method, active pen, touch screen, electronic device, and communication system |
WO2021184221A1 (en) * | 2020-03-17 | 2021-09-23 | 深圳市汇顶科技股份有限公司 | Coding control and coding method, coding system, chip, electronic device, and storage medium |
CN111638814A (en) * | 2020-06-02 | 2020-09-08 | 深圳市汇顶科技股份有限公司 | Synchronization method, wireless communication chip, touch control chip and coding chip |
Also Published As
Publication number | Publication date |
---|---|
CN114356124A (en) | 2022-04-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20050071511A1 (en) | Self-activating network connection system and method | |
CN110363888B (en) | Door lock management method and device, electronic equipment and readable storage medium | |
WO2022148477A1 (en) | Wifi-based human body detection method, and smart device | |
US8959394B2 (en) | Electronic device, system, and method for testing exception handling mechanism | |
US10496128B2 (en) | Method for obtaining timestamp and computer device using the same | |
CN102236406A (en) | Communication device | |
CN112154614A (en) | Sensing system, sensing apparatus, control method thereof, movable platform, and storage medium | |
CN114356124B (en) | Cycle self-adaption method, device, active pen and computer readable storage medium | |
JP2005529319A (en) | Circuit for detecting the ground offset of network components | |
CN111371777A (en) | Attack detection method, device, detector and storage medium for vehicle network | |
CN112787886B (en) | Processing method, device driver, readable storage medium and computer for real-time system network device auto-negotiation | |
CN107168902B (en) | Method for realizing automatic identification of high-speed CAN baud rate by using DMA | |
CN111402454A (en) | Method and device for associating intelligent lock with environmental parameters | |
US20170221329A1 (en) | Control apparatus, control method, and storage medium | |
CN109639396B (en) | Data transmission method and device and computer readable storage medium | |
CN114816844A (en) | Factory setting restoration method and device | |
CN115884144B (en) | Near field communication method and device, NFC chip and NFC device | |
US20200028957A1 (en) | Control method and device for sensors of mobile terminal, storage medium and mobile terminal | |
CN110932930A (en) | Detection method, device and medium for server PCIE link stability | |
CN108735241B (en) | Local time detection method and system for Flash player | |
JP3682497B2 (en) | Image forming apparatus | |
CN115640182A (en) | Test method, chip, electronic device, and storage medium | |
CN114866446A (en) | Data transmission rate testing method, system, electronic device and storage medium | |
US20080037564A1 (en) | Network device and method for starting v5 connection thereof | |
CN118057344A (en) | MIPI device control method and MIPI device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |