WO2019104688A1 - Input data processing method for handwriting board, electronic device and storage medium - Google Patents

Input data processing method for handwriting board, electronic device and storage medium Download PDF

Info

Publication number
WO2019104688A1
WO2019104688A1 PCT/CN2017/114065 CN2017114065W WO2019104688A1 WO 2019104688 A1 WO2019104688 A1 WO 2019104688A1 CN 2017114065 W CN2017114065 W CN 2017114065W WO 2019104688 A1 WO2019104688 A1 WO 2019104688A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
input data
pressure value
writing operation
input
Prior art date
Application number
PCT/CN2017/114065
Other languages
French (fr)
Chinese (zh)
Inventor
钟兆宇
Original Assignee
深圳市柔宇科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳市柔宇科技有限公司 filed Critical 深圳市柔宇科技有限公司
Priority to PCT/CN2017/114065 priority Critical patent/WO2019104688A1/en
Priority to CN201780096922.9A priority patent/CN111356971A/en
Publication of WO2019104688A1 publication Critical patent/WO2019104688A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/03Arrangements for converting the position or the displacement of a member into a coded form
    • G06F3/041Digitisers, e.g. for touch screens or touch pads, characterised by the transducing means

Definitions

  • the present application relates to the field of data processing technologies, and in particular, to an input data processing method for a tablet, an electronic device, and a computer readable storage medium.
  • the writing data corresponding to each writing point in the writing operation is usually generated by the tablet system to generate a data packet, and then the data packet is sent to the receiving end system for subsequent processing of the data.
  • the data packet usually contains more data segments.
  • the data packet generally includes five data segments: a flag bit (1 Byte), an X coordinate value (2 Bytes), a Y coordinate value (2 Bytes), and a time.
  • the timestamp is used to record the timestamp generated by the writing point on the tablet.
  • the timestamp is a relative timestamp, and the time interval between each two adjacent writing points is fixed at ⁇ t.
  • the data packet of this format has a length of 11 Bytes, and the storage capacity is too large, resulting in a slow transmission speed, thereby affecting the response speed of the receiving end system to the writing operation, such as the slow real-time display speed of the writing track and the response of the function triggered by the writing operation. Slow speed, etc., which affects the user experience.
  • the present application provides an input data processing method for a tablet, an electronic device, and a computer readable storage medium, which can reduce the storage space occupied by storing data and increase the transmission speed of the data.
  • the present application provides a method for processing input data of a tablet, where the input data processing method includes:
  • the input data is written data generated by a writing operation, determining whether the input data is the first written data generated by the continuous writing operation;
  • the input data is the first written data generated by the continuous writing operation, generating the data packet according to the first data format
  • the input data is not written data generated by a writing operation, or the input data is non-first writing data generated by a continuous writing operation, generating the data packet according to the second data format;
  • the generated data packet is sent to the receiving end system.
  • the present application provides a method for processing input data of a tablet, and the method for processing input data includes:
  • the analysis processes the tablet data to be processed.
  • the present application provides an electronic device including a processor, a memory, and a computer program stored in the memory, the processor for running a computer program stored in the memory to perform the following steps :
  • the input data is written data generated by a writing operation, determining whether the input data is the first written data generated by the continuous writing operation;
  • the input data is the first written data generated by the continuous writing operation, generating the data packet according to the first data format
  • the input data is not written data generated by a writing operation, or the input data is non-first writing data generated by a continuous writing operation, generating the data packet according to the second data format;
  • the generated data packet is sent to the receiving end system.
  • the present application provides an electronic device including a processor, a memory, and a computer program stored in the memory, the processor for running a computer program stored in the memory to perform the following steps :
  • the analysis processes the tablet data to be processed.
  • the present application provides a computer readable storage medium having stored thereon computer instructions that, when executed by a processor, implement the steps of the input data processing method of the tablet of any of the above embodiments.
  • the input data processing method of the tablet of the present application and the electronic device are regrouped without changing the data source.
  • the data format of the data packet can reduce the number of data segments of the data packet, and achieve the purpose of reducing the storage capacity and the transmission amount of the data, thereby significantly reducing the storage space occupied by the storage data and increasing the data transmission speed, thereby facilitating the data format. Improve the response speed of the receiving end system to the writing operation, so that the user has a better user experience.
  • FIG. 1 is a schematic diagram of a data format of a data packet in the prior art.
  • FIG. 2 is a flow chart of a method for processing input data of a tablet according to the first embodiment of the present application.
  • FIG. 3 is a schematic diagram of a first data format of a data packet of the present application.
  • FIG. 4 is a schematic diagram of a second data format of a data packet of the present application.
  • FIG. 5 is a flowchart of a method for processing input data of a tablet according to a second embodiment of the present application.
  • FIG. 6 is a schematic diagram of functional modules of an input data processing apparatus according to a first embodiment of the present application.
  • FIG. 7 is a schematic diagram of functional modules of an input data processing apparatus according to a second embodiment of the present application.
  • FIG. 8 is a schematic diagram of functional modules of an electronic device according to an embodiment of the present application.
  • FIG. 2 is a flowchart of a method for processing input data of a tablet according to a first embodiment of the present application.
  • the input data processing method is applied to an electronic device having the tablet. More specifically, the input data processing method is applied to a tablet system of the electronic device. It should be noted that the input data processing method of the embodiment of the present application is not limited to the steps and the sequence in the flowchart shown in FIG. 2 . The steps in the illustrated flow diagrams can be added, removed, or changed in order, depending on the requirements.
  • the input data processing method includes the following steps:
  • Step 101 Acquire input data generated on the tablet according to a preset time interval.
  • the input data includes an X coordinate value, a Y coordinate value, a pressure value, and a time stamp.
  • the input data may be position data of the stylus on the tablet (ie, cursor position data), or the input data may be a pressure value generated by the cursor position data and the writing operation input by the stylus on the tablet.
  • the sum of the data, wherein the sum of the cursor position data and the pressure value data constitutes written data.
  • the pen when the pen is written, a writing point is generated on the tablet, and a pressure value is detected on the tablet, and the acquired input data includes cursor position data (ie, X coordinate value, Y coordinate value). And pressure value data.
  • cursor position data ie, X coordinate value, Y coordinate value
  • pressure value data When the pen is lifted, no writing point is generated on the tablet, and no pressure value is detected on the tablet, and the acquired input data includes only the cursor position data (ie, the X coordinate value and the Y coordinate value).
  • the tablet program automatically generates a timestamp t, so the input data generated on the tablet also includes a timestamp.
  • Step 102 Determine whether the input data is written data generated by a writing operation. If the input data is written data generated by a writing operation, step 103 is performed. If the input data is not written data generated by the writing operation, step 105 is performed.
  • the step of "determining whether the input data is written data generated by a writing operation" includes:
  • the input data includes a pressure value that is not zero, determining that the input data is written data generated by a writing operation
  • the input data includes a pressure value of zero, it is determined that the input data is not written data generated by a writing operation.
  • Step 103 Determine whether the input data is the first written data generated by the continuous writing operation. If the input data is the first written data generated by the continuous writing operation, step 104 is performed. If the input data is non-first written data generated by a continuous writing operation, step 105 is performed.
  • the step of "determining whether the input data is the first written data generated by the continuous writing operation" includes:
  • the pressure value of the input data acquired last time is zero, it can be determined that the input data acquired last time corresponds to a pen-holding operation.
  • the currently-acquired input data is a writing operation caused by a writing operation, The data can then determine that the currently acquired input data is the first written data generated by the continuous writing operation.
  • the pressure value of the input data acquired last time is not zero, it can be determined that the input data acquired last time corresponds to a pen writing operation. At this time, if the currently input data is the writing data generated by the writing operation, Judge the current acquisition The input data is non-first written data generated by a continuous writing operation.
  • Step 104 Generate the data packet according to the first data format.
  • the byte length of the data packet of the first data format is a first preset value, and includes four data segments, where the four data segments are respectively used to store X coordinate values, Y. Coordinate value, pressure value, time stamp.
  • Step 105 Generate the data packet according to the second data format.
  • the byte length of the data packet of the second data format is a second preset value, and includes three data segments, where the three data segments are respectively used to store X coordinate values, Y. Coordinate value, pressure value.
  • the data segments storing the X coordinate value, the Y coordinate value, and the pressure value each have a data length of 2 Bytes, and the data segment storing the time stamp has a data length of 4 Bytes.
  • the pressure value ranges from 0 to 2048. Since the data segment storing the pressure value has a data length of 2 Bytes, and the value ranges from 0 to 65535, the highest bit of the data segment storing the pressure value in the prior art data packet as shown in FIG. 1 is always 0. .
  • the data packet of the prior art is also separately provided with a data segment of 1 Byte for storing the flag data, wherein the flag bit records the lower pen flag and the pen pen flag, and the pen and the pen are represented by 1 and 0 respectively. That is to say, the prior art data packet has a byte length of 11 Bytes.
  • the highest data bit of the data segment storing the pressure value is also used to store the flag bit data, and the remaining data bits are used to store pressure value data.
  • the prior art when the lower pen generates pressure, the prior art records "01” in the data segment in which the flag bit is stored, and records "01e5" in the data segment in which the pressure value is stored, and the present embodiment removes the data segment in which the flag bit is stored. And “11e5" is recorded in the data segment in which the pressure value is stored.
  • the pen is raised, no pressure is generated.
  • "00” is recorded in the data segment in which the flag is stored
  • "0000" is recorded in the data segment in which the pressure value is stored
  • the embodiment stores the data in the pressure value.
  • "0000" is recorded in the segment.
  • the present embodiment by storing the flag bit data by using the highest data bit of the data segment storing the pressure value, the storage space of the flag bit of 1 Byte can be reduced, so that the storage space of the data packet can be optimized.
  • the time stamp generated by the tablet is a relative time stamp
  • the data packet corresponding to the starting point of the writing operation contains the data segment storing the time stamp.
  • the value is 10 Bytes
  • the data packet corresponding to the pen point reduces the storage space of the 1 Byte flag bit compared to the data packet generated by the prior art.
  • the time stamp of the data packet corresponding to the non-pick point and the pen up operation can be calculated by accumulating the time stamp of the pen point and the time interval. Therefore, the data packet corresponding to the non-pick point and the pen up operation may not include the data segment storing the time stamp.
  • the data packet corresponding to the pen operation reduces the storage space of the 5 Byte flag bit compared to the data packet generated by the prior art.
  • non-priming data packets can also be collectively referred to as non-priming data packets.
  • Step 106 Send the generated data packet to the receiving end system.
  • step 106 the flow returns to step 101 to continue to acquire input data generated on the tablet at preset time intervals.
  • the processing method can reduce the data length of most data packets of the tablet input data from the original 11 Bytes to 6 Bytes, so that the storage capacity and the transmitted data amount are reduced by 45%, and the data length of the data packet of the pen point is also from the original The reduction of 11 Bytes to 10 Bytes reduced the amount of storage capacity and data transferred by at least 9%.
  • the input data processing method of the tablet of the present application can reduce the number of data segments of the data packet by reorganizing the data format of the data packet without changing the data source, thereby achieving the purpose of reducing the storage capacity and the transmission amount of the data, thereby
  • the storage space occupied by the stored data can be significantly reduced, and the data transmission speed can be improved, so as to improve the response speed of the receiving end system to the writing operation, such as increasing the real-time display speed of the writing track or improving the response speed of the function triggered by the writing operation. To give users a better experience.
  • FIG. 5 is a flowchart of a method for processing input data of a tablet according to a second embodiment of the present application.
  • the input data processing method is applied to an electronic device having the tablet. More specifically, the input data processing method is applied to a receiving end system of the electronic device.
  • the input data processing method of the embodiment of the present application is not limited to the steps and the sequence in the flowchart shown in FIG. 5. The steps in the illustrated flow diagrams can be added, removed, or changed in order, depending on the requirements.
  • the input data processing method includes the following steps:
  • Step 201 Receive a data packet and determine a byte length of the data packet. If the byte length of the data packet is equal to the first preset value, step 202 is performed. If the byte length of the data packet is equal to the second preset value, step 203 is performed.
  • the value of the first preset value is 10 Bytes
  • the value of the second preset value is 6 Bytes.
  • Step 202 Determine that the data of the data packet is the first written data generated by the continuous writing operation, and parse the data packet according to the first data format to obtain the tablet data to be processed.
  • the data packet of the first data format includes four data segments, and the four data segments are respectively used for storing an X coordinate value, a Y coordinate value, a pressure value, and a time stamp.
  • the input data processing method includes:
  • the parsed timestamp is determined as the starting timestamp of the continuous handwriting operation.
  • Step 203 Parse the data of the data packet according to the second data format to obtain the tablet data to be processed.
  • the data packet of the second data format includes three data segments, and the three data segments are respectively used for storing an X coordinate value, a Y coordinate value, and a pressure value.
  • the data segments storing the X coordinate value, the Y coordinate value, and the pressure value each have a data length of 2 Bytes, and the data segment storing the time stamp has a data length of 4 Bytes.
  • Step 204 Calculate a timestamp of the currently received data packet according to the last parsed timestamp and the number of data packets received after the data packet containing the timestamp.
  • the step of “calculating the timestamp of the currently received data packet based on the last timestamp and the number of data packets received after the data packet containing the timestamp” includes :
  • the sum of the timestamp and the product is taken as the timestamp of the currently received data packet.
  • timestamp that was last parsed refers to the start timestamp of the latest continuous writing operation.
  • the time stamp generated by the tablet is a relative time stamp.
  • the tablet program automatically generates the time stamp t, and the data packet corresponding to the starting point of the writing operation generated by the tablet system includes the storage time stamp.
  • the receiving end system receives a data packet with a byte length of 10 Bytes, it can parse the writing time stamp of the writing operation, which can also be called a starting time stamp.
  • the receiving end system receives a packet with a byte length of 6 Bytes, it can determine that the data packet does not contain a timestamp, and can automatically generate a timestamp for the data packet. It can be understood that the generated data packets after the starting point and before the next writing operation can also be collectively referred to as non-priming data packets.
  • the start timestamp is t0
  • the timestamp of the non-primed data packet is t
  • the preset time interval for generating two adjacent input data is ⁇ t
  • the start data time stamp is included in the data packet (ie, the start time stamp is included)
  • the number of data packets received after the data packet is N
  • Step 205 Add the calculated time stamp to the to-be-written tablet data.
  • Step 206 Analyze and process the tablet data to be processed.
  • the input data processing method further includes:
  • the data of the remaining data bits of the data segment storing the pressure value is parsed into pressure value data.
  • the input data processing method further includes:
  • Determining the type of data of the data packet based on the byte length of the data packet and the flag bit data and the pressure value data obtained by parsing the data packet.
  • the flag bit data is a pen down mark, and the pressure value is not zero, determining that the data of the data packet is generated by a continuous writing operation Not the first to write data.
  • the flag bit data is a pen up flag, and the pressure value is zero, it is determined that the data of the data packet is data of a tablet cursor position.
  • the analysis processing of the tablet data to be processed includes, but is not limited to, displaying a writing track in real time according to the tablet data to be processed, or triggering a corresponding function application according to the tablet data to be processed. .
  • step 206 the flow returns to step 201 to continue receiving the data packet and determining the byte length of the data packet.
  • the input data processing method of the tablet of the present application can parse the received data packet by using different data formats according to the byte length of the data packet when receiving the data packet, and automatically provide the data that does not include the time stamp.
  • the packet generates a corresponding timestamp, which can help the tablet system to reduce the byte length of the data packet when generating the data packet, so as to significantly reduce the storage space occupied by the stored data and increase the data transmission speed.
  • FIG. 6 is a functional block diagram of the input data processing device 10 according to the first embodiment of the present application.
  • the input data processing device 10 is applied to an electronic device having a tablet. More specifically, the input data processing device 10 is applied to a tablet system of the electronic device.
  • the input data processing device 10 may include one or more modules stored in a memory of the electronic device and configured to be processed by one or more processors (this embodiment is a process) Execution to complete this application.
  • the input data processing apparatus 10 may include an acquisition module 11, a determination module 12, a data packet generation module 13, and a transmission module 14.
  • the module referred to in the embodiment of the present application may be a program segment that completes a specific function, and is more suitable than the program to describe the execution process of the software in the processor. It can be understood that, corresponding to the input data processing method of the first embodiment, the input data processing apparatus 10 may include some or all of the functional modules shown in FIG. 6, and the functions of each module will be specifically described below. Introduction.
  • the obtaining module 11 is configured to acquire input data generated on the tablet according to a preset time interval.
  • the input data includes an X coordinate value, a Y coordinate value, a pressure value, and a time stamp.
  • the input data may be position data of the stylus on the tablet (ie, cursor position data), or
  • the input data may be a sum of cursor position data and pressure value data generated by a writing operation input by the stylus on the tablet, wherein the sum of the cursor position data and the pressure value data constitutes written data.
  • the input data acquired by the acquiring module 11 includes cursor position data (ie, an X coordinate value). , Y coordinate value) and pressure value data.
  • cursor position data ie, an X coordinate value
  • Y coordinate value ie, X coordinate value
  • pressure value data ie, the pressure value
  • the input data acquired by the acquiring module 11 only includes the cursor position data (ie, the X coordinate value and the Y coordinate). value).
  • the tablet program automatically generates a timestamp t, so the input data generated on the tablet also includes a timestamp.
  • the determining module 12 is configured to determine whether the input data is written data generated by a writing operation.
  • the determining module 12 determines whether the input data is written data generated by a writing operation
  • the determining module 12 is specifically configured to:
  • the input data includes a pressure value that is not zero, determining that the input data is written data generated by a writing operation
  • the input data includes a pressure value of zero, it is determined that the input data is not written data generated by a writing operation.
  • the determining module 12 is further configured to continue to determine whether the input data is the first written data generated by the continuous writing operation when determining that the input data is writing data generated by the writing operation.
  • the determining module 12 determines whether the input data is the first written data generated by the continuous writing operation, the determining module 12 is specifically configured to:
  • the pressure value of the input data acquired last time is zero, it can be determined that the input data acquired last time corresponds to a pen-holding operation.
  • the currently-acquired input data is a writing operation caused by a writing operation, The data can then determine that the currently acquired input data is the first written data generated by the continuous writing operation.
  • the pressure value of the input data acquired last time is not zero, it can be determined that the input data acquired last time corresponds to a pen writing operation. At this time, if the currently input data is the writing data generated by the writing operation, It is judged that the input data currently acquired is the non-first written data generated by the continuous writing operation.
  • the data packet generating module 13 is configured to generate the data packet according to the first data format when the input data is the first written data generated by the continuous writing operation.
  • the byte length of the data packet of the first data format is a first preset value, and includes four data segments, where the four data segments are respectively used to store X coordinate values, Y. Coordinate value, pressure value, time stamp.
  • the data packet generating module 13 is further configured to: when the input data is not written data generated by a writing operation, or the input data is a non-first writing data generated by a continuous writing operation, according to the second data format The input data generates a data packet.
  • the byte length of the data packet of the second data format is a second preset value, and includes three data segments, where the three data segments are respectively used to store X coordinate values, Y. Coordinate value, pressure value.
  • the data segments storing the X coordinate value, the Y coordinate value, and the pressure value each have a data length of 2 Bytes, and the data segment storing the time stamp has a data length of 4 Bytes.
  • the pressure value ranges from 0 to 2048. Since the data segment storing the pressure value has a data length of 2 Bytes, and the value ranges from 0 to 65535, the highest bit of the data segment storing the pressure value in the prior art data packet as shown in FIG. 1 is always 0. .
  • the data packet of the prior art is also separately provided with a data segment of 1 Byte for storing the flag data, wherein the flag bit records the lower pen flag and the pen pen flag, and the pen and the pen are represented by 1 and 0 respectively. That is to say, the prior art data packet has a byte length of 11 Bytes.
  • the highest data bit of the data segment storing the pressure value is also used to store the flag bit data, and the remaining data bits are used to store pressure value data.
  • the prior art when the lower pen generates pressure, the prior art records "01” in the data segment in which the flag bit is stored, and records "01e5" in the data segment in which the pressure value is stored, and the present embodiment removes the data segment in which the flag bit is stored. And “11e5" is recorded in the data segment in which the pressure value is stored.
  • the pen is raised, no pressure is generated.
  • "00” is recorded in the data segment in which the flag is stored
  • "0000" is recorded in the data segment in which the pressure value is stored
  • the embodiment stores the data in the pressure value.
  • "0000" is recorded in the segment.
  • the present embodiment by storing the flag bit data by using the highest data bit of the data segment storing the pressure value, the storage space of the flag bit of 1 Byte can be reduced, so that the storage space of the data packet can be optimized.
  • the time stamp generated by the tablet is a relative time stamp
  • the data packet corresponding to the starting point of the writing operation contains the data segment storing the time stamp.
  • the value is 10 Bytes
  • the data packet corresponding to the pen point reduces the storage space of the 1 Byte flag bit compared to the data packet generated by the prior art.
  • the time stamp of the data packet corresponding to the non-pick point and the pen up operation can be calculated by accumulating the time stamp of the pen point and the time interval. Therefore, the data packet corresponding to the non-pick point and the pen up operation may not include the data segment storing the time stamp.
  • the data packet corresponding to the pen operation reduces the storage space of the 5 Byte flag bit compared to the data packet generated by the prior art.
  • non-priming data packets can also be collectively referred to as non-priming data packets.
  • the sending module 14 is configured to send the generated data packet to the receiving end system.
  • the processing device 10 can reduce the data length of most data packets of the tablet input data from the original 11 Bytes to 6 Bytes, so that the storage capacity and the transmitted data amount are reduced by 45%, and the data length of the data packet of the pen point is also from the original.
  • the 11Bytes is reduced to 10Bytes, which reduces the amount of storage capacity and data transferred by at least 9%.
  • the input data processing apparatus 10 of the tablet of the present application can reduce the number of data segments of the data packet by reorganizing the data format of the data packet without changing the data source, thereby achieving the purpose of reducing the storage capacity and the transmission amount of the data.
  • the storage space occupied by the stored data can be significantly reduced and the data transmission speed can be improved, so as to improve the response speed of the receiving end system to the writing operation, for example, improving the real-time display speed of the writing track or improving the response of the function triggered by the writing operation. speed.
  • FIG. 7 is a functional block diagram of an input data processing device 20 according to a second embodiment of the present application.
  • the input data processing device 20 is applied to an electronic device having a tablet. More specifically, the input data processing device 20 is applied to a receiving end system of the electronic device.
  • the input data processing device 20 may include one or more modules stored in a memory of the electronic device and configured to be processed by one or more processors (this embodiment is a process) Execution to complete this application.
  • the input data processing apparatus 20 may include a receiving module 21, a parsing module 22, a processing module 23, a computing module 24, and a loading module 25.
  • the module referred to in the embodiment of the present application may be a program segment that completes a specific function, and is more suitable than the program to describe the execution process of the software in the processor. It can be understood that, corresponding to the input data processing method of the second embodiment, the input data processing device 20 may include some or all of the functional modules shown in FIG. 7, and the functions of each module will be specifically described below. Introduction.
  • the receiving module 21 is configured to receive a data packet.
  • the data packet is from a tablet system.
  • the parsing module 22 is configured to determine a byte length of the data packet.
  • the parsing module 22 is further configured to: when determining that the byte length of the data packet is equal to the first preset value, determine that the data of the data packet is the first written data generated by the continuous writing operation. And parsing the data packet according to the first data format to obtain the tablet data to be processed.
  • the value of the first preset value is 10 Bytes.
  • the data packet of the first data format includes four data segments, and the four data segments are respectively used for storing an X coordinate value, a Y coordinate value, a pressure value, and a time stamp.
  • the processing module 23 is configured to determine the parsed timestamp as a starting timestamp of the continuous handwriting operation.
  • the parsing module 22 is further configured to parse the data of the data packet according to the second data format to obtain the handwritten to be processed when determining that the byte length of the data packet is equal to the second preset value. Board data.
  • the value of the second preset value is 6 Bytes.
  • the data packet of the second data format includes three data segments, and the three data segments are respectively used for storing an X coordinate value, a Y coordinate value, and a pressure value.
  • the data segments storing the X coordinate value, the Y coordinate value, and the pressure value each have a data length of 2 Bytes, and the data segment storing the time stamp has a data length of 4 Bytes.
  • the calculating module 24 is configured to calculate a timestamp of the currently received data packet according to the last parsed timestamp and the number of data packets received after the data packet containing the timestamp.
  • the calculating module 24 when calculating the timestamp of the currently received data packet, is specifically configured to:
  • the sum of the timestamp and the product is taken as the timestamp of the currently received data packet.
  • timestamp that was last parsed refers to the start timestamp of the latest continuous writing operation.
  • the time stamp generated by the tablet is a relative time stamp.
  • the tablet program automatically generates the time stamp t, and the data packet corresponding to the starting point of the writing operation generated by the tablet system includes the storage time stamp.
  • the receiving end system receives a data packet with a byte length of 10 Bytes, it can parse the writing time stamp of the writing operation, which can also be called a starting time stamp.
  • the receiving end system receives a packet with a byte length of 6 Bytes, it can determine that the data packet does not contain a timestamp, and can automatically generate a timestamp for the data packet. It can be understood that the generated data packets after the starting point and before the next writing operation can also be collectively referred to as non-priming data packets.
  • the start timestamp is t0
  • the timestamp of the non-primed data packet is t
  • the preset time interval for generating two adjacent input data is ⁇ t
  • the start data time stamp is included in the data packet (ie, the start time stamp is included)
  • the number of data packets received after the data packet is N
  • the loading module 25 is configured to add the calculated time stamp to the to-be-written tablet data.
  • the processing module 23 is further configured to analyze and process the tablet data to be processed.
  • the parsing module 22 is further configured to parse data of the highest data bit of the data segment storing the pressure value into flag bit data, and store the remaining data bits of the data segment of the pressure value.
  • the data is parsed into pressure value data, wherein the flag bit includes a lower pen flag and a pen pen flag.
  • the processing module 23 is further configured to determine the type of the data of the data packet according to the byte length of the data packet and the flag bit data and the pressure value data obtained by parsing the data packet.
  • the processing module 23 determines that the data of the data packet is Non-first written data produced by continuous writing operations.
  • the processing module 23 determines that the data of the data packet is a tablet The data at the cursor position.
  • the analysis processing of the tablet data to be processed includes, but is not limited to, displaying a writing track in real time according to the tablet data to be processed, or triggering a corresponding function application according to the tablet data to be processed. .
  • the input data processing device 20 of the tablet of the present application can parse the received data packet according to the byte length of the data packet, and automatically provide the time stamp without the time stamp.
  • the data packet generates a corresponding time stamp, which can help the tablet system to reduce the byte length of the data packet when generating the data packet, so as to significantly reduce the storage space occupied by the storage data and increase the data transmission speed.
  • the embodiment of the present application further provides an electronic device, including a memory, a processor, and a computer program stored on the memory and operable on the processor, where the processor executes the program to implement the foregoing embodiments.
  • the steps of the input data processing method of the tablet are aforementioned.
  • FIG. 8 is a schematic diagram of functional modules of an electronic device 100 according to an embodiment of the present application.
  • the electronic device 100 includes at least a processor 30, a memory 40, a computer program 50 (eg, an input data processing program) stored in the memory 40 and operable on the processor 30, handwritten Board system 60 and receiver system 70.
  • a computer program 50 eg, an input data processing program
  • the electronic device 100 can be a smart phone with a touch screen, a tablet computer, a television set, or a computer device with a tablet and a display.
  • the tablet system 60 and the receiving end system 70 may be independent or integrated, for example, the tablet system 60 and the receiving end system 70 may be a touch screen composed of a tablet and a display screen.
  • the schematic diagram 8 is only an example of the electronic device 100 used in the present application for implementing the input data processing method of the tablet, and does not constitute a limitation on the electronic device 100, and may include more than the illustration. More or less components, or combinations of certain components, or different components, such as the electronic device 100 may also include input and output devices, network access devices, wireless transmission devices, and the like.
  • the processor 30 executes the computer program 50, the steps in the implementation of each of the input data processing methods described above are implemented, such as steps 101-106 shown in FIG. 2 or steps 201-206 shown in FIG.
  • the processor 30 executes the computer program 50, the functions of the modules/units, for example, the modules 11-14, 21-25, in the embodiment of the input data processing device 10, 20 described above are implemented.
  • the computer program 50 can be partitioned into one or more modules/units that are stored in the memory 40 and executed by the processor 30 to complete This application.
  • the one or more modules/units may be a series of computer program 50 instruction segments capable of performing a particular function, the instruction segments being used to describe the execution of the computer program 50 in the electronic device 100.
  • the computer program 50 can be divided into the acquisition module 11, the determination module 12, the data packet generation module 13, and the transmission module 14, and the receiving module 21, the parsing module 22, and the processing module 23 in FIG.
  • the processor 30 may be a central processing unit (CPU), or may be other general-purpose processors, a digital signal processor (DSP), an application specific integrated circuit (ASIC), and an off-the-shelf programmable Field-Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, etc.
  • the general purpose processor may be a microprocessor or the processor or any conventional processor or the like, the processor 30 being the control center of the electronic device 100, connecting the entire input data processing device 10 using various interfaces and lines. / Various parts of the electronic device 100.
  • the memory 40 can be used to store the computer program 50 and/or modules/units by running or executing computer programs 50 and/or modules/units stored in the memory 40, and by calling
  • the data within the memory 40 implements various functions of the input data processing apparatus 10, 20/electronic device 100.
  • the memory 40 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application required for at least one function (eg, a sound playing function, an image playing function, etc.), and the like; the storage data area may be Data created according to the use of the electronic device 100 (for example, audio data, data set and acquired by applying the above-described input data processing method, and the like) are stored.
  • the memory 40 may include a high-speed random access memory, and may also include a non-volatile memory such as a hard disk, a memory, a plug-in hard disk, a smart memory card (SMC), a Secure Digital (SD) card, and a flash memory. Flash Card, at least one disk storage device, flash device, or other volatile solid-state storage device.
  • a non-volatile memory such as a hard disk, a memory, a plug-in hard disk, a smart memory card (SMC), a Secure Digital (SD) card, and a flash memory.
  • Flash Card at least one disk storage device, flash device, or other volatile solid-state storage device.
  • the present application also provides a computer readable storage medium having stored thereon a computer program that, when executed by a processor, implements the steps of the input data processing method described in the above embodiments.
  • the input data processing device 10, 20/electronic device 100/computer device integrated module/unit of the present application can be stored in a computer readable if it is implemented in the form of a software functional unit and sold or used as a standalone product. In the storage medium. Based on such understanding, the present application implements all or part of the processes in the foregoing embodiments, and may also be calculated.
  • the computer program can be executed by instructing related hardware, which can be stored in a computer readable storage medium, which when executed by the processor, can implement the steps of the various method embodiments described above.
  • the computer program comprises computer program code, which may be in the form of source code, object code form, executable file or some intermediate form.
  • the computer readable medium may include any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a removable hard disk, a magnetic disk, an optical disk, a computer memory, a Read-Only Memory (ROM), Random access memory (RAM, Random Access Memory), electrical carrier signals, telecommunications signals, and software distribution media. It should be noted that the content contained in the computer readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in a jurisdiction, for example, in some jurisdictions, according to legislation and patent practice, computer readable media Does not include electrical carrier signals and telecommunication signals.
  • the disclosed input data processing method and apparatus may be implemented in other manners.
  • the implementation of the input data processing device described above is merely illustrative.
  • the division of the module is only a logical function division, and the actual implementation may have another division manner.
  • each functional module in each embodiment of the present application may be integrated in the same processing module, or each module may exist physically separately, or two or more modules may be integrated in the same module.
  • the above integrated modules can be implemented in the form of hardware or in the form of hardware plus software function modules.

Abstract

An input data processing method for a handwriting board, and an electronic device. The method comprises: acquiring, according to a pre-set time interval, input data produced on a handwriting board (101); if the input data is first handwriting data produced by a continuous handwriting operation, then generating a data package with the input data according to a first data format (104); if the input data is not handwriting data produced by a handwriting operation, or the input data is non-first handwriting data produced by a continuous handwriting operation, then generating a data package with the input data according to a second data format (105); and sending the generated data package to a receiving-end system (106). According to the input data processing method for a handwriting board, the number of data segments of a data package can be reduced by reorganizing the data format of the data package without changing data source, so that the storage space occupied by stored data can be significantly reduced, and the speed of data transmission can be improved, aiding in improving the speed of a receiving-end system responding to a handwriting operation.

Description

手写板的输入数据处理方法、电子设备以及存储介质Input data processing method of tablet, electronic device and storage medium 技术领域Technical field
本申请涉及数据处理技术领域,尤其涉及一种手写板的输入数据处理方法、电子设备以及计算机可读存储介质。The present application relates to the field of data processing technologies, and in particular, to an input data processing method for a tablet, an electronic device, and a computer readable storage medium.
背景技术Background technique
随着科学技术的发展,手写技术也得到了广泛的应用,为消费者带来了极大的便利。当在手写板上输入书写操作时,通常是由手写板系统将书写操作中的每个书写点对应的书写数据分别生成数据包,再将数据包发送到接收端系统进行数据的后续处理。所述数据包通常包含较多的数据段,例如图1所示,所述数据包一般包含五个数据段:标志位(1Byte)、X坐标值(2Bytes)、Y坐标值(2Bytes)、时间戳(4Bytes),其中,标志位用0x00表示抬笔,用0x01表示下笔,X、Y坐标表示手写笔产生的坐标信息,压力值表示下笔时产生的压力值,压力值的取值范围为(0~2048),时间戳用于记录书写点在手写板上产生的时间戳,此时间戳为相对时间戳,每两个相邻的书写点之间相差的时间间隔固定为△t。这种格式的数据包具有11Bytes的长度,存储容量过大,导致传输速度较慢,从而影响接收端系统对书写操作的响应速度,例如书写轨迹的实时显示速度缓慢、书写操作触发的功能的响应速度缓慢等,从而影响用户使用体验。With the development of science and technology, handwriting technology has also been widely used, bringing great convenience to consumers. When a writing operation is input on the tablet, the writing data corresponding to each writing point in the writing operation is usually generated by the tablet system to generate a data packet, and then the data packet is sent to the receiving end system for subsequent processing of the data. The data packet usually contains more data segments. For example, as shown in FIG. 1, the data packet generally includes five data segments: a flag bit (1 Byte), an X coordinate value (2 Bytes), a Y coordinate value (2 Bytes), and a time. Poke (4Bytes), in which the flag bit is marked with 0x00, the pen is 0x01, the X, Y coordinates represent the coordinate information generated by the stylus, the pressure value represents the pressure value generated when the pen is down, and the value range of the pressure value is ( 0~2048), the timestamp is used to record the timestamp generated by the writing point on the tablet. The timestamp is a relative timestamp, and the time interval between each two adjacent writing points is fixed at Δt. The data packet of this format has a length of 11 Bytes, and the storage capacity is too large, resulting in a slow transmission speed, thereby affecting the response speed of the receiving end system to the writing operation, such as the slow real-time display speed of the writing track and the response of the function triggered by the writing operation. Slow speed, etc., which affects the user experience.
发明内容Summary of the invention
鉴于此,本申请提供一种手写板的输入数据处理方法、电子设备以及计算机可读存储介质,能够降低存储数据所占用的存储空间以及提高数据的传输速度。In view of this, the present application provides an input data processing method for a tablet, an electronic device, and a computer readable storage medium, which can reduce the storage space occupied by storing data and increase the transmission speed of the data.
第一方面,本申请提供一种手写板的输入数据处理方法,所述输入数据处理方法包括:In a first aspect, the present application provides a method for processing input data of a tablet, where the input data processing method includes:
按照预设时间间隔获取手写板上产生的输入数据;Acquiring input data generated on the tablet according to a preset time interval;
判断所述输入数据是否为书写操作产生的书写数据;Determining whether the input data is written data generated by a writing operation;
若所述输入数据为书写操作产生的书写数据,则判断所述输入数据是否为连续书写操作产生的第一个书写数据;If the input data is written data generated by a writing operation, determining whether the input data is the first written data generated by the continuous writing operation;
若所述输入数据为连续书写操作产生的第一个书写数据,则依据第一数据格式将所述输入数据生成数据包;If the input data is the first written data generated by the continuous writing operation, generating the data packet according to the first data format;
若所述输入数据不为书写操作产生的书写数据,或者所述输入数据为连续书写操作产生的非第一个书写数据,则依据第二数据格式将所述输入数据生成数据包;If the input data is not written data generated by a writing operation, or the input data is non-first writing data generated by a continuous writing operation, generating the data packet according to the second data format;
将生成的所述数据包发送给接收端系统。 The generated data packet is sent to the receiving end system.
第二方面,本申请提供一种手写板的输入数据处理方法,所述输入数据处理方法包括:In a second aspect, the present application provides a method for processing input data of a tablet, and the method for processing input data includes:
接收数据包并确定所述数据包的字节长度;Receiving a data packet and determining a byte length of the data packet;
若所述数据包的字节长度等于第一预设值,则确定所述数据包的数据为连续书写操作产生的第一个书写数据,并依据第一数据格式解析所述数据包以得到待处理的手写板数据;If the byte length of the data packet is equal to the first preset value, determining that the data of the data packet is the first written data generated by the continuous writing operation, and parsing the data packet according to the first data format to obtain Handwritten tablet data;
若所述数据包的字节长度等于第二预设值,则依据第二数据格式解析所述数据包的数据以得到待处理的手写板数据;If the byte length of the data packet is equal to the second preset value, parsing the data of the data packet according to the second data format to obtain the tablet data to be processed;
分析处理所述待处理的手写板数据。The analysis processes the tablet data to be processed.
第三方面,本申请提供一种电子设备,所述电子设备包括处理器、存储器以及存储于所述存储器中的计算机程序,所述处理器用于运行所述存储器中存储的计算机程序以执行以下步骤:In a third aspect, the present application provides an electronic device including a processor, a memory, and a computer program stored in the memory, the processor for running a computer program stored in the memory to perform the following steps :
按照预设时间间隔获取手写板上产生的输入数据;Acquiring input data generated on the tablet according to a preset time interval;
判断所述输入数据是否为书写操作产生的书写数据;Determining whether the input data is written data generated by a writing operation;
若所述输入数据为书写操作产生的书写数据,则判断所述输入数据是否为连续书写操作产生的第一个书写数据;If the input data is written data generated by a writing operation, determining whether the input data is the first written data generated by the continuous writing operation;
若所述输入数据为连续书写操作产生的第一个书写数据,则依据第一数据格式将所述输入数据生成数据包;If the input data is the first written data generated by the continuous writing operation, generating the data packet according to the first data format;
若所述输入数据不为书写操作产生的书写数据,或者所述输入数据为连续书写操作产生的非第一个书写数据,则依据第二数据格式将所述输入数据生成数据包;If the input data is not written data generated by a writing operation, or the input data is non-first writing data generated by a continuous writing operation, generating the data packet according to the second data format;
将生成的所述数据包发送给接收端系统。The generated data packet is sent to the receiving end system.
第四方面,本申请提供一种电子设备,所述电子设备包括处理器、存储器以及存储于所述存储器中的计算机程序,所述处理器用于运行所述存储器中存储的计算机程序以执行以下步骤:In a fourth aspect, the present application provides an electronic device including a processor, a memory, and a computer program stored in the memory, the processor for running a computer program stored in the memory to perform the following steps :
接收数据包并确定所述数据包的字节长度;Receiving a data packet and determining a byte length of the data packet;
若所述数据包的字节长度等于第一预设值,则确定所述数据包的数据为连续书写操作产生的第一个书写数据,并依据第一数据格式解析所述数据包以得到待处理的手写板数据;If the byte length of the data packet is equal to the first preset value, determining that the data of the data packet is the first written data generated by the continuous writing operation, and parsing the data packet according to the first data format to obtain Handwritten tablet data;
若所述数据包的字节长度等于第二预设值,则依据第二数据格式解析所述数据包的数据以得到待处理的手写板数据;If the byte length of the data packet is equal to the second preset value, parsing the data of the data packet according to the second data format to obtain the tablet data to be processed;
分析处理所述待处理的手写板数据。The analysis processes the tablet data to be processed.
第五方面,本申请提供一种计算机可读存储介质,其上存储有计算机指令,所述计算机指令被处理器执行时实现上述任一实施例所述的手写板的输入数据处理方法的步骤。In a fifth aspect, the present application provides a computer readable storage medium having stored thereon computer instructions that, when executed by a processor, implement the steps of the input data processing method of the tablet of any of the above embodiments.
本申请的手写板的输入数据处理方法以及电子设备在不改变数据源的情况下通过重新组 织数据包的数据格式,可减少数据包的数据段数量,达到了缩减数据的存储容量和传输量的目的,从而可以显著地降低存储数据所占用的存储空间以及提高数据的传输速度,以利于提高接收端系统对书写操作的响应速度,使用户具有较佳的使用体验。The input data processing method of the tablet of the present application and the electronic device are regrouped without changing the data source. The data format of the data packet can reduce the number of data segments of the data packet, and achieve the purpose of reducing the storage capacity and the transmission amount of the data, thereby significantly reducing the storage space occupied by the storage data and increasing the data transmission speed, thereby facilitating the data format. Improve the response speed of the receiving end system to the writing operation, so that the user has a better user experience.
附图说明DRAWINGS
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings to be used in the embodiments or the prior art description will be briefly described below. Obviously, the drawings in the following description are only It is a certain embodiment of the present application, and other drawings can be obtained according to the drawings without any creative work for those skilled in the art.
图1为现有技术中的数据包的数据格式的示意图。FIG. 1 is a schematic diagram of a data format of a data packet in the prior art.
图2为本申请第一实施方式的手写板的输入数据处理方法的流程图。2 is a flow chart of a method for processing input data of a tablet according to the first embodiment of the present application.
图3为本申请的数据包的第一数据格式的示意图。3 is a schematic diagram of a first data format of a data packet of the present application.
图4为本申请的数据包的第二数据格式的示意图。4 is a schematic diagram of a second data format of a data packet of the present application.
图5为本申请第二实施方式的手写板的输入数据处理方法的流程图。FIG. 5 is a flowchart of a method for processing input data of a tablet according to a second embodiment of the present application.
图6为本申请第一实施方式的输入数据处理装置的功能模块示意图。FIG. 6 is a schematic diagram of functional modules of an input data processing apparatus according to a first embodiment of the present application.
图7为本申请第二实施方式的输入数据处理装置的功能模块示意图。FIG. 7 is a schematic diagram of functional modules of an input data processing apparatus according to a second embodiment of the present application.
图8为本申请一实施方式的电子设备的功能模块示意图。FIG. 8 is a schematic diagram of functional modules of an electronic device according to an embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application are clearly and completely described in the following with reference to the drawings in the embodiments of the present application. It is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present application without departing from the inventive scope are the scope of the present application.
请参阅图2,为本申请第一实施方式的手写板的输入数据处理方法的流程图,所述输入数据处理方法应用于具有所述手写板的电子设备中。更具体地,所述输入数据处理方法应用于所述电子设备的手写板系统中。应说明的是,本申请实施方式的所述输入数据处理方法并不限于图2所示的流程图中的步骤及顺序。根据不同的需求,所示流程图中的步骤可以增加、移除、或者改变顺序。Please refer to FIG. 2 , which is a flowchart of a method for processing input data of a tablet according to a first embodiment of the present application. The input data processing method is applied to an electronic device having the tablet. More specifically, the input data processing method is applied to a tablet system of the electronic device. It should be noted that the input data processing method of the embodiment of the present application is not limited to the steps and the sequence in the flowchart shown in FIG. 2 . The steps in the illustrated flow diagrams can be added, removed, or changed in order, depending on the requirements.
如图2所示,所述输入数据处理方法包括如下步骤:As shown in FIG. 2, the input data processing method includes the following steps:
步骤101,按照预设时间间隔获取手写板上产生的输入数据。Step 101: Acquire input data generated on the tablet according to a preset time interval.
在本实施方式中,所述输入数据包括X坐标值、Y坐标值、压力值以及时间戳。 In the embodiment, the input data includes an X coordinate value, a Y coordinate value, a pressure value, and a time stamp.
其中,所述输入数据可为手写笔在手写板上的位置数据(即光标位置数据),或者,所述输入数据可为光标位置数据与手写笔在手写板上输入的书写操作产生的压力值数据之和,其中,所述光标位置数据与所述压力值数据之和组成书写数据。The input data may be position data of the stylus on the tablet (ie, cursor position data), or the input data may be a pressure value generated by the cursor position data and the writing operation input by the stylus on the tablet. The sum of the data, wherein the sum of the cursor position data and the pressure value data constitutes written data.
例如,下笔时,在所述手写板上会有书写点产生,在所述手写板上就会检测到压力值,获取到的输入数据就包括光标位置数据(即X坐标值、Y坐标值)和压力值数据。抬笔时,在所述手写板上没有书写点产生,在所述手写板上检测不到压力值,获取到的输入数据只包括光标位置数据(即X坐标值、Y坐标值)。For example, when the pen is written, a writing point is generated on the tablet, and a pressure value is detected on the tablet, and the acquired input data includes cursor position data (ie, X coordinate value, Y coordinate value). And pressure value data. When the pen is lifted, no writing point is generated on the tablet, and no pressure value is detected on the tablet, and the acquired input data includes only the cursor position data (ie, the X coordinate value and the Y coordinate value).
此外,手写板程序还会自动生成时间戳t,因此手写板上产生的输入数据还包括时间戳。In addition, the tablet program automatically generates a timestamp t, so the input data generated on the tablet also includes a timestamp.
步骤102,判断所述输入数据是否为书写操作产生的书写数据。若所述输入数据为书写操作产生的书写数据,则执行步骤103。若所述输入数据不为书写操作产生的书写数据,则执行步骤105。Step 102: Determine whether the input data is written data generated by a writing operation. If the input data is written data generated by a writing operation, step 103 is performed. If the input data is not written data generated by the writing operation, step 105 is performed.
在本实施方式中,“判断所述输入数据是否为书写操作产生的书写数据”的步骤包括:In the present embodiment, the step of "determining whether the input data is written data generated by a writing operation" includes:
根据所述输入数据包括的压力值判断所述输入数据是否为书写操作产生的书写数据;Determining, according to the pressure value included in the input data, whether the input data is written data generated by a writing operation;
若所述输入数据包括的压力值不为零,则判断所述输入数据为书写操作产生的书写数据;If the input data includes a pressure value that is not zero, determining that the input data is written data generated by a writing operation;
若所述输入数据包括的压力值为零,则判断所述输入数据不为书写操作产生的书写数据。If the input data includes a pressure value of zero, it is determined that the input data is not written data generated by a writing operation.
步骤103,判断所述输入数据是否为连续书写操作产生的第一个书写数据。若所述输入数据为连续书写操作产生的第一个书写数据,则执行步骤104。若所述输入数据为连续书写操作产生的非第一个书写数据,则执行步骤105。Step 103: Determine whether the input data is the first written data generated by the continuous writing operation. If the input data is the first written data generated by the continuous writing operation, step 104 is performed. If the input data is non-first written data generated by a continuous writing operation, step 105 is performed.
在本实施方式中,“判断所述输入数据是否为连续书写操作产生的第一个书写数据”的步骤包括:In the present embodiment, the step of "determining whether the input data is the first written data generated by the continuous writing operation" includes:
根据前一次获取的输入数据的压力值判断当前获取的所述输入数据是否为连续书写操作产生的第一个书写数据;Determining, according to the pressure value of the input data acquired last time, whether the currently acquired input data is the first written data generated by the continuous writing operation;
若前一次获取的输入数据的压力值为零,则判断当前获取的所述输入数据为连续书写操作产生的第一个书写数据;If the pressure value of the input data acquired last time is zero, it is determined that the currently acquired input data is the first written data generated by the continuous writing operation;
若前一次获取的输入数据的压力值不为零,则判断当前获取的所述输入数据为连续书写操作产生的非第一个书写数据。If the pressure value of the input data acquired last time is not zero, it is judged that the currently acquired input data is the non-first written data generated by the continuous writing operation.
可以理解的是,若前一次获取的输入数据的压力值为零,可判断前一次获取的输入数据对应的是抬笔操作,此时,若当前获取的所述输入数据为书写操作产生的书写数据,则可判断当前获取的所述输入数据为连续书写操作产生的第一个书写数据。It can be understood that if the pressure value of the input data acquired last time is zero, it can be determined that the input data acquired last time corresponds to a pen-holding operation. At this time, if the currently-acquired input data is a writing operation caused by a writing operation, The data can then determine that the currently acquired input data is the first written data generated by the continuous writing operation.
若前一次获取的输入数据的压力值不为零,可判断前一次获取的输入数据对应的是下笔书写操作,此时,若当前获取的所述输入数据为书写操作产生的书写数据,则可判断当前获取的 所述输入数据为连续书写操作产生的非第一个书写数据。If the pressure value of the input data acquired last time is not zero, it can be determined that the input data acquired last time corresponds to a pen writing operation. At this time, if the currently input data is the writing data generated by the writing operation, Judge the current acquisition The input data is non-first written data generated by a continuous writing operation.
步骤104,依据第一数据格式将所述输入数据生成数据包。Step 104: Generate the data packet according to the first data format.
其中,如图3所示,所述第一数据格式的数据包的字节长度为第一预设值,且包括四个数据段,所述四个数据段分别用于存储X坐标值、Y坐标值、压力值、时间戳。As shown in FIG. 3, the byte length of the data packet of the first data format is a first preset value, and includes four data segments, where the four data segments are respectively used to store X coordinate values, Y. Coordinate value, pressure value, time stamp.
步骤105,依据第二数据格式将所述输入数据生成数据包。Step 105: Generate the data packet according to the second data format.
其中,如图4所示,所述第二数据格式的数据包的字节长度为第二预设值,且包括三个数据段,所述三个数据段分别用于存储X坐标值、Y坐标值、压力值。As shown in FIG. 4, the byte length of the data packet of the second data format is a second preset value, and includes three data segments, where the three data segments are respectively used to store X coordinate values, Y. Coordinate value, pressure value.
在本实施方式中,存储所述X坐标值、Y坐标值以及压力值的数据段均具有2Bytes的数据长度,存储所述时间戳的数据段具有4Bytes的数据长度。In the present embodiment, the data segments storing the X coordinate value, the Y coordinate value, and the pressure value each have a data length of 2 Bytes, and the data segment storing the time stamp has a data length of 4 Bytes.
在本实施方式中,所述压力值的取值范围为0~2048。由于存储所述压力值的数据段具有2Bytes的数据长度,取值范围为0~65535,如图1所示的现有技术的数据包中存储所述压力值的数据段的最高位一直为0。In the present embodiment, the pressure value ranges from 0 to 2048. Since the data segment storing the pressure value has a data length of 2 Bytes, and the value ranges from 0 to 65535, the highest bit of the data segment storing the pressure value in the prior art data packet as shown in FIG. 1 is always 0. .
现有技术的数据包中还单独设了1Byte的数据段来存储标志位数据,其中,所述标志位记录的是下笔标志和抬笔标志,分别用1和0表示下笔和抬笔。也就是说现有技术的数据包的字节长度为11Bytes。The data packet of the prior art is also separately provided with a data segment of 1 Byte for storing the flag data, wherein the flag bit records the lower pen flag and the pen pen flag, and the pen and the pen are represented by 1 and 0 respectively. That is to say, the prior art data packet has a byte length of 11 Bytes.
在本实施方式中,存储所述压力值的数据段的最高数据位还用于存储所述标志位数据,其余数据位用于存储压力值数据。In the present embodiment, the highest data bit of the data segment storing the pressure value is also used to store the flag bit data, and the remaining data bits are used to store pressure value data.
例如,当下笔产生压力时,现有技术在存储标志位的数据段中记录“01”,在存储所述压力值的数据段中记录“01e5”,而本实施方式去除存储标志位的数据段,并在存储所述压力值的数据段中记录“11e5”。抬笔时未产生压力,现有技术在存储标志位的数据段中记录“00”,在存储所述压力值的数据段中记录“0000”,而本实施方式在存储所述压力值的数据段中记录“0000”。本实施方式中通过采用存储所述压力值的数据段的最高数据位来存储标志位数据,可至少减少1Byte的标志位的存储空间,从而可优化所述数据包的存储空间。For example, when the lower pen generates pressure, the prior art records "01" in the data segment in which the flag bit is stored, and records "01e5" in the data segment in which the pressure value is stored, and the present embodiment removes the data segment in which the flag bit is stored. And "11e5" is recorded in the data segment in which the pressure value is stored. When the pen is raised, no pressure is generated. In the prior art, "00" is recorded in the data segment in which the flag is stored, and "0000" is recorded in the data segment in which the pressure value is stored, and the embodiment stores the data in the pressure value. "0000" is recorded in the segment. In the present embodiment, by storing the flag bit data by using the highest data bit of the data segment storing the pressure value, the storage space of the flag bit of 1 Byte can be reduced, so that the storage space of the data packet can be optimized.
在本实施方式中,手写板产生的时间戳为相对时间戳,书写操作的起笔点(即下笔后的第一个书写点)对应的数据包包含有存储时间戳的数据段。起笔点对应的数据包的字节长度为:2Bytes(X坐标值)+2Bytes(Y坐标值)+2Bytes(压力值)+4Bytes(时间戳)=10Bytes,即,所述第一预设值的取值为10Bytes,起笔点对应的数据包相比现有技术生成的数据包减少了1Byte的标志位的存储空间。In this embodiment, the time stamp generated by the tablet is a relative time stamp, and the data packet corresponding to the starting point of the writing operation (ie, the first writing point after the pen down) contains the data segment storing the time stamp. The byte length of the data packet corresponding to the starting point is: 2 Bytes (X coordinate value) + 2 Bytes (Y coordinate value) + 2 Bytes (pressure value) + 4 Bytes (time stamp) = 10 Bytes, that is, the first preset value The value is 10 Bytes, and the data packet corresponding to the pen point reduces the storage space of the 1 Byte flag bit compared to the data packet generated by the prior art.
在本实施方式中,由于手写板上的输入数据是按照预设时间间隔产生的,通过起笔点的时间戳与时间间隔的累计可计算出非起笔点以及抬笔操作对应的数据包的时间戳,因此,非起笔点以及抬笔操作对应的数据包可不包含存储时间戳的数据段。非起笔点以及抬笔操作对应的数 据包的字节长度为:2Bytes(X坐标值)+2Bytes(Y坐标值)+2Bytes(压力值)=6Bytes,即,所述第二预设值的取值为6Bytes,非起笔点以及抬笔操作对应的数据包相比现有技术生成的数据包减少了5Byte的标志位的存储空间。In this embodiment, since the input data on the tablet is generated according to a preset time interval, the time stamp of the data packet corresponding to the non-pick point and the pen up operation can be calculated by accumulating the time stamp of the pen point and the time interval. Therefore, the data packet corresponding to the non-pick point and the pen up operation may not include the data segment storing the time stamp. Non-starting point and number corresponding to the pen up operation According to the byte length of the packet: 2Bytes (X coordinate value) + 2Bytes (Y coordinate value) + 2Bytes (pressure value) = 6Bytes, that is, the value of the second preset value is 6Bytes, non-starting point and lifting The data packet corresponding to the pen operation reduces the storage space of the 5 Byte flag bit compared to the data packet generated by the prior art.
可以理解的是,也可以将非起笔点以及抬笔操作对应的数据包统称为非起笔数据包。It can be understood that the data packets corresponding to the non-pick point and the pen up operation can also be collectively referred to as non-priming data packets.
步骤106,将生成的所述数据包发送给接收端系统。Step 106: Send the generated data packet to the receiving end system.
在所述步骤106之后,流程返回至步骤101,按照预设时间间隔继续获取手写板上产生的输入数据。After the step 106, the flow returns to step 101 to continue to acquire input data generated on the tablet at preset time intervals.
可以理解的是,在手写板上产生的输入数据中,非起笔点以及抬笔操作对应的输入数据的数据包通常远多于起笔点对应的输入数据的数据包,因此采用本申请的输入数据处理方法能够将手写板输入数据的大部分数据包的数据长度从原来的11Bytes减少到6Bytes,使得存储容量和传输的数据量都减少了45%,起笔点的数据包的数据长度也从原来的11Bytes减少到10Bytes,使得存储容量和传输的数据量至少也减少了9%。It can be understood that, among the input data generated on the tablet, the data packets of the input data corresponding to the non-pick point and the pen-up operation are usually far more than the data packets of the input data corresponding to the pen point, and thus the input data of the present application is adopted. The processing method can reduce the data length of most data packets of the tablet input data from the original 11 Bytes to 6 Bytes, so that the storage capacity and the transmitted data amount are reduced by 45%, and the data length of the data packet of the pen point is also from the original The reduction of 11 Bytes to 10 Bytes reduced the amount of storage capacity and data transferred by at least 9%.
本申请的手写板的输入数据处理方法在不改变数据源的情况下通过重新组织数据包的数据格式,可减少数据包的数据段数量,达到了缩减数据的存储容量和传输量的目的,从而可以显著地降低存储数据所占用的存储空间以及提高数据的传输速度,以利于提高接收端系统对书写操作的响应速度,例如提高书写轨迹的实时显示速度、或者提高书写操作触发的功能的响应速度,使用户具有较佳的使用体验。The input data processing method of the tablet of the present application can reduce the number of data segments of the data packet by reorganizing the data format of the data packet without changing the data source, thereby achieving the purpose of reducing the storage capacity and the transmission amount of the data, thereby The storage space occupied by the stored data can be significantly reduced, and the data transmission speed can be improved, so as to improve the response speed of the receiving end system to the writing operation, such as increasing the real-time display speed of the writing track or improving the response speed of the function triggered by the writing operation. To give users a better experience.
请参阅图5,为本申请第二实施方式的手写板的输入数据处理方法的流程图,所述输入数据处理方法应用于具有所述手写板的电子设备中。更具体地,所述输入数据处理方法应用于所述电子设备的接收端系统中。应说明的是,本申请实施方式的所述输入数据处理方法并不限于图5所示的流程图中的步骤及顺序。根据不同的需求,所示流程图中的步骤可以增加、移除、或者改变顺序。Please refer to FIG. 5 , which is a flowchart of a method for processing input data of a tablet according to a second embodiment of the present application. The input data processing method is applied to an electronic device having the tablet. More specifically, the input data processing method is applied to a receiving end system of the electronic device. It should be noted that the input data processing method of the embodiment of the present application is not limited to the steps and the sequence in the flowchart shown in FIG. 5. The steps in the illustrated flow diagrams can be added, removed, or changed in order, depending on the requirements.
如图5所示,所述输入数据处理方法包括如下步骤:As shown in FIG. 5, the input data processing method includes the following steps:
步骤201,接收数据包并确定所述数据包的字节长度。若所述数据包的字节长度等于第一预设值,则执行步骤202。若所述数据包的字节长度等于第二预设值,则执行步骤203。Step 201: Receive a data packet and determine a byte length of the data packet. If the byte length of the data packet is equal to the first preset value, step 202 is performed. If the byte length of the data packet is equal to the second preset value, step 203 is performed.
在本实施方式中,所述第一预设值的取值为10Bytes,所述第二预设值的取值为6Bytes。In this embodiment, the value of the first preset value is 10 Bytes, and the value of the second preset value is 6 Bytes.
步骤202,确定所述数据包的数据为连续书写操作产生的第一个书写数据,并依据第一数据格式解析所述数据包以得到待处理的手写板数据。Step 202: Determine that the data of the data packet is the first written data generated by the continuous writing operation, and parse the data packet according to the first data format to obtain the tablet data to be processed.
其中,所述第一数据格式的数据包包括四个数据段,所述四个数据段分别用于存储X坐标值、Y坐标值、压力值、时间戳。The data packet of the first data format includes four data segments, and the four data segments are respectively used for storing an X coordinate value, a Y coordinate value, a pressure value, and a time stamp.
在本实施方式中,所述输入数据处理方法包括: In this embodiment, the input data processing method includes:
将解析出的时间戳确定为所述连续手写操作的起始时间戳。The parsed timestamp is determined as the starting timestamp of the continuous handwriting operation.
步骤203,依据第二数据格式解析所述数据包的数据以得到待处理的手写板数据。Step 203: Parse the data of the data packet according to the second data format to obtain the tablet data to be processed.
其中,所述第二数据格式的数据包包括三个数据段,所述三个数据段分别用于存储X坐标值、Y坐标值、压力值。The data packet of the second data format includes three data segments, and the three data segments are respectively used for storing an X coordinate value, a Y coordinate value, and a pressure value.
在本实施方式中,存储所述X坐标值、Y坐标值以及压力值的数据段均具有2Bytes的数据长度,存储所述时间戳的数据段具有4Bytes的数据长度。In the present embodiment, the data segments storing the X coordinate value, the Y coordinate value, and the pressure value each have a data length of 2 Bytes, and the data segment storing the time stamp has a data length of 4 Bytes.
步骤204,根据最近一次解析到的时间戳以及在包含所述时间戳的数据包之后接收到的数据包的数量来计算当前接收到的所述数据包的时间戳。Step 204: Calculate a timestamp of the currently received data packet according to the last parsed timestamp and the number of data packets received after the data packet containing the timestamp.
在本实施方式中,“根据最近一次解析到的时间戳以及在包含所述时间戳的数据包之后接收到的数据包的数量来计算当前接收到的所述数据包的时间戳”的步骤包括:In this embodiment, the step of “calculating the timestamp of the currently received data packet based on the last timestamp and the number of data packets received after the data packet containing the timestamp” includes :
获取最近一次解析到的时间戳和产生相邻两个输入数据的预设时间间隔;Obtaining the timestamp that was last parsed and the preset time interval for generating two adjacent input data;
确定在包含有所述时间戳的数据包之后接收到的数据包的数量;Determining the number of data packets received after the data packet containing the timestamp;
计算所述数据包的数量与所述预设时间间隔的乘积;Calculating a product of the number of the data packets and the preset time interval;
计算所述时间戳与所述乘积之和;Calculating a sum of the timestamp and the product;
将所述时间戳与所述乘积之和作为当前接收到的所述数据包的时间戳。The sum of the timestamp and the product is taken as the timestamp of the currently received data packet.
可以理解的是,所述最近一次解析到的时间戳是指最新的连续书写操作的起始时间戳。It can be understood that the timestamp that was last parsed refers to the start timestamp of the latest continuous writing operation.
在本实施方式中,手写板产生的时间戳为相对时间戳,在下笔时,手写板程序会自动生成时间戳t,手写板系统生成的书写操作的起笔点对应的数据包包含有存储时间戳的数据段,且起笔点对应的数据包的字节长度为:2Bytes(X坐标值)+2Bytes(Y坐标值)+2Bytes(压力值)+4Bytes(时间戳)=10Bytes。接收端系统在接收到字节长度为10Bytes的数据包时,可解析出这一书写操作的起笔时间戳,也可称为起始时间戳。In this embodiment, the time stamp generated by the tablet is a relative time stamp. When the pen is written, the tablet program automatically generates the time stamp t, and the data packet corresponding to the starting point of the writing operation generated by the tablet system includes the storage time stamp. The data segment, and the byte length of the packet corresponding to the pen point is: 2Bytes (X coordinate value) + 2Bytes (Y coordinate value) + 2Bytes (pressure value) + 4Bytes (time stamp) = 10Bytes. When the receiving end system receives a data packet with a byte length of 10 Bytes, it can parse the writing time stamp of the writing operation, which can also be called a starting time stamp.
在所述起笔点之后到下一次书写操作之前生成的数据包不包含存储时间戳的数据段,对应的数据包的字节长度为:2Bytes(X坐标值)+2Bytes(Y坐标值)+2Bytes(压力值)=6Bytes。接收端系统在接收到字节长度为6Bytes的数据包时,可确定这个数据包不包含时间戳,并可自动为该数据包生成时间戳。可以理解的是,也可以将所述起笔点之后到下一次书写操作之前的产生的数据包统称为非起笔数据包。The data packet generated after the starting point and before the next writing operation does not include the data segment storing the time stamp, and the byte length of the corresponding data packet is: 2 Bytes (X coordinate value) + 2 Bytes (Y coordinate value) + 2 Bytes (pressure value) = 6 Bytes. When the receiving end system receives a packet with a byte length of 6 Bytes, it can determine that the data packet does not contain a timestamp, and can automatically generate a timestamp for the data packet. It can be understood that the generated data packets after the starting point and before the next writing operation can also be collectively referred to as non-priming data packets.
假设所述起始时间戳为t0,非起笔数据包的时间戳为t,产生相邻两个输入数据的预设时间间隔为△t,在起笔数据包(即包含有所述起始时间戳的数据包)之后接收到的数据包的数量为N,则非起笔数据包的时间戳t=t0+△t*N。Assuming that the start timestamp is t0, the timestamp of the non-primed data packet is t, and the preset time interval for generating two adjacent input data is Δt, and the start data time stamp is included in the data packet (ie, the start time stamp is included) The number of data packets received after the data packet is N, and the time stamp of the non-priming data packet is t=t0+Δt*N.
步骤205,将计算得到的时间戳加到所述待处理的手写板数据中。Step 205: Add the calculated time stamp to the to-be-written tablet data.
步骤206,分析处理所述待处理的手写板数据。 Step 206: Analyze and process the tablet data to be processed.
在本实施方式中,所述输入数据处理方法还包括:In this embodiment, the input data processing method further includes:
将存储所述压力值的数据段的最高数据位的数据解析为标志位数据,其中,所述标志位包括下笔标志和抬笔标志;Parsing data of a highest data bit of the data segment storing the pressure value into flag data, wherein the flag bit includes a pen down flag and a pen pen flag;
将存储所述压力值的数据段的其余数据位的数据解析为压力值数据。The data of the remaining data bits of the data segment storing the pressure value is parsed into pressure value data.
在本实施方式中,所述输入数据处理方法还包括:In this embodiment, the input data processing method further includes:
根据所述数据包的字节长度以及解析所述数据包得到的标志位数据和压力值数据来确定所述数据包的数据的类型。Determining the type of data of the data packet based on the byte length of the data packet and the flag bit data and the pressure value data obtained by parsing the data packet.
其中,若所述数据包的字节长度等于第二预设值,所述标志位数据为下笔标记,且所述压力值不为零,则确定所述数据包的数据为连续书写操作产生的非第一个书写数据。Wherein, if the byte length of the data packet is equal to the second preset value, the flag bit data is a pen down mark, and the pressure value is not zero, determining that the data of the data packet is generated by a continuous writing operation Not the first to write data.
若所述数据包的字节长度等于第二预设值,所述标志位数据为抬笔标记,且所述压力值为零,则确定所述数据包的数据为手写板光标位置的数据。If the byte length of the data packet is equal to the second preset value, the flag bit data is a pen up flag, and the pressure value is zero, it is determined that the data of the data packet is data of a tablet cursor position.
在本实施方式中,所述待处理的手写板数据的分析处理包括但不限于根据所述待处理的手写板数据实时显示书写轨迹、或者根据所述待处理的手写板数据触发相应的功能应用。In this embodiment, the analysis processing of the tablet data to be processed includes, but is not limited to, displaying a writing track in real time according to the tablet data to be processed, or triggering a corresponding function application according to the tablet data to be processed. .
在所述步骤206之后,流程返回至步骤201,继续接收数据包并确定所述数据包的字节长度。After the step 206, the flow returns to step 201 to continue receiving the data packet and determining the byte length of the data packet.
本申请的手写板的输入数据处理方法在接收到数据包时,能够根据数据包的字节长度的不同而采用不同的数据格式来解析接收到的数据包,并自动给不包含时间戳的数据包生成相应的时间戳,从而可利于手写板系统在生成数据包时缩减数据包的字节长度,以显著地降低存储数据所占用的存储空间并提高数据的传输速度。The input data processing method of the tablet of the present application can parse the received data packet by using different data formats according to the byte length of the data packet when receiving the data packet, and automatically provide the data that does not include the time stamp. The packet generates a corresponding timestamp, which can help the tablet system to reduce the byte length of the data packet when generating the data packet, so as to significantly reduce the storage space occupied by the stored data and increase the data transmission speed.
请参阅图6,为本申请第一实施方式的输入数据处理装置10的功能模块示意图,所述输入数据处理装置10应用于具有手写板的电子设备中。更具体地,所述输入数据处理装置10应用于所述电子设备的手写板系统中。所述输入数据处理装置10可以包括一个或多个模块,所述一个或多个模块被储存在所述电子设备的存储器中并被配置成由一个或多个处理器(本实施方式为一个处理器)执行,以完成本申请。例如,参阅图6所示,所述输入数据处理装置10可以包括获取模块11、判断模块12、数据包生成模块13以及发送模块14。本申请实施例所称的模块可以是完成一特定功能的程序段,比程序更适合于描述软件在处理器中的执行过程。可以理解的是,对应于上述第一实施方式的输入数据处理方法,所述输入数据处理装置10可以包括图6中所示的各功能模块中的一部分或全部,各模块的功能将在下面具体介绍。Please refer to FIG. 6, which is a functional block diagram of the input data processing device 10 according to the first embodiment of the present application. The input data processing device 10 is applied to an electronic device having a tablet. More specifically, the input data processing device 10 is applied to a tablet system of the electronic device. The input data processing device 10 may include one or more modules stored in a memory of the electronic device and configured to be processed by one or more processors (this embodiment is a process) Execution to complete this application. For example, referring to FIG. 6, the input data processing apparatus 10 may include an acquisition module 11, a determination module 12, a data packet generation module 13, and a transmission module 14. The module referred to in the embodiment of the present application may be a program segment that completes a specific function, and is more suitable than the program to describe the execution process of the software in the processor. It can be understood that, corresponding to the input data processing method of the first embodiment, the input data processing apparatus 10 may include some or all of the functional modules shown in FIG. 6, and the functions of each module will be specifically described below. Introduction.
所述获取模块11用于按照预设时间间隔获取手写板上产生的输入数据。The obtaining module 11 is configured to acquire input data generated on the tablet according to a preset time interval.
在本实施方式中,所述输入数据包括X坐标值、Y坐标值、压力值以及时间戳。In the embodiment, the input data includes an X coordinate value, a Y coordinate value, a pressure value, and a time stamp.
其中,所述输入数据可为手写笔在手写板上的位置数据(即光标位置数据),或者,所述 输入数据可为光标位置数据与手写笔在手写板上输入的书写操作产生的压力值数据之和,其中,所述光标位置数据与所述压力值数据之和组成书写数据。The input data may be position data of the stylus on the tablet (ie, cursor position data), or The input data may be a sum of cursor position data and pressure value data generated by a writing operation input by the stylus on the tablet, wherein the sum of the cursor position data and the pressure value data constitutes written data.
例如,下笔时,在所述手写板上会有书写点产生,在所述手写板上就会检测到压力值,所述获取模块11获取到的输入数据就包括光标位置数据(即X坐标值、Y坐标值)和压力值数据。抬笔时,在所述手写板上没有书写点产生,在所述手写板上检测不到压力值,所述获取模块11获取到的输入数据只包括光标位置数据(即X坐标值、Y坐标值)。For example, when the pen is written, a writing point is generated on the tablet, and a pressure value is detected on the tablet. The input data acquired by the acquiring module 11 includes cursor position data (ie, an X coordinate value). , Y coordinate value) and pressure value data. When the pen is lifted, no writing point is generated on the tablet, and no pressure value is detected on the tablet. The input data acquired by the acquiring module 11 only includes the cursor position data (ie, the X coordinate value and the Y coordinate). value).
此外,手写板程序还会自动生成时间戳t,因此手写板上产生的输入数据还包括时间戳。In addition, the tablet program automatically generates a timestamp t, so the input data generated on the tablet also includes a timestamp.
所述判断模块12用于判断所述输入数据是否为书写操作产生的书写数据。The determining module 12 is configured to determine whether the input data is written data generated by a writing operation.
在本实施方式中,所述判断模块12在判断所述输入数据是否为书写操作产生的书写数据时,具体用于:In this embodiment, when the determining module 12 determines whether the input data is written data generated by a writing operation, the determining module 12 is specifically configured to:
根据所述输入数据包括的压力值判断所述输入数据是否为书写操作产生的书写数据;Determining, according to the pressure value included in the input data, whether the input data is written data generated by a writing operation;
若所述输入数据包括的压力值不为零,则判断所述输入数据为书写操作产生的书写数据;If the input data includes a pressure value that is not zero, determining that the input data is written data generated by a writing operation;
若所述输入数据包括的压力值为零,则判断所述输入数据不为书写操作产生的书写数据。If the input data includes a pressure value of zero, it is determined that the input data is not written data generated by a writing operation.
所述判断模块12还用于在判断所述输入数据为书写操作产生的书写数据时,继续判断所述输入数据是否为连续书写操作产生的第一个书写数据。The determining module 12 is further configured to continue to determine whether the input data is the first written data generated by the continuous writing operation when determining that the input data is writing data generated by the writing operation.
在本实施方式中,所述判断模块12在判断所述输入数据是否为连续书写操作产生的第一个书写数据时,具体用于:In the embodiment, when the determining module 12 determines whether the input data is the first written data generated by the continuous writing operation, the determining module 12 is specifically configured to:
根据前一次获取的输入数据的压力值判断当前获取的所述输入数据是否为连续书写操作产生的第一个书写数据;Determining, according to the pressure value of the input data acquired last time, whether the currently acquired input data is the first written data generated by the continuous writing operation;
若前一次获取的输入数据的压力值为零,则判断当前获取的所述输入数据为连续书写操作产生的第一个书写数据;If the pressure value of the input data acquired last time is zero, it is determined that the currently acquired input data is the first written data generated by the continuous writing operation;
若前一次获取的输入数据的压力值不为零,则判断当前获取的所述输入数据为连续书写操作产生的非第一个书写数据。If the pressure value of the input data acquired last time is not zero, it is judged that the currently acquired input data is the non-first written data generated by the continuous writing operation.
可以理解的是,若前一次获取的输入数据的压力值为零,可判断前一次获取的输入数据对应的是抬笔操作,此时,若当前获取的所述输入数据为书写操作产生的书写数据,则可判断当前获取的所述输入数据为连续书写操作产生的第一个书写数据。It can be understood that if the pressure value of the input data acquired last time is zero, it can be determined that the input data acquired last time corresponds to a pen-holding operation. At this time, if the currently-acquired input data is a writing operation caused by a writing operation, The data can then determine that the currently acquired input data is the first written data generated by the continuous writing operation.
若前一次获取的输入数据的压力值不为零,可判断前一次获取的输入数据对应的是下笔书写操作,此时,若当前获取的所述输入数据为书写操作产生的书写数据,则可判断当前获取的所述输入数据为连续书写操作产生的非第一个书写数据。If the pressure value of the input data acquired last time is not zero, it can be determined that the input data acquired last time corresponds to a pen writing operation. At this time, if the currently input data is the writing data generated by the writing operation, It is judged that the input data currently acquired is the non-first written data generated by the continuous writing operation.
所述数据包生成模块13用于在所述输入数据为连续书写操作产生的第一个书写数据时,依据第一数据格式将所述输入数据生成数据包。 The data packet generating module 13 is configured to generate the data packet according to the first data format when the input data is the first written data generated by the continuous writing operation.
其中,如图3所示,所述第一数据格式的数据包的字节长度为第一预设值,且包括四个数据段,所述四个数据段分别用于存储X坐标值、Y坐标值、压力值、时间戳。As shown in FIG. 3, the byte length of the data packet of the first data format is a first preset value, and includes four data segments, where the four data segments are respectively used to store X coordinate values, Y. Coordinate value, pressure value, time stamp.
所述数据包生成模块13还用于在所述输入数据不为书写操作产生的书写数据,或者所述输入数据为连续书写操作产生的非第一个书写数据时,依据第二数据格式将所述输入数据生成数据包。The data packet generating module 13 is further configured to: when the input data is not written data generated by a writing operation, or the input data is a non-first writing data generated by a continuous writing operation, according to the second data format The input data generates a data packet.
其中,如图4所示,所述第二数据格式的数据包的字节长度为第二预设值,且包括三个数据段,所述三个数据段分别用于存储X坐标值、Y坐标值、压力值。As shown in FIG. 4, the byte length of the data packet of the second data format is a second preset value, and includes three data segments, where the three data segments are respectively used to store X coordinate values, Y. Coordinate value, pressure value.
在本实施方式中,存储所述X坐标值、Y坐标值以及压力值的数据段均具有2Bytes的数据长度,存储所述时间戳的数据段具有4Bytes的数据长度。In the present embodiment, the data segments storing the X coordinate value, the Y coordinate value, and the pressure value each have a data length of 2 Bytes, and the data segment storing the time stamp has a data length of 4 Bytes.
在本实施方式中,所述压力值的取值范围为0~2048。由于存储所述压力值的数据段具有2Bytes的数据长度,取值范围为0~65535,如图1所示的现有技术的数据包中存储所述压力值的数据段的最高位一直为0。In the present embodiment, the pressure value ranges from 0 to 2048. Since the data segment storing the pressure value has a data length of 2 Bytes, and the value ranges from 0 to 65535, the highest bit of the data segment storing the pressure value in the prior art data packet as shown in FIG. 1 is always 0. .
现有技术的数据包中还单独设了1Byte的数据段来存储标志位数据,其中,所述标志位记录的是下笔标志和抬笔标志,分别用1和0表示下笔和抬笔。也就是说现有技术的数据包的字节长度为11Bytes。The data packet of the prior art is also separately provided with a data segment of 1 Byte for storing the flag data, wherein the flag bit records the lower pen flag and the pen pen flag, and the pen and the pen are represented by 1 and 0 respectively. That is to say, the prior art data packet has a byte length of 11 Bytes.
在本实施方式中,存储所述压力值的数据段的最高数据位还用于存储所述标志位数据,其余数据位用于存储压力值数据。In the present embodiment, the highest data bit of the data segment storing the pressure value is also used to store the flag bit data, and the remaining data bits are used to store pressure value data.
例如,当下笔产生压力时,现有技术在存储标志位的数据段中记录“01”,在存储所述压力值的数据段中记录“01e5”,而本实施方式去除存储标志位的数据段,并在存储所述压力值的数据段中记录“11e5”。抬笔时未产生压力,现有技术在存储标志位的数据段中记录“00”,在存储所述压力值的数据段中记录“0000”,而本实施方式在存储所述压力值的数据段中记录“0000”。本实施方式中通过采用存储所述压力值的数据段的最高数据位来存储标志位数据,可至少减少1Byte的标志位的存储空间,从而可优化所述数据包的存储空间。For example, when the lower pen generates pressure, the prior art records "01" in the data segment in which the flag bit is stored, and records "01e5" in the data segment in which the pressure value is stored, and the present embodiment removes the data segment in which the flag bit is stored. And "11e5" is recorded in the data segment in which the pressure value is stored. When the pen is raised, no pressure is generated. In the prior art, "00" is recorded in the data segment in which the flag is stored, and "0000" is recorded in the data segment in which the pressure value is stored, and the embodiment stores the data in the pressure value. "0000" is recorded in the segment. In the present embodiment, by storing the flag bit data by using the highest data bit of the data segment storing the pressure value, the storage space of the flag bit of 1 Byte can be reduced, so that the storage space of the data packet can be optimized.
在本实施方式中,手写板产生的时间戳为相对时间戳,书写操作的起笔点(即下笔后的第一个书写点)对应的数据包包含有存储时间戳的数据段。起笔点对应的数据包的字节长度为:2Bytes(X坐标值)+2Bytes(Y坐标值)+2Bytes(压力值)+4Bytes(时间戳)=10Bytes,即,所述第一预设值的取值为10Bytes,起笔点对应的数据包相比现有技术生成的数据包减少了1Byte的标志位的存储空间。In this embodiment, the time stamp generated by the tablet is a relative time stamp, and the data packet corresponding to the starting point of the writing operation (ie, the first writing point after the pen down) contains the data segment storing the time stamp. The byte length of the data packet corresponding to the starting point is: 2 Bytes (X coordinate value) + 2 Bytes (Y coordinate value) + 2 Bytes (pressure value) + 4 Bytes (time stamp) = 10 Bytes, that is, the first preset value The value is 10 Bytes, and the data packet corresponding to the pen point reduces the storage space of the 1 Byte flag bit compared to the data packet generated by the prior art.
在本实施方式中,由于手写板上的输入数据是按照预设时间间隔产生的,通过起笔点的时间戳与时间间隔的累计可计算出非起笔点以及抬笔操作对应的数据包的时间戳,因此,非起笔点以及抬笔操作对应的数据包可不包含存储时间戳的数据段。非起笔点以及抬笔操作对应的数 据包的字节长度为:2Bytes(X坐标值)+2Bytes(Y坐标值)+2Bytes(压力值)=6Bytes,即,所述第二预设值的取值为6Bytes,非起笔点以及抬笔操作对应的数据包相比现有技术生成的数据包减少了5Byte的标志位的存储空间。In this embodiment, since the input data on the tablet is generated according to a preset time interval, the time stamp of the data packet corresponding to the non-pick point and the pen up operation can be calculated by accumulating the time stamp of the pen point and the time interval. Therefore, the data packet corresponding to the non-pick point and the pen up operation may not include the data segment storing the time stamp. Non-starting point and number corresponding to the pen up operation According to the byte length of the packet: 2Bytes (X coordinate value) + 2Bytes (Y coordinate value) + 2Bytes (pressure value) = 6Bytes, that is, the value of the second preset value is 6Bytes, non-starting point and lifting The data packet corresponding to the pen operation reduces the storage space of the 5 Byte flag bit compared to the data packet generated by the prior art.
可以理解的是,也可以将非起笔点以及抬笔操作对应的数据包统称为非起笔数据包。It can be understood that the data packets corresponding to the non-pick point and the pen up operation can also be collectively referred to as non-priming data packets.
所述发送模块14用于将生成的所述数据包发送给接收端系统。The sending module 14 is configured to send the generated data packet to the receiving end system.
可以理解的是,在手写板上产生的输入数据中,非起笔点以及抬笔操作对应的输入数据的数据包通常远多于起笔点对应的输入数据的数据包,因此采用本申请的输入数据处理装置10能够将手写板输入数据的大部分数据包的数据长度从原来的11Bytes减少到6Bytes,使得存储容量和传输的数据量都减少了45%,起笔点的数据包的数据长度也从原来的11Bytes减少到10Bytes,使得存储容量和传输的数据量至少也减少了9%。It can be understood that, among the input data generated on the tablet, the data packets of the input data corresponding to the non-pick point and the pen-up operation are usually far more than the data packets of the input data corresponding to the pen point, and thus the input data of the present application is adopted. The processing device 10 can reduce the data length of most data packets of the tablet input data from the original 11 Bytes to 6 Bytes, so that the storage capacity and the transmitted data amount are reduced by 45%, and the data length of the data packet of the pen point is also from the original. The 11Bytes is reduced to 10Bytes, which reduces the amount of storage capacity and data transferred by at least 9%.
本申请的手写板的输入数据处理装置10在不改变数据源的情况下通过重新组织数据包的数据格式,可减少数据包的数据段数量,达到了缩减数据的存储容量和传输量的目的,从而可以显著地降低存储数据所占用的存储空间以及提高数据的传输速度,以利于提高接收端系统对书写操作的响应速度,例如提高书写轨迹的实时显示速度、或者提高书写操作触发的功能的响应速度。The input data processing apparatus 10 of the tablet of the present application can reduce the number of data segments of the data packet by reorganizing the data format of the data packet without changing the data source, thereby achieving the purpose of reducing the storage capacity and the transmission amount of the data. Thereby, the storage space occupied by the stored data can be significantly reduced and the data transmission speed can be improved, so as to improve the response speed of the receiving end system to the writing operation, for example, improving the real-time display speed of the writing track or improving the response of the function triggered by the writing operation. speed.
请参阅图7,为本申请第二实施方式的输入数据处理装置20的功能模块示意图,所述输入数据处理装置20应用于具有手写板的电子设备中。更具体地,所述输入数据处理装置20应用于所述电子设备的接收端系统中。所述输入数据处理装置20可以包括一个或多个模块,所述一个或多个模块被储存在所述电子设备的存储器中并被配置成由一个或多个处理器(本实施方式为一个处理器)执行,以完成本申请。例如,参阅图7所示,所述输入数据处理装置20可以包括接收模块21、解析模块22、处理模块23、计算模块24以及加载模块25。本申请实施例所称的模块可以是完成一特定功能的程序段,比程序更适合于描述软件在处理器中的执行过程。可以理解的是,对应于上述第二实施方式的输入数据处理方法,所述输入数据处理装置20可以包括图7中所示的各功能模块中的一部分或全部,各模块的功能将在下面具体介绍。Please refer to FIG. 7, which is a functional block diagram of an input data processing device 20 according to a second embodiment of the present application. The input data processing device 20 is applied to an electronic device having a tablet. More specifically, the input data processing device 20 is applied to a receiving end system of the electronic device. The input data processing device 20 may include one or more modules stored in a memory of the electronic device and configured to be processed by one or more processors (this embodiment is a process) Execution to complete this application. For example, referring to FIG. 7, the input data processing apparatus 20 may include a receiving module 21, a parsing module 22, a processing module 23, a computing module 24, and a loading module 25. The module referred to in the embodiment of the present application may be a program segment that completes a specific function, and is more suitable than the program to describe the execution process of the software in the processor. It can be understood that, corresponding to the input data processing method of the second embodiment, the input data processing device 20 may include some or all of the functional modules shown in FIG. 7, and the functions of each module will be specifically described below. Introduction.
所述接收模块21用于接收数据包。其中,所述数据包来自于手写板系统中。The receiving module 21 is configured to receive a data packet. Wherein, the data packet is from a tablet system.
所述解析模块22用于确定所述数据包的字节长度。The parsing module 22 is configured to determine a byte length of the data packet.
在本实施方式中,所述解析模块22还用于在确定所述数据包的字节长度等于第一预设值时,确定所述数据包的数据为连续书写操作产生的第一个书写数据,并依据第一数据格式解析所述数据包以得到待处理的手写板数据。In this embodiment, the parsing module 22 is further configured to: when determining that the byte length of the data packet is equal to the first preset value, determine that the data of the data packet is the first written data generated by the continuous writing operation. And parsing the data packet according to the first data format to obtain the tablet data to be processed.
在本实施方式中,所述第一预设值的取值为10Bytes。其中,所述第一数据格式的数据包包括四个数据段,所述四个数据段分别用于存储X坐标值、Y坐标值、压力值、时间戳。 In this embodiment, the value of the first preset value is 10 Bytes. The data packet of the first data format includes four data segments, and the four data segments are respectively used for storing an X coordinate value, a Y coordinate value, a pressure value, and a time stamp.
所述处理模块23用于将解析出的时间戳确定为所述连续手写操作的起始时间戳。The processing module 23 is configured to determine the parsed timestamp as a starting timestamp of the continuous handwriting operation.
在本实施方式中,所述解析模块22还用于在确定所述数据包的字节长度等于第二预设值时,依据第二数据格式解析所述数据包的数据以得到待处理的手写板数据。In this embodiment, the parsing module 22 is further configured to parse the data of the data packet according to the second data format to obtain the handwritten to be processed when determining that the byte length of the data packet is equal to the second preset value. Board data.
在本实施方式中,所述第二预设值的取值为6Bytes。其中,所述第二数据格式的数据包包括三个数据段,所述三个数据段分别用于存储X坐标值、Y坐标值、压力值。In this embodiment, the value of the second preset value is 6 Bytes. The data packet of the second data format includes three data segments, and the three data segments are respectively used for storing an X coordinate value, a Y coordinate value, and a pressure value.
在本实施方式中,存储所述X坐标值、Y坐标值以及压力值的数据段均具有2Bytes的数据长度,存储所述时间戳的数据段具有4Bytes的数据长度。In the present embodiment, the data segments storing the X coordinate value, the Y coordinate value, and the pressure value each have a data length of 2 Bytes, and the data segment storing the time stamp has a data length of 4 Bytes.
所述计算模块24用于根据最近一次解析到的时间戳以及在包含所述时间戳的数据包之后接收到的数据包的数量来计算当前接收到的所述数据包的时间戳。The calculating module 24 is configured to calculate a timestamp of the currently received data packet according to the last parsed timestamp and the number of data packets received after the data packet containing the timestamp.
在本实施方式中,所述计算模块24在计算当前接收到的所述数据包的时间戳时,具体用于:In this embodiment, when calculating the timestamp of the currently received data packet, the calculating module 24 is specifically configured to:
获取最近一次解析到的时间戳和产生相邻两个输入数据的预设时间间隔;Obtaining the timestamp that was last parsed and the preset time interval for generating two adjacent input data;
确定在包含有所述时间戳的数据包之后接收到的数据包的数量;Determining the number of data packets received after the data packet containing the timestamp;
计算所述数据包的数量与所述预设时间间隔的乘积;Calculating a product of the number of the data packets and the preset time interval;
计算所述时间戳与所述乘积之和;Calculating a sum of the timestamp and the product;
将所述时间戳与所述乘积之和作为当前接收到的所述数据包的时间戳。The sum of the timestamp and the product is taken as the timestamp of the currently received data packet.
可以理解的是,所述最近一次解析到的时间戳是指最新的连续书写操作的起始时间戳。It can be understood that the timestamp that was last parsed refers to the start timestamp of the latest continuous writing operation.
在本实施方式中,手写板产生的时间戳为相对时间戳,在下笔时,手写板程序会自动生成时间戳t,手写板系统生成的书写操作的起笔点对应的数据包包含有存储时间戳的数据段,且起笔点对应的数据包的字节长度为:2Bytes(X坐标值)+2Bytes(Y坐标值)+2Bytes(压力值)+4Bytes(时间戳)=10Bytes。接收端系统在接收到字节长度为10Bytes的数据包时,可解析出这一书写操作的起笔时间戳,也可称为起始时间戳。In this embodiment, the time stamp generated by the tablet is a relative time stamp. When the pen is written, the tablet program automatically generates the time stamp t, and the data packet corresponding to the starting point of the writing operation generated by the tablet system includes the storage time stamp. The data segment, and the byte length of the packet corresponding to the pen point is: 2Bytes (X coordinate value) + 2Bytes (Y coordinate value) + 2Bytes (pressure value) + 4Bytes (time stamp) = 10Bytes. When the receiving end system receives a data packet with a byte length of 10 Bytes, it can parse the writing time stamp of the writing operation, which can also be called a starting time stamp.
在所述起笔点之后到下一次书写操作之前生成的数据包不包含存储时间戳的数据段,对应的数据包的字节长度为:2Bytes(X坐标值)+2Bytes(Y坐标值)+2Bytes(压力值)=6Bytes。接收端系统在接收到字节长度为6Bytes的数据包时,可确定这个数据包不包含时间戳,并可自动为该数据包生成时间戳。可以理解的是,也可以将所述起笔点之后到下一次书写操作之前的产生的数据包统称为非起笔数据包。The data packet generated after the starting point and before the next writing operation does not include the data segment storing the time stamp, and the byte length of the corresponding data packet is: 2 Bytes (X coordinate value) + 2 Bytes (Y coordinate value) + 2 Bytes (pressure value) = 6 Bytes. When the receiving end system receives a packet with a byte length of 6 Bytes, it can determine that the data packet does not contain a timestamp, and can automatically generate a timestamp for the data packet. It can be understood that the generated data packets after the starting point and before the next writing operation can also be collectively referred to as non-priming data packets.
假设所述起始时间戳为t0,非起笔数据包的时间戳为t,产生相邻两个输入数据的预设时间间隔为△t,在起笔数据包(即包含有所述起始时间戳的数据包)之后接收到的数据包的数量为N,则非起笔数据包的时间戳t=t0+△t*N。Assuming that the start timestamp is t0, the timestamp of the non-primed data packet is t, and the preset time interval for generating two adjacent input data is Δt, and the start data time stamp is included in the data packet (ie, the start time stamp is included) The number of data packets received after the data packet is N, and the time stamp of the non-priming data packet is t=t0+Δt*N.
所述加载模块25用于将计算得到的时间戳加到所述待处理的手写板数据中。 The loading module 25 is configured to add the calculated time stamp to the to-be-written tablet data.
所述处理模块23还用于分析处理所述待处理的手写板数据。The processing module 23 is further configured to analyze and process the tablet data to be processed.
在本实施方式中,所述解析模块22还用于将存储所述压力值的数据段的最高数据位的数据解析为标志位数据,并将存储所述压力值的数据段的其余数据位的数据解析为压力值数据,其中,所述标志位包括下笔标志和抬笔标志。In this embodiment, the parsing module 22 is further configured to parse data of the highest data bit of the data segment storing the pressure value into flag bit data, and store the remaining data bits of the data segment of the pressure value. The data is parsed into pressure value data, wherein the flag bit includes a lower pen flag and a pen pen flag.
在本实施方式中,所述处理模块23还用于根据所述数据包的字节长度以及解析所述数据包得到的标志位数据和压力值数据来确定所述数据包的数据的类型。In this embodiment, the processing module 23 is further configured to determine the type of the data of the data packet according to the byte length of the data packet and the flag bit data and the pressure value data obtained by parsing the data packet.
其中,若所述数据包的字节长度等于第二预设值,所述标志位数据为下笔标记,且所述压力值不为零,则所述处理模块23确定所述数据包的数据为连续书写操作产生的非第一个书写数据。Wherein, if the byte length of the data packet is equal to the second preset value, the flag bit data is a pen down mark, and the pressure value is not zero, the processing module 23 determines that the data of the data packet is Non-first written data produced by continuous writing operations.
若所述数据包的字节长度等于第二预设值,所述标志位数据为抬笔标记,且所述压力值为零,则所述处理模块23确定所述数据包的数据为手写板光标位置的数据。If the byte length of the data packet is equal to the second preset value, the flag bit data is a pen up flag, and the pressure value is zero, the processing module 23 determines that the data of the data packet is a tablet The data at the cursor position.
在本实施方式中,所述待处理的手写板数据的分析处理包括但不限于根据所述待处理的手写板数据实时显示书写轨迹、或者根据所述待处理的手写板数据触发相应的功能应用。In this embodiment, the analysis processing of the tablet data to be processed includes, but is not limited to, displaying a writing track in real time according to the tablet data to be processed, or triggering a corresponding function application according to the tablet data to be processed. .
本申请的手写板的输入数据处理装置20在接收到数据包时,能够根据数据包的字节长度的不同而采用不同的数据格式来解析接收到的数据包,并自动给不包含时间戳的数据包生成相应的时间戳,从而可利于手写板系统在生成数据包时缩减数据包的字节长度,以显著地降低存储数据所占用的存储空间并提高数据的传输速度。When receiving the data packet, the input data processing device 20 of the tablet of the present application can parse the received data packet according to the byte length of the data packet, and automatically provide the time stamp without the time stamp. The data packet generates a corresponding time stamp, which can help the tablet system to reduce the byte length of the data packet when generating the data packet, so as to significantly reduce the storage space occupied by the storage data and increase the data transmission speed.
本申请实施例还提供一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现上述各实施方式中所述的手写板的输入数据处理方法的步骤。The embodiment of the present application further provides an electronic device, including a memory, a processor, and a computer program stored on the memory and operable on the processor, where the processor executes the program to implement the foregoing embodiments. The steps of the input data processing method of the tablet.
图8为本申请一实施方式的电子设备100的功能模块示意图。如图8所示,所述电子设备100至少包括处理器30、存储器40、存储在所述存储器40中并可在所述处理器30上运行的计算机程序50(例如输入数据处理程序)、手写板系统60以及接收端系统70。FIG. 8 is a schematic diagram of functional modules of an electronic device 100 according to an embodiment of the present application. As shown in FIG. 8, the electronic device 100 includes at least a processor 30, a memory 40, a computer program 50 (eg, an input data processing program) stored in the memory 40 and operable on the processor 30, handwritten Board system 60 and receiver system 70.
其中,所述电子设备100可以是一个具有触摸屏的智能手机、平板电脑、电视机,或具有手写板和显示器的计算机装置等。所述手写板系统60以及接收端系统70可以是独立存在的,也可以是整合为一体的,例如手写板系统60以及接收端系统70可以是由手写板与显示屏组合成的触摸屏。The electronic device 100 can be a smart phone with a touch screen, a tablet computer, a television set, or a computer device with a tablet and a display. The tablet system 60 and the receiving end system 70 may be independent or integrated, for example, the tablet system 60 and the receiving end system 70 may be a touch screen composed of a tablet and a display screen.
本领域技术人员可以理解,所述示意图8仅仅是本申请用于实现手写板的输入数据处理方法的电子设备100的示例,并不构成对所述电子设备100的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如所述电子设备100还可以包括输入输出设备、网络接入设备、无线传输设备等。 It can be understood by those skilled in the art that the schematic diagram 8 is only an example of the electronic device 100 used in the present application for implementing the input data processing method of the tablet, and does not constitute a limitation on the electronic device 100, and may include more than the illustration. More or less components, or combinations of certain components, or different components, such as the electronic device 100 may also include input and output devices, network access devices, wireless transmission devices, and the like.
所述处理器30执行所述计算机程序50时实现上述各个输入数据处理方法实施方式中的步骤,例如图2所示的步骤101~106,或者图5示的步骤201~206。或者,所述处理器30执行所述计算机程序50时实现上述输入数据处理装置10、20实施方式中各模块/单元,例如模块11~14、21~25的功能。When the processor 30 executes the computer program 50, the steps in the implementation of each of the input data processing methods described above are implemented, such as steps 101-106 shown in FIG. 2 or steps 201-206 shown in FIG. Alternatively, when the processor 30 executes the computer program 50, the functions of the modules/units, for example, the modules 11-14, 21-25, in the embodiment of the input data processing device 10, 20 described above are implemented.
示例性的,所述计算机程序50可以被分割成一个或多个模块/单元,所述一个或多个模块/单元被存储在所述存储器40中,并由所述处理器30执行,以完成本申请。所述一个或多个模块/单元可以是能够完成特定功能的一系列计算机程序50指令段,所述指令段用于描述所述计算机程序50在所述电子设备100中的执行过程。例如,所述计算机程序50可以被分割成图6中的获取模块11、判断模块12、数据包生成模块13以及发送模块14,和图7中的接收模块21、解析模块22、处理模块23、计算模块24以及加载模块25,各模块11~14和21~25的具体功能请参见前面的具体介绍,为节省篇幅及避免重复起见,在此就不再赘述。Illustratively, the computer program 50 can be partitioned into one or more modules/units that are stored in the memory 40 and executed by the processor 30 to complete This application. The one or more modules/units may be a series of computer program 50 instruction segments capable of performing a particular function, the instruction segments being used to describe the execution of the computer program 50 in the electronic device 100. For example, the computer program 50 can be divided into the acquisition module 11, the determination module 12, the data packet generation module 13, and the transmission module 14, and the receiving module 21, the parsing module 22, and the processing module 23 in FIG. For the specific functions of the calculation module 24 and the loading module 25, and the functions of the modules 11 to 14 and 21 to 25, please refer to the previous detailed description. To save space and avoid duplication, no further details are provided herein.
所称处理器30可以是中央处理单元(CentralProcessingUnit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific IntegratedCircuit,ASIC)、现成可编程门阵列(Field-ProgrammableGateArray,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等,所述处理器30是所述电子设备100的控制中心,利用各种接口和线路连接整个输入数据处理装置10/电子设备100的各个部分。The processor 30 may be a central processing unit (CPU), or may be other general-purpose processors, a digital signal processor (DSP), an application specific integrated circuit (ASIC), and an off-the-shelf programmable Field-Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, etc. The general purpose processor may be a microprocessor or the processor or any conventional processor or the like, the processor 30 being the control center of the electronic device 100, connecting the entire input data processing device 10 using various interfaces and lines. / Various parts of the electronic device 100.
所述存储器40可用于存储所述计算机程序50和/或模块/单元,所述处理器30通过运行或执行存储在所述存储器40内的计算机程序50和/或模块/单元,以及调用存储在存储器40内的数据,实现所述输入数据处理装置10、20/电子设备100的各种功能。所述存储器40可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(例如声音播放功能、图像播放功能等)等;存储数据区可存储根据电子设备100的使用所创建的数据(例如音频数据,应用上述输入数据处理方法而设置、获取的数据等)等。此外,存储器40可以包括高速随机存取存储器,还可以包括非易失性存储器,例如硬盘、内存、插接式硬盘,智能存储卡(SmartMediaCard,SMC),安全数字(SecureDigital,SD)卡,闪存卡(Flash Card)、至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。The memory 40 can be used to store the computer program 50 and/or modules/units by running or executing computer programs 50 and/or modules/units stored in the memory 40, and by calling The data within the memory 40 implements various functions of the input data processing apparatus 10, 20/electronic device 100. The memory 40 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application required for at least one function (eg, a sound playing function, an image playing function, etc.), and the like; the storage data area may be Data created according to the use of the electronic device 100 (for example, audio data, data set and acquired by applying the above-described input data processing method, and the like) are stored. In addition, the memory 40 may include a high-speed random access memory, and may also include a non-volatile memory such as a hard disk, a memory, a plug-in hard disk, a smart memory card (SMC), a Secure Digital (SD) card, and a flash memory. Flash Card, at least one disk storage device, flash device, or other volatile solid-state storage device.
本申请还提供一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现上述实施方式中所述的输入数据处理方法的步骤。The present application also provides a computer readable storage medium having stored thereon a computer program that, when executed by a processor, implements the steps of the input data processing method described in the above embodiments.
本申请的所述输入数据处理装置10、20/电子设备100/计算机装置集成的模块/单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,也可以通过计算 机程序来指令相关的硬件来完成,所述的计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,所述计算机程序包括计算机程序代码,所述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读介质可以包括:能够携带所述计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-OnlyMemory)、随机存取存储器(RAM,RandomAccess Memory)、电载波信号、电信信号以及软件分发介质等。需要说明的是,所述计算机可读介质包含的内容可以根据司法管辖区内立法和专利实践的要求进行适当的增减,例如在某些司法管辖区,根据立法和专利实践,计算机可读介质不包括电载波信号和电信信号。The input data processing device 10, 20/electronic device 100/computer device integrated module/unit of the present application can be stored in a computer readable if it is implemented in the form of a software functional unit and sold or used as a standalone product. In the storage medium. Based on such understanding, the present application implements all or part of the processes in the foregoing embodiments, and may also be calculated. The computer program can be executed by instructing related hardware, which can be stored in a computer readable storage medium, which when executed by the processor, can implement the steps of the various method embodiments described above. Wherein, the computer program comprises computer program code, which may be in the form of source code, object code form, executable file or some intermediate form. The computer readable medium may include any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a removable hard disk, a magnetic disk, an optical disk, a computer memory, a Read-Only Memory (ROM), Random access memory (RAM, Random Access Memory), electrical carrier signals, telecommunications signals, and software distribution media. It should be noted that the content contained in the computer readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in a jurisdiction, for example, in some jurisdictions, according to legislation and patent practice, computer readable media Does not include electrical carrier signals and telecommunication signals.
在本申请所提供的几个具体实施方式中,应该理解到,所揭露的输入数据处理方法和装置,可以通过其它的方式实现。例如,以上描述的输入数据处理装置实施方式仅仅是示意性的,例如,所述模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。In the specific embodiments provided in the present application, it should be understood that the disclosed input data processing method and apparatus may be implemented in other manners. For example, the implementation of the input data processing device described above is merely illustrative. For example, the division of the module is only a logical function division, and the actual implementation may have another division manner.
另外,在本申请各个实施例中的各功能模块可以集成在相同处理模块中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在相同模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用硬件加软件功能模块的形式实现。In addition, each functional module in each embodiment of the present application may be integrated in the same processing module, or each module may exist physically separately, or two or more modules may be integrated in the same module. The above integrated modules can be implemented in the form of hardware or in the form of hardware plus software function modules.
对于本领域技术人员而言,显然本申请不限于上述示范性实施例的细节,而且在不背离本申请的精神或基本特征的情况下,能够以其他的具体形式实现本申请。因此,无论从哪一点来看,均应将实施例看作是示范性的,而且是非限制性的,本申请的范围由所附权利要求而不是上述说明限定,因此旨在将落在权利要求的等同要件的含义和范围内的所有变化涵括在本申请内。不应将权利要求中的任何附图标记视为限制所涉及的权利要求。此外,显然“包括”一词不排除其他单元或步骤,单数不排除复数。装置权利要求中陈述的多个单元或装置也可以由同一个单元或装置通过软件或者硬件来实现。It is obvious to those skilled in the art that the present application is not limited to the details of the above-described exemplary embodiments, and the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present application. Therefore, the present embodiments are to be considered as illustrative and not restrictive, and the scope of the invention is defined by the appended claims instead All changes in the meaning and scope of equivalent elements are included in this application. Any reference signs in the claims should not be construed as limiting the claim. In addition, it is to be understood that the word "comprising" does not exclude other elements or steps. A plurality of units or devices recited in the device claims may also be implemented by the same unit or device in software or hardware.
最后应说明的是,以上实施方式仅用以说明本申请的技术方案而非限制,尽管参照以上较佳实施方式对本申请进行了详细说明,本领域的普通技术人员应当理解,可以对本申请的技术方案进行修改或等同替换都不应脱离本申请技术方案的精神和范围。 It should be noted that the above embodiments are only used to explain the technical solutions of the present application, and are not limited thereto. Although the present application is described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technology of the present application can be applied. Modifications or equivalents of the embodiments are not to be construed as a departure from the spirit and scope of the invention.

Claims (20)

  1. 一种手写板的输入数据处理方法,包括:A method for processing input data of a tablet, comprising:
    按照预设时间间隔获取手写板上产生的输入数据;Acquiring input data generated on the tablet according to a preset time interval;
    判断所述输入数据是否为书写操作产生的书写数据;Determining whether the input data is written data generated by a writing operation;
    若所述输入数据为书写操作产生的书写数据,则判断所述输入数据是否为连续书写操作产生的第一个书写数据;If the input data is written data generated by a writing operation, determining whether the input data is the first written data generated by the continuous writing operation;
    若所述输入数据为连续书写操作产生的第一个书写数据,则依据第一数据格式将所述输入数据生成数据包;If the input data is the first written data generated by the continuous writing operation, generating the data packet according to the first data format;
    若所述输入数据不为书写操作产生的书写数据,或者所述输入数据为连续书写操作产生的非第一个书写数据,则依据第二数据格式将所述输入数据生成数据包;If the input data is not written data generated by a writing operation, or the input data is non-first writing data generated by a continuous writing operation, generating the data packet according to the second data format;
    将生成的所述数据包发送给接收端系统。The generated data packet is sent to the receiving end system.
  2. 如权利要求1所述的输入数据处理方法,其特征在于,所述输入数据包括X坐标值、Y坐标值、压力值以及时间戳,所述第一数据格式的数据包的字节长度为第一预设值,且包括四个数据段,所述四个数据段分别用于存储X坐标值、Y坐标值、压力值、时间戳;所述第二数据格式的数据包的字节长度为第二预设值,且包括三个数据段,所述三个数据段分别用于存储X坐标值、Y坐标值、压力值。The input data processing method according to claim 1, wherein the input data comprises an X coordinate value, a Y coordinate value, a pressure value, and a time stamp, and a byte length of the data packet of the first data format is a preset value, and including four data segments, respectively, for storing an X coordinate value, a Y coordinate value, a pressure value, and a time stamp; the byte length of the data packet of the second data format is The second preset value includes three data segments, and the three data segments are respectively used to store an X coordinate value, a Y coordinate value, and a pressure value.
  3. 如权利要求2所述的输入数据处理方法,其特征在于,“判断所述输入数据是否为书写操作产生的书写数据”的步骤包括:The input data processing method according to claim 2, wherein the step of "determining whether the input data is written data generated by a writing operation" comprises:
    根据所述输入数据包括的压力值判断所述输入数据是否为书写操作产生的书写数据;Determining, according to the pressure value included in the input data, whether the input data is written data generated by a writing operation;
    若所述输入数据包括的压力值不为零,则判断所述输入数据为书写操作产生的书写数据;If the input data includes a pressure value that is not zero, determining that the input data is written data generated by a writing operation;
    若所述输入数据包括的压力值为零,则判断所述输入数据不为书写操作产生的书写数据。If the input data includes a pressure value of zero, it is determined that the input data is not written data generated by a writing operation.
  4. 如权利要求3所述的输入数据处理方法,其特征在于,“判断所述输入数据是否为连续书写操作产生的第一个书写数据”的步骤包括:The input data processing method according to claim 3, wherein the step of "determining whether said input data is the first written data generated by the continuous writing operation" comprises:
    根据前一次获取的输入数据的压力值判断当前获取的所述输入数据是否为连续书写操作产生的第一个书写数据;Determining, according to the pressure value of the input data acquired last time, whether the currently acquired input data is the first written data generated by the continuous writing operation;
    若前一次获取的输入数据的压力值为零,则判断当前获取的所述输入数据为连续书写操作产生的第一个书写数据;If the pressure value of the input data acquired last time is zero, it is determined that the currently acquired input data is the first written data generated by the continuous writing operation;
    若前一次获取的输入数据的压力值不为零,则判断当前获取的所述输入数据为连续书写操作产生的非第一个书写数据。If the pressure value of the input data acquired last time is not zero, it is judged that the currently acquired input data is the non-first written data generated by the continuous writing operation.
  5. 如权利要求2所述的输入数据处理方法,其特征在于,存储所述X坐标值、Y坐标值以 及压力值的数据段均具有2Bytes的数据长度,存储所述时间戳的数据段具有4Bytes的数据长度;所述压力值的取值范围为0~2048,存储所述压力值的数据段的最高数据位还用于存储标志位数据,其余数据位用于存储压力值数据,其中,所述标志位记录的是下笔标志和抬笔标志。The input data processing method according to claim 2, wherein said X coordinate value and Y coordinate value are stored And the data segment of the pressure value has a data length of 2 Bytes, and the data segment storing the time stamp has a data length of 4 Bytes; the pressure value ranges from 0 to 2048, and the data segment storing the pressure value is the highest. The data bits are also used to store flag bit data, and the remaining data bits are used to store pressure value data, wherein the flag bits record the pen down flag and the pen up flag.
  6. 一种手写板的输入数据处理方法,包括:A method for processing input data of a tablet, comprising:
    接收数据包并确定所述数据包的字节长度;Receiving a data packet and determining a byte length of the data packet;
    若所述数据包的字节长度等于第一预设值,则确定所述数据包的数据为连续书写操作产生的第一个书写数据,并依据第一数据格式解析所述数据包以得到待处理的手写板数据;If the byte length of the data packet is equal to the first preset value, determining that the data of the data packet is the first written data generated by the continuous writing operation, and parsing the data packet according to the first data format to obtain Handwritten tablet data;
    若所述数据包的字节长度等于第二预设值,则依据第二数据格式解析所述数据包的数据以得到待处理的手写板数据;If the byte length of the data packet is equal to the second preset value, parsing the data of the data packet according to the second data format to obtain the tablet data to be processed;
    分析处理所述待处理的手写板数据。The analysis processes the tablet data to be processed.
  7. 如权利要求6所述的输入数据处理方法,其特征在于,所述第一数据格式的数据包包括四个数据段,所述四个数据段分别用于存储X坐标值、Y坐标值、压力值、时间戳;所述第二数据格式的数据包包括三个数据段,所述三个数据段分别用于存储X坐标值、Y坐标值、压力值;The input data processing method according to claim 6, wherein the data packet of the first data format comprises four data segments, and the four data segments are respectively used for storing X coordinate values, Y coordinate values, and pressures. a value, a time stamp; the data packet of the second data format includes three data segments, and the three data segments are respectively used for storing an X coordinate value, a Y coordinate value, and a pressure value;
    在“依据第二数据格式解析所述数据包的数据以得到待处理的手写板数据”之后还包括:After "resolving the data of the data packet according to the second data format to obtain the tablet data to be processed", the method further includes:
    根据最近一次解析到的时间戳以及在包含所述时间戳的数据包之后接收到的数据包的数量来计算当前接收到的所述数据包的时间戳,并将计算得到的时间戳加到所述待处理的手写板数据中。Calculating a timestamp of the currently received data packet according to the last parsed timestamp and the number of data packets received after the data packet containing the timestamp, and adding the calculated timestamp to the timestamp In the tablet data to be processed.
  8. 如权利要求7所述的输入数据处理方法,其特征在于,所述第一预设值的取值为10Bytes,所述第二预设值的取值为6Bytes,存储所述X坐标值、Y坐标值以及压力值的数据段均具有2Bytes的数据长度,存储所述时间戳的数据段具有4Bytes的数据长度;所述输入数据处理方法还包括:The input data processing method according to claim 7, wherein the value of the first preset value is 10 Bytes, and the value of the second preset value is 6 Bytes, and the X coordinate value and Y are stored. The data segments of the coordinate value and the pressure value each have a data length of 2 Bytes, and the data segment storing the time stamp has a data length of 4 Bytes; the input data processing method further includes:
    将存储所述压力值的数据段的最高数据位的数据解析为标志位数据,其中,所述标志位包括下笔标志和抬笔标志;Parsing data of a highest data bit of the data segment storing the pressure value into flag data, wherein the flag bit includes a pen down flag and a pen pen flag;
    将存储所述压力值的数据段的其余数据位的数据解析为压力值数据。The data of the remaining data bits of the data segment storing the pressure value is parsed into pressure value data.
  9. 如权利要求8所述的输入数据处理方法,其特征在于,所述输入数据处理方法还包括:The input data processing method according to claim 8, wherein the input data processing method further comprises:
    根据所述数据包的字节长度以及解析所述数据包得到的标志位数据和压力值数据来确定所述数据包的数据的类型。Determining the type of data of the data packet based on the byte length of the data packet and the flag bit data and the pressure value data obtained by parsing the data packet.
  10. 如权利要求7所述的输入数据处理方法,其特征在于,“根据最近一次解析到的时间戳以及在包含所述时间戳的数据包之后接收到的数据包的数量来计算当前接收到的所述数据包的时间戳”的步骤包括: The input data processing method according to claim 7, wherein "the currently received location is calculated based on the last parsed timestamp and the number of data packets received after the data packet containing the timestamp. The steps of the timestamp of the data packet include:
    获取最近一次解析到的时间戳和产生相邻两个输入数据的预设时间间隔;Obtaining the timestamp that was last parsed and the preset time interval for generating two adjacent input data;
    确定在包含有所述时间戳的数据包之后接收到的数据包的数量;Determining the number of data packets received after the data packet containing the timestamp;
    计算所述数据包的数量与所述预设时间间隔的乘积;Calculating a product of the number of the data packets and the preset time interval;
    计算所述时间戳与所述乘积之和;Calculating a sum of the timestamp and the product;
    将所述时间戳与所述乘积之和作为当前接收到的所述数据包的时间戳。The sum of the timestamp and the product is taken as the timestamp of the currently received data packet.
  11. 一种电子设备,包括处理器、存储器以及存储于所述存储器中的计算机程序,其特征在于,所述处理器用于运行所述存储器中存储的计算机程序以执行以下步骤:An electronic device comprising a processor, a memory, and a computer program stored in the memory, wherein the processor is configured to execute a computer program stored in the memory to perform the following steps:
    按照预设时间间隔获取手写板上产生的输入数据;Acquiring input data generated on the tablet according to a preset time interval;
    判断所述输入数据是否为书写操作产生的书写数据;Determining whether the input data is written data generated by a writing operation;
    若所述输入数据为书写操作产生的书写数据,则判断所述输入数据是否为连续书写操作产生的第一个书写数据;If the input data is written data generated by a writing operation, determining whether the input data is the first written data generated by the continuous writing operation;
    若所述输入数据为连续书写操作产生的第一个书写数据,则依据第一数据格式将所述输入数据生成数据包;If the input data is the first written data generated by the continuous writing operation, generating the data packet according to the first data format;
    若所述输入数据不为书写操作产生的书写数据,或者所述输入数据为连续书写操作产生的非第一个书写数据,则依据第二数据格式将所述输入数据生成数据包;If the input data is not written data generated by a writing operation, or the input data is non-first writing data generated by a continuous writing operation, generating the data packet according to the second data format;
    将生成的所述数据包发送给接收端系统。The generated data packet is sent to the receiving end system.
  12. 如权利要求11所述的电子设备,其特征在于,所述输入数据包括X坐标值、Y坐标值、压力值以及时间戳,所述第一数据格式的数据包的字节长度为第一预设值,且包括四个数据段,所述四个数据段分别用于存储X坐标值、Y坐标值、压力值、时间戳,所述第二数据格式的数据包的字节长度为第二预设值,且包括三个数据段,所述三个数据段分别用于存储X坐标值、Y坐标值、压力值。The electronic device according to claim 11, wherein the input data comprises an X coordinate value, a Y coordinate value, a pressure value, and a time stamp, and a byte length of the data packet of the first data format is a first pre- Setting a value, and including four data segments, respectively, for storing an X coordinate value, a Y coordinate value, a pressure value, and a time stamp, wherein the data length of the second data format packet is the second The preset value includes three data segments, and the three data segments are respectively used for storing an X coordinate value, a Y coordinate value, and a pressure value.
  13. 如权利要求12所述的电子设备,其特征在于,所述处理器在“判断所述输入数据是否为书写操作产生的书写数据”时,具体用于:The electronic device according to claim 12, wherein the processor is specifically configured to: when determining whether the input data is written data generated by a writing operation.
    根据所述输入数据包括的压力值判断所述输入数据是否为书写操作产生的书写数据;Determining, according to the pressure value included in the input data, whether the input data is written data generated by a writing operation;
    若所述输入数据包括的压力值不为零,则判断所述输入数据为书写操作产生的书写数据;If the input data includes a pressure value that is not zero, determining that the input data is written data generated by a writing operation;
    若所述输入数据包括的压力值为零,则判断所述输入数据不为书写操作产生的书写数据。If the input data includes a pressure value of zero, it is determined that the input data is not written data generated by a writing operation.
  14. 如权利要求13所述的电子设备,其特征在于,所述处理器在“判断所述输入数据是否为连续书写操作产生的第一个书写数据”时,具体用于:The electronic device according to claim 13, wherein the processor is specifically configured to: when determining whether the input data is the first written data generated by the continuous writing operation.
    根据前一次获取的输入数据的压力值判断当前获取的所述输入数据是否为连续书写操作产生的第一个书写数据;Determining, according to the pressure value of the input data acquired last time, whether the currently acquired input data is the first written data generated by the continuous writing operation;
    若前一次获取的输入数据的压力值为零,则判断当前获取的所述输入数据为连续书写操作 产生的第一个书写数据;If the pressure value of the input data acquired last time is zero, it is determined that the currently input data is a continuous writing operation The first written data produced;
    若前一次获取的输入数据的压力值不为零,则判断当前获取的所述输入数据为连续书写操作产生的非第一个书写数据。If the pressure value of the input data acquired last time is not zero, it is judged that the currently acquired input data is the non-first written data generated by the continuous writing operation.
  15. 如权利要求12所述的电子设备,其特征在于,存储所述X坐标值、Y坐标值以及压力值的数据段均具有2Bytes的数据长度,存储所述时间戳的数据段具有4Bytes的数据长度;所述压力值的取值范围为0~2048,存储所述压力值的数据段的最高数据位还用于存储标志位数据,其余数据位用于存储压力值数据,其中,所述标志位记录的是下笔标志和抬笔标志。The electronic device according to claim 12, wherein the data segments storing the X coordinate value, the Y coordinate value, and the pressure value each have a data length of 2 Bytes, and the data segment storing the time stamp has a data length of 4 Bytes The pressure value ranges from 0 to 2048, and the highest data bit of the data segment storing the pressure value is further used to store the flag data, and the remaining data bits are used to store the pressure value data, wherein the flag bit The lower pen mark and the pen up mark are recorded.
  16. 一种电子设备,包括处理器、存储器以及存储于所述存储器中的计算机程序,其特征在于,所述处理器用于运行所述存储器中存储的计算机程序以执行以下步骤:An electronic device comprising a processor, a memory, and a computer program stored in the memory, wherein the processor is configured to execute a computer program stored in the memory to perform the following steps:
    接收数据包并确定所述数据包的字节长度;Receiving a data packet and determining a byte length of the data packet;
    若所述数据包的字节长度等于第一预设值,则确定所述数据包的数据为连续书写操作产生的第一个书写数据,并依据第一数据格式解析所述数据包以得到待处理的手写板数据;If the byte length of the data packet is equal to the first preset value, determining that the data of the data packet is the first written data generated by the continuous writing operation, and parsing the data packet according to the first data format to obtain Handwritten tablet data;
    若所述数据包的字节长度等于第二预设值,则依据第二数据格式解析所述数据包的数据以得到待处理的手写板数据;If the byte length of the data packet is equal to the second preset value, parsing the data of the data packet according to the second data format to obtain the tablet data to be processed;
    分析处理所述待处理的手写板数据。The analysis processes the tablet data to be processed.
  17. 如权利要求16所述的电子设备,其特征在于,所述第一数据格式的数据包包括四个数据段,所述四个数据段分别用于存储X坐标值、Y坐标值、压力值、时间戳,所述第二数据格式的数据包包括三个数据段,所述三个数据段分别用于存储X坐标值、Y坐标值、压力值;The electronic device according to claim 16, wherein the data packet of the first data format comprises four data segments, wherein the four data segments are respectively used for storing X coordinate values, Y coordinate values, pressure values, a time stamp, the data packet of the second data format includes three data segments, where the three data segments are respectively used for storing an X coordinate value, a Y coordinate value, and a pressure value;
    在“依据第二数据格式解析所述数据包的数据以得到待处理的手写板数据”之后,所述处理器还用于执行以下步骤:After "parsing the data of the data packet according to the second data format to obtain the tablet data to be processed", the processor is further configured to perform the following steps:
    根据最近一次解析到的时间戳以及在包含所述时间戳的数据包之后接收到的数据包的数量来计算当前接收到的所述数据包的时间戳,并将计算得到的时间戳加到所述待处理的手写板数据中。Calculating a timestamp of the currently received data packet according to the last parsed timestamp and the number of data packets received after the data packet containing the timestamp, and adding the calculated timestamp to the timestamp In the tablet data to be processed.
  18. 如权利要求17所述的电子设备,其特征在于,所述第一预设值的取值为10Bytes,所述第二预设值的取值为6Bytes,存储所述X坐标值、Y坐标值以及压力值的数据段均具有2Bytes的数据长度,存储所述时间戳的数据段具有4Bytes的数据长度;所述处理器还用于执行以下步骤:The electronic device according to claim 17, wherein the value of the first preset value is 10 Bytes, and the value of the second preset value is 6 Bytes, and the X coordinate value and the Y coordinate value are stored. And the data segments of the pressure value each have a data length of 2 Bytes, and the data segment storing the time stamp has a data length of 4 Bytes; the processor is further configured to perform the following steps:
    将存储所述压力值的数据段的最高数据位的数据解析为标志位数据,其中,所述标志位包括下笔标志和抬笔标志;Parsing data of a highest data bit of the data segment storing the pressure value into flag data, wherein the flag bit includes a pen down flag and a pen pen flag;
    将存储所述压力值的数据段的其余数据位的数据解析为压力值数据。The data of the remaining data bits of the data segment storing the pressure value is parsed into pressure value data.
  19. 如权利要求17所述的电子设备,其特征在于,所述处理器在“根据最近一次解析到的 时间戳以及在包含所述时间戳的数据包之后接收到的数据包的数量来计算当前接收到的所述数据包的时间戳”时,具体用于:The electronic device of claim 17 wherein said processor is "based on a last parsing The timestamp and the number of data packets received after the data packet containing the timestamp to calculate the timestamp of the currently received data packet, specifically for:
    获取最近一次解析到的时间戳和产生相邻两个输入数据的预设时间间隔;Obtaining the timestamp that was last parsed and the preset time interval for generating two adjacent input data;
    确定在包含有所述时间戳的数据包之后接收到的数据包的数量;Determining the number of data packets received after the data packet containing the timestamp;
    计算所述数据包的数量与所述预设时间间隔的乘积;Calculating a product of the number of the data packets and the preset time interval;
    计算所述时间戳与所述乘积之和;Calculating a sum of the timestamp and the product;
    将所述时间戳与所述乘积之和作为当前接收到的所述数据包的时间戳。The sum of the timestamp and the product is taken as the timestamp of the currently received data packet.
  20. 一种计算机可读存储介质,其上存储有计算机指令,其特征在于,所述计算机指令被处理器执行时实现如权利要求1-10中任意一项所述的手写板的输入数据处理方法的步骤。 A computer readable storage medium having stored thereon computer instructions, wherein the computer instructions are executed by a processor to implement the input data processing method of the tablet according to any one of claims 1-10 step.
PCT/CN2017/114065 2017-11-30 2017-11-30 Input data processing method for handwriting board, electronic device and storage medium WO2019104688A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2017/114065 WO2019104688A1 (en) 2017-11-30 2017-11-30 Input data processing method for handwriting board, electronic device and storage medium
CN201780096922.9A CN111356971A (en) 2017-11-30 2017-11-30 Input data processing method of handwriting board, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2017/114065 WO2019104688A1 (en) 2017-11-30 2017-11-30 Input data processing method for handwriting board, electronic device and storage medium

Publications (1)

Publication Number Publication Date
WO2019104688A1 true WO2019104688A1 (en) 2019-06-06

Family

ID=66665374

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/114065 WO2019104688A1 (en) 2017-11-30 2017-11-30 Input data processing method for handwriting board, electronic device and storage medium

Country Status (2)

Country Link
CN (1) CN111356971A (en)
WO (1) WO2019104688A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113157644B (en) * 2021-04-14 2023-01-13 上海创建达一智能科技有限公司 Real-time evaluation system for note effect of class and meeting based on paper handwriting

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101446872A (en) * 2008-12-31 2009-06-03 广东威创视讯科技股份有限公司 Touch positioning method and device thereof
CN101609396A (en) * 2008-06-16 2009-12-23 成都吉锐触摸技术股份有限公司 A kind of implementation method of communication protocol of touch screen
CN102566858A (en) * 2010-12-09 2012-07-11 联想(北京)有限公司 Touch control method and electronic equipment
CN102736765A (en) * 2011-04-15 2012-10-17 联咏科技股份有限公司 Drive method for touch display device and touch device thereof
CN106406731A (en) * 2016-09-06 2017-02-15 东莞优闪电子科技有限公司 Original handwriting writing same-screen display method and system

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
AU2001229368A1 (en) * 2000-01-30 2002-01-21 Celox Networks, Inc. Device and method for packet formatting
TW577009B (en) * 2001-12-21 2004-02-21 Inventec Appliances Corp Handwriting input device
CN100370786C (en) * 2004-03-04 2008-02-20 华为技术有限公司 A data processing chip and data packet number generating method thereof
CN101751440A (en) * 2008-12-19 2010-06-23 高德软件有限公司 Data compression/decompression method and device thereof
CN102129319A (en) * 2011-02-28 2011-07-20 李丽平 Fast information interactive system and interactive method thereof
CN105807966B (en) * 2014-12-30 2020-06-23 鸿合科技股份有限公司 Method and device for acquiring touch screen event

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101609396A (en) * 2008-06-16 2009-12-23 成都吉锐触摸技术股份有限公司 A kind of implementation method of communication protocol of touch screen
CN101446872A (en) * 2008-12-31 2009-06-03 广东威创视讯科技股份有限公司 Touch positioning method and device thereof
CN102566858A (en) * 2010-12-09 2012-07-11 联想(北京)有限公司 Touch control method and electronic equipment
CN102736765A (en) * 2011-04-15 2012-10-17 联咏科技股份有限公司 Drive method for touch display device and touch device thereof
CN106406731A (en) * 2016-09-06 2017-02-15 东莞优闪电子科技有限公司 Original handwriting writing same-screen display method and system

Also Published As

Publication number Publication date
CN111356971A (en) 2020-06-30

Similar Documents

Publication Publication Date Title
WO2020019616A1 (en) Touch control data processing method and device, intelligent device and storage medium
US20200021772A1 (en) Multimedia recording data obtaining method and terminal device
WO2015055002A1 (en) Electronic book file processing method, terminal, and electronic device
WO2020062985A1 (en) Block device access tracking method and apparatus, storage medium and terminal
WO2022016654A1 (en) Dot-matrix writing content recording method and apparatus, and electronic device
WO2019080531A1 (en) Information acquisition method and apparatus, and memory release method and apparatus
CN104581353A (en) Video recording/playing method and recording/playing device
WO2019104688A1 (en) Input data processing method for handwriting board, electronic device and storage medium
CN105654080B (en) Operation control method and device for stylus pen
WO2022099871A1 (en) Handwriting data processing method and apparatus, and electronic device
WO2022104999A1 (en) Handwriting graphics analysis method and apparatus, and electronic device
US10838543B2 (en) Method for transmitting continuous data by data compression
WO2022099868A1 (en) Method and apparatus for analyzing writing behavior feature of smart pen, and electronic device
WO2022016653A1 (en) Dot-matrix writing content recording method and apparatus, and electronic device
KR102494584B1 (en) Display apparatus and content display method thereof
WO2018157655A1 (en) Method and device for redefining control display area of screen
WO2021068382A1 (en) Multi-window operation control method and apparatus, and device and storage medium
WO2023024959A1 (en) Image labeling method and system, and device and storage medium
JP2020525963A (en) Method and apparatus for comparing media characteristics
WO2022104998A1 (en) Handwriting content evaluation method and apparatus, and electronic device
US11747921B2 (en) Handwriting generation method and apparatus, storage medium, electronic device, and system
US9195595B2 (en) Portable apparatus using multi-core storage mechanism and data access method therefor
TWI482099B (en) Image processing and recording system and image processing and recording method thereof
WO2021077263A1 (en) Power consumption log processing method and apparatus, electronic device, and storage medium
WO2020102937A1 (en) Handwriting processing method, handwriting input device and computer readable storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17933402

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17933402

Country of ref document: EP

Kind code of ref document: A1