CN114327102A - Protocol switching method, device, equipment and computer readable storage medium - Google Patents

Protocol switching method, device, equipment and computer readable storage medium Download PDF

Info

Publication number
CN114327102A
CN114327102A CN202111488241.1A CN202111488241A CN114327102A CN 114327102 A CN114327102 A CN 114327102A CN 202111488241 A CN202111488241 A CN 202111488241A CN 114327102 A CN114327102 A CN 114327102A
Authority
CN
China
Prior art keywords
signal
protocol
active pen
switching
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.)
Granted
Application number
CN202111488241.1A
Other languages
Chinese (zh)
Other versions
CN114327102B (en
Inventor
陈鹏宇
李林
詹梓煜
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Maxeye Smart Technologies Co ltd
Original Assignee
Maxeye Smart Technologies Co ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Maxeye Smart Technologies Co ltd filed Critical Maxeye Smart Technologies Co ltd
Priority to CN202111488241.1A priority Critical patent/CN114327102B/en
Publication of CN114327102A publication Critical patent/CN114327102A/en
Application granted granted Critical
Publication of CN114327102B publication Critical patent/CN114327102B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • User Interface Of Digital Computer (AREA)
  • Communication Control (AREA)

Abstract

The invention discloses a protocol switching method, a device, equipment and a computer readable storage medium, wherein signal searching is started through a gap (namely a silent stage) of a signal transmitted by an active pen based on a current protocol, so that the current signal transmission of the active pen is not interfered, and the stability of signal searching operation is ensured; after the external signal needing to be received is determined to exist in the silent stage, the external signal is received and recognized, the target protocol needing to be switched is determined, and protocol switching is carried out at a proper switching time (namely, the time meeting the preset protocol switching condition).

Description

Protocol switching method, device, equipment and computer readable storage medium
Technical Field
The present invention relates to the field of embedded technologies, and in particular, to a protocol switching method, apparatus, device, and computer-readable storage medium.
Background
With the rapid development of electronic technology, the active pen also becomes a common electronic device in daily life. The active pen writes on the electronic screen, which is essentially the process of pen-screen communication interaction, since there is communication, there must be a communication protocol. The target communication protocol is established based on the screen end leader, and the active pen and the screen carry out wireless communication interaction according to a certain communication protocol. However, at present, no standard protocol uniformly followed by each screen manufacturer exists, and each large screen manufacturer formulates a protocol of its own, so that users on the market can only buy the active pen matched with the screen of their own when buying the active pen.
Buying different pens for different screens is really a huge waste, and if the active pen can be used on all multimedia devices like a bluetooth headset, it is obvious that great convenience is brought to the use of consumers. But it is obviously difficult to promote the large screen factories to jointly make and register the same initiative pen protocol. Although it is difficult to have the same protocol, devices can be made compatible with multiple protocols. Theoretically, as long as the Flash memory space is enough, it is not difficult to make multiple sets of active pen protocols compatible with the same pen, but in the actual switching process, if the different protocols cannot be switched rapidly and stably, the original stable working state of the active pen may be affected, so that the active pen cannot write normally.
Disclosure of Invention
The invention mainly aims to provide a protocol switching method, a protocol switching device, protocol switching equipment and a computer readable storage medium, and aims to solve the technical problem of how to improve the timeliness and stability of different screen-end protocol switching of an active pen.
In order to achieve the above object, the present invention provides a protocol switching method, including:
after an active pen enters a working state according to a current protocol, starting a signal searching function of the active pen in a silent stage of the working state, wherein the silent stage is a stage in which the active pen does not send signals in the working state;
confirming the existence of an external signal in the silent stage based on the signal searching function, and starting a signal receiving function of the active pen;
receiving and identifying the external signal based on the signal receiving function to determine a target protocol in a plurality of sets of protocols compatible with the active pen;
and when detecting that the current protocol meets the preset protocol switching condition, switching the current protocol into the target protocol.
Optionally, the step of receiving and identifying the external signal based on the signal receiving function to determine a target protocol in a plurality of sets of protocols compatible with the active pen includes:
starting to receive an external signal based on the signal receiving function and identifying the signal type of the external signal;
when the signal type is identified to be a square wave type or a DSSS signal type, judging whether the signal type is the same as the original signal type of the current protocol or not;
if not, determining a first receiving logic and the target protocol according to the signal type;
the external signal continues to be received in accordance with the first receive logic until the external signal is completely received.
Optionally, after the step of determining whether the signal type is the same as the original signal type of the current protocol, the method further includes:
if yes, analyzing specific field characteristics of the external signal, and determining second receiving logic and the target protocol according to the specific field characteristics;
continuing to receive the external signal in accordance with the second receive logic until the external signal is fully received.
Optionally, after the step of identifying the signal type of the external signal, the method further includes:
when the signal type is identified to be a noise type, the signal receiving function is closed;
and returning to execute the step of starting the signal searching function of the active pen in the silent stage of the working state.
Optionally, the protocol switching condition includes at least one of:
switching within the quiet phase;
switching when no pen point pressure exists;
not switching in proximity to a next action specified by the current protocol;
switching at the end of a current period of the active pen transmit signal, wherein a period division of the current period is specified by the current protocol.
Optionally, the step of confirming the existence of the external signal in the silent phase based on the signal finding function comprises:
determining whether a rising edge or a high level from the outside is detected in the silent period based on the signal finding function;
and if so, judging that the external signal exists.
Optionally, the step of turning on the signal finding function of the active pen in the silent phase of the working state includes:
and determining function starting time in the silent stage according to a preset function starting rule, and starting the signal searching function according to the function starting time, wherein the function starting rule is based on the setting of stable operation of the active pen.
In addition, to achieve the above object, the present invention provides a protocol switching apparatus, including:
the signal searching and starting module is used for starting the signal searching function of the active pen in a silent stage of a working state after the active pen enters the working state according to a current protocol, wherein the silent stage is a stage that the active pen does not send signals in the working state;
the signal receiving and starting module is used for confirming that an external signal exists in the silent stage based on the signal searching function and starting the signal receiving function of the active pen;
the external signal identification module is used for receiving and identifying the external signal based on the signal receiving function so as to determine a target protocol in a plurality of sets of protocols compatible with the active pen;
and the target protocol switching unit is used for switching the current protocol into the target protocol when detecting that the current protocol meets the preset protocol switching condition.
In addition, to achieve the above object, the present invention further provides a protocol switching apparatus, including: a memory, a processor and a protocol switching program stored on the memory and executable on the processor, the protocol switching program when executed by the processor implementing the steps of the protocol switching method as described above.
Further, to achieve the above object, the present invention also provides a computer readable storage medium having a protocol switching program stored thereon, which when executed by a processor implements the steps of the protocol switching method as described above.
Furthermore, to achieve the above object, the present invention also provides a computer program product comprising a computer program which, when being executed by a processor, realizes the steps of the protocol switching method as described above.
The invention starts signal searching through the gap (namely the silent stage) of the signal transmitted by the active pen based on the current protocol, so that the current signal transmission of the active pen is not interfered, and the stability of the signal searching operation is ensured; after the external signal needing to be received is determined to exist in the silent stage, the external signal is received and recognized, the target protocol needing to be switched is determined, and protocol switching is carried out at a proper switching time (namely, the time meeting the preset protocol switching condition).
Drawings
FIG. 1 is a schematic diagram of an apparatus architecture of a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a protocol switching method according to a first embodiment of the present invention;
fig. 3 is a functional block diagram of the protocol switching apparatus according to the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
With the rapid development of electronic technology, the active pen also becomes a common electronic device in daily life. The active pen writes on the electronic screen, which is essentially the process of pen-screen communication interaction, since there is communication, there must be a communication protocol. The target communication protocol is established based on the screen end leader, and the active pen and the screen carry out wireless communication interaction according to a certain communication protocol. However, at present, no standard protocol uniformly followed by each screen manufacturer exists, and each large screen manufacturer formulates a protocol of its own, so that users on the market can only buy the active pen matched with the screen of their own when buying the active pen.
Buying different pens for different screens is really a huge waste, and if the active pen can be used on all multimedia devices like a bluetooth headset, it is obvious that great convenience is brought to the use of consumers. But it is obviously difficult to promote the large screen factories to jointly make and register the same initiative pen protocol. Although it is difficult to have the same protocol, devices can be made compatible with multiple protocols. Theoretically, as long as the Flash space is enough, it is not difficult to make multiple sets of active pen protocols compatible with the same pen, but in the actual switching process, if the different protocols cannot be switched rapidly and stably, the original stable working state of the active pen may be affected, so that the active pen cannot write normally.
In order to solve the above problems, the present invention provides a protocol switching method, that is, signal searching is started in the gap (i.e. silent stage) where the active pen sends signals based on the current protocol, so that the current signal sending of the active pen is not interfered, and the stability of signal searching operation is ensured; after the external signal needing to be received is determined to exist in the silent stage, the external signal is received and recognized, the target protocol needing to be switched is determined, and protocol switching is carried out at a proper switching time (namely, the time meeting the preset protocol switching condition).
As shown in fig. 1, fig. 1 is a schematic device structure diagram of a hardware operating environment according to an embodiment of the present invention.
As shown in fig. 1, the protocol switching device 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 a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also 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 non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the configuration of the apparatus shown in fig. 1 is not intended to be limiting of the apparatus and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a kind of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a protocol switching program.
In the device shown in fig. 1, the network interface 1004 is mainly used for connecting to a backend server and performing data communication with the backend server; the user interface 1003 is mainly used for connecting a client (programmer's end) and performing data communication with the client; and the processor 1001 may be configured to call a protocol switching program stored in the memory 1005 and perform operations in the protocol switching method described below.
Based on the hardware structure, the embodiment of the protocol switching method is provided.
Referring to fig. 2, fig. 2 is a flowchart illustrating a protocol switching method according to a first embodiment of the present invention. The protocol switching method comprises the following steps:
step S10, after the active pen enters the working state according to the current protocol, the signal searching function of the active pen is started in the silent stage of the working state, wherein the silent stage is the stage that the active pen does not send signals in the working state;
in this embodiment, the present invention is applied to an active pen, which is an active capacitive pen. The capacitive pen is a pen which is made of a conductor material, has a conductive characteristic and is used for touch control of a capacitive screen to complete man-machine conversation operation, and is an auxiliary device for completing man-machine conversation by simulating a human body (usually fingers) through the conductor material. The current protocol refers to the protocol that the active pen was running before the protocol was switched. The working state refers to that the active pen communicates with the screen end according to the current protocol.
It should be noted that, in order to generally save power consumption and facilitate the screen identification process, the electrical signal sent by the active pen to the screen end under the protocol is periodic, that is, the signal is sent within a period of time, and the signal is not sent within a period of time. At present, the mainstream pen screen communication adopts a half-duplex mode similar to the singlechip bus communication, namely data flows bidirectionally but only one way at the same time, so that theoretically, when the active pen does not send signals, the original 'silent' time can be used for receiving and processing the signals, and the time period of not sending the signals becomes a silent stage. The signal transmission period is defined by the protocol, and the period division of different protocols is generally different. A period typically consists of multiple signaling phases alternating with multiple quiet phases. The signal searching function refers to a function of confirming whether an external signal exists, and signal information does not need to be identified and analyzed, so that a CPU is not needed, and power consumption is low.
Specifically, after the active pen compatible with multiple protocols is paired with the screen end equipment produced by the manufacturer A, the protocol A is used for performing pen screen communication with the screen end equipment. The active pen periodically sends signals to the screen-side equipment according to the regulation of the protocol A, and selects a proper time to start a signal searching function in a silent stage.
Step S20, confirming the existence of external signals in the silent stage based on the signal searching function, and starting the signal receiving function of the active pen;
in this embodiment, the external signal refers to an electrical signal received by the active pen from the outside, which may be a signal related to communication or may be only a noise signal causing interference. The signal receiving function consumes more power than the signal searching function, and needs to use the data processing capability of the CPU to determine the signal type.
Specifically, the active pen still communicates with the screen-side device according to the protocol a, and simultaneously monitors an external signal based on the function without interfering with the original working state after the signal searching function is started in the silent stage. At this time, if the screen end device produced by the manufacturer B is replaced, that is, the active pen is applied to the screen end device produced by another manufacturer, the active pen may find a signal transmitted by another screen end device based on the signal finding function, or the active pen may receive other interference signals due to being close to other devices, and these signals may be collectively referred to as external signals. After the active pen confirms that the external signal exists, the signal receiving function can be started so as to receive the external signal.
Step S30, receiving and identifying the external signal based on the signal receiving function to determine a target protocol in a plurality of sets of protocols compatible with the active pen;
in this embodiment, the target protocol refers to a protocol that needs to be switched currently in a communication protocol in which the active pen is compatible with screen-side devices of multiple different manufacturers.
Specifically, the active pen receives the external signal based on a signal receiving function after detecting the external signal, rapidly identifies the signal type of the external signal while receiving the external signal, and optionally further identifies other characteristics of the external signal, so as to determine a target protocol in a plurality of sets of protocols compatible with the active pen based on the signal type or other characteristics.
It should be noted that if the active pen recognizes that the detected external signal is a screen end signal sent by the screen end device, the screen end signal needs to be completely received; however, if the detected external signal is not the screen-side signal transmitted by the screen-side device but another clutter signal (i.e., a noise signal), the clutter signal is not continuously received, and the previously received clutter signal is discarded.
Step S40, when detecting that a preset protocol switching condition is currently satisfied, switching the current protocol to the target protocol.
In this embodiment, the protocol switching condition refers to several conditions that specify the timing for the active pen to perform the protocol switching operation, and these conditions are set based on the principle that the original working state of the active pen is not interfered as much as possible.
Specifically, after determining the target protocol that needs to be switched currently, the active pen needs to find a suitable switching time, rather than switching immediately after determining the target protocol. This is because if the switching is performed at will after the target protocol is determined, and a certain time is required to perform the switching operation, it is easy to affect the original signal sending task of the active pen, so that the active pen cannot send a signal normally, and a result of communication with the screen-side device is lost, thereby affecting the writing experience of the user. Therefore, after the active pen determines the target protocol to be switched, it needs to follow the protocol switching condition, find a switching time that can minimize the adverse effect caused by switching, and perform protocol switching on the time to ensure the stability of protocol switching.
The present embodiment provides a protocol switching method, which starts signal finding through a gap (i.e., a silent period) in which an active pen sends a signal based on a current protocol, so that interference on current signal sending of the active pen is avoided, and stability of signal finding operation is ensured; after the external signal needing to be received is determined to exist in the silent stage, the external signal is received and recognized, the target protocol needing to be switched is determined, and protocol switching is carried out at a proper switching time (namely, the time meeting the preset protocol switching condition).
Further, based on the first embodiment shown in fig. 2, a second embodiment of the protocol switching method of the present invention is proposed. In the present embodiment, step S30 includes:
a step S31 of starting to receive an external signal based on the signal receiving function and identifying a signal type of the external signal;
step S32, when the signal type is identified to be a square wave type or a DSSS signal type, judging whether the signal type is the same as the original signal type of the current protocol;
step S33, if not, determining a first receiving logic and the target protocol according to the signal type;
step S34, the external signal is continuously received according to the first receiving logic until the external signal is completely received.
In this embodiment, since there are two types of signals transmitted from the screen at present, one is a square wave signal with a fixed frequency for a period of time, and the other is a Direct Sequence Spread Spectrum (DSSS) signal with a constantly changing frequency, the two signals have different signal characteristics, and thus the receiving logic is different. The original signal type refers to the type of signal used for communication between pen screens as specified by the current protocol. The first receiving logic refers to receiving logic matched with the identified signal when the identified signal type is different from the original signal type.
Specifically, the active pen receives the external signal and rapidly identifies the signal, and since different types of signal features (such as frequencies) are different, and the active pen records signal features of various common signals, the signal type of the external signal can be found correspondingly after the signal features of the external signal are analyzed. The active pen further compares the signal type with the signal type of a signal sent by the active pen when the active pen communicates with the screen-end equipment according to the specification of the current protocol, and judges whether the signal type is consistent with the signal type of the signal sent by the active pen when the active pen communicates with the screen-end equipment. If the active pen determines that the two types of signals are not consistent, a receiving logic for receiving the square wave signal or a receiving logic for receiving the DSSS signal is determined according to the square wave type or the DSSS signal type to which the external signal belongs, so as to serve as the first receiving logic (the receiving logic corresponding to the different types of signals can also be prestored in the active pen). Meanwhile, the active pen can select a corresponding target protocol according to the signal characteristics (the corresponding relation between different signal types and protocols can also be prestored in the active pen). The active pen continues to receive the external signal according to the first receiving logic until the external signal is completely received.
Further, after step S32, the method further includes:
step A1, if yes, analyzing specific field characteristics of the external signal, and determining a second receiving logic and the target protocol according to the specific field characteristics;
step a2, continuing to receive the external signal according to the second receiving logic until the external signal is completely received.
In this embodiment, the second receiving logic refers to receiving logic matched with the identified signal when the identified signal type is the same as the original signal type. Because the signals belonging to the same type are different, if the types of the signals specified by different protocols are the same, but other characteristics of the signals are different, different receiving logics can be adopted for receiving, so that the external signals can be accurately and completely received.
Specifically, when the active pen determines that the signal type of the external signal is the same as the original signal type, it needs to further analyze the difference between the two types of information, such as the difference between the data header fields. After analyzing the difference between the two signals, the active pen may select the receiving logic corresponding to the specific field of the external signal as the second receiving logic (the corresponding relationship between different receiving logics and characteristics of the same signal type may be pre-stored in the active pen). The active pen continues to receive the external signal according to the second receiving logic until the external signal is completely received.
In addition, after the signal receiving function is turned on, and which logic is to be received is determined, then, only the signal needs to be completely received and data analysis is performed. The logic of data analysis depends on the regulations in a plurality of protocols compatible with the active pen (the analysis logic needs to be written according to the data distribution characteristics of each protocol in advance). After data analysis, a platform from which a received signal comes, such as a micro-soft screen or a Google screen, should be analyzed, and a part of protocols can also analyze specific fields in received data to judge whether a screen end is allowed to be paired with the screen, and whether the communication is based on a protocol version.
As another embodiment, the active pen may switch protocols when no signal is received upon detection, in addition to possibly switching protocols when an external signal is detected. Specifically, the active pen protocol can be divided into two types of unidirectional transmission or bidirectional transmission according to the communication data transmission direction with the screen. Currently, a common dual-protocol pen works in a unidirectional transmission protocol as a default, and simultaneously starts receiving and monitoring the bidirectional protocol. The mode is switched to the bidirectional protocol operation mode immediately when the condition for switching to the bidirectional protocol is met, and the unidirectional protocol with less power consumption is switched back when the receiving signal can not be detected under the bidirectional protocol (for example, the pen leaves the range of the screen).
Further, after step S31, the method further includes:
step B1, when the signal type is identified as the noise type, the signal receiving function is closed;
and step B2, returning to the step of executing the signal searching function of starting the active pen in the silent stage of the working state.
In this embodiment, the noise type is a clutter type unrelated to pen screen communication. If the active pen recognizes that the type of the current external signal does not belong to the square wave type or the DSSS type, the external signal is an interference signal at the moment and does not need to be received any more, so that the signal receiving function is closed, the originally received noise signal can be discarded, and the storage space can be cleaned in time. Then, the active pen returns to the original signal searching stage to continue to search and identify signals.
Further, based on the second embodiment, a third embodiment of the protocol switching method of the present invention is provided. In this embodiment, the protocol switching condition includes at least one of the following:
switching within the quiet phase;
switching when no pen point pressure exists;
not switching in proximity to a next action specified by the current protocol;
switching at the end of a current period of the active pen transmit signal, wherein a period division of the current period is specified by the current protocol.
In this embodiment, the switching operation is started when it is determined that the protocol is to be switched, and the current protocol continues to operate if the protocol is not to be switched. And the switching needs to be at the 'correct time', otherwise the current work can be influenced. The switching should follow one or more of the following (all better): (1) switching in a silent stage of an active pen period to ensure normal operation of the current protocol; (2) should not be too close to the next action period (action refers to send action, receive action) specified by the current protocol because there is enough time to abort the switch to continue running the current protocol once the switch fails; (3) the protocol switching action is selected to be executed at the end of the current period of the current protocol, or at least the protocol is switched after the data required to be sent by the active pen in the current period is sent, so that the pressure information can be sent for one more frame, the switching is quicker, and the disconnection feeling or the flicker feeling is minimum. (4) The protocol should be selected to be switched when no pen point pressure exists, and because the protocol is switched when pressure exists, communication is lost for a short time in the switching process, so that the user experiences disconnection feeling, and the user experience is not facilitated.
Further, the step of confirming the existence of the external signal in the silent phase based on the signal finding function in step S20 includes:
step S21, determining whether a rising edge or a high level from the outside is detected in the silent phase based on the signal finding function;
in step S22, if yes, it is determined that the external signal is present.
In this embodiment, when the active pen has temporarily finished signaling and is supposed to be in a silent phase, the signal finding function is turned on until the next pen signaling action is turned off in order to enable the user to detect without perception whether there is a screen device of another protocol. The purpose of this reception process is simply to confirm the presence or absence of an external signal, and it is not necessary to turn on the signal reception performance in order to save power consumption. The method can be realized by detecting the rising edge or the high level, the active pen should receive the continuous low level when no external signal exists, otherwise, if the rising edge or the high level occurs, the external signal exists, and the identification of the rising edge or the high level is very simple and efficient for the singlechip.
Further, the step of turning on the signal searching function of the active pen in the silent phase of the working state in step S10 includes:
and determining function starting time in the silent stage according to a preset function starting rule, and starting the signal searching function according to the function starting time, wherein the function starting rule is based on the setting of stable operation of the active pen.
In this embodiment, since the above-mentioned signal searching, identifying and receiving actions all require a period of time, which covers the silent period of the active pen, the time occupied by the covered position should not affect the stable operation of the active pen under the current protocol, so that a proper position needs to be selected according to the specific processing time overhead to insert the multi-protocol "searching" process, and the specific function opening rule may include: the opening timing should be within a quiet period, the opening timing should not be within a time period adjacent to the previous action or the next action, and so on.
As shown in fig. 3, the present invention further provides a protocol switching apparatus, including:
a signal searching and starting module 10, configured to start a signal searching function of an active pen in a silent stage of a working state after the active pen enters the working state according to a current protocol, where the silent stage is a stage in which the active pen does not send a signal in the working state;
a signal receiving and starting module 20, configured to start a signal receiving function of the active pen based on the signal finding function that the external signal is confirmed to exist in the silent stage;
an external signal identification module 30, configured to receive and identify the external signal based on the signal receiving function, so as to determine a target protocol in the multiple sets of protocols compatible with the active pen;
and the target protocol switching unit 40 is configured to switch the current protocol to the target protocol when detecting that a preset protocol switching condition is currently met.
Optionally, the external signal identification module 30 includes:
a signal type identification unit for starting to receive an external signal based on the signal receiving function and identifying a signal type of the external signal;
the signal type judging unit is used for judging whether the signal type is the same as the original signal type of the current protocol or not when the signal type is identified to be the square wave type or the DSSS signal type;
a first logic determining unit, configured to determine, if the signal type is not the target protocol, a first receiving logic and the target protocol according to the signal type;
and the first logic receiving unit is used for continuously receiving the external signal according to the first receiving logic until the external signal is completely received.
Optionally, the external signal identification module 30 includes:
a second logic determining unit, configured to, if yes, analyze a specific field feature of the external signal, and determine a second receiving logic and the target protocol according to the specific field feature;
and the second logic receiving unit is used for continuously receiving the external signal according to the second receiving logic until the external signal is completely received.
Optionally, the external signal identification module 30 includes:
a receiving function closing unit, configured to close the signal receiving function when the signal type is identified as a noise type;
and the step return execution unit is used for returning to execute the step of starting the signal searching function of the active pen in the silent stage of the working state.
Optionally, the protocol switching apparatus further includes:
a protocol switching condition module, configured to apply the protocol switching condition to include at least one of:
switching within the quiet phase;
switching when no pen point pressure exists;
not switching in proximity to a next action specified by the current protocol;
switching at the end of a current period of the active pen transmit signal, wherein a period division of the current period is specified by the current protocol.
Optionally, the signal reception starting module 20 includes:
a signal searching and judging unit, configured to judge whether a rising edge or a high level from the outside is detected in the silent stage based on the signal searching function;
and the external signal judging unit is used for judging that the external signal exists if the external signal exists.
Optionally, the signal finding starting module 10 includes:
and the signal searching and starting unit is used for determining function starting time in the silent stage according to a preset function starting rule and starting the signal searching function according to the function starting time, wherein the function starting rule is based on the setting of stable operation of the active pen.
The invention also provides a protocol switching device.
The protocol switching device comprises a processor, a memory and a protocol switching program stored on the memory and capable of running on the processor, wherein the protocol switching program realizes the steps of the protocol switching method when being executed by the processor.
The method implemented when the protocol switching program is executed may refer to each embodiment of the protocol switching method of the present invention, and details thereof are not repeated herein.
The invention also provides a computer readable storage medium.
The computer readable storage medium of the present invention has stored thereon a protocol switching program, which when executed by a processor implements the steps of the protocol switching method as described above.
The method implemented when the protocol switching program is executed may refer to each embodiment of the protocol switching method of the present invention, and details thereof are not repeated herein.
The invention also provides a computer program product comprising a computer program which, when executed by a processor, implements the steps of the protocol switching method as described above.
The method implemented when the computer program is executed may refer to each embodiment of the protocol switching method of the present invention, and details 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 an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention essentially or contributing to the prior art can be embodied in the form of a software product, which is stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) as described above and includes several instructions for enabling a terminal device (e.g. a mobile phone, a computer, a server or a network device, etc.) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. A protocol switching method, characterized in that the protocol switching method comprises:
after an active pen enters a working state according to a current protocol, starting a signal searching function of the active pen in a silent stage of the working state, wherein the silent stage is a stage in which the active pen does not send signals in the working state;
confirming the existence of an external signal in the silent stage based on the signal searching function, and starting a signal receiving function of the active pen;
receiving and identifying the external signal based on the signal receiving function to determine a target protocol in a plurality of sets of protocols compatible with the active pen;
and when detecting that the current protocol meets the preset protocol switching condition, switching the current protocol into the target protocol.
2. The protocol switching method according to claim 1, wherein the step of receiving and recognizing the external signal based on the signal receiving function to determine a target protocol among the plurality of sets of protocols compatible with the active pen comprises:
starting to receive an external signal based on the signal receiving function and identifying the signal type of the external signal;
when the signal type is identified to be a square wave type or a Direct Sequence Spread Spectrum (DSSS) signal type, judging whether the signal type is the same as the original signal type of the current protocol or not;
if not, determining a first receiving logic and the target protocol according to the signal type;
the external signal continues to be received in accordance with the first receive logic until the external signal is completely received.
3. The protocol switching method according to claim 2, wherein after the step of determining whether the signal type is the same as an original signal type of the current protocol, the method further comprises:
if yes, analyzing specific field characteristics of the external signal, and determining second receiving logic and the target protocol according to the specific field characteristics;
continuing to receive the external signal in accordance with the second receive logic until the external signal is fully received.
4. The protocol switching method of claim 2, wherein the step of identifying the signal type of the external signal is followed by further comprising:
when the signal type is identified to be a noise type, the signal receiving function is closed;
and returning to execute the step of starting the signal searching function of the active pen in the silent stage of the working state.
5. The protocol switching method of claim 1, wherein the protocol switching condition comprises at least one of:
switching within the quiet phase;
switching when no pen point pressure exists;
not switching in proximity to a next action specified by the current protocol;
switching at the end of a current period of the active pen transmit signal, wherein a period division of the current period is specified by the current protocol.
6. The protocol switching method according to claim 1, wherein the step of confirming the presence of an external signal in the silent phase based on the signal finding function comprises:
determining whether a rising edge or a high level from the outside is detected in the silent period based on the signal finding function;
and if so, judging that the external signal exists.
7. The protocol switching method according to any of claims 1-6, wherein the step of turning on the signal finding function of the active pen in the silent phase of the working state comprises:
and determining function starting time in the silent stage according to a preset function starting rule, and starting the signal searching function according to the function starting time, wherein the function starting rule is based on the setting of stable operation of the active pen.
8. A protocol switching apparatus, comprising:
the signal searching and starting module is used for starting the signal searching function of the active pen in a silent stage of a working state after the active pen enters the working state according to a current protocol, wherein the silent stage is a stage that the active pen does not send signals in the working state;
the signal receiving and starting module is used for confirming that an external signal exists in the silent stage based on the signal searching function and starting the signal receiving function of the active pen;
the external signal identification module is used for receiving and identifying the external signal based on the signal receiving function so as to determine a target protocol in a plurality of sets of protocols compatible with the active pen;
and the target protocol switching unit is used for switching the current protocol into the target protocol when detecting that the current protocol meets the preset protocol switching condition.
9. A protocol switching device, characterized in that the protocol switching device comprises: memory, processor and a protocol switching program stored on the memory and executable on the processor, the protocol switching program when executed by the processor implementing the steps of the protocol switching method according to any one of claims 1 to 7.
10. A computer-readable storage medium, having a protocol switching program stored thereon, which when executed by a processor implements the steps of the protocol switching method according to any one of claims 1 to 7.
CN202111488241.1A 2021-12-06 2021-12-06 Protocol switching method, device, equipment and computer readable storage medium Active CN114327102B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111488241.1A CN114327102B (en) 2021-12-06 2021-12-06 Protocol switching method, device, equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111488241.1A CN114327102B (en) 2021-12-06 2021-12-06 Protocol switching method, device, equipment and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN114327102A true CN114327102A (en) 2022-04-12
CN114327102B CN114327102B (en) 2023-07-21

Family

ID=81049633

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111488241.1A Active CN114327102B (en) 2021-12-06 2021-12-06 Protocol switching method, device, equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN114327102B (en)

Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090024757A1 (en) * 2004-07-30 2009-01-22 Proctor David W Automatic Protocol Determination For Portable Devices Supporting Multiple Protocols
CN104484063A (en) * 2014-12-10 2015-04-01 北京汉王鹏泰科技有限公司 Active capacitance pen and touch device
US20170055303A1 (en) * 2015-08-21 2017-02-23 Samsung Electronics Co., Ltd Method and apparatus for intelligent communication selection
US20180120962A1 (en) * 2016-10-06 2018-05-03 Wacom Co., Ltd. Stylus and controller
CN108132729A (en) * 2017-12-19 2018-06-08 广州视源电子科技股份有限公司 Processing method, device and the electronic equipment and storage medium of touch signal
CN108139820A (en) * 2015-10-02 2018-06-08 微软技术许可有限责任公司 The stylus for communicate with digitizer with dynamic protocol selection
CN109188991A (en) * 2018-11-20 2019-01-11 上海新纪元机器人有限公司 Control the transmission method and device of signal
CN109941315A (en) * 2019-03-29 2019-06-28 上海仁童电子科技有限公司 A kind of data processing equipment and method
CN110851006A (en) * 2020-01-16 2020-02-28 深圳市千分一智能技术有限公司 Touch pen mode switching method, device and equipment and readable storage medium
CN111436042A (en) * 2019-10-31 2020-07-21 珠海市杰理科技股份有限公司 Bluetooth headset and dynamic master-slave switching method, device and system thereof
CN111580690A (en) * 2020-04-28 2020-08-25 深圳市千分一智能技术有限公司 Stylus mode switching method and device, stylus and readable storage medium
CN113064525A (en) * 2021-04-13 2021-07-02 合肥松豪电子科技有限公司 Control method compatible with active pens with different protocols
CN113094105A (en) * 2020-01-09 2021-07-09 北京君正集成电路股份有限公司 Method for ensuring low power consumption state of USB device and awakening USB device
CN113259389A (en) * 2021-06-23 2021-08-13 浙江正泰物联技术有限公司 Protocol switching method and system for guide rail meter

Patent Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090024757A1 (en) * 2004-07-30 2009-01-22 Proctor David W Automatic Protocol Determination For Portable Devices Supporting Multiple Protocols
CN104484063A (en) * 2014-12-10 2015-04-01 北京汉王鹏泰科技有限公司 Active capacitance pen and touch device
US20170055303A1 (en) * 2015-08-21 2017-02-23 Samsung Electronics Co., Ltd Method and apparatus for intelligent communication selection
CN108139820A (en) * 2015-10-02 2018-06-08 微软技术许可有限责任公司 The stylus for communicate with digitizer with dynamic protocol selection
US20180120962A1 (en) * 2016-10-06 2018-05-03 Wacom Co., Ltd. Stylus and controller
CN108132729A (en) * 2017-12-19 2018-06-08 广州视源电子科技股份有限公司 Processing method, device and the electronic equipment and storage medium of touch signal
CN109188991A (en) * 2018-11-20 2019-01-11 上海新纪元机器人有限公司 Control the transmission method and device of signal
CN109941315A (en) * 2019-03-29 2019-06-28 上海仁童电子科技有限公司 A kind of data processing equipment and method
CN111436042A (en) * 2019-10-31 2020-07-21 珠海市杰理科技股份有限公司 Bluetooth headset and dynamic master-slave switching method, device and system thereof
CN113094105A (en) * 2020-01-09 2021-07-09 北京君正集成电路股份有限公司 Method for ensuring low power consumption state of USB device and awakening USB device
CN110851006A (en) * 2020-01-16 2020-02-28 深圳市千分一智能技术有限公司 Touch pen mode switching method, device and equipment and readable storage medium
CN111580690A (en) * 2020-04-28 2020-08-25 深圳市千分一智能技术有限公司 Stylus mode switching method and device, stylus and readable storage medium
CN113064525A (en) * 2021-04-13 2021-07-02 合肥松豪电子科技有限公司 Control method compatible with active pens with different protocols
CN113259389A (en) * 2021-06-23 2021-08-13 浙江正泰物联技术有限公司 Protocol switching method and system for guide rail meter

Also Published As

Publication number Publication date
CN114327102B (en) 2023-07-21

Similar Documents

Publication Publication Date Title
CN109062479B (en) Split screen application switching method and device, storage medium and electronic equipment
CN107566015B (en) Antenna control method, antenna control device, storage medium and electronic equipment
CN109033247B (en) Application program management method and device, storage medium and terminal
CN105677335A (en) Method and device for increasing first starting speed of mobile terminal
US11012970B2 (en) Method for processing radio frequency interference and electronic device
RU2664410C2 (en) Method for double mode control, device and user terminal
EP3435215B1 (en) Method, device, storage medium and mobile terminal for recognizing an off-screen gesture
US11604570B2 (en) Method, device, apparatus, and storage medium for controlling touch operation mode
CN106445609A (en) Automatic updating method of application program and mobile terminal
CN105159548A (en) List interface operating method and electronic terminal
CN111273769B (en) Equipment control method and device, electronic equipment and storage medium
CN104168385A (en) Double card switchover method and device
CN111970749A (en) Network connection method and device, intelligent household equipment and intelligent household system
CN105183280A (en) Operation method for list interface and electronic terminal
CN111611189A (en) Communication method, device and computer storage medium
RU2602824C2 (en) Communication control method and device
US20190114069A1 (en) Control instruction identification method and apparatus, and storage medium
CN113824511A (en) Detection method and device for diversity antenna, electronic equipment and storage medium
CN114327102B (en) Protocol switching method, device, equipment and computer readable storage medium
CN104811563A (en) Method for adjusting working performance of mobile terminal
CN109547646B (en) Mobile terminal and interference processing method thereof
CN107395888B (en) Processing method, device, storage medium and the mobile terminal of blank screen gesture
CN107967363B (en) Data processing method and device and electronic equipment
CN115225166A (en) Anti-interference method, terminal and storage medium
WO2019153986A1 (en) Application display method, application, storage medium, and electronic 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