The recognition methods of subway gate barcode scanning and mobile terminal
Technical field
The invention belongs to field of mobile terminals more particularly to a kind of subway gate barcode scanning recognition methods and mobile terminals.
Background technique
Subway has become the main means of transport of people's trip.Passenger is into subway station or by gate from brush traffic
Card or traffic coin upgrade to brush mobile phone.Brush mobile phone enters the station usually, and there are two types of modes: the first is that mobile phone is required to have NFC (low coverage
From wireless communication technique) function, when entering the station, by mobile phone close to gate, the reader identification in gate is read on NFC user
Data, being verified rear user can enter the station;Second is that mobile phone is required to download App in advance, and when entering the station, user generates App
Two dimensional code be presented to gate, gate scanning can be entered the station by rear user.Since first way needs to carry out firmly mobile phone
Transformation on part, and the second way is only to need to mobile phone-downloaded App, institute applies when brush mobile phone enters the station in the second
Ground is more universal and extensive.
For using second way brush mobile phone to enter the station, how to allow gate rapidly to scan the two dimensional code on mobile phone, be
Influence the key of speed of entering the station.In the prior art, the two dimensional code size shown on mobile phone is fixed and invariable, mobile phone and gate
The distance between it is excessively close or can all influence too far gate whether can successful scan to two dimensional code, user needs voluntarily to adjust mobile phone
The distance between gate just can guarantee the success of scanning.The longer time is consumed when user voluntarily adjusts, and leads to user
It cannot quickly enter the station, even also will cause the stream of people's congestion when stream of people is big in standing.
Summary of the invention
The technical problem to be solved by the present invention is in order to overcome in the prior art user need voluntarily to adjust mobile phone and gate
The distance between just can guarantee the successful defect of scanning, a kind of subway gate barcode scanning recognition methods and mobile terminal are provided.
The present invention is to solve above-mentioned technical problem by the following technical programs:
The present invention provides a kind of subway gate barcode scanning recognition methods, and the subway gate barcode scanning recognition methods includes:
Detect the distance between mobile terminal and subway gate;
When the distance is greater than first threshold, amplify the size for the identification code that the mobile terminal is shown;
When the distance is less than second threshold, the size of the identification code is reduced;
The first threshold is greater than or equal to the second threshold.
Preferably, the subway gate barcode scanning recognition methods further include:
When the distance is greater than third threshold value, the bright screen of the mobile terminal is controlled;
When the distance is not more than the third threshold value, controls the mobile terminal and go out screen;
The third threshold value is less than the second threshold;
And/or when the distance is no more than the first threshold and is not less than the second threshold, keep the identification
The size constancy of code simultaneously controls the mobile terminal sending prompt, and the prompt includes voice prompting and/or vibration prompting, described
Prompt is for informing that distance described in user is the scannable preferred distance of the subway gate.
Preferably, the mobile terminal includes range sensor, mobile terminal and ground are detected by the range sensor
The distance between iron gate.
Preferably, the subway gate barcode scanning recognition methods further include:
The size that the identification code is arranged is the original dimension of default;
When testing the mobile terminal and showing the identification code of the original dimension, the subway gate can recognize described initial
The distance range of the identification code of size;
The upper limit that the distance range is arranged is the first threshold;
The lower limit that the distance range is arranged is the second threshold.
Preferably, the subway gate barcode scanning recognition methods further include:
The size that the identification code is respectively set is different pre-set dimension;
When testing the mobile terminal respectively and showing the identification code of the different pre-set dimension, the subway gate can be known
The distance range of the identification code of the not described different pre-set dimension;
Establish the first mapping table of the different pre-set dimension and the distance range;
The step of size for the identification code that the amplification mobile terminal is shown includes:
First mapping table is searched, distance range belonging to the distance and corresponding pre-set dimension are obtained;
The identification code is amplified to the corresponding pre-set dimension got;
The step of size for reducing the identification code includes:
First mapping table is searched, distance range belonging to the distance and corresponding pre-set dimension are obtained;
The identification code is contracted to the corresponding pre-set dimension got.
Or, the subway gate barcode scanning recognition methods further include:
It is different pre-determined distances that the distance between the mobile terminal and the subway gate, which is respectively set,;
When testing the different pre-determined distance respectively, the size model of the identifiable identification code of subway gate
It encloses;
Establish the second mapping table of the different pre-determined distance and the size range;
The step of size for the identification code that the amplification mobile terminal is shown includes:
Second mapping table is searched, is obtained in the different pre-determined distance with described apart from immediate default
Distance and corresponding size range;
The identification code is amplified to any size in the corresponding size range got;
The step of size for reducing the identification code includes:
Second mapping table is searched, is obtained in the different pre-determined distance with described apart from immediate default
Distance and corresponding size range;
The identification code is contracted to any size in the corresponding size range got.
The present invention provides a kind of mobile terminal, and the mobile terminal includes:
Distance detection unit, for detecting the distance between mobile terminal and subway gate;
Identification code unit for scaling, for amplifying the knowledge that the mobile terminal is shown when the distance is greater than first threshold
The size of other code reduces the size of the identification code when the distance is less than second threshold;
The first threshold is greater than or equal to the second threshold.
Preferably, the mobile terminal further include:
Screen control unit, for the bright screen of the mobile terminal being controlled, described when the distance is greater than third threshold value
It when distance is not more than the third threshold value, controls the mobile terminal and goes out screen, the third threshold value is less than the second threshold;
And/or the identification code unit for scaling is also used in the distance no more than the first threshold and not less than institute
When stating second threshold, the size constancy of the identification code is kept;The mobile terminal further includes prompt unit, the prompt unit
For issuing prompt when the distance is no more than the first threshold and is not less than the second threshold, the prompt includes language
Sound prompt and/or vibration prompting, it is described prompt for inform distance described in user be the subway gate it is scannable preferably away from
From.
Preferably, the distance detection unit includes range sensor, mobile terminal is detected by the range sensor
The distance between subway gate.
Preferably, the mobile terminal further include:
The size that first setting unit is used to be arranged the identification code is the original dimension defaulted, and obtains the mobile terminal
Show that the subway gate when identification code of the original dimension can recognize the distance range of identification code of the original dimension, if
The upper limit for setting the distance range is the first threshold, and the lower limit that the distance range is arranged is the second threshold.
Preferably, the mobile terminal further include:
The size that second setting unit is used to be respectively set the identification code is different pre-set dimension, respectively described in acquisition
Mobile terminal shows that the subway gate can recognize the different pre-set dimension when identification code of the different pre-set dimension
Identification code distance range, establish the first mapping table of the different pre-set dimension and the distance range;
The identification code unit for scaling is also used to search described first pair when the distance is greater than the first threshold
Relation table is answered, distance range belonging to the distance and corresponding pre-set dimension is obtained, the identification code is amplified to and is got
The corresponding pre-set dimension;
The identification code unit for scaling is also used to that it is corresponding to search described first when the distance is less than the second threshold
Relation table obtains distance range belonging to the distance and corresponding pre-set dimension, and the identification code is contracted to get
The corresponding pre-set dimension;
Or, the mobile terminal further include:
Third setting unit is different for the distance between the mobile terminal and the subway gate to be respectively set
Pre-determined distance obtains the size model of subway gate identifiable identification code when the different pre-determined distance respectively
It encloses, establishes the second mapping table of the different pre-determined distance and the size range;
The identification code unit for scaling is also used to search described second pair when the distance is greater than the first threshold
It answers relation table, obtains in the different pre-determined distance with described apart from immediate pre-determined distance and corresponding size range,
The identification code is amplified to any size in the corresponding size range got;
The identification code unit for scaling is also used to that it is corresponding to search described second when the distance is less than the second threshold
Relation table obtains in the different pre-determined distance with described apart from immediate pre-determined distance and corresponding size range, will
The identification code is contracted to any size in the corresponding size range got.
On the basis of common knowledge of the art, above-mentioned each optimum condition, can any combination to get each preferable reality of the present invention
Example.
The positive effect of the present invention is that: the present invention contracts automatically according to the distance between mobile terminal and subway gate
The identification code shown on mobile terminal is put, so that regardless of distance, gate can rapidly scanning recognition code, on the one hand,
User need not voluntarily adjust the position of mobile terminal, facilitate operation, on the other hand, improve the scanning speed of gate and be scanned into
Power realizes quickly entering the station for user, avoids the stream of people's congestion caused in station.
Detailed description of the invention
Fig. 1 is a kind of flow chart of subway gate barcode scanning recognition methods of the embodiment of the present invention 1;
Fig. 2 is a kind of flow chart of subway gate barcode scanning recognition methods of the embodiment of the present invention 2;
Fig. 3 is preset first threshold value and second threshold in a kind of subway gate barcode scanning recognition methods of the embodiment of the present invention 3
Specific flow chart;
Fig. 4 be the embodiment of the present invention 4 a kind of subway gate barcode scanning recognition methods in preset amplification/contracting of the identification code
The specific flow chart of small degree;
Fig. 5 is a kind of flow chart of subway gate barcode scanning recognition methods of the embodiment of the present invention 4;
Fig. 6 be the embodiment of the present invention 5 a kind of subway gate barcode scanning recognition methods in preset amplification/contracting of the identification code
The specific flow chart of small degree;
Fig. 7 is a kind of flow chart of subway gate barcode scanning recognition methods of the embodiment of the present invention 5;
Fig. 8 is a kind of schematic block diagram of mobile terminal of the embodiment of the present invention 6;
Fig. 9 is a kind of schematic block diagram of mobile terminal of the embodiment of the present invention 7;
Figure 10 is a kind of schematic block diagram of mobile terminal of the embodiment of the present invention 8;
Figure 11 is a kind of schematic block diagram of mobile terminal of the embodiment of the present invention 9;
Figure 12 is a kind of schematic block diagram of mobile terminal of the embodiment of the present invention 10.
Specific embodiment
The present invention is further illustrated below by the mode of embodiment, but does not therefore limit the present invention to the reality
It applies among a range.
Embodiment 1
Fig. 1 shows a kind of subway gate barcode scanning recognition methods of the present embodiment.The subway gate barcode scanning recognition methods
Include:
Step 11, detection the distance between mobile terminal and subway gate.
Whether step 12, the distance are greater than first threshold or are less than second threshold, if the distance is greater than first
Threshold value thens follow the steps 13, if the distance is less than second threshold and thens follow the steps 14.
The size for the identification code that step 13, the amplification mobile terminal are shown.
Step 14, the size for reducing the identification code.
Wherein, the first threshold is greater than or equal to the second threshold.The first threshold and the second threshold can
Depending on the performance and requirement that subway gate identifies identification code.The identification code can with but be not limited to two dimensional code, item
Shape code or digital code.
The subway gate barcode scanning recognition methods of the present embodiment is contracted automatically according to the distance between mobile terminal and subway gate
The identification code shown on mobile terminal is put, so that regardless of distance, gate can rapidly scanning recognition code, on the one hand,
User need not voluntarily adjust the position of mobile terminal, facilitate operation, on the other hand, improve the scanning speed of gate and be scanned into
Power realizes quickly entering the station for user, avoids the stream of people's congestion caused in station.
Embodiment 2
The subway gate barcode scanning recognition methods of the present embodiment is further improvement on the basis of embodiment 1.Specifically,
The subway gate barcode scanning recognition methods of the present embodiment difference from example 1 is that, as shown in Fig. 2, the ground of the present embodiment
The recognition methods of iron gate barcode scanning after step 11, before step 12 further include:
Step 111 judges whether the distance is greater than third threshold value, if so then execute step 112, thens follow the steps if not
113。
Step 112, the control bright screen of mobile terminal, then execute step 12.
Step 113, the control mobile terminal go out screen.
Wherein, the third threshold value is less than the second threshold, and the third threshold value can be identified according to subway gate to be known
Depending on the performance and requirement of other code.
In the present embodiment, the distance is less than the third threshold value, then shows the mobile terminal and the subway gate
The distance between it is excessively close, even if the mobile terminal shows identification code, the subway gate can not also identify substantially.Therefore,
Above-mentioned step 111-113 according to the distance between the mobile terminal and the subway gate realize mobile terminal bright screen,
It goes out and shields control, only in bright screen, identification code can just be shown on mobile terminals, can just be identified by the subway gate.
In addition, in the present embodiment, step 12 further include:
If the distance is no more than the first threshold and is not less than the second threshold, 15 are thened follow the steps.
Step 15, the size constancy for keeping the identification code simultaneously control the mobile terminal sending prompt.The prompt packet
Voice prompting and/or vibration prompting are included, the prompt is for informing that distance described in user is that the subway gate is scannable excellent
Select distance.Wherein, preferred distance is depending on the scan performance of the subway gate, the subway lock in the preferred distance
Machine can clearly, accurately scan the identification code of the size.
The prompt can give user feedback, and user is helped to know the distance of suitable subway gate scanning,
Cultivate barcode scanning habit.
In the present embodiment, the mobile terminal may include range sensor, is detected and is moved by the range sensor
The distance between terminal and subway gate.The p often having in existing mobile terminal can be directly used in the range sensor
Sensor is realized.
Embodiment 3
The subway gate barcode scanning recognition methods of the present embodiment is further improvement on the basis of embodiment 2.Specifically,
The subway gate barcode scanning recognition methods of the present embodiment gives the specific of before step 11 preset first threshold value and second threshold
Step, as shown in Figure 3:
Step 011, the size of the setting identification code are the original dimension of default.
When step 012, the test mobile terminal show the identification code of the original dimension, the subway gate be can recognize
The distance range of the identification code of the original dimension.
Step 013, the upper limit of the setting distance range are the first threshold.
Step 014, the lower limit that the distance range is arranged are the second threshold.
Wherein, the subway gate can recognize the distance range of the identification code of the original dimension, refer at this apart from model
The identification code of the original dimension can be scanned by enclosing the interior subway gate, and can therefrom get user information, subway
The barcode scannings such as seating information enter the station or the outbound required information of barcode scanning.
After step 011-014, the step in embodiment 1 or embodiment 2 is executed, is specifically repeated no more.
First threshold and second threshold, tool is arranged by the means of the recognizable distance range of test identification code in the present embodiment
Have the advantages that test is simple, result is accurate.
Embodiment 4
The subway gate barcode scanning recognition methods of the present embodiment is further improvement on the basis of embodiment 1.Specifically,
The subway gate barcode scanning recognition methods of the present embodiment, which gives, to be preset step 13 before step 11,14 amplifications, reduces the knowledge
The amplification of other code/diminution degree specific steps, as shown in Figure 4:
Step 021: the size that the identification code is respectively set is different pre-set dimension.
Step 022, when testing the mobile terminal respectively and showing the identification code of the different pre-set dimension, the subway
Gate can recognize the distance range of the identification code of the different pre-set dimension.Wherein, the subway gate can recognize it is described not
The distance range of the identification code of same pre-set dimension refers to that it is default can to scan this for the subway gate in the distance range
The identification code of size, and can therefrom get user information, subway takes that the barcode scannings such as information enter the station or barcode scanning is outbound required
Information.
Step 023, the first mapping table for establishing the different pre-set dimension and the distance range.
Correspondingly, as shown in figure 5, step 13 specifically includes in the subway gate barcode scanning recognition methods of the present embodiment:
Step 131 searches first mapping table, obtains distance range belonging to the distance and corresponding default
Size.
The identification code is amplified to the corresponding pre-set dimension got by step 132.
Correspondingly, in the subway gate barcode scanning recognition methods of the present embodiment, step 14 is specifically included:
Step 141 searches first mapping table, obtains distance range belonging to the distance and corresponding default
Size.
The identification code is contracted to the corresponding pre-set dimension got by step 142.
The step 021-023, step 131-132, step 141-142 of certain the present embodiment can also be applied to embodiment 2 or
In other embodiments, other new embodiments of the invention are formed.
Embodiment 5
The subway gate barcode scanning recognition methods of the present embodiment is further improvement on the basis of embodiment 1.Specifically,
The subway gate barcode scanning recognition methods of the present embodiment, which gives, to be preset step 13 before step 11,14 amplifications, reduces the knowledge
The amplification of other code/diminution degree specific steps, as shown in Figure 6:
The distance between the mobile terminal and the subway gate is respectively set as different pre-determined distances in step 031.
Step 032, when testing the different pre-determined distance respectively, the identifiable identification code of subway gate
Size range.Wherein, the size range of the identifiable identification code of the subway gate refers to described in the distance range
Subway gate can scan the identification code of the size range, and can therefrom get user information, subway seating information etc.
Barcode scanning enters the station or the outbound required information of barcode scanning.
Step 033, the second mapping table for establishing the different pre-determined distance and the size range.
Correspondingly, as shown in fig. 7, step 13 specifically includes in the subway gate barcode scanning recognition methods of the present embodiment:
Step 131 ', search second mapping table, obtain in the different pre-determined distance with the distance most
Close pre-determined distance and corresponding size range.
Step 132 ', the identification code is amplified to any size in the corresponding size range got.
Correspondingly, in the subway gate barcode scanning recognition methods of the present embodiment, step 14 is specifically included:
Step 141 ', search second mapping table, obtain in the different pre-determined distance with the distance most
Close pre-determined distance and corresponding size range.
Step 142 ', the identification code is contracted to any size in the corresponding size range got.
The step 031-033 of certain the present embodiment, step 131 ' -132 ', step 141 ' -142 ' can also be applied to embodiment
2 or other embodiments in, form other new embodiments of the invention.
Embodiment 6
Fig. 8 shows a kind of mobile terminal of the present embodiment.The mobile terminal includes:
Distance detection unit 21, for detecting the distance between mobile terminal and subway gate;
Identification code unit for scaling 22, for amplifying what the mobile terminal was shown when the distance is greater than first threshold
The size of identification code reduces the size of the identification code when the distance is less than second threshold.
Wherein, the first threshold is greater than or equal to the second threshold.The first threshold and the second threshold can
Depending on the performance and requirement that subway gate identifies identification code.The identification code can with but be not limited to two dimensional code, item
Shape code or digital code.
The mobile terminal of the present embodiment is according on the distance between mobile terminal and subway gate auto zoom mobile terminal
The identification code of display, so that regardless of distance, gate can rapidly scanning recognition code, on the one hand, user need not be voluntarily
The position for adjusting mobile terminal, facilitates operation, on the other hand, improves the scanning speed and scanning success rate of gate, realizes
User's quickly enters the station, and avoids the stream of people's congestion caused in station.
Embodiment 7
The mobile terminal of the present embodiment is further improvement on the basis of embodiment 6.Specifically, the shifting of the present embodiment
Dynamic terminal and embodiment 5 the difference is that, as shown in figure 9, the mobile terminal of the present embodiment further include:
Screen control unit 23, for the bright screen of the mobile terminal being controlled, in institute when the distance is greater than third threshold value
When stating distance no more than the third threshold value, controls the mobile terminal and go out screen, the third threshold value is less than the second threshold.
The third threshold value can be depending on the performance and requirement that subway gate identifies identification code.
In the present embodiment, the distance is less than the third threshold value, then shows the mobile terminal and the subway gate
The distance between it is excessively close, even if the mobile terminal shows identification code, the subway gate can not also identify substantially.Therefore,
Above-mentioned screen control unit 23 realizes the bright of mobile terminal according to the distance between the mobile terminal and the subway gate
Shield, go out and shield control, only in bright screen, identification code can just be shown on mobile terminals, can just be identified by the subway gate.
In addition, the identification code unit for scaling 22 is also used in the distance no more than first threshold in the present embodiment
When being worth and being not less than the second threshold, the size constancy of the identification code is kept;The mobile terminal further includes prompt unit,
The prompt unit is used to issue prompt, institute when the distance is no more than the first threshold and is not less than the second threshold
Stating prompt includes voice prompting and/or vibration prompting, and the prompt is for informing that distance described in user is that the subway gate can
The preferred distance of scanning.Wherein, preferred distance is depending on the scan performance of the subway gate, the institute in the preferred distance
The identification code of the size can clearly, accurately be scanned by stating subway gate.
The prompt can give user feedback, and user is helped to know that the distance of suitable subway gate scanning, culture barcode scanning are practised
It is used.
In the present embodiment, the distance detection unit 21 may include range sensor, be examined by the range sensor
Survey the distance between mobile terminal and subway gate.The range sensor, which can be directly used, often to be had in existing mobile terminal
P sensor is realized.
Embodiment 8
The mobile terminal of the present embodiment is further improvement on the basis of embodiment 7.Specifically, as shown in Figure 10,
The mobile terminal of the present embodiment further include:
The size that first setting unit 24 is used to be arranged the identification code is the original dimension defaulted, and is obtained described mobile whole
The subway gate can recognize the distance range of the identification code of the original dimension when identification code of the end display original dimension,
The upper limit that the distance range is arranged is the first threshold, and the lower limit that the distance range is arranged is the second threshold.
Wherein, the subway gate can recognize the distance range of the identification code of the original dimension, refer at this apart from model
The identification code of the original dimension can be scanned by enclosing the interior subway gate, and can therefrom get user information, subway
The barcode scannings such as seating information enter the station or the outbound required information of barcode scanning.
First threshold and second threshold, tool is arranged by the means of the recognizable distance range of test identification code in the present embodiment
Have the advantages that test is simple, result is accurate.
Embodiment 9
The mobile terminal of the present embodiment is further improvement on the basis of embodiment 6.Specifically, as shown in figure 11,
The mobile terminal of the present embodiment further include:
The size that second setting unit 25 is used to be respectively set the identification code is different pre-set dimension, obtains institute respectively
It states mobile terminal and shows that the subway gate can recognize the different default ruler when identification code of the different pre-set dimension
The distance range of very little identification code establishes the first mapping table of the different pre-set dimension and the distance range.
Correspondingly, the identification code unit for scaling 22 is also used to search when the distance is greater than the first threshold
First mapping table obtains distance range belonging to the distance and corresponding pre-set dimension, and the identification is piled up
Greatly to the corresponding pre-set dimension got;
The identification code unit for scaling 22 is also used to search described first pair when the distance is less than the second threshold
Relation table is answered, distance range belonging to the distance and corresponding pre-set dimension is obtained, the identification code is contracted to get
The corresponding pre-set dimension.
Second setting unit 25, identification code unit for scaling 22 of certain the present embodiment can also be applied in embodiment 2, be formed
Other embodiments of the invention.
Embodiment 10
The subway gate barcode scanning recognition methods of the present embodiment is further improvement on the basis of embodiment 1.Specifically,
As shown in figure 12, the mobile terminal of the present embodiment further include:
Third setting unit 26 is different for the distance between the mobile terminal and the subway gate to be respectively set
Pre-determined distance, obtain the size model of subway gate identifiable identification code when the different pre-determined distance respectively
It encloses, establishes the second mapping table of the different pre-determined distance and the size range.
Correspondingly, the identification code unit for scaling 22 is also used to search when the distance is greater than the first threshold
Second mapping table, obtain in the different pre-determined distance with it is described apart from immediate pre-determined distance and corresponding
The identification code is amplified to any size in the corresponding size range got by size range;
The identification code unit for scaling 22 is also used to search described second pair when the distance is less than the second threshold
It answers relation table, obtains in the different pre-determined distance with described apart from immediate pre-determined distance and corresponding size range,
The identification code is contracted to any size in the corresponding size range got.
The third setting unit 26, identification code unit for scaling 22 of certain the present embodiment can also be applied in embodiment 6, be formed
Other embodiments of the invention.
Although specific embodiments of the present invention have been described above, it will be appreciated by those of skill in the art that these
It is merely illustrative of, protection scope of the present invention is defined by the appended claims.Those skilled in the art is not carrying on the back
Under the premise of from the principle and substance of the present invention, many changes and modifications may be made, but these are changed
Protection scope of the present invention is each fallen with modification.