Communication method and system of DPTP protocol, product and medium

By using the DPTP protocol communication method between the dot matrix pen and the upper layer application, the problem of inconsistent data format of dot matrix pen of different manufacturers is solved, and the stability and accuracy of data transmission are achieved.

CN119561979AActive Publication Date: 2025-03-04BEIJING TOGETHER EDUCATION TECH DEV CO LTD

Patent Information

Application Number
CN202411692934.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-25
Publication Date
2025-03-04
Estimated Expiration
2044-11-25

AI Technical Summary

Technical Problem

The dot matrix pens of different manufacturers adopt different data formats, which leads to the need for the upper-level applications to develop specific analytical modules for each pen type, resulting in cumbersome data processing and error-prone and insufficient accuracy.

Method used

Using the communication method of the DPTP protocol, after the dot-matrix pen is connected to the upper layer application, it receives the protocol level and data standard number, and processes the writing trajectory data according to the authentication strategy to ensure the consistency of the data format.

Benefits of technology

Through the standardized data transmission process, the accuracy and stability of data transmission are improved, and the cumbersome data processing and easy error problems caused by inconsistent formats are avoided.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119561979A_ABST
    Figure CN119561979A_ABST
Patent Text Reader

Abstract

A communication method and system of a DPTP protocol, a product and a medium relate to the field of data transmission, and the method comprises the following steps: under the condition that a dot matrix pen establishes a connection with an upper end application, the dot matrix pen receives a protocol level and a data standard number sent by the upper end application to the dot matrix pen; the dot matrix pen returns a confirmation message to the upper end application, wherein the confirmation message comprises an equipment authentication strategy number; if the authentication strategy number indicates that authentication is needed, the dot matrix pen carries out authentication operation on an authentication instruction sent by the upper end application; under the condition that the authentication operation result is that authentication succeeds or the authentication strategy number indicates that authentication is not needed, the dot matrix pen packages the collected writing track data into message data in a data format according to the data format corresponding to the data standard number; and the dot matrix pen sends the message data to the upper end application. By implementing the method, the stability of data transmission between the dot matrix pen and the upper application can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data transmission, and in particular to a communication method, system, product and medium of a DPTP protocol. Background Art

[0002] With the development of educational informatization, intelligent writing devices are increasingly used in teaching scenarios. Among them, the dot matrix pen is a kind of intelligent writing device. By writing on special dot matrix code paper, the writing trajectory data is collected and transmitted to the upper layer application for processing, so as to realize the digital recording of the writing content.

[0003] In the related technology, each dot matrix pen manufacturer uses an independently developed data transmission protocol, which defines a fixed data format and transmission rules. Under this protocol design, the dot matrix pen packages the collected writing trajectory data through a preset data structure and sends it, and the upper-layer application parses it according to the agreed format to complete the data transmission.

[0004] However, since dot pens from different manufacturers use different data formats, and the data parsing rules preset by the upper-end application are often only applicable to data in a specific format, the data processing process is cumbersome and prone to errors, and lacks accuracy. Summary of the invention

[0005] The present application provides a communication method, system, product and medium of the DPTP protocol, which are used to improve the stability of data transmission between a dot matrix pen and an upper-level application.

[0006] In a first aspect, the present application provides a communication method of the DPTP protocol, which is applied to a communication system of the DPTP protocol, wherein the communication system of the DPTP protocol includes a dot matrix pen and an upper-end application, and the method includes: when the dot matrix pen establishes a connection with the upper-end application, the dot matrix pen receives the protocol level and data standard number sent by the upper-end application to the dot matrix pen; the dot matrix pen returns a confirmation message to the upper-end application, and the confirmation message includes a device authentication policy number; if the authentication policy number indicates that authentication is required, the dot matrix pen performs an authentication operation on the authentication instruction sent by the upper-end application; when the authentication operation result is successful authentication or the authentication policy number indicates that authentication is not required, the dot matrix pen packages the collected writing trajectory data into message data in the data format corresponding to the data standard number; the dot matrix pen sends the message data to the upper-end application.

[0007] By adopting the above technical solution, in the DPTP protocol communication system, after the dot matrix pen establishes a connection with the upper-end application, a series of interactions are carried out. The dot matrix pen receives the protocol level and data standard number, returns a confirmation message containing the authentication policy number, and processes the writing trajectory data according to the authentication situation. This orderly interaction and processing mechanism makes the data transmission process standardized and safe. The dot matrix pen packages and sends data in the format corresponding to the data standard number, ensuring the consistency of the data format, avoiding the cumbersome and error-prone data processing caused by inconsistent formats, and effectively improving the accuracy and stability of data transmission.

[0008] In combination with some embodiments of the first aspect, in some embodiments, the dot pen packages the collected writing trajectory data into message data in the data format according to the data format corresponding to the data standard number, specifically including: when a page change operation is detected, the dot pen packages the page number information in the writing trajectory data into message data in the data format.

[0009] By adopting the above technical solution, when a page change operation is detected, the dot matrix pen packages the page number information in the writing trajectory data into message data of the corresponding data format. Compared with the prior art that transmits the page number information every time data is transmitted, this operation only transmits the page number information when the page is changed, thereby improving the data transmission efficiency in the dot matrix pen with low power consumption and limited storage space.

[0010] In combination with some embodiments of the first aspect, in some embodiments, it is characterized in that the dot matrix pen, according to the data format corresponding to the data standard number, packages the collected writing trajectory data into message data in the data format, specifically including: the dot matrix pen sets the coordinate information in the writing trajectory data as absolute coordinates and relative coordinates; the dot matrix pen uses the absolute coordinates to record the reference position, and uses the relative coordinates to record the position offset relative to the reference position; the dot matrix pen records the absolute coordinates according to a preset number of sampling points; the dot matrix pen calculates the offset of the sampling point position within the preset number of sampling points relative to the absolute coordinates, and records the offset as the relative coordinates; the dot matrix pen packages the absolute coordinates and the relative coordinates into message data in the data format.

[0011] By adopting the above technical solution, the dot matrix pen uses a combination of absolute coordinates and relative coordinates for the coordinate information of the writing trajectory data, and records the absolute coordinates and calculates the relative coordinates according to the preset number of sampling points. The absolute coordinates provide an accurate basis for reference positioning, and the relative coordinates use them to represent the offset relative to the reference position, effectively reducing the amount of data. In a dot matrix pen with low power consumption and limited storage space, this method significantly reduces the pressure of data storage. At the same time, when packaging these coordinate data into message data, the data structure is optimized and the data transmission efficiency is improved.

[0012] In combination with some embodiments of the first aspect, in some embodiments, after the step of the dot matrix pen sending the message data to the upper-end application, the method also includes: the upper-end application verifies the message data and sends the verification result to the dot matrix pen; if the verification result is a verification failure or the dot matrix pen does not receive the verification result within a preset time, the message data is resent.

[0013] By adopting the above technical solution, the data format corresponding to the data standard number includes packaging rules and transmission rules, and the data transmission rate in the transmission rule is determined by the sampling rate of the writing trajectory data. This feature closely integrates the data format with the collection and transmission of data. In practical applications, different sampling rates correspond to appropriate data transmission rates, avoiding data transmission problems caused by rate mismatch. For example, in high-speed writing scenarios, a higher sampling rate can ensure the integrity of data collection, and the matching transmission rate can ensure timely data transmission.

[0014] In combination with some embodiments of the first aspect, in some embodiments, the data format corresponding to the data standard number includes packing rules and transmission rules for the writing trajectory data, and the data transmission rate in the transmission rules is determined by the sampling rate of the writing trajectory data.

[0015] By adopting the above technical solution, after the dot matrix pen establishes a connection with the upper-end application and receives the data standard number, it selects the general data format or the private data format according to the number. This flexible format selection method packages the writing trajectory data according to the preset data structure in the general data format, ensuring the standardization and universality of the data format; in the private data format, it is packaged according to its custom data structure to meet the personalized needs of special devices or scenarios.

[0016] In combination with some embodiments of the first aspect, in some embodiments, when the dot matrix pen establishes a connection with the upper-end application, after the dot matrix pen receives the step of the upper-end application sending the protocol level and the data standard number to the dot matrix pen, the method also includes: the dot matrix pen selects the universal data format or the private data format according to the data standard number; the dot matrix pen packages the writing trajectory data according to a preset data structure under the universal data format; the dot matrix pen packages the writing trajectory data according to a custom data structure in the private data format under the private data format.

[0017] By adopting the above technical solution, after the dot matrix pen establishes a connection with the upper-end application and receives the data standard number, it selects the general data format or the private data format according to the number. This flexible format selection method packages the writing trajectory data according to the preset data structure in the general data format, ensuring the standardization and universality of the data format; in the private data format, it is packaged according to its custom data structure to meet the personalized needs of special devices or scenarios.

[0018] In combination with some embodiments of the first aspect, in some embodiments, after the step of the dot matrix pen sending the message data to the upper-end application, the method further includes: when the authentication operation result is authentication failure, the dot matrix pen interrupts the data transmission connection with the upper-end application.

[0019] By adopting the above technical solution, in the process of data interaction between the dot matrix pen and the upper-end application, the authentication operation becomes a key link in ensuring data security. When the authentication operation result is authentication failure, the dot matrix pen interrupts the data transmission connection with the upper-end application, preventing the unauthorized upper-end application from obtaining the writing trajectory data collected by the dot matrix pen, thereby ensuring the security and confidentiality of the data.

[0020] In a second aspect, an embodiment of the present application provides a communication system of the DPTP protocol, the communication system of the DPTP protocol comprising: one or more processors and a memory; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code comprises computer instructions, the one or more processors call the computer instructions to enable the communication system of the DPTP protocol to execute the method described in the first aspect and any possible implementation method of the first aspect.

[0021] In a third aspect, an embodiment of the present application provides a computer program product comprising instructions, which, when the above-mentioned computer program product runs on a communication system of the DPTP protocol, enables the above-mentioned communication system of the DPTP protocol to execute the method described in the first aspect and any possible implementation method of the first aspect.

[0022] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, comprising instructions. When the above instructions are executed on a communication system of the DPTP protocol, the communication system of the above DPTP protocol executes the method described in the first aspect and any possible implementation method of the first aspect.

[0023] It is understandable that the communication system of the DPTP protocol provided in the second aspect, the computer program product provided in the third aspect, and the computer storage medium provided in the fourth aspect are all used to execute the method provided in the embodiment of the present application. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method, which will not be repeated here.

[0024] One or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages: 1. In the DPTP protocol communication system, the dot matrix pen and the upper-end application establish a connection and perform a series of interactions. The dot matrix pen receives the protocol level and data standard number, returns a confirmation message containing the authentication policy number, and processes the writing trajectory data according to the authentication situation. This orderly interaction and processing mechanism makes the data transmission process standardized and safe. The dot matrix pen packages and sends data in the format corresponding to the data standard number, ensuring the consistency of the data format, avoiding the cumbersome and error-prone data processing caused by inconsistent formats, and effectively improving the accuracy and stability of data transmission.

[0025] 2. In the present application, when a page change operation is detected, the dot matrix pen packages the page number information in the writing trajectory data into message data of the corresponding data format. Compared with the prior art that transmits the page number information in each data transmission, this operation only transmits the page number information when the page is changed, thereby improving the data transmission efficiency in the dot matrix pen with low power consumption and limited storage space.

[0026] 3. This application uses a combination of absolute coordinates and relative coordinates for the coordinate information of the writing trajectory data through the dot matrix pen, and records the absolute coordinates and calculates the relative coordinates according to the preset number of sampling points. The absolute coordinates provide an accurate basis for reference positioning, and the relative coordinates use them to represent the offset relative to the reference position, effectively reducing the amount of data. In a dot matrix pen with low power consumption and limited storage space, this method significantly reduces the pressure of data storage. At the same time, when packaging these coordinate data into message data, the data structure is optimized and the data transmission efficiency is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 It is a flow chart of the communication method of the DPTP protocol in the embodiment of the present application; Figure 2 It is another flow chart of the communication method of the DPTP protocol in the embodiment of the present application; Figure 3 It is a schematic diagram of the physical device structure of the communication system of the DPTP protocol in the embodiment of the present application. DETAILED DESCRIPTION

[0028] The terms used in the following embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to be used as limitations to the present application. As used in the specification of the present application, the singular expressions "one", "a kind of", "above", "the" and "this" are intended to also include plural expressions, unless there is a clear indication to the contrary in the context. It should also be understood that the term "and / or" used in the present application refers to any or all possible combinations comprising one or more of the listed items.

[0029] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features, and in the description of the embodiments of the present application, unless otherwise specified, "plurality" means two or more.

[0030] For ease of understanding, the application scenarios of the embodiments of the present application are introduced below.

[0031] In a smart classroom of an educational institution, teachers use dot pens to write teaching content on special paper, and need to transmit handwriting data to the display screen in front of the classroom and the student tablet in real time. Since multiple dot pens are used in the classroom at the same time, and each pen uses low-power Bluetooth transmission, the built-in storage space is small (usually only a few hundred KB), and the processor performance is also relatively limited. In actual use, the following problems arise: dot pens from different manufacturers use different data formats, resulting in the upper-level application needing to develop specific parsing modules for each pen type; in a high-density use environment (such as 30 pens working at the same time), due to the inconsistent data format, additional processing overhead is caused, affecting real-time performance; at the same time, due to the limited hardware resources of the dot pen, complex data processing can easily lead to memory overflow or rapid battery depletion.

[0032] A school uses an existing dot pen solution and a data transmission protocol developed by manufacturer A. The protocol uses a fixed data format to package and send the collected coordinates, pressure and other information according to the preset field definitions. When the dot pens of manufacturer A and manufacturer B are used in the classroom at the same time, the system cannot directly process the data of manufacturer B's pen because the pens of manufacturer B use different data formats. To solve this problem, the school had to deploy two display systems in each classroom or develop a complex data conversion module. Moreover, because the protocol design did not take into account the hardware limitations of the dot pen, the data packaging process occupied a large amount of memory and processing resources, resulting in the need to replace the battery of the dot pen after each class, which seriously affected the teaching experience.

[0033] After educational institutions adopt the DPTP protocol, dot matrix pens from multiple manufacturers can be used simultaneously in the classroom. When a teacher uses the dot matrix pen from manufacturer A, after the pen establishes a connection with the upper-level application, the protocol negotiates to determine the use of a common data format (number 0x01). The dot matrix pen uses a mixed encoding method of relative coordinates and absolute coordinates. An absolute coordinate is recorded for every 8 sampling points, and the middle point is represented by a 1-byte relative offset, which significantly reduces the amount of data. At the same time, the dot matrix pen from manufacturer B achieves seamless docking with the upper-level application while maintaining adaptation to its hardware characteristics through the private format mechanism supported by the protocol (using the 0xF1 number). This method not only solves the compatibility problem of pens from multiple manufacturers, but also reduces the resource consumption of the dot matrix pen through optimized data encoding methods.

[0034] For ease of understanding, the following describes the process of the method provided by this implementation in combination with the above scenario. Figure 1 , which is a flow chart of the communication method of the DPTP protocol in an embodiment of the present application.

[0035] S101. When the dot matrix pen is connected to the upper-end application, the dot matrix pen receives a protocol level and a data standard number sent by the upper-end application to the dot matrix pen.

[0036] Among them, the dot pen refers to an intelligent writing device that is used to collect writing trajectory data and transmit it to the receiving end via Bluetooth. The upper-end application refers to the software program running on computers, mobile phones and other devices, which is used to receive and process dot pen data. Establishing a connection refers to the process of establishing a Bluetooth communication link between the dot pen and the upper-end application, including three stages: device discovery, pairing and connection establishment. The protocol level is used to indicate the version number of the DPTP protocol, which is represented by a 1-byte unsigned integer, and the current version value is 1. The data standard number refers to the type of data format used, which is represented by a 1-byte unsigned integer, where 0x01 indicates a common standard and the range of 0xF0-0xFF indicates a private standard. For example, the protocol level 0x01 indicates the use of DPTP protocol version 1.0, and the data standard number 0x01 indicates the use of a common data format.

[0037] This step is performed after the dot matrix pen completes the establishment of a Bluetooth connection with the upper application, and is used to initialize the basic parameters of data communication. Specifically, the dot matrix pen receives the initialization parameters sent by the upper application through the Bluetooth characteristic value, which includes a 1-byte protocol level value and a 1-byte data standard number.

[0038] In some embodiments, the process of receiving and processing initialization parameters by the dot matrix pen can be implemented in a variety of ways: Optionally, after receiving a Bluetooth connection request, the dot matrix pen first enters a waiting state and starts a 5-second timer. Before the timer times out, it must receive the initialization parameters sent by the upper-end application. After receiving the parameters, the parameter values ​​are immediately parsed and saved. If the parameters are valid, the timer is stopped and the normal working state is entered. If the parameters are invalid or the timer times out, the Bluetooth connection is actively disconnected; Optionally, after the Bluetooth connection is established, the dot matrix pen first sends a notification requesting initialization to the upper-end application, and then waits for the response of the upper-end application. After receiving the response, the protocol level and data standard number are parsed, and these parameters are matched with the internally supported parameter list. If the match is successful, the normal working state is entered. If the match fails, an error code is returned and the initialization state is maintained. It can be understood that other methods can also be used to implement the parameter initialization process between the dot matrix pen and the upper-end application, which is not limited here.

[0039] S102: The dot matrix pen returns a confirmation message to the upper-end application, where the confirmation message includes a device authentication policy number.

[0040] Among them, the confirmation message refers to the response message of the dot matrix pen to the initialization request of the upper application, which is used to confirm the protocol parameters and return the device information. The device authentication policy number indicates the security authentication method adopted by the dot matrix pen, which is represented by a 1-byte unsigned integer, where 0x00 means no authentication is required, and other values ​​represent specific authentication policies. The return process refers to the operation of the dot matrix pen sending a confirmation message to the upper application through the Bluetooth characteristic value. For example, the authentication policy number 0x01 may indicate that password authentication is required, and 0x02 indicates that certificate authentication is required.

[0041] This step is executed after the dot matrix pen completes the initialization parameter reception, and is used to confirm the parameter reception status to the upper-end application and inform the security authentication requirements. Specifically, the dot matrix pen determines the authentication strategy to be adopted for the current session based on the internal configuration and generates a confirmation message. The confirmation message contains a 2-byte message header (identifying the message type and sequence number), a 1-byte authentication strategy number, a 2-byte status code (indicating whether the parameter reception is successful), and a 2-byte checksum. The dot matrix pen sends the message to the upper-end application via the Bluetooth characteristic value.

[0042] In some embodiments, the generation and sending process of the confirmation message can be implemented in a variety of ways: Optionally, the dot matrix pen first checks whether the received protocol level and data standard number are valid, then queries the internal configuration table to obtain the corresponding authentication policy, generates a confirmation message containing complete device information, calculates the CRC16 check value for the message content, and finally sends the complete message at one time through the Bluetooth characteristic value; Optionally, the dot matrix pen first sends a simple parameter reception confirmation, and then returns detailed device information and authentication policy when the upper-end application requests it. The confirmation message is transmitted in segments, and each segment contains an independent check code. The confirmation process is completed only after the upper-end application receives all segments. It is understandable that other methods can also be used to implement the transmission process of the confirmation message, which is not limited here.

[0043] S103: If the authentication policy number indicates that authentication is required, the dot matrix pen performs an authentication operation on the authentication instruction sent by the upper-end application.

[0044] Among them, the authentication policy number refers to a 1-byte unsigned integer used by the dot matrix pen to identify the security authentication method, which is used to indicate the authentication mechanism adopted by the current session. The authentication instruction refers to the data packet containing authentication information sent by the upper-end application, which is used to provide the credentials required for identity authentication to the dot matrix pen. The authentication operation refers to the process of the dot matrix pen verifying the received authentication information, which is used to ensure that only authorized upper-end applications can access the device. Authentication required means that the value of the authentication policy number is not 0x00, which is used to indicate that the current session must be securely authenticated. For example, when the authentication policy number is 0x01, the authentication instruction needs to contain the preset password information; when the number is 0x02, the instruction needs to contain digital certificate information.

[0045] This step is executed after the dot matrix pen sends a confirmation message, and is used to verify the access rights of the upper-end application. Specifically, the dot matrix pen checks the authentication policy number in the confirmation message. If the value is not 0x00, it enters the authentication state. The dot matrix pen waits to receive the authentication instruction sent by the upper-end application. The instruction format includes a 2-byte instruction type, N bytes of authentication data (variable length depending on the authentication strategy), and a 2-byte checksum. After receiving the complete authentication instruction, the dot matrix pen selects the corresponding verification algorithm according to the authentication policy number and verifies the authentication data.

[0046] In some embodiments, the authentication and verification process of the dot matrix pen can be implemented in a variety of ways: Optionally, after receiving the authentication instruction, the dot matrix pen first performs instruction format verification and checksum verification, then extracts the password field from the instruction, and compares it with the authorization password stored in the device. If they are completely matched, the authentication is marked as successful, otherwise an error code is returned; if a valid authentication instruction is not received within a preset time, the connection is automatically disconnected; Optionally, after entering the authentication state, the dot matrix pen first sends a random challenge value to the upper application, and then receives the response data encrypted by the upper application using the private key. The dot matrix pen uses the pre-stored public key to verify the signature of the response data, and checks the validity period and permission level of the certificate. The authentication is marked as successful only after all verifications are passed, and any verification failure will cause the connection to be disconnected. It can be understood that other methods can also be used to implement the security authentication process of the dot matrix pen, which is not limited here.

[0047] S104. When the authentication operation result is successful authentication or the authentication policy number indicates that authentication is not required, the dot matrix pen packages the collected writing trajectory data into message data in the data format corresponding to the data standard number.

[0048] Among them, the authentication operation result refers to the judgment result after the dot matrix pen completes the identity authentication, which is used to indicate whether the authentication is passed. The data standard number refers to a 1-byte unsigned integer that specifies the data format type, which is used to indicate the data organization method adopted. The writing trajectory data represents the handwriting information collected by the dot matrix pen, including parameters such as coordinates, pressure, and angle. The data format refers to the data organization specification defined by the DPTP protocol, which is used to specify the storage structure of various types of information. The message data represents a data packet organized according to the protocol format, which is used for transmission between the dot matrix pen and the upper-end application. For example, the message structure defined by the general data format (number 0x01) contains 4 bytes of absolute coordinates and 2 bytes of relative coordinates, while the private format may use different field definitions.

[0049] This step is performed after the dot matrix pen completes authentication verification or confirms that no authentication is required, and is used to process the collected writing data. Specifically, the dot matrix pen first confirms that the current working state meets the data transmission conditions, and then searches for the corresponding format definition according to the data standard number. For the data collected in each sampling period, the dot matrix pen converts it into the data type required by the standard format, including converting the physical coordinates into the coordinate system defined by the protocol, normalizing the pressure value to the specified range, calculating the inclination data, etc. Then organize the data packet according to the format specification, and add the necessary control information and checksum.

[0050] In some embodiments, the data processing and packaging process of the dot matrix pen can be implemented in a variety of ways: optionally, the dot matrix pen maintains a circular buffer to store the original sampled data. When the buffer accumulates to a predetermined size, the data processing process is started. First, the coordinate system conversion and numerical normalization are performed, and then the processed data is organized into a message according to the specification of the data format. Finally, the CRC check code is calculated and added; after the processing is completed, the buffer is cleared to prepare for the next round of data collection; optionally, the dot matrix pen adopts a real-time processing mode, and the format conversion is performed immediately after each set of data is collected, and the converted data is stored in the sending queue. At the same time, a sliding window is maintained to control the data flow. When the data accumulated in the queue reaches the size of a complete message, the message header and check information are added, and the complete message is submitted to the transmission module. It can be understood that other methods can also be used to implement the data format conversion and packaging process of the dot matrix pen, which is not limited here.

[0051] S105. The dot matrix pen sends the message data to the upper-end application.

[0052] Among them, message data refers to a data packet organized according to the DPTP protocol specification, which is used to carry the data structure of writing trajectory information. The dot pen refers to an intelligent writing device that collects writing trajectory data, which is used to package the collected data and send it via Bluetooth. The upper-end application represents a software program that receives and processes the dot pen data, which is used to parse and display the writing trajectory information. The sending process refers to the operation of transmitting data through the Bluetooth communication link, which is used to realize data exchange between the dot pen and the upper-end application. The data transmission rate indicates the speed at which the dot pen sends data, which is used to match the sampling rate of the writing trajectory data, for example, 50 frames / second corresponds to 300 bytes / second, and 100 frames / second corresponds to a transmission rate of 500 bytes / second. For example, a complete message data includes a 2-byte message header, a 1-byte data length, an N-byte data segment, and a 2-byte checksum.

[0053] This step is performed after the dot matrix pen completes data packaging and is used to achieve reliable data transmission. Specifically, the dot matrix pen first checks the Bluetooth connection status and communication parameters to confirm that data transmission can be performed. Then, according to the maximum transmission unit (MTU) size of the Bluetooth protocol, the message data larger than the MTU is divided into multiple data fragments. A 2-byte serial number identifier and a 2-byte fragment check code are added to each data fragment. The dot matrix pen uses the Bluetooth characteristic value write operation to send these data fragments in sequence according to the set transmission rate. At the same time, a sending window is maintained to record the data fragments that have been sent but not confirmed.

[0054] In some embodiments, the data transmission process of the dot matrix pen can be implemented in a variety of ways: Optionally, the dot matrix pen creates a transmission buffer before sending data, stores the complete message data in the buffer, and then calculates the number of required fragments according to the MTU size, generates a unique serial number identifier for each fragment, writes the fragment data into the Bluetooth characteristic value one by one, and starts a timeout timer every time a fragment is sent. If the confirmation from the upper application is received before the timeout, the next fragment is sent. If the confirmation is not received after the timeout, the current fragment is resent until all fragments are sent or the maximum number of retries is reached; Optionally, the dot matrix pen uses a sliding window mechanism to control data transmission, first sets the window size (such as 4 fragments), sends all fragments in the window at the same time, and then waits for the batch confirmation of the upper application. After receiving the confirmation, the window slides forward and continues to send new fragments. If packet loss is found, only the lost fragments are resent, and the sending rate is dynamically adjusted to adapt to the network conditions. It can be understood that other methods can also be used to implement the data transmission process of the dot matrix pen, which is not limited here.

[0055] The following is a more detailed description of the process of the method provided by this implementation. Figure 2 , which is another flow chart of the communication method of the DPTP protocol in an embodiment of the present application.

[0056] S201. When the dot matrix pen establishes a connection with the upper-end application, the dot matrix pen receives the protocol level and data standard number sent by the upper-end application to the dot matrix pen. The data format corresponding to the data standard number includes packing rules and transmission rules for the writing trajectory data. The data transmission rate in the transmission rule is determined by the sampling rate of the writing trajectory data.

[0057] The dot matrix pen is an intelligent writing device that captures the coded information on the special dot matrix code paper through the built-in infrared high-speed camera, thereby realizing the collection of writing trajectories. The upper-end application is an application program that interacts with the dot matrix pen for data, which can be software running on PCs, mobile phones and other devices. The protocol level uses a one-byte unsigned integer to represent the revision number of the protocol, and the current version value is 1. The data standard number also uses a one-byte unsigned integer to represent the adopted data standard, where 0x01 represents the universal standard and the 0xF0-0xFF segment is used for custom private standards. The data format specifies the packaging rules (such as data structure, field definition, etc.) and transmission rules (such as transmission rate, verification mechanism, etc.) of the writing trajectory data. The sampling rate is the frequency at which the dot matrix pen collects writing trajectory data, which is generally 50 frames / second or 100 frames / second.

[0058] In this step, the dot matrix pen first establishes a physical connection with the upper-end application through Bluetooth or other communication methods. After the connection is established, the upper-end application will send two parameters, the protocol level and the data standard number, to the dot matrix pen. The dot matrix pen determines the format specification used for subsequent data transmission based on the received data standard number. The format specification contains specific packaging rules (such as organizing the collected handwriting coordinates, pressure, angle and other information according to the specified structure) and transmission rules (such as determining the transmission rate based on the sampling rate, 50 frames / second corresponds to 300 bytes / second, and 100 frames / second corresponds to 500 bytes / second). The entire process realizes the negotiation of the protocol version and data format between the dot matrix pen and the upper-end application.

[0059] S202: The dot matrix pen returns a confirmation message to the upper-end application, where the confirmation message includes a device authentication policy number.

[0060] The confirmation message is the response message of the dot matrix pen to the initialization request of the upper application, which is used to confirm the protocol parameters and return the device information. The device authentication policy number uses a one-byte unsigned integer to represent the authentication method used, where 0x00 means no authentication is required, and other values ​​indicate that a specific authentication policy needs to be adopted. The authentication policy can include password authentication, certificate authentication and other methods to ensure that the dot matrix pen only establishes a connection with the authorized upper application.

[0061] After receiving the initialization request from the upper application, the dot matrix pen will generate and return a confirmation message. The confirmation message contains the device authentication policy number, which is used to inform the upper application whether authentication is required and what authentication method to use. For example, when the number is 0x00, it means that the dot matrix pen allows any upper application to access and use; when the number is 0x01, it may mean that the preset pairing password needs to be entered; when the number is 0x02, it may mean that the digital certificate needs to be verified, etc. This mechanism allows the dot matrix pen to flexibly control access permissions and protect device security.

[0062] S203: If the authentication policy number indicates that authentication is required, the dot matrix pen performs an authentication operation on the authentication instruction sent by the upper-end application.

[0063] Authentication is the process of verifying whether the upper-end application has the authority to use the dot matrix pen. The authentication instruction is a message sent by the upper-end application containing authentication information (such as passwords, certificates, etc.). The authentication operation is the specific process of the dot matrix pen verifying the authentication information, including steps such as information parsing, rule matching, and result determination. The authentication result indicates whether the authentication is successful. If successful, subsequent data transmission is allowed, and if failed, the connection is rejected.

[0064] When the authentication policy number in the confirmation message is not 0x00, the dot matrix pen will wait for the upper application to send an authentication instruction. After receiving the authentication instruction, the dot matrix pen will verify it according to the preset rules. For example, in the password authentication mode, the dot matrix pen will compare the received password with the internally stored authorization password; in the certificate authentication mode, the dot matrix pen will verify the validity and permission level of the certificate. Only after the authentication operation is judged to be successful, the dot matrix pen will continue to execute the subsequent data transmission process. This step realizes the security control of the dot matrix pen's usage permissions.

[0065] S204: When the authentication operation result is successful authentication or the authentication policy number indicates that authentication is not required, when a page change operation is detected, the dot matrix pen packages the page number information in the writing trajectory data into message data in the data format.

[0066] In some embodiments, step S104 may further include the following steps: The dot matrix pen sets the coordinate information in the writing trajectory data as absolute coordinates and relative coordinates; Specifically, the writing trajectory data is the pen tip movement information collected by the dot matrix pen through the built-in infrared camera, including position, pressure, angle and other data. The coordinate information is a two-dimensional coordinate value that describes the position of the pen tip on the special dot matrix code paper. The absolute coordinate uses the complete X and Y values ​​to represent the actual position of the pen tip on the paper. Generally, each coordinate value occupies 2-4 bytes. The relative coordinate records the position difference relative to a reference position, and usually only 1 byte is needed to represent a smaller range of position changes. For example, within a writing range of 10mm×10mm, the absolute coordinate needs to use a value such as (1000, 1000) to represent the precise position, while the relative coordinate only needs an offset value such as (-5, +3) to represent the relative position. In this step, the dot matrix pen converts the coordinate representation of the collected writing trajectory data. The dot matrix pen first retains the original absolute coordinate value and calculates the relative coordinate value at the same time. In specific implementation, the dot matrix pen sets two coordinate fields for each sampling point in the data structure: one uses 4 bytes to store the complete absolute coordinate value (X, Y), and the other uses 2 bytes to store the offset relative to the reference point (△X, △Y).

[0067] The dot matrix pen uses the absolute coordinates to record a reference position, and uses the relative coordinates to record a position offset relative to the reference position; Specifically, the reference position is a reference position point expressed in absolute coordinates, which is used as the origin for calculating relative coordinates. The position offset refers to the coordinate difference of the current sampling point relative to the reference position, expressed in relative coordinates. A dual coordinate recording mechanism is adopted, in which the absolute coordinate provides precise positioning and the relative coordinate provides efficient storage. In practical applications, if point (1000, 1000) is used as the reference position, the position offset of the surrounding points (1002, 1003) is (+2, +3). In this way, the data storage space can be greatly reduced. In the specific execution process, the dot matrix pen records the key point positions in the writing trajectory in real time. For each sampling point set as the reference, the dot matrix pen uses a 4-byte absolute coordinate value (X, Y) to completely record its position. For other sampling points near the reference point, the dot matrix pen calculates their position offset relative to the reference point and records the offset using a 1-byte relative coordinate value (△X, △Y). This recording method ensures the accuracy of the position data, while significantly reducing the amount of data by using relative coordinates.

[0068] The dot matrix pen records the absolute coordinates according to the preset number of sampling points; Specifically, the preset number of sampling points refers to the number of sampling points at which a complete absolute coordinate value is recorded in a continuous writing trajectory. This value is usually set to 8 or 16. The sampling point is the handwriting position data point obtained by the dot matrix pen during the writing process, and the sampling frequency is generally 50 times / second or 100 times / second. Recording absolute coordinates means using complete position information to store the spatial position of the sampling point, which requires 4 bytes of storage space. For example, if the absolute coordinate is recorded once every 8 sampling points, then at a sampling rate of 100Hz, 12-13 absolute coordinate values ​​need to be recorded per second. In this step, the dot matrix pen records the absolute coordinates according to the preset sampling point interval. In specific implementation, the dot matrix pen maintains a sampling point counter, and the counter is incremented by 1 each time a point is collected. When the counter value reaches the preset number of sampling points, the dot matrix pen records the complete coordinate value of the current sampling point as the absolute coordinate, and clears the counter to zero and starts counting again.

[0069] The dot matrix pen calculates the offset of the sampling point position within the preset number of sampling points relative to the absolute coordinate, and records the offset as the relative coordinate; Specifically, the offset refers to the position difference of the sampling point relative to the reference point, and a signed integer is used to represent the displacement in the X-axis and Y-axis directions. The sampling point position is the spatial coordinate of the handwriting trajectory point obtained by the dot matrix pen during the writing process, which consists of X and Y values. The preset number of sampling points defines the number of sampling points between two absolute coordinate recording points, which is usually set to 8 or 16 points. Relative coordinates use fewer bytes (usually 1 byte) to record position offset information, which can save storage space compared to absolute coordinates (usually 4 bytes). For example, if the absolute coordinate point position is (1000, 1000) and the position of a sampling point is (1003, 998), the calculated offset is (+3, -2), and this offset is recorded as a relative coordinate. When executing this step, the dot matrix pen first obtains the absolute coordinate value of the current record as the reference point. For each sampling point after the absolute coordinate point, the dot matrix pen performs the following calculations: subtract the X coordinate of the sampling point from the X coordinate of the reference point to obtain the X-direction offset, and subtract the Y coordinate of the sampling point from the Y coordinate of the reference point to obtain the Y-direction offset. Since the position change between adjacent sampling points will not be too large, these offsets are usually in the range of -128 to +127, so they can be stored in a one-byte signed integer. The dot matrix pen stores the calculated X and Y offsets in the relative coordinate data structure respectively until all sampling points within the preset number are processed.

[0070] The dot matrix pen packages the absolute coordinates and the relative coordinates into message data in the data format.

[0071] Specifically, the message data is an information packet organized in accordance with the data transmission format specified by the DPTP protocol. The data format defines the specific structure of the data packet, including the arrangement and length specifications of fields such as the message header, data segment, and check code. The absolute coordinate data occupies 4 bytes of space and completely records the spatial position of the reference point. Each point of the relative coordinate data occupies 2 bytes of space and records the position offset relative to the reference point. The packaging process is to organize different types of coordinate data into a complete data packet according to the specified format. For example, a complete data packet structure can be: message header (2 bytes) + data length (1 byte) + absolute coordinate (4 bytes) + relative coordinate group (2 bytes × N) + check code (2 bytes). In this step, the dot matrix pen first allocates memory space according to the message format defined by the DPTP protocol. Data packaging is carried out in the following order: first write the message header, including the message type identifier and sequence number; then write the data segment length information; then write the absolute coordinate value, including two 4-byte values ​​of X and Y; then write the relative coordinate value of each sampling point in turn, each point including two 1-byte offsets of X and Y; finally calculate and add the check code. In the specific implementation, the dot pen stores all data in little-endian format to ensure data consistency on different platforms. After packaging, the message data has the format requirements for transmission to the upper-end application via Bluetooth.

[0072] S205: When the authentication operation result is authentication failure, the dot matrix pen interrupts the data transmission connection with the upper-end application.

[0073] The result of the authentication operation is the result obtained after the dot matrix pen verifies the identity of the upper-end application, including two states: success and failure. Authentication failure means that the authentication information provided by the upper-end application does not pass the verification rules of the dot matrix pen. The data transmission connection is the Bluetooth communication link established between the dot matrix pen and the upper-end application, which is used to transmit the writing trajectory data. Disconnection means that the dot matrix pen actively disconnects the Bluetooth communication link with the upper-end application and stops all data interaction. For example, when the password provided by the upper-end application does not match the authorization password stored in the dot matrix pen, it will cause authentication failure. When the dot matrix pen determines that the authentication operation fails, it immediately executes the connection interruption process. In specific implementation, the dot matrix pen first sends a disconnection notification containing an error code to the upper-end application. The error code value is a value in the range of 0x81-0x8F, indicating the specific reason for the authentication failure. After sending the notification, the dot matrix pen closes the Bluetooth communication interface, releases the connection resources, and enters the state of waiting for a new connection. This mechanism ensures that only the upper-end application that has passed the authentication can establish a valid data transmission connection with the dot matrix pen.

[0074] S206: The dot matrix pen sends the message data to the upper-end application.

[0075] The message data is a data packet organized according to the DPTP protocol specification, including a message header, a data segment, and a checksum. The sending process is to transmit the data packet from the dot matrix pen to the upper-end application through the Bluetooth link. The dot matrix pen is the sender of the data and is responsible for packaging and sending the collected writing trajectory data. The upper-end application is the receiver of the data and is responsible for receiving and parsing the message data. For example, a complete message data structure is: 2-byte message header + 1-byte length + 4-byte absolute coordinates + N×2-byte relative coordinates + 2-byte checksum.

[0076] In this step, the dot matrix pen sends the packaged message data through the Bluetooth communication interface. In the specific implementation, the dot matrix pen first confirms that the Bluetooth connection status is normal. Then the message data is fragmented according to the maximum transmission unit (MTU) size of the Bluetooth protocol, usually no more than 20 bytes per fragment. A serial number is added to each fragment and sent to the upper-end application in sequence through the Bluetooth characteristic value write operation. During the sending process, a sending window is maintained to track the fragments that have been sent but not confirmed. This fragment transmission mechanism ensures the reliable transmission of a large amount of writing trajectory data.

[0077] S207: The upper-end application verifies the message data and sends the verification result to the dot matrix pen.

[0078] Verification is the process by which the upper-end application verifies the integrity and correctness of the received message data. The verification result includes two states: verification success and failure, as well as the specific error type. The upper-end application is a program running on a computer or mobile device that is responsible for receiving and processing the dot matrix pen data. Verification result transmission means that the upper-end application returns the data verification result to the dot matrix pen through the Bluetooth link. For example, verification can include multiple links such as message length verification, checksum calculation, and sequence number continuity check.

[0079] In this step, the upper-end application first performs multi-level verification on the received message data. The verification process includes: verifying whether the magic field of the message header is correct, confirming whether the message length field is consistent with the actual received data length, recalculating the checksum of the data segment and comparing it with the check code in the message, and checking the continuity of the message sequence number. After completing the verification, the upper-end application generates a verification result message, the message content includes: 1 byte of verification result status code (0x00 indicates success, 0x80-0x8F indicates failure) and 2 bytes of message identifier. The upper-end application sends the verification result message to the dot matrix pen through the Bluetooth characteristic value write operation.

[0080] S208: If the verification result is a verification failure or the dot matrix pen does not receive the verification result within a preset time, the message data is resent.

[0081] The verification result is the status identifier of the received message data after the upper-end application verifies it. It is represented by 1 byte, 0x00 indicates success, and 0x80-0x8F indicates different types of failures. The preset time is the maximum time interval that the dot matrix pen waits for to receive the verification result, which is usually set to 100-200 milliseconds. Retransmission refers to the process in which the dot matrix pen repackages and transmits the previously sent message data. For example, when the upper-end application detects that the message checksum does not match, it will return a verification failure result of 0x81, or if the verification result is not received within 200 milliseconds due to network delay, these situations will trigger the message retransmission.

[0082] When executing this step, the dot matrix pen first checks the received verification result status code. If the status code is in the range of 0x80-0x8F, it means that the verification has failed, and the dot matrix pen immediately starts the retransmission mechanism. At the same time, the dot matrix pen starts a timer. If the verification result of the upper application is not received within the preset 200 milliseconds, the retransmission mechanism is also triggered after the timer times out. When retransmitting, the dot matrix pen takes out the original message data from the sending buffer, recalculates the verification code, updates the message sequence number, and then sends it again through the Bluetooth link. To prevent infinite retransmission, the dot matrix pen sets the maximum number of retransmissions for each message to 3 times, and will report a transmission error after exceeding this number. This retransmission mechanism ensures the reliability of data transmission.

[0083] S209: The dot matrix pen selects the universal data format or the private data format according to the data standard number.

[0084] The data standard number is a byte unsigned integer used to identify the type of data format used, where 0x01 indicates a universal standard and the range of 0xF0-0xFF indicates a private standard. The universal data format is a standard data structure specified by the DPTP protocol and is applicable to most dot-pen devices. The private data format is a dedicated data structure customized for a specific device or scenario. For example, the universal format uses a fixed field structure to describe handwriting data, while the private format may contain additional device-specific information.

[0085] In this step, the dot matrix pen determines the format used for subsequent data transmission based on the data standard number received in the initialization phase. When the data standard number is 0x01, the dot matrix pen chooses to use the universal data format, which has a fixed field definition and arrangement order. When the data standard number is in the range of 0xF0-0xFF, the dot matrix pen searches the internal preset private format definition table and selects the corresponding private data format. The dot matrix pen saves the selected format information in the session context for subsequent data packaging. This format selection mechanism ensures the compatibility of different types of dot matrix pen data.

[0086] S210: The dot matrix pen packages the writing trajectory data in the universal data format according to a preset data structure.

[0087] The general data format is a standard data structure defined by the DPTP protocol, which contains fixed field layout and encoding rules. The preset data structure specifies the storage format of various types of information, including coordinate data using 4 bytes to store absolute positions, 2 bytes to store relative positions, 1 byte to represent pressure values, and 4 bytes to represent timestamps. The writing trajectory data contains information such as the location, pressure, and angle of the sampling point. Packaging is the process of organizing this information into data packets in a specified format. For example, a standard data packet structure is: message header (2 bytes) + data length (1 byte) + timestamp (4 bytes) + coordinate data (6 bytes × N) + pressure value (1 byte × N) + checksum (2 bytes).

[0088] In this step, the dot matrix pen packages the writing trajectory data strictly according to the specifications of the universal data format. First, a buffer that meets the maximum packet length (244 bytes) is allocated, and a 2-byte message header is written, including a type identifier and a sequence number. Then a 1-byte data length field is written. Then a 4-byte sampling timestamp is written. For each sampling point, the X, Y coordinate values ​​(4 bytes for absolute coordinates, 2 bytes for relative coordinates), pressure value (1 byte), inclination value (1 byte) and other information are written in sequence. Finally, the checksum of the entire data segment is calculated, and a 2-byte checksum is added to the end of the packet. This standardized packaging process ensures the uniformity and compatibility of the data format.

[0089] S211. The dot matrix pen packages the writing trajectory data in the private data format according to the user-defined data structure in the private data format.

[0090] The private data format is a custom data structure specification reserved by the DPTP protocol for specific scenarios or devices, using identifiers in the range of 0xF0-0xFF. The custom data structure is a special field arrangement and encoding method defined under the private data format to meet specific application requirements. The writing trajectory data contains all the information collected by the dot pen, including basic coordinates, pressure, angle data, and extended device status, environmental parameters and other information. The packaging process is to organize this information into data packets according to the rules of the private format. For example, the data structure defined by a private format (identifier 0xF1) is: basic information segment (including coordinates, pressure, etc.) + extended information segment (including battery power, signal strength, etc.) + custom check segment, while the structure of another private format (identifier 0xF2) may be completely different, containing specific encrypted fields or compressed fields.

[0091] When executing this step, the dot matrix pen first reads the private format definition of the corresponding identifier from the internal storage. This definition contains complete field layout, data type, encoding rules and other information. The specific packaging process is carried out in the following order: first, a private format data packet header is created, which contains a 4-byte format identifier and version information; then, according to the specifications of the private format, the basic data segment is packaged, including an 8-byte device ID, a 4-byte timestamp, and coordinate data (different compression algorithms may be used according to the requirements of the private format); then the extended data segment is packaged, such as 2 bytes of battery power, 2 bytes of signal strength, 1 byte of working mode, etc.; finally, the check value is calculated according to the check algorithm defined in the private format (such as CRC16, MD5, etc.) and added to the end of the data packet. The entire packaging process strictly follows the specifications of the private format to ensure data integrity and the needs of specific application scenarios. The dot matrix pen will also add a tag field unique to the private format to the data packet for the receiving end to quickly identify and correctly parse the data packet. This flexible private format mechanism enables the DPTP protocol to adapt to the needs of various special application scenarios.

[0092] The following describes the communication system of the DPTP protocol in the embodiment of the present invention from the perspective of hardware processing. Figure 3 , which is a schematic diagram of a physical device structure of a communication system of the DPTP protocol in an embodiment of the present application.

[0093] It should be noted that Figure 3 The structure of the communication system of the DPTP protocol shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0094] like Figure 3 As shown, the communication system of the DPTP protocol includes a central processing unit (CPU) 301, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 302 or the program loaded from the storage part 308 to the random access memory (RAM) 303, such as executing the method described in the above embodiment. In the RAM 303, various programs and data required for system operation are also stored. The CPU 301, the ROM 302 and the RAM 303 are connected to each other through the bus 304. The input / output (I / O) interface 305 is also connected to the bus 304.

[0095] The following components are connected to the I / O interface 305: an input section 306 including an audio input device, a button switch, etc.; an output section 307 including a liquid crystal display (LCD) and an audio output device, an indicator light, etc.; a storage section 308 including a hard disk, etc.; and a communication section 309 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 309 performs communication processing via a network such as the Internet. A drive 310 is also connected to the I / O interface 305 as needed. A removable medium 311, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 310 as needed so that a computer program read therefrom is installed into the storage section 308 as needed.

[0096] In particular, according to an embodiment of the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present invention includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication part 309, and / or installed from a removable medium 311. When the computer program is executed by the central processing unit (CPU) 301, various functions defined in the present invention are performed.

[0097] It should be noted that specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, apparatus, or device.

[0098] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present invention. Each box in the flowchart or block diagram may represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions marked in the box may also occur in an order different from that marked in the accompanying drawings.

[0099] Specifically, the communication system of the DPTP protocol of this embodiment includes a processor and a memory. The memory stores a computer program. When the computer program is executed by the processor, the communication method of the DPTP protocol provided in the above embodiment is implemented.

[0100] As another aspect, the present invention further provides a computer-readable storage medium, which may be included in the communication system of the DPTP protocol described in the above embodiment; or may exist independently without being assembled into the communication system of the DPTP protocol. The above storage medium carries one or more computer programs, and when the above one or more computer programs are executed by a processor of the communication system of the DPTP protocol, the communication system of the DPTP protocol implements the communication method of the DPTP protocol provided in the above embodiment.

[0101] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

[0102] As used in the above embodiments, the term "when..." may be interpreted to mean "if..." or "after..." or "in response to determining..." or "in response to detecting...", depending on the context. Similarly, the phrases "upon determining..." or "if (the stated condition or event) is detected" may be interpreted to mean "if determining..." or "in response to determining..." or "upon detecting (the stated condition or event)" or "in response to detecting (the stated condition or event)", depending on the context.

[0103] Those skilled in the art can understand that to implement all or part of the processes in the above-mentioned embodiments, the processes can be completed by computer programs to instruct related hardware, and the programs can be stored in computer-readable storage media. When the programs are executed, they can include the processes of the above-mentioned method embodiments. The aforementioned storage media include: ROM or random access memory RAM, magnetic disk or optical disk and other media that can store program codes.

Claims

1. A communication method of DPTP protocol, characterized in that: A communication system applied to the DPTP protocol, wherein the communication system of the DPTP protocol includes a dot matrix pen and an upper-end application, and the method includes: When the dot matrix pen is connected to the upper-end application, the dot matrix pen receives the protocol level and data standard number sent by the upper-end application to the dot matrix pen; The dot matrix pen returns a confirmation message to the upper-end application, wherein the confirmation message includes a device authentication policy number; If the authentication policy number indicates that authentication is required, the dot matrix pen performs an authentication operation on the authentication instruction sent by the upper-end application; When the authentication operation result is that the authentication is successful or the authentication policy number indicates that authentication is not required, the dot matrix pen packages the collected writing trajectory data into message data in the data format according to the data format corresponding to the data standard number; The dot matrix pen sends the message data to the upper-end application.

2. The method according to claim 1, characterized in that The step of packaging the collected writing trajectory data into message data in the data format according to the data format corresponding to the data standard number by the dot matrix pen specifically includes: When a page change operation is detected, the dot matrix pen packages the page number information in the writing trajectory data into message data in the data format.

3. The method according to claim 1, characterized in that: The step of packaging the collected writing trajectory data into message data in the data format according to the data format corresponding to the data standard number by the dot matrix pen specifically includes: The dot matrix pen sets the coordinate information in the writing trajectory data as absolute coordinates and relative coordinates; The dot matrix pen uses the absolute coordinates to record a reference position, and uses the relative coordinates to record a position offset relative to the reference position; The dot matrix pen records the absolute coordinates according to the preset number of sampling points; The dot matrix pen calculates the offset of the sampling point positions within the preset number of sampling points relative to the absolute coordinates, and records the offset as the relative coordinates; The dot matrix pen packages the absolute coordinates and the relative coordinates into message data in the data format.

4. The method according to claim 1, characterized in that: After the step of the dot matrix pen sending the message data to the upper-end application, the method further includes: The upper-end application verifies the message data and sends the verification result to the dot matrix pen; If the verification result is a verification failure or the dot matrix pen does not receive the verification result within a preset time, the message data is resent.

5. The method according to claim 1, characterized in that The data format corresponding to the data standard number includes a packaging rule and a transmission rule for the writing trajectory data, and the data transmission rate in the transmission rule is determined by the sampling rate of the writing trajectory data.

6. The method according to claim 1, characterized in that In the case where the dot matrix pen is connected to the upper-end application, after the step of the dot matrix pen receiving the protocol level and data standard number sent by the upper-end application to the dot matrix pen, the method further includes: The dot matrix pen selects the universal data format or the private data format according to the data standard number; The dot matrix pen packages the writing trajectory data in the universal data format according to a preset data structure; The dot matrix pen packages the writing trajectory data in the private data format according to the custom data structure in the private data format.

7. The method according to claim 1, characterized in that After the step of the dot matrix pen sending the message data to the upper-end application, the method further includes: When the authentication operation result is authentication failure, the dot matrix pen interrupts the data transmission connection with the upper-end application.

8. A communication system of DPTP protocol, characterized in that: The communication system of the DPTP protocol includes: one or more processors and a memory; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors call the computer instructions to enable the communication system of the DPTP protocol to execute the method described in any one of claims 1-7.

9. A computer-readable storage medium comprising instructions, characterized in that: When the instruction is executed on the communication system of the DPTP protocol, the communication system of the DPTP protocol executes the method as described in any one of claims 1-7.

10. A computer program product, characterized in that When the computer program product runs on a communication system of the DPTP protocol, the communication system of the DPTP protocol executes the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Methods and systems for determining haplotypes and phasing of haplotypes

    CN108486236A

  • Precise time synchronization method based on programmable data plane

    CN114337893A

  • Method and system for realizing communication interconnection of various devices based on intelligent message template

    CN114928648A

  • Dot matrix pen system and decoding method

    CN115376134A

  • UDP protocol data transmission method, system and device based on ARQ

    CN115883680A

Cited By

  • Dot matrix pen collective creation data block storage system based on region division

    CN121411700A

  • Dot matrix pen collective creation data block storage system based on region division

    CN121411700B