Data processing method and apparatus

CN121411704BActive Publication Date: 2026-10-27BEIJING YUANLI WEILAI SCI & TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202511542796.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-27
Publication Date
2026-10-27
Estimated Expiration
2045-10-27

AI Technical Summary

Technical Problem

此类数据量庞大,若直接进行完整存储,将占用大量存储空间并增加传输开销,尤其在移动设备或云端同步场景下,易造成资源浪费和响应延迟

Benefits of technology

[0016]本说明书一个实施例提供的数据处理方法,确定初始书写数据,并在初始书写数据中确定书写轨迹数据,明确初始书写数据中书写文本内容的书写轨迹数据。在书写轨迹数据中确定书写点序列,并根据书写点提取策略在书写点序列中提取目标书写点。基于预设存储格式对书写轨迹数据和目标书写点进行数据压缩,获得初始书写数据对应的目标书写数据,并对目标书写数据进行存储。针对初始书写数据,先确定初始书写数据包含的书写轨迹数据,针对书写轨迹确定智能采样获得的目标书写点。对书写轨迹数据和目标书写点进行数据压缩后再存储。实现数据压缩存储,提高数据存储效率的同时,确保初始书写数据中关键特征信息的完整性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121411704B_ABST
    Figure CN121411704B_ABST
Patent Text Reader

Abstract

The embodiment of the present specification provides a data processing method and device, wherein the data processing method comprises: determining initial writing data, and determining writing track data in the initial writing data; determining a writing point sequence in the writing track data, and extracting a target writing point in the writing point sequence according to a writing point extraction strategy; performing data compression on the writing track data and the target writing point based on a preset storage format, obtaining target writing data corresponding to the initial writing data, and storing the target writing data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments in this specification relate to the field of data processing technology, and in particular to data processing methods and apparatus. Background Technology

[0002] With the widespread adoption of smart handwriting devices, electronic whiteboards, and digital signature systems, the demand for digital collection and storage of user handwriting is increasing daily. These devices, while recording text content, typically collect high-frequency handwriting coordinate sequences, forming raw handwriting data containing information such as time, pressure, and coordinates. This data volume is enormous; direct, complete storage would consume significant storage space and increase transmission overhead, especially in mobile device or cloud synchronization scenarios, easily leading to resource waste and response delays. Existing data compression methods often employ simple downsampling or lossy encoding techniques, which, while reducing data volume, often lose key dynamic features during the writing process, resulting in a significant decline in the quality of subsequent handwriting analysis or reconstruction. Therefore, a more effective data processing method is urgently needed to address these issues. Summary of the Invention

[0003] In view of the above, embodiments of this specification provide a data processing method. One or more embodiments of this specification also relate to a data processing apparatus, a computing device, a computer-readable storage medium, and a computer program product, to address the technical deficiencies existing in the prior art.

[0004] According to a first aspect of the embodiments of this specification, a data processing method is provided, comprising: Determine initial writing data, and then determine writing trajectory data from the initial writing data; A sequence of writing points is determined from the writing trajectory data, and the target writing point is extracted from the writing point sequence according to the writing point extraction strategy; The writing trajectory data and the target writing point are compressed based on a preset storage format to obtain the target writing data corresponding to the initial writing data, and the target writing data is stored.

[0005] Optionally, extracting the target writing point from the writing point sequence according to the writing point extraction strategy includes: The writing point extraction strategy includes the writing point insertion strategy and the writing point sampling strategy. According to the writing point insertion strategy, connecting writing points are inserted into the writing point sequence to obtain an initial writing point sequence; According to the writing point sampling strategy, writing point sampling is performed in the initial writing point sequence to obtain the target writing point.

[0006] Optionally, the step of inserting connecting writing points into the writing point sequence according to the writing point insertion strategy to obtain an initial writing point sequence includes: The preset point spacing is determined according to the writing point insertion strategy, and the target writing point spacing is matched in the writing point sequence according to the preset point spacing; Insert the connecting writing point at the point corresponding to the target writing point spacing to obtain the initial writing point sequence.

[0007] Optionally, the step of sampling writing points in the initial writing point sequence according to the writing point sampling strategy to obtain the target writing point includes: The distance threshold and pressure threshold are determined based on the writing point sampling strategy. In the initial writing point sequence, at least one group of writing points containing two adjacent writing points is determined, and the distance and pressure difference between the first and second writing points in each writing point group are calculated. In the at least one group of writing points containing two adjacent writing points, select a target writing point group whose distance value is greater than a distance threshold or whose pressure difference value is greater than a pressure threshold, and use the writing points in the target writing point group as the target writing points.

[0008] Optionally, the step of compressing the writing trajectory data and the target writing point based on a preset storage format to obtain the target writing data corresponding to the initial writing data includes: Determine the header file format and trajectory data format included in the preset storage format; Based on the writing trajectory data, the file fields contained in the header file format are filled to obtain the header file data; Based on the writing point attribute data corresponding to the target writing point, the trajectory fields contained in the trajectory data format are filled to obtain trajectory compressed data; The header file data and the trajectory compression data are used as the target writing data corresponding to the initial writing data.

[0009] Optionally, the step of filling the trajectory fields included in the trajectory data format with the writing point attribute data corresponding to the target writing point to obtain trajectory compressed data includes: The trajectory header field, coordinate field, time field, and handwriting field are determined from the trajectory fields included in the trajectory data format; The trajectory compressed data is obtained by filling the trajectory header field, the coordinate field, the time field and / or the handwriting field with the writing point attribute data corresponding to the target writing point.

[0010] Optionally, after extracting the target writing point from the writing point sequence according to the writing point extraction strategy, the method further includes: The erasure trajectory is determined from the writing trajectory data, and the erasure area corresponding to the erasure trajectory is constructed; By traversing the target writing points based on the erasure region, an erasure writing point associated with the erasure region is determined among the target writing points; Add an erasure marker to the erased writing point.

[0011] Optionally, when there are at least two target writing points, determining any one of the target writing points to be erased includes: Determine the writing point to be processed from the at least two target writing points; Construct the writing point ray corresponding to the writing point to be processed, and construct the directed ring graph corresponding to the erasure area based on the erasure trajectory; When the target edge in the directed ring graph crosses the writing point ray upwards, the writing point to be processed is taken as the target erasure writing point.

[0012] According to a second aspect of the embodiments of this specification, a data processing apparatus is provided, comprising: The determination module is configured to determine initial writing data and, within the initial writing data, determine writing trajectory data; The extraction module is configured to determine a sequence of writing points in the writing trajectory data and extract target writing points from the sequence of writing points according to a writing point extraction strategy. The storage module is configured to compress the writing trajectory data and the target writing point based on a preset storage format to obtain the target writing data corresponding to the initial writing data, and to store the target writing data.

[0013] According to a third aspect of the embodiments of this specification, a computing device is provided, comprising: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions, which, when executed by the processor, implement the steps of the above-described data processing method.

[0014] According to a fourth aspect of the embodiments of this specification, a computer-readable storage medium is provided that stores computer-executable instructions, which, when executed by a processor, implement the steps of the data processing method described above.

[0015] According to a fifth aspect of the embodiments of this specification, a computer program product is provided, including a computer program or instructions that, when executed by a processor, implement the steps of the above-described data processing method.

[0016] This specification provides a data processing method according to one embodiment, which determines initial writing data and writing trajectory data within the initial writing data, thus clarifying the writing trajectory data of the written text content in the initial writing data. A sequence of writing points is determined from the writing trajectory data, and target writing points are extracted from the writing point sequence according to a writing point extraction strategy. The writing trajectory data and target writing points are compressed based on a preset storage format to obtain target writing data corresponding to the initial writing data, and then the target writing data is stored. For the initial writing data, the writing trajectory data contained in the initial writing data is first determined, and target writing points obtained through intelligent sampling are determined based on the writing trajectory. The writing trajectory data and target writing points are compressed before storage. This achieves data compression and storage, improving data storage efficiency while ensuring the integrity of key feature information in the initial writing data. Attached Figure Description

[0017] Figure 1 This is a flowchart illustrating a data processing method provided in one embodiment of this specification; Figure 2 This is a schematic diagram illustrating the determination of the erasure writing point in a data processing method provided in one embodiment of this specification; Figure 3 This is a flowchart illustrating the processing procedure of a data processing method provided in one embodiment of this specification. Figure 4 This is a schematic diagram of the structure of a data processing device provided in one embodiment of this specification; Figure 5 This is a structural block diagram of a computing device provided in one embodiment of this specification. Detailed Implementation

[0018] Many specific details are set forth in the following description to provide a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar extensions without departing from the spirit of this specification. Therefore, this specification is not limited to the specific implementations disclosed below.

[0019] The terminology used in one or more embodiments of this specification is for the purpose of describing particular embodiments only and is not intended to be limiting of the one or more embodiments of this specification. The singular forms “a,” “described,” and “the” as used in one or more embodiments of this specification and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.

[0020] It should be understood that although the terms first, second, etc., may be used to describe various information in one or more embodiments of this specification, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, first may also be referred to as second without departing from the scope of one or more embodiments of this specification, and similarly, second may also be referred to as first. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to a determination."

[0021] Furthermore, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in one or more embodiments of this specification are all information and data authorized by the user or fully authorized by all parties. Moreover, the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.

[0022] First, the terms and concepts used in one or more embodiments of this specification will be explained.

[0023] Track data refers to a collection of data that records information such as pen tip position, pressure, and timestamps during handwriting.

[0024] MHWT (megrez-hand-writing-track): A binary storage format for handwritten trajectory data.

[0025] Stroke order: The order in which strokes are written in Chinese characters.

[0026] Point sampling: The process of filtering or interpolating the original trajectory points to optimize the amount of data and the performance.

[0027] Range Erase: A technique that erases pen marks within a closed curved area.

[0028] Non-Zero Winding Number Rule: An algorithm for determining whether a point is inside a polygon.

[0029] DPI (Dots Per Inch): Dots per inch, a unit of screen display resolution.

[0030] This specification provides a data processing method, and also relates to a data processing apparatus, a computing device, a computer-readable storage medium, and a computer program product, which will be described in detail in the following embodiments.

[0031] See Figure 1 , Figure 1 A flowchart of a data processing method according to an embodiment of this specification is shown, which specifically includes the following steps.

[0032] Step 102: Determine the initial writing data, and determine the writing trajectory data from the initial writing data.

[0033] Specifically, initial writing data can be data generated by users inputting data by handwriting through handwriting devices such as smart handwriting devices, learning machines, electronic whiteboards, and digital signature devices. Initial writing data records the time, stroke trajectory, writing pressure, writing point, and the coordinates (two-dimensional coordinates) of the writing point on the writing canvas when the user writes text content. Writing trajectory data can be the data from the moment the pen touches the canvas to the moment it is lifted when writing text content. It can also be the stroke trajectory of each character when writing text, the writing trajectory of letters from the moment the pen touches the canvas to the moment it is lifted when writing letters, or the drawing trajectory of graphics from the moment the pen touches the canvas to the moment it is lifted when drawing graphics.

[0034] Based on this, users can submit initial writing data by writing text or drawing graphics on the canvas provided by the writing device. After determining the initial writing data, writing trajectory data can be defined within it. This data includes the text writing trajectory generated when the user writes text, the graphic drawing trajectory generated when the user draws graphics, and deletion trajectory data generated during the process of deleting written trajectory data. Deleting written trajectory data can be done by drawing a closed polygon; the area within the polygon is the deletion or erasure area. Writing trajectories or points within the polygon will be deleted using markers (e.g., "deleted" or "0").

[0035] In practical applications, initial writing data refers to the data generated by users writing text and / or drawing graphics using devices such as smart handwriting devices, learning devices, and electronic whiteboards that include handwriting functionality. Initial writing data can be data generated when users perform writing tasks. Writing tasks can include answering questions, writing articles, and other handwriting tasks. Initial writing data includes data generated by users writing text or drawing graphics, as well as erasing trajectory data generated by erasing already written text or drawn graphics.

[0036] Step 104: Determine the writing point sequence in the writing trajectory data, and extract the target writing point from the writing point sequence according to the writing point extraction strategy.

[0037] Specifically, after determining the initial writing data and the writing trajectory data within it, a sequence of writing points can be determined from the writing trajectory data. Then, a target writing point is extracted from this sequence based on a writing point extraction strategy. The writing trajectory data contains at least one writing trajectory, each consisting of consecutive points representing a stroke—the handwriting produced during the process of writing on the canvas from the moment the pen is put down to the moment it is lifted. The writing point sequence contains multiple subsequences of consecutive points, each representing a stroke. The target writing point is obtained by sampling from the multiple writing points within the writing point sequence. This target writing point represents key features of the writing in the writing trajectory data, including but not limited to key features such as stroke transitions and pauses, ensuring the accuracy of stroke order determination. The writing point extraction strategy is used to extract target writing points representing key writing features from the writing point sequence through sampling.

[0038] Based on this, after determining the initial writing data and the writing trajectory data in the initial writing data, a sequence of writing points representing the writing trajectory and retaining the writing trajectory information is determined in the writing trajectory data. Then, target writing points are extracted from the writing point sequence according to the writing point extraction strategy. The writing point extraction strategy is used to extract target writing points representing key writing features such as turns and pauses in the writing trajectory data from the writing point sequence.

[0039] In practical applications, considering the impact of DPI differences between different devices, the distance threshold used for sampling the target writing point can be dynamically adjusted. The dynamic adjustment is based on the formula: min_distance = base_distance × (device_dpi / reference_dpi). Where: base_distance is the baseline sampling distance (e.g., 5.5 pixels), reference_dpi is the reference DPI value (e.g., 226.0), and device_dpi is the actual DPI value of the current device. This method ensures consistent target writing point sampling results across devices with different resolutions.

[0040] Furthermore, to ensure that the target writing points identified in the writing point sequence accurately represent the key features in the writing trajectory data, target writing points can be extracted from the writing point sequence based on a writing point extraction strategy. The writing point extraction strategy includes a writing point insertion strategy and a writing point sampling strategy, which are implemented as follows: The writing point extraction strategy includes a writing point insertion strategy and a writing point sampling strategy; according to the writing point insertion strategy, connecting writing points are inserted into the writing point sequence to obtain an initial writing point sequence; according to the writing point sampling strategy, writing points are sampled in the initial writing point sequence to obtain the target writing point.

[0041] Specifically, the writing point insertion strategy inserts a connecting writing point between two writing points in the writing point sequence, based on the calculated distance between them. This connecting writing point connects the two writing points, thus performing interpolation between them. The writing point insertion strategy calculates the distance between any two adjacent writing points in the writing point sequence and determines whether to insert a connecting writing point between them based on the calculated distance. The writing point sampling strategy samples writing points in the initial writing point sequence.

[0042] Based on this, the writing point extraction strategy is determined to include a writing point insertion strategy and a writing point sampling strategy. According to the writing point insertion strategy, connecting writing points are inserted between any two adjacent writing points in the writing point sequence that satisfy the distance condition, obtaining an initial writing point sequence. According to the writing point sampling strategy, writing points are sampled from the initial writing point sequence to obtain target writing points representing key features such as turns and pauses in the writing trajectory data.

[0043] For example, after a user generates initial writing data by writing text or drawing graphics using a smart handwriting device, the initial writing data can be stored. Before storing the initial writing data, it is necessary to sample the writing point sequence using a writing point insertion strategy and a writing point adoption strategy to extract target writing points that represent key writing features such as turns and pauses in the writing trajectory from the writing point sequence.

[0044] In summary, by sampling writing points in the initial writing point sequence according to the writing point sampling strategy, target writing points representing key features such as turning points and pauses in the writing trajectory data can be obtained. The target writing points representing key features of writing in the writing point sequence are retained, and the target writing points are stored subsequently. This can reduce the storage space occupied while ensuring that key features are not lost.

[0045] Furthermore, when inserting connecting writing points into the writing point sequence according to the writing point insertion strategy, it can be determined whether a connecting writing point needs to be inserted between two writing points by calculating the distance between the two writing points and judging whether the calculated distance meets the distance condition. The specific implementation is as follows: The preset point spacing is determined according to the writing point insertion strategy, and the target writing point spacing is matched in the writing point sequence according to the preset point spacing; the connecting writing point is inserted at the point corresponding to the target writing point spacing to obtain the initial writing point sequence.

[0046] Specifically, the preset point spacing represents the distance threshold between two writing points. If the distance between two adjacent writing points in the writing point sequence is greater than the preset point spacing, it means that the distance between these two adjacent writing points meets the distance condition. The target writing point spacing is the writing point spacing between two adjacent writing points that meets the distance condition. The number and position of the points corresponding to the target writing point spacing are determined based on the preset point spacing. The preset point spacing represents the maximum distance that needs to be maintained between any two adjacent writing points in the writing point sequence. If the target writing point spacing is greater than the preset point spacing but less than twice the preset point spacing, there is only one point corresponding to the target writing point spacing, and the point position is the middle position of the target writing point spacing. If the target writing point spacing is represented as d and the preset point spacing is represented as T, then the number of points corresponding to the target writing point spacing is n = d / (T-1), indicating that n connecting writing points need to be inserted into the target writing point spacing, and ensuring that the distance between any two adjacent connecting writing points is less than the preset point spacing.

[0047] Based on this, a preset point spacing is determined according to the writing point insertion strategy, and a target writing point spacing is matched in the writing point sequence according to the preset point spacing. At least one target writing point spacing is determined in the writing point sequence by calculating the spacing between any two adjacent writing points. The number of points corresponding to the target writing point spacing is calculated according to the preset point spacing, and connecting writing points are inserted between the two writing points corresponding to the target writing point spacing according to the number of points and the preset point spacing to obtain the initial writing point sequence.

[0048] Continuing with the previous example, the pre-defined spacing for interpolating the writing point sequence can be determined based on the writing point insertion strategy. The writing point insertion strategy is used to generate intermediate points through linear interpolation in the writing point sequence, considering the distance between two adjacent writing points relative to the pre-defined spacing, thus ensuring the continuity of the handwriting. These intermediate points are the continuous writing points. The writing point insertion strategy corresponds to an interpolation algorithm, which can be expressed as follows: For each pair of adjacent points P1(x1,y1,t1,p1,w1) and P2(x2,y2,t2,p2,w2) in the writing trajectory (writing point sequence), calculate the Euclidean distance d (writing point spacing) between the two points. If d > threshold T (pre-defined spacing), then calculate the number of points to be inserted, n = d / (T-1). For each value of j (connecting writing point number) from 1 to n, calculate the interpolation ratio r = j / n to generate interpolation points (connecting writing points) P'(x',y',t',p',w'), where: x' = x1 + r(x2 - x1); y' = y1 + r(y2 - y1); t' = t1 + r(t2 - t1); p' = p1 + r(p2 - p1); w' = w1 + r(w2 - w1). After inserting the connecting writing points into the writing point sequence, the initial writing point sequence is obtained.

[0049] In summary, by inserting connecting writing points at the points corresponding to the target writing point spacing, an initial writing point sequence is obtained. This ensures that the spacing between any two adjacent connecting writing points in the target writing point spacing is less than the preset point spacing, thereby ensuring the continuity between writing points in the writing point sequence.

[0050] Furthermore, when sampling target writing points from the initial writing point sequence according to the writing point sampling strategy, the target writing point group can be determined by calculating the distance between any two adjacent writing points and pressure interpolation. The writing points in the target writing point group are then used as the target writing points obtained from sampling the initial writing point sequence. The specific implementation is as follows: According to the writing point sampling strategy, a distance threshold and a pressure threshold are determined; at least one group of writing points containing two adjacent writing points is determined in the initial writing point sequence, and the distance value and pressure difference between the first writing point and the second writing point in each writing point group are calculated; among the at least one group of writing points containing two adjacent writing points, a target writing point group is selected where the distance value is greater than the distance threshold or the pressure difference is greater than the pressure threshold, and the writing points in the target writing point group are taken as the target writing points.

[0051] Specifically, the distance threshold is used to determine whether any two adjacent writing points in the initial writing point sequence can be used as target writing points based on the distance between them. The pressure threshold is used to determine whether any two adjacent writing points in the initial writing point sequence can be used as target writing points based on the difference in writing pressure between them.

[0052] Based on this, distance and pressure thresholds are determined according to the writing point sampling strategy. At least one group of writing points containing two adjacent writing points is identified in the initial writing point sequence, and the distance and pressure difference between the first and second writing points in each group are calculated. From the at least one group of writing points containing two adjacent writing points, a target writing point group is selected where the distance value is greater than the distance threshold or the pressure difference is greater than the pressure threshold, and the writing points in the target writing point group are designated as target writing points. The target writing point includes the writing start and writing end points from the initial writing point sequence.

[0053] In addition, target writing points can be sampled by traversing the initial writing point sequence. First, the first point (writing start point) in the initial writing point sequence is retained. For each point P_i in the initial writing point sequence (except the first and last points), the nearest retained point P_last is taken, and the Euclidean distance d between the two points is calculated. The pressure difference Δp = |p_i - p_last| is calculated. If d ≥ distance threshold D or Δp ​​≥ pressure threshold P, the point is retained. Finally, the last point of the trajectory is retained. The distance preset can be set to 6, and the pressure threshold can be set to 300. It should be noted that both the distance threshold and the pressure threshold can be set according to actual needs.

[0054] Following the previous example, after obtaining the initial writing point sequence by interpolation, writing point resampling can be performed on the initial writing point sequence. Writing points in the initial writing point sequence can be grouped according to their proximity, resulting in multiple writing point groups. For each writing point group, the distance and pressure difference between the two writing points (the first and second writing points) are calculated. If the distance is greater than a distance threshold or the pressure difference is greater than a pressure threshold, the writing point group is designated as the target writing point group, and the two writing points in the target writing point group are designated as the target writing points.

[0055] In summary, from at least one group of writing points containing two adjacent writing points, a target writing point group is selected where the distance value is greater than a distance threshold or the pressure difference value is greater than a pressure threshold, and the writing points in the target writing point group are used as target writing points to ensure that the sampled target writing points can represent the key writing features of the writing trajectory data.

[0056] Furthermore, considering that writing errors are inevitable during the writing process, the writing trajectory data also includes erasure trajectories to ensure the integrity of the writing trajectory data. To facilitate subsequent analysis of the writing trajectory data and the judgment of the correctness of the stroke order, it is necessary to traverse the target writing points based on the erasure trajectories and add erasure markers to the erased writing points. The specific implementation is as follows: An erasure trajectory is determined from the writing trajectory data, and an erasure region corresponding to the erasure trajectory is constructed; the target writing point is traversed based on the erasure region, and an erasure writing point associated with the erasure region is determined from the target writing point; an erasure marker is added to the erasure writing point.

[0057] Specifically, the erase trajectory visually appears as a closed polygon with a trajectory drawing direction. The erased area is the closed polygonal region determined based on the erase trajectory. The erased writing point associated with the erased area is the writing point located within the content of the erased area. Erasure markers are added to the erased writing points, such as adding a marker indicating that the writing point has been erased, like "erased".

[0058] Based on this, erasure trajectories are determined from the writing trajectory data, and polygonal erasure regions corresponding to these trajectories are constructed. By traversing the target writing points based on these erasure regions, erased writing points associated with the erasure regions are identified. These erased writing points are those whose positions are located within the erasure regions. Erasure markers are added to these erased writing points, marking them as deleted. Therefore, these erased writing points are not analyzed during subsequent stroke order analysis of the writing trajectory data.

[0059] Continuing with the previous example, during the user's writing process, for incorrectly written content, the writing trajectory and writing points within the erased area corresponding to the writing trajectory can be marked as deleted by writing an eraser path. The eraser path is also retained in the writing trajectory data. The eraser path can be determined based on the trajectory identifier (erasure identifier) ​​of the writing trajectory. Based on the writing stroke order of the eraser path, the erased area with the writing direction polygon can be determined. By traversing the determined target writing points, it is determined whether each target writing point is within the erased area. Target writing points within the erased area are designated as erased writing points and marked "deleted". For example... Figure 2As shown, the area circled in counter-clockwise order A→B→C→D→A is the erasure area. The target writing point N within the erasure area is the erasure writing point, and a "deleted" label needs to be added to the target writing point N.

[0060] In summary, by traversing the target writing points based on the erasure region, erasure writing points associated with the erasure region are identified among the target writing points. These erasure writing points are those whose positions are located within the erasure region. Adding erasure markers to these writing points facilitates subsequent analysis of the writing trajectory data and the evaluation of the correctness of the stroke order.

[0061] Furthermore, considering that there can be at least two target writing points, when determining the erasure writing point among at least two target writing points, the position can be determined by using the writing point ray corresponding to the writing point to be processed and the directed ring graph corresponding to the erasure trajectory. This determines whether the writing point to be processed among the target writing points is the target erasure writing point. The specific implementation is as follows: Determine the writing point to be processed among the at least two target writing points; construct the writing point ray corresponding to the writing point to be processed, and construct a directed ring graph corresponding to the erasure region based on the erasure trajectory; if the target edge in the directed ring graph passes upward through the writing point ray, the writing point to be processed is taken as the target erasure writing point.

[0062] Specifically, the writing point to be processed is the writing point to be erased among at least two target writing points. The writing point ray can be a ray drawn with the writing point to be processed as the starting point (origin) and the horizontal axis of the Cartesian coordinate system in which the writing point to be processed is located as the direction. The directed torus corresponding to the erasure region is a directed polygon torus drawn in the Cartesian coordinate system in which the writing point to be processed is located. The target edge in the directed torus is at least one edge that intersects with the writing point ray.

[0063] Based on this, the writing point to be processed is determined from at least two target writing points; a writing point ray corresponding to the writing point to be processed is constructed in a Cartesian coordinate system, and a directed torus graph corresponding to the erasure region is constructed in the Cartesian coordinate system based on the erasure trajectory. In the directed torus graph, a target edge intersecting with the writing point ray is selected. If there is only one target edge and the target edge passes upward through the writing point ray, the writing point to be processed is taken as the target erasure writing point.

[0064] Continuing with the previous example, such as Figure 2As shown, target writing point N and target writing point M are both writing points to be processed. The X-axis (horizontal axis) of the Cartesian coordinate system points to the right, and the Y-axis (vertical axis) points downwards (consistent with the screen coordinate system), with the axes marking the coordinate directions. Point N is located inside the polygon, representing the writing point to be erased. When a target edge crosses the writing point ray upwards, it indicates that the starting point of the target edge is below or at the same horizontal level as the writing point ray, and the ending point is above the writing point ray. When a target edge crosses the writing point ray upwards, the writing point to be processed corresponding to the writing point ray is the writing point to be erased.

[0065] The range erasure marking process can be described as follows: Traverse all trajectories and identify trajectories with the pen type "range erasure". For each range erasure trajectory E, its point set forms a closed polygon. Traverse all handwritten trajectories T preceding this erasure trajectory. For each point P in each handwritten trajectory: if point P has not yet been marked as erased, use the non-zero wrapping number algorithm to determine whether P is inside the erasure polygon; if it is inside the polygon, then mark P as erased. The non-zero wrapping number algorithm can be described as follows: For the point to be detected (the writing point to be processed) P(x,y) and the polygon vertex sequence V={V_1,V_2,...,V_...} n}, initialize the wrapping number W=0 (erase writing points). For each edge of the polygon (from V_i to V_(i+1)), where i represents the i-th vertex in the polygon vertex sequence, i is less than or equal to n, and n represents the number of vertices in the polygon vertex sequence: if V_i.y≤Py and V_(i+1).y>Py (edge ​​passes upward through the horizontal ray), if (V_(i+1).x-V_i.x)(Py-V_i.y)-(Px-V_i.x)(V_(i+1).y-V_i.y)>0, W=W+1; if V_i.y>Py and V_(i+1).y≤Py (edge ​​passes downward through the horizontal ray), if (V_(i+1).x-V_i.x)(Py-V_i.y)-(Px-V_i.x)(V_(i+1).y-V_i.y)<0, W=W-1; if W≠0, then point P is inside the polygon; otherwise, it is outside.

[0066] In summary, when the target edge in the directed ring graph passes upward through the writing point ray, the writing point to be processed is taken as the target erasure writing point, and the target erasure writing point can be accurately found among at least two target writing points.

[0067] Step 106: Compress the writing trajectory data and the target writing point based on a preset storage format to obtain the target writing data corresponding to the initial writing data, and store the target writing data.

[0068] Specifically, after determining the writing point sequence in the writing trajectory data and extracting the target writing point from the writing point sequence according to the writing point extraction strategy, the writing trajectory data and the target writing point can be compressed based on a preset storage format to obtain the target writing data corresponding to the initial writing data. The target writing data is then stored. The writing trajectory data can be a three-layer nested data structure: points, trajectories, and handwriting data. Point: The basic unit, containing the following attributes: x, y: coordinate position, timestamp: timestamp, pressure: pressure value, penWidth: pen width, is_erased: eraser marker (used by the range erasure algorithm). Track: Composed of continuous points, representing a stroke, containing: penType: pen type (stylus, eraser, etc.), pointList: point list. HandwritingData: Complete handwriting data, containing: width, height: canvas size, trackList: track list, version: version number, note: additional information. The preset storage format can be a data compression format set for the writing trajectory data and the target writing point. The target writing data is the data obtained by compressing the writing trajectory data and the data corresponding to the target writing point.

[0069] Based on this, after determining the writing point sequence in the writing trajectory data and extracting the target writing point from the writing point sequence according to the writing point extraction strategy, the writing trajectory data and the target writing point are compressed according to the preset storage format to obtain the target writing data corresponding to the initial writing data. The target writing data is then stored, thereby realizing the compressed storage of the writing trajectory data and the data corresponding to the target writing point, improving data storage efficiency, and reducing the storage space occupied by data storage.

[0070] Furthermore, considering that directly storing the writing trajectory data and target writing points would occupy a large amount of storage space and have low storage efficiency and concurrency, data compression is required before storing the writing trajectory data and target writing points. The specific implementation is as follows: The header file format and trajectory data format included in the preset storage format are determined; the file fields included in the header file format are filled based on the writing trajectory data to obtain header file data; the trajectory fields included in the trajectory data format are filled based on the writing point attribute data corresponding to the target writing point to obtain trajectory compressed data; the header file data and the trajectory compressed data are used as the target writing data corresponding to the initial writing data.

[0071] Specifically, the header file format is a compressed storage format of the file header in binary storage format. The trajectory data format is a compressed storage format of trajectory data in binary storage format. The file fields included in the header file format include, but are not limited to, file identifier, canvas width, binary compression version number, number of writing trajectories, annotation length, and annotation content. The writing point attribute data represents the coordinates of the target writing point, writing pressure, and other handwriting attributes or writing properties. The trajectory field is used to store writing attribute data in a field-based manner.

[0072] Based on this, the header file format and trajectory data format included in the preset storage format are determined. The header file data is obtained by filling in the file fields including file identifier, canvas width, binary compression version number, number of writing trajectories, annotation length, and annotation content based on the writing trajectory data. The trajectory fields in the trajectory data format are then filled in based on the writing point attribute data corresponding to the target writing point to obtain the compressed trajectory data. The header file data and the compressed trajectory data are used as the target writing data corresponding to the initial writing data, achieving data compression of the writing trajectory data and the target writing point through binary encoding.

[0073] Following the previous example, the structure of the binary storage format (MHWT) includes a file header and trajectory data. The file header corresponds to the header file format, and the trajectory data corresponds to the trajectory data format. The file header (64 bytes) contains fields such as file identifier, canvas width, binary compression version number, number of writing trajectories, annotation length, and annotation content. The header file data is obtained by filling in the fields of file identifier, canvas width, binary compression version number, number of writing trajectories, annotation length, and annotation content based on the writing trajectory data. Specifically, the file identifier (32 bytes), canvas width (2 bytes), height (2 bytes), version number (2 bytes), number of trajectories (2 bytes), annotation length (1 byte), and annotation content (maximum 20 bytes) are all present. The compressed trajectory data is obtained by compressing and storing the writing point attribute data of the target writing point according to the trajectory data format, segmented by trajectory field.

[0074] In summary, by using header file data and trajectory compressed data as the target writing data corresponding to the initial writing data, the writing trajectory data and target writing points are compressed and stored in binary storage format, reducing storage and bandwidth costs, improving data storage and transmission efficiency, and supporting a higher number of concurrent users.

[0075] Furthermore, considering that the target writing point is represented in coordinate form, storing the target writing point can be represented as storing the writing attribute data corresponding to the target writing point, as specifically implemented as follows: The trajectory data format includes a trajectory header field, a coordinate field, a time field, and a handwriting field. Based on the writing point attribute data corresponding to the target writing point, the trajectory header field, the coordinate field, the time field, and / or the handwriting field are filled to obtain the trajectory compressed data.

[0076] Specifically, the trajectory header field is used to store data such as the writing pen type, start timestamp, number of points, and reserved space corresponding to the target writing point; the coordinate field is used to store the coordinate data of the target writing point; the time field is used to store the timestamp difference between the target writing point and the previous target writing point to be stored; and the handwriting field is used to store the writing pressure value and pen width value of the target writing point.

[0077] Based on this, the trajectory header field, coordinate field, time field, and handwriting field are determined in the trajectory fields included in the trajectory data format. The trajectory header field, coordinate field, time field, and / or handwriting field are filled with data such as the coordinate data, timestamp difference, pressure value, and pen width value (handwriting width, in pixels) corresponding to the target writing point in the writing point attribute data to obtain compressed trajectory data. For the coordinate data, the original coordinates are mapped to a 16-bit integer range (0-32767) to ensure accuracy while reducing storage space. The normalization formula is: x = 32767 × x / width, y = 32767 × y / height. The timestamp difference is: for the first writing point among the target writing points, the normalized absolute coordinates are stored; for subsequent writing points, the difference between the normalized and previous writing points is stored; only the difference between adjacent target writing points is stored, not the absolute value. Coordinate data is grouped and stored, with similar data stored contiguously to improve compression efficiency. Specifically, all x-coordinate differences are stored contiguously, followed by all y-coordinate differences, then timestamp differences, pressure values, and pen width values, which are then grouped and stored separately. The trajectory compressed data is stored as a .mhwt file using gzip compression.

[0078] Following the previous example, the structure of the binary storage format (MHWT) includes a file header and trajectory data. The file header corresponds to the header file format, and the trajectory data corresponds to the trajectory data format. The trajectory data format includes multiple fields such as trajectory header field, coordinate field, time field, and handwriting field. By compressing and storing the trajectory header, coordinate data, timestamp difference, pressure value, and pen width value of the target writing point according to the trajectory fields corresponding to the trajectory data format, the trajectory compressed data can be obtained. The writing trajectory data of each writing trajectory includes: trajectory header, coordinate data, timestamp difference, pressure value, and pen width value. Trajectory header: pen type (1 byte), start timestamp (4 bytes), number of points (2 bytes), reserved space (4 bytes); coordinate data: using difference encoding, only storing the difference between adjacent points, x-coordinate difference (2-byte signed integer), y-coordinate difference (2-byte signed integer); timestamp difference (2-byte unsigned integer); pressure value (2-byte unsigned integer); pen width value (1-byte unsigned integer, actual value × 10).

[0079] In summary, trajectory compressed data is obtained by filling the trajectory header field, coordinate field, time field, and / or handwriting field with the writing point attribute data corresponding to the target writing point. The trajectory compressed data is stored in a binary storage format, reducing storage and bandwidth costs and improving data storage and transmission efficiency.

[0080] This specification provides a data processing method according to one embodiment, which determines initial writing data and writing trajectory data within the initial writing data, thus clarifying the writing trajectory data of the written text content in the initial writing data. A sequence of writing points is determined from the writing trajectory data, and target writing points are extracted from the writing point sequence according to a writing point extraction strategy. The writing trajectory data and target writing points are compressed based on a preset storage format to obtain target writing data corresponding to the initial writing data, and then the target writing data is stored. For the initial writing data, the writing trajectory data contained in the initial writing data is first determined, and target writing points obtained through intelligent sampling are determined based on the writing trajectory. The writing trajectory data and target writing points are compressed before storage. This achieves data compression and storage, improving data storage efficiency while ensuring the integrity of key feature information in the initial writing data.

[0081] The following is in conjunction with the appendix Figure 3 Taking the application of the data processing method provided in this specification in the storage of writing trajectory data as an example, the data processing method will be further explained. Among other things, Figure 3 A flowchart illustrating the processing procedure of a data processing method according to an embodiment of this specification is shown, specifically including the following steps.

[0082] Step 302: Determine the initial writing data, and then determine the writing trajectory data within the initial writing data.

[0083] With the deepening development of digital education, handwriting recognition and electronic note-taking technologies are being applied more and more widely in educational settings. In the specific field of Chinese character teaching, the standardization of stroke order directly affects students' writing quality and learning outcomes; therefore, accurately recording and analyzing students' writing process has become an important requirement. Initial writing data refers to the writing data generated by users through smart handwriting devices. Writing trajectory data refers to the handwriting strokes, which are the strokes produced from the moment the pen is put down to the moment it is lifted.

[0084] Step 304: Determine the writing point sequence in the writing trajectory data, and determine the writing point insertion strategy and writing point sampling strategy included in the writing point extraction strategy.

[0085] A writing trajectory consists of multiple writing points in a specific order; one writing trajectory corresponds to one sequence of writing points. Writing point extraction strategies include writing point insertion strategies and writing point sampling strategies.

[0086] Step 306: Insert connecting writing points into the writing point sequence according to the writing point insertion strategy to obtain the initial writing point sequence.

[0087] The writing point insertion strategy is used to calculate the number of writing points to be inserted in a writing point sequence based on the distance between two adjacent writing points, and then insert the writing points.

[0088] Step 308: Perform writing point sampling in the initial writing point sequence according to the writing point sampling strategy to obtain the target writing point.

[0089] The writing point sampling strategy is used to resample the initial writing point sequence obtained through writing point interpolation. The sampled points represent key features such as turns and pauses in the writing trajectory, i.e., the target writing points. Writing point sampling is implemented based on a dual threshold consisting of a distance threshold and a pressure threshold.

[0090] Step 310: Determine the erasure trajectory from the writing trajectory data and construct the erasure area corresponding to the erasure trajectory.

[0091] Considering that users may make writing errors during the writing process and use the eraser tool (eraser pen) to erase writing points / trajectories by drawing eraser paths, the writing trajectory will include the eraser path. The eraser path forms a closed eraser area, which is represented by a closed polygon. Writing points / trajectories within the polygon need to be marked as erased and will not participate in subsequent stroke order analysis.

[0092] Step 312: Traverse the target writing points based on the erasure region, identify the erasure writing points associated with the erasure region among the target writing points, and add an erasure marker to the erasure writing points.

[0093] The purpose of traversing the target writing point is to determine whether the target writing point is within the erasure area. If it is within the erasure area, an erasure mark is made. The erasure mark processing can be described as follows: Traverse all writing trajectories and identify trajectories with the pen type "range erasure". For each range erasure trajectory, its point set forms a closed polygon (erasure area). Traverse all handwritten trajectories before this erasure trajectory. For each point P in each handwritten trajectory: if point P has not yet been marked as erased, use the non-zero wrapping number algorithm to determine whether P is inside the erasure polygon; if it is inside the polygon, add an erasure mark to P and mark P as erased.

[0094] Step 314: Determine the header file format and trajectory data format included in the preset storage format, and fill in the file fields included in the header file format based on the written trajectory data to obtain the header file data.

[0095] The header file format includes file fields including, but not limited to, file identifier, canvas width, version number, number of tracks, annotation length, and annotation content.

[0096] Step 316: Fill the trajectory fields contained in the trajectory data format based on the writing point attribute data corresponding to the target writing point and the writing point attribute data corresponding to the erased writing point to obtain trajectory compressed data.

[0097] The trajectory data format includes trajectory fields including, but not limited to, trajectory header, coordinate data, timestamp difference, pressure value, and pen width value.

[0098] Step 318: Use the header file data and trajectory compressed data as the target writing data corresponding to the initial writing data, and store the target writing data.

[0099] Furthermore, considering the impact of DPI differences across different devices, the distance threshold used for sampling the target writing point can be dynamically adjusted. The dynamic adjustment is based on the formula: min_distance = base_distance × (device_dpi / reference_dpi). Where: base_distance is the baseline sampling distance (e.g., 5.5 pixels), reference_dpi is the reference DPI value (e.g., 226.0), and device_dpi is the actual DPI value of the current device. This method ensures consistent target writing point sampling across devices with different resolutions.

[0100] In summary, the data processing method provided in this embodiment, through intelligent sampling and a dedicated binary storage format, compresses the initial writing data in the original JSON format (2.4MB) to the final compressed binary format (67KB), achieving a compression rate of 97.2%, which greatly improves storage and transmission efficiency and supports a higher number of concurrent users. The sampling algorithm based on dual thresholds of distance and pressure effectively preserves key features of handwriting, such as turns and pauses, while reducing the amount of data, ensuring the accuracy of stroke order judgment. The range erasure algorithm, implemented using a non-zero wrapping number rule, accurately determines the spatial relationship between the target writing point and the erasure area, ensuring the precision and reliability of the erasure operation and providing accurate data support for subsequent stroke order correction and analysis. By considering the sampling distance adjustment mechanism based on device DPI differences, consistent sampling results are ensured across different devices, improving the system's versatility.

[0101] Corresponding to the above method embodiments, this specification also provides data processing apparatus embodiments. Figure 4 A schematic diagram of the structure of a data processing apparatus according to one embodiment of this specification is shown. Figure 4 As shown, the device includes: The determining module 402 is configured to determine initial writing data and determine writing trajectory data in the initial writing data; The extraction module 404 is configured to determine a sequence of writing points in the writing trajectory data and extract a target writing point from the sequence of writing points according to a writing point extraction strategy. The storage module 406 is configured to compress the writing trajectory data and the target writing point based on a preset storage format to obtain the target writing data corresponding to the initial writing data, and to store the target writing data.

[0102] In an optional embodiment, the extraction module 404 is further configured to: The writing point extraction strategy includes the writing point insertion strategy and the writing point sampling strategy. According to the writing point insertion strategy, connecting writing points are inserted into the writing point sequence to obtain an initial writing point sequence; According to the writing point sampling strategy, writing point sampling is performed in the initial writing point sequence to obtain the target writing point.

[0103] In an optional embodiment, the extraction module 404 is further configured to: The preset point spacing is determined according to the writing point insertion strategy, and the target writing point spacing is matched in the writing point sequence according to the preset point spacing; Insert the connecting writing point at the point corresponding to the target writing point spacing to obtain the initial writing point sequence.

[0104] In an optional embodiment, the extraction module 404 is further configured to: The distance threshold and pressure threshold are determined based on the writing point sampling strategy. In the initial writing point sequence, at least one group of writing points containing two adjacent writing points is determined, and the distance and pressure difference between the first and second writing points in each writing point group are calculated. In the at least one group of writing points containing two adjacent writing points, select a target writing point group whose distance value is greater than a distance threshold or whose pressure difference value is greater than a pressure threshold, and use the writing points in the target writing point group as the target writing points.

[0105] In an optional embodiment, the storage module 406 is further configured to: Determine the header file format and trajectory data format included in the preset storage format; Based on the writing trajectory data, the file fields contained in the header file format are filled to obtain the header file data; Based on the writing point attribute data corresponding to the target writing point, the trajectory fields contained in the trajectory data format are filled to obtain trajectory compressed data; The header file data and the trajectory compression data are used as the target writing data corresponding to the initial writing data.

[0106] In an optional embodiment, the storage module 406 is further configured to: The trajectory header field, coordinate field, time field, and handwriting field are determined from the trajectory fields included in the trajectory data format; The trajectory compressed data is obtained by filling the trajectory header field, the coordinate field, the time field and / or the handwriting field with the writing point attribute data corresponding to the target writing point.

[0107] In an optional embodiment, the extraction module 404 is further configured to: The erasure trajectory is determined from the writing trajectory data, and the erasure area corresponding to the erasure trajectory is constructed; By traversing the target writing points based on the erasure region, an erasure writing point associated with the erasure region is determined among the target writing points; Add an erasure marker to the erased writing point.

[0108] In an optional embodiment, the extraction module 404 is further configured to: Determine the writing point to be processed from the at least two target writing points; Construct the writing point ray corresponding to the writing point to be processed, and construct the directed ring graph corresponding to the erasure area based on the erasure trajectory; When the target edge in the directed ring graph crosses the writing point ray upwards, the writing point to be processed is taken as the target erasure writing point.

[0109] This specification provides a data processing method according to one embodiment, which determines initial writing data and writing trajectory data within the initial writing data, thus clarifying the writing trajectory data of the written text content in the initial writing data. A sequence of writing points is determined from the writing trajectory data, and target writing points are extracted from the writing point sequence according to a writing point extraction strategy. The writing trajectory data and target writing points are compressed based on a preset storage format to obtain target writing data corresponding to the initial writing data, and then the target writing data is stored. For the initial writing data, the writing trajectory data contained in the initial writing data is first determined, and target writing points obtained through intelligent sampling are determined based on the writing trajectory. The writing trajectory data and target writing points are compressed before storage. This achieves data compression and storage, improving data storage efficiency while ensuring the integrity of key feature information in the initial writing data.

[0110] The above is an illustrative scheme of a data processing apparatus according to this embodiment. It should be noted that the technical solution of this data processing apparatus and the technical solution of the data processing method described above belong to the same concept. For details not described in detail in the technical solution of the data processing apparatus, please refer to the description of the technical solution of the data processing method described above.

[0111] Figure 5 A structural block diagram of a computing device 500 according to one embodiment of this specification is shown. The components of the computing device 500 include, but are not limited to, a memory 510 and a processor 520. The processor 520 is connected to the memory 510 via a bus 530, and a database 550 is used to store data.

[0112] The computing device 500 also includes an access device 540, which enables the computing device 500 to communicate via one or more networks 560. Examples of these networks include Public Switched Telephone Network (PSTN), Local Area Network (LAN), Wide Area Network (WAN), Personal Area Network (PAN), or combinations of communication networks such as the Internet. The access device 540 may include one or more of any type of wired or wireless network interface (e.g., a network interface card (NIC)), such as an IEEE 802.11 Wireless Local Area Network (WLAN) wireless interface, a Wi-MAX (Worldwide Interoperability for Microwave Access) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, or a Near Field Communication (NFC) interface.

[0113] In one embodiment of this specification, the above-described components of the computing device 500 and Figure 5 Other components, not shown, can also be connected to each other, for example, via a bus. It should be understood that... Figure 5 The block diagram of the computing device shown is for illustrative purposes only and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.

[0114] The computing device 500 can be any type of stationary or mobile computing device, including mobile computers or mobile computing devices (e.g., tablet computers, personal digital assistants, laptop computers, notebook computers, netbooks, etc.), mobile phones (e.g., smartphones), wearable computing devices (e.g., smartwatches, smart glasses, etc.) or other types of mobile devices, or stationary computing devices such as desktop computers or personal computers (PCs). The computing device 500 can also be a mobile or stationary server.

[0115] The processor 520 is configured to execute the following computer-executable instructions, which, when executed by the processor, implement the steps of the above-described data processing method.

[0116] The above is an illustrative scheme of a computing device according to this embodiment. It should be noted that the technical solution of this computing device and the technical solution of the data processing method described above belong to the same concept. For details not described in detail in the technical solution of the computing device, please refer to the description of the technical solution of the data processing method described above.

[0117] An embodiment of this specification also provides a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the steps of the above-described data processing method.

[0118] The above is an illustrative scheme of a computer-readable storage medium according to this embodiment. It should be noted that the technical solution of this storage medium and the technical solution of the data processing method described above belong to the same concept. For details not described in detail in the technical solution of the storage medium, please refer to the description of the technical solution of the data processing method described above.

[0119] An embodiment of this specification also provides a computer program product, including a computer program or instructions that, when executed by a processor, implement the steps of the above-described data processing method.

[0120] The above is an illustrative scheme of a computer program product according to this embodiment. It should be noted that the technical solution of this computer program product and the technical solution of the data processing method described above belong to the same concept. For details not described in detail in the technical solution of the computer program product, please refer to the description of the technical solution of the data processing method described above.

[0121] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.

[0122] The computer instructions include computer program code, which may be in the form of source code, object code, executable file, or certain intermediate forms. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium may be appropriately added or removed according to the requirements of patent practice. For example, in some regions, according to patent practice, computer-readable media may not include electrical carrier signals and telecommunication signals.

[0123] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments in this specification are not limited to the described order of actions, because according to the embodiments in this specification, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the embodiments in this specification.

[0124] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0125] The preferred embodiments disclosed above are merely illustrative of this specification. The optional embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the embodiments described herein. These embodiments are selected and specifically described in this specification to better explain the principles and practical applications of the embodiments, thereby enabling those skilled in the art to better understand and utilize this specification. This specification is limited only by the claims and their full scope and equivalents.

Claims

1. A data processing method, characterized in that, include: Determine initial writing data, and then determine writing trajectory data from the initial writing data; A sequence of writing points is determined in the writing trajectory data, and a target writing point is extracted from the writing point sequence according to a writing point extraction strategy. The writing point extraction strategy includes a writing point insertion strategy and a writing point sampling strategy. The target writing point is used to represent the turning point and / or pause of the handwriting in the writing trajectory data. The writing point insertion strategy refers to the strategy of obtaining an initial writing point sequence by inserting connecting writing points into the writing point sequence. The writing point sampling strategy refers to the strategy of determining the target writing point based on the distance value and pressure difference value between writing points in the initial writing point sequence. The writing trajectory data and the target writing point are compressed based on a preset storage format to obtain the target writing data corresponding to the initial writing data, and the target writing data is stored.

2. The data processing method according to claim 1, characterized in that, Extracting the target writing point from the writing point sequence according to the writing point extraction strategy includes: According to the writing point insertion strategy, connecting writing points are inserted into the writing point sequence to obtain an initial writing point sequence; According to the writing point sampling strategy, writing point sampling is performed in the initial writing point sequence to obtain the target writing point.

3. The data processing method according to claim 2, characterized in that, The step of inserting connecting writing points into the writing point sequence according to the writing point insertion strategy to obtain an initial writing point sequence includes: The preset point spacing is determined according to the writing point insertion strategy, and the target writing point spacing is matched in the writing point sequence according to the preset point spacing; Insert the connecting writing point at the point corresponding to the target writing point spacing to obtain the initial writing point sequence.

4. The data processing method according to claim 2, characterized in that, The step of sampling writing points in the initial writing point sequence according to the writing point sampling strategy to obtain the target writing point includes: The distance threshold and pressure threshold are determined based on the writing point sampling strategy. In the initial writing point sequence, at least one group of writing points containing two adjacent writing points is determined, and the distance and pressure difference between the first and second writing points in each writing point group are calculated. In the at least one group of writing points containing two adjacent writing points, select a target writing point group whose distance value is greater than a distance threshold or whose pressure difference value is greater than a pressure threshold, and use the writing points in the target writing point group as the target writing points.

5. The data processing method according to claim 1, characterized in that, The step of compressing the writing trajectory data and the target writing point based on a preset storage format to obtain the target writing data corresponding to the initial writing data includes: Determine the header file format and trajectory data format included in the preset storage format; Based on the writing trajectory data, the file fields contained in the header file format are filled to obtain the header file data; Based on the writing point attribute data corresponding to the target writing point, the trajectory fields contained in the trajectory data format are filled to obtain trajectory compressed data; The header file data and the trajectory compression data are used as the target writing data corresponding to the initial writing data.

6. The data processing method according to claim 5, characterized in that, The step of filling the trajectory fields contained in the trajectory data format with the writing point attribute data corresponding to the target writing point to obtain trajectory compressed data includes: The trajectory header field, coordinate field, time field, and handwriting field are determined from the trajectory fields included in the trajectory data format; The trajectory compressed data is obtained by filling the trajectory header field, the coordinate field, the time field and / or the handwriting field with the writing point attribute data corresponding to the target writing point.

7. The data processing method according to claim 1, characterized in that, After extracting the target writing point from the writing point sequence according to the writing point extraction strategy, the method further includes: The erasure trajectory is determined from the writing trajectory data, and the erasure area corresponding to the erasure trajectory is constructed; By traversing the target writing points based on the erasure region, an erasure writing point associated with the erasure region is determined among the target writing points; Add an erasure marker to the erased writing point.

8. The data processing method according to claim 7, characterized in that, When there are at least two target writing points, determining any one of the target writing points to be erased includes: Determine the writing point to be processed from the at least two target writing points; Construct the writing point ray corresponding to the writing point to be processed, and construct the directed ring graph corresponding to the erasure area based on the erasure trajectory; When the target edge in the directed ring graph crosses the writing point ray upwards, the writing point to be processed is taken as the target erasure writing point.

9. A data processing apparatus, characterized in that, include: The determination module is configured to determine initial writing data and, within the initial writing data, determine writing trajectory data; The extraction module is configured to determine a sequence of writing points in the writing trajectory data and extract a target writing point from the sequence of writing points according to a writing point extraction strategy. The writing point extraction strategy includes a writing point insertion strategy and a writing point sampling strategy. The target writing point is used to represent the turning point and / or pause in the handwriting in the writing trajectory data. The writing point insertion strategy refers to the strategy of obtaining an initial writing point sequence by inserting connecting writing points into the writing point sequence. The writing point sampling strategy refers to the strategy of determining the target writing point based on the distance value and pressure difference value between writing points in the initial writing point sequence. The storage module is configured to compress the writing trajectory data and the target writing point based on a preset storage format to obtain the target writing data corresponding to the initial writing data, and to store the target writing data.

10. A computing device, characterized in that, include: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions, which, when executed by the processor, implement the steps of the data processing method according to any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that, It stores computer-executable instructions that, when executed by a processor, implement the steps of the data processing method according to any one of claims 1 to 8.

12. A computer program product, characterized in that, It includes a computer program or instructions that, when executed by a processor, implement the steps of the data processing method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Method and apparatus for compression and reconstruction of electronic handwriting

    WO2003056503A1