A communication method, system, product and medium of DPTP protocol

Through the DPTP protocol, the dot matrix pen negotiates data format and security policies with the upper-end application. By combining absolute and relative coordinate data packaging methods, the problem of inconsistent data formats between pens from different manufacturers is solved, improving the accuracy and stability of data transmission, reducing resource consumption, and achieving seamless integration and data security for pens from multiple manufacturers.

CN119561979BActive Publication Date: 2025-12-12BEIJING TOGETHER EDUCATION TECH DEV CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

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

Smart Images

  • Figure CN119561979B_ABST
    Figure CN119561979B_ABST
Patent Text Reader

Abstract

A communication method, system, product and medium of a DPTP protocol, relating to the field of data transmission, the method comprising: in the case that the dot matrix pen and the upper end application establish a connection, 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 an acknowledgement message to the upper end application, the acknowledgement message containing a device authentication strategy number; if the authentication strategy number indicates that authentication is required, the dot matrix pen performs authentication operation on the authentication instruction sent by the upper end application; in the case that the authentication operation result is authentication success or the authentication strategy number indicates that authentication is not required, the dot matrix pen packs the collected writing track data into message data in 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 layer 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, in particular to a DPTP protocol communication method, system, product and medium. BACKGROUND

[0002] With the development of education informatization, intelligent writing devices are increasingly widely used in teaching scenarios. Among them, the dot matrix pen as an intelligent writing device, through writing on special dot matrix code paper, collects writing trajectory data and transmits it to the upper application for processing, to realize digital recording of writing content.

[0003] In related technologies, dot matrix pen manufacturers each use independently developed data transmission protocols, which define fixed data formats and transmission rules in the protocols. Under this protocol design method, the dot matrix pen sends the collected writing trajectory data after packaging by the preset data structure, and the upper application parses according to the agreed format, thereby completing data transmission.

[0004] However, since dot matrix pens of different manufacturers use different data formats, and the preset data parsing rules of the upper application are often only applicable to data of a specific format, the data processing process is relatively cumbersome and prone to errors, and the accuracy is insufficient. SUMMARY

[0005] The present application provides a DPTP protocol communication method, system, product and medium for improving the stability of data transmission between the dot matrix pen and the upper application.

[0006] In a first aspect, the present application provides a DPTP protocol communication method applied to a DPTP protocol communication system, the DPTP protocol communication system comprising a dot matrix pen and an upper application, the method comprising: in the case that the dot matrix pen and the upper application establish a connection, the dot matrix pen receives a protocol level and a data standard number sent by the upper application to the dot matrix pen; the dot matrix pen returns an acknowledgement message to the upper application, the acknowledgement message comprising a device authentication strategy number; if the authentication strategy number indicates that authentication is required, the dot matrix pen performs an authentication operation on the authentication instruction sent by the upper application; in the case that the authentication operation result is authentication success or the authentication strategy number indicates that authentication is not required, the dot matrix pen packages the collected writing trajectory data into message data of the data format corresponding to the data standard number; and the dot matrix pen sends the message data to the upper application.

[0007] By adopting the technical scheme, 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 the data standard number, returns the confirmation message containing the authentication strategy number, and processes the writing track data according to the authentication condition. The ordered interaction and processing mechanism make the data transmission process standard and safe, the dot matrix pen packs and sends the data in the format corresponding to the data standard number according to the data standard number, ensures the consistency of the data format, avoids the problems of complicated data processing and error-prone caused by inconsistent format, and effectively improves the accuracy and stability of data transmission.

[0008] In combination with some embodiments of the first aspect, in some embodiments, the dot matrix pen packs the collected writing track data into the message data in the data format corresponding to the data standard number, specifically including: when detecting a page changing operation, the dot matrix pen packs the page number information in the writing track data into the message data in the data format.

[0009] By adopting the technical scheme, when detecting a page changing operation, the dot matrix pen packs the page number information in the writing track data into the message data in the corresponding data format. Compared with the prior art of transmitting page number information every time data is transmitted, this operation only transmits page number information when changing pages, 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, the dot matrix pen packs the collected writing track data into the message data in the data format corresponding to the data standard number, specifically including: the dot matrix pen sets the coordinate information in the writing track data as absolute coordinates and relative coordinates; the dot matrix pen records the reference position by using the absolute coordinates and records the position offset relative to the reference position by using the relative coordinates; the dot matrix pen records the absolute coordinates according to a preset sampling point number; the dot matrix pen calculates the offset relative to the absolute coordinates for the sampling point positions within the preset sampling point number and records the offset as the relative coordinates; and the dot matrix pen packs the absolute coordinates and the relative coordinates into the message data in the data format.

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

[0012] In some embodiments of the first aspect, after the step of sending the message data to the upper application by the dot pen, the method further comprises: checking the message data by the upper application and sending the checking result to the dot pen; and resending the message data if the checking result is a checking failure or the dot pen does not receive the checking result within a preset time.

[0013] By adopting the technical solution, the data format corresponding to the data standard number comprises a packing rule and a transmission rule, and the data transmission rate in the transmission rule is determined by the sampling rate of the writing track data. This feature makes the data format closely combined with the collection and transmission of the data. In actual application, different sampling rates correspond to appropriate data transmission rates, avoiding data transmission problems caused by rate mismatch. For example, in a high-speed writing scenario, a higher sampling rate can ensure the integrity of data collection, and a transmission rate matched therewith can ensure timely data transmission.

[0014] In some embodiments of the first aspect, the data format corresponding to the data standard number comprises a packing rule and a transmission rule for the writing track data, and the data transmission rate in the transmission rule is determined by the sampling rate of the writing track data.

[0015] By adopting the technical solution, the dot pen selects the general data format or the private data format according to the number after establishing a connection with the upper application and receiving the data standard number. This flexible format selection mode packs the writing track data according to a preset data structure in the general data format, ensuring the standardization and generality of the data format; and packs the writing track data according to a self-defined data structure in the private data format, meeting the individual needs of special devices or scenarios.

[0016] In some embodiments of the first aspect, after the step of receiving the sending of the protocol level and the data standard number from the upper application by the dot pen under the condition that the dot pen establishes a connection with the upper application, the method further comprises: selecting the general data format or the private data format by the dot pen according to the data standard number; packing the writing track data according to a preset data structure in the general data format by the dot pen; and packing the writing track data according to a self-defined data structure in the private data format by the dot pen.

[0017] By adopting the technical scheme, after the dot matrix pen establishes a connection with the upper application and receives the data standard number, the dot matrix pen selects a general data format or a private data format according to the number. The flexible format selection mode packs the writing track data according to a preset data structure in the general data format, ensuring the standardization and generality of the data format; and in the private data format, the writing track data is packed according to a self-defined data structure, meeting the individual needs of special devices or scenes.

[0018] With reference to the embodiments of the first aspect, in some embodiments, after the dot matrix pen sends the message data to the upper application, the method further includes: if the authentication operation result is authentication failure, the dot matrix pen interrupts the data transmission connection with the upper application.

[0019] By adopting the technical scheme, in the data interaction process between the dot matrix pen and the upper application, the authentication operation becomes a key link for ensuring data security, and when the authentication operation result is authentication failure, the dot matrix pen interrupts the data transmission connection with the upper application, preventing unauthorized upper applications from obtaining the writing track data collected by the dot matrix pen, and ensuring the security and confidentiality of the data.

[0020] In the second aspect, the embodiments of the present application provide a DPTP protocol communication system, which comprises one or more processors and a memory; the memory is coupled to the one or more processors, and the memory is configured to store computer program code, the computer program code comprising computer instructions, and the one or more processors are configured to invoke the computer instructions to enable the DPTP protocol communication system to perform the method described in the first aspect and any possible implementation manner of the first aspect.

[0021] In the third aspect, the embodiments of the present application provide a computer program product comprising instructions, which, when executed on a DPTP protocol communication system, enable the DPTP protocol communication system to perform the method described in the first aspect and any possible implementation manner of the first aspect.

[0022] In the fourth aspect, the embodiments of the present application provide a computer readable storage medium comprising instructions, which, when executed on a DPTP protocol communication system, enable the DPTP protocol communication system to perform the method described in the first aspect and any possible implementation manner of the first aspect.

[0023] It can be understood that the DPTP protocol communication system 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 embodiments of the present application. Therefore, the beneficial effects that can be achieved are referred to the beneficial effects in the corresponding method, which will not be described here.

[0024] The one or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages:

[0025] 1. In the DPTP protocol communication system, the dot matrix pen and the upper end application establish a connection and then perform a series of interactions. The dot matrix pen receives the protocol level and data standard number, returns an acknowledgement message containing the authentication strategy number, and processes the writing track data according to the authentication situation. This orderly interaction and processing mechanism makes the data transmission process standardized and safe. The dot matrix pen packs and sends data in the format corresponding to the data standard number, ensuring the consistency of the data format, avoiding the tedious and error-prone problems caused by inconsistent formats, and effectively improving the accuracy and stability of data transmission.

[0026] 2. When the page change operation is detected, the dot matrix pen packs the page number information in the writing track data into message data in the corresponding data format. Compared with the prior art, which transmits page number information every time data is transmitted, this operation only transmits page number information when the page is changed, improving the data transmission efficiency in the dot matrix pen with low power consumption and limited storage space.

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

[0028] Figure 1 is a flowchart of the communication method of the DPTP protocol in the embodiments of the present application;

[0029] Figure 2 is another flowchart of the communication method of the DPTP protocol in the embodiments of the present application;

[0030] Figure 3 is a schematic diagram of an entity device structure of the DPTP protocol communication system in the embodiments of the present application. DETAILED DESCRIPTION

[0031] The terminology used in the following embodiments of the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of the present application. As used in the description of the application, the singular forms "a", "an" and "the" are intended to include plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "and / or", as used herein, refers to

[0032] Hereinafter, the terms "first", "second" are only used for the purpose of description, and cannot be understood as implying or suggesting relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined with "first", "second" can explicitly or implicitly include one or more of the features, and in the description of the embodiments of the present application, the meaning of "a plurality of" is two or more, unless otherwise specified.

[0033] In order to facilitate understanding, the application scenarios of the embodiments of the present application are introduced as follows.

[0034] In the smart classroom of a certain 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 limited. In actual use, the following problems have occurred: different dot pens from different manufacturers use different data formats, which requires the upper application to develop a specific analysis module for each pen type; in a high-density use environment (such as 30 pens working at the same time), due to the non-uniform 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 cause memory overflow or rapid battery depletion.

[0035] A school uses an existing dot pen solution developed by A manufacturer. The protocol uses a fixed data format to package and send the collected coordinates, pressure, and other information according to the pre-defined field definition. When dot pens from A manufacturer and B manufacturer are used at the same time in the classroom, the data from the B manufacturer's pen cannot be directly processed by the system due to the different data format used by the B manufacturer's pen. In order to solve this problem, the school has to deploy two sets of display systems in each classroom, or develop a complex data conversion module. Moreover, since the protocol design does not take into account the hardware limitations of the dot pen, the data packaging process occupies a large amount of memory and processing resources, resulting in the need to replace the battery of the dot pen every class, which seriously affects the teaching experience.

[0036] After the education institution adopts the DPTP protocol, multiple dot pens of different manufacturers can be used simultaneously in the classroom. When the teacher uses a dot pen of manufacturer A, the pen establishes a connection with the upper-layer application and determines to use a general data format (number 0x01) through protocol negotiation. The dot pen uses a mixed coding mode of relative coordinates and absolute coordinates, records an absolute coordinate every 8 sampling points, and uses a 1-byte relative offset to represent the middle point, thereby significantly reducing the data volume. Meanwhile, the dot pen of manufacturer B supports a private format mechanism (uses number 0xF1) through the protocol, thereby realizing seamless connection with the upper-layer application while maintaining adaptation to the hardware characteristics. This way not only solves the compatibility problem of multiple dot pens, but also reduces the resource consumption of the dot pen through an optimized data coding mode.

[0037] For ease of understanding, the method provided by the embodiment is described in a flow. Please refer to Figure 1 , which is a flow diagram of the communication method of the DPTP protocol in the embodiment of the present application.

[0038] S101, in the case where the dot pen establishes a connection with the upper-layer application, the dot pen receives the protocol level and data standard number sent by the upper-layer application to the dot pen.

[0039] The dot pen refers to a kind of intelligent writing device, which is used to collect writing track data and transmit the data to a receiving end through Bluetooth. The upper-layer application refers to a software program running on a computer, a mobile phone or the like, which is used to receive and process dot pen data. The connection establishment refers to the process of establishing a Bluetooth communication link between the dot pen and the upper-layer application, including three stages of 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, wherein 0x01 represents a general standard, and 0xF0-0xFF represents a private standard. For example, the protocol level 0x01 indicates that the DPTP protocol 1.0 version is used, and the data standard number 0x01 indicates that the general data format is used.

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

[0041] In some embodiments, the process of receiving and processing the initialization parameters by the dot pen can be implemented in various ways: optionally, after receiving the Bluetooth connection request, the dot pen first enters a waiting state, starts a 5-second timer, and must receive the initialization parameters sent by the upper application before the timer expires. After receiving, the parameter values are immediately parsed and saved, and if the parameters are valid, the timer is stopped and the normal working state is entered, if the parameters are invalid or the timer expires, the Bluetooth connection is actively disconnected; optionally, after the Bluetooth connection is established, the dot pen first sends a request for initialization to the upper application, then waits for the response of the upper application, and after receiving the response, the protocol level and data standard number are parsed. Match these parameters with the internal supported parameter list, if the matching is successful, enter the normal working state, if the matching fails, return an error code and remain in the initialization state. It can be understood that other ways can also be used to implement the parameter initialization process of the dot pen and the upper application, which is not limited here.

[0042] S102, the dot pen returns an acknowledgement message to the upper application, and the acknowledgement message contains a device authentication policy number.

[0043] The acknowledgement message refers to the response message of the dot 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 pen, which is represented by a 1-byte unsigned integer, wherein 0x00 indicates no authentication, and other values indicate specific authentication policies. The return process refers to the operation of the dot pen sending the acknowledgement message to the upper application through the Bluetooth characteristic value. For example, the authentication policy number 0x01 can represent password authentication, and 0x02 represents certificate authentication.

[0044] This step is executed after the dot pen completes the initialization parameter receiving, which is used to confirm the parameter receiving state to the upper application and inform the security authentication requirement. Specifically, the dot pen determines the authentication policy required for the current session according to the internal configuration, and generates an acknowledgement message. The acknowledgement message contains a 2-byte message header (identifying the message type and sequence number), a 1-byte authentication policy number, a 2-byte status code (indicating whether the parameter receiving is successful), and a 2-byte check code. The dot pen sends the message to the upper application through the Bluetooth characteristic value.

[0045] In some embodiments, the generation and sending process of the confirmation message can be implemented in various ways: optionally, the dot 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 strategy, generates a confirmation message containing complete device information, calculates the CRC16 check value of the message content, and finally sends the complete message through the Bluetooth characteristic value once. Optionally, the dot pen first sends a simple parameter reception confirmation, and then returns detailed device information and authentication strategy when the upper application requests. The confirmation message uses segmented transmission, each segment contains an independent check code, and the upper application receives all segments before completing the confirmation process. It can be understood that other ways can also be used to implement the transmission process of the confirmation message, which is not limited here.

[0046] S103, if the authentication strategy number indicates that authentication is required, the dot pen performs authentication operation on the authentication instruction sent by the upper application.

[0047] The authentication strategy number is a 1-byte unsigned integer used by the dot pen to identify the security authentication method, indicating the authentication mechanism used in the current session. The authentication instruction indicates the data packet sent by the upper application containing authentication information, which is used to provide the credentials required for identity verification to the dot pen. The authentication operation is the process of verifying the received authentication information by the dot pen, which is used to ensure that only authorized upper applications can access the device. The need for authentication indicates that the value of the authentication strategy number is not 0x00, indicating that security authentication must be performed in the current session. For example, when the authentication strategy number is 0x01, the authentication instruction needs to contain preset password information; when the number is 0x02, the instruction needs to contain digital certificate information.

[0048] This step is executed after the dot pen sends the confirmation message, and is used to verify the access rights of the upper application. Specifically, the dot pen checks the authentication strategy number in the confirmation message, and if the value is not 0x00, it enters the authentication state. The dot pen waits to receive the authentication instruction sent by the upper application, which contains 2 bytes of instruction type, N bytes of authentication data (length variable according to authentication strategy), and 2 bytes of check code. After receiving the complete authentication instruction, the dot pen selects the corresponding verification algorithm according to the authentication strategy number and verifies the authentication data.

[0049] In some embodiments, the authentication process of the dot pen can be implemented in various ways: optionally, after receiving the authentication instruction, the dot pen first performs instruction format verification and check code comparison, then extracts the password field from the instruction, compares it with the authorized password stored in the device, and if they match completely, marks the authentication as successful, otherwise returns an error code; if no valid authentication instruction is received within a preset time, the connection is automatically disconnected; optionally, after entering the authentication state, the dot pen first sends a random challenge value to the upper application, then receives the response data encrypted by the private key of the upper application, and the dot pen verifies the signature of the response data using the pre-stored public key, checks the validity period and permission level of the certificate, and marks the authentication as successful only after all verifications are passed. Any failure of the verification will result in disconnection of the connection. It can be understood that other ways can also be used to implement the security authentication process of the dot pen, which is not limited here.

[0050] S104、In the case that the authentication operation result is authentication success or the authentication policy number indicates that no authentication is required, the dot pen packs the collected writing trajectory data into message data in the data format corresponding to the data standard number.

[0051] The authentication operation result refers to the determination result of the dot pen after completing the identity verification, and is used to indicate whether the authentication is passed. The data standard number is a 1-byte unsigned integer that specifies the data format type, and is used to indicate the data organization method. The writing trajectory data refers to the handwriting information collected by the dot pen, including coordinates, pressure, angle, etc. 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 refers to the data packet organized according to the protocol format, which is used for transmission between the dot pen and the upper 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.

[0052] This step is executed after the dot pen completes the authentication verification or confirms that no authentication is required, and is used to process the collected writing data. Specifically, the dot pen first confirms that the current working state meets the data transmission conditions, and then finds the corresponding format definition according to the data standard number. For the data collected in each sampling period, the dot 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 the data packet is organized according to the format specification, and necessary control information and check code are added.

[0053] In some embodiments, the data processing and packaging process of the dot pen can be implemented in various ways: optionally, the dot pen maintains a circular buffer to store raw sampling data, when the buffer accumulates to a predetermined size, the data processing flow is started, first coordinate system conversion and numerical normalization are performed, then the processed data is organized into a packet according to the specification of the data format, and finally the CRC check code is calculated and added; after processing, the buffer is emptied, and the next round of data acquisition is prepared; optionally, the dot pen adopts a real-time processing mode, and immediately performs format conversion after collecting a group of data, and stores the converted data into a sending queue, while maintaining a sliding window to control the data flow, when the accumulated data in the queue reaches the size of a complete packet, the packet header and check information are added, and the complete packet is submitted to the transmission module. It can be understood that other ways can also be used to implement the data format conversion and packaging process of the dot pen, which is not limited here.

[0054] S105, the dot pen sends the packet data to the upper application.

[0055] Wherein, the packet data refers to the data packet organized according to the DPTP protocol specification, which is a data structure for carrying 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 through Bluetooth. The upper application indicates a software program that receives and processes dot pen data, which is used to analyze and display writing trajectory information. The sending process refers to the operation of transmitting data through a Bluetooth communication link, which is used to realize the data exchange between the dot pen and the upper application. The data transmission rate indicates the speed of the dot pen sending data, which is used to match the sampling rate of the writing trajectory data, for example, 50 frames / second corresponds to 300 bytes / second, 100 frames / second corresponds to 500 bytes / second transmission rate. For example, a complete packet data includes a 2-byte packet header, a 1-byte data length, an N-byte data segment, and a 2-byte check code.

[0056] This step is executed after the dot pen completes data packaging, which is used to realize reliable transmission of data. Specifically, the dot pen first checks the Bluetooth connection state 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 packet data larger than the MTU is divided into multiple data segments. Each data segment adds a 2-byte sequence number identifier and a 2-byte segment check code. The dot pen sends these data segments in turn according to the set transmission rate through the Bluetooth feature value write operation. At the same time, a sending window is maintained to record the data segments that have been sent but have not received an acknowledgement.

[0057] In some embodiments, the data sending process of the dot pen can be implemented in various ways: optionally, the dot pen creates a sending buffer before sending data, stores the complete message data in the buffer, then calculates the number of fragments needed according to the MTU size, generates a unique sequence number for each fragment, writes the fragment data one by one to the Bluetooth characteristic value, starts a timeout timer for each fragment sent, if an acknowledgement from the upper application is received before the timeout, the next fragment is sent, if no acknowledgement is received before the timeout, the current fragment is retransmitted, until all fragments are sent or the maximum number of retries is reached; optionally, the dot pen uses a sliding window mechanism to control data sending, first sets the window size (such as 4 fragments), then sends all fragments in the window, then waits for batch acknowledgements from the upper application, after receiving the acknowledgements, the window slides forward and new fragments are sent, if a packet is found to be lost, only the lost packet is retransmitted, and the sending rate is dynamically adjusted to adapt to network conditions. It can be understood that other ways can also be used to implement the data transmission process of the dot pen, which are not limited here.

[0058] The method provided by the present embodiment is further described in more detail below. Please refer to Figure 2 , another flowchart of the communication method of the DPTP protocol in the embodiment of the present application.

[0059] S201, in the case where the dot pen and the upper application establish a connection, the dot pen receives the protocol level and the data standard number sent by the upper application to the dot pen, the data format corresponding to the data standard number includes the packing rule and the transmission rule of the writing track data, and the data transmission rate in the transmission rule is determined by the sampling rate of the writing track data.

[0060] The dot pen is a kind of intelligent writing device, which captures the coding information on the special dot code paper through the built-in infrared high-speed camera, so as to realize the collection of writing track. The upper application is an application program for data interaction with the dot pen, which can be software running on PC, mobile phone and other devices. The protocol level is represented by an unsigned integer of one byte, which indicates the revision version number of the protocol, and the current version value is 1. The data standard number is also represented by an unsigned integer of one byte, which indicates the data standard adopted, wherein 0x01 represents a general standard, and the segment of 0xF0-0xFF is used for defining a private standard. The data format specifies the packing rule (such as data structure, field definition, etc.) and the transmission rule (such as transmission rate, check mechanism, etc.) of the writing track data. The sampling rate is the frequency of collecting writing track data by the dot pen, which is generally 50 frames / second or 100 frames / second.

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

[0062] S202, the dot pen returns an acknowledgement message to the upper application, which contains a device authentication policy number.

[0063] The acknowledgement message is a response message of the dot 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 is represented by an unsigned integer of one byte, indicating the authentication method used, where 0x00 means no authentication is needed, and other values mean a specific authentication policy needs to be used. The authentication policy can include password authentication, certificate authentication, and other methods, which are used to ensure that the dot pen only connects with authorized upper applications.

[0064] After receiving the initialization request of the upper application, the dot pen generates and returns an acknowledgement message. The acknowledgement message contains a device authentication policy number, which informs the upper application whether authentication is needed and which authentication method to use. For example, when the number is 0x00, it means that the dot pen allows any upper application to access; when the number is 0x01, it may mean that a preset pairing password needs to be entered; when the number is 0x02, it may mean that a digital certificate needs to be verified. This mechanism allows the dot pen to flexibly control access permissions and protect device security.

[0065] S203, if the authentication policy number indicates that authentication is needed, the dot pen performs authentication operations on the authentication instructions sent by the upper application.

[0066] Authentication is the process of verifying whether the upper application has the right to use the dot pen. The authentication instruction is a message sent by the upper application containing authentication information (such as password, certificate, etc.). The authentication operation is the specific process of the dot pen verifying the authentication information, including information parsing, rule matching, result determination, etc. The authentication result indicates whether the authentication is passed, and if it is successful, subsequent data transmission is allowed, and if it fails, the connection is rejected.

[0067] When the authentication policy number in the confirmation packet is not 0x00, the pen will wait for the host application to send an authentication instruction. After receiving the authentication instruction, the pen will verify according to the preset rules. For example, in the password authentication mode, the pen will compare the received password with the authorized password stored in the internal storage; in the certificate authentication mode, the pen will verify the validity and authority level of the certificate. Only when the authentication operation is determined to be successful, the pen will continue to execute the subsequent data transmission process. This step realizes the security control of the pen usage authority.

[0068] S204, in the case of authentication success or the authentication policy number indicating that no authentication is required, when a page change operation is detected, the pen packs the page number information in the writing trajectory data into a packet data in the data format.

[0069] In some embodiments, step S104 can further include the following steps:

[0070] The pen sets the coordinate information in the writing trajectory data as absolute coordinates and relative coordinates;

[0071] Specifically, the writing trajectory data is the pen tip motion information collected by the built-in infrared camera, including position, pressure, angle, etc. Coordinate information is a two-dimensional coordinate value describing the position of the pen tip on the special dot matrix paper. Absolute coordinates use 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. Relative coordinates are the position difference relative to a certain reference position, usually only 1 byte is needed to represent the position change in a small range. For example, in a 10mm×10mm writing range, absolute coordinates need to use a value like (1000, 1000) to represent the exact position, while relative coordinates only need to use an offset value like (-5, +3) to represent the relative position. In this step, the pen converts the coordinate representation of the collected writing trajectory data. The pen first retains the original absolute coordinate value, and calculates the relative coordinate value. In specific implementation, the pen sets two coordinate fields in the data structure for each sampling point: one uses 4 bytes to store the complete absolute coordinate value (X, Y), and the other uses 2 bytes to store the offset (△X, △Y) relative to the reference point.

[0072] The 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;

[0073] Specifically, the reference position is a reference position point expressed in absolute coordinates, serving 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 absolute coordinates provide accurate positioning, and relative coordinates provide efficient storage. In actual applications, if the point (1000, 1000) is taken as the reference position, the position offset of the surrounding point (1002, 1003) is (+2, +3), and in this way, the data storage space can be greatly reduced. In the specific execution process, the dotter pen records the position of the key point in the writing trajectory in real time. For each sampling point set as a reference, the dotter pen uses 4 bytes of absolute coordinate value (X, Y) to record its position completely. For other sampling points near the reference point, the dotter pen calculates their position offset relative to the reference point and uses 1 byte of relative coordinate value (△X, △Y) to record the offset. This recording method ensures the accuracy of the position data, and at the same time, significantly reduces the data volume by using relative coordinates.

[0074] The dotter pen records the absolute coordinate according to the preset number of sampling points;

[0075] Specifically, the preset number of sampling points refers to recording a complete absolute coordinate value every certain number of sampling points in a continuous writing trajectory. This value is usually set to 8 or 16. Sampling points are position data points of handwriting obtained by the dotter pen during writing. The sampling frequency is generally 50 times per second or 100 times per second. Recording absolute coordinates refers to storing the spatial position of sampling points using complete position information, which requires 4 bytes of storage space. For example, if absolute coordinates are recorded every 8 sampling points, 12-13 absolute coordinate values need to be recorded per second at a sampling rate of 100 Hz. In this step, the dotter pen records absolute coordinates according to the pre-set sampling point interval. In specific implementation, the dotter pen maintains a sampling point counter, and increments the counter by 1 for each point collected. When the counter value reaches the preset number of sampling points, the dotter pen records the complete coordinate value of the current sampling point as the absolute coordinate, and resets the counter to zero to start counting again.

[0076] The dotter pen calculates the offset relative to the absolute coordinate for the position of the sampling points within the preset number of sampling points, and records the offset as the relative coordinate;

[0077] Specifically, the offset refers to the position difference of a sample point relative to a reference point, and is expressed as a signed integer in the displacement in the X-axis and Y-axis directions. The sample point position is the spatial coordinates of a handwriting track point acquired by the dotter pen during writing, composed of X and Y values. The preset number of sample points defines the number of sample points between two absolute coordinate recording points, usually set to 8 or 16 points. The relative coordinates use a smaller number of bytes (usually 1 byte) to record the position offset information, which can save storage space compared to the absolute coordinates (usually 4 bytes). For example, if the absolute coordinate point position is (1000, 1000), and the position of a sample point is (1003, 998), the calculated offset is (+3, -2), and this offset is recorded as a relative coordinate. When performing this step, the dotter pen first acquires the absolute coordinate value of the current record as the reference point. For each sample point after the absolute coordinate point, the dotter pen performs the following calculation: subtract the X coordinate of the sample point from the X coordinate of the reference point to obtain the X direction offset, and subtract the Y coordinate of the sample point from the Y coordinate of the reference point to obtain the Y direction offset. Since the position change between adjacent sample points will not be too large, these offsets are usually within the range of -128 to +127, so they can be stored in a byte of signed integer. The dotter pen stores the calculated X and Y offsets in the relative coordinate data structure, respectively, until all sample points within the preset number are processed.

[0078] The dotter pen packs the absolute coordinate and the relative coordinate into the packet data of the data format.

[0079] Specifically, the message data is an information packet organized in a data transmission format defined by the DPTP protocol. The data format defines the specific structure of the data packet, including the arrangement and length specification of the fields such as the message header, data segment, and check code. The absolute coordinate data occupies 4 bytes of space and records the spatial position of the reference point completely. The relative coordinate data occupies 2 bytes of space for each point and records the positional offset relative to the reference point. The packaging process organizes 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 x N) + check code (2 bytes). In this step, the dotter first allocates memory space according to the message format defined by the DPTP protocol. The data packaging is performed in the following order: first, write the message header, which includes the message type identifier and sequence number; then write the data segment length information; then write the absolute coordinate value, which includes two 4-byte values of X and Y; then write the relative coordinate value of each sampling point in turn, each point containing two 1-byte offsets of X and Y; finally, calculate and add the check code. In specific implementation, the dotter stores all data in little-endian mode to ensure consistency of data on different platforms. After completing the packaging, the message data meets the format requirements for transmission to the upper application through Bluetooth.

[0080] S205, in the case of an authentication operation result being authentication failure, the dotter interrupts the data transmission connection with the upper application.

[0081] The authentication operation result is the judgment result obtained after the dotter verifies the identity of the upper application, including success and failure. Authentication failure means that the authentication information provided by the upper application does not pass the verification rules of the dotter. The data transmission connection is the Bluetooth communication link established between the dotter and the upper application for transmitting writing trajectory data. Interrupting the connection means that the dotter actively disconnects the Bluetooth communication link with the upper application and stops all data interaction. For example, when the password provided by the upper application does not match the authorized password stored by the dotter, it will result in authentication failure. When the dotter determines that the authentication operation fails, it immediately executes the connection interruption process. In specific implementation, the dotter first sends a disconnect notification to the upper application, which includes an error code. The error code value is in the range of 0x81-0x8F, indicating the specific reason for authentication failure. After sending the notification, the dotter closes the Bluetooth communication interface and releases the connection resources, entering the state of waiting for new connection. This mechanism ensures that only the upper application that passes the authentication can establish an effective data transmission connection with the dotter.

[0082] S206, the dotter sends the message data to the upper application.

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

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

[0085] S207, the upper application verifies the message data and sends the verification result to the dot matrix pen.

[0086] Verification is the process of verifying the integrity and correctness of the received message data by the upper application. The verification result includes two states of success and failure, as well as specific error types. The upper application is a program running on a computer or mobile device, responsible for receiving and processing dot matrix pen data. The verification result sending means that the upper application returns the data verification result to the dot matrix pen through the Bluetooth link. For example, verification can include message length verification, checksum calculation, serial number continuity check, etc.

[0087] In this step, the upper application first performs multi-level verification on the received message data. The verification process includes: verifying whether the magic number 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 serial number. After completing the verification, the upper application generates a verification result message, which contains: 1 byte of verification result status code (0x00 indicates success, 0x80-0x8F indicates failure) and 2 bytes of message identifier. The upper application sends the verification result message to the dot matrix pen through the Bluetooth characteristic value write operation.

[0088] S208, if the verification result is verification failure or the dot matrix pen does not receive the verification result within a preset time, resend the message data.

[0089] The check result is the state identifier verified by the upper application after receiving the message data, represented by 1 byte, 0x00 indicates success, 0x80-0x8F indicates different types of failure. The preset time is the maximum time interval for the dot pen to wait to receive the check result, usually set to 100-200 milliseconds. Resending refers to the process of the dot pen repackaging and transmitting the previously sent message data. For example, when the upper application detects that the message checksum does not match, it will return a check failure result of 0x81, or due to network delay, the check result is not received within 200 milliseconds, which will trigger the message retransmission.

[0090] When performing this step, the dot pen first checks the received check result status code. If the status code is in the range of 0x80-0x8F, indicating a check failure, the dot pen immediately starts the retransmission mechanism. At the same time, the dot pen starts a timer, and if the check result from the upper application is not received within the preset 200 milliseconds, the timer will timeout and trigger the retransmission mechanism. When retransmitting, the dot pen takes the original message data from the send buffer, recalculates the check code, updates the message sequence number, and then transmits it again through the Bluetooth link. To prevent infinite retransmission, the dot pen sets a maximum retransmission number of 3 times for each message, and beyond that will report a transmission error. This retransmission mechanism ensures the reliability of data transmission.

[0091] S209、the dot pen selects the general data format or the private data format according to the data standard number.

[0092] The data standard number is an unsigned integer of 1 byte, used to identify the type of data format used, where 0x01 indicates a general standard and 0xF0-0xFF indicates a private standard. The general data format is a standard data structure defined by the DPTP protocol, suitable for most dot pen devices. The private data format is a special data structure customized for specific devices or scenarios. For example, the general format uses a fixed field structure to describe handwriting data, while the private format may contain additional device-specific information.

[0093] In this step, the dot pen determines the format used in subsequent data transmission according to the data standard number received in the initialization phase. When the data standard number is 0x01, the dot pen selects the general 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 pen looks up the internal preset private format definition table and selects the corresponding private data format. The dot 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 pen data.

[0094] S210、the dot pen packs the writing trajectory data according to the preset data structure in the general data format.

[0095] The general data format is a standard data structure defined by the DPTP protocol, containing a fixed field layout and encoding rules. The default data structure specifies the storage format for various types of information, including using 4 bytes to store absolute position and 2 bytes to store relative position for coordinate data, using 1 byte to represent pressure values, and using 4 bytes for timestamps. Writing trajectory data includes information such as the location, pressure, and angle of sampling points. Packaging is the process of organizing this information into data packets according to the prescribed format. For example, a standard data packet structure is: header (2 bytes) + data length (1 byte) + timestamp (4 bytes) + coordinate data (6 bytes × N) + pressure value (1 byte × N) + checksum (2 bytes).

[0096] In this step, the dot matrix pen strictly adheres to the specifications of a common data format to package the writing trajectory data. First, a buffer meeting the maximum packet length (244 bytes) is allocated, and a 2-byte header containing a type identifier and sequence number is written. Then, a 1-byte data length field is written. Next, a 4-byte sampling timestamp is written. For each sampling point, X and Y coordinate values ​​(4 bytes for absolute coordinates, 2 bytes for relative coordinates), pressure value (1 byte), and tilt angle value (1 byte) are written sequentially. 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.

[0097] S211. The dot matrix pen packages the writing trajectory data according to the custom data structure in the private data format.

[0098] The proprietary 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 arrangement and encoding method of fields defined under the proprietary data format to meet specific application requirements. Writing trajectory data contains all information collected by the dot matrix pen, including basic coordinate, pressure, and angle data, as well as extended information such as device status and environmental parameters. The packaging process organizes this information into data packets according to the rules of the proprietary format. For example, a proprietary format (identifier 0xF1) defines a data structure as: basic information segment (containing coordinates, pressure, etc.) + extended information segment (containing battery level, signal strength, etc.) + custom check segment, while another proprietary format (identifier 0xF2) may have a completely different structure, containing specific encrypted or compressed fields.

[0099] In performing this step, the dot pen first reads the private format definition corresponding to the identifier from internal storage, which contains complete field layout, data type, coding rules, etc. The specific packaging process is carried out in the following order: first, create a private format data packet header, containing 4 bytes of format identification and version information; then, according to the specification of the private format, package the basic data segment, including 8 bytes of device ID, 4 bytes of timestamp, coordinate data (different compression algorithms may be used according to the requirements of the private format); then, package the extended data segment, such as 2 bytes of battery power, 2 bytes of signal strength, 1 byte of working mode, etc.; finally, calculate the check value according to the check algorithm (such as CRC16, MD5, etc.) defined by the private format and add it to the end of the data packet. The entire packaging process strictly follows the specification of the private format, ensuring the integrity of the data and the needs of specific application scenarios. The dot pen also adds a marker field specific to the private format in the data packet, which is used 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.

[0100] The communication system of the DPTP protocol in the embodiments of the present application will be described from the perspective of hardware processing. Please refer to Figure 3 , which is a schematic diagram of an entity device structure of the communication system of the DPTP protocol in the embodiments of the present application.

[0101] 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 impose any limitations on the functions and usage range of the embodiments of the present application.

[0102] As Figure 3 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 programs stored in a read-only memory (ROM) 302 or loaded from a storage portion 308 into a random access memory (RAM) 303, such as performing the methods described in the above embodiments. In the RAM 303, various programs and data required for system operation are also stored. The CPU 301, ROM 302, and RAM 303 are connected to each other through a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.

[0103] The following components are connected to the I / O interface 305: an input section 306 including an audio input device, a push button switch, and the like; an output section 307 including a Liquid Crystal Display (LCD), and an audio output device, a lamp, and the like; a storage section 308 including a hard disk and the like; and a communication section 309 including a network interface card such as a LAN (Local Area Network) card, a modem, and the like. The communication section 309 performs a communication process via a network such as the Internet. A drive 310 is also connected to the I / O interface 305 as necessary. A removable recording medium 311, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, and the like, is attached to the drive 310 as necessary so that a computer program read therefrom can be installed into the storage section 308 as necessary.

[0104] In particular, the processes described above with reference to the flow charts can be implemented as a computer software program in accordance with embodiments of the present application. For example, an embodiment of the present application includes a computer program product comprising a computer program carried on a computer readable medium, the computer program containing computer programs for executing the methods shown in the flow charts. In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 309, and / or installed from the removable recording medium 311. When the computer program is executed by the central processing unit (CPU) 301, various functions defined in the present application are performed.

[0105] Note that specific examples of the computer readable storage medium can include but are not limited to one or more of a conduit with one or more wires, a portable computer diskette, 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 disc read only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium can be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.

[0106] The flow diagrams and the block diagrams in the drawings are schematic and specific embodiments of a possible implementation of the system, method and computer program product according to the present application are set forth in detail in the following description and illustrated in the drawings by using block diagrams, flow charts, etc. Each block there of and combinations of blocks can be implemented by various means or one or more computer-readable media containing computer-executable instructions for implementing the stateful logic there of. Such computer-readable media further can be realized as a result of, for example, software routines executed by one or more processors of the DPTP protocol communication system. Also, the DPTP protocol communication system described herein includes the software that: (i) enables hardware of the DPTP protocol communication system to operate as described herein; and / or (ii) constitutes the various features described herein (e.g., various functions of the DPTP protocol communication system). Still yet, any of the blocks in the flow diagrams and / or block diagrams and any combination of the blocks there of can be implemented by various means or one or more computer-readable media containing computer-executable instructions for implementing the stateful logic there of. Further, these computer- readable media further can be realized as a result of, for example, the software routines executed by one or more processors of the DPTP protocol communication system. As an example, such computer- readable media can comprise RAM (Random Access Memory) or ROM (Read Only Memory), EPROM (Erasable Programmable Read Only Memory), EEPROM (Electrically Erasable Programmable Read Only Memory), flash memory or NVRAM (Non-Volatile Random Access Memory), floppy disks, CD-ROMs, hard drives, or any other form of computer-readable media which can be used for storage these computer-executable instructions. Note that the software that enables the computer system to operate as described herein uses any of the various computer systems described above, and can be written as hardware description languages, high-level programming languages, machine languages, or a combination thereof, and can be written as one or more computer programs (for use with different types of computer systems).

[0107] In particular, the communication system of the DPTP protocol in the embodiment includes a processor and a memory, and 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.

[0108] As another aspect, the present application also provides a computer-readable storage medium. The storage medium can be included in the communication system of the DPTP protocol described in the above embodiments, or can exist independently without being assembled into the communication system of the DPTP protocol. The storage medium carries one or more computer programs. When the 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 embodiments.

[0109] The above embodiments are only used to illustrate the technical solutions of the present application, but not limit the present application; although the present application is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application.

[0110] In the above embodiments, according to the context, the term "when" can be interpreted as meaning "if" or "after" or "in response to determining" or "in response to detecting". Similarly, according to the context, the phrase "on determining" or "if detecting (the stated condition or event)" can be interpreted as meaning "if determining" or "in response to determining" or "on detecting (the stated condition or event)" or "in response to detecting (the stated condition or event)".

[0111] Those skilled in the art can understand that all or part of the processes in the above-mentioned method embodiments can be implemented by a computer program instructing relevant hardware to complete, the program can be stored in a computer readable storage medium, and the program can include the processes of the above-mentioned method embodiments when executed. The aforementioned storage medium includes ROM or random storage memory RAM, magnetic disc or optical disc and various storage code medium.

Claims

1. A communication method of a DPTP protocol, characterized in that, The application relates to a communication system applied to a DPTP protocol, wherein the communication system comprises a dot pen and an upper-end application, and the method comprises the following steps: When the dot pen establishes a connection with the upper-end application, the dot pen receives a protocol level and a data standard number sent by the upper-end application to the dot pen; The dot pen returns an acknowledgement message to the upper-end application, and the acknowledgement message comprises a device authentication strategy number; If the authentication strategy number indicates that authentication is needed, the dot pen performs an authentication operation on an authentication instruction sent by the upper-end application; If the authentication operation result is authentication success or the authentication strategy number indicates that authentication is not needed, the dot pen packs collected writing track data into message data in a data format corresponding to the data standard number, sets coordinate information in the writing track data as absolute coordinates and relative coordinates, records a reference position by using the absolute coordinates and records a position offset relative to the reference position by using the relative coordinates, records the absolute coordinates according to a preset sampling point number, calculates an offset relative to the absolute coordinates for a sampling point position in the preset sampling point number, records the offset as the relative coordinates, and packs the absolute coordinates and the relative coordinates into the message data in the data format; The dot pen sends the message data to the upper-end application.

2. The method of claim 1, wherein, The step of packing the collected writing track data into the message data in the data format corresponding to the data standard number comprises the following steps: When a page changing operation is detected, the dot pen packs page information in the writing track data into the message data in the data format.

3. The method of claim 1, characterized in that, The step of packing the collected writing track data into the message data in the data format corresponding to the data standard number comprises the following steps: The dot pen sets coordinate information in the writing track data as absolute coordinates and relative coordinates; The dot pen records a reference position by using the absolute coordinates and records a position offset relative to the reference position by using the relative coordinates; The dot pen records the absolute coordinates according to a preset sampling point number; The dot pen calculates an offset relative to the absolute coordinates for a sampling point position in the preset sampling point number, records the offset as the relative coordinates; The dot pen packs the absolute coordinates and the relative coordinates into the message data in the data format.

4. The method of claim 1, wherein, After the step of sending the message data to the upper-end application by the dot pen, the method further comprises the following steps: The upper-end application checks the message data and sends a checking result to the dot pen; If the checking result is checking failure or the dot pen does not receive the checking result within a preset time, the message data is resent.

5. The method of claim 1, wherein, The data format corresponding to the data standard number comprises a packing rule and a transmission rule of the writing track data, and a data transmission rate in the transmission rule is determined by a sampling rate of the writing track data.

6. The method of claim 1, wherein, In a case where 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 a protocol level and a data standard number to the dot matrix pen, the method further comprises: The dot matrix pen selects the general data format or the private data format according to the data standard number; The dot matrix pen packs the writing track data according to a preset data structure in the general data format; The dot matrix pen packs the writing track data according to a custom data structure in the private data format.

7. The method of claim 1, wherein, After the dot matrix pen sends the message data to the upper-end application, the method further comprises: In a case where 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 DPTP protocol communication system comprises one or more processors and a memory; the memory is coupled with the one or more processors; the memory is configured to store computer program code, the computer program code comprises computer instructions; and the one or more processors invoke the computer instructions to enable the DPTP protocol communication system to perform the method according to any one of claims 1-7.

9. A computer-readable storage medium comprising instructions, characterized in that, When the instructions run on the DPTP protocol communication system, the DPTP protocol communication system performs the method according to any one of claims 1-7.

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

Citation Information

Patent Citations

  • Dot matrix pen system and decoding method

    CN115376134A

  • DNA damage distinguishing and sequencing method based on different base conversion modes

    CN118186064A