Touch screen calibration authentication method and electronic equipment
By generating encrypted data containing a reference token and processor identifier bound to the device, two-way authentication between the device and the server is achieved, and the high-priority execution of calibration commands is ensured. This solves the security and efficiency problems of touchscreen calibration methods and supports remote and efficient calibration.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- FUZHOU WECON ELECTRONICS TECH
- Filing Date
- 2025-12-18
- Publication Date
- 2026-04-21
AI Technical Summary
Existing touchscreen calibration methods suffer from insufficient security, poor reliability, inconvenience in use, and difficulty in management, especially lacking device-level identity binding and efficient operation when remotely triggering calibration.
By obtaining the device identifier of the device to be calibrated, a corresponding reference token and processor identifier are generated. The reference token is encrypted using the processor identifier, encrypted data is generated, and calibration instructions are assembled to achieve two-way authentication between the device and the server. The high-priority execution of calibration instructions is ensured through an interrupt procedure.
It improves the security and efficiency of touchscreen calibration operations, reduces the computational load and time delay of the encryption and decoding process, ensures real-time response and high reliability, and supports efficient execution of remotely triggered calibration.
Smart Images

Figure CN121902117A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of touch screen control technology, and in particular to a touch screen calibration and certification method and electronic device. Background Technology
[0002] During the use of electronic devices, touchscreen calibration is often required. Touchscreen calibration is typically initiated by pressing a physical button or by a host computer remotely sending a calibration command via network communication.
[0003] However, physical buttons cannot authenticate the operator's identity, posing a security risk. Using a host computer, on the other hand, requires complex software, making it inconvenient to use. Summary of the Invention
[0004] The technical problem to be solved by the present invention is to provide a touch screen calibration and certification method and electronic device to improve the safety and efficiency of touch screen calibration operations.
[0005] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows: A touchscreen calibration and certification method, comprising: Obtain the device identifier of the device to be calibrated, and obtain the reference token and processor identifier corresponding to the device to be calibrated based on the device identifier; The base token is encrypted based on the processor identifier to obtain encrypted data; The encrypted data is assembled according to a preset method to obtain a calibration instruction; The calibration command is sent to the device to be calibrated, instructing the device to verify the calibration command, and triggering the screen calibration process after successful verification.
[0006] To solve the above-mentioned technical problems, another technical solution adopted by the present invention is as follows: An electronic device further includes a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor executes the computer program to implement the steps of the touchscreen calibration and certification method described above.
[0007] The beneficial effects of this invention are as follows: After obtaining the device identifier of the device to be calibrated, a reference token and processor identifier corresponding to the device to be calibrated are obtained based on the device identifier. The reference token is then encrypted using the processor identifier to generate encrypted data. That is, the processor identifier of the device to be calibrated is used as the root of the encrypted reference token to generate a calibration command strongly bound to the device to be calibrated. This allows the device to be calibrated to encrypt and decrypt the reference token using its own identical processor identifier, thereby improving the security of remote trigger screen calibration operations. At the same time, the reference token is a fixed token, which greatly reduces the amount of computation and time delay in the encryption and decoding process during the generation of calibration commands, meeting the requirements of real-time response and high reliability, and improving the efficiency of trigger screen calibration operations. Attached Figure Description
[0008] Figure 1 This is a flowchart illustrating the steps of a touchscreen calibration and certification method according to an embodiment of the present invention. Figure 2 This is a schematic diagram of the system interaction of a touch screen calibration and certification method according to an embodiment of the present invention; Figure 3 This is a schematic diagram of the server structure of a touch screen calibration and authentication method according to an embodiment of the present invention; Figure 4 This is a schematic diagram of the HMI device structure for a touchscreen calibration and certification method according to an embodiment of the present invention; Figure 5 This is a flowchart illustrating the steps involved in generating calibration instructions in a touchscreen calibration and certification method according to an embodiment of the present invention. Figure 6 This is a schematic diagram of the structure of a calibration instruction in a touchscreen calibration and certification method according to an embodiment of the present invention; Figure 7 This is a flowchart illustrating the steps of verifying calibration instructions in a touchscreen calibration and certification method according to an embodiment of the present invention. Figure 8 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention. Detailed Implementation
[0009] To explain in detail the technical content, objectives, and effects of the present invention, the following description is provided in conjunction with the embodiments and accompanying drawings.
[0010] The terms used in this application are defined as follows.
[0011] HMI, Human Machine Interface; During the use of electronic devices, touchscreen calibration is often required. Touchscreen calibration is primarily initiated via physical buttons, such as: 1. Entering calibration mode via a combination of buttons or a hidden button. 2. Long-pressing a specific area on a specific interface to trigger calibration. 3. Entering touchscreen calibration mode via DIP switches / external I / O. Alternatively, calibration mode can be triggered remotely by a host computer sending calibration commands via network communication, such as: 1. Sending calibration commands via network protocols. 2. Using digital certificates or simple token authentication.
[0012] However, the above methods have the following shortcomings: (1) Insufficient security: fixed passwords or simple checksums are easily cracked, lack device-level identity binding, commands can be used across devices, and replay attacks cannot be prevented. (2) Poor reliability: calibration cannot be reliably triggered when the main system is abnormal, lacks priority guarantee mechanism, and has weak anti-interference ability. (3) Inconvenient to use: it relies on complex host computer software, requires professional personnel to operate, and cannot be quickly maintained on-site. (4) Difficult to manage: it cannot achieve fine-grained access control, lacks effective operation auditing, and is difficult to trace operation records.
[0013] To address the aforementioned technical problems, this invention provides a touchscreen calibration and certification method and electronic device, improving the security and efficiency of touchscreen calibration operations. It can be applied to the following scenarios: (1) Automated production line: In the touch screen production and testing process, the test fixture integrating the system can automatically scan the equipment barcode, obtain safety instructions and trigger calibration, so as to achieve unmanned and traceable high-efficiency production throughout the entire process.
[0014] (2) On-site equipment maintenance: When an HMI device in an industrial site experiences touch drift, maintenance personnel do not need to return to the factory. They can simply use a handheld terminal to apply for the device's exclusive calibration command to quickly and safely restore the device on-site, greatly reducing maintenance costs and time.
[0015] (3) Remote security technical support: After obtaining user authorization, the technical support center can generate a temporary and unique security command for the remote faulty equipment and send it to the on-site personnel for execution via the network. This solves the problem and avoids the spread of core calibration permissions, thus achieving secure remote assistance.
[0016] A touchscreen calibration and certification method, comprising: Obtain the device identifier of the device to be calibrated, and obtain the reference token and processor identifier corresponding to the device to be calibrated based on the device identifier; The base token is encrypted based on the processor identifier to obtain encrypted data; The encrypted data is assembled according to a preset method to obtain a calibration instruction; The calibration command is sent to the device to be calibrated, instructing the device to verify the calibration command, and triggering the screen calibration process after successful verification.
[0017] As described above, the beneficial effects of this invention are as follows: After obtaining the device identifier of the device to be calibrated, a reference token and processor identifier corresponding to the device to be calibrated are obtained based on the device identifier. The reference token is then encrypted using the processor identifier to generate encrypted data. That is, the processor identifier of the device to be calibrated is used as the root of the encrypted reference token to generate a calibration command strongly bound to the device to be calibrated. This allows the device to be calibrated to encrypt and decrypt the reference token using its own identical processor identifier, thereby improving the security of remote trigger screen calibration operations. At the same time, since the reference token is a fixed token, the computational load and time delay in the encryption and decoding process are greatly reduced during the generation of calibration commands, meeting the requirements of real-time response and high reliability, and improving the efficiency of trigger screen calibration operations.
[0018] In one embodiment of the present invention, the process of obtaining the device identifier of the device to be calibrated includes: The unique processor identifier of the device to be calibrated is read using production tools; Generate a reference token corresponding to the device to be calibrated, and send the reference token to the device to be calibrated; Obtain the device identifier of the device to be calibrated, establish and store the correspondence between the device identifier, the reference token and the processor identifier.
[0019] As described above, by reading the unique processor identifier of the device to be calibrated by the production tool and sending the reference token to the device to be calibrated, the security of obtaining the processor identifier and transmitting the reference token can be improved. At the same time, the processor identifier of the device to be calibrated is unique, that is, the processor identifier of different devices to be calibrated is different. The reference token is encrypted based on the processor identifier. Hardware binding is achieved through the processor identifier and combined with strong encryption technology, realizing one token per device. This fundamentally eliminates command replay, copying and cross-device abuse, and improves the security of calibration commands.
[0020] In one embodiment of the present invention, sending the calibration command to the device to be calibrated includes: The calibration command is sent to the device to be calibrated, instructing the device to verify that the encrypted data is decrypted according to its own processor identifier, and to determine whether the reference token in the encrypted data is consistent with the reference token stored in its own memory. If they are consistent, the verification is successful and the screen calibration process is triggered.
[0021] As described above, during the encryption process, the processor identifier is used to encrypt the reference token, rather than directly encrypting the calibration command. During decryption, the device to be calibrated decrypts the encrypted data using its own processor identifier and determines whether the reference token in the encrypted data is consistent with the reference token stored in the device. That is, the device to be calibrated uses the reference token to authenticate the device sending the command, ensuring that the device sending the command is a device it trusts.
[0022] In one embodiment of the present invention, generating the reference token corresponding to the device to be calibrated includes: A random number is generated, and the random number is used as the reference token corresponding to the device to be calibrated.
[0023] As described above, by generating a random number as the reference token corresponding to the device to be calibrated, the reference token is data that is not related to the information of the device to be calibrated, and therefore the reference token cannot be obtained based on the information of the device to be calibrated.
[0024] In one embodiment of the present invention, sending the calibration command to the device to be calibrated includes: The device to be calibrated is instructed to listen for the calibration command via an interrupt routine, which has the highest hardware priority.
[0025] As described above, the device to be calibrated listens for calibration commands through an interrupt routine. Since the interrupt routine has the highest hardware priority, even if the system of the device to be calibrated is bricked or the touch screen is completely unresponsive, the calibration command can still be triggered to complete the screen calibration of the device to be calibrated.
[0026] In one embodiment of the present invention, sending the calibration command to the device to be calibrated includes: The calibration command is sent to the device to be calibrated, instructing the device to trigger a high-priority software interrupt to execute the calibration command after the interrupt program detects the calibration command, and to forcibly suspend the current main application.
[0027] As described above, upon receiving a calibration command, a high-priority software interrupt is triggered to execute the calibration command, and the current main application is forcibly suspended. This means that executing the calibration command is the highest priority operation, ensuring that the calibration command can be executed in a timely manner.
[0028] In one embodiment of the present invention, assembling the encrypted data into a calibration instruction according to a preset method includes: Obtain a calibration command word, which is used to instruct the device to be calibrated to perform a screen calibration process; The calibration command word and the encrypted data are combined to obtain the calibration instruction.
[0029] As described above, adding a calibration command word to the calibration instruction clarifies that the calibration instruction is used to instruct the device to be calibrated to perform the screen calibration process, thus distinguishing the calibration instruction from other control instructions such as query instructions and upgrade instructions.
[0030] In one embodiment of the invention, the calibration instruction is further assembled with a data length; The calibration command is sent to the device to be calibrated, instructing the device to extract the encrypted data from the calibration command according to the data length.
[0031] As described above, the calibration command sets the data length so that after the device to be calibrated receives the calibration command, it can determine the location and length of the encrypted data in the calibration command by using the data length, thereby extracting the encrypted data for decryption and verification.
[0032] In one embodiment of the present invention, the calibration instruction is further equipped with a check bit; The calibration command is sent to the device to be calibrated, instructing the device to verify the integrity of the calibration command based on the check bit.
[0033] As described above, by setting a check bit in the calibration command, the command structure, check bit, and encrypted data constitute a triple protection, effectively resisting data noise, random erroneous commands, and malicious attacks, and ensuring the accuracy of the operation intention.
[0034] Another embodiment of the present invention provides an electronic device, which further includes a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, it implements the steps of the touch screen calibration and certification method described above.
[0035] Please refer to Figure 1 A touchscreen calibration and certification method. This embodiment illustrates the steps of the method using the interaction between a server (command sending end) and an HMI device. The method includes: S0. System Initialization and Key Presetting: The unique processor identifier of the device to be calibrated is read through the production tool; for example, if the device to be calibrated is an HMI device, at the end of the production line, the test fixture reads the unique CPUID of each HMI device through the debugging interface. The server then generates a random number for the HMI device as its unique base token and burns it into the secure area of the HMI device's non-volatile memory. Simultaneously, the server obtains the device identifier of the device to be calibrated, which can be the HMI device's serial number. The server then establishes the correspondence between the device identifier, the base token, and the processor identifier and stores it in a secure database. Figure 2As shown, the command sending end can send a security command request to the HMI device, query the identity of the HMI device, and send an encrypted calibration command stream. The HMI device sends the calibration command request via serial port, carrying the CPUID of the main control MCU. Figure 3 As shown, the command sending end includes a secure database, a command generation engine, and a communication interface; the secure database stores information such as keys, device whitelists, and calibration templates; the command generation engine generates encrypted commands based on the database; and the communication interface adapts to the serial port protocol for sending / receiving data. Figure 4 As shown, the HMI device includes a serial communication module, a main control MCU, a touch screen module, and a memory (Flash). The main control MCU is used to execute calibration commands.
[0036] Please refer to Figure 5 S1. Obtain the device identifier of the device to be calibrated, and obtain the reference token and processor identifier corresponding to the device based on the device identifier. For example, during field maintenance, authorized personnel request a calibration command from the server using the serial number of the HMI device; after the server obtains the serial number of the target HMI device, it queries the database to obtain the CPUID and reference token corresponding to the serial number of the target HMI device. Then, the encryption step in S2 is executed. If the CPUID corresponding to the serial number does not exist, an error is reported and the process exits.
[0037] S2. Encrypt the base token according to the processor identifier to obtain encrypted data. For example, the server uses the CPUID as the key for a preset encryption algorithm (such as AES-128 encryption algorithm) to encrypt the base token and generate encrypted data.
[0038] S3. Assemble the encrypted data into a calibration command according to a preset method. In this embodiment, the server assembles the complete command frame according to a predefined binary frame structure.
[0039] Please refer to Figure 6 The instruction frame structure is as follows: frame header (0xAA0x55) + calibration command word (0xC1) + data length + encrypted data + checksum + frame trailer (0x0D0x0A). The function and composition of each structure are as follows: 1. Frame header (0-1 bytes); Data value: 0xAA (byte 0), 0x55 (byte 1), combined as 0xAA55; Core function: Synchronization identifier for the receiving end (HMI device), used to quickly identify the start of a valid command frame and filter invalid data.
[0040] 2. Command word (2 bytes); Data value: 0xC1 (single byte); Core function: Instruction type identifier, clearly indicating that this frame is a "touch calibration encryption instruction" to distinguish it from other control instructions (such as query, upgrade).
[0041] 3. Data length (3 bytes); Data value: N (an integer in the range of 0-255, corresponding to the number of bytes in the encrypted data field); Core function: Informs the receiving end of the length of the subsequent encrypted data field, so that the receiving end can accurately intercept the data, and supports flexible expansion of the data length.
[0042] 4. Encrypted data (4-(N+3) bytes); Length range: N≥1 (set according to calibration data requirements in actual scenarios, example N=8); Storage content: Encrypted core touch calibration data, such as calibration reference parameters, device matching identifier, calibration mode configuration, etc.; Security significance: Encrypted transmission of core data to prevent theft or tampering during transmission.
[0043] 5. Checksum (N+4 bytes); The calculation rule is: perform arithmetic summation on all bytes of "frame header (2 bytes) + command word (1 byte) + data length (1 byte) + encrypted data field (N bytes)", and take the lower 8 bits of the result (only the last 1 byte is retained); Core function: The receiving end (HMI device) performs reverse calculation using the same rule to verify whether there is packet loss or tampering during data transmission, and ensure data integrity.
[0044] 6. Frame end (N+5-(N+6) bytes); Data value: 0x0D (byte N+5), 0x0A (byte N+6), combined to form 0x0D0A; Core function: Marks the end of the instruction frame, and together with the frame header forms a complete frame boundary, making it easier for the receiving end to complete frame parsing.
[0045] S4. Send the calibration command to the device to be calibrated, instructing the device to verify the calibration command and trigger the screen calibration process upon successful verification. That is, after the server sends the calibration command with the aforementioned binary frame structure to the HMI device, the HMI device will verify the calibration command and trigger the screen calibration process upon successful verification. Please refer to... Figure 7 The specific verification steps are as follows: When the S41 HMI device powers on and initializes, it configures its serial port receive interrupt to the highest hardware interrupt priority. This interrupt service routine (ISR) continuously listens for data asynchronously in the background, and its execution is completely independent of the main application's task scheduler or the operating system (if any). The HMI device receives the data continuously listened for in the background by the receive interrupt service routine through its serial port.
[0046] S42. Upon receiving the data, a high-priority task parses it: first, it matches the frame header, frame trailer, and checksum to verify the integrity of the instruction format. That is, the HMI device performs reverse calculation verification based on the same checksum rules as in S3 above, thereby verifying whether there is packet loss or tampering during data transmission and ensuring data integrity.
[0047] S43. After the format verification is successful, extract the encrypted data from the calibration command. Then, the HMI device reads its own CPUID and uses it as the key to decrypt the encrypted data using AES-128, obtaining the decryption token (baseline token).
[0048] S44. Compare the decryption token with the locally stored baseline token. If they match, the verification is successful, and the screen calibration process is triggered. When the screen calibration process is triggered, the system will trigger a high-priority software interrupt, forcibly suspending the current main application.
[0049] S45, the interrupt service routine calls the underlying touch driver to start the calibration process and display the calibration points on the screen.
[0050] S46. After the user clicks, the system calculates and saves the new calibration parameters to Flash.
[0051] Throughout the entire process described above, the HMI device sends status commands such as "successful reception," "authentication passed," "calibration in progress," "calibration complete," or "authentication failed" to the sender via serial port. Simultaneously, through an architecture of "highest priority interrupt listening + independent verification," an independent "hardware-level backdoor" channel is provided, enabling the device to recover from a "bricked" state.
[0052] The touchscreen calibration and certification method and electronic device provided by this invention can be applied to the following scenarios: (1) Automated production line: In the touch screen production and testing process, the test fixture integrating the system can automatically scan the equipment barcode, obtain safety instructions and trigger calibration, so as to achieve unmanned and traceable high-efficiency production throughout the entire process.
[0053] (2) On-site equipment maintenance: When an HMI device in an industrial site experiences touch drift, maintenance personnel do not need to return to the factory. They can simply use a handheld terminal to apply for the device's exclusive calibration command to quickly and safely restore the device on-site, greatly reducing maintenance costs and time.
[0054] (3) Remote security technical support: After obtaining user authorization, the technical support center can generate a temporary and unique security command for the remote faulty equipment and send it to the on-site personnel for execution via the network. This solves the problem and avoids the spread of core calibration permissions, thus achieving secure remote assistance.
[0055] Please refer to Figure 8 Another embodiment of the present invention provides an electronic device, which further includes a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, it implements the steps of the touch screen calibration and certification method described above.
[0056] In summary, the core concept of the touchscreen calibration and authentication method and electronic device provided by this invention lies in constructing a secure calibration architecture that deeply integrates "two-way closed-loop authentication" and "state-insensitive triggering." The two-way closed-loop authentication mechanism constructs an authentication loop consisting of a unique CPUID for the device, a baseline token issued by the server, and a dynamically encrypted command with a unique key for each device. The server uses the CPUID to encrypt the baseline token, not the direct operation command; the purpose of device-side decryption is to restore this baseline token and compare it with the locally stored baseline token, achieving two-way authentication between the device and the server. Furthermore, during the encryption process, a triple protection system consisting of binary frame structure, checksum, and hardware decryption authentication effectively resists data noise, random erroneous commands, and malicious attacks, ensuring the accuracy of the operation intent.
[0057] Status-insensitive triggering mechanism: The listening and verification of calibration commands are completely independent of the main loop of the HMI device's application; by setting the serial port receive interrupt to the highest hardware priority, and directly completing frame format verification, checksum verification, and even triggering the decryption comparison process in this interrupt service routine, it is ensured that the calibration channel remains unobstructed even if the device's main system "freezes" or "bricks" due to software bugs, resource exhaustion, or abnormal touch driver.
[0058] The above description is merely an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent modifications made based on the content of the present invention specification and drawings, or direct or indirect applications in related technical fields, are similarly included within the patent protection scope of the present invention.
Claims
1. A touchscreen calibration and certification method, characterized in that, include: Obtain the device identifier of the device to be calibrated, and obtain the reference token and processor identifier corresponding to the device to be calibrated based on the device identifier; The base token is encrypted based on the processor identifier to obtain encrypted data; The encrypted data is assembled according to a preset method to obtain a calibration instruction; The calibration command is sent to the device to be calibrated, instructing the device to verify the calibration command, and triggering the screen calibration process after successful verification.
2. The touchscreen calibration and certification method according to claim 1, characterized in that, Before obtaining the device identifier of the device to be calibrated, the following steps are included: The unique processor identifier of the device to be calibrated is read using production tools; Generate a reference token corresponding to the device to be calibrated, and send the reference token to the device to be calibrated; Obtain the device identifier of the device to be calibrated, establish and store the correspondence between the device identifier, the reference token and the processor identifier.
3. The touchscreen calibration and certification method according to claim 2, characterized in that, Sending the calibration command to the device to be calibrated includes: The calibration command is sent to the device to be calibrated, instructing the device to verify that the encrypted data is decrypted according to its own processor identifier, and to determine whether the reference token in the encrypted data is consistent with the reference token stored in its own memory. If they are consistent, the verification is successful and the screen calibration process is triggered.
4. The touchscreen calibration and certification method according to claim 2, characterized in that, The generation of the reference token corresponding to the device to be calibrated includes: A random number is generated, and the random number is used as the reference token corresponding to the device to be calibrated.
5. The touchscreen calibration and certification method according to claim 1, characterized in that, Sending the calibration command to the device to be calibrated includes: The calibration command is sent to the device to be calibrated, instructing the device to listen for the calibration command via an interrupt routine, wherein the interrupt routine has the highest hardware priority.
6. The touchscreen calibration and certification method according to claim 5, characterized in that, Sending the calibration command to the device to be calibrated further includes: The calibration command is sent to the device to be calibrated, instructing the device to trigger a high-priority software interrupt to execute the calibration command after the interrupt program detects the calibration command, and to forcibly suspend the current main application.
7. The touchscreen calibration and certification method according to claim 1, characterized in that, The step of assembling the encrypted data into a calibration instruction according to a preset method includes: Obtain a calibration command word, which is used to instruct the device to be calibrated to perform a screen calibration process; The calibration command word and the encrypted data are combined to obtain the calibration instruction.
8. The touchscreen calibration and certification method according to claim 7, characterized in that, The calibration command also includes a data length; The calibration command is sent to the device to be calibrated, instructing the device to extract the encrypted data from the calibration command according to the data length.
9. A touchscreen calibration and certification method according to claim 7, characterized in that, The calibration command also includes a check bit; The calibration command is sent to the device to be calibrated, instructing the device to verify the integrity of the calibration command based on the check bit.
10. An electronic device, the electronic device further comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements each step of the touchscreen calibration and certification method as described in any one of claims 1-8.