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 terminals, experience thereby improve the user.
In order to solve the problems of the technologies described above, the embodiment of the invention provides a kind of control method of gate control system, and 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, receive visible light signal corresponding to stem with this serial ports;
When the visible light signal of checking reception and default Condition Matching, the release of control door lock.
Another embodiment of the present invention also provides a kind of gate control system, comprising:
Interface receives the stem of visible light signal and the visible light signal that mobile phone sends with universaling I/O port, receives the visible light signal that light pen sends with serial ports;
The central processing unit that is connected with described interface is used for verifying whether the visible light signal that described interface receives mates with default condition, when coupling, and the door lock release that control is connected with this central processing unit.
In the gate control system that the embodiment of the invention provides, the gate control system control end is with the stem of universaling I/O port reception from the visible light signal of different transmitting terminals, the stem of determining visible light signal is from mobile phone or light pen, if the source is mobile phone, adopts the receive mode of mobile phone to receive visible light signal; If the 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, experiences thereby improve the user.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment only is the present invention's part embodiment, rather than whole embodiments.Based on the embodiment among the present invention, those of ordinary skills belong to the scope of protection of the invention not making the every other embodiment that obtains under the creative work prerequisite.
Embodiment one,
Referring to Fig. 1, the control method process flow diagram of a kind of gate control system that provides for the embodiment of the invention one, this control method comprises:
S11: the visible light signal receiving port is set to general purpose I/O (input/output, input and output) mouthful, i.e. universaling I/O port initialization.For example, UART (Universal Asynchronous Receiver/Transmitter, Universal Asynchronous Receiver ﹠ dispensing device) port is set to the I/O mouth.
Be understandable that, in concrete implementation process, also need CPU is carried out initialization operation.
The S12:I/O mouth receives the stem of visible light signal, determines the source of stem.For example, default information and stem are compared, judge whether this stem unblanks to indicate, if the source of determining stem is mobile phone or light pen.
S13: if know that from S12 the source of stem is mobile phone, then receive visible light signal corresponding to stem with universaling I/O port.
S14: if know that from S12 the source of stem is light pen, then universaling I/O port is replaced by serial ports, receives visible light signal corresponding to stem with this serial ports.
S15: the visible light signal that S13 or S14 receive is verified, when the visible light signal that receives during with default Condition Matching, the release of control door lock.
In the present embodiment, with the stem of universaling I/O port reception from the visible light signal of different transmitting terminals, the stem of determining visible light signal is from mobile phone or light pen, if the source is mobile phone, adopts the receive mode of mobile phone to receive visible light signal; If the 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 receiving ends, experience thereby improve the user.
Embodiment two,
Referring to Fig. 2, the control method process flow diagram of a kind of gate control system that provides for the embodiment of the invention two, this control method comprises:
S21: the visible light signal receiving port is set to general purpose I/O (input/output, input and output) mouthful, i.e. I/O mouth initialization.For example, UART (Universal Asynchronous Receiver/Transmitter, Universal Asynchronous Receiver ﹠ dispensing device) port is set to the I/O mouth.
Be understandable that, in concrete implementation process, also need CPU is carried out initialization operation.
The S22:I/O mouth receives the stem of visible light signal, judges this stem sign of whether unblanking, if then determine the source of stem.For example, default information and stem are compared, the source of determining stem is mobile phone or light pen.
S23: if know that from S22 the source of stem is mobile phone, then receive visible light signal corresponding to stem with universaling I/O port.
S24: if know that from S22 the source of stem is light pen, 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 of S23 or S24 reception 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; This voltage signal is carried out amplifieroperation; Then the voltage signal after will amplifying is decoded and cyclic redundancy check (CRC) as numeral, obtains binary data.
S26: the binary data and the default condition that are converted to are compared, judge whether binary data and default condition mate, if coupling, execution in step S27; Otherwise, execution in step S28.
Wherein, binary data refers to default Condition Matching: binary data is identical or have a corresponding relation with default condition.
S27: the control door lock is carried out unlocking operation.
S28: send the authentication failed prompt tone.
The present embodiment two is with respect to embodiment one, the pre-conditioned checking data that namely prestores is binary data, therefore the visible light signal that receives need to be decoded, be converted to binary data, then the binary data that is converted to and the checking data that prestores are compared, if the structure of comparison is not mated, then send the authentication failed prompting, experience with further raising user.
Embodiment three,
Referring to Fig. 3, be a kind of gate control system structural representation that the embodiment of the invention three provides, this gate control system comprises:
Interface 31 receives the stem of visible light signal and the visible light signal that mobile phone sends with universaling I/O port 311, receives the visible light signal that light pen sends with serial ports 312;
Whether the central processing unit 32 that is connected with interface 31 is used for checking interface 31 visible light signal that receives and the condition of presetting and mates, when coupling, and door lock 33 releases that control is connected with this central processing unit 32.
Wherein, central processing unit 32 comprises:
Conversion subelement 321 is used for converting the visible light signal that described interface receives to binary data;
Checking subelement 322 is used for verifying whether the binary data that conversion subelement 321 is converted to mates with default condition, and sends the result;
Control subelement 323 when being match information for the result that receives from described authentication unit 321, being controlled connected door lock 33 and is carried out unlocking action.
The gate control system that the present embodiment provides can receive the visible light signal that different transmitting terminals send, and with respect to the transmitting terminal of the corresponding identical type of same gate control system, the dirigibility that has improved the user selection transmitting terminal is experienced thereby improve the user.
Embodiment four,
Referring to Fig. 4, be a kind of gate control system structural representation that the embodiment of the invention four provides, with respect to embodiment three, this gate control system central processing unit 32 also comprises:
The warning subelement 324 that checking subelement 322 connects when being used for the result that receives from checking subelement 322 for match information not, sends the authentication failed prompt tone.
With respect to embodiment three, owing to having increased warning subelement 324, the situation of avoiding repeatedly malice to unblank occurs, thereby further improves user's security.
Above disclosed is a kind of better embodiment of the present invention only, certainly can not limit with this interest field of the present invention, and the equivalent variations of therefore doing according to claim of the present invention still belongs to the scope that the present invention is contained.