Summary of the invention
The embodiment of the present invention is designed to provide a kind of graphic code scan method, device and scanner, to reduce sensing
The error of the light intensity for the reflection source that the graphic code that device receives is reflected, to improve the scanning accuracy of scanner.
Specific technical solution is as follows:
In a first aspect, the embodiment of the invention provides a kind of graphic code scan method, applied to the processor in scanner,
The scanner further includes sensor, alignment light source and reflection source, the method includes:
When the alignment light source and the reflection source in the open state, judge in alignment area with the presence or absence of wait sweep
Trace designs shape code;
If there are graphic codes to be scanned in the alignment area, judge whether the sensor is in sensing state;
If the sensor is in sensing state, the alignment light source is closed;
The reflected light signal of the sensor sensing is received, and according to the reflected light signal, determines the figure to be scanned
The corresponding information of shape code;The reflected light signal is that the graphic code to be scanned reflects the reflected light formed after the reflection source
Signal.
Optionally, before the reflected light signal for receiving the sensor sensing, the method also includes:
Judge whether the alignment light source is in the open state;
If the alignment light source is in the open state, the sensing function of the sensor is closed;
If the alignment light source is in close state, the sensing function of the sensor is opened.
Optionally, if the sensor is in sensing state, the alignment light source is closed, including:
If the sensor is in sensing state, judge the sensor be continuously in sensing state time whether
In preset time range;
If the sensor is continuously in the time of sensing state in preset time range, close described to quasi-optical
Source;
If the sensor is continuously in the time of sensing state not in preset time range, described in restarting
Scanner.
Optionally, the alignment light source is Light-emitting diode LED light source.
Optionally, the sensor is correlation type photoelectric sensor.
Second aspect, the embodiment of the invention also provides a kind of graphic code scanning means, applied to the processing in scanner
Device, the scanner further include sensor, alignment light source and reflection source, and described device includes:
Region decision unit, for judging to be aligned when the alignment light source and the reflection source in the open state
It whether there is graphic code to be scanned in region;
Sensor states judging unit, if judging the biography for there are graphic codes to be scanned in the alignment area
Whether sensor is in sensing state;
Light source control unit closes the alignment light source if being in sensing state for the sensor;
Information determination unit, for receiving the reflected light signal of sensor sensing, and according to the reflected light signal,
Determine the corresponding information of the graphic code to be scanned;The reflected light signal is that the graphic code to be scanned reflects the reflected light
The reflected light signal formed behind source.
Optionally, described device further includes:
Light source state judging unit, for judging whether the alignment light source is in the open state;
Sensor control unit closes the sensing of the sensor if in the open state for the alignment light source
Function;If the alignment light source is in close state, the sensing function of the sensor is opened.
Optionally, the light source control unit, including:
Time judgment sub-unit is sensed, if being in sensing state for the sensor, judges that the sensor continues
Whether the time in sensing state is in preset time range;
Light source control subelement, if being continuously in the time of sensing state in preset time model for the sensor
In enclosing, the alignment light source is closed;If the sensor is continuously in the time of sensing state not in preset time range
It is interior, restart the scanner.
Optionally, the alignment light source is Light-emitting diode LED light source.
The third aspect, the embodiment of the invention also provides a kind of scanner, including processor, communication interface, memory and
Communication bus, wherein processor, communication interface, memory complete mutual communication by communication bus;
Memory, for storing computer program;
Processor when for executing the program stored on memory, realizes method and step described in first aspect.
Fourth aspect, the embodiment of the invention also provides a kind of computer readable storage medium, the storage medium memory
Computer program is contained, method and step described in first aspect is realized when the computer program is executed by processor.
Graphic code scan method provided in an embodiment of the present invention is applied to scanner, and scanner includes sensor, to quasi-optical
Source and reflection source, the method includes:Open alignment light source and reflection source;Judge whether graphic code to be scanned is in
In alignment area;If the graphic code to be scanned is in alignment area, judge whether the sensor is in sensing state;
If the sensor is in sensing state, the alignment light source is closed;According to the reflected light signal that the sensor senses, really
Determine the corresponding information of the graphic code to be scanned;The reflected light signal reflects the reflected light for the graphic code to be scanned
The reflected light signal formed behind source.
Graphic code scan method provided in an embodiment of the present invention can root when graphic code to be scanned is in alignment area
It whether is in sensing state according to sensor, to control the opening and closing of alignment light source.When sensor is in sensing state, illustrate wait sweep
Tracing shape code can be sensed by sensor, at this point, need not be aligned light source effect come assist operators carry out to
The alignment of scanning figure shape code can close alignment light source at this time, to avoid the reflected light signal of sensor sensing by alignment light source
Influence improve scanning so as to reduce the optical signal error for the reflection source that the graphic code that sensor receives is reflected
The scanning accuracy of rifle.Certainly, it implements any of the products of the present invention or method must be not necessarily required to reach above-described simultaneously
All advantages.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on
Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other
Embodiment shall fall within the protection scope of the present invention.
In order to reduce the reflection source that the graphic code that sensor receives is reflected light intensity error, to improve
The scanning accuracy of scanner, the embodiment of the invention provides a kind of graphic code scan method, device and scanners, by when biography
Sensor closes alignment light source when being in sensing state, and the reflected light signal to avoid sensor from sensing is influenced by alignment light source,
So as to reduce the optical signal error for the reflection source that the graphic code that sensor receives is reflected, the scanning of scanner is improved
Accuracy.Graphic code scan method is provided for the embodiments of the invention below to be introduced.
It should be noted that graphic code scan method provided by the embodiment of the present invention can be applied to all kinds of scanners
In.
Graphic code scan method provided by the embodiment of the present invention can be applied to the processor in scanner, above-mentioned to sweep
Retouching rifle further includes sensor, alignment light source and reflection source, and as shown in topic 1, the above method be may comprise steps of:
S110:When alignment light source and reflection source in the open state, judge in alignment area with the presence or absence of to be scanned
Graphic code.
In practical applications, bar code and two dimensional code are generally included for characterizing the graphic code of merchandise news, it is therefore, above-mentioned
Graphic code to be scanned can be bar code, be also possible to two dimensional code.
It is understood that operator need to first open scanner, make the alignment light source of scanner when using scanner
After being in open state with reflection source, graphic code is placed in scanning area, can just smoothly complete the scanning of graphic code.
Therefore, in embodiments of the present invention, it is the scanning for smoothly completing graphic code, can be in and open when alignment light source and reflection source
When state, judge in alignment area with the presence or absence of graphic code to be scanned.
Above-mentioned alignment area, which can be, is formed by alignment patterns region, operator by the light that alignment light source is launched
Graphic code to be scanned can be placed in above-mentioned alignment patterns region, so that graphic code to be scanned is successfully scanned.
Above-mentioned reflection source is used to provide reflection light, the reflection light quilt that reflection source is launched for graphic code to be scanned
Graphic code reflection light is formed after graphic code reflection to be scanned, scanner can obtain figure according to the graphic code reflection light
The corresponding information of code.
S120:If there are graphic codes to be scanned in above-mentioned alignment area, judge whether the sensor is in sensing shape
State.
The sensor can be used for sensing graphic code reflection light, when graphic code to be scanned is accurately placed at alignment area
When interior, sensor can sense graphic code reflection light.In embodiments of the present invention, in order to launch alignment light source
Light does not influence the sensing precision of sensor, can first judge whether sensor is in sensing state, so that the processing of scanner
Device can control the state of alignment light source according to the state of sensor.
S130:If the sensor is in sensing state, above-mentioned alignment light source is closed.
It is understood that when sensor is in sensing state, if alignment light source is opened, what alignment light source was launched
After light is radiated on graphic code to be scanned, the accuracy that sensor treats scanning figure code information sensing will affect.Therefore, exist
In the embodiment of the present invention, if sensor is in sensing state, above-mentioned alignment light source can be closed.To make sensor to figure
The sensing of code information is not influenced by alignment light source.
S140:The reflected light signal of the sensor sensing is received, and according to above-mentioned reflected light signal, is determined above-mentioned wait sweep
Trace designs the corresponding information of shape code;Above-mentioned reflected light signal be above-mentioned graphic code to be scanned reflect after above-mentioned reflection source formed it is anti-
Penetrate optical signal.
After closing alignment light source, the light of graphic code reflective light source to be scanned, without being emitted by alignment light source
The influence of light out.At this point, the processor of scanner can receive the sensor sensing reflected light signal, and according to
Above-mentioned reflected light signal determines the corresponding information of above-mentioned graphic code to be scanned.
Graphic code scan method provided in an embodiment of the present invention, when graphic code to be scanned is in alignment area, processing
Whether device can be in sensing state according to sensor, to control the opening and closing of alignment light source, so as to avoid sensor from sensing
Reflected light signal is influenced by alignment light source, reduces the optical signal for the reflection source that the graphic code that sensor receives is reflected
Error improves the scanning accuracy of scanner.
In practical applications, processor is when the open and-shut mode to alignment light source controls, it is possible that operation is different
Normal situation, for example, during the opening and closing in the quasi-optical source of the state control pair according to sensor, there is control mistake in processor,
Sensor is not off alignment light source when sensing.At this point, the accuracy of the information for the graphic code to be scanned that sensor is sensed
It will decline.
In a kind of embodiment of the embodiment of the present invention, to be further ensured that graphic code to be scanned that sensor is sensed
Information accuracy, before above-mentioned steps S140, can also include the following steps:
Judge whether above-mentioned alignment light source is in the open state;
If above-mentioned alignment light source is in the open state, the sensing function of the sensor is closed;
If above-mentioned alignment light source is in close state, the sensing function of the sensor is opened.
By further judging whether alignment light source is opened and closed, to control the sensing state of sensor, may further ensure that
The light that the graphic code to be scanned of sensor sensing is reflected, is not influenced by alignment light source, thus, further improve scanning
The scanning accuracy of rifle.
It is understood that scanner is as electronic device, in the course of work it is possible that the case where run-time error,
For example, being placed in alignment area regardless of whether needing scanning figure shape code, sensor is in sensing state always.Such case
Under, mistake may also can occur for the information for the graphic code to be scanned that sensor is sensed.
It is influenced caused by scanning accuracy to reduce because of scanner run-time error, in a kind of reality of the embodiment of the present invention
It applies in mode, step S130 can be realized according to the following steps:
If the sensor is in sensing state, judge the sensor be continuously in sensing state time whether
In preset time range;
If the sensor is continuously in the time of sensing state in preset time range, close above-mentioned to quasi-optical
Source;
If the sensor is continuously in the time of sensing state not in preset time range, restart above-mentioned
Scanner.
It is understood that usually only requiring a very short time can feeling of success when sensor senses graphic code information
It surveys, for example, time of the operative sensor with 0.5 second, so that it may the information of feeling of success mapping shape code.Therefore, sensor is persistently located
In sensing state time be it is very short, remaining time is in idle state.If sensor be continuously in sensing state when
Between it is longer, then illustrate that sensor may run error.Therefore, in embodiments of the present invention, above-mentioned preset time range for example may be used
To be in the time range in 2 seconds, in 3 seconds, shorter in 5 seconds etc..Those skilled in the art can specifically set according to the actual situation
Above-mentioned preset time range is set, the embodiment of the present invention does not make specific limit to preset time range.
In practical applications, when electronic device run-time error, it may be possible to because EMS memory occupation is excessive, at this point, restarting
Machine can discharge partial memory, operate normally electronic device again.In embodiments of the present invention, when the sensor is held
The continuous time in sensing state not in preset time range, illustrates the possible run-time error of scanner, at this point it is possible to again
Start scanner, to make sensor rearming.
It is continuously in the time of sensing state, by the sensor according to detection to decide whether to continue to scan on the work of rifle
State, it is possible to reduce because mistake occurs for the information for the graphic code to be scanned that sensor is sensed caused by scanner run-time error
Probability, further improve the scanning accuracy of scanner.
It is understood that Light-emitting diode LED has many advantages, such as that small in size, outer dimension is flexible, energy conservation, therefore,
In a kind of embodiment of the embodiment of the present invention, above-mentioned alignment light source can be Light-emitting diode LED light source, so as to so as to sweep
More compact structure, the electricity consuming for retouching rifle are lower.
Correlation type photoelectric sensor has many advantages, such as short response time, high resolution, lacks to the limitation of detection object, can
The object of all kinds of materials such as glass, plastics, timber, liquid is detected.For scanner in scanning figure shape code, graphic code may
It is present on the commodity of various unlike materials, in a kind of embodiment of the embodiment of the present invention, the sensor can be pair
Emitting photoelectric sensor, thus make the scanning speed of scanner faster, resolution ratio is higher, scanning accuracy rate is wider, use scope
It is wider.
Graphic code scanning means is provided for the embodiments of the invention below to be introduced.
Graphic code scanning means provided by the embodiment of the present invention is applied to the processor in scanner, and the scanner is also
Including sensor, alignment light source and reflection source, as shown in Fig. 2, described device includes:
Region decision unit 210 is used for when the alignment light source and the reflection source in the open state, judgement pair
It whether there is graphic code to be scanned in quasi- region;
Sensor states judging unit 220, if in the alignment area there are graphic code to be scanned, described in judgement
Whether sensor is in sensing state;
Light source control unit 230 closes the alignment light source if being in sensing state for the sensor;
Information determination unit 240 for receiving the reflected light signal of the sensor sensing, and is believed according to the reflected light
Number, determine the corresponding information of the graphic code to be scanned;The reflected light signal is that the graphic code reflection to be scanned is described anti-
Penetrate the reflected light signal formed after light source.
Graphic code scanning means provided in an embodiment of the present invention, when graphic code to be scanned is in alignment area, processing
Whether device can be in sensing state according to sensor, to control the opening and closing of alignment light source, so as to avoid sensor from sensing
Reflected light signal is influenced by alignment light source, reduces the optical signal for the reflection source that the graphic code that sensor receives is reflected
Error improves the scanning accuracy of scanner.
In a kind of embodiment of the embodiment of the present invention, above-mentioned apparatus can also include:
Light source state judging unit, for judging whether the alignment light source is in the open state;
Sensor control unit closes the sensing of the sensor if in the open state for the alignment light source
Function;If the alignment light source is in close state, the sensing function of the sensor is opened.
In a kind of embodiment of the embodiment of the present invention, the light source control unit may include:
Time judgment sub-unit is sensed, if being in sensing state for the sensor, judges that the sensor continues
Whether the time in sensing state is in preset time range;
Light source control subelement, if being continuously in the time of sensing state in preset time model for the sensor
In enclosing, the alignment light source is closed;If the sensor is continuously in the time of sensing state not in preset time range
It is interior, restart the scanner.
In a kind of embodiment of the embodiment of the present invention, the alignment light source is Light-emitting diode LED light source.
In a kind of embodiment of the embodiment of the present invention, the sensor is correlation type photoelectric sensor.
Scanner is provided for the embodiments of the invention below to be introduced.
Scanner provided by the embodiment of the present invention, as shown in figure 3, including processor 301, communication interface 302, memory
303 and communication bus 304, wherein processor 301, communication interface 302, memory 303 are completed mutually by communication bus 304
Between communication,
Memory 303, for storing computer program;
Processor 301 when for executing the program stored on memory 303, realizes following steps:
When the alignment light source and the reflection source in the open state, judge in alignment area with the presence or absence of wait sweep
Trace designs shape code;
If there are graphic codes to be scanned in the alignment area, judge whether the sensor is in sensing state;
If the sensor is in sensing state, the alignment light source is closed;
The reflected light signal of the sensor sensing is received, and according to the reflected light signal, determines the figure to be scanned
The corresponding information of shape code;The reflected light signal is that the graphic code to be scanned reflects the reflected light formed after the reflection source
Signal.
Scanner provided in an embodiment of the present invention, when graphic code to be scanned is in alignment area, processor can basis
Whether sensor is in sensing state, to control the opening and closing of alignment light source, so as to the reflected light letter for avoiding sensor from sensing
It number is influenced by alignment light source, reduces the optical signal error for the reflection source that the graphic code that sensor receives is reflected, mention
The high scanning accuracy of scanner.
Optionally, the embodiment of the invention also provides a kind of computer readable storage medium, the interior storages of the storage medium
There is computer program, the computer program realizes following steps when being executed by processor:
When the alignment light source and the reflection source in the open state, judge in alignment area with the presence or absence of wait sweep
Trace designs shape code;
If there are graphic codes to be scanned in the alignment area, judge whether the sensor is in sensing state;
If the sensor is in sensing state, the alignment light source is closed;
The reflected light signal of the sensor sensing is received, and according to the reflected light signal, determines the figure to be scanned
The corresponding information of shape code;The reflected light signal is that the graphic code to be scanned reflects the reflected light formed after the reflection source
Signal.
Storage medium provided in an embodiment of the present invention, when graphic code to be scanned is in alignment area, processor can root
It whether is in sensing state according to sensor, to control the opening and closing of alignment light source, so as to the reflected light for avoiding sensor from sensing
Signal is influenced by alignment light source, reduces the optical signal error for the reflection source that the graphic code that sensor receives is reflected,
Improve the scanning accuracy of scanner.
The embodiment of the present invention is raw according to the data information of the text to be forwarded or picture to be forwarded received by server
At unique link, and by the unique link it is corresponding with the foundation of the data information of acquired text to be forwarded or picture to be forwarded close
System, may be implemented the direct forwarding to text or pictorial information, so as to quickly and conveniently carry out to picture or text information
Forwarding is shared, and user experience is improved.
The communication bus that above-mentioned mobile terminal and server are mentioned can be Peripheral Component Interconnect standard (Peripheral
Component Interconnect, PCI) bus or expanding the industrial standard structure (Extended Industry Standard
Architecture, EISA) bus etc..The communication bus can be divided into address bus, data/address bus, control bus etc..For just
It is only indicated with a thick line in expression, figure, it is not intended that an only bus or a type of bus.
Communication interface is for the communication between above-mentioned mobile terminal or server and other equipment.
Memory may include random access memory (Random Access Memory, RAM), also may include non-easy
The property lost memory (Non-Volatile Memory, NVM), for example, at least a magnetic disk storage.Optionally, memory may be used also
To be storage device that at least one is located remotely from aforementioned processor.
Above-mentioned processor can be general processor, including central processing unit (Central Processing Unit,
CPU), network processing unit (Network Processor, NP) etc.;It can also be digital signal processor (Digital Signal
Processing, DSP), it is specific integrated circuit (Application Specific Integrated Circuit, ASIC), existing
It is field programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic device, discrete
Door or transistor logic, discrete hardware components.
For device/mobile terminal/server/storage medium embodiment, implement since it is substantially similar to method
Example, so being described relatively simple, the relevent part can refer to the partial explaination of embodiments of method.
It should be noted that, in this document, relational terms such as first and second and the like are used merely to a reality
Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation
In any actual relationship or order or sequence.Moreover, the terms "include", "comprise" or its any other variant are intended to
Non-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including those
Element, but also including other elements that are not explicitly listed, or further include for this process, method, article or equipment
Intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that
There is also other identical elements in process, method, article or equipment including the element.
Each embodiment in this specification is all made of relevant mode and describes, same and similar portion between each embodiment
Dividing may refer to each other, and each embodiment focuses on the differences from other embodiments.Especially for device,
For mobile terminal, server, storage medium embodiment, since it is substantially similar to the method embodiment, so the comparison of description
Simply, the relevent part can refer to the partial explaination of embodiments of method.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the scope of the present invention.It is all
Any modification, equivalent replacement, improvement and so within the spirit and principles in the present invention, are all contained in protection scope of the present invention
It is interior.