Embodiment
For making the purpose, technical solutions and advantages of the present invention clearer, the embodiment of the invention is described in further details below in conjunction with accompanying drawing.At this, illustrative examples of the present invention and explanation thereof are used to explain the present invention, but not as a limitation of the invention.
Fig. 1 is the flow chart based on the LED lamp light control method of touch-screen of the embodiment of the invention.As shown in the figure, the LED lamp light control method based on touch-screen may further comprise the steps:
Step S101 sets up the touch track information of touch-screen and the mapping relations of LED light driver.In the present embodiment, touch track is meant that the user touches tracks such as draw perpendicular, horizontal stroke, point, triangle, circle, semicircle, square frame, letter on touch-screen, can be that the user draws with pointing to touch on touch-screen, or the user touch a stroke formation touch track with felt pen on touch-screen.In the present embodiment, touch track is defined as follows: if in setting-up time, the user does not have the pressure action to touch-screen, and then preserving the track of this moment is touch track.As can specifying in 3 seconds, the user no longer continues to click or drag on touch-screen, and the track that form this moment is the touch track of user by exerting pressure on touch-screen and forming in the step for this reason.Certainly the time was not restricted to for 3 seconds, and this time can be designed voluntarily according to user's the age level and the frequency of use touch-screen, also setting-up time can be set at 5 seconds or the like.Touch track is after the process analog-to-digital conversion, generate the digital signal of touch track, this digital signal is expressed as the form of character matrix in the present embodiment, for example, if the definition user is because the data input that pressure produces is 1, remaining is 0, can obtain one like this by 1 and 0 character matrix of forming.Certainly the invention is not restricted to this, also can set the numerical value in the character matrix according to the pressure size of user's input, for example can be made as is 0~10.Carrying out to utilize high speed analog-to-digital conversion ADC (Analog Digital Convertor) sampler analog-to-digital the time.Behind the character matrix that obtains the touch track correspondence, calculate the characteristic value of character matrix, this characteristic value can be one dimension or N dimension, the mapping relations of characteristic value and LED light driver are set up, therefore then in N 〉=2, in the present embodiment, touch track information can be the characteristic value information of touch track.So in this step, the mapping relations of setting up touch track information and LED light driver promptly can be the characteristic value of setting up touch track and the mapping relations of LED light driver.
Step S102, the detection user is applied to the touch track on the touch-screen, generates touch track information.When the user uses touch-screen, on touch-screen, touch and mark touch track, after track is determined, can touch track be converted to digital signal according to high speed analog-to-digital conversion ADC sampler, digital signal shows as character matrix in the present embodiment.Among this embodiment, can adopt the method for described character matrix being carried out singular value decomposition, thereby obtain its characteristic value, singular value decomposition method is the most reliable a kind of orthogonal matrix analytic approach, at first provides the definition of singular value decomposition below:
The singular value decomposition theorem of matrix: establishing A is m*n rank complex matrix, then has m rank unitary matrix U and n rank unitary matrix V, makes:
A=U*S*V ', wherein S=diag (σ i, σ 2 ..., σ r), σ i>0, (i=1 ..., r), r=rank (A).
Singular value decomposition provides some information about A, and for example the number of non-zero singular value (exponent number of S) is identical with the order of A, in case order r determines that the preceding r row of U have constituted the orthogonal basis in the column vector space of A so.If the order n of A is non-vanishing, then matrix A has n non-zero root.
In the present embodiment, character matrix utilizes n non-zero root that singular value decomposition obtains to be the characteristic value of touch track.For having only a non-zero characteristics root, this non-zero characteristics root is the characteristic value of touch track, and this situation belongs to the one-dimensional characteristic value.
General, the order r of character matrix>1 promptly has plural non-zero root, and then character matrix has plural characteristic value, if this moment C=order A
TA then can obtain the characteristic vector that C ties up, and is [x
1, x
2X
c], among this embodiment, the characteristic value that obtains is the touch track information that touch track generates.
Step S103 according to the touch track information that generates, calls corresponding LED light driver, control LED lighting effects.
Among this embodiment, when obtaining the user after the touch track that applies on the touch-screen, generate corresponding touch track information, in the present embodiment, touch track information is the characteristic value of touch track.After in step S102, calculating the characteristic value of resultant touch track, from the mapping relations of the touch track information of the touch-screen among step S101, set up and LED light driver, obtain pairing LED light driver, thus control LED lighting effects.In embodiments of the present invention, can adopt the Euclidean distance computing method, calculate the characteristic value of resulting touch track and the Euclidean distance between the characteristic value in the mapping relations, select Euclidean distance to do the LED light driver of little characteristic value correspondence, thus control LED lighting effects.The Euclidean distance computational methods are as follows:
Calculate
Find and calculate the immediate characteristic value data that is stored in the mapping relations of characteristic value of the touch track of gained, j wherein, l ∈ (1,2 ..., c), the Euclidean distance in ‖ ‖ representation feature space.Wherein, the y of above-mentioned middle upper right corner band j is certain the known LED light driver characteristic of correspondence value that is stored in the mapping relations, and y is the characteristic value of the touch track of the new input of user.
After carrying out the characteristic value comparison, get access to the LED light driver of the touch track correspondence of user's input, the variation of LED light driver driving LED light changes the size of electric current in the led circuit and the break-make of circuit, thereby realizes different LED lighting effects.
Fig. 2 is the structural representation of the device that changes based on touch-screen control LED light of the embodiment of the invention.As shown in the figure, the device that changes based on touch-screen control LED light comprises:
Mapping relations memory cell 101 is used to set up and store the touch track information of touch-screen and the mapping relations of LED light driver.In the present embodiment, touch track is meant that the user touches tracks such as draw perpendicular, horizontal stroke, point, triangle, circle, semicircle, square frame, letter on touch-screen, can be that the user draws with pointing to touch on touch-screen, or the user touch a stroke formation touch track with felt pen on touch-screen.In the present embodiment, touch track information can be the characteristic value information of touch track.So in this step, the mapping relations of setting up touch track information and LED light driver promptly can be the characteristic value of setting up touch track and the mapping relations of LED light driver.Among this embodiment, mapping relations memory cell 101 is ROM.
Touch track information generating unit 102 is used to detect the user and is applied to touch track on the touch-screen, generates touch track information.When the user uses touch-screen, on touch-screen, touch and mark touch track, after track is determined, can touch track be converted to digital signal according to high speed analog-to-digital conversion ADC sampler, digital signal shows as character matrix in the present embodiment.Among this embodiment, can adopt the method for described character matrix being carried out singular value decomposition, thereby obtain its characteristic value.Among this embodiment, the characteristic value that obtains is the touch track information that touch track generates.
LED light control unit 103 is used for calling corresponding LED light driver according to the touch track information that generates, control LED lighting effects.After above-mentioned touch track information generates, promptly generate after the touch track characteristic of correspondence value and the mapping relations of touch track information in the mapping relations memory cell 101 and LED light driver in characteristic value compare.Comparison method can adopt the Euclidean distance computing method, the distance of all characteristic values in calculating and the mapping relations, select the LED light driver of that stack features value correspondence of Euclidean distance minimum, the variation of LED light driver driving LED light, change the size of electric current in the led circuit and the break-make of circuit, thereby realize different LED lighting effects.
Fig. 3 carries out the schematic diagram of the portable terminal of LED light control for the embodiment of the invention based on touch-screen.As shown in the figure, this portable terminal comprises:
Touch-screen 10 is used for the user and imports touch track.In the present embodiment, touch track is meant that the user touches tracks such as draw perpendicular, horizontal stroke, point, triangle, circle, semicircle, square frame, letter on touch-screen, can be that the user touches on touch-screen with finger and draws, or the user touches a stroke formation with felt pen on touch-screen.
LED equipment 20 is arranged on the described portable terminal, is used for showing the LED lighting effects.LED equipment 20 can be arranged on around the touch-screen of portable terminal, a as shown in Figure 3, and b, c, d, e, f, g, the h lamp also can be arranged on the top or the bottom of portable terminal, but the invention is not restricted to this.
LED control appliance 30 is used for being applied to touch track on the described touch-screen according to the user, and the light of controlling described LED equipment changes.In the present embodiment, the LED control appliance comprises: the mapping relations memory cell is used to set up and store the touch track information of touch-screen and the mapping relations of LED light driver; The touch track information generating unit is used to detect the user and is applied to touch track on the touch-screen, generates touch track information; The LED light control unit is used for calling corresponding LED light driver according to the touch track information that generates, control LED lighting effects.
Embodiment one:
Step 1: the touch track that the user applies on touch screen is a square square frame as shown in Figure 4.
Step 2: by high speed analog-to-digital conversion ADC sampler the conversion of the touch track obtained is formed touch track information, in the present embodiment, form a character matrix and be:
Step 3: above-mentioned character matrix is carried out singular value decomposition, obtain:
Order A
TA=1, promptly A has a nonzero eigenvalue, and calculating can get, and the root of A is a1=2, and a2=0 is so the nonzero eigenvalue of A is 2; So far, the characteristic value that obtains the character matrix of this square-shaped frame track correspondence is that an one-dimensional vector value is 2.
Step 4: as shown in Figure 5, be the characteristic value of storing in the mapping relations memory cell in the present embodiment and the mapping relations table of LED light control program.Adopt Euclidean distance method,
Calculate Euclidean distance with each characteristic.Therefore because characteristic value is an one dimension, select that the one-dimensional characteristic value compares in the corresponding relation.Get according to the Euclidean distance computing formula:
Be minimum value, then call the corresponding LED light driver " light changes from weak to strong " of characteristic value " 2 " institute, the electric current power in the control led circuit, thereby control lighting effects.
Embodiment two:
General, by the touch track information that touch track obtains, promptly therefore the non-zero characteristics root of Dui Ying character matrix can obtain the characteristic value of C dimension all more than or equal to two.
Step 1: the touch track that the user applies on touch screen as shown in Figure 6, is similar " M " shape.
Step 2: after obtaining touch track by high speed analog-to-digital conversion ADC sampler, obtain touch track information, in the present embodiment, the character matrix of formation is:
Step 3: above-mentioned character matrix is carried out singular value decomposition, obtain: order A
TA=3, promptly A has 3 nonzero eigenvalues, and calculating can get, and the root of A is a1=2,
A3=8, so far, the characteristic value that obtains these touch track data be a three-dimensional vector value be [2,
, 8].
Step 4: inquire about the characteristic value of storing in the mapping relations memory cell of present embodiment shown in Figure 5 and the mapping table of LED light control program.Adopt Euclidean distance method,
Calculate Euclidean distance with each characteristic.Because characteristic value is three-dimensional, select therefore that the three-dimensional feature value compares in the corresponding relation.Get according to the Euclidean distance computing formula:
……
Utilizing Euclidean distance to obtain minimum value is 0.236, then call the corresponding LED light driver of characteristic value " 2,2,8 " institute " the green alternately flicker of light color reddish yellow ", the light on and off and the electric current power of the LED modules with different colors lamp in the control led circuit, thereby control lighting effects.
Certainly, in embodiments of the present invention, the threshold value of LED light work can be set also.In embodiment two, the Euclidean distance minimum value of calculating gained is 0.236, if threshold value is set to 0.500, then minimum value does not exceed set threshold value, can driving LED light control program, if threshold value is made as 0.200, exceed set threshold value this moment, then LED light is not done any variation, and the prompting user re-enters or refuse identification.The numerical value of threshold value can be determined according to the statistics experience that equipment test obtains.For example, import 10 times in " mouth ", carry out the characteristic value that singular value calculates 10 " mouths ", do Euclidean distance with the characteristic value of " mouth " that prestore respectively and calculate, to do mean value calculation after 10 distance value additions that obtain, the mean value that obtains is the numerical value of the threshold value that prestores.
Embodiment three:
In embodiment three, the two-layer corresponding relation of storage can be set in the mapping relations memory cell: the one, the corresponding relation of the characteristic value of touch track and graph of a correspondence feature; The one, the corresponding relation of graphic feature and LED light driver.Need to prove that herein graphic feature and characteristic value are one to one, also can calculate by singular value decomposition method.As, calculate touch track " M ", its characteristic value is 2,2 and 8, then stores three-dimensional feature value [2,2,8] graph of a correspondence and is characterized as M.As shown in Figure 7, the two-layer corresponding relation for storing in the mapping relations memory cell shown in the embodiment three.Use the example of embodiment two to illustrate, step 3 obtain touch track as shown in Figure 6 characteristic value [2,

, 8] after, at first judge its graphic feature.As shown in Figure 7, the characteristic value of inquiry touch track and the corresponding relation of graph of a correspondence feature, utilize the Euclidean distance computing method equally, obtaining its graphic feature is M, then at the corresponding relation of inquiring about graphic feature and LED light driver, the LED light driver that obtains graphic feature M correspondence is " the green alternately flicker of light color reddish yellow ", the light on and off and the electric current power of the LED modules with different colors lamp in the control led circuit, thereby control lighting effects.
Among this embodiment, adding graphic feature, form two-layer corresponding relation, is to make corresponding relation brighter and clearer, but has but increased the time of portable terminal reaction.
By implementing above-described method, device and the portable terminal that the present invention is based on the LED light control of touch-screen, can user's health check-up and interest have been strengthened with comprising the hommization more and the interest and appeal of the design of electronic products with touch-screen of mobile phone.
Above-described specific embodiment; purpose of the present invention, technical scheme and beneficial effect are further described; institute is understood that; the above only is specific embodiments of the invention; and be not intended to limit the scope of the invention; within the spirit and principles in the present invention all, any modification of being made, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.