Disclosure of Invention
The invention aims to provide a handwriting data processing method, a system, computer equipment and a storage medium, and aims to solve the problem that in the prior art, the handwriting on a touch pad is processed by more steps, so that the handwriting display on a display screen has larger delay feeling.
In a first aspect, an embodiment of the present invention provides a method for processing handwriting data, including:
the touch pad receives handwriting data written by the touch pen and sends the handwriting data to a reading module of the system mainboard;
the reading module preprocesses the handwriting data to obtain coordinate data, and writes the coordinate data into a frame cache of the system mainboard;
and generating a handwriting picture according to the coordinate data, displaying the handwriting picture on a display screen, and synchronously sending the handwriting picture to a storage area through an application program.
In a second aspect, an embodiment of the present invention provides a handwriting data processing system, which includes:
the touch panel is used for receiving handwriting data written by a user and sending the handwriting data to a reading module of the system mainboard;
the reading module is used for reading the handwriting data and obtaining coordinate data, and writing the coordinate data into a frame buffer of the system mainboard;
and generating a handwriting picture according to the coordinate data, displaying the handwriting picture on a display screen, and synchronously sending the handwriting picture to a storage area through an application program.
In a third aspect, an embodiment of the present invention further provides a computer device, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the computer program, the processor implements the handwriting data processing method according to the first aspect.
In a fourth aspect, the embodiments of the present invention also provide a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and the computer program, when executed by a processor, causes the processor to execute the handwriting data processing method according to the first aspect.
The embodiment of the invention discloses a handwriting data processing method, a handwriting data processing system, computer equipment and a storage medium. The method comprises the steps that a touch pad receives handwriting data written by a touch pen and sends the handwriting data to a reading module of a system mainboard; the reading module preprocesses the handwriting data to obtain coordinate data, and writes the coordinate data into a frame cache of the system mainboard; and generating a handwriting picture according to the coordinate data, displaying the handwriting picture on a display screen, and synchronously sending the handwriting picture to a storage area through an application program. The embodiment of the invention shortens the steps of handwriting data processing, so that the process from operation to display of the handwriting is faster, and the method has the advantage of reducing the delay sense during handwriting.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the specification of the present invention and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
Referring to fig. 1, fig. 1 is a schematic flow chart of a handwriting data processing method according to an embodiment of the present invention;
as shown in fig. 1, the method includes steps S101 to S103.
S101, the touch pad receives handwriting data written by the touch pen and sends the handwriting data to a reading module of the system mainboard.
In this embodiment, the handwriting screen of the touch pad is an electromagnetic screen, a user performs handwriting on the electromagnetic screen through a touch pen and generates handwriting data, the physical interruption of the electromagnetic screen is performed at most 200 times per second, and the handwriting data is effectively reported 100-125 times, and the time consumed for receiving the handwriting data and sending the handwriting data to the reading module in this step is 8-10 ms.
In one embodiment, as shown in fig. 2, the step S101 includes:
s201, the touch pad receives each writing track of a touch pen on a screen, calculates a plurality of handwriting coordinate points of the writing track and the generation time of each handwriting coordinate point, and obtains corresponding handwriting data of the writing track according to the plurality of handwriting coordinate points and the generation time of each handwriting coordinate point;
and S202, the touch pad sends the handwriting data to a reading module of the system mainboard.
In the embodiment, in the process of handwriting by a user, a first handwriting coordinate point starts to be generated at the moment when a touch pen touches the touch pad, and a plurality of handwriting coordinate points are continuously generated along a handwriting track in the continuous handwriting process until a last handwriting coordinate point is generated after the touch pen leaves the touch pad, wherein the process is a one-time complete handwriting track; and recording the generation time of each handwriting coordinate point while generating the handwriting coordinate points, and obtaining the handwriting data of the corresponding writing track according to the handwriting coordinate points and the generation time of each handwriting coordinate point.
And sending the handwriting data to a reading module of the system mainboard through the touch pad, wherein the system mainboard can be an android system mainboard, and the reading module is an android system component.
S102, the reading module preprocesses the handwriting data to obtain coordinate data, and writes the coordinate data into a frame buffer of the system mainboard.
Specifically, the step S102 includes:
the reading module reads the received handwriting data to obtain corresponding handwriting coordinate points, filters the handwriting coordinate points to obtain a plurality of key coordinate points and the generation time of each key coordinate point, obtains coordinate data of the handwriting data according to the plurality of key coordinate points and the generation time of each key coordinate point, and writes the coordinate data into a frame cache of the system mainboard.
In this embodiment, the reading module receives and reads the handwriting data to obtain all handwriting coordinate points of the handwriting data, in order to improve response time of handwriting processing, the handwriting coordinate points are filtered to obtain key coordinate points, processing time consumption is reduced by reducing the number of the handwriting coordinate points, specifically, the handwriting coordinate points are sorted according to generation time of the handwriting coordinate points, the number of the remaining handwriting coordinate points is calculated and compared with a preset number, if the number of the handwriting coordinate points is greater than the preset number, half of the handwriting coordinate points are selected and removed in an interval selection mode, then the number of the remaining handwriting coordinate points is calculated, and if the number of the remaining handwriting coordinate points is greater than the preset number, half of the handwriting coordinate points are removed in an interval selection mode, until the number of the remaining handwriting coordinate points is smaller than the preset number, taking the last remaining handwriting coordinate points as key coordinate points; obtaining coordinate data of the handwriting data according to the key coordinate points and the generation time of each key coordinate point, wherein the data volume of the coordinate data is greatly reduced, and the transmission speed is effectively improved; finally, writing the coordinate data into a frame cache of the system mainboard; in the step, the time consumed for processing the handwriting data from the reading module and writing the handwriting data into the frame buffer of the system mainboard is 8-10 ms.
It should be noted that, in the embodiment, the number of the handwriting coordinate points of each piece of handwriting data is controlled by setting the preset number; specifically, when the handwriting track is long and the number of generated handwriting coordinate points is large, the handwriting characteristics cannot be lost by removing the number of the handwriting coordinate points for many times, and when the handwriting track is short and the number of generated handwriting coordinate points is small, the removed number is relatively small, and the lost handwriting characteristics are also avoided.
And S103, generating a handwriting picture according to the coordinate data, displaying the handwriting picture on a display screen, and synchronously sending the handwriting picture to a storage area through an application program.
Specifically, as shown in fig. 3, the step S103 includes:
s301, reading the coordinate data from the frame buffer, acquiring the key coordinate points and the generation time of each key coordinate point from the coordinate data, connecting the key coordinate points according to the generation time sequence to form a handwriting picture corresponding to the coordinate data, and displaying the handwriting picture on a display screen;
and S302, synchronously sending the handwriting picture to a storage area through an application program.
In this embodiment, the frame buffer is a virtual buffer created in the Linux system, and is a direct image of a picture displayed on a screen, each storage unit of the frame buffer corresponds to a key coordinate point pixel on the screen, and after connecting the key coordinate points according to a generation time sequence, a handwriting picture corresponding to the coordinate data can be formed in the frame buffer and displayed on the display screen.
And after the handwriting picture is displayed on the display screen, the handwriting picture is sent to a storage area by the application program to be stored.
In one embodiment, the displaying on the display screen includes:
and sending the handwriting picture to the display screen through a bus, and displaying the handwriting picture on a screen of the display screen.
In this embodiment, an interface connected to the frame buffer is disposed on the display screen, and the display screen is connected to the frame buffer through a bus, that is, the handwriting picture is sent to the display screen through the bus, and is controlled and displayed on the screen of the display screen by a Linux system.
In an embodiment, the sending the handwriting picture to the display screen through a bus and displaying the handwriting picture on a screen of the display screen includes:
and displaying the handwriting picture on the display screen in a vertical synchronization mode.
In this embodiment, the handwriting picture is scanned in the vertical synchronization mode to generate a vertical synchronization signal, and the vertical synchronization signal is sent to the picture processing module, so that the picture processing module is restricted by the vertical synchronization signal when processing the handwriting picture, thereby preventing the picture from being torn when displaying the handwriting picture, and better displaying the handwriting picture; the process of reading from the frame buffer and displaying on the display screen in this step takes about 12 ms.
In an embodiment, the reading module is in communication with the frame buffer, and the frame buffer is created through an android surface window.
In this embodiment, the reading module is in communication with the frame buffer so that the handwriting data can be stably transmitted; the frame cache can be created and managed through the android surface window, and the frame cache can stably store the handwriting data.
The embodiment of the invention also provides a handwriting data processing system, which is used for executing any embodiment of the handwriting data processing method. Specifically, referring to fig. 4, fig. 4 is a schematic block diagram of a handwriting data processing system according to an embodiment of the present invention.
As shown in FIG. 4, a handwriting data processing system 400, comprising: the touch panel system comprises a touch panel 401, a system main board 402 and a display screen 403, wherein the system main board 402 comprises a reading module 4021, a frame cache 4022, an application program 4023 and a storage area 4024;
the touch panel 401 is used for receiving handwriting data written by a user and sending the handwriting data to a reading module of the system mainboard;
the reading module 4021 is configured to read the handwriting data and obtain coordinate data, and write the coordinate data into a frame buffer 4022 of the system motherboard;
and generating a handwriting picture according to the coordinate data, displaying the handwriting picture on a display screen, and synchronously sending the handwriting picture to the storage area 4024 through the application program 4023.
The system shortens the steps of handwriting data processing, so that the process from operation to display of the handwriting is faster, the time consumption in the total processing process is only about 40ms, and the system has the advantage of reducing the delay sense during handwriting.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
The handwriting data processing system described above may be implemented in the form of a computer program which may be run on a computer device as shown in figure 5.
Referring to fig. 5, fig. 5 is a schematic block diagram of a computer device according to an embodiment of the present invention. The computer device 500 is a server, and the server may be an independent server or a server cluster composed of a plurality of servers.
Referring to fig. 5, the computer device 500 includes a processor 502, memory, and a network interface 505 connected by a system bus 501, where the memory may include a non-volatile storage medium 503 and an internal memory 504.
The non-volatile storage medium 503 may store an operating system 5031 and a computer program 5032. The computer program 5032, when executed, may cause the processor 502 to perform a handwriting data processing method.
The processor 502 is used to provide computing and control capabilities that support the operation of the overall computer device 500.
The internal memory 504 provides an environment for the execution of the computer program 5032 in the non-volatile storage medium 503, and when the computer program 5032 is executed by the processor 502, the processor 502 can be caused to execute the handwriting data processing method.
The network interface 505 is used for network communication, such as providing transmission of data information. Those skilled in the art will appreciate that the configuration shown in fig. 5 is a block diagram of only a portion of the configuration associated with aspects of the present invention and is not intended to limit the computing device 500 to which aspects of the present invention may be applied, and that a particular computing device 500 may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
Those skilled in the art will appreciate that the embodiment of a computer device illustrated in fig. 5 does not constitute a limitation on the specific construction of the computer device, and that in other embodiments a computer device may include more or fewer components than those illustrated, or some components may be combined, or a different arrangement of components. For example, in some embodiments, the computer device may only include a memory and a processor, and in such embodiments, the structures and functions of the memory and the processor are consistent with those of the embodiment shown in fig. 5, and are not described herein again.
It should be understood that, in the embodiment of the present invention, the Processor 502 may be a Central Processing Unit (CPU), and the Processor 502 may also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, and the like. Wherein a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
In another embodiment of the invention, a computer-readable storage medium is provided. The computer readable storage medium may be a non-volatile computer readable storage medium. The computer-readable storage medium stores a computer program, wherein the computer program implements the handwriting data processing method of the embodiment of the invention when executed by the processor.
The storage medium is an entity and non-transitory storage medium, and may be various entity storage media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-only memory (ROM), a magnetic disk, or an optical disk.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described apparatuses, devices and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
While the invention has been described with reference to specific embodiments, the invention is not limited thereto, and various equivalent modifications and substitutions can be easily made by those skilled in the art within the technical scope of the invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.