A handwriting drawing method and device, computer equipment and storage medium

By using a line element drawing method with shared boundaries, the problem of line element cracking in whiteboard drawing tools in online classrooms was solved, resulting in improved stroke fluency and computational efficiency.

CN115880394BActive Publication Date: 2026-11-20DOUYIN VISION CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202111162677.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-30
Publication Date
2026-11-20
Estimated Expiration
2041-09-30

AI Technical Summary

Technical Problem

In existing technologies, when whiteboard drawing tools are used to draw strokes in online classrooms, cracks easily occur between line elements, resulting in gaps in the strokes, which also increases the amount of computation and the CPU load.

Method used

By receiving location point information, the line element information corresponding to each location point is determined, and the line elements between two adjacent location points share the same boundary to avoid cracks between line elements. A line element drawing method with shared boundaries is adopted.

Benefits of technology

Without increasing the number of line elements, it avoids the phenomenon of cracking between line elements, ensures the smoothness of the handwriting, reduces the amount of calculation, and reduces the CPU load.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115880394B_ABST
    Figure CN115880394B_ABST
Patent Text Reader

Abstract

The present disclosure provides a handwriting drawing method and device, computer equipment and a storage medium, wherein the method comprises: receiving position point information sent by a first user terminal; determining line element information corresponding to each position point based on the position point information, wherein the line element information is used to represent boundary information of a line element between the position point and two adjacent position points; the boundary information of the line element between any position point and two adjacent position points is the same; determining the line element between each two adjacent position points based on the line element information, and performing handwriting drawing based on the determined line element.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and more specifically, to a method, apparatus, computer device, and storage medium for drawing handwriting. Background Technology

[0002] In online classrooms, the whiteboard drawing tool is a commonly used teaching tool. The teacher uses the mouse to control the movement of the whiteboard drawing tool, creating strokes of varying thickness. The student's end receives the position information of the strokes and reconstructs the teacher's handwriting.

[0003] In related technologies, trapezoidal line elements are placed between every two position points, and the handwriting at the teacher's end is restored by superimposing these trapezoidal line elements. However, the line elements drawn in this way have cracks between them, which can cause gaps in the handwriting. If the spacing between line elements is reduced to prevent cracking and more line elements are added, the computational load will increase significantly, thereby increasing the CPU burden. Summary of the Invention

[0004] This disclosure provides at least one method, apparatus, computer device, and storage medium for drawing handwriting.

[0005] In a first aspect, embodiments of this disclosure provide a method for drawing handwriting, including:

[0006] Receive location information sent by the first user terminal;

[0007] Based on the location point information, the line element information corresponding to each location point is determined, wherein the line element information is used to represent the boundary information of the line elements between the location point and the two adjacent location points; the boundary information of the line elements between any location point and the two adjacent location points is the same;

[0008] Based on the line element information, the line elements between each pair of adjacent position points are determined, and the handwriting is drawn based on the determined line elements.

[0009] In one possible implementation, the line element information includes the position information of the line element endpoints, the line element endpoints including the upper endpoint and the lower endpoint of the line element; the position point information includes the width information of the line element to which the position point is located;

[0010] The step of determining the line element information corresponding to each position point based on the position point information includes:

[0011] For any given location point, based on the location point information, determine the direction vector corresponding to that location point, wherein the direction vector is used to characterize the drawing direction of the line element to which the location point is located;

[0012] Based on the direction vector and the width information included in the location point information, the position information of the upper endpoint and lower endpoint of the line element corresponding to the location point is determined.

[0013] In one possible implementation, determining the line element between every two adjacent location points based on the line element information includes:

[0014] For any two adjacent position points, connect the upper endpoints of the line elements corresponding to the two position points respectively, connect the lower endpoints of the line elements corresponding to the two position points respectively, and connect the upper endpoints and lower endpoints of the line elements corresponding to the same position point to form a line element between the two adjacent position points.

[0015] In one possible implementation, the location point information further includes the timestamp when the first user terminal drew the location point, and the location information corresponding to the location point;

[0016] The step of determining the direction vector corresponding to any given location point based on its location information includes:

[0017] Based on the timestamp included in the location point information, determine the next location point corresponding to the current location point;

[0018] Starting from the current location point and ending at the next location point, a first vector is determined between the current location point and the next location point, and this first vector is used as the direction vector corresponding to the current location point.

[0019] In one possible implementation, determining the direction vector corresponding to any given location point based on its location information includes:

[0020] Based on the timestamp included in the location point information, determine the next and previous location points corresponding to the location point;

[0021] Taking the previous position point as the starting point and the next position point as the ending point, determine the second vector between the previous position point and the next position point;

[0022] Based on the second vector, the direction vector corresponding to the position point is determined, wherein the direction vector has the same direction as the second vector; the direction vector corresponding to the first position point is a vector formed with the first position point as the starting point and the second position point as the ending point, and the direction vector of the last position point has the same direction as the direction vector of the second to last position point.

[0023] In one possible implementation, after determining the line elements between every two adjacent location points based on the line element information, the method further includes:

[0024] Detect whether the currently identified line element overlaps with the previously identified line element;

[0025] If there is an overlap, determine the target position points corresponding to the endpoints of the target line elements in the overlapping area;

[0026] For any two target location points with adjacent timestamps, the target line element endpoint of the first target location point with the earlier timestamp is taken as the target line element endpoint of the second target location point with the later timestamp. Based on the re-determined line element endpoint, the line element between the first target location point and the second target location point is re-determined.

[0027] In one possible implementation, detecting whether the currently determined line element overlaps with a previously determined line element includes:

[0028] Determine the first endpoint of other line elements whose distance from the current line element meets preset conditions;

[0029] Based on the position information of the first endpoint and the direction vector of the position point corresponding to the current line element, it is determined whether the current line element overlaps with the other line elements.

[0030] In one possible implementation, receiving the location information sent by the first user terminal includes:

[0031] The system receives a data set sent by a first user terminal. The data set includes multiple position point information corresponding to the same stroke, and reference time information corresponding to the data set. The reference time information is used to sequentially mark the multiple data sets sent by the first user terminal.

[0032] The method of drawing handwriting based on defined line elements includes:

[0033] Determine the line element information corresponding to the position point with the latest timestamp in the currently drawn stroke;

[0034] If it is detected that the current stroke is not completed, determine whether to connect it with the current stroke that has already been drawn;

[0035] If so, then based on the cached line element information and the line elements corresponding to the currently received data set, the drawing is performed on the basis of the current stroke drawing;

[0036] If not, then draw directly based on the line elements corresponding to the currently received data set.

[0037] In one possible implementation, determining whether to connect with the currently drawn stroke includes:

[0038] The reference time information corresponding to the currently received data set, the timestamp corresponding to the position point of the currently received data set, and the timestamp corresponding to the position point of the previous data set are used to determine whether to connect with the currently drawn stroke.

[0039] Secondly, embodiments of this disclosure also provide a handwriting drawing apparatus, comprising:

[0040] The receiving module is used to receive location information sent by the first user terminal;

[0041] The determination module is used to determine the line element information corresponding to each position point based on the position point information, wherein the line element information is used to represent the boundary information of the line elements between the position point and two adjacent position points; the boundary information of the line elements between any position point and two adjacent position points is the same;

[0042] The drawing module is used to determine the line elements between every two adjacent position points based on the line element information, and to draw the handwriting based on the determined line elements.

[0043] In one possible implementation, the line element information includes the position information of the line element endpoints, the line element endpoints including the upper endpoint and the lower endpoint of the line element; the position point information includes the width information of the line element to which the position point is located;

[0044] The determining module, when determining the line element information corresponding to each position point based on the position point information, is used for:

[0045] For any given location point, based on the location point information, determine the direction vector corresponding to that location point, wherein the direction vector is used to characterize the drawing direction of the line element to which the location point is located;

[0046] Based on the direction vector and the width information included in the location point information, the position information of the upper endpoint and lower endpoint of the line element corresponding to the location point is determined.

[0047] In one possible implementation, the determining module, when determining the line element between every two adjacent location points based on the line element information, is configured to:

[0048] For any two adjacent position points, connect the upper endpoints of the line elements corresponding to the two position points respectively, connect the lower endpoints of the line elements corresponding to the two position points respectively, and connect the upper endpoints and lower endpoints of the line elements corresponding to the same position point to form a line element between the two adjacent position points.

[0049] In one possible implementation, the location point information further includes the timestamp when the first user terminal drew the location point, and the location information corresponding to the location point;

[0050] The determining module, when determining the direction vector corresponding to any given location point based on its location information, is configured to:

[0051] Based on the timestamp included in the location point information, determine the next location point corresponding to the current location point;

[0052] Starting from the current location point and ending at the next location point, a first vector is determined between the current location point and the next location point, and this first vector is used as the direction vector corresponding to the current location point.

[0053] In one possible implementation, the determining module, when determining the direction vector corresponding to any given location point based on its location information, is configured to:

[0054] Based on the timestamp included in the location point information, determine the next and previous location points corresponding to the location point;

[0055] Taking the previous position point as the starting point and the next position point as the ending point, determine the second vector between the previous position point and the next position point;

[0056] Based on the second vector, the direction vector corresponding to the position point is determined, wherein the direction vector has the same direction as the second vector; the direction vector corresponding to the first position point is a vector formed with the first position point as the starting point and the second position point as the ending point, and the direction vector of the last position point has the same direction as the direction vector of the second to last position point.

[0057] In one possible implementation, after determining the line elements between every two adjacent position points based on the line element information, the drawing module is further configured to:

[0058] Detect whether the currently identified line element overlaps with the previously identified line element;

[0059] If there is an overlap, determine the target position points corresponding to the endpoints of the target line elements in the overlapping area;

[0060] For any two target location points with adjacent timestamps, the target line element endpoint of the first target location point with the earlier timestamp is taken as the target line element endpoint of the second target location point with the later timestamp. Based on the re-determined line element endpoint, the line element between the first target location point and the second target location point is re-determined.

[0061] In one possible implementation, the drawing module, when detecting whether a currently determined line element overlaps with a previously determined line element, is configured to:

[0062] Determine the first endpoint of other line elements whose distance from the current line element meets preset conditions;

[0063] Based on the position information of the first endpoint and the direction vector of the position point corresponding to the current line element, it is determined whether the current line element overlaps with the other line elements.

[0064] In one possible implementation, the receiving module, when receiving location information sent by the first user terminal, is configured to:

[0065] The system receives a data set sent by a first user terminal. The data set includes multiple position point information corresponding to the same stroke, and reference time information corresponding to the data set. The reference time information is used to sequentially mark the multiple data sets sent by the first user terminal.

[0066] The drawing module, when drawing handwriting based on determined line elements, is used for:

[0067] Determine the line element information corresponding to the position point with the latest timestamp in the currently drawn stroke;

[0068] If it is detected that the current stroke is not completed, determine whether to connect it with the current stroke that has already been drawn;

[0069] If so, then based on the cached line element information and the line elements corresponding to the currently received data set, the drawing is performed on the basis of the current stroke drawing;

[0070] If not, then draw directly based on the line elements corresponding to the currently received data set.

[0071] In one possible implementation, the receiving module, when determining whether to connect with the currently drawn stroke, is configured to:

[0072] The reference time information corresponding to the currently received data set, the timestamp corresponding to the position point of the currently received data set, and the timestamp corresponding to the position point of the previous data set are used to determine whether to connect with the currently drawn stroke.

[0073] Thirdly, embodiments of this disclosure also provide a computer device, including: a processor, a memory, and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the computer device is running, the processor communicates with the memory via the bus, and when the machine-readable instructions are executed by the processor, the steps of the first aspect above, or any possible implementation of the first aspect, are performed.

[0074] Fourthly, embodiments of this disclosure also provide a computer-readable storage medium storing a computer program that, when executed by a processor, performs the steps of the first aspect or any possible implementation of the first aspect.

[0075] The handwriting drawing method, apparatus, computer device, and storage medium provided in this disclosure first receive position point information sent by a first user terminal. Then, based on the position point information, line element information corresponding to each position point is determined. Finally, based on the line element information, line elements between every two adjacent position points are determined, and handwriting is drawn based on the determined line elements. In this way, since adjacent line elements share the same boundary, and the method draws only one line element between every two position points, it avoids the phenomenon of cracks between line elements without increasing the number of line elements, thereby ensuring the smoothness of the drawn handwriting.

[0076] To make the above-mentioned objects, features and advantages of this disclosure more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0077] To more clearly illustrate the technical solutions of the embodiments of this disclosure, the accompanying drawings used in the embodiments will be briefly described below. These drawings are incorporated in and constitute a part of this specification. They illustrate embodiments conforming to this disclosure and, together with the specification, serve to explain the technical solutions of this disclosure. It should be understood that the following drawings only show some embodiments of this disclosure and should not be considered as limiting the scope. Those skilled in the art can obtain other related drawings based on these drawings without creative effort.

[0078] Figure 1 A flowchart illustrating a handwriting drawing method provided in an embodiment of this disclosure is shown;

[0079] Figure 2 A schematic diagram of the line element endpoints, width information, and line elements provided in the embodiments of this disclosure is shown;

[0080] Figure 3 A flowchart of a method for determining line element information provided by an embodiment of this disclosure is shown;

[0081] Figure 4 A schematic diagram illustrating a method for determining a direction vector provided by an embodiment of this disclosure is shown;

[0082] Figure 5 A schematic diagram illustrating another method for determining a direction vector, as provided in an embodiment of this disclosure, is shown.

[0083] Figure 6 A schematic diagram illustrating a method for calculating a direction vector provided by an embodiment of this disclosure is shown;

[0084] Figure 7 A schematic diagram of a line element provided in an embodiment of this disclosure is shown;

[0085] Figure 8 A schematic diagram illustrating a method for determining whether line elements overlap, provided by an embodiment of this disclosure, is shown.

[0086] Figure 9 A schematic diagram of drawing a triangular line element provided by an embodiment of this disclosure is shown;

[0087] Figure 10 A flowchart illustrating a handwriting drawing method provided in an embodiment of this disclosure is shown;

[0088] Figure 11 This illustration shows a schematic diagram of a connection to a currently drawn stroke provided by an embodiment of the present disclosure;

[0089] Figure 12 A schematic diagram of the architecture of a handwriting drawing device provided in an embodiment of this disclosure is shown;

[0090] Figure 13 A schematic diagram of the structure of a computer device provided in an embodiment of this disclosure is shown. Detailed Implementation

[0091] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this disclosure, and not all of them. The components of the embodiments of this disclosure described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this disclosure provided in the accompanying drawings is not intended to limit the scope of the claimed disclosure, but merely represents selected embodiments of this disclosure. All other embodiments obtained by those skilled in the art based on the embodiments of this disclosure without inventive effort are within the scope of protection of this disclosure.

[0092] In online classrooms, the whiteboard drawing tool is a commonly used teaching tool. The teacher uses the mouse to control the movement of the whiteboard drawing tool, creating strokes of varying thickness. The student's end receives the position information of the strokes and reconstructs the teacher's handwriting.

[0093] In related technologies, trapezoidal line elements are placed between every two position points, and the handwriting at the teacher's end is restored by superimposing these trapezoidal line elements. However, the line elements drawn in this way have cracks between them, which can cause gaps in the handwriting. If the spacing between line elements is reduced to prevent cracking and more line elements are added, the computational load will increase significantly, thereby increasing the CPU burden.

[0094] Based on the above research, this disclosure provides a method, apparatus, computer device, and storage medium for drawing handwriting. First, it receives position point information sent by a first user terminal. Then, based on the position point information, it determines the line element information corresponding to each position point. Finally, based on the line element information, it determines the line elements between every two adjacent position points and draws handwriting based on the determined line elements. In this way, since adjacent line elements share the same boundary, and the method draws only one line element between every two position points, it avoids the phenomenon of gaps between line elements without increasing the number of line elements, thus ensuring the smoothness of the drawn handwriting.

[0095] The shortcomings of the above solutions are the result of the inventor's practical experience and careful research. Therefore, the discovery process of the above problems and the solutions proposed in this disclosure below should be considered as the inventor's contribution to this disclosure.

[0096] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.

[0097] To facilitate understanding of this embodiment, a handwriting drawing method disclosed in this disclosure will first be described in detail. The execution subject of the handwriting drawing method provided in this disclosure is a second user terminal, which can be a smartphone, tablet computer, personal computer, etc.

[0098] See Figure 1 The diagram shows a flowchart of a handwriting drawing method provided in this embodiment of the present disclosure. The method includes steps 101 to 103, wherein:

[0099] Step 101: Receive location information sent by the first user terminal;

[0100] Step 102: Determine the line element information corresponding to each position point based on the position point information, wherein the line element information is used to represent the boundary information of the line elements between the position point and the two adjacent position points; the boundary information of the line elements between any position point and the two adjacent position points is the same;

[0101] Step 103: Based on the line element information, determine the line elements between every two adjacent position points, and draw the handwriting based on the determined line elements.

[0102] The following is a detailed description of the steps described above.

[0103] Regarding step 101,

[0104] The first user terminal can refer to the teacher's terminal, and the processes of steps 101 to 103 can be executed by a second user terminal, which can refer to the student's terminal. For example, the teacher's terminal can control the mouse to move the drawing tool and display the corresponding handwriting. The teacher can control the mouse to draw handwriting in the target area, thus assisting in teaching. The student's terminal can receive the position point information sent by the teacher's terminal and reconstruct the handwriting drawn by the teacher.

[0105] It should be noted that the location information includes the absolute coordinates of each location point. After receiving the location information, the display position of each location point in the display area can be determined based on the absolute coordinates.

[0106] In one possible implementation, the location point information can be sent and cached in the form of a data set. The second user terminal can receive the data set sent by the first user terminal. The data set includes multiple location point information corresponding to the same stroke, as well as reference time information corresponding to the data set. The same stroke refers to the stroke drawn from the beginning of the stroke to the end of the stroke. The reference time information is used to sequentially mark the multiple data sets sent by the first user terminal.

[0107] The reference time information can be the timestamp of the last position point of the data set preceding the current data set, such as the timestamp of the last position point of the previous data set, or the timestamp of the last position point of the data set two years before the current data set.

[0108] Alternatively, the reference time information can also be the identifier of the data set, which is used to indicate the order of the data set. It can be generated on the second user terminal according to the order in which the data set was generated. For example, the identifier of the data set can be "1, 2, 3, 4".

[0109] For example, the second user end successively receives a first data set and a second data set corresponding to the handwriting of the Chinese character "一". The first received data set contains three pieces of position point information, and in the order of the corresponding timestamps from earliest to latest, the absolute coordinates included in the three pieces of position point information are respectively the coordinates of position point A (15, 20), the coordinates of position point B (17, 19), and the coordinates of position point C (18, 20), and the reference time information is 1. The subsequently received second data set contains two pieces of position point information, which are respectively the coordinates of position point D (19, 21) and the coordinates of position point E (21, 21) in the order of the corresponding timestamps from earliest to latest, and the reference time information is 2.

[0110] For step 102,

[0111] After the second user end receives the position point information, the second user end needs to determine the line segment element information corresponding to each position point according to the position point information, and then perform handwriting restoration according to the line segment element information.

[0112] In a possible implementation, the line segment element information includes position information of endpoints of the line segment element, and the endpoints of the line segment element include an upper endpoint of the line segment element and a lower endpoint of the line segment element; the position point information includes width information of the line segment element where the position point is located.

[0113] Wherein, if the upper endpoints of the line segment element corresponding to adjacent position points are on any side of the connecting line between the adjacent position points, the lower endpoints of the line segment element corresponding to the adjacent position points are on the other side of the connecting line between the adjacent position points; the line segment element is an irregular triangle or quadrilateral formed by connecting straight line segments, which is used to represent the shape of the handwriting between every two position points, and the endpoints of the line segment element are the endpoints of the boundary of the line segment element. The width information represents the distance between any position point and the endpoint of the line segment element corresponding to this position point, which is preset by the first user end.

[0114] For example, refer to Figure 2 as shown, if there are four position points A, B, C, D, position points E and G are the endpoints of the line segment element corresponding to point B, position points F and H are the endpoints of the line segment element corresponding to point C, the quadrilateral EFHG is the line segment element, and the lengths of line segments EB, BG, FC, and CH are the lengths corresponding to the width information.

[0115] In order to ensure that no gap is generated between the line segment elements, in the present disclosure, the boundary information of the line segment elements between any position point and its two adjacent position points is the same. Specifically, the connecting line between the upper endpoint of the line segment element and the lower endpoint of the line segment element is taken as the boundary of the line segment element between any position point and its two adjacent position points, and the position information of the upper endpoint of the line segment element and the lower endpoint of the line segment element corresponding to the boundary is the corresponding boundary information, that is, the two line segment elements between any position point and its two adjacent position points share a boundary.

[0116] When determining the line element information corresponding to each location point based on the location point information, for example, see [example missing]. Figure 3 The method shown includes the following steps:

[0117] S301. For any given location point, based on the location point information, determine the direction vector corresponding to the location point, wherein the direction vector is used to characterize the drawing direction of the line element to which the location point is located;

[0118] S302. Based on the direction vector and the width information included in the position point information of the position point, determine the position information of the upper endpoint and the lower endpoint of the line element corresponding to the position point.

[0119] In one possible implementation, the location point information further includes the timestamp when the first user terminal drew the location point, and the location information corresponding to the location point.

[0120] The location information can be the coordinates of a location point, and the timestamp can refer to the time when the first user terminal draws the location point. This time can be an absolute time or a relative time. For example, the relative time can refer to the time relative to the content display time, such as the Kth second of the content display.

[0121] In one possible implementation, when determining the direction vector corresponding to any given location point based on its location information, the next location point can be determined based on the timestamp included in the location information. Then, taking the current location point as the starting point and the next location point as the ending point, a first vector between the current location point and the next location point is determined, and this first vector is used as the direction vector corresponding to the current location point.

[0122] For example, the timestamp corresponding to the current location point can be determined first, and then the next location point adjacent to the timestamp corresponding to the current location point can be determined based on the order of the timestamps from early to late. A line can be drawn from the current location point as the starting point to the next location point as the ending point to determine the first vector between the current location point and the next location point, which is the direction vector corresponding to the current location point.

[0123] For example, see Figure 4 As shown, the current position is M, and the next position is N. Starting from position M and ending at position N, connecting position M and position N yields the first vector.

[0124] In another possible implementation, the direction vector can also be determined by the line connecting the previous and next adjacent positions.

[0125] For example, when determining the direction vector corresponding to any location point based on its location information, the next and previous location points can also be determined based on the timestamps included in the location information; a second vector between the previous and next location points can be determined, with the previous location point as the starting point and the next location point as the ending point; and the direction vector corresponding to the location point can be determined based on the second vector, wherein the direction vector has the same direction as the second vector.

[0126] Specifically, the timestamp corresponding to the current position is determined. Based on the order of the timestamps from early to late, the next position and the previous position adjacent to the timestamp corresponding to the current position are determined. The previous position is used as the starting point and the next position is used as the ending point to connect them, and the second vector corresponding to the current position is determined. A line parallel to the second vector is drawn through the current position to determine the direction vector.

[0127] Here, the current position can be used as the starting point, and a preset length can be truncated to determine any point on the direction vector, which is convenient for subsequent calculations.

[0128] For example, see Figure 5 As shown, the current position is B, the previous position is A, and the next position is C. A straight line is drawn through A and C to obtain the second vector. Make a pass through the current position point B The direction vector of point B is obtained from the parallel lines.

[0129] It should be noted that, in this case, the direction vector corresponding to the first position point is a vector that starts from the first position point and ends at the second position point; the direction vector of the last position point has the same direction as the direction vector of the second-to-last position point; or, the direction vector of the last position point is the direction of the vector that starts from the second-to-last position point and ends at the last position point.

[0130] by Figure 5 For example, if point A is the first position point, then the direction vector of point A is... If C is the last position point, then the direction vector of point C can be in the same direction as the direction vector of point B, or it can be in the same direction as the direction vector of point B. They are in the same direction.

[0131] In one possible implementation, when determining the position information of the upper endpoint and lower endpoint of the line element corresponding to the position point based on the direction vector and the width information included in the position point information, specifically, for any position point, a perpendicular line to the direction vector can be drawn through the position point, and the preset length in the width information can be intercepted along the two directions of the perpendicular line with the position point as the starting point to determine the position information of the upper endpoint and lower endpoint of the line element corresponding to the position point.

[0132] Here, when determining the position information of the upper and lower endpoints of the line element, a coordinate system can be established with the position point as the origin. Based on the preset length and the direction vector, the relative position coordinates of the upper and lower endpoints of the line element with respect to the position point can be determined.

[0133] For example, such as Figure 6 As shown, the direction vector It is mostly a diagonal line. When calculating the coordinates of the upper endpoint G of the line element corresponding to the current position point C (here referring to the relative coordinates relative to C) and the lower endpoint H of the line element corresponding to the current position point C (here referring to the relative coordinates relative to C), we can take the current position point C as the origin (0,0), take the horizontal rightward as the positive X-axis direction, and take the vertical upward as the positive Y-axis direction to establish a plane rectangular coordinate system. Then we can calculate the relative coordinates (x1, y1) of the upper endpoint G of the line element and the relative coordinates (x2, y2) of the lower endpoint H of the line element.

[0134] For example, the relative coordinates (x1, y1) of the upper endpoint G of the line element and the relative coordinates (x2, y2) of the lower endpoint H of the line element can be calculated using the following formula:

[0135]

[0136]

[0137]

[0138]

[0139] Where |CG| represents the distance between the current position point C and the upper endpoint G of the line element, i.e., the width information corresponding to position point C, y f Let |CF| represent the ordinate of the endpoint F of the direction vector, and |CF| represent the distance between the current position C and the endpoint F of the direction vector. f The x-coordinate of the endpoint F of the direction vector is represented, and |CH| represents the distance between the current position point C and the lower endpoint H of the line element, i.e., the width information corresponding to position point C.

[0140] It is important to note here that the coordinates (x, y) of the endpoint F are... f ,y f As described in the method for determining the direction vector above, when determining the relative coordinates of the endpoint F, the absolute coordinates of the next position point D, or the absolute coordinates of the previous position point B and the next position point D, can be converted into relative coordinates first, and then the relative coordinates of the endpoint F can be calculated; or, after calculating the absolute coordinates of the endpoint F, the absolute coordinates of the endpoint F can be converted into relative coordinates.

[0141] Here, after determining the relative coordinates of each line element endpoint, the relative coordinates of the line element endpoints can be converted into absolute coordinates based on the absolute coordinates of the position points, and then the line elements can be drawn based on the absolute coordinates of the line element endpoints.

[0142] Regarding step 103,

[0143] In one possible implementation, when determining the line element between every two adjacent position points based on the line element information, for any two adjacent position points, the upper endpoints of the line elements corresponding to the two position points are connected, the lower endpoints of the line elements corresponding to the two position points are connected, and the upper endpoints and lower endpoints of the line elements corresponding to the same position point are connected to form the line element between the two adjacent position points.

[0144] Here, since there are only two endpoints of the line element corresponding to the same position point, the boundaries of the line elements between the position point and the previous position point, and between the position point and the next position point are the same. That is, the two line elements share the boundary, which is the line connecting the upper endpoint and the lower endpoint of the line element corresponding to the position point. Therefore, in the handwriting drawn based on the method provided in this disclosure, there will be no cracks between adjacent line elements.

[0145] For example, such as Figure 7 As shown, if there are three adjacent position points A, D, and G, with position point A having its upper endpoint B and lower endpoint C, position point D having its upper endpoint E and lower endpoint F, and position point G having its upper endpoint H and lower endpoint I, and CF, FE, EB, BC, EH, HI, and IF are connected respectively, the quadrilateral BEFC formed is the line element between position points A and D, and the quadrilateral EHIF formed is the line element between position points D and G. The quadrilaterals BEFC and EHIF share the boundary FE.

[0146] In practical applications, after connecting the line elements based on the above method, if the curvature of the handwriting is too large, there is a high possibility that adjacent line elements may overlap. If the overlapping line elements are not processed, the color of the overlapping part in the restored handwriting will be darker, thus affecting the display effect. Therefore, after determining the line elements between each two adjacent positions based on the line element information, it is also necessary to detect whether the currently determined line element overlaps with the previously determined line element.

[0147] In one possible implementation, when detecting whether a currently determined line element overlaps with a previously determined line element, the first endpoints of other line elements whose distance from the current line element meets a preset condition can be determined first. Then, based on the position information of the first endpoints and the direction vector of the position point corresponding to the current line element, it can be determined whether the current line element overlaps with the other line elements. The preset condition can refer to being closest to the current line element or being located inside the current line element.

[0148] Specifically, a comparison vector is determined with the current position point as the starting point and the upper or lower endpoint of the line element corresponding to the previous position point as the ending point. If the angle between the comparison vector and the direction vector is less than 90 degrees, that is, the product of the comparison vector and the direction vector is greater than 0, then the line elements overlap.

[0149] For example, see Figure 8 As shown, when determining whether line elements determined based on position points B and C overlap, the product of the comparison vector and the direction vector can be calculated using the following formula:

[0150]

[0151] in, This represents the direction vector. Let x represent the comparison vector. f The x-coordinate of point F represents the x-coordinate of the location. g The x-coordinate of point G is represented by the y-coordinate. f The y-coordinate of point F represents the coordinate of the point. g This represents the ordinate of the location point G.

[0152] Here, the coordinates of points G and F can be relative to point C, or they can be absolute coordinates, as long as they are in the same coordinate system.

[0153] In one possible implementation, if it is detected that the currently determined line element overlaps with the previously determined line element, the target position points corresponding to the endpoints of the target line elements in the overlapping area should be determined respectively. For any two target position points with adjacent timestamps, the target line element endpoint of the first target position point with the earlier timestamp is taken as the target line element endpoint of the second target position point with the later timestamp. Based on the re-determined line element endpoints, the line elements between the first target position point and the second target position point are re-determined.

[0154] In one possible implementation, when redetermining the line element between the first target position point and the second target position point based on the redetermined line element endpoints, for any two adjacent position points, the upper endpoints or lower endpoints of the line element corresponding to the two position points are connected respectively, and the upper endpoints and lower endpoints of the line element corresponding to the same position point are connected to form a triangular line element between the two adjacent position points.

[0155] For example, see Figure 9 As shown, if there are two adjacent position points B and C, with the upper endpoint of the line element corresponding to position point B being H and the lower endpoint of the line element being F, and the upper endpoint of the line element corresponding to position point C being I and the lower endpoint of the line element being J, and the line element between position points A and D overlapping as determined by the lower endpoint of the line element, then the lower endpoint of the line element corresponding to position point C is set to F, and HF, HI, and IF are connected respectively. The resulting triangle HIF is the line element between position points B and C.

[0156] In one possible implementation, after the line elements are determined, handwriting is drawn based on the determined line elements, see [link to relevant documentation]. Figure 10 As shown, it includes the following steps:

[0157] S1001. Determine the line element information corresponding to the position point with the latest timestamp in the currently drawn stroke;

[0158] S1002. If it is detected that the current stroke has not been completed, determine whether to connect it with the current stroke that has already been drawn.

[0159] If yes, then execute S1003 sequentially; otherwise, execute S1004.

[0160] S1003. Based on the cached line element information and the line elements corresponding to the currently received data set, draw the current stroke.

[0161] S1004. Draw directly based on the line elements corresponding to the currently received data set.

[0162] Specifically, since the second user terminal typically uses an incremental drawing mode when caching the data set, that is, it overwrites the previous data set when caching the current data set, if the previous data set and the current data set belong to the same stroke, the line element between the last position point in the previous data set and the first position point in the current data set will not be drawn, which will cause the stroke to break in the middle.

[0163] Therefore, when connecting line elements, it should first be determined whether the current data set and the previous data set need to be connected, and then line elements should be drawn between the data sets that need to be connected.

[0164] In one possible implementation, the continuity identifier can be used to determine whether an incomplete current stroke and an already drawn stroke belong to the same stroke. The continuity identifier is generated by a first user terminal, stored in a data set, and used to indicate whether the data set and the next data set belong to the same stroke.

[0165] For example, if the current data set and the data set belong to the same stroke, the identifier displays 1; if the current data set and the data set do not belong to the same stroke, the identifier displays 0.

[0166] Furthermore, in the event of poor network conditions, the data sets received by the second user terminal may be out of order, resulting in the previous data set not being adjacent to the current data set, or not being received in chronological order from early to late. Therefore, it is also necessary to determine whether any of the received data sets arrive in sequence.

[0167] In one possible implementation, it can also be determined whether to connect with the currently drawn stroke based on the reference time information corresponding to the currently received data set, the timestamp corresponding to the position point of the currently received data set, and the timestamp corresponding to the position point of the previous data set.

[0168] For example, taking the timestamp of the last position point of the previous data set as the reference time information, the following two conditions can be used to determine whether to connect with the currently drawn stroke.

[0169] Condition 1: The timestamp in the earliest location information in the previous data set is greater than the reference time information;

[0170] Condition 2: The timestamp of the latest location information in the previous data set is less than the timestamp of the earliest location information in the current data set.

[0171] If condition 1 is met, it means that the previous data set is after the data set two days prior. If condition 2 is met, it means that the previous data set is before the current data set. If both conditions are met, it means that the three data sets were received in chronological order, and then a connection is made.

[0172] For example, see Figure 11 As shown, the second user terminal receives data set one, data set two, and data set three in succession. The latest position point with the corresponding timestamp in data set one is A, the earliest position point with the corresponding timestamp in data set two is B, the latest position point with the corresponding timestamp is C, and the earliest position point with the corresponding timestamp in data set three is D. According to condition 1, the timestamp corresponding to position point A is compared with the timestamp corresponding to position point B, and according to condition 2, the timestamp corresponding to position point C is compared with the timestamp corresponding to position point D. If both conditions are met, then position points A and B, and position points B and C are connected. If any condition is not met, then no connection is made.

[0173] After determining that the currently drawn stroke should be connected, line element drawing is performed based on the line element information with the latest timestamp in the previous data set and the line element information with the earliest timestamp in the current data set. In one possible implementation, since the data set is cached in an overlay manner, when receiving any data set, the line element information with the latest timestamp in the previous data set should be retained so that it can be connected with the drawn strokes in the current data set after receiving the data set.

[0174] The handwriting drawing method provided in this embodiment first receives position point information sent by a first user terminal, then determines the line element information corresponding to each position point based on the position point information, and finally determines the line elements between every two adjacent position points based on the line element information, and draws handwriting based on the determined line elements. In this way, since adjacent line elements share the same boundary, and the method draws only one line element between every two position points, it avoids the phenomenon of cracks between line elements without increasing the number of line elements, thereby ensuring the smoothness of the drawn handwriting.

[0175] Those skilled in the art will understand that, in the above-described method of the specific implementation, the order in which each step is written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of each step should be determined by its function and possible internal logic.

[0176] Based on the same inventive concept, this disclosure also provides a handwriting drawing device corresponding to the handwriting drawing method. Since the principle of the device in this disclosure for solving the problem is similar to the handwriting drawing method described above in this disclosure, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be described again.

[0177] Reference Figure 12 The diagram shown is a schematic representation of the architecture of a handwriting drawing device according to an embodiment of this disclosure. The device includes: a receiving module 1201, a determining module 1202, and a drawing module 1203; wherein,

[0178] The receiving module 1201 is used to receive location information sent by the first user terminal;

[0179] The determining module 1202 is used to determine the line element information corresponding to each position point based on the position point information, wherein the line element information is used to represent the boundary information of the line elements between the position point and two adjacent position points; the boundary information of the line elements between any position point and two adjacent position points is the same;

[0180] The drawing module 1203 is used to determine the line elements between each pair of adjacent position points based on the line element information, and to draw the handwriting based on the determined line elements.

[0181] In one possible implementation, the line element information includes the position information of the line element endpoints, the line element endpoints including the upper endpoint and the lower endpoint of the line element; the position point information includes the width information of the line element to which the position point is located;

[0182] The determining module 1202, when determining the line element information corresponding to each position point based on the position point information, is used for:

[0183] For any given location point, based on the location point information, determine the direction vector corresponding to that location point, wherein the direction vector is used to characterize the drawing direction of the line element to which the location point is located;

[0184] Based on the direction vector and the width information included in the location point information, the position information of the upper endpoint and lower endpoint of the line element corresponding to the location point is determined.

[0185] In one possible implementation, the determining module 1202, when determining the line element between every two adjacent position points based on the line element information, is used to:

[0186] For any two adjacent position points, connect the upper endpoints of the line elements corresponding to the two position points respectively, connect the lower endpoints of the line elements corresponding to the two position points respectively, and connect the upper endpoints and lower endpoints of the line elements corresponding to the same position point to form a line element between the two adjacent position points.

[0187] In one possible implementation, the location point information further includes the timestamp when the first user terminal drew the location point, and the location information corresponding to the location point;

[0188] The determining module 1202, when determining the direction vector corresponding to any given location point based on the location point information, is used to:

[0189] Based on the timestamp included in the location point information, determine the next location point corresponding to the current location point;

[0190] Starting from the current location point and ending at the next location point, a first vector is determined between the current location point and the next location point, and this first vector is used as the direction vector corresponding to the current location point.

[0191] In one possible implementation, the determining module 1202, when determining the direction vector corresponding to any given location point based on its location information, is configured to:

[0192] Based on the timestamp included in the location point information, determine the next and previous location points corresponding to the location point;

[0193] Taking the previous position point as the starting point and the next position point as the ending point, determine the second vector between the previous position point and the next position point;

[0194] Based on the second vector, the direction vector corresponding to the position point is determined, wherein the direction vector has the same direction as the second vector; the direction vector corresponding to the first position point is a vector formed with the first position point as the starting point and the second position point as the ending point, and the direction vector of the last position point has the same direction as the direction vector of the second to last position point.

[0195] In one possible implementation, after determining the line elements between every two adjacent position points based on the line element information, the drawing module 1203 is further configured to:

[0196] Detect whether the currently identified line element overlaps with the previously identified line element;

[0197] If there is an overlap, determine the target position points corresponding to the endpoints of the target line elements in the overlapping area;

[0198] For any two target location points with adjacent timestamps, the target line element endpoint of the first target location point with the earlier timestamp is taken as the target line element endpoint of the second target location point with the later timestamp. Based on the re-determined line element endpoint, the line element between the first target location point and the second target location point is re-determined.

[0199] In one possible implementation, the drawing module 1203, when detecting whether the currently determined line element overlaps with the previously determined line element, is used to:

[0200] Determine the first endpoint of other line elements whose distance from the current line element meets preset conditions;

[0201] Based on the position information of the first endpoint and the direction vector of the position point corresponding to the current line element, it is determined whether the current line element overlaps with the other line elements.

[0202] In one possible implementation, the receiving module 1201, when receiving location information sent by the first user terminal, is used to:

[0203] The system receives a data set sent by a first user terminal. The data set includes multiple position point information corresponding to the same stroke, and reference time information corresponding to the data set. The reference time information is used to sequentially mark the multiple data sets sent by the first user terminal.

[0204] The drawing module 1203, when drawing handwriting based on determined line elements, is used for:

[0205] Determine the line element information corresponding to the position point with the latest timestamp in the currently drawn stroke;

[0206] If it is detected that the current stroke is not completed, determine whether to connect it with the current stroke that has already been drawn;

[0207] If so, then based on the cached line element information and the line elements corresponding to the currently received data set, the drawing is performed on the basis of the current stroke drawing;

[0208] If not, then draw directly based on the line elements corresponding to the currently received data set.

[0209] In one possible implementation, the receiving module 1201, when determining whether to connect with the currently drawn stroke, is configured to:

[0210] The reference time information corresponding to the currently received data set, the timestamp corresponding to the position point of the currently received data set, and the timestamp corresponding to the position point of the previous data set are used to determine whether to connect with the currently drawn stroke.

[0211] The processing flow of each module in the device and the interaction flow between each module can be referred to the relevant descriptions in the above method embodiments, and will not be detailed here.

[0212] Based on the same technical concept, this disclosure also provides a computer device. (See also...) Figure 13 The diagram shows the structure of a computer device 1300 provided in this embodiment, including a processor 1301, a memory 1302, and a bus 1303. The memory 1302 stores execution instructions and includes main memory 13021 and external memory 13022. The main memory 13021, also called internal memory, is used to temporarily store computational data in the processor 1301 and data exchanged with external memory 13022 such as a hard disk. The processor 1301 exchanges data with the external memory 13022 through the main memory 13021. When the computer device 1300 is running, the processor 1301 and the memory 1302 communicate through the bus 1303, causing the processor 1301 to execute the following instructions:

[0213] Receive location information sent by the first user terminal;

[0214] Based on the location point information, the line element information corresponding to each location point is determined, wherein the line element information is used to represent the boundary information of the line elements between the location point and the two adjacent location points; the boundary information of the line elements between any location point and the two adjacent location points is the same;

[0215] Based on the line element information, the line elements between each pair of adjacent position points are determined, and the handwriting is drawn based on the determined line elements.

[0216] In one possible implementation, the line element information includes the position information of the line element endpoints, the line element endpoints including the upper endpoint and the lower endpoint of the line element; the position point information includes the width information of the line element to which the position point is located;

[0217] In one possible implementation, the instruction executed by processor 1301, which involves determining the line element information corresponding to each position point based on the position point information, includes:

[0218] For any given location point, based on the location point information, determine the direction vector corresponding to that location point, wherein the direction vector is used to characterize the drawing direction of the line element to which the location point is located;

[0219] Based on the direction vector and the width information included in the location point information, the position information of the upper endpoint and lower endpoint of the line element corresponding to the location point is determined.

[0220] In one possible implementation, the instruction executed by processor 1301, which determines the line element between every two adjacent location points based on the line element information, includes:

[0221] For any two adjacent position points, connect the upper endpoints of the line elements corresponding to the two position points respectively, connect the lower endpoints of the line elements corresponding to the two position points respectively, and connect the upper endpoints and lower endpoints of the line elements corresponding to the same position point to form a line element between the two adjacent position points.

[0222] In one possible implementation, the location point information further includes the timestamp when the first user terminal drew the location point, and the location information corresponding to the location point;

[0223] In one possible implementation, the instruction executed by processor 1301, which determines the direction vector corresponding to any given location point based on the location point information, includes:

[0224] Based on the timestamp included in the location point information, determine the next location point corresponding to the current location point;

[0225] Starting from the current location point and ending at the next location point, a first vector is determined between the current location point and the next location point, and this first vector is used as the direction vector corresponding to the current location point.

[0226] In one possible implementation, the instruction executed by processor 1301, which determines the direction vector corresponding to any given location point based on the location point information, includes:

[0227] Based on the timestamp included in the location point information, determine the next and previous location points corresponding to the location point;

[0228] Taking the previous position point as the starting point and the next position point as the ending point, determine the second vector between the previous position point and the next position point;

[0229] Based on the second vector, the direction vector corresponding to the position point is determined, wherein the direction vector has the same direction as the second vector; the direction vector corresponding to the first position point is a vector formed with the first position point as the starting point and the second position point as the ending point, and the direction vector of the last position point has the same direction as the direction vector of the second to last position point.

[0230] In one possible implementation, after determining the line elements between every two adjacent location points based on the line element information, the method further includes the following instructions executed by processor 1301:

[0231] Detect whether the currently identified line element overlaps with the previously identified line element;

[0232] If there is an overlap, determine the target position points corresponding to the endpoints of the target line elements in the overlapping area;

[0233] For any two target location points with adjacent timestamps, the target line element endpoint of the first target location point with the earlier timestamp is taken as the target line element endpoint of the second target location point with the later timestamp. Based on the re-determined line element endpoint, the line element between the first target location point and the second target location point is re-determined.

[0234] In one possible implementation, the instruction executed by processor 1301, which includes detecting whether a currently determined line element overlaps with a previously determined line element, includes:

[0235] Determine the first endpoint of other line elements whose distance from the current line element meets preset conditions;

[0236] Based on the position information of the first endpoint and the direction vector of the position point corresponding to the current line element, it is determined whether the current line element overlaps with the other line elements.

[0237] In one possible implementation, the instruction executed by processor 1301, which includes receiving location information sent by the first user terminal, includes:

[0238] The system receives a data set sent by a first user terminal. The data set includes multiple position point information corresponding to the same stroke, and reference time information corresponding to the data set. The reference time information is used to sequentially mark the multiple data sets sent by the first user terminal.

[0239] The method of drawing handwriting based on defined line elements includes:

[0240] Determine the line element information corresponding to the position point with the latest timestamp in the currently drawn stroke;

[0241] If it is detected that the current stroke is not completed, determine whether to connect it with the current stroke that has already been drawn;

[0242] If so, then based on the cached line element information and the line elements corresponding to the currently received data set, the drawing is performed on the basis of the current stroke drawing;

[0243] If not, then draw directly based on the line elements corresponding to the currently received data set.

[0244] In one possible implementation, the instruction executed by processor 1301, determining whether to connect with the currently drawn stroke, includes:

[0245] The reference time information corresponding to the currently received data set, the timestamp corresponding to the position point of the currently received data set, and the timestamp corresponding to the position point of the previous data set are used to determine whether to connect with the currently drawn stroke.

[0246] This disclosure also provides a computer-readable storage medium storing a computer program that, when executed by a processor, performs the steps of the handwriting drawing method described in the above method embodiments. The storage medium can be a volatile or non-volatile computer-readable storage medium.

[0247] This disclosure also provides a computer program product carrying program code. The program code includes instructions that can be used to execute the steps of the handwriting drawing method described in the above method embodiments. For details, please refer to the above method embodiments, which will not be repeated here.

[0248] The aforementioned computer program product can be implemented through hardware, software, or a combination thereof. In one optional embodiment, the computer program product is specifically embodied in a computer storage medium; in another optional embodiment, the computer program product is specifically embodied in a software product, such as a software development kit (SDK), etc.

[0249] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems and devices described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. In the several embodiments provided in this disclosure, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division; in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Another point is that the displayed or discussed mutual coupling or direct coupling or communication connection may be through some communication interfaces; the indirect coupling or communication connection of devices or units may be electrical, mechanical, or other forms.

[0250] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0251] In addition, the functional units in the various embodiments of this disclosure can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0252] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this disclosure. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0253] Finally, it should be noted that the above-described embodiments are merely specific implementations of this disclosure, used to illustrate the technical solutions of this disclosure, and not to limit it. The protection scope of this disclosure is not limited thereto. Although this disclosure has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this disclosure. Such modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this disclosure, and should all be covered within the protection scope of this disclosure. Therefore, the protection scope of this disclosure should be determined by the protection scope of the claims.

Claims

1. A method for drawing handwriting, characterized in that, include: Receive location information sent by the first user terminal; Based on the location point information, the line element information corresponding to each location point is determined, wherein the line element information is used to represent the boundary information of the line elements between the location point and two adjacent location points; the boundary information of the line elements between any location point and two adjacent location points is the same. Based on the line element information, the line elements between each pair of adjacent position points are determined, and the handwriting is drawn by connecting the adjacent line elements based on the determined line elements. The line element information includes the position information of the line element endpoints, and the line element endpoints include the upper endpoint and the lower endpoint of the line element; The method further includes, after determining the line elements between every two adjacent location points based on the line element information: Detect whether the currently identified line element overlaps with the previously identified line element; If there is an overlap, determine the target position points corresponding to the endpoints of the target line elements in the overlapping area; For any two target location points with adjacent timestamps, the target line element endpoint of the first target location point with the earlier timestamp is taken as the target line element endpoint of the second target location point with the later timestamp. Based on the re-determined line element endpoint, the line element between the first target location point and the second target location point is re-determined.

2. The method according to claim 1, characterized in that, The location point information includes the width information of the line element to which the location point is located; The step of determining the line element information corresponding to each position point based on the position point information includes: For any given location point, based on the location point information, a direction vector corresponding to the location point is determined, wherein the direction vector is used to characterize the drawing direction of the line element to which the location point is located; Based on the direction vector and the width information included in the position point information of the position point, the position information of the upper endpoint and the lower endpoint of the line element corresponding to the position point is determined.

3. The method according to claim 2, characterized in that, The step of determining the line element between every two adjacent position points based on the line element information includes: For any two adjacent position points, connect the upper endpoints of the line elements corresponding to the two adjacent position points, connect the lower endpoints of the line elements corresponding to the two adjacent position points, and connect the upper endpoints and lower endpoints of the line elements corresponding to the same position point to form a line element between the two adjacent position points.

4. The method according to claim 2, characterized in that, The location point information also includes the timestamp when the first user terminal drew the location point, and the location information corresponding to the location point; The step of determining the direction vector corresponding to any given location point based on the location point information includes: Based on the timestamp included in the location point information, determine the next location point corresponding to the location point; Starting from the given location point and ending at the next location point, a first vector is determined between the given location point and the next location point, and this first vector is used as the direction vector corresponding to the given location point.

5. The method according to claim 2, characterized in that, The step of determining the direction vector corresponding to any given location point based on the location point information includes: Based on the timestamps included in the location point information, determine the next and previous location points corresponding to the location point; Taking the previous position point as the starting point and the next position point as the ending point, determine the second vector between the previous position point and the next position point; Based on the second vector, the direction vector corresponding to the position point is determined, wherein the direction vector has the same direction as the second vector; the direction vector corresponding to the first position point is a vector formed with the first position point as the starting point and the second position point as the ending point, and the direction vector of the last position point has the same direction as the direction vector of the second to last position point.

6. The method according to claim 1, characterized in that, The detection of whether the currently determined line element overlaps with the previously determined line element includes: Determine the first endpoint of other line elements whose distance from the current line element meets preset conditions; Based on the position information of the first endpoint and the direction vector of the position point corresponding to the current line element, it is determined whether the current line element overlaps with the other line elements.

7. The method according to claim 1, characterized in that, The receipt of location information sent by the first user terminal includes: The system receives a data set sent by a first user terminal. The data set includes multiple position point information corresponding to the same stroke, and reference time information corresponding to the data set. The reference time information is used to sequentially mark the multiple data sets sent by the first user terminal. The method employs an incremental rendering mode. The method of drawing handwriting based on defined line elements includes: Determine the line element information corresponding to the position point with the latest timestamp in the currently drawn stroke; If it is detected that the current stroke is not completed, determine whether to connect it with the current stroke that has already been drawn; If so, then based on the cached line element information and the line elements corresponding to the currently received data set, the drawing is performed on the basis of the current stroke drawing; If not, then draw directly based on the line elements corresponding to the currently received data set.

8. The method according to claim 7, characterized in that, The determination of whether to connect with the currently drawn stroke includes: The reference time information corresponding to the currently received data set, the timestamp corresponding to the position point of the currently received data set, and the timestamp corresponding to the position point of the previous data set are used to determine whether to connect with the currently drawn stroke.

9. A handwriting drawing device, characterized in that, include: The receiving module is used to receive location information sent by the first user terminal; The determining module is used to determine the line element information corresponding to each position point based on the position point information, wherein the line element information is used to represent the boundary information of the line elements between the position point and two adjacent position points; the boundary information of the line elements between any position point and two adjacent position points is the same; The drawing module is used to determine the line elements between each pair of adjacent position points based on the line element information, and to draw the handwriting by connecting the adjacent line elements based on the determined line elements. The line element information includes the position information of the line element endpoints, and the line element endpoints include the upper endpoint and the lower endpoint of the line element; The drawing module, after determining the line elements between every two adjacent position points based on the line element information, is further configured to: Detect whether the currently identified line element overlaps with the previously identified line element; If there is an overlap, determine the target position points corresponding to the endpoints of the target line elements in the overlapping area; For any two target location points with adjacent timestamps, the target line element endpoint of the first target location point with the earlier timestamp is taken as the target line element endpoint of the second target location point with the later timestamp. Based on the re-determined line element endpoint, the line element between the first target location point and the second target location point is re-determined.

10. A computer device, characterized in that, include: The computer device includes a processor, a memory, and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the computer device is running, the processor communicates with the memory via the bus, and the machine-readable instructions, when executed by the processor, perform the steps of the handwriting drawing method as described in any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the handwriting drawing method as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Control device, laser irradiation device, optimization font data database, recording method, and computer-readable storage medium

    CN101648467A

  • Method and device of determining pressure sensing handwriting area

    CN107526526A

  • Handwriting rendering method, device, interactive intelligent tablet computer, and storage medium

    CN109284059A