Operation method of touch screen in terminal equipment and equipment
By writing drivers and performing data filtering, the problem of inconvenient USB touch screen operation in VxWorks/Dao/Ruihua system is solved, the accuracy and stability of touch operation are improved, and the system reliability is enhanced.
Patent Information
- Application Number
- CN202411968744.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-05-13
AI Technical Summary
The lack of USB touch screen driving, calibration and filtering methods in VxWorks/Dao/Ruihua system, resulting in the touch screen being prone to jitter, inaccurate touch, and other problems, which are inconvenient to operate.
By writing a driver, driving the touch screen based on the USB stack, and obtaining the original operation data during operation, filtering, denoising and coordinate transformation, and finally sending the processed data to the WindML layer, so that the GUI user layer responds to the touch operation.
It improves the accuracy and stability of touch operation, enhances the reliability of the entire system, and solves the inconvenience of operating the USB touch screen in VxWorks/Dao/Ruihua system.
Smart Images

Figure CN119987585A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer control, and in particular to an operation method and device of a touch screen in a terminal device. Background Art
[0002] As a device that integrates touch and computing, the touch terminal has an intuitive human-computer interaction method and is easy to carry and move. It has been widely used in various fields such as industrial automation, education, medical treatment, exhibitions, etc. In recent years, it has also been used in military fields such as ships / aviation / aerospace that require high reliability.
[0003] VxWorks / Dao / Ruihua systems are real-time operating systems launched by Wind River, Beijing Keyin Jingcheng Technology Co., Ltd., and 32 Institute, respectively. They are widely used in fields with high real-time requirements such as communications, military, aviation, and aerospace. WindML is a multimedia library under VxWorks / Dao / Ruihua and other operating systems. As an intermediate layer, it can provide users with basic image, video, and audio technologies. Based on this intermediate layer, QT / tilcon and other interface development programs can directly carry out cross-platform development without interacting with the underlying operating system.
[0004] Currently, VxWorks / Dao / Ruihua systems do not provide drivers, calibration, or filtering methods that support USB touch screens. Due to the influence of electromagnetic noise and interference, the touch screen is prone to problems such as jitter and inaccurate touch, which makes the touch screen inconvenient to operate. Summary of the invention
[0005] In order to solve the technical problem of inconvenient USB touch screen operation in the current VxWorks / Dao / Ruihua system, the present invention provides a method and device for operating a touch screen in a terminal device, which can enable an application running on a touch terminal to respond to the touch operation of the touch screen, while improving the accuracy and stability of the touch operation, thereby improving the reliability of the entire system.
[0006] In order to achieve the above technical purpose, the technical solution of the present invention is:
[0007] A method for operating a touch screen in a terminal device comprises the following steps:
[0008] Step 1, writing a driver for driving the touch screen based on the connection protocol stack of the touch screen, so that the driver is loaded after the system is started to drive the touch screen;
[0009] Step 2: When the touch screen is operated, the driver obtains the original operation data of the touch screen, and filters, denoises and coordinates the data based on the filtering mode, and then sends the processed data to the WindML layer;
[0010] In step 3, the WindML layer uses the touch screen as an input device and submits the data processed in step 2 to the GUI user layer in the form of screen coordinates and touch status, so that the GUI user layer responds to the corresponding touch operation.
[0011] In the method, in step 1, the connection protocol stack of the touch screen is a USB stack.
[0012] In the method, in step 1, the driver includes a function for driving the touch screen registered with the I / O file system layer, and the function includes an open function, a close function, a read function and a control function respectively used to open, close, read and control the touch screen; wherein the open function also includes an interrupt callback function registered with the USB stack.
[0013] The method and the interrupt callback function described are that when the touch screen receives an interrupt signal generated by a touch operation and sends it to the main processing board, the operating system running on the main processing board calls the interrupt callback function to identify and process the interrupt signal, and converts it into touch data to store in the driver buffer for temporary storage and subsequent processing.
[0014] The method described, in step 2, after the driver obtains the original operation data of the touch screen, also includes the step of determining whether it is currently in calibration mode or filtering mode; when in calibration mode, calibration is performed according to the five-point method, and the coordinate transformation value obtained by calibration is saved.
[0015] The method, the five-point calibration comprises:
[0016] The calibration interface is constructed through the WindML layer. The calibration interface displays five points on the touch screen, including the upper left corner, upper right corner, lower right corner, lower left corner and the center of the screen. When the user touches these five points, the actual sampled raw touch data of each point is obtained, and after coordinate transformation, the coordinate values of the three X directions of left, middle and right, the coordinate values of the three Y directions of top, middle and bottom, as well as the scaling value and the screen resolution value are obtained as the coordinate transformation values of the coordinate transformation in the filtering mode.
[0017] In the method, in step 2, the filtering process of the filtering mode includes:
[0018] When data jump occurs, that is, data changes significantly, the data after a delay of one sampling interval is checked. When the data recovers, it is considered that data abnormality occurs. When the data keeps changing significantly, it is considered that the touch position moves rapidly.
[0019] A touch screen device in a terminal device, used to implement the above method, comprising: a main processing board, a liquid crystal screen, a touch screen, a touch screen control module, a storage unit and a power supply;
[0020] The touch screen control module obtains the touch information of the touch screen, and then sends the touch information data to the main processing board via the USB interface; the main processing board processes the data; the LCD screen is used to receive the display output data sent by the main processing board and display it; the storage unit is used to store data including operating system files; the power supply is electrically connected to the main processing board and provides power.
[0021] In the touch screen device in the terminal device, the touch screen control module obtains touch information of the touch screen, including touch status information of pressing and lifting and touch position information.
[0022] In the touch screen device in the terminal device, an operating system runs on the main processing board, and performs operations including touch screen driving, calibration and filtering.
[0023] The technical effect of the present invention is that the present invention can solve the driving, calibration and filtering problems of the USB touch screen of the touch terminal under real-time operating systems such as VxWorks / Dao / Ruihua, and improve the reliability of the touch terminal equipment by improving the accuracy and stability of the touch screen data. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 It is a structural block diagram of the touch screen device of the present invention. DETAILED DESCRIPTION
[0025] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments.
[0026] The present embodiment provides a method for operating a touch screen in a terminal device, comprising the following steps:
[0027] Step 1, based on the connection protocol stack of the touch screen, a driver for driving the touch screen is written, so that the driver is loaded after the system is started to drive the touch screen. The connection protocol stack of the touch screen is a USB stack. The driver includes a function for driving the touch screen registered with the I / O file system layer, and the function includes an open function, a close function, a read function and a control function for opening, closing, reading and controlling the touch screen respectively; wherein the open function also includes an interrupt callback function registered with the USB stack. The interrupt callback function is when the touch screen receives an interrupt signal generated by a touch operation and sends it to the main processing board, the operating system running on the main processing board calls the interrupt callback function to identify and process the interrupt signal, and converts it into touch data to store in the driver buffer for temporary storage and subsequent processing. In this step, based on the USB stack, the device open, close, read and control functions are registered with the I / O file system layer, and in the open function, the interrupt callback function is registered with the USB stack. When a USB host controller receives data, the function is called back to store the data in the driver buffer.
[0028] Step 2, when the touch screen is operated, the driver obtains the original operation data of the touch screen, and then determines whether it is currently in calibration mode or filtering mode. When it is in calibration mode, the calibration is performed according to the five-point method, and the coordinate transformation value obtained by the calibration is saved. The five-point method calibration is to build a calibration interface through the WindML layer. The calibration interface displays five points on the touch screen, including the upper left corner, upper right corner, lower right corner, lower left corner and the middle of the screen. When the user touches these five points, the actual sampled original touch data of each point is obtained, and after coordinate transformation, the coordinate values of the three X directions of left, middle and right, the coordinate values of the three Y directions of top, middle and bottom, as well as the scaling value and the screen resolution value are obtained as the coordinate transformation values of the coordinate transformation in the filtering mode.
[0029] When in filtering mode, the data is filtered, denoised and coordinate transformed, and the processed data is sent to the WindML layer. Filtering means that when there is a data jump, that is, a large change in the data, the data after a delay of one sampling interval is checked. When the data is restored, it is considered that the data is abnormal. When the data keeps changing significantly, it is considered that the touch position has moved rapidly. In filtering mode, the data is first taken out from the driver buffer, and the data is filtered (variance)-denoised (dejitter)-coordinate transformed (linear). For some touch screens with rough sampling and touch point jumps caused by electrical noise interference, the sampling data of a suspicious point is judged as abnormal or a rapid movement of the touch position by delaying one sampling interval, thereby reducing the probability of sampling point jumps; then a smoothing filter is used to remove noise data; finally, the coordinate data for calibration is read from the hard disk file, and the touch data is converted into screen coordinate data by coordinate transformation, and submitted to the WindML layer;
[0030] Step 3: The WindML layer uses the touch screen as an input device and submits the data processed in step 2 to the GUI user layer in the form of screen coordinates and touch status, so that the GUI user layer responds to the corresponding touch operation. In this step, a new WindML configuration file is first created, and the device loaded by the touch screen driver is used as the input device of WindML, which can be displayed and selected in the WindML configuration interface.
[0031] usb2Ts.CREATE=uglUsb2TsDriver
[0032] usb2Ts.DEVNAME = / usb2Ts / 0
[0033] Among them, usb2TS.DEVNAME is used to specify the device name that can be selected in the windML configuration interface, corresponding to the device name registered by the touch screen driver to the system 1 / 0 layer. usb2TS.CREATE is used to specify that when the user selects the touch screen device as the input device in the WindML configuration interface, the corresponding structure of the WindML layer input device management is filled.
[0034] In the WindML driver source code, add the uglUsb2Ts.c file, in which the uglUsb2TsDriver structure is defined as follows:
[0035] UGL_INPUT_DRVuglUsb2TsDriver=
[0036] {
[0037] (UGL_INPUT_DEV_OPEN)uglUsb2TsOpen,
[0038] (UGL_INPUT_DEV_CLOSE)uglUsb2TsClose,
[0039] (UGL_INPUT_DEV_CONTROL)uglUsb2TsControl
[0040] };
[0041] The above structure is used to register the input device implementation function to the WindML layer. WindML implements the opening, closing, and control of the touch device by calling the functions in the structure. uglUsb2TsOpen initializes the filter function by calling the previous usb2TS.DEVNAME configuration function. uglUsb2TsControl provides an interface function for reading filtered data.
[0042] This embodiment also provides a touch screen device in a terminal device, including: a main processing board, a liquid crystal screen, a touch screen, a touch screen control module, a storage unit and a power supply;
[0043] The touch screen control module obtains the touch information of the touch screen, including the touch status information and touch position information of pressing and lifting, and then sends the touch information data to the main processing board via the USB interface; the VxWorks / Dao / Ruihua operating system running on the main processing board loads the driver, calibrates the touch screen and filters the data, and the filtered data is passed to the application layer by the WindML layer, so that any GUI user program can directly respond to the touch operation. The LCD screen is used to receive the display output data sent by the main processing board and display it; the storage unit is used to store data including operating system files; the power supply is electrically connected to the main processing board and provides power.
Claims
1. A method for operating a touch screen in a terminal device, characterized in that: The following steps are involved: Step 1, writing a driver for driving the touch screen based on the connection protocol stack of the touch screen, so that the driver is loaded after the system is started to drive the touch screen; Step 2: When the touch screen is operated, the driver obtains the original operation data of the touch screen, and filters, denoises and coordinates the data based on the filtering mode, and then sends the processed data to the WindML layer; In step 3, the WindML layer uses the touch screen as an input device and submits the data processed in step 2 to the GUI user layer in the form of screen coordinates and touch status, so that the GUI user layer responds to the corresponding touch operation.
2. The method according to claim 1, characterized in that In the step 1, the connection protocol stack of the touch screen is a USB stack.
3. The method according to claim 2, characterized in that In step 1, the driver includes a function for driving the touch screen registered with the I / O file system layer, and the function includes an open function, a close function, a read function and a control function respectively used to open, close, read and control the touch screen; wherein the open function also includes an interrupt callback function registered with the USB stack.
4. The method according to claim 3, characterized in that The interrupt callback function is that when the touch screen receives an interrupt signal generated by a touch operation and sends it to the main processing board, the operating system running on the main processing board calls the interrupt callback function to identify and process the interrupt signal, and converts it into touch data to store in the driver buffer for temporary storage and subsequent processing.
5. The method according to claim 3, characterized in that: In the step 2, after the driver obtains the original operation data of the touch screen, it also includes the step of determining whether the current mode is a calibration mode or a filtering mode; When in calibration mode, calibration is performed according to the five-point method, and the coordinate transformation values obtained by calibration are saved.
6. The method according to claim 5, characterized in that The five-point calibration method includes: The calibration interface is constructed through the WindML layer. The calibration interface displays five points on the touch screen, including the upper left corner, upper right corner, lower right corner, lower left corner and the center of the screen. When the user touches these five points, the actual sampled raw touch data of each point is obtained, and after coordinate transformation, the coordinate values of the three X directions of left, middle and right, the coordinate values of the three Y directions of top, middle and bottom, as well as the scaling value and the screen resolution value are obtained as the coordinate transformation values of the coordinate transformation in the filtering mode.
7. The method according to claim 5, characterized in that In the step 2, the filtering process of the filtering mode includes: When data jump occurs, that is, data changes significantly, the data after a delay of one sampling interval is checked. When the data recovers, it is considered that data abnormality occurs. When the data keeps changing significantly, it is considered that the touch position moves rapidly.
8. A touch screen device in a terminal device, characterized in that: Used to implement the method according to any one of claims 1 to 7, comprising: a main processing board, a liquid crystal screen, a touch screen, a touch screen control module, a storage unit and a power supply; The touch screen control module obtains the touch information of the touch screen, and then sends the touch information data to the main processing board via the USB interface; the main processing board processes the data; the LCD screen is used to receive the display output data sent by the main processing board and display it; the storage unit is used to store data including operating system files; the power supply is electrically connected to the main processing board and provides power.
9. The touch screen device in a terminal device according to claim 8, characterized in that: The touch screen control module obtains touch information of the touch screen, including touch state information of pressing and lifting and touch position information.
10. The touch screen device in a terminal device according to claim 8, characterized in that: The main processing board runs an operating system and performs operations including touch screen driving, calibration and filtering.