Summary of the invention
Embodiment of the present invention technical matters to be solved is, a kind of control method based on gate control system and gate control system are provided, can improve the security of gate control system, and this gate control system can receive the visible light signal from different transmitting terminal, thus improve Consumer's Experience.
In order to solve the problems of the technologies described above, embodiments provide a kind of control method of gate control system, described control method comprises:
Receive the stem of visible light signal with universaling I/O port, determine the source of described stem;
If the source of stem is mobile phone, then receive visible light signal corresponding to stem with described universaling I/O port;
If the source of stem is light pen, then described universaling I/O port is replaced by serial ports, receives visible light signal corresponding to stem with this serial ports;
When the visible light signal that checking receives and the Condition Matching preset, control door lock and unlock.
Another embodiment of the present invention additionally provides a kind of gate control system, comprising:
Interface, receives the stem of visible light signal and the visible light signal of mobile phone transmission with universaling I/O port, receives the visible light signal of light pen transmission with serial ports;
The central processing unit be connected with described interface, for verifying whether the visible light signal of described interface mates with the condition preset, upon a match, the door lock controlling to be connected with this central processing unit unlocks.
In the gate control system that the embodiment of the present invention provides, gate control system control end receives the stem from the visible light signal of different transmitting terminal with universaling I/O port, determine that the stem of visible light signal is from mobile phone or light pen, if source is mobile phone, adopt the receive mode of mobile phone to receive visible light signal; If source is light pen, then receive visible light signal with the receive mode of light pen, therefore gate control system control end can corresponding different types of receiving end, thus improves Consumer's Experience.
Embodiment
Below in conjunction with the accompanying drawing in embodiment of the present invention, be clearly and completely described the technical scheme in embodiment of the present invention, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
Embodiment one,
See Fig. 1, be the control method process flow diagram of a kind of gate control system that the embodiment of the present invention one provides, this control method comprises:
S11: visible light signal receiving port is set to general purpose I/O (input/output, input and output) mouth, i.e. universaling I/O port initialization.Such as, UART (Universal Asynchronous Receiver/Transmitter, Universal Asynchronous Receive/dispensing device) port is set to I/O mouth.
Be understandable that, in concrete implementation process, also need to carry out initialization operation to CPU.
S12:I/O mouth receives the stem of visible light signal, determines the source of stem.Such as, default information and stem are compared, judge whether this stem unblanks to indicate, if so, determines that the source of stem is mobile phone or light pen.
S13: if know that the source of stem is mobile phone from S12, then receive visible light signal corresponding to stem with universaling I/O port.
S14: if know that the source of stem is light pen from S12, then universaling I/O port is replaced by serial ports, receives visible light signal corresponding to stem with this serial ports.
S15: verify the visible light signal that S13 or S14 receives, when the visible light signal received and the Condition Matching preset, controls door lock and unlocks.
In the present embodiment, receive the stem from the visible light signal of different transmitting terminal with universaling I/O port, determine that the stem of visible light signal is from mobile phone or light pen, if source is mobile phone, adopt the receive mode of mobile phone to receive visible light signal; If source is light pen, then receive visible light signal with the receive mode of light pen, the receiving end that therefore gate control system control end can be corresponding different, thus improve Consumer's Experience.
Embodiment two,
See Fig. 2, be the control method process flow diagram of a kind of gate control system that the embodiment of the present invention two provides, this control method comprises:
S21: visible light signal receiving port is set to general purpose I/O (input/output, input and output) mouth, i.e. I/O mouth initialization.Such as, UART (Universal Asynchronous Receiver/Transmitter, Universal Asynchronous Receive/dispensing device) port is set to I/O mouth.
Be understandable that, in concrete implementation process, also need to carry out initialization operation to CPU.
S22:I/O mouth receives the stem of visible light signal, judges whether this stem unblanks to indicate, if so, then determines the source of stem.Such as, default information and stem are compared, determine that the source of stem is mobile phone or light pen.
S23: if know that the source of stem is mobile phone from S22, then receive visible light signal corresponding to stem with universaling I/O port.
S24: if know that the source of stem is light pen from S22, then universaling I/O port is replaced by serial ports, receives visible light signal corresponding to stem with this serial ports.
S25: the visible light signal that S23 or S24 receives is converted to binary data.
Wherein, to be converted to binary process as follows for visible light signal: convert visible light signal to current signal; Convert described current signal to voltage signal; Amplifieroperation is carried out to this voltage signal; Then the voltage signal after amplification is carried out decoding and cyclic redundancy check (CRC) as numeral, obtain binary data.
S26: the binary data be converted to and the condition preset are compared, judges whether binary data mates with the condition preset, if coupling, performs step S27; Otherwise, perform step S28.
Wherein, binary data refers to the Condition Matching preset: binary data is identical with the condition preset or there is corresponding relation.
S27: control door lock and perform unlocking operation.
S28: send authentication failed prompt tone.
The present embodiment two is relative to embodiment one, the pre-conditioned checking data namely prestored is binary data, therefore the visible light signal of reception is needed to decode, be converted to binary data, then the binary data be converted to and the checking data prestored are compared, if the structure of comparison is not mated, then send authentication failed prompting, to improve Consumer's Experience further.
Embodiment three,
See Fig. 3, be a kind of gate control system structural representation that the embodiment of the present invention three provides, this gate control system comprises:
Interface 31, receives the stem of visible light signal and the visible light signal of mobile phone transmission with universaling I/O port 311, receives the visible light signal of light pen transmission with serial ports 312;
The central processing unit 32 be connected with interface 31, for verifying whether the visible light signal that interface 31 receives mates with the condition preset, upon a match, the door lock 33 controlling to be connected with this central processing unit 32 unlocks.
Wherein, central processing unit 32 comprises:
Conversion subelement 321, for converting the visible light signal of described interface to binary data;
Checking subelement 322, for verifying whether the binary data that conversion subelement 321 is converted to mates with the condition preset, and sends the result;
Control subelement 323, when the result for receiving from described authentication unit 321 being match information, controlling connected door lock 33 and performing unlocking action.
The gate control system that the present embodiment provides can receive the visible light signal that different transmitting terminal sends, and relative to the transmitting terminal of the corresponding identical type of same gate control system, improves the dirigibility that user selects transmitting terminal, thus improves Consumer's Experience.
Embodiment four,
See Fig. 4, be a kind of gate control system structural representation that the embodiment of the present invention four provides, relative to embodiment three, this gate control system central processing unit 32 also comprises:
The alarm part-unit 324 that checking subelement 322 connects, for from the result that receives of checking subelement 322 for not match information time, send authentication failed prompt tone.
Relative to embodiment three, owing to adding alarm part-unit 324, the situation avoiding malice repeatedly to unblank occurs, thus improves the security of user further.
Above disclosedly be only a kind of better embodiment of the present invention, certainly can not limit the interest field of the present invention with this, therefore according to the equivalent variations that the claims in the present invention are done, still belong to the scope that the present invention is contained.