Intelligent writing method and device, electronic equipment and storage medium

By detecting the contact status between the smart writing pen and the infrared touchscreen and controlling the working parameters, the target infrared emission signal is sent, which solves the problem of inaccurate color recognition of the writing trajectory on the infrared touchscreen and achieves higher writing accuracy and user experience.

CN120973248APending Publication Date: 2025-11-18GUANGZHOU SHIYUAN ELECTRONICS CO LTD +1
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202410616430.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-17
Publication Date
2025-11-18

AI Technical Summary

Technical Problem

When users write with an infrared pen, existing infrared touchscreens suffer from inaccurate color recognition of writing traces due to variations in the touch area caused by different pen-holding habits, affecting writing accuracy and user experience.

Method used

The intelligent writing pen determines the contact state with the infrared touchscreen and sends target infrared emission signals according to the working parameters to ensure that the infrared touchscreen accurately recognizes the handwriting parameters. This includes using DIP switches and level signals to identify the contact state of the pen tip or pen tail and controlling the infrared emission signals to achieve different writing functions.

Benefits of technology

It improves the accuracy and user experience of writing on infrared touchscreens, reduces writing errors, and ensures accurate writing results regardless of how the user holds the pen.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120973248A_ABST
    Figure CN120973248A_ABST
Patent Text Reader

Abstract

The invention provides an intelligent writing method and device, electronic equipment and a storage medium, the method is applied to the technical field of touch, the method comprises the steps that the contact state between an intelligent writing pen and an infrared touch screen is determined, and the contact state comprises the contacted state and the non-contacted state; under the condition that the contact state is a contacted state, a target infrared emission signal of the intelligent writing pen is determined according to the working parameters of the intelligent writing pen, and the target infrared emission signal is used for representing handwriting parameters of the intelligent writing pen in the writing process; and sending the target infrared emission signal to the infrared touch screen, so that the infrared touch screen displays a text corresponding to the handwriting parameter on the infrared touch screen based on the target infrared emission signal. According to the method, the purpose of writing on the infrared touch screen can be achieved in the mode that the intelligent writing pen sends the infrared emission signal to the infrared touch screen, the writing accuracy is guaranteed, and the writing experience of a user is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the touch technical field, and more particularly, to a smart writing method and device, an electronic device and a storage medium. BACKGROUND

[0002] With the development of science and technology and Internet technology, various electronic products are emerging on the market, such as smart phones, smart tablets (such as touch screens, touch pads). The continuous emergence of electronic products makes people's life more and more intelligent and convenient.

[0003] As a kind of touch screen, infrared touch screen is widely used in education, medical treatment, entertainment and other fields. For example, teachers can use infrared pens to write classroom scripts on infrared touch screens during daily teaching.

[0004] In the related art, when a user writes on an infrared touch screen using an infrared pen, the infrared touch screen can identify the thickness of the tip of the current infrared pen to obtain the identity document (ID) of the current infrared pen, so as to display the track color corresponding to the ID on the infrared touch screen.

[0005] However, due to different writing habits of users, the touch area (infrared light network detected touch area) between the infrared pen and the infrared touch screen changes, resulting in incorrect track color when the infrared pen writes. For example, most users do not write vertically, but with a certain inclination angle. Generally, when the pen is inclined, the touch area detected by the infrared touch screen through the infrared light network will be larger than when the pen is vertical, so it may cause inaccurate identification. SUMMARY

[0006] The present application provides a smart writing method, device, electronic device and storage medium, which can achieve the purpose of writing on the infrared touch screen by sending an infrared emission signal to the infrared touch screen with a smart writing pen, ensuring the accuracy of writing and improving the user's writing experience.

[0007] In a first aspect, a smart writing method is provided, comprising: determining a contact state between a smart writing pen and an infrared touch screen, the contact state including contacted and not contacted; in a case where the contact state is contacted, determining a target infrared emission signal of the smart writing pen according to a working parameter of the smart writing pen, the target infrared emission signal being used to represent a handwriting parameter of the smart writing pen in a writing process; sending the target infrared emission signal to the infrared touch screen, so that the infrared touch screen displays a text corresponding to the handwriting parameter based on the target infrared emission signal.

[0008] In the above technical solution, in the process of using the intelligent writing pen by the user, the application proposes an intelligent writing method. First, the contact state between the intelligent writing pen and the infrared touch screen is determined to determine whether the user has the demand of using the intelligent writing pen to write on the infrared touch screen. When the intelligent writing pen is in contact with the infrared touch screen, the intelligent writing pen can determine the target infrared emission signal to be sent to the infrared touch screen through its own working parameter, and send it to the infrared touch screen to make the infrared touch screen display the corresponding text. The above intelligent writing pen interacts with the infrared touch screen through the infrared emission signal to achieve the purpose of writing. Therefore, the infrared touch screen can accurately identify the writing parameters required by the intelligent writing pen based on the infrared emission signal for display, so that no matter how the contact area between the infrared pen and the infrared touch screen changes, it does not affect the final writing effect, ensures the accuracy of the intelligent writing pen in the writing process, reduces the writing error, and improves the user's writing experience.

[0009] In combination with the first aspect, in some possible implementation manners, the target infrared emission signal of the intelligent writing pen is determined according to the working parameter of the intelligent writing pen, including: determining the target identifier of the intelligent writing pen according to the working parameter, the target identifier being used to represent the function or writing trace color of the intelligent writing pen in the writing process; and determining the target infrared emission signal according to the target identifier.

[0010] In the above technical solution, in the application, different identifiers of the intelligent writing pen represent different writing requirements, such as erasing, highlighting, displaying red text, displaying green text, etc. In the process of determining the target infrared emission signal, the application can identify the current target identifier of the intelligent writing pen, so as to determine the writing function or writing trace color of the intelligent writing pen, so as to obtain the target infrared emission signal according to the target identifier, so that the target infrared emission signal can be closely related to the writing requirement of the user, and the accuracy of the infrared touch screen in display is further ensured.

[0011] In combination with the first aspect, in some possible implementation manners, the working parameter includes the on-off state of a dial switch installed on the intelligent writing pen and a level signal of the intelligent writing pen, the on-off state is used to represent that the dial switch is disconnected or closed, the dial switch includes a first dial switch corresponding to the pen tip and a second dial switch corresponding to the pen tail, and the level signal includes a first level signal corresponding to the pen tip or a second level signal corresponding to the pen tail. The target identifier of the intelligent writing pen is determined according to the working parameter, including: in the case that the first level signal is a preset level signal, the target identifier is determined according to the first on-off state of the first dial switch; or in the case that the second level signal is the preset level signal, the target identifier is determined according to the second on-off state of the second dial switch.

[0012] In the technical solution, the tip and the tail of the smart writing pen have certain writing functions, for example, the tip can be used to write text, and the tail can be used to erase the text or highlight the text. Either the tip or the tail corresponds to multiple marks, and each mark is used to realize different functions. For example, each mark of the multiple marks of the tip represents a different color, and each mark of the multiple marks of the tail can realize different functions, such as erasing, highlighting, etc. The application can determine the target mark by installing the first dial switch and the second dial switch on the tip and the tail, respectively. Specifically, the application can first determine whether the tip or the tail contacts the infrared touch screen by the level signal of the tip or the level signal of the tail. When the tip contacts the infrared touch screen, the application can determine the target mark by the first on state of the first dial switch corresponding to the tip. Conversely, when the tail contacts the infrared touch screen, the application can determine the target mark by the second on state of the second dial switch corresponding to the tail. The above process can ensure that the infrared touch screen can realize functions matched with the user's needs whether the user uses the tip or the tail, and the target mark can be accurately identified based on the on state of the dial switch.

[0013] In combination with the first aspect and the above implementation, in some possible implementation, the working parameter includes a current working voltage, and the sending of the target infrared emission signal to the infrared touch screen includes: determining a target emission channel corresponding to the target infrared emission signal according to the current working voltage; and sending the target infrared emission signal to the infrared touch screen through the target emission channel.

[0014] In the technical solution, in order to maintain the stability of the smart writing pen during writing, the application can control the smart writing pen to always work at a constant power. After determining the current working voltage of the smart writing pen, the application can determine the target emission channel according to the current working voltage under the condition of constant power.

[0015] In combination with the first aspect and the above implementation, in some possible implementation, the determination of the contact state between the smart writing pen and the infrared touch screen includes: determining whether to run an interrupt program of the smart writing pen according to the working parameter during the running of a main program of the smart writing pen; and determining the contact state according to the working parameter by the interrupt program in the case of determining to run the interrupt program.

[0016] With reference to the first aspect and the above implementation manners, in some possible implementation manners, the working parameter includes any one of a charging interface state of the smart writing pen, a first level signal corresponding to a pen tip of the smart writing pen, and a second level signal corresponding to a pen tail of the smart writing pen, and the determining, according to the working parameter, whether to run the interrupt program of the smart writing pen includes: determining to run the interrupt program in a case where the charging interface state is connected, or the first level signal is a preset level signal, or the second level signal is the preset level signal; and determining not to run the interrupt program in a case where the charging interface state is not connected, and the first level signal is not the preset level signal, and the second level signal is not the preset level signal.

[0017] With reference to the first aspect and the above implementation manners, in some possible implementation manners, the working parameter includes a previous working voltage, a current working voltage, a charging interface state, a first level signal corresponding to a pen tip of the smart writing pen, and a second level signal corresponding to a pen tail of the smart writing pen, and the determining, by the interrupt program according to the working parameter, of the contact state includes: determining, based on the previous working voltage, an order in which the current working voltage is compared with a first threshold and a second threshold, the second threshold being greater than the first threshold; comparing the current working voltage with the first threshold and the second threshold according to the order to determine a voltage gear corresponding to the current working voltage; and determining the contact state according to the voltage gear corresponding to the current working voltage, or according to the voltage gear corresponding to the current working voltage and any one of the charging interface state, the first level signal, and the second level signal.

[0018] In a possible implementation manner of the first aspect, the order in which the current working voltage is compared with the first threshold value and the second threshold value based on the previous working voltage comprises: determining a voltage range corresponding to the previous working voltage, the voltage range comprising a first voltage range, a second voltage range and a third voltage range, the first voltage range indicating that the previous working voltage is greater than or equal to the second threshold value, the second voltage range indicating that the previous working voltage is greater than the first threshold value and less than the second threshold value, and the third voltage range indicating that the previous working voltage is less than or equal to the first threshold value; in a case where the voltage range corresponding to the previous working voltage is the first voltage range, the order is determined as a first order, the first order being that the current working voltage is compared with the second threshold value first and then compared with the first threshold value; in a case where the voltage range corresponding to the previous working voltage is the second voltage range, the order is determined as the first order or a second order, the second order being that the current working voltage is compared with the first threshold value first and then compared with the second threshold value; and in a case where the voltage range corresponding to the previous working voltage is the third voltage range, the order is determined as the second order.

[0019] In a possible implementation manner of the first aspect, the order in which the current working voltage is compared with the first threshold value and the second threshold value based on the previous working voltage comprises: determining a voltage range corresponding to the previous working voltage, the voltage range comprising a first voltage range, a second voltage range and a third voltage range, the first voltage range indicating that the previous working voltage is greater than or equal to the second threshold value, the second voltage range indicating that the previous working voltage is greater than the first threshold value and less than the second threshold value, and the third voltage range indicating that the previous working voltage is less than or equal to the first threshold value; in a case where the voltage range corresponding to the previous working voltage is the first voltage range, the order is determined as a first order, the first order being that the current working voltage is compared with the second threshold value first and then compared with the first threshold value; in a case where the voltage range corresponding to the previous working voltage is the second voltage range, the order is determined as the first order or a second order, the second order being that the current working voltage is compared with the first threshold value first and then compared with the second threshold value; and in a case where the voltage range corresponding to the previous working voltage is the third voltage range, the order is determined as the second order.

[0020] In the technical solution, the MCU can be woken up to execute the interrupt program in the low-power mode or the ultra-low-power mode. Since the power consumption of the low-power mode and the ultra-low-power mode is low, the current working voltage and the previous working voltage are generally close. When determining the voltage gear of the current working voltage, the current working voltage is compared with the boundary values of different voltage gears. To improve the determination efficiency and reduce the number of comparisons between the current working voltage and the boundary values, the application can use the voltage gear of the previous working voltage to obtain the comparison order between the current working voltage and the first threshold value and the second threshold value, and then determine the voltage gear of the current working voltage by comparison. The following cases are divided:

[0021] The first case is that the voltage gear corresponding to the previous working voltage is the first voltage gear, indicating that the previous working voltage is close to the second threshold value. Therefore, the current working voltage is compared with the second threshold value first. If the current working voltage is greater than the second threshold value, the voltage gear of the current working voltage is obtained. If the current working voltage is less than the second threshold value, the current working voltage is compared with the first threshold value to obtain the voltage gear of the current working voltage.

[0022] The second case is that the voltage gear corresponding to the previous working voltage is the second voltage gear, indicating that the previous working voltage is greater than the first threshold value and less than the second threshold value. In this voltage gear, the previous working voltage may be closer to the first threshold value or closer to the second threshold value. Therefore, whether the current working voltage is compared with the second threshold value first or the first threshold value first, the voltage gear of the current working voltage can be determined by at most two comparisons.

[0023] The third case is that the voltage gear corresponding to the previous working voltage is the third voltage gear, indicating that the previous working voltage is closer to the first threshold value and has a large difference from the second threshold value. Therefore, the current working voltage is compared with the first threshold value first. If the current working voltage is less than or equal to the first threshold value, the voltage gear of the current working voltage is obtained. If the current working voltage is greater than the first threshold value, the current working voltage is compared with the second threshold value to obtain the voltage gear of the current working voltage.

[0024] Therefore, when the voltage gears of the previous working voltage are different, the comparison order is flexibly adjusted, which can ensure that in most cases, the voltage gear of the current working voltage can be obtained by comparing the current working voltage with the threshold value that is compared first only once, thereby improving the determination efficiency of the current voltage gear.

[0025] In a possible implementation of the first aspect and the foregoing implementation, in some possible implementation, the determining the contact state according to the voltage gear corresponding to the current working voltage, or according to the voltage gear corresponding to the current working voltage and at least one of the charging interface state, the first level signal and the second level signal, comprises: in a case where the voltage gear corresponding to the current working voltage is the third voltage gear, determining that the contact state is not contacted and exiting the interrupt program; in a case where the voltage gear corresponding to the current working voltage is the first voltage gear or the second voltage gear, if the charging interface state is connected, determining that the contact state is not contacted; in a case where the voltage gear corresponding to the current working voltage is the first voltage gear or the second voltage gear, if the first level signal is a preset level signal or the second level signal is the preset level signal, determining that the contact state is contacted.

[0026] In a possible implementation of the first aspect and the foregoing implementation, the method further comprises: during running of a main program of the smart writing pen, obtaining and storing the previous working voltage before the microcontroller unit enters the low-power consumption mode or enters the ultra-low-power consumption mode.

[0027] In a possible implementation of the first aspect and the foregoing implementation, before the determining the target infrared emission signal of the smart writing pen according to the working parameter of the smart writing pen, the method further comprises: obtaining a first duration that a first level signal is a preset level signal or a second duration that a second level signal is the preset level signal, the first level signal being a level signal corresponding to a pen tip of the smart writing pen, and the second level signal being a level signal corresponding to a pen tail of the smart writing pen; in a case where the first duration is greater than or equal to a preset duration or the second duration is greater than or equal to the preset duration, determining that the smart writing pen enters a writing state.

[0028] In the foregoing technical solution, in a case where the smart writing pen is in contact with the infrared touch screen, if the pen tip is in contact with the infrared touch screen, the application can further obtain a first duration that a first level signal of the pen tip is a preset level signal, and compare the first duration with a preset duration to determine whether the current contact is a pen tip false touch. When the first duration is greater than the preset duration, it is indicated that the pen tip is not a false touch. Similarly, if the pen tail is in contact with the infrared touch screen, the application can further obtain a second duration that a second level signal of the pen tail is the preset level signal, and when the second duration is greater than the preset duration, it is indicated that the current pen tail is not a false touch, so that the foregoing process ensures the accuracy in writing by the pen tip or the pen tail.

[0029] In a second aspect, an intelligent writing device is provided, which includes: a state determining module configured to determine a contact state between an intelligent writing pen and an infrared touch screen, the contact state including a contacted state and an uncontacted state; a signal determining module configured to, when the contact state is the contacted state, determine a target infrared emission signal of the intelligent writing pen according to a working parameter of the intelligent writing pen, the target infrared emission signal being used to represent a stroke parameter of the intelligent writing pen in a writing process; and a signal sending module configured to send the target infrared emission signal to the infrared touch screen, so that the infrared touch screen displays a text corresponding to the stroke parameter based on the target infrared emission signal.

[0030] With reference to the second aspect, in some possible implementation manners, the signal determining module is specifically configured to: determine a target identification of the intelligent writing pen according to the working parameter, the target identification being used to represent a function or a stroke color of a writing track of the intelligent writing pen in the writing process; and determine the target infrared emission signal according to the target identification.

[0031] With reference to the second aspect and the foregoing implementation manners, in some possible implementation manners, the working parameter includes a turn-on state of a dial switch installed on the intelligent writing pen and a level signal of the intelligent writing pen, the turn-on state being used to represent that the dial switch is turned off or closed, the dial switch including a first dial switch corresponding to the pen tip and a second dial switch corresponding to the pen tail, and the level signal including a first level signal corresponding to the pen tip or a second level signal corresponding to the pen tail, and the signal determining module is further configured to: when the first level signal is a preset level signal, determine the target identification according to a first turn-on state of the first dial switch; or when the second level signal is the preset level signal, determine the target identification according to a second turn-on state of the second dial switch.

[0032] With reference to the second aspect and the foregoing implementation manners, in some possible implementation manners, the working parameter includes a current working voltage, and the signal sending module is further configured to: determine a target emission channel corresponding to the target infrared emission signal according to the current working voltage; and send the target infrared emission signal to the infrared touch screen through the target emission channel.

[0033] With reference to the second aspect and the foregoing implementation manners, in some possible implementation manners, the state determining module is specifically configured to: during running of a main program of the intelligent writing pen, determine whether to run an interrupt program of the intelligent writing pen according to the working parameter; and when it is determined to run the interrupt program, determine the contact state according to the working parameter by the interrupt program.

[0034] With reference to the second aspect and the foregoing implementation manners, in some possible implementation manners, the working parameter includes any one of a charging interface state of the smart writing pen, a first level signal corresponding to a pen tip of the smart writing pen, and a second level signal corresponding to a pen tail, and the state determining module is further configured to: determine to run the interrupt program in a case where the charging interface state is connected, or the first level signal is a preset level signal, or the second level signal is the preset level signal; and determine not to run the interrupt program in a case where the charging interface state is not connected, and the first level signal is not the preset level signal, and the second level signal is not the preset level signal.

[0035] With reference to the second aspect and the foregoing implementation manners, in some possible implementation manners, the working parameter includes a previous working voltage, a current working voltage, a charging interface state, a first level signal corresponding to a pen tip of the smart writing pen, and a second level signal corresponding to a pen tail, the previous working voltage being a working voltage before the micro control unit enters a low-power mode or before the micro control unit enters an overtime power consumption mode, and the state determining module is further configured to: determine, based on the previous working voltage, an order in which the current working voltage is compared with a first threshold and a second threshold, the second threshold being greater than the first threshold; compare the current working voltage with the first threshold and the second threshold in the order to determine a voltage gear corresponding to the current working voltage; and determine the contact state according to the voltage gear corresponding to the current working voltage, or according to the voltage gear corresponding to the current working voltage and any one of the charging interface state, the first level signal, and the second level signal.

[0036] With reference to the second aspect and the foregoing implementation manners, in some possible implementation manners, the state determining module is further configured to: determine a voltage gear corresponding to the previous working voltage, the voltage gear including a first voltage gear, a second voltage gear, and a third voltage gear, the first voltage gear indicating that the previous working voltage is greater than or equal to the second threshold, the second voltage gear indicating that the previous working voltage is greater than the first threshold and less than the second threshold, and the third voltage gear indicating that the previous working voltage is less than or equal to the first threshold; in a case where the voltage gear corresponding to the previous working voltage is the first voltage gear, determine the order to be a first order, the first order being to compare the current working voltage with the second threshold first, and then compare the current working voltage with the first threshold; in a case where the voltage gear corresponding to the previous working voltage is the second voltage gear, determine the order to be the first order or a second order, the second order being to compare the current working voltage with the first threshold first, and then compare the current working voltage with the second threshold; and in a case where the voltage gear corresponding to the previous working voltage is the third voltage gear, determine the order to be the second order.

[0037] With reference to the second aspect and the foregoing implementations, in some possible implementations, the state determining module is further configured to: in a case where the sequence is the first sequence, if the current working voltage is greater than or equal to the second threshold value, determining that the voltage gear corresponding to the current working voltage is the first voltage gear; if the current working voltage is less than the second threshold value, comparing the current working voltage with the first threshold value; if the current working voltage is less than the first threshold value, determining that the voltage gear corresponding to the current working voltage is the third voltage gear; if the current working voltage is greater than or equal to the first threshold value, determining that the voltage gear corresponding to the current working voltage is the second voltage gear; in a case where the sequence is the second sequence, if the current working voltage is greater than or equal to the first threshold value, comparing the current working voltage with the second threshold value; if the current working voltage is less than the second threshold value, determining that the voltage gear of the current working voltage is the second voltage gear; if the current working voltage is greater than or equal to the second threshold value, determining that the voltage gear of the current working voltage is the first voltage gear; if the current working voltage is less than the first threshold value, determining that the voltage gear of the current working voltage is the third voltage gear.

[0038] With reference to the second aspect and the foregoing implementations, in some possible implementations, the state determining module is further configured to: in a case where the voltage gear corresponding to the current working voltage is the third voltage gear, determining that the contact state is not contacted and exiting the interrupt program; in a case where the voltage gear corresponding to the current working voltage is the first voltage gear or the second voltage gear, if the charging interface state is contacted, determining that the contact state is contacted; in a case where the voltage gear corresponding to the current working voltage is the first voltage gear or the second voltage gear, if the first level signal is a preset level signal or the second level signal is the preset level signal, determining that the contact state is contacted.

[0039] With reference to the second aspect and the foregoing implementations, in some possible implementations, the apparatus further includes a voltage storage module configured to acquire and store the previous working voltage before the microcontroller unit enters the low-power consumption mode or enters the ultra-low-power consumption mode during running of a main program of the smart writing pen.

[0040] With reference to the second aspect and the above implementation manners, in some possible implementation manners, before the target infrared emission signal of the smart writing pen is determined according to the working parameter of the smart writing pen, the apparatus further includes: a level signal acquisition module, configured to acquire a first time length during which a first level signal is a preset level signal or a second time length during which a second level signal is the preset level signal, the first level signal being a level signal corresponding to a pen tip of the smart writing pen, and the second level signal being a level signal corresponding to a pen tail of the smart writing pen; and in a case where the first time length is greater than or equal to a preset time length or the second time length is greater than or equal to the preset time length, it is determined that the smart writing pen enters a writing state.

[0041] In a third aspect, an electronic device is provided, including a memory and a processor. The memory is configured to store executable program code, and the processor is configured to invoke and run the executable program code from the memory, so that the electronic device executes the method in the first aspect or any possible implementation manner of the first aspect.

[0042] In a fourth aspect, a computer program product is provided, which includes computer program code. When the computer program code is run on a computer, the computer program code causes the computer to execute the method in the first aspect or any possible implementation manner of the first aspect.

[0043] In a fifth aspect, a computer-readable storage medium is provided, which stores computer program code. When the computer program code is run on a computer, the computer program code causes the computer to execute the method in the first aspect or any possible implementation manner of the first aspect. BRIEF DESCRIPTION OF DRAWINGS

[0044] Figure 1 is a schematic diagram of a smart writing scenario provided by an embodiment of the present application;

[0045] Figure 2 is a schematic flowchart of main program running provided by an embodiment of the present application;

[0046] Figure 3 is a schematic flowchart of a smart writing method provided by an embodiment of the present application;

[0047] Figure 4 is a schematic flowchart of interrupt program running provided by an embodiment of the present application;

[0048] Figure 5 is a structural schematic diagram of an apparatus for smart writing provided by an embodiment of the present application;

[0049] Figure 6 is a structural schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0050] The technical solutions in the present application will be described clearly and exhaustively in combination with the drawings. In the description of the embodiments of the present application, unless otherwise specified, " / " represents the meaning of or, for example, A / B can represent A or B: "and / or" in the text only describes the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B, which can represent: A exists alone, A and B exist together, and B exists alone, in addition, in the description of the embodiments of the present application, "multiple" means two or more than two.

[0051] Hereinafter, the terms "first" and "second" are only for descriptive purposes, and cannot be understood as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Therefore, the features defined with "first" and "second" can explicitly or implicitly include one or more features.

[0052] Before introducing the method of the embodiments of the present application, the professional terms that may be involved in the embodiments of the present application are first explained.

[0053] Main program: the core program of the program, the main program is executed in sequence, and each cycle is called a scanning period.

[0054] Interrupt program, is a separate program, is the single-chip microcomputer main program running process, some unexpected situations need to be handled by the single-chip microcomputer, the single-chip microcomputer can automatically stop the running main program and enter the program to handle the new situation, when the interrupt program is executed, it returns to the main program to continue executing the main program.

[0055] Figure 1 It is a scene schematic diagram of intelligent writing provided by the embodiments of the present application.

[0056] For example, as shown in Figure 1 When the user writes on the infrared touch screen 101 by the intelligent writing pen 102, in order to distinguish different contents, the user can use the intelligent writing pen 102 with different pen trace colors (such as red, green, blue) or the intelligent writing pen 102 with different pen tip thicknesses to write, so that the infrared touch screen 101 displays texts with different pen trace colors or texts with different line thicknesses.

[0057] Optionally, the intelligent writing pen 102 in the embodiments of the present application is an infrared pen capable of interacting with the infrared touch screen 101.

[0058] In the related art, in order to realize that the infrared touch screen 101 displays text in different handwriting colors in the writing process of the intelligent writing pen 102, a plurality of intelligent writing pens 102 with different pen tip thicknesses can be pre-configured. Different pen tip thicknesses represent different handwriting colors and different IDs. When a user writes with a certain intelligent writing pen 102, the infrared touch screen 101 can identify the pen tip thickness of the intelligent writing pen 102, determine the ID of the intelligent writing pen 102, finally obtain the handwriting color of the intelligent writing pen 102, and then the infrared touch screen 101 displays text in the handwriting color in the display area.

[0059] In the above process, due to the difference in pen holding posture and pen holding habit of different users, the touch area (the touch area detected by the infrared light network) between the intelligent writing pen and the infrared touch screen changes when different users write, thereby causing the color of the track finally written by the intelligent writing pen to be incorrect, and the desired effect of the user cannot be achieved. For example, most users do not vertically drop the pen when using it, and the pen has a certain inclination angle. Generally, when the pen is inclined, the touch area detected by the infrared touch screen through the infrared light network is larger than when the pen is vertical, and therefore inaccurate recognition can be caused.

[0060] Based on the above problems, the embodiment of the present application proposes a method of intelligent writing, which can achieve the purpose of writing on the infrared touch screen by the intelligent writing pen sending an infrared emission signal to the infrared touch screen, thereby ensuring the accuracy of writing and improving the writing experience of the user.

[0061] After introducing the application scenario of the embodiment of the present application, the intelligent writing pen provided by the embodiment of the present application also has differences in hardware structure compared with the intelligent writing pen in the prior art.

[0062] Specifically, as known from the foregoing description, the intelligent writing pen in the prior art mainly achieves the effect of distinguishing handwriting colors by configuring different pen tip thicknesses in the writing process, and does not involve circuit and program control.

[0063] In the embodiment of the present application, the hardware structure of the intelligent writing pen mainly consists of the following parts: a micro controller unit (MCU), a super capacitor, a dial switch, a key, and an infrared emission tube.

[0064] The MCU serves as the main controller of the intelligent writing pen and is used to control the running and termination of the program.

[0065] The super capacitor serves as the battery of the intelligent writing pen and has the characteristics of large energy storage space and fast charging and discharging. On the one hand, it can ensure that the intelligent writing pen has a long writing time, and on the other hand, it can also ensure the efficiency of charging and discharging of the intelligent writing pen.

[0066] Dial switch, also known as dial switch, digital switch, etc., is an address switch for operation control, which adopts 0 / 1 binary code principle and is mainly used in program control board. It can realize different functions by switching between 0 and 1. In the embodiment of the application, different on states are used to represent different IDs of intelligent writing pens.

[0067] The state of the key is mainly used to reflect whether the pen tip or the pen tail is in contact with the infrared touch screen. For a common key, it usually includes two states of pressing and releasing, and the two states correspond to different level signals. Generally, when the key is pressed, it corresponds to a low level signal, and when the key is released, it corresponds to a high level signal. In the embodiment of the application, a key can be configured on the pen tip and the pen tail respectively, and the two keys are used to detect the contact state between the pen tip and the infrared touch screen and the contact state between the pen tail and the infrared touch screen. When the pen tip is in contact with the infrared touch screen, the key corresponding to the pen tip is automatically connected (i.e. pressed), and the level signal of the pen tip is at a low level signal; on the contrary, when the pen tail is in contact with the infrared touch screen, the key corresponding to the pen tail is automatically connected, i.e. the level signal of the pen tail is at a low level signal.

[0068] On the contrary, when the pen tip is not in contact with the infrared touch screen, the key corresponding to the pen tip is automatically disconnected (i.e. released), and the level signal of the pen tip (i.e. the level signal of the key corresponding to the pen tip) is at a high level signal. When the pen tail is not in contact with the infrared touch screen, the key corresponding to the pen tail is automatically disconnected, and the level signal of the pen tail (i.e. the level signal of the key corresponding to the pen tail) is at a high level signal.

[0069] In another case, the embodiment of the application can also adjust the connection mode of the key corresponding to the pen tip and the key corresponding to the pen tail to make the pen tip correspond to a high level signal when it is in contact with the infrared touch screen, and correspond to a low level signal when it is not in contact with the infrared touch screen; and the pen tail corresponds to a high level signal when it is in contact with the infrared touch screen, and corresponds to a low level signal when it is not in contact with the infrared touch screen.

[0070] In the introduction process of the embodiment of the application, the low level signal corresponding to the contact between the pen tip and the infrared touch screen or the contact between the pen tail and the infrared touch screen is exemplified.

[0071] Therefore, the embodiment of the application determines whether the pen tip is in contact with the infrared touch screen by detecting whether the level signal of the pen tip is a high level signal or a low level signal, and determines whether the pen tail is in contact with the infrared touch screen by detecting whether the level signal of the pen tail is a high level signal or a low level signal.

[0072] The infrared emitting tube can convert electrical signals into infrared radiation signals of a specific frequency and is mainly used as a transmitting element of the intelligent writing pen.

[0073] After introducing the hardware structure of the intelligent writing pen in the embodiments of the present application, before introducing the method of intelligent writing provided by the embodiments of the present application, the two execution programs involved in the embodiments of the present application are introduced.

[0074] It should be understood that, according to the principle of MCU, there is a main program corresponding to the running process of MCU. During the execution of the main program, various events will be encountered, such as encountering an error instruction, a sudden change in the level of a pin, etc. These events are usually referred to as "interrupt" or "exception".

[0075] In the embodiments of the present application, in order to ensure that the intelligent writing pen can be charged and written, a corresponding interrupt program and a signal triggering the running of the interrupt program (i.e. the condition for running the interrupt program) can be set in advance. When the main program is executed, if the MCU determines that the condition for running the interrupt program is met according to the working state of the intelligent writing pen, the MCU will jump from the main program to the interrupt program to start executing the interrupt program. After the execution of the interrupt program is completed, the MCU returns to the main program again, i.e. completes the process of calling the interrupt program once.

[0076] The entire running process of the main program will be described in detail below in combination with Figure 2

[0077] Figure 2 is a schematic flowchart of the main program provided by the embodiments of the present application.

[0078] For example, as shown in Figure 2 , the main program in the running process mainly includes the following steps 201-209.

[0079] 201, the MCU is initialized, and the charging detection, the nib pressing detection and the tail pressing detection are turned on.

[0080] The charging detection refers to detecting whether the intelligent writing pen is in a charging state. The nib pressing can be understood as the contact between the nib and the infrared touch screen; the tail pressing can be understood as the contact between the tail and the infrared touch screen. Therefore, the nib pressing detection is to detect whether the nib and the infrared touch screen are in contact, and the tail pressing detection is to detect whether the tail and the infrared touch screen are in contact.

[0081] In the embodiments of the present application, the charging detection, the nib pressing detection and the tail pressing detection are the conditions for triggering the running of the interrupt program. In other words, when any one of the following conditions is detected, i.e. the intelligent writing pen is in a charging state, the nib and the infrared touch screen are in contact, and the tail and the infrared touch screen are in contact, the MCU will switch the currently running program from the main program to the interrupt program. ​

[0082] Initialization is the most basic and important step for all MCUs, which generally includes the following parts:

[0083] All interrupts are masked and the stack pointer is initialized, because no interrupts are expected to occur during the initialization of the general MCU;

[0084] The random access memory (RAM) area of the system and the display memory are cleared, and the initialization of the input / output (IO) interface is performed;

[0085] The initialization of other functional modules, for all peripheral functional modules of the MCU that need to be used, the corresponding settings must be made according to the requirements of the program application, such as the communication of the universal asynchronous receiver / transmitter (UART), which needs to set the baud rate, data length, check mode, etc.

[0086] The initialization of parameters, that is, the initialization settings of some variables and data used in the program.

[0087] The setting of interrupts, for all interrupts that the program needs to use, the trigger conditions of the interrupts should be set and the detection of the trigger conditions of the interrupts should be started, and the redundant interrupts that are not used are closed.

[0088] In the embodiments of the present application, the detections that need to be started include the aforementioned charging detection, stylus tip pressing detection and stylus tail pressing detection.

[0089] For example, for the charging detection, the smart writing pen generally has a charging interface, so the charging detection can be specifically implemented by acquiring the charging interface state.

[0090] Optionally, the charging interface state includes connected and not connected, and specifically when the MCU detects that the charging interface state is connected, the interrupt program starts to run.

[0091] Optionally, the types of the charging interface include a micro universal serial bus (Micro USB) interface, a Type-C interface and a lightning interface. The embodiments of the present application do not limit the type of the charging interface.

[0092] For example, for the tip pressing detection and the tail pressing detection, as known from the foregoing, the level signal of the tip is a low level signal when the tip is in contact with the infrared touch screen, and the level signal of the tip is a high level signal when the tip is not in contact with the infrared touch screen. Therefore, the level signal of the tip being a low level signal can be taken as a running condition of the interrupt program in the embodiment of the application. Similarly, for the tail pressing detection, the level signal of the tail being a low level signal can be taken as a running condition of the interrupt program.

[0093] Through the above process, the MCU can complete the initialization. After the initialization is completed, the MCU can continuously detect the charging interface state, the level signal of the tip and the level signal of the tail in the process of running the main program, so as to determine whether it is necessary to jump to the interrupt program.

[0094] 202, the MCU determines whether it is in an idle mode.

[0095] After the initialization is completed, the MCU first determines whether it is in an idle mode. The idle mode refers to a state in which the MCU does not perform a task, but the detection process of the external interrupt program, the external low-voltage detection circuit, the timer, the analog to digital converter (A / D or ADC), the serial port and the like are still normally operated. The task in the embodiment of the application can be understood as all processes of the interrupt program. Since the MCU starts the detection of the three interrupt trigger conditions in the initialization, the MCU will continuously detect whether the smart writing pen meets the interrupt program trigger condition in the process of running the main program. When the MCU determines that the smart writing pen does not meet the interrupt program trigger condition, it is determined that the MCU currently does not perform the interrupt program and is in the idle mode. Otherwise, the MCU determines that it is not in the idle mode. When the MCU is in the idle mode, the subsequent process of the main program can be continuously performed.

[0096] When the MCU is in the idle mode, step 203 is continuously performed.

[0097] When the MCU is not in the idle mode, the MCU is performing the interrupt program. In this case, the MCU returns to perform step 202, that is, continuously detects whether the MCU is in the idle mode again.

[0098] 203, it is determined whether the smart writing pen is being charged.

[0099] For example, the MCU can determine whether the smart writing pen is being charged through the charging interface state. When the charging interface state is connected, it is determined that the smart writing pen is being charged. When the charging interface state is not connected, it is determined that the smart writing pen is not being charged.

[0100] When the smart writing pen is being charged, step 204 is performed.

[0101] When the smart writing pen is not charging, step 205 is executed.

[0102] 204, a low voltage directive (LVD) is started to obtain the working voltage of the current smart writing pen and refresh it.

[0103] When the smart writing pen is in the charging process, the MCU can detect the working voltage of the current smart writing pen and refresh the working voltage, the purpose is to obtain the latest working voltage, and after refreshing, return to step 203 to continuously detect whether the smart writing pen is fully charged.

[0104] 205, determine whether the working voltage is less than the preset voltage.

[0105] Optionally, the preset voltage is 3V, and it can also be adjusted according to actual needs. The preset voltage is determined based on the working voltage range of the MCU and the working voltage of the infrared emitting tube. In the embodiment of the application, the working voltage range of the MCU is generally 2.6V-5.5V; the working voltage of the infrared emitting tube is generally 2.7V-5V. Through experiments, it is found that for the smart writing pen, when the working voltage is above 3.0V, the smart writing pen can maintain a stable writing state; when the working voltage is less than 3.0V, the writing state of the smart writing pen is unstable, so the preset voltage of the application is set to 3V. In particular, in combination with the working voltage of the infrared emitting tube, when the working voltage of the smart writing pen is less than 2.7V, the smart writing pen cannot emit infrared signals to the infrared touch screen, and needs to be charged in time.

[0106] When the smart writing pen is not in the charging process, the MCU can further compare whether the current working voltage is less than 3V.

[0107] When the working voltage is greater than or equal to 3V, step 206 is executed;

[0108] When the working voltage is less than 3V, steps 207-209 are executed.

[0109] 206, the MCU enters a low-power mode.

[0110] When the working voltage is greater than or equal to 3V, since the MCU has determined to be in idle mode before this step and has not executed an interrupt program, in order to reduce the power consumption of the MCU, the MCU can enter a low-power mode.

[0111] 207, remind by flashing a light-emitting diode (LED), and turn off the tip pressing detection and the tail pressing detection.

[0112] When the working voltage is less than 3V, it indicates that the current smart writing pen is in a low voltage state. At this time, in order to remind the user to charge in time, the MCU can control the LED light on the smart writing pen to flash, and turn off the tip pressing detection and tail pressing detection, so as to avoid the smart writing pen from writing inaccurately in the low voltage state, thereby affecting the user's writing experience.

[0113] 208, the MCU enters an ultra-low power consumption mode.

[0114] After turning off the tip pressing detection and tail pressing detection, in order to reduce the power consumption of the smart writing pen as much as possible, the MCU can enter an ultra-low power consumption mode.

[0115] 209, when the MCU is in a low power consumption mode or an ultra-low power consumption mode, it is judged whether the MCU is woken up.

[0116] In the embodiment of the application, the MCU in the low power consumption mode can start running the interrupt program when detecting that the charging interface state is on, or the level signal of the tip is a low level signal, or the level signal of the tail is a low level signal. That is to say, the interrupt sources of the MCU in the low power consumption mode include the charging interface, the tip level signal and the tail level signal.

[0117] The MCU in the ultra-low power consumption mode can only be woken up by the charging detection, and then start running the interrupt program. That is to say, the interrupt source of the MCU in the ultra-low power consumption mode is only the charging interface.

[0118] The power consumption of the MCU in the low power consumption mode and the ultra-low power consumption mode is very small. The working current of the smart writing pen in the two working modes is less than about 1μA. The main difference between the two working modes is that the number of interrupt sources of the MCU in the low power consumption mode is more than that in the ultra-low power consumption mode. The more the interrupt sources, the greater the probability of the MCU being woken up. Since the wake-up process is essentially the MCU switching from the low power consumption mode or the ultra-low power consumption mode to the normal power consumption mode, the number of interrupt sources in the low power consumption mode is larger, so the power consumption when the low power consumption mode is woken up is greater than that when the ultra-low power consumption mode is woken up.

[0119] When the MCU is woken up, return to step 202.

[0120] Since the MCU is woken up, the MCU jumps from the main program to the interrupt program. Therefore, in the woken-up state, the MCU needs to continuously detect whether the interrupt program is running or not, that is, whether it is in an idle mode.

[0121] When the MCU is not woken up, the MCU continues to be in the ultra-low power consumption mode.

[0122] As can be seen from the above, in the process of running the main program, the MCU will finally enter the low-power mode or the ultra-low-power mode at the end of each loop. The MCU in the ultra-low-power mode can only be woken up by the charging detection, so as to jump to the interrupt program. The MCU in the low-power mode can be woken up by any one of the pen tip pressing detection, the pen tail pressing detection and the charging detection, so as to jump to the interrupt program.

[0123] When the MCU is in the ultra-low-power mode or the low-power mode, after being woken up by the interrupt, the method for intelligent writing provided by the embodiment of the present application can be executed.

[0124] The execution process of the interrupt program is also the specific process of the method for intelligent writing in the embodiment of the present application, which will be described in detail below. Figure 3

[0125] Figure 3 is a schematic flowchart of the method for intelligent writing provided by the embodiment of the present application. It should be understood that the method can be applied to the intelligent writing pen in the embodiment of the present application, and specifically applied to the MCU in the intelligent writing pen.

[0126] For example, as shown in Figure 3 , the method 300 includes:

[0127] 301, determining the contact state between the intelligent writing pen and the infrared touch screen, the contact state including having contacted and not having contacted.

[0128] As can be known from the foregoing description, in the process of running the main program, the running of the interrupt program can be triggered by the state of the charging interface being connected, or the contact between the pen tip and the infrared touch screen, or the contact between the pen tail and the infrared touch screen. However, the connection of the charging interface cannot make the intelligent writing pen realize the writing effect, and only the contact between the pen tip and the infrared touch screen or the contact between the pen tail and the infrared touch screen can make the intelligent writing pen realize the writing effect. Therefore, when the intelligent writing pen is used for writing, it is necessary to first determine the contact state between the intelligent writing pen and the infrared touch screen.

[0129] Optionally, the contact state between the intelligent writing pen and the infrared touch screen includes the contact state between the pen tip and the infrared touch screen or the contact state between the pen tail and the infrared touch screen.

[0130] In the embodiment of the present application, since the pen tip and the infrared touch screen cannot be in contact and the pen tail and the infrared touch screen cannot be in contact when the interrupt program is not running, it is meaningful to determine the contact state between the intelligent writing pen and the infrared touch screen only after the interrupt program starts running.

[0131] ​In a possible implementation, the contact state between the smart writing pen and the infrared touch screen is determined according to the working parameters, and the determination includes:

[0132] During the running of the main program of the smart writing pen, it is determined whether to run the interrupt program of the smart writing pen according to the working parameters.

[0133] In the case of determining to run the interrupt program, the contact state is determined by the interrupt program according to the working parameters.

[0134] For example, as shown in Figure 2 Because the detection process of the interrupt program trigger condition is started during the initialization process of the main program, the MCU can continuously detect the working parameters of the smart writing pen to determine whether the running condition of the interrupt program is met during the running of the main program. When the working parameters meet the running condition of the interrupt program, the interrupt program is called again to determine the contact state between the smart writing pen and the infrared touch screen according to the working parameters.

[0135] According to the foregoing description, it can be known that the running condition of the interrupt program in the embodiment of the application includes any one of the following: the charging interface state is connected, the pen tip contacts the infrared touch screen, and the pen tail contacts the infrared touch screen. Therefore, when it is determined whether to run the interrupt program according to the working parameters, the working parameters specifically include the charging interface state, the first level signal corresponding to the pen tip, and the second level signal corresponding to the pen tail. The charging interface state includes two states: connected and not connected. The first level signal includes a low level signal or a high level signal, and the second level signal includes a low level signal or a high level signal.

[0136] In a possible implementation, it is determined whether to run the interrupt program of the smart writing pen according to the working parameters, and the determination includes:

[0137] In the case that the charging interface state is connected, or the first level signal is a preset level signal, or the second level signal is a preset level signal, it is determined to run the interrupt program.

[0138] In the case that the charging interface state is not connected, and the first level signal is not the preset level signal, and the second level signal is not the preset level signal, it is determined not to run the interrupt program.

[0139] Optionally, the preset level signal is a low level signal.

[0140] For example, as shown in Figure 2The introduction of steps 203-208 in the above method, when the main program is running, the MCU will continue to detect the charging interface state, the first level signal of the pen tip and the second level signal of the pen tail. When the MCU enters the low power consumption mode or the ultra-low power consumption mode, if the MCU obtains that the charging interface state is connected, or the first level signal is a low level signal, or the second level signal is a low level signal, the MCU determines that the smart writing pen meets the jump condition of the interrupt program, that is, jumps from the current main program to the interrupt program.

[0141] On the contrary, when the charging interface state is not connected, and the first level signal is a high level signal, and the second level signal is a high level signal, the MCU determines that the smart writing pen does not meet the jump condition of the interrupt program, that is, continues to run the main program.

[0142] After starting to run the interrupt program, because the working voltage of the smart writing pen is low, the working process of the smart writing pen will be unstable, which affects the writing effect. Therefore, first, the MCU enters the LVD state, obtains the voltage gear of the current working voltage of the smart writing pen, and judges whether the voltage gear of the current working voltage is in the low voltage gear. When the current voltage gear is not in the low voltage gear, it indicates that the working voltage of the smart writing pen can ensure the normal working of the smart writing pen, and in this case, the contact state is further obtained. At the same time, the MCU starts the press filtering processing. The purpose of the press filtering is to ensure the accuracy of the pen tip press detection result or the pen tail press detection result, that is, the key debouncing processing, which will be described in detail later, and will not be described here.

[0143] Among them, the voltage gear of the current working voltage can be understood as the voltage interval in which the current working voltage is located, which will be explained in detail later.

[0144] It should be understood that the power consumption of the MCU is low when it is in the low power consumption mode or the ultra-low power consumption mode. Therefore, the working voltage of the smart writing pen before and after the MCU is interrupted and awakened has little difference. When obtaining the voltage gear of the current working voltage, the MCU can determine it by means of the previous working voltage before entering the low power consumption mode or the ultra-low power consumption mode. Optionally, the working parameter can also include the previous working voltage.

[0145] Based on this, the embodiment of the application can obtain the previous working voltage before the MCU enters the low power consumption mode or the ultra-low power consumption mode.

[0146] In a possible implementation manner, the method further includes:

[0147] During the running of the main program of the smart writing pen, the previous working voltage is obtained and stored before the microcontroller unit enters the low power consumption mode or the ultra-low power consumption mode.

[0148] For example, such as Figure 2 As shown, in each loop of the main program, the MCU can periodically detect and refresh the operating voltage of the smart stylus. This allows the MCU to continuously refresh and acquire the latest operating voltage before entering low-power or ultra-low-power mode. Once the MCU detects that it has entered low-power or ultra-low-power mode, it can acquire and store the most recent operating voltage, i.e., the previous operating voltage.

[0149] As another example, the MCU can also obtain the operating voltage of the smart stylus as the previous operating voltage and store it when it determines that it is about to enter a low-power mode or an ultra-low-power mode.

[0150] Therefore, the MCU can store the previous operating voltage of the smart pen before each entry into low-power mode or ultra-low-power mode.

[0151] After obtaining the previous operating voltage, when the MCU is woken up by an interrupt, it immediately starts the LVD and determines the voltage level of the current operating voltage based on the previous operating voltage, and determines the contact status based on the voltage level of the current operating voltage.

[0152] In one possible implementation, the interrupt routine determines the contact state based on operating parameters, including:

[0153] Based on the previous operating voltage, determine the order in which the current operating voltage is compared with the first threshold and the second threshold, where the second threshold is greater than the first threshold;

[0154] The voltage level corresponding to the current operating voltage is determined by comparing the current operating voltage with the first and second thresholds in sequence.

[0155] The contact state is determined based on the voltage level corresponding to the current operating voltage, or based on the voltage level corresponding to the current operating voltage, and any one of the charging interface status, the first level signal, and the second level signal.

[0156] Based on the operating voltage range of the smart writing pen in this embodiment, when the operating voltage is less than 3V, the smart writing pen performs poorly, and when the operating voltage is less than 2.7V, the smart writing pen cannot work normally, and the MCU will automatically enter ultra-low power mode and wait for the smart writing pen to charge; when the operating voltage is between 3.0V and 3.3V, the smart writing pen has better performance; when the operating voltage is above 3.3V, the smart writing pen has ideal performance.

[0157] According to the different working voltages of the intelligent writing pen, the voltage gears provided in the embodiments of the present application include a first voltage gear, a second voltage gear and a third voltage gear. The first voltage gear is a 3.3V gear, and the corresponding voltage interval is 3.3-5V (determined by the maximum working voltage of the MCU and the maximum working voltage of the infrared emitting tube). The second voltage gear is 3.0V, and the corresponding voltage interval is 3V-3.3V. The third voltage gear is 2.7V, and the corresponding voltage interval is 2.7V-3.0V.

[0158] In the embodiments of the present application, determining the voltage gear of the current working voltage is essentially comparing the current working voltage with the boundary values corresponding to the voltage gears. Specifically, the current working voltage can be compared with 3.3V and 3V respectively to obtain the voltage gear of the current working voltage.

[0159] Therefore, the first threshold value in the embodiments of the present application is 3V, and the second threshold value is 3.3V.

[0160] Since the previous working voltage is close to the current working voltage, when comparing the current working voltage with the first threshold value and the second threshold value to obtain the voltage gear of the current working voltage, in order to improve the efficiency of comparison and reduce the number of comparisons, the MCU can determine the comparison order of the current working voltage and the first threshold value and the second threshold value based on the previous working voltage, and then obtain the voltage gear of the current working voltage through comparison.

[0161] In a possible implementation manner, the order in which the current working voltage is compared with the first threshold value and the second threshold value based on the previous working voltage includes:

[0162] The voltage gear corresponding to the previous working voltage is determined, and the voltage gear includes a first voltage gear, a second voltage gear and a third voltage gear. The first voltage gear indicates that the previous working voltage is greater than or equal to the second threshold value, the second voltage gear indicates that the previous working voltage is greater than the first threshold value and less than the second threshold value, and the third voltage gear indicates that the previous working voltage is less than or equal to the first threshold value.

[0163] In the case where the voltage gear corresponding to the previous working voltage is the first voltage gear, the order is determined as a first order, and the first order is to compare the current working voltage with the second threshold value first, and then compare the current working voltage with the first threshold value.

[0164] In the case where the voltage gear corresponding to the previous working voltage is the second voltage gear, the order is determined as the first order or a second order, and the second order is to compare the current working voltage with the first threshold value first, and then compare the current working voltage with the second threshold value.

[0165] In the case where the voltage gear corresponding to the previous working voltage is the third voltage gear, the order is determined as the second order.

[0166] For example, the MCU can determine the voltage gear corresponding to the previous working voltage by comparing the previous working voltage with the first threshold value and the second threshold value.

[0167] After obtaining the voltage gear of the previous working voltage, there are three scenarios:

[0168] First, the voltage gear of the current working voltage is the first voltage gear, i.e., the previous working voltage is in the voltage interval of 3.3-5V, indicating that the previous working voltage is greater than or equal to 3.3V. Therefore, when determining the voltage gear of the current working voltage, the MCU can preferentially compare the current working voltage with 3.3V which is relatively close, and then compare the current working voltage with 3V which is relatively far, i.e., the first order.

[0169] Second, the voltage gear of the current working voltage is the second voltage gear, i.e., the previous working voltage is in the voltage interval of 3.0-3.3V, indicating that the previous working voltage is greater than 3V and less than 3.3V. In this case, the previous working voltage can be close to 3V or close to 3.3V. The MCU can first compare the current working voltage with 3V and then compare the current working voltage with 3.3V, i.e., the second order, or compare the current working voltage with the first threshold value and the second threshold value according to the first order.

[0170] Third, the voltage gear of the current working voltage is the third voltage gear, i.e., the previous working voltage is in the voltage interval of 2.7-3.0V, indicating that the previous working voltage is less than 3.0V. The MCU can preferentially compare the current working voltage with 3.0V which is relatively close, and then compare the current working voltage with 3.3V which is relatively far, i.e., the second order.

[0171] After determining the comparison order, the MCU can compare the current working voltage with the first threshold value and the second threshold value according to the order to determine the voltage gear corresponding to the current working voltage.

[0172] In a possible implementation, comparing the current working voltage with the first threshold value and the second threshold value according to the order to determine the voltage gear corresponding to the current working voltage includes:

[0173] In the case of the first order, if the current working voltage is greater than or equal to the second threshold value, it is determined that the voltage gear corresponding to the current working voltage is the first voltage gear; if the current working voltage is less than the second threshold value, the current working voltage is compared with the first threshold value; if the current working voltage is less than the first threshold value, it is determined that the voltage gear corresponding to the current working voltage is the third voltage gear; if the current working voltage is greater than or equal to the first threshold value, it is determined that the voltage gear corresponding to the current working voltage is the second voltage gear.

[0174] In the case of the second order, if the current working voltage is greater than or equal to the first threshold value, the current working voltage is compared with the second threshold value; if the current working voltage is less than the second threshold value, the voltage gear of the current working voltage is determined as the second voltage gear; if the current working voltage is greater than or equal to the second threshold value, the voltage gear of the current working voltage is determined as the first voltage gear; if the current working voltage is less than the first threshold value, the voltage gear of the current working voltage is determined as the third voltage gear.

[0175] According to the different orders of comparison between the determined current working voltage and the first threshold value and the second threshold value, the comparison processes corresponding to the first order and the second order are discussed respectively.

[0176] In the first case, when the comparison order is the first order, i.e., the second threshold value is compared first and then the first threshold value is compared. After the MCU obtains the current working voltage, the current working voltage is compared with 3.3V first to determine the comparison result. If the current working voltage is greater than 3.3V, the MCU can directly determine that the current working voltage is in the voltage interval of 3.3-5V, i.e., the voltage gear of the current working voltage is the first voltage gear, and it is not necessary to compare the current working voltage with 3V again. If the current working voltage is less than 3.3V, the current working voltage can be in the second voltage gear or in the third voltage gear, so the MCU needs to compare the current working voltage with 3.0V again. If the current working voltage is greater than 3.0V, it indicates that the current working voltage is in the voltage interval of 3.0-3.3V, i.e., the voltage gear of the current working voltage is the second voltage gear; if the current working voltage is less than 3.0V, it indicates that the current working voltage is in the voltage interval of 2.7-3.0V, i.e., the voltage gear of the current working voltage is the third voltage gear.

[0177] In the second case, when the comparison order is the second order, i.e., the first threshold value is compared first and then the second threshold value is compared. After the MCU obtains the current working voltage, the current working voltage is compared with 3V first to determine the comparison result. If the current working voltage is less than 3V, the MCU can directly determine that the current working voltage is in the voltage interval of 2.7-3V, i.e., the voltage gear of the current working voltage is the third voltage gear, and it is not necessary to compare the current working voltage with 3.3V again. If the current working voltage is greater than or equal to 3V, the current working voltage can be in the first voltage gear or in the second voltage gear, so the MCU needs to compare the current working voltage with 3.3V again. If the current working voltage is greater than 3.3V, it indicates that the current working voltage is in the voltage interval of 3.3-5V, i.e., the voltage gear of the current working voltage is the first voltage gear; if the current working voltage is less than 3.3V, it indicates that the current working voltage is in the voltage interval of 3.0-3.3V, i.e., the voltage gear of the current working voltage is the second voltage gear.

[0178] Therefore, when the MCU determines the voltage gear of the current working voltage, since the difference between the previous working voltage and the current working voltage is small in general, the MCU only needs to compare the current working voltage with the closest threshold value once in most cases, so as to determine the voltage gear of the current working voltage.

[0179] In the technical solution, the MCU can be woken up to execute the interrupt program in the low-power mode or the ultra-low-power mode. Since the power consumption of the low-power mode and the ultra-low-power mode is low, the current working voltage is generally close to the previous working voltage. When the voltage gear of the current working voltage is determined, the current working voltage is compared with the boundary values of different voltage gears. In order to improve the determination efficiency and reduce the number of comparisons between the current working voltage and the boundary values, the application can obtain the comparison order between the current working voltage and the first threshold value and the second threshold value by means of the voltage gear of the previous working voltage, and then determine the voltage gear of the current working voltage by comparison, which includes the following cases.

[0180] In the first case, the voltage gear corresponding to the previous working voltage is the first voltage gear, which indicates that the previous working voltage is close to the second threshold value. Therefore, the current working voltage is compared with the second threshold value preferentially. If the current working voltage is greater than the second threshold value, the voltage gear of the current working voltage is obtained. If the current working voltage is less than the second threshold value, the current working voltage is compared with the first threshold value, and the voltage gear of the current working voltage is obtained.

[0181] In the second case, the voltage gear corresponding to the previous working voltage is the second voltage gear, which indicates that the previous working voltage is greater than the first threshold value and less than the second threshold value. In this voltage gear, the previous working voltage can be closer to the first threshold value or the second threshold value. Therefore, whether the current working voltage is compared with the second threshold value first or the first threshold value first, the voltage gear of the current working voltage can be determined by at most two comparisons.

[0182] In the third case, the voltage gear corresponding to the previous working voltage is the third voltage gear, which indicates that the previous working voltage is closer to the first threshold value and has a large difference from the second threshold value. Therefore, the current working voltage is compared with the first threshold value preferentially. If the current working voltage is less than or equal to the first threshold value, the voltage gear of the current working voltage is obtained. If the current working voltage is greater than the first threshold value, the current working voltage is compared with the second threshold value, and the voltage gear of the current working voltage is obtained.

[0183] Therefore, when the voltage gears of the previous working voltage are different, the comparison order is adjusted flexibly, so that the voltage gear of the current working voltage can be obtained by comparing the current working voltage with the threshold value preferentially only once in most cases, and the determination efficiency of the current voltage gear is improved.

[0184] After determining the voltage gear corresponding to the current working voltage, the MCU can further determine the contact state in combination with the voltage gear corresponding to the current working voltage, the charging interface state, the first level signal and the second level signal.

[0185] In a possible implementation, the contact state is determined according to the voltage gear corresponding to the current working voltage, or according to the voltage gear corresponding to the current working voltage and at least one of the charging interface state, the first level signal and the second level signal, and includes:

[0186] In a case where the voltage gear corresponding to the current working voltage is the third voltage gear, the contact state is determined as not contacted and the interrupt program is exited.

[0187] In a case where the voltage gear corresponding to the current working voltage is the first voltage gear or the second voltage gear, if the charging interface state is connected, the contact state is determined as not contacted.

[0188] In a case where the voltage gear corresponding to the current working voltage is the first voltage gear or the second voltage gear, if the first level signal is a preset level signal or the second level signal is a preset level signal, the contact state is determined as contacted.

[0189] When the voltage gear corresponding to the current working voltage is the third voltage gear, the current working voltage is less than 3V, and the smart writing pen is in a low-voltage state, to ensure the stability of the smart writing pen in the writing process, the MCU can directly control the MCU to exit the current interrupt program, that is, to return to the main program again. Since the interrupt program is not successfully run when the current working voltage is low, in this case, the smart writing pen and the infrared touch screen are not contacted.

[0190] It should be understood that, in the embodiments of the present application, the exiting of the current interrupt program to return to the main program again specifically means that the MCU returns to the idle mode and continues to run the main program according to the flow of the main program.

[0191] When the voltage gear corresponding to the current working voltage is the second voltage gear or the first voltage gear, the voltage of the current smart writing pen is relatively high, which can ensure the stability in the writing process. In this case, the MCU can continue to run the interrupt program.

[0192] Since the jump of the interrupt program corresponds to three trigger conditions, that is, the charging interface state, the first level signal corresponding to the pen tip and the second level signal corresponding to the pen tail. When the interrupt program starts to run, it is not clear which trigger condition triggers. Therefore, after the interrupt program starts to run, the interrupt program needs to determine which trigger condition causes the jump, so as to determine the contact state between the smart writing pen and the infrared touch screen.

[0193] When the charging interface state is on, it indicates that the current running of the interrupt program is triggered by the charging of the smart writing pen, and thus there is no contact between the smart writing pen and the infrared touch screen.

[0194] In the case of determining that there is no contact between the smart writing pen and the infrared touch screen, the MCU exits the interrupt program and re-starts the nib pressing detection and the tail pressing detection, so as to be able to timely detect the contact state between the tail or the nib and the infrared touch screen.

[0195] When the first level signal is a preset level signal (low level signal), it indicates that the current running of the interrupt program is triggered by the contact between the nib and the infrared touch screen, and thus the MCU can determine that there is contact between the smart writing pen and the infrared touch screen.

[0196] Similarly, when the second level signal is a preset level signal, it indicates that the current running of the interrupt program is triggered by the contact between the tail and the infrared touch screen, and thus the MCU can determine that there is contact between the smart writing pen and the infrared touch screen.

[0197] In addition, the running of the interrupt program can also be caused by program failure or program exception, although the interrupt program starts to run, but the charging interface state can be off, the first level signal can be a high level signal, and the second level signal can be a high level signal, and thus in this case, the MCU can also determine that there is no contact between the smart writing pen and the infrared touch screen.

[0198] Thus, through the above process, the MCU can determine which detection triggers the interrupt program when the interrupt program runs, and thus correspondingly determine the contact state between the smart writing pen and the infrared touch screen based on the working parameters of the smart writing pen.

[0199] 302. In the case of the contact state being contacted, the target infrared emission signal of the smart writing pen is determined according to the working parameters of the smart writing pen, and the target infrared emission signal is used to represent the stroke parameters of the smart writing pen in the writing process.

[0200] When the MCU determines that there is contact between the smart writing pen and the infrared touch screen through the above step 301, it indicates that the user currently has a writing demand, and thus the MCU can further determine the target infrared emission signal of the smart writing pen according to the working parameters of the smart writing pen, and the target emission signal represents the stroke parameters of the smart writing pen, i.e. which form of stroke needs to be displayed in the writing process, such as which color or which stroke type of stroke, the stroke type can include line types such as dashed line and solid line, and can also include virtual real pen types such as brush, pen and marker.

[0201] It should be understood that during the user writes with the smart writing pen, there can also be a user mis-touch situation, therefore, in order to prevent the user mis-touch phenomenon in determining the contact between the smart writing pen and the infrared touch screen, the MCU can also perform press filtering processing on the results of the pen tip press detection or the pen tail press detection.

[0202] The filtering processing described above can be understood as key debounce processing. Key debounce, as the name implies, is to eliminate the key bounce. Key debounce refers to the fact that due to the elastic effect of the contact, a key switch will not be immediately and stably connected when closed, and will not be immediately disconnected when disconnected. Thus, there is a series of bounces at the moment of closing and disconnecting. The measure taken to prevent this phenomenon is key debounce.

[0203] Specifically, in the key debounce process of the embodiments of the present application, a processing duration is usually set, that is, the state of the key (i.e. low level signal or high level signal) in a stable duration is read to accurately determine the state of the key.

[0204] In a possible implementation, before determining the target infrared emission signal of the smart writing pen according to the working parameter of the smart writing pen, the method further includes:

[0205] obtaining a first duration in which the first level signal is a preset level signal or a second duration in which the second level signal is a preset level signal, the first level signal being a level signal corresponding to the pen tip of the smart writing pen, and the second level signal being a level signal corresponding to the pen tail of the smart writing pen;

[0206] In a case where the first duration is greater than or equal to a preset duration or the second duration is greater than or equal to the preset duration, it is determined that the smart writing pen enters a writing state.

[0207] Optionally, the preset duration is 15 ms, and the length of the preset duration can also be adjusted according to actual conditions, and the specific value of the preset duration is not limited in the embodiments of the present application.

[0208] Specifically, when it is determined that the smart writing pen is in contact with the infrared touch screen, there are two cases: one is that the pen tip is in contact with the infrared touch screen, and the other is that the pen tail is in contact with the infrared touch screen. Since the pen tip and the pen tail correspond to a key respectively, key debounce processing can be performed for different contact situations.

[0209] When the pen tip is in contact with the infrared touch screen, the first level signal of the pen tip is a low level signal, and the MCU can further acquire a first time length during which the first level signal is a low level signal, and compare the first time length with a pre-set debounce time length (i.e. a preset time length). When the first time length is greater than or equal to the preset time length, it is indicated that the pen tip is not in false contact with the infrared touch screen, and the writing state can be entered. On the contrary, when the first time length is less than the preset time length, it is indicated that the pen tip is in false contact with the infrared touch screen, the MCU exits the interrupt program, and enters an idle mode to switch to the main program and continue to execute the main program.

[0210] Similarly, when the pen tail is in contact with the infrared touch screen, the second level signal of the pen tail is a low level signal, and the MCU can further acquire a second time length during which the second level signal is a low level signal, and compare the second time length with a pre-set debounce time length (i.e. a preset time length). When the second time length is greater than or equal to the preset time length, it is indicated that the pen tail is not in false contact with the infrared touch screen, and the writing state can be entered. On the contrary, when the second time length is less than the preset time length, it is indicated that the pen tail is in false contact with the infrared touch screen, the MCU exits the interrupt program, and enters an idle mode to switch to the main program and continue to execute the main program.

[0211] In the above technical solution, when the smart writing pen is in contact with the infrared touch screen, if the pen tip is in contact with the infrared touch screen, the application can further acquire a first time length during which the first level signal of the pen tip is a pre-set level signal, and compare the first time length with a pre-set time length, to determine whether the current contact is a false contact of the pen tip. When the first time length is greater than the preset time length, it is indicated that the pen tip is not in false contact. Similarly, if the pen tail is in contact with the infrared touch screen, the application can further acquire a second time length during which the second level signal of the pen tail is a pre-set level signal, and when the second time length is greater than the preset time length, it is indicated that the current pen tail is not in false contact. The above process ensures the accuracy during writing by the pen tip or the pen tail.

[0212] After the smart writing pen determines to enter the writing state through the key debounce processing, the smart writing pen can interact with the infrared touch screen through the infrared emission signal.

[0213] Specifically, in the writing state, the MCU can determine a target infrared emission signal between the smart writing pen and the infrared touch screen according to the working parameters of the smart writing pen.

[0214] In a possible implementation manner, the target infrared emission signal of the smart writing pen is determined according to the working parameters of the smart writing pen, including:

[0215] The target identification of the smart writing pen is determined according to the working parameters, and the target identification is used to represent a function or a handwriting color of a writing track of the smart writing pen in the writing process.

[0216] According to the target identification, the target infrared emission signal is determined.

[0217] In the embodiments of the present application, the pen tip or the pen tail can realize different functions in the process of contacting the infrared touch screen. For example, when the pen tip contacts the infrared touch screen, different color texts can be written, and when the pen tail contacts the infrared touch screen, corresponding auxiliary functions such as erasing, highlighting, and bold display can be realized.

[0218] In order to realize the above-mentioned effects of the intelligent writing pen, a unique identification can be defined for each function. When the intelligent writing pen contacts the infrared touch screen, the current target identification can be obtained to determine the current writing requirement and further determine the corresponding target infrared emission signal.

[0219] In the above technical solution, in the present application, different identifications of the intelligent writing pen represent different writing requirements, such as erasing, highlighting, displaying red texts, and displaying green texts. In the process of determining the target infrared emission signal, the present application can identify the current target identification of the intelligent writing pen to determine the writing function or the writing trace color of the intelligent writing pen, so that the target infrared emission signal can be obtained according to the target identification, and the target infrared emission signal can be closely related to the writing requirement of the user, further ensuring the accuracy of the infrared touch screen in display.

[0220] In the process of determining the target identification of the intelligent writing pen, in combination with the structure of the aforementioned intelligent writing pen, it can be known that the intelligent writing pen is installed with a dial switch, and the dial switch corresponds to two positions of disconnection and connection. When disconnected, the contact state of the dial switch is 0, and when connected, the contact state of the dial switch is 1.

[0221] In the embodiments of the present application, multiple dial switches can be installed on the pen tip and the pen tail of the intelligent writing pen. When there are multiple dial switches, multiple contact states can be freely combined. Each combination of the contact state corresponds to an ID to realize different functions through the pen tip or the pen tail.

[0222] Therefore, in the embodiments of the present application, the MCU can determine the ID of the current intelligent writing pen, that is, the target identification, according to the contact state of the current dial switch.

[0223] In a possible implementation manner, the working parameter includes a contact state of a dial switch installed on the intelligent writing pen and a level signal of the intelligent writing pen, the contact state is used to indicate that the dial switch is disconnected or connected, the dial switch includes a first dial switch corresponding to the pen tip and a second dial switch corresponding to the pen tail, the level signal includes a first level signal corresponding to the pen tip or a second level signal corresponding to the pen tail, and according to the working parameter, the target identification of the intelligent writing pen is determined, including:

[0224] In a case that the first level signal is the preset level signal, the target identification is determined according to the first on state of the first dial switch; or,

[0225] In a case that the second level signal is the preset level signal, the target identification is determined according to the second on state of the second dial switch.

[0226] For example, in the embodiment of the present application, the dial switch corresponding to the pen tip is the first dial switch, and the dial switch corresponding to the pen tail is the second dial switch. Since the functions realized by the pen tip and the pen tail are different, the ID determined by the on state of the first dial switch is also different from the ID determined by the on state of the second dial switch.

[0227] For the on state of each dial switch in the embodiment of the present application, the MCU can measure the voltage of each dial switch through the ADC, and determine whether the on state of the dial switch is open or closed according to the voltage.

[0228] For example, assuming that the first dial switch is dial switch 1 and dial switch 2, the combination of the on state has four kinds, which are 00, 01, 10 and 11, each combination can be configured to correspond to different IDs, and each ID corresponds to a handwriting color. When the pen tip contacts the infrared touch screen, the MCU can determine the handwriting color during current writing according to the determined ID. Assuming that the second dial switch is dial switch 3 and dial switch 4, the combination of the on state also has four kinds, which are 00, 01, 10 and 11, each combination can be configured to correspond to different IDs, and each ID corresponds to an editing text function, for example, 00 corresponds to inclined display, 01 corresponds to highlighted display, 10 corresponds to bold display, and 11 corresponds to underlined display. When the pen tail contacts the infrared touch screen, the MCU can determine the corresponding editing text function according to the determined ID.

[0229] In the technical solution, the tip and the tail of the intelligent writing pen have certain writing functions, for example, the tip can be used to write text, and the tail can be used to erase text and highlight text. Either the tip or the tail corresponds to multiple marks, and each mark is used to realize different functions. For example, each mark of the multiple marks of the tip represents a different color, and each mark of the multiple marks of the tail can realize different functions, such as erasing and highlighting. The application can determine the target mark by installing a first dial switch and a second dial switch on the tip and the tail, respectively. Specifically, the application can first determine whether the tip or the tail contacts the infrared touch screen through the level signal of the tip or the level signal of the tail. When the tip contacts the infrared touch screen, the application can determine the target mark through the first on state of the first dial switch corresponding to the tip. Conversely, when the tail contacts the infrared touch screen, the application can determine the target mark through the second on state of the second dial switch corresponding to the tail. The above process can ensure that the infrared touch screen can realize functions that match the needs of the user, regardless of whether the user uses the tip or the tail, and the accuracy of target mark identification can be ensured based on the dial switch.

[0230] For the intelligent writing pen, different marks correspond to different functions, and the infrared signal is in the form of a binary signal in the MCU. Therefore, the technical personnel in the embodiment of the application can pre-configure and store the correspondence between different marks and different binary signals corresponding to the infrared emission signal. After the target mark is determined, the MCU can determine the target binary signal corresponding to the target infrared emission signal based on the correspondence between the target mark and the multiple binary signals, and further obtain a series of pulse train signals by encoding and modulating the target binary signal, i.e., obtain the target infrared emission signal.

[0231] Through the above step 302, the MCU can determine the target infrared emission signal to be sent.

[0232] 303, the target infrared emission signal is sent to the infrared touch screen, so that the infrared touch screen displays text corresponding to the handwriting parameter on the infrared touch screen based on the target infrared emission signal.

[0233] It should be understood that, in the working process of the intelligent writing pen, the power of the writing pen is usually controlled to remain in a relatively stable range to ensure the stability of the working of the intelligent writing pen.

[0234] Since the working voltage of the intelligent writing pen changes, the MCU can select a suitable emission channel to send the target infrared emission signal according to the different working voltages under the condition that the power is relatively constant.

[0235] In a possible implementation, the target infrared emission signal is sent to the infrared touch screen, including:

[0236] According to the current working voltage, a target emission channel corresponding to the target infrared emission signal is determined.

[0237] The target infrared emission signal is sent to the infrared touch screen through the target emission channel.

[0238] The target emission channel is a target infrared emission tube, and is configured to emit an infrared signal.

[0239] Specifically, since the power of the smart writing pen is relatively constant, the application can preset a plurality of infrared emission tubes under different currents in the smart writing pen according to different working voltages of the smart writing pen.

[0240] For example, according to several different voltage gears provided by the application, the first infrared emission tube can be set to correspond to the first voltage gear, and the second infrared emission tube can be set to correspond to the second voltage gear. Since the power of the smart writing pen is relatively constant, the current of the first infrared emission tube is lower than that of the second infrared emission tube.

[0241] After obtaining the current working voltage and determining the voltage gear of the current working voltage, the MCU can determine the corresponding target infrared emission channel based on the voltage gear.

[0242] After obtaining the current working voltage, the MCU can select a target infrared emission tube matched with the current working voltage based on the relationship among power, voltage and current, so as to send the target infrared emission signal to the infrared touch screen through the target infrared emission tube.

[0243] In the above technical solution, in order to maintain the stability of the smart writing pen during writing, the application can control the smart writing pen to always work at a constant power. When the current working voltage of the smart writing pen is determined, the application can determine the target emission channel based on the constant power and the current working voltage.

[0244] Since the target infrared emission signal is one-to-one corresponding to the ID of the smart writing pen, when the infrared touch screen receives the infrared emission signal, the current ID can be identified through the corresponding relationship between the pre-stored ID and the emission signal, and the handwriting corresponding to the current ID function can be displayed on the display area.

[0245] In order to facilitate understanding of the execution process of the interrupt program, the following will be described by taking the smart writing pen as an example. Figure 4 The whole process of the interrupt program will be described in detail.

[0246] Figure 4 is a schematic flowchart of the execution of the interrupt program provided by the application.

[0247] As shown in the example, Figure 4 The execution process of the interrupt program includes the following steps 401-411.

[0248] 401, the MCU in the low-power mode or the ultra-low-power mode is woken up by the interrupt and jumps to the interrupt program.

[0249] 402, the LVD is started to acquire the current working voltage, the previous working voltage, and the key is started to be dithered, and the voltage gear of the current working voltage is determined according to the previous working voltage.

[0250] 403, it is judged whether the voltage gear of the current working voltage is the third voltage gear.

[0251] When the voltage gear of the current working voltage is the third voltage gear, step 404 is executed;

[0252] When the voltage gear of the current working voltage is not the third voltage gear, step 405 is executed.

[0253] 404, the MCU enters the idle mode, that is, exits the interrupt program and resumes to the main program.

[0254] 405, it is judged whether the charging interface state of the smart writing pen is connected.

[0255] When the charging interface state is connected, step 406 is executed;

[0256] When the charging interface state is not connected, step 407 is executed.

[0257] 406, the tip pressing detection and the tail pressing detection are started, and the current interrupt program is exited and resumed to the main program.

[0258] 407, it is judged whether it is tip pressing or tail pressing, that is, whether the first level signal of the tip is a low-level signal or the second level signal of the tail is a low-level signal.

[0259] When the first level signal is a high-level signal and the second level signal is a high-level signal, step 404 is executed;

[0260] When the first level signal is a low-level signal or the second level signal is a low-level signal, step 408 is executed.

[0261] 408, it is judged whether the current tip pressing or tail pressing is a false touch through the first duration of the first level signal being a low-level signal or the second duration of the second level signal being a low-level signal.

[0262] When the pen tip pressing or the pen tail pressing is not a false touch, steps 409-412 are performed;

[0263] When the pen tip pressing or the pen tail pressing is a false touch, the step 404 is returned to.

[0264] 409. The target identifier is determined according to the on state of the dial switch.

[0265] 410. The target infrared emission signal is determined according to the target identifier.

[0266] 411. The target emission channel is determined according to the current working voltage.

[0267] 412. The target infrared emission signal is sent to the infrared touch screen through the target emission channel.

[0268] The steps 401-412 described above have the same inventive concept as the steps 301-303 in the method 300, and details can be referred to the steps 301-303, which will not be repeated here.

[0269] Figure 5 is a structural schematic diagram of a device for intelligent writing provided by an embodiment of the present application.

[0270] As shown in the example of Figure 5 , the device 500 includes:

[0271] The state determination module 501 is configured to determine a contact state between the intelligent writing pen and the infrared touch screen, the contact state including having contacted and not having contacted.

[0272] The signal determination module 502 is configured to, when the contact state is having contacted, determine a target infrared emission signal of the intelligent writing pen according to a working parameter of the intelligent writing pen, the target infrared emission signal being used to represent a handwriting parameter of the intelligent writing pen in a writing process.

[0273] The signal sending module 503 is configured to send the target infrared emission signal to the infrared touch screen, so that the infrared touch screen displays a text corresponding to the handwriting parameter based on the target infrared emission signal.

[0274] In a possible implementation manner, the signal determination module 502 is specifically configured to: determine a target identifier of the intelligent writing pen according to the working parameter, the target identifier being used to represent a function or a handwriting color of a writing track of the intelligent writing pen in the writing process; and determine the target infrared emission signal according to the target identifier.

[0275] In a possible implementation, the working parameter includes a turn-on state of a dial switch installed on the smart writing pen and a level signal of the smart writing pen, the turn-on state is used to indicate that the dial switch is open or closed, the dial switch includes a first dial switch corresponding to the pen nib and a second dial switch corresponding to the pen tail, and the level signal includes a first level signal corresponding to the pen nib or a second level signal corresponding to the pen tail. The signal determination module 502 is further configured to: in a case where the first level signal is a preset level signal, determine the target identifier according to a first turn-on state of the first dial switch; or in a case where the second level signal is the preset level signal, determine the target identifier according to a second turn-on state of the second dial switch.

[0276] In a possible implementation, the working parameter includes a current working voltage, and the signal sending module 503 is further configured to: determine a target emission channel corresponding to the target infrared emission signal according to the current working voltage; and send the target infrared emission signal to the infrared touch screen through the target emission channel.

[0277] In a possible implementation, the state determination module 501 is specifically configured to: in a process in which a main program of the smart writing pen is running, determine whether to run an interrupt program of the smart writing pen according to the working parameter; and in a case where it is determined to run the interrupt program, determine the contact state by the interrupt program according to the working parameter.

[0278] In a possible implementation, the working parameter includes any one of a charging interface state of the smart writing pen, a first level signal corresponding to a pen nib of the smart writing pen, and a second level signal corresponding to a pen tail of the smart writing pen. The state determination module 501 is further configured to: in a case where the charging interface state is turned on, or the first level signal is a preset level signal, or the second level signal is the preset level signal, determine to run the interrupt program; and in a case where the charging interface state is not turned on, and the first level signal is not the preset level signal, and the second level signal is not the preset level signal, determine not to run the interrupt program.

[0279] In a possible implementation, the working parameter includes a previous working voltage, a current working voltage, a charging interface state, a first level signal corresponding to a pen tip of the smart writing pen, and a second level signal corresponding to a pen tail, the previous working voltage is a working voltage before the micro control unit enters a low power consumption mode or before the micro control unit enters an overdue power consumption mode, and the state determination module 501 is further configured to: determine, based on the previous working voltage, an order in which the current working voltage is compared with a first threshold value and a second threshold value, the second threshold value being greater than the first threshold value; compare the current working voltage with the first threshold value and the second threshold value in the order, and determine a voltage gear corresponding to the current working voltage; and determine the contact state according to the voltage gear corresponding to the current working voltage, or according to the voltage gear corresponding to the current working voltage and any one of the charging interface state, the first level signal, and the second level signal.

[0280] In a possible implementation, the state determination module 501 is further configured to: determine a voltage gear corresponding to the previous working voltage, the voltage gear including a first voltage gear, a second voltage gear, and a third voltage gear, the first voltage gear indicating that the previous working voltage is greater than or equal to the second threshold value, the second voltage gear indicating that the previous working voltage is greater than the first threshold value and less than the second threshold value, and the third voltage gear indicating that the previous working voltage is less than or equal to the first threshold value; in a case where the voltage gear corresponding to the previous working voltage is the first voltage gear, determine the order as a first order, the first order being to compare the current working voltage with the second threshold value first and then compare the current working voltage with the first threshold value; in a case where the voltage gear corresponding to the previous working voltage is the second voltage gear, determine the order as the first order or a second order, the second order being to compare the current working voltage with the first threshold value first and then compare the current working voltage with the second threshold value; and in a case where the voltage gear corresponding to the previous working voltage is the third voltage gear, determine the order as the second order.

[0281] In a possible implementation, the state determining module 501 is further configured to: in the case where the sequence is the first sequence, if the current working voltage is greater than or equal to the second threshold value, determining that the voltage gear corresponding to the current working voltage is the first voltage gear; if the current working voltage is less than the second threshold value, comparing the current working voltage with the first threshold value; if the current working voltage is less than the first threshold value, determining that the voltage gear corresponding to the current working voltage is the third voltage gear; if the current working voltage is greater than or equal to the first threshold value, determining that the voltage gear corresponding to the current working voltage is the second voltage gear; in the case where the sequence is the second sequence, if the current working voltage is greater than or equal to the first threshold value, comparing the current working voltage with the second threshold value; if the current working voltage is less than the second threshold value, determining that the voltage gear of the current working voltage is the second voltage gear; if the current working voltage is greater than or equal to the second threshold value, determining that the voltage gear of the current working voltage is the first voltage gear; if the current working voltage is less than the first threshold value, determining that the voltage gear of the current working voltage is the third voltage gear.

[0282] In a possible implementation, the state determining module 501 is further configured to: in the case where the voltage gear corresponding to the current working voltage is the third voltage gear, determining that the contact state is not contacted and exiting the interrupt program; in the case where the voltage gear corresponding to the current working voltage is the first voltage gear or the second voltage gear, if the charging interface state is connected, determining that the contact state is contacted; in the case where the voltage gear corresponding to the current working voltage is the first voltage gear or the second voltage gear, if the first level signal is a preset level signal or the second level signal is the preset level signal, determining that the contact state is contacted.

[0283] Optionally, the apparatus further includes a voltage storage module configured to acquire and store the previous working voltage before the microcontroller unit enters the low-power consumption mode or enters the ultra-low-power consumption mode during running of a main program of the smart writing pen.

[0284] Optionally, before determining the target infrared emission signal of the smart writing pen according to the working parameter of the smart writing pen, the apparatus further includes a level signal acquisition module configured to acquire a first time length during which a first level signal is a preset level signal or a second time length during which a second level signal is the preset level signal, the first level signal being a level signal corresponding to a pen tip of the smart writing pen, and the second level signal being a level signal corresponding to a pen tail of the smart writing pen; and in the case where the first time length is greater than or equal to a preset time length or the second time length is greater than or equal to the preset time length, determining that the smart writing pen enters a writing state.

[0285] Figure 6Fig. 1 is a structural schematic diagram of an electronic device provided by an embodiment of the present application.

[0286] As shown in Fig. 6, the electronic device 600 includes a memory 601 and a processor 602, wherein the memory 601 stores executable program code 6011, and the processor 602 is configured to invoke and execute the executable program code 6011 to execute a method of intelligent writing. Figure 6

[0287] The embodiment can divide the functional modules of the electronic device according to the above method examples, for example, each functional module can be provided, or two or more functions can be integrated in one processing module, and the integrated module can be implemented in the form of hardware. It should be noted that the division of the modules in the embodiment is illustrative, and is only a logical functional division, and another division mode can be used in actual implementation.

[0288] In the case of dividing each functional module according to each function, the electronic device can include a state acquisition module, a signal determination module, a signal sending module, and the like. It should be noted that all related contents of each step involved in the above method embodiments can be referred to the function description of the corresponding functional module, and will not be repeated here.

[0289] The electronic device provided by the embodiment is used to execute the above method of intelligent writing, and thus the same effect as the above implementation method can be achieved.

[0290] In the case of using an integrated unit, the electronic device can include a processing module and a storage module. The processing module can be used to control and manage the actions of the electronic device. The storage module can be used to support the electronic device to execute related program codes and data.

[0291] The processing module can be a processor or a controller, which can implement or execute various exemplary logical blocks, modules and circuits shown in combination with the disclosure of the present application. The processor can also be a combination of computing functions, such as one or more microprocessor combinations, digital signal processing (DSP) and microprocessor combinations, etc. The storage module can be a memory.

[0292] The embodiment further provides a computer readable storage medium, which stores computer program code, when the computer program code is run on a computer, the computer program code causes the computer to execute the above related method steps to implement the method of intelligent writing in the above embodiment.

[0293] ​The embodiment also provides a computer program product, which, when running on a computer, causes the computer to execute the above related steps to implement the method of intelligent writing in the above embodiment.

[0294] In addition, the electronic device provided by the embodiment of the present application can be a chip, a component or a module, and the electronic device can include a connected processor and a memory; the memory is used to store instructions, and the processor can invoke and execute the instructions when the electronic device is running, so that the chip executes the method of intelligent writing in the above embodiment.

[0295] The electronic device, the computer readable storage medium, the computer program product or the chip provided by the embodiment can be used to execute the corresponding method provided above, and thus the beneficial effects achieved thereby can refer to the beneficial effects of the corresponding method provided above, which will not be described here again.

[0296] Through the description of the above embodiments, those skilled in the art can understand that, for the convenience and brevity of description, only the above division of functional modules is taken as an example for illustration, and in actual application, the above functions can be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.

[0297] In the embodiments provided by the present application, it should be understood that the disclosed device and method can be implemented by other ways. For example, the device embodiment described above is only schematic, for example, the division of the modules or units is only a logical function division, and other division manners can be adopted in actual implementation, for example, a plurality of units or components can be combined or integrated into another device, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some interfaces, devices or units, and can be electrical, mechanical or other forms.

[0298] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto, and any person skilled in the art can easily think of changes or replacements within the technical range disclosed by the present application, which should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A method for intelligent writing, characterized in that, The method includes: Determine the contact state between the smart writing pen and the infrared touchscreen, the contact state including contacted and uncontacted; When the contact state is "contacted", the target infrared emission signal of the smart writing pen is determined according to the working parameters of the smart writing pen. The target infrared emission signal is used to represent the handwriting parameters of the smart writing pen during the writing process. The target infrared emission signal is sent to the infrared touch screen so that the infrared touch screen displays the text corresponding to the handwriting parameters based on the target infrared emission signal.

2. The method according to claim 1, characterized in that, The step of determining the target infrared emission signal of the smart writing pen based on its operating parameters includes: Based on the operating parameters, a target identifier for the smart writing pen is determined. The target identifier is used to represent the function of the smart writing pen during the writing process or the color of the writing trajectory. The infrared emission signal of the target is determined based on the target identifier.

3. The method according to claim 2, characterized in that, The operating parameters include the on / off state of the DIP switch installed on the smart writing pen and the level signal of the smart writing pen. The on / off state indicates whether the DIP switch is open or closed. The DIP switch includes a first DIP switch corresponding to the pen tip and a second DIP switch corresponding to the pen tail. The level signal includes a first level signal corresponding to the pen tip or a second level signal corresponding to the pen tail. Determining the target identifier of the smart writing pen based on the operating parameters includes: When the first level signal is a preset level signal, the target identifier is determined according to the first on / off state corresponding to the first DIP switch; or... When the second level signal is the preset level signal, the target identifier is determined according to the second on state corresponding to the second DIP switch.

4. The method according to claim 1, characterized in that, The operating parameters include the current operating voltage, and sending the target infrared emission signal to the infrared touchscreen includes: Based on the current operating voltage, determine the target transmission channel corresponding to the target infrared emission signal; The target infrared emission signal is sent to the infrared touchscreen through the target emission channel.

5. The method according to claim 1, characterized in that, Determining the contact state between the smart writing pen and the infrared touchscreen includes: During the main program execution of the smart writing pen, the system determines whether to run the smart writing pen's interrupt routine based on the operating parameters. If it is determined that the interrupt routine will be run, the interrupt routine will determine the contact state based on the operating parameters.

6. The method according to claim 5, characterized in that, The operating parameters include any one of the following: the charging interface status of the smart writing pen, a first level signal corresponding to the pen tip, and a second level signal corresponding to the pen tail. Determining whether to run the smart writing pen's interrupt program based on the operating parameters includes: If the charging interface is in the ON state, or if the first level signal is a preset level signal, or if the second level signal is the preset level signal, then the interrupt program is determined to run. If the charging interface is not connected, and the first level signal is not the preset level signal, and the second level signal is not the preset level signal, then the interrupt program will not be executed.

7. The method according to claim 5, characterized in that, The operating parameters include the previous operating voltage, the current operating voltage, the charging interface status, the first level signal corresponding to the tip of the smart writing pen, and the second level signal corresponding to the tail of the pen. The previous operating voltage is the operating voltage before the microcontroller enters low-power mode or ultra-low-power mode. The step of determining the contact state by the interrupt program based on the operating parameters includes: Based on the previous operating voltage, the order in which the current operating voltage is compared with a first threshold and a second threshold is determined, wherein the second threshold is greater than the first threshold; The voltage level corresponding to the current operating voltage is determined by comparing the current operating voltage with the first threshold and the second threshold in the aforementioned order. The contact state is determined based on the voltage level corresponding to the current operating voltage, or based on the voltage level corresponding to the current operating voltage, and any one of the charging interface state, the first level signal, and the second level signal.

8. The method according to claim 7, characterized in that, The step of determining the order in which the current operating voltage is compared with the first threshold and the second threshold based on the previous operating voltage includes: The voltage level corresponding to the previous working voltage is determined. The voltage level includes a first voltage level, a second voltage level, and a third voltage level. The first voltage level indicates that the previous working voltage is greater than or equal to the second threshold. The second voltage level indicates that the previous working voltage is greater than the first threshold and less than the second threshold. The third voltage level indicates that the previous working voltage is less than or equal to the first threshold. If the voltage level corresponding to the previous working voltage is the first voltage level, the order is determined as the first order, which is to first compare the current working voltage with the second threshold, and then compare the current working voltage with the first threshold. If the voltage level corresponding to the previous working voltage is the second voltage level, the order is determined to be either the first order or the second order. The second order is to first compare the current working voltage with the first threshold, and then compare the current working voltage with the second threshold. If the voltage level corresponding to the previous working voltage is the third voltage level, the sequence will be determined as the second sequence.

9. The method according to claim 8, characterized in that, The step of comparing the current operating voltage with the first threshold and the second threshold in the stated order to determine the voltage level corresponding to the current operating voltage includes: If the order is the first order, and the current operating voltage is greater than or equal to the second threshold, the voltage level corresponding to the current operating voltage is determined to be the first voltage level; if the current operating voltage is less than the second threshold, the current operating voltage is compared with the first threshold; if the current operating voltage is less than the first threshold, the voltage level corresponding to the current operating voltage is determined to be the third voltage level; if the current operating voltage is greater than or equal to the first threshold, the voltage level corresponding to the current operating voltage is determined to be the second voltage level. When the order is the second order, if the current operating voltage is greater than or equal to the first threshold, compare the current operating voltage with the second threshold; if the current operating voltage is less than the second threshold, determine the voltage level of the current operating voltage as the second voltage level; if the current operating voltage is greater than or equal to the second threshold, determine the voltage level of the current operating voltage as the first voltage level; if the current operating voltage is less than the first threshold, determine the voltage level of the current operating voltage as the third voltage level.

10. The method according to claim 9, characterized in that, Determining the contact state based on the voltage level corresponding to the current operating voltage, or based on the voltage level corresponding to the current operating voltage, and at least one of the charging interface state, the first level signal, and the second level signal, includes: If the voltage level corresponding to the current operating voltage is the third voltage level, determine that the contact state is not contacted and exit the interrupt program; If the voltage level corresponding to the current operating voltage is the first voltage level or the second voltage level, and the charging interface is in the ON state, then the contact state is determined to be non-contact. If the voltage level corresponding to the current working voltage is the first voltage level or the second voltage level, and if the first level signal is a preset level signal or the second level signal is the preset level signal, then the contact state is determined to be contacted.

11. The method according to claim 7, characterized in that, The method further includes: During the main program execution of the smart writing pen, before the microcontroller unit enters the low-power mode or the ultra-low-power mode, the previous operating voltage is acquired and stored.

12. The method according to claim 1, characterized in that, Before determining the target infrared emission signal of the smart writing pen based on its operating parameters, the method further includes: The first level signal is a preset level signal for a first duration or the second level signal is the preset level signal for a second duration, wherein the first level signal is the level signal corresponding to the tip of the smart writing pen and the second level signal is the level signal corresponding to the tail of the smart writing pen. If the first duration is greater than or equal to the preset duration or the second duration is greater than or equal to the preset duration, the smart writing pen is determined to enter the writing state.

13. A smart writing device, characterized in that, The device includes: A status determination module is used to determine the contact status between the smart writing pen and the infrared touch screen, the contact status including contacted and not contacted; The signal determination module is used to determine the target infrared emission signal of the smart writing pen based on the working parameters of the smart writing pen when the contact state is contacted. The target infrared emission signal is used to represent the handwriting parameters of the smart writing pen during the writing process. A signal transmitting module is used to send the target infrared emission signal to the infrared touch screen, so that the infrared touch screen displays the text corresponding to the handwriting parameters based on the target infrared emission signal.

14. An electronic device, characterized in that, The electronic device includes: Memory, used to store executable program code; A processor for calling and running the executable program code from the memory, causing the electronic device to perform the method as described in any one of claims 1 to 12.

15. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed, implements the method as described in any one of claims 1 to 12.

Citation Information

Patent Citations

  • Electromagnetic pen for electronic whiteboard and control method thereof

    CN102478974A

  • Interactive device and trajectory generation method and device

    CN106527775A

  • Parameter adjusting method, parameter adjusting device and touch device

    CN113703636A

  • Stylus switching method and system and stylus

    CN114428561A

  • Information display method and device, electronic equipment, handwriting pen and storage medium

    CN115543108A