Background technology
Gate control system is exactly the system of exit and entrance being carried out to control, and it develops on traditional door lock basis.Traditional mechanical door lock is only simple mechanical hook-up, and no matter how reasonable structural design is, and how firm material is, and people can be opened it by various means.Passage (office block, the hotel guest room) key management a lot of the personnel of discrepancy is pretty troublesome, and key loss or personnel change and lock & key will be changed together.For addressing these problems, just occurred electronic magnetic card lock, electronic password lock, the problem of electronic magnetic card lock is that information is easily replicated, and between card and card-reading machine, wearing and tearing are large, and failure rate is high, and safety coefficient is low; The problem of electronic password lock is that password is easily revealed, and have no way of again having looked into, safety coefficient is very low.Meanwhile, the product in this period is arranged on outdoors owing to mostly adopting Card Reader part (Password Input) and control section to be combined, and is easy to be opened lock by people in outdoor.In recent years along with the development of contactless card technology, biological identification technology, there is the system responding to the various technology such as cassette gate control system, fingerprint entrance guard system, but induction cassette gate control system complex operation, fingerprint entrance guard system has fingerprint and is easily stolen, the shortcomings such as client is easily damaged, and discrimination is low.
For solving the problem, light-operated gate control system is arisen at the historic moment, light-operated gate control system generally includes photon client-side and light-operated door lock (photon acceptor end), photon client-side is for launching the light signal containing unlocking cipher information, and photon client-side also can be mobile phone, and light-operated door lock is resolved light signal after receiving light signal, if light signal contains unlocking cipher, then control door lock to open, otherwise, then close.
What initial photon client-side coding adopted is represent signal with the number of high level, and each high level lasting time is about about 2ms, often organizes maximum four high level, often organizes level number and represents 2bit signal.Such as, when high level number is 1 in one group of signal, 00 is represented; When high level number is 2, representation signal 01, when high level number is 3 interval scale signals 10; When high level number is 4, representation signal 11.Often organize between signal and distinguish with low level delay, low level time delay is about 30ms.
High level and low level all have certain time delay, and therefore, photon acceptor end can by detecting high level on its single-chip processor i/o pin and low level is decoded time delay to the received signal when Received signal strength.Beginning using level rising edge as a high level, when rising edge being detected, start timing, when high level lasting time is greater than 1.5us, think effective signal, record high level number, using negative edge as a low level beginning, timing is started when I/O pin detects negative edge, the end of one group of signal is thought when low duration is greater than 20ms, then think that when I/O pin low duration is greater than 75ms the complete or Signal reception of Signal reception interrupts, restart detection signal.
The high level number that the decoding process corresponding with above-mentioned existing coded system need export and detect is more, causes signal very unstable, and the overall transmitting time of signal and time of reception longer, data rate is slow.
Summary of the invention
The technical matters that the present invention solves is, provides a kind of photon acceptor end and coding/decoding method thereof, and photon acceptor end structure of the present invention is simple, can pass through coding/decoding method high-efficiency decoding of the present invention; Coding/decoding method of the present invention solves clock period stationary problem between signal transmitting terminal and receiving end, low by the signal error rate of decoding method decodes of the present invention, stable performance.
The technical solution adopted for the present invention to solve the technical problems is, provides a kind of photon acceptor end coding/decoding method, comprises the following steps:
S1. using rising edge as the start-up portion of high level, photon acceptor end starts timing after rising edge being detected, when described high level lasting time is greater than 1.5 μ s, and photon acceptor end record high level number;
S2. using negative edge as low level start-up portion, start timing when photon acceptor end detects negative edge, when described low duration is greater than 20ms, photon acceptor end records one group of signal ended automatically;
S3. photon acceptor end calculates the cycle often organizing signal by synchronous clock, according to the described Periodic identification low level signal often organizing signal.
Preferably, when there is high level signal in 40ms after one group of signal ended, then photon acceptor end also records described high level signal in next group signal automatically according to the time complexity curve clock of high level signal.
Preferably, when there is not high level signal in 60ms after one group of signal ended, then photon acceptor end determines that the signal received is the low level signal of next group signal.
Preferably, coding/decoding method is applicable to the visible light signal decoding that photon client-side sends.
Preferably, coding/decoding method is applicable to the visible light signal decoding that mobile phone sends.
Preferably, implication is represented according to the high and low level number of often group signal of photon client-side visible light signal coded system definition photon acceptor end record.
The present invention also provides a kind of photon acceptor end, comprising:
Photodiode, for receiving the visible light signal that photon client-side sends;
The demodulator circuit be connected with photodiode, for converting the visible light signal received to digital signal;
The single-chip microcomputer be connected with demodulator circuit, decodes for carrying out and controls Lock-Picking Devices;
The power module be connected with single-chip microcomputer, powers for giving described photon acceptor end;
The equipment control circuit be connected with single-chip microcomputer, for performing unlocking action;
The hummer be connected with single-chip microcomputer, for prompt cipher mistake.
This photon acceptor end is decoded by above-mentioned coding/decoding method.
Preferably, photon acceptor end is light-operated door lock.
Preferably, power module comprises power supply and feed circuit.
Preferably, power supply is dry cell.
Beneficial effect of the present invention is, provides a kind of photon acceptor end, and this photon acceptor end structure is simple, can efficiently, accurately decode by coding/decoding method according to the present invention; The invention provides a kind of photon acceptor end coding/decoding method, lower, the stable performance of the bit error rate of the method decoding, solves the clock period stationary problem between signal transmitting terminal and receiving end.
Embodiment
Below in conjunction with drawings and the specific embodiments, the present invention will be further described.
A kind of coding method based on visible light communication, the stroboscopic visible ray coding that the stroboscopic visible ray that mobile phone flashlight can be sent and photon client-side send, the signal of 2 bits is represented by the number of high level, the signal of 2 bits has 4 types: 00, 01, 10, 11, high level be 0 namely low level time, also the signal of 2 bits can be represented, during coding, the signal of high level number and 2 bits is one to one, the signal of 2 bits divides by group, the signal of four group of 2 bit represents a byte, the cycle often organizing signal transmission is identical, the method of fixed cycle is adopted to send different signals, the transmitting time of signal does not change because sending the difference of signal, and then low level time delay is often organized in signal in minimizing, signal is sent more stable, speed is faster.
The cycle often organizing signal transmission is 57-63ms, often organize in signal low level time delay, often organize low level time delay and sum time delay often organizing signal high level between signal and equal often to organize the cycle that signal sends, high level time delay for being not less than 1ms, preferred 5ms.
Often organizing the half being not more than low level time delay in signal and often organizing the time delay of low level between signal, two groups of different signals can be distinguished time delay according to often organizing low level between signal.
When the frequency that mobile phone flashlight or photon client-side send stroboscopic visible ray is greater than 1ms, this stroboscopic visible ray is encoded by available above-mentioned coding method, preferred 5ms, 10ms.
The invention provides a kind of photon acceptor end coding/decoding method based on above coding method, the stroboscopic visible light signal that mobile phone flashlight or photon client-side can be sent is decoded, and comprises the following steps:
S1. using rising edge as the start-up portion of high level, photon acceptor end starts timing after rising edge being detected, when described high level lasting time is greater than 1.5 μ s, and photon acceptor end record high level number;
S2. using negative edge as low level start-up portion, start timing when photon acceptor end detects negative edge, when low duration is greater than 20ms, photon acceptor end records one group of signal ended automatically;
S3. photon acceptor end calculates the cycle often organizing signal by synchronous clock, according to the Periodic identification low level signal often organizing signal.
When there is high level signal in 40ms after one group of signal ended, then photon acceptor end also records high level signal in next group signal automatically according to the time complexity curve clock of high level signal.
When there is not high level signal in 60ms after one group of signal ended, then photon acceptor end determines that the signal received is the low level signal of next group signal.
Coding/decoding method of the present invention is applicable to the stroboscopic visible light signal decoding that photon client-side or mobile phone send.
The high and low level number of often group signal according to photon client-side visible light signal coded system definition photon acceptor end record represents implication.
The present invention also provides a kind of photon acceptor end, comprising:
Photodiode 101, for receiving the visible light signal that photon client-side sends;
The demodulator circuit 102 be connected with photodiode 101, for converting the visible light signal received to digital signal;
The single-chip microcomputer 104 be connected with demodulator circuit 102, decodes for carrying out and controls Lock-Picking Devices;
The power module 105 be connected with single-chip microcomputer 104, powers for giving described photon acceptor end;
The equipment control circuit 103 be connected with single-chip microcomputer 104, for performing unlocking action;
The hummer 106 be connected with single-chip microcomputer 104, for prompt cipher mistake.
This photon acceptor end is decoded by coding/decoding method of the present invention, should be appreciated that photon acceptor end is light-operated door lock.
It is understood that power module 105 comprises power supply and feed circuit, power supply is dry cell.
It is understood that the single-chip microcomputer 104 of photon acceptor end of the present invention has clock synchronous function.
Be to be understood that, the stroboscopic visible light signal that photon client-side sends is received by the photodiode 101 of photon acceptor end, be sent to demodulator circuit 102, it is the discernible digital signal of single-chip microcomputer 104 by signal receiving, single-chip microcomputer 104 is by this digital signal decoding, and confirm that whether this password is identical with the password that photon client-side sends, if identical, opertaing device control circuit 103 performs unlocking action, if difference, hummer 106 starts prompting mistake.
Embodiment 1
If low level represents 00, 1 high level represents 01, 2 high level represent 10, 3 high level represent 11, the signal transmission cycle is fixed as 59ms, the time delay of high level is 5ms, then press the signal schematic representation of this coding method transmission see Fig. 3, first preferred embodiment of the invention signal schematic representation, the signal of 2 bits is represented by low level, decrease the number of high level, make signal more stable, simultaneously, the total transmitting time of signal can not change because sending signal difference, the signal that the present embodiment photon client-side sends is 01110010, photon acceptor end is decoded to this signal:
S1. using rising edge as the start-up portion of high level, photon acceptor end starts timing after rising edge being detected, and when described high level lasting time is greater than 1.5 μ s, the high level number of photon acceptor end tracer signal is respectively 1,3,0,2;
S2. using negative edge as low level start-up portion, photon acceptor end starts timing when negative edge being detected, when low duration is greater than 20ms, photon acceptor end records one group of signal ended automatically, the present embodiment four groups of signal low durations are all more than 20ms, therefore photon acceptor end can record one group of signal ended automatically, and when there is not high level signal in 60ms after one group of signal ended, then photon acceptor end determines that the signal received is the low level signal 00 of next group signal;
S3. photon acceptor end calculates the cycle often organizing signal by synchronous clock, and the preferred embodiment of the present invention one signal period is fixed as 59ms, and the signal of therefore decoding is 01110010.
Embodiment 2
If 1 high level represents that 00,2 high level represents that 10,3 high level represent that 01,4 high level represents 11, the signal transmission cycle is fixed as 63ms, the time delay of high level is 4.7ms, then press the signal schematic representation of this coding method transmission see Fig. 4, second preferred embodiment of the invention signal schematic representation, the signal that the present embodiment sends is 00100111, and photon acceptor end is decoded to this signal:
S1. using rising edge as the start-up portion of high level, photon acceptor end starts timing after rising edge being detected, when described high level lasting time is greater than 1.5 μ s, the high level number of photon acceptor end tracer signal is respectively 1,2,3,4, when there is high level signal in 40ms after one group of signal ended, then photon acceptor end also records high level signal in next group signal automatically according to the time complexity curve clock of high level signal.
S2. using negative edge as low level start-up portion, photon acceptor end starts timing when negative edge being detected, when low duration is greater than 20ms, photon acceptor end records one group of signal ended automatically, the present embodiment four groups of signal low durations are all more than 20ms, and therefore photon acceptor end can record one group of signal ended automatically;
S3. photon acceptor end calculates the cycle often organizing signal by synchronous clock, and the preferred embodiment of the present invention binary signal cycle is fixed as 63ms, and the signal of therefore decoding is 00100111.
Above embodiment is only schematic, during coding, 1 high level also can represent 10 or 01,2 high level also can represent 00 or 11, that is the one-to-one relationship of high level number and 2 bit signals can need to arrange according to user, and therefore photon client-side coding/decoding method of the present invention can adjust according to the change of coded system.
Photon acceptor end structure of the present invention is simple, can efficiently, accurately decode by photon acceptor end coding/decoding method according to the present invention, photon acceptor end coding/decoding method provided by the invention solves that the clock period stationary problem bit error rate between signal photon client-side and photon acceptor end is lower, performance is more stable.
By reference to the accompanying drawings embodiments of the invention are described above; but the present invention is not limited to above-mentioned embodiment; above-mentioned embodiment is only schematic; instead of it is restrictive; those of ordinary skill in the art is under enlightenment of the present invention; do not departing under the ambit that present inventive concept and claim protect, also can make a lot of form, these all belong within protection of the present invention.