Disclosure of Invention
The invention provides a multi-system multi-display area touch data distribution method and device, and aims to overcome the defects in the prior art and realize automatic distribution of multi-system multi-reality area touch data.
In order to achieve the above purpose, the technical scheme adopted by the invention is as follows:
In one aspect, the present invention provides a method for distributing touch data in multiple systems and multiple display areas, including:
step 1, obtaining display area distribution information;
Step 2, generating matched touch area matching information according to the display area distribution information;
step 3, receiving touch operation, and identifying touch positions and the number of touch points;
Step 4, determining a touch area where the touch occurs according to the touch position;
Step 5, determining a target receiving operation system of the touch parameter according to the corresponding relation between the touch area and the operation system to which the touch area belongs in the touch area matching information;
And step 6, sending the touch parameters to a target receiving operation system for processing.
Specifically, the specific method for identifying the touch position in the step 3 includes:
Step 3-A1, acquiring a current touch data frame, and determining a capacitance value change peak value in the current touch data frame;
step 3-A2, determining a historical threshold average value of touch data of a preset frame number before the current touch data frame;
Step 3-A3, determining a current threshold value of the current touch data frame according to the capacitance value variation peak value and the historical threshold value average value;
Step 3-A4, determining a capacitance value change value higher than the current threshold value in the current touch data frame as pending touch data;
Step 3-A5, calculating a pending touch coordinate point corresponding to the pending touch data, and sequentially connecting the pending touch coordinate points to obtain a pending touch polygon;
step 3-A6, randomly selecting a reference point in the to-be-determined touch polygon, and connecting the reference point with the to-be-determined touch coordinate points to obtain internal division triangles with the same number as the to-be-determined touch coordinate points;
step 3-A7, determining the center point of each internal division triangle;
Step 3-A8, calculating each vector from the reference point to the center point of each internal division triangle and the sum of each vector;
step 3-A9, calculating the area of each inner division triangle;
step 3-A10, calculating the sum of vector products of the pending touch polygons according to the areas of the internal division triangles and the vectors;
and 3-A11, calculating a center position vector of the pending touch polygon according to the sum of vector products of the pending touch polygon and the sum of vectors.
Specifically, the historical threshold average Tn (avg) = [ T (-1) +t (-2) + … +t (-n) ]/n, where T (-i) (i=1, 2,3 … n) represents the threshold of the i-th frame before the current touch data frame.
Specifically, the current threshold=max { k×Δcmax, tn (avg) }, where max { indicates taking the larger of the two, and Δcmax indicates the peak of the capacitance value change in the current touch data frame.
Specifically, the sum of vector products m=l1×s1+l2×s2+ … +lm×sm, where S1, S2 … Sm represents the area of each inner triangle, and L1, L2 … Lm represent the vector from the reference point to the center point of each inner triangle.
Specifically, the center position vector l0=m/(l1+l2+ … Lm).
Specifically, the specific method for identifying the number of touch points in the step 3 includes:
step 3-B1, when the number of touch points is greater than 1, acquiring the time when each touch point is generated;
step 3-B2, determining a first acceleration set of adjacent touch points in the touch points in corresponding time;
Step 3-B3, acquiring the lateral acceleration and the longitudinal acceleration of the vehicle in the same time as the corresponding time, and calculating the comprehensive acceleration of the vehicle;
step 3-B4, judging whether the first acceleration set has judging data identical to the comprehensive acceleration of the vehicle, if so, determining a touch endpoint corresponding to the judging data;
and 3-B5, judging the lower endpoint in the touch endpoints as an invalid touch point.
The invention further provides a multi-system multi-display area touch data distribution device which comprises a touch screen, a touch position determining module, a touch area determining module, a receiving determining module and a parameter sending module which are connected in sequence, wherein the touch area determining module and the receiving determining module are also connected with a touch configuration generating module, and the touch configuration generating module is also connected with a display configuration acquiring module;
The touch screen is used for sensing the touch of a user and generating touch electric signals;
the touch position determining module is used for reading an electric signal generated when the touch screen touches and determining the touch position and the number of touch points;
The touch area determining module is used for determining an area generated by touch according to the touch position;
The receiving determining module is used for determining a target receiving operating system of the touch parameters according to the corresponding relation between the touch area and the operating system of the touch area matching information;
the parameter sending module is used for sending the touch parameters to the target receiving operation system;
the display configuration acquisition module is used for acquiring the distribution information of the display area;
The touch configuration generation module is used for generating matched touch area matching information according to the display area distribution information.
The invention has the beneficial effects that: according to the method and the device, the matched touch area matching information is generated according to the display area distribution information, the touch positions and the number of touch points are identified, so that the touch area where the touch occurs is determined, the target receiving operation system of the touch parameters is determined according to the corresponding relation between the touch area and the operation system to which the touch area matching information belongs, and then the touch parameters are sent to the target receiving operation system for processing, and the automatic distribution of the multi-system multi-reality area touch data is realized.
Detailed Description
Embodiments of the present invention will now be described in detail with reference to the accompanying drawings, which are for reference and illustration only, and are not intended to limit the scope of the invention.
Example 1
As shown in fig. 1, the present embodiment provides a multi-system multi-display area touch data allocation method, including:
And step 1, acquiring display area distribution information.
In this embodiment, the display areas are at least two display areas on the same display screen, and the at least two display areas display images sent by different operating systems. For example, 2 display areas are distributed on the display screen a: display area 1, display area 2. The display area 1 displays contents related to automobile instruments such as engine speed transmitted by the QNX operating system, and the display area 2 displays contents related to multimedia such as song names transmitted by the android operating system.
The display area distribution information comprises the number, the starting coordinate and the ending coordinate of each display area and an operating system to which each display area belongs.
And 2, generating matched touch area matching information according to the display area distribution information.
And the touch area matching information also comprises the number, the starting coordinate, the ending coordinate and the affiliated operating system of each touch area corresponding to the display area distribution information. In this embodiment, the number, the start coordinate, the end coordinate, and the operating system to which each touch area belongs are completely identical to the number, the start coordinate, the end coordinate, and the operating system to which each display area belongs.
And step 3, receiving touch operation, and identifying touch positions and the number of touch points.
When a user performs clicking or sliding operations on the touch screen, the touch screen senses the operations of the user, generates corresponding electric signals, and then performs recognition of touch positions and the number of touch points by corresponding modules.
And 4, determining a touch area where the touch occurs according to the touch position.
The receiving channels correspond to the operating systems, for example, a first receiving channel corresponds to a first operating system QNX and a second receiving channel corresponds to a second operating system android.
And step 5, determining a target receiving operation system of the touch parameters according to the corresponding relation between the touch area and the operation system to which the touch area belongs in the touch area matching information.
And step 6, sending the touch parameters to a target receiving operation system for processing.
Example 2
Unlike embodiment 1, this embodiment provides a specific method for identifying a touch location described in step 3 of embodiment 1, including:
And step 3-A1, acquiring a current touch data frame, and determining a capacitance value change peak value in the current touch data frame.
When a user clicks on the touch screen, the capacitance value of the area with the touch point as the center changes like a mountain, and the mountain is the capacitance value change peak value delta Cmax.
And 3-A2, determining a historical threshold average value of touch data of a preset frame number before the current touch data frame.
In this embodiment, the historical threshold average Tn (avg) = [ T (-1) +t (-2) + … +t (-n) ]/n, where T (-i) (i=1, 2,3 … n) represents the threshold of the i-th frame before the current touch data frame.
And 3-A3, determining the current threshold value of the current touch data frame according to the capacitance value variation peak value and the historical threshold value average value.
In this embodiment, the current threshold=max { k×Δcmax, tn (avg) }, where max { is the larger of the two, and k=0.2 to 0.5 may be obtained by calibration of experimental effects.
And step 3-A4, determining a capacitance value change value higher than the current threshold value in the current touch data frame as pending touch data.
And 3-A5, calculating the undetermined touch coordinate points corresponding to the undetermined touch data, and sequentially connecting the undetermined touch coordinate points to obtain undetermined touch polygons.
As shown in fig. 2, P1 and P2 … P6 are pending touch coordinate points corresponding to pending touch data, and these points are first connected to obtain a touch polygon P1P2P3P4P5P6.
And 3-A6, randomly selecting a reference point in the to-be-determined touch polygon, and connecting the reference point with the to-be-determined touch coordinate points to obtain internal division triangles with the same number as the to-be-determined touch coordinate points.
As shown in fig. 2, the Q point is any point in the touch polygon P1P2P3P4P5P6, and the Q point is connected to P1, P2, and P3 … P6 to obtain 6 inner triangle types QP1P2 and QP2P3 … QP6P 1.
And 3-A7, determining the center point of each internal division triangle.
As shown in fig. 2, O1, O2 … O6 are the center points of the inner partition triangles QP1P2, QP2P3 … QP6P1, respectively.
Step 3-A8, calculating each vector from the reference point to the center point of each inner division triangle, and the sum of each vector.
As shown in fig. 2, QO1, QO2 … QO6 are vectors L1, L2 … L6 from the reference point to the center point of each of the inner triangle.
And step 3-A9, calculating the area of each inner division triangle.
And 3-A10, calculating the sum of vector products of the pending touch polygons according to the areas of the internal division triangles and the vectors.
In this embodiment, the sum of vector products m=l1×s1+l2×s2+ … +lm×sm, where S1, S2 … Sm represents the area of each inner triangle, and L1, L2 … Lm represent the vector from the reference point to the center point of each inner triangle.
And 3-A11, calculating a center position vector of the pending touch polygon according to the sum of vector products of the pending touch polygon and the sum of vectors.
In the present embodiment, the center position vector l0=m/(l1+l2+ … Lm).
The position corresponding to the central position vector is the central point of the touch position.
Example 3
Unlike embodiment 1, this embodiment provides a specific method for identifying the number of touch points described in step 3 of embodiment 1, including:
and step 3-B1, when the number of the touch points is greater than 1, acquiring the time when each touch point is generated.
For example, the time at which the touch point P (1) is generated corresponds to t (1), the time at which P (2) is generated corresponds to t (2), and so on.
And 3-B2, determining a first acceleration set of adjacent touch points in the touch points in corresponding moments.
For example, the first acceleration corresponding to the touch points P (1) and P (2) in t (1) and t (2) is a1 (1), and the first acceleration corresponding to the touch points P (k) and P (k+1) (k=1, 2 … i-1) in the corresponding time instants t (k) and t (k+1) is a1 (k).
And 3-B3, acquiring the lateral acceleration and the longitudinal acceleration of the vehicle in the same time as the corresponding time, and calculating the comprehensive acceleration of the vehicle.
In the present embodiment, a2 (k) =a2h (k) +a2v (k), where a2h (k) represents the vehicle lateral acceleration, a2v (k) represents the vehicle longitudinal acceleration, and a2 (k) represents the vehicle integrated acceleration.
And 3-B4, judging whether the first acceleration set has the same judging data as the comprehensive acceleration of the vehicle, and if so, determining a touch endpoint corresponding to the judging data.
For example, if the determination data is a (q) (1.ltoreq.q.ltoreq.i-1, the following is the same), the touch end points corresponding to a (q) are P (q), P (q+1), where P (q) is the upper end point and P (q+1) is the lower end point.
And 3-B5, judging the lower endpoint in the touch endpoints as an invalid touch point.
Example 4
As shown in fig. 3, the embodiment provides a multi-system multi-display area touch data distribution device, which comprises a touch screen, a touch position determining module, a touch area determining module, a receiving determining module and a parameter sending module which are sequentially connected, wherein the touch area determining module and the receiving determining module are also connected with a touch configuration generating module, and the touch configuration generating module is also connected with a display configuration obtaining module;
The touch screen is used for sensing the touch of a user and generating touch electric signals;
the touch position determining module is used for reading an electric signal generated when the touch screen touches and determining the touch position and the number of touch points;
The touch area determining module is used for determining an area generated by touch according to the touch position;
The receiving determining module is used for determining a target receiving operating system of the touch parameters according to the corresponding relation between the touch area and the operating system of the touch area matching information;
the parameter sending module is used for sending the touch parameters to the target receiving operation system;
the display configuration acquisition module is used for acquiring the distribution information of the display area;
The touch configuration generation module is used for generating matched touch area matching information according to the display area distribution information.
The working process of the multi-system multi-display area touch data distribution device in this embodiment is shown in the multi-system multi-display area touch data distribution method in embodiment 1, and is not described herein.
The above disclosure is illustrative of the preferred embodiments of the present invention and should not be construed as limiting the scope of the invention, which is defined by the appended claims.