[embodiment]
Below in conjunction with the accompanying drawing in the embodiment of the present invention, be clearly and completely described the technical scheme in the 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 other embodiments all obtained under creative work prerequisite, belong to the scope of protection of the invention.
Embodiment one,
See Fig. 1, be that a kind of recovery that the embodiment of the present invention one provides is shaken hands synchronous method flow diagram, this recovery synchronous method of shaking hands comprises:
S101: re-power after the transmitting terminal power-off that state machine changed with the unit interval.
S102: transmitting terminal sends with form of glistening launches to receiving Ore-controlling Role the state reset signal changed with the unit interval.
Wherein, state reset signal is made up of three parts: state resets code, state indication code and primary signal (as ID).Reset code and there is unique value, with conduct optical signals, there is identical length; State indication code is a random number, is used to indicate the pseudo-code sequence which state photon acceptor end uses.State reset signal after modulator is modulated, then is launched by LED.
S103: receive the visible light signal that Ore-controlling Role receives transmitting terminal transmitting.
S104: when receipts Ore-controlling Role judges that the visible light signal of reception is state reset signal, the state of state machine is adjusted to the state of described state reset signal instruction.
S105: the state of state machine is adjusted to the state of state reset signal instruction by transmitting terminal.
Wherein, S104 and S105 occurs simultaneously.
Concrete, receive Ore-controlling Role and judge whether it is state reset signal by state replacement decision device, if so, then state indication code and ID are separated, and the state of register corresponding with No. ID in pseudo-code decision device is reset to the state indicated in state indication code.
So far, transmitting terminal and receive Ore-controlling Role and recover to shake hands synchronous, then both pseudo-code generators are by change identical for intercropping on time.Because state indication code is a random number, there is randomness, it just indicates the state that transmitting terminal uses when state resets with receipts Ore-controlling Role, so namely use high-speed camera shooting to obtain this conditional code, also the pseudo-code sequence used cannot be learnt, when to carry out Reset Status next time, state indication code becomes again another value, and the pseudo-code sequence used also can change therefrom, so take with high-speed camera the signal copied can become invalid, thus the fail safe of photon Internet of Things can be improved.
Embodiment two,
See Fig. 2, be that a kind of recovery that the embodiment of the present invention two provides is shaken hands synchronous method flow diagram, this recovery synchronous method of shaking hands comprises:
S201: the transmitting terminal that state machine changed with the unit interval is connected with receipts Ore-controlling Role.
Realize shaking hands by this step transmitting terminal and receipts Ore-controlling Role.
Wherein, each receiving terminal that Ore-controlling Role comprises system control panel and is connected with this system control panel is received.
Concrete, the state machine of transmitting terminal constantly changed with the unit interval, and when in certain time period, its state machine is also just positioned at N number of state; Transmitting terminal is connected with system control panel.
S202: receive Ore-controlling Role and adjust the state of each receiving-end state machine and the state synchronized of transmitting terminal state machine.
Concrete, the state of system control panel adjustment System parametric controller state machine and the state of each receiving-end state machine and the state synchronized of transmitting terminal state machine, such as, be positioned at N number of state.
S203: primary signal and conduct optical signals are carried out logical operation with the pseudo-code signal of present period by transmitting terminal respectively, obtains the primary signal of encryption and the conduct optical signals of encryption.
Wherein, the frequency between primary signal, conduct optical signals and pseudo-code signal is identical or there is integral multiple relation, and start-stop phase place is identical.
Primary signal is a kind of numerical sequence signal, is also referred to as base band data, can form by No. ID.Here No. ID unique identifier referring to each transmitting terminal can be 8,16, the binary digit of the bit such as 24 or 32.Suppose there be M transmitting terminal in certain photon Internet of Things, the baseband signal of that each transmitting terminal is self No. ID.Meanwhile, the state of the pseudo-code generator of each transmitting terminal is jointly determined by current time and ID.Suppose that pseudo-code generator also has N kind state, and the corresponding unique pseudo-code signal of each state, so in the T1 period, photon emitters 1 corresponding states 1, photon emitters 2 corresponding states 2 ... photon emitters M corresponding states N; And in the T2 period, photon emitters 1 corresponding states 2, photon emitters 2 corresponding states 2 ... photon emitters M corresponding states 1, circulation change like this.Can ensure like this: the same period, the pseudo-code signal that each transmitting terminal produces is different, and for same transmitting terminal, the pseudo-code signal that Different periods produces also is different.Conduct optical signals is then produced by conduct optical signals generator, is one group of complete " 1 " binary digit, as 8, and 16, the Bit such as 24 or 32.
Such as, in the T1 time, suppose that the baseband signal of transmitting terminal 1 is 00,000,000,000,000,000,000,000,000,000,110,111,111,111,111,111,111,111,111 11111111, totally 64, its first 32 is its No. ID, namely 00000000000000000000000000000110; The conduct optical signals of latter 32 complete 1.Within the T1 unit interval, the state of pseudo-code generator is state 1, is assumed to be 11101001110100111010001001001101, then its logical operation, and namely the process of XOR is as shown in table 1:
Primary signal |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
1 |
1 |
0 |
Pseudo-code signal |
1 |
1 |
1 |
0 |
1 |
0 |
0 |
1 |
1 |
1 |
0 |
1 |
0 |
0 |
1 |
1 |
1 |
0 |
1 |
0 |
0 |
0 |
1 |
0 |
0 |
1 |
0 |
0 |
1 |
1 |
0 |
1 |
Output signal |
1 |
1 |
1 |
0 |
1 |
0 |
0 |
1 |
1 |
1 |
0 |
1 |
0 |
0 |
1 |
1 |
1 |
0 |
1 |
0 |
0 |
0 |
1 |
0 |
0 |
1 |
0 |
0 |
1 |
0 |
1 |
1 |
Table 1 transmitting terminal 1 primary signal is logical operation process table within the T1 unit interval
As known from Table 1, the output signal after convolution, the primary signal of namely encrypting is 11101001110100111010001001001011.
The logical operation of conduct optical signals part and pseudo-code signal, namely the process of XOR is as shown in table 2:
Conduct optical signals |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
Pseudo-code signal |
1 |
1 |
1 |
0 |
1 |
0 |
0 |
1 |
1 |
1 |
0 |
1 |
0 |
0 |
1 |
1 |
1 |
0 |
1 |
0 |
0 |
0 |
1 |
0 |
0 |
1 |
0 |
0 |
1 |
1 |
0 |
1 |
Output signal |
0 |
0 |
0 |
1 |
0 |
1 |
1 |
0 |
0 |
0 |
1 |
0 |
1 |
1 |
0 |
0 |
0 |
1 |
0 |
1 |
1 |
1 |
0 |
1 |
1 |
0 |
1 |
1 |
0 |
0 |
1 |
0 |
Table 2 transmitting terminal 1 conduct optical signals is logical operation process table within the T1 unit interval
As known from Table 2, the output signal after logical operation, the conduct optical signals namely encrypted is 00010110001011000101110110110010.
S204: the conduct optical signals of the primary signal of encryption and encryption is merged acquisition scrambler signal by transmitting terminal.
Such as, by the primary signal 11101001110100111010001001001011 of encryption, merge with the conduct optical signals 00010110001011000101110110110010 of encryption, obtain scrambler signal 11,101,001,110,100,111,010,001,001,001,011,000,101,100,010,110,001,011,101 10110010.Herein before 32 for encryption primary signal, rear 32 be encryption conduct optical signals merge, within a particular process, also can in the past 32 be encryption conduct optical signals, rear 32 be encrypt primary signal merge, will not enumerate herein.
S205: transmitting terminal sends described scrambler signal with the form of visible light signal.
Suppose the ID signal representing transmitting terminal with ID, PW represents the conduct optical signals of transmitting terminal, and PN represents pseudo-code signal, then the scrambler signal S exported can represent with S=ID*PN+PW*PN.If the signal that now transmitting terminal is launched is copied by high-speed camera shooting, then the signal copied also is 11,101,001,110,100,111,010,001,001,001,011,000,101,100,010,110,001,011,101 10110010.
S206: receive the visible light signal that Ore-controlling Role receives S205 transmitting, and this visible light signal is converted to digital signal.
Concrete, certain receiving terminal received in Ore-controlling Role receives the visible light signal that transmitting terminal is launched, and light signal is converted to current signal, current signal is converted to voltage signal, exported by voltage signal as digital signal.
S207: receive Ore-controlling Role and decompose this digital signal, obtains the primary signal of encryption and the conduct optical signals of encryption.
S208: receive Ore-controlling Role and the conduct optical signals of encryption is carried out logical operation with all users prestored at the pseudo-code signal that present period state machine is corresponding, judge according to relevant peaks the pseudo-code signal that current state is corresponding.
Wherein S208 can have been come by the receiving terminal receiving visible light signal, also can come at system control panel.
Such as, each receiving terminal receiving Ore-controlling Role is the same with transmitting terminal, also there is identical state machine, and the state of state machine is also constantly change in time.Difference is, each transmitting terminal is a corresponding state in a period of time, just can be converted to other state, that is can only produce one group of pseudo-code signal, and this pseudo-code changes along with the change of time after this time period.And at receiving terminal, suppose to there is M transmitting terminal, namely there is M user, receive control end and there is N kind state simultaneously, namely there is N group pseudo-code signal simultaneously, each group of pseudo-code signal is not identical, this N number of pseudo-code is kept in N number of register, and each register correspond to unique transmitting terminal, i.e. No. ID and time dependent pseudo-code signal of the in store fixing transmitting terminal of each register, as No. ID of register 1 in store transmitting terminal 1 all the time, No. ID of register 2 in store transmitting terminal 2 all the time.The pseudo-code signal preserved in each register then with pseudo-code signal one_to_one corresponding in transmitting terminal, constantly changed in time by Time dependent.As in the T1 period, register 1 corresponding states 1, register 2 corresponding states 2 ... register N corresponding states N; And in the T2 period, register 1 corresponding states 2, register 2 corresponding states 2 ... register N corresponding states 1, circulation change like this.
Wherein, relevant peaks refers to the peak value of set of number sequence of gained after the conduct optical signals encrypted and pseudo-code signal logical operation, such as, the conduct optical signals of encryption is the full Serial No. of " 1 " and the result of pseudo-code signal XOR, if the conduct optical signals of encryption and all users prestored travel through at the pseudo-code signal that present period state machine is corresponding and attempt XOR, if the result peak value of computing is the Serial No. of complete 1, then prove that the pseudo-code signal that pseudo-code signal that certain receiving terminal present period state machine is corresponding is corresponding with transmitting terminal present period state machine is identical, thus obtain pseudo-code signal corresponding to receiving terminal current state.
Suppose in the T1 period, the pseudo-code signal preserved in the conduct optical signals 00010110001011000101110110110010 of encryption and N number of register carries out logical operation one by one, pass through correlated peak recognition, the sequence of 32 complete " 1 " can be obtained, thus obtain encrypting pseudo-code signal used, the pseudo-code signal namely preserved in register 1 is 11101001110100111010001001001101.
S209: receive Ore-controlling Role and adopt the primary signal of pseudo-code signal corresponding to current state to encryption to be decrypted, obtain primary signal.
Such as, pseudo-code signal 11101001110100111010001001001101 and the ID data 11101001110100111010001001001011 of encryption are carried out logical operation, obtain the ID data that is 00000000000000000000000000000110 after deciphering, thus obtain primary signal.
Supposed the T2 period, at this moment the baseband signal of transmitting terminal 1 is still 00,000,000,000,000,000,000,000,000,000,110,111,111,111,111,111,111,111,111 11111111.But at this moment its shape machine is state 2, suppose that the pseudo-code signal of its correspondence is 10101101010100101011001101011010, then its logical operation, namely the process of XOR is as shown in table 3:
Primary signal |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
1 |
1 |
0 |
Pseudo-code signal |
1 |
0 |
1 |
0 |
1 |
1 |
0 |
1 |
0 |
1 |
0 |
1 |
0 |
0 |
1 |
0 |
1 |
0 |
1 |
1 |
0 |
0 |
1 |
1 |
0 |
1 |
0 |
1 |
1 |
0 |
1 |
0 |
Output signal |
1 |
0 |
1 |
0 |
1 |
1 |
0 |
1 |
0 |
1 |
0 |
1 |
0 |
0 |
1 |
0 |
1 |
0 |
1 |
1 |
0 |
0 |
1 |
1 |
0 |
1 |
0 |
1 |
1 |
1 |
0 |
0 |
Primary signal logical operation process table within the T2 unit interval of table 3 transmitting terminal 1
As known from Table 3, the output signal after logic basis calculation, the primary signal of namely encrypting is 10101101010100101011001101011100.
Conduct optical signals and pseudo-code signal carry out logical operation, i.e. shown in the process table 4 of XOR:
Conduct optical signals |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
Pseudo-code signal |
1 |
0 |
1 |
0 |
1 |
1 |
0 |
1 |
0 |
1 |
0 |
1 |
0 |
0 |
1 |
0 |
1 |
0 |
1 |
1 |
0 |
0 |
1 |
1 |
0 |
1 |
0 |
1 |
1 |
0 |
1 |
0 |
Output signal |
0 |
1 |
0 |
1 |
0 |
0 |
1 |
0 |
1 |
0 |
1 |
0 |
1 |
1 |
0 |
1 |
0 |
1 |
0 |
0 |
1 |
1 |
0 |
0 |
1 |
0 |
1 |
0 |
0 |
1 |
0 |
1 |
Conduct optical signals logical operation process table within the T2 unit interval of table 4 transmitting terminal 1
As known from Table 4, the output signal after logical operation, the conduct optical signals namely encrypted is 01010010101011010100110010100101.
Consolidated statement 3 and table 4, the pseudo-code signal that can obtain the transmitting of transmitting terminal in the T2 unit interval is 10,101,101,010,100,101,011,001,101,011,100,010,100,101,010,110,101,001,100 10100101.
In the T2 period, receiving terminal register 1 still preserves No. ID: 00000000000000000000000000000110, because the state variation of receiving terminal is identical with transmitting terminal, so now the state of register 1 also synchronously becomes state 2, pseudo-code signal 10101101010100101011001101011010 the same as the state 2 of transmitting terminal.By previously described reception process process approach, receiving terminal also can identify the pseudo-code signal that encryption is used, and the ID data after deciphering also can be consistent with the ID data of preserving, and is legal signal.
If that is 11,101,001,110,100,111,010,001,001,001,011,000,101,100,010,110,001,011,101 10110010 go to allow receiving terminal identify with the signal that the T1 period copies in the T2 period.Pseudo-code signal used when to recognize pseudo-code signal used in pseudo-code decision device be state 1, namely 11101001110100111010001001001101, and the register preserving this pseudo-code signal is X, but can not be register 1.No. ID that preserves due to each register has uniqueness, so register X No. ID of preserving can not be 00000000000000000000000000000110, but during the ID of the signal going deciphering to copy with the pseudo-code signal that pseudo-code decision device identifies, No. ID that obtains is but 00000000000000000000000000000110, obtains the ID of mistake.Therefore, the information be replicated in the process of optical signal transmission, just can not identify receiving end in the next time period, has become expired information, thus improve the fail safe of photon Internet of Things.
S210: re-power after transmitting terminal power-off, sends with form of glistening and launches to receiving Ore-controlling Role the state reset signal changed with the unit interval.
Wherein, state reset signal is made up of three parts: state resets code, state indication code and primary signal (as ID).Reset code and there is unique value, with conduct optical signals, there is identical length; State indication code is a random number, is used to indicate the pseudo-code sequence which state photon acceptor end uses.State reset signal after modulator is modulated, then is launched by LED.
S211: when receipts Ore-controlling Role judges that the described visible light signal of reception is state reset signal, the state of state machine is adjusted to the state of state reset signal instruction; Meanwhile, the state of state machine is adjusted to the state of state reset signal instruction by transmitting terminal, and returns S203.
In this embodiment, primary signal and conduct optical signals are carried out the step of logical operation with the pseudo-code signal of present period by transmitting terminal respectively, are described for XOR, in concrete implementation process, other logical operation can also be comprised, such as logical AND, repeat no more herein.
Embodiment three,
See Fig. 3, be a kind of synchronous method flow chart of shaking hands based on visible light communication that the embodiment of the present invention three provides, the method comprises:
S301: the transmitting terminal that state machine changed with the unit interval is connected with system control panel.
Concrete, the state machine of transmitting terminal constantly changed with the unit interval, and when in certain time period, its state machine is also just positioned at N number of state; Transmitting terminal is connected with system control panel.
By this step, transmitting terminal and system control panel realize shaking hands.
S302: the state of system control panel adjustment oneself state machine and the state of each receiving-end state machine be connected with system control panel and the state synchronized of transmitting terminal state machine.
S303: primary signal and conduct optical signals are carried out logical operation with the pseudo-code signal of present period by transmitting terminal respectively, obtains the primary signal of encryption and the conduct optical signals of encryption.
Wherein, pseudo-code signal changed with the unit interval, and the pseudo-code signal of present period is dropped at subsequent time period, adopted new pseudo-code signal.Wherein, the frequency between primary signal, conduct optical signals and pseudo-code signal is identical or there is integral multiple relation, and start-stop phase place is identical.
S304: the conduct optical signals of the primary signal of encryption and encryption is merged acquisition scrambler signal by transmitting terminal.
Such as, by the primary signal 11101001110100111010001001001011 of namely encrypting, merge with the conduct optical signals 00010110001011000101110110110010 of encryption, obtain scrambler signal 11,101,001,110,100,111,010,001,001,001,011,000,101,100,010,110,001,011,101 10110010.
S305: transmitting terminal is modulated scrambler signal, obtains modulation signal.Such as, the mode such as PCM, PWM, PPM, BPSK, QPSK, QAM, QNAM and keying modulation can be adopted, scrambler signal is modulated.
S306: described modulation signal sends with the form of visible light signal by transmitting terminal.Such as, modulation signal is sent with flash of light form by LED by transmitting terminal.
S307: receiving terminal receives the visible light signal that transmitting terminal sends, and this visible light signal is converted to digital signal.
S308: receiving terminal carries out demodulation to digital signal, obtains restituted signal.Such as, the demodulation mode that the mode such as PCM, PWM, PPM, BPSK, QPSK, QAM, QNAM and keying modulation is corresponding can be adopted, demodulation is carried out to described digital signal.
S309: receiving terminal decomposes restituted signal, obtains the primary signal of encryption and the conduct optical signals of encryption.
S310: the conduct optical signals of encryption is carried out convolution algorithm with all users prestored at the pseudo-code signal that present period state machine is corresponding by receiving terminal, judges according to relevant peaks the pseudo-code signal that current state is corresponding.
Such as, receiving terminal register 1 is in the T1 period, and its state is state 1, and namely pseudo-code signal is 11101001110100111010001001001101.Now, the conduct optical signals of encryption is 00010110001011000101110110110010, carries out convolution algorithm with this random code, by correlated peak recognition, can obtain the sequence of 32 complete " 1 ", illustrate that this pseudo-code signal encrypts pseudo-code signal used just.Conduct optical signals and the pseudo-code signal of encryption carry out logical operation, and namely the process of XOR is as shown in table 5:
Table 5 receiving terminal 1 is to conduct optical signals logical operation process table within the T1 unit interval of encryption
S311: receiving terminal adopts the primary signal of pseudo-code signal corresponding to current state to encryption to be decrypted, and obtains primary signal.
Such as, the primary signal of encryption is 11101001110100111010001001001011, and carry out logical operation with pseudo-code signal 11101001110100111010001001001101, namely the process of XOR is as shown in table 6:
Table 6 receiving terminal 1 is to conduct optical signals logical operation process table within the T1 unit interval of encryption
As known from Table 6, the primary signal after deciphering, namely ID signal is 00000000000000000000000000000110.
S312: the primary signal of the primary signal of deciphering with all users prestored is compared by system control panel, judges the legitimacy of the primary signal received.If legal, then enter S314; Otherwise, enter S313.
In concrete implementation process, S312 also can substitute by following steps: the primary signal of deciphering and the primary signal prestored are compared by receiving terminal, judges the legitimacy of the primary signal received.Such as, the primary signal after deciphering is 00000000000000000000000000000110, and the primary signal prestored also is 00000000000000000000000000000110, be then judged to be that the primary signal received is legal.
If that is 11,101,001,110,100,111,010,001,001,001,011,000,101,100,010,110,001,011,101 10110010 go to allow receiving terminal identify with the signal that the T1 period copies in the T2 period.Pseudo-code signal used when to recognize pseudo-code signal used in pseudo-code decision device be state 1, namely 11101001110100111010001001001101, and the register preserving this pseudo-code signal is X, but can not be register 1.No. ID that preserves due to each register has uniqueness, so register X No. ID of preserving can not be 00000000000000000000000000000110, but during the ID of the signal going deciphering to copy with the pseudo-code signal that pseudo-code decision device identifies, No. ID that obtains is but 00000000000000000000000000000110, obtains the ID of mistake.So when carrying out ID contrast in ID decision device, both are not identical, can be judged as illegal signals.
S313: receiving terminal performs prompt action.Such as, text prompt or voice message is sent.
S314: receiving terminal controls connected functional unit action.Such as, receiving terminal access control system performs unlocking action.Or control household electrical appliance opening power, enter operating state.
S315: re-power after transmitting terminal power-off, sends with form of glistening and launches to receiving Ore-controlling Role the state reset signal changed with the unit interval.
Wherein, state reset signal is made up of three parts: state resets code, state indication code and primary signal (as No. ID).Reset code and there is unique value, with conduct optical signals, there is identical length; State indication code is a random number, is used to indicate the pseudo-code sequence which state photon acceptor end uses.State reset signal after modulator is modulated, then is launched by LED.
S316: when receipts Ore-controlling Role judges that the described visible light signal of reception is state reset signal, the state of state machine is adjusted to the state of state reset signal instruction; Meanwhile, the state of state machine is adjusted to the state of state reset signal instruction by transmitting terminal, and returns S303.
By above synchronous method, because state indication code is a random number, there is randomness, it just indicates the state that transmitting terminal uses when state resets with receipts Ore-controlling Role, so namely use high-speed camera shooting to obtain this conditional code, also the pseudo-code sequence used cannot be learnt, when to carry out Reset Status next time, state indication code becomes again another value, and the pseudo-code sequence used also can change therefrom, so take with high-speed camera the signal copied can become invalid, thus the fail safe of photon Internet of Things can be improved.
Above-mentioned embodiment of the method for the present invention to be described, embodiment to be enumerated to the hardware system running said method embodiment below and be described in detail.
Embodiment four,
See Fig. 4, it is the system configuration schematic diagram that a kind of recovery that the embodiment of the present invention four provides is shaken hands synchronous, this system 400 comprises transmitting terminal 401 and receives Ore-controlling Role 402, at least one receiving terminal 404 that this receipts Ore-controlling Role 402 comprises system control panel 403 and is connected with this system control panel.
The state machine of transmitting terminal 401 changed with the unit interval, in preset time period, be connected to realize shaking hands with receipts Ore-controlling Role 402, comprise pseudo-code generator 401a, conduct optical signals generator 401b, encoder 401c, transmitting element 401d and state reset cell 401e.
Pseudo-code generator 401a, for generation of the pseudo-code signal also exported with unit interval change.The operating state of this pseudo-code generator 401a changed with the unit interval, the pseudo-code signal exported also changes with the unit interval, such as, within the T1 unit interval, the state of pseudo-code generator 401a is state 1, and the pseudo-code signal of output is 11101001110100111010001001001101; Within the T2 time period, the state of pseudo-code generator 301a is state 2, and the pseudo-code signal of output is 10101101010100101011001101011010.
Conduct optical signals generator 401b, for exporting conduct optical signals.The frequency of this conduct optical signals generator 401b is identical with the operating frequency of pseudo-code generator or there is the relation of integral multiple.
The encoder 401c be connected with conduct optical signals generator 401b and pseudo-code generator 401a, for the conduct optical signals exported primary signal and conduct optical signals generator 401b, the pseudo-code signal exported with pseudo-code generator 401a present period respectively carries out logical operation, obtain the primary signal of encryption and the conduct optical signals of encryption, the conduct optical signals of the primary signal of encryption and encryption is merged acquisition scrambler signal.Such as, by the primary signal 11101001110100111010001001001011 of encryption, merge with the conduct optical signals 00010110001011000101110110110010 of encryption, obtain scrambler signal 11,101,001,110,100,111,010,001,001,001,011,000,101,100,010,110,001,011,101 10110010.Herein before 32 for encryption primary signal, rear 32 be encryption conduct optical signals merge, within a particular process, also can in the past 32 be encryption conduct optical signals, rear 32 be encrypt primary signal merge.
The transmitting element 401d be connected with encoder 401c, sends with the form of visible light signal for the scrambler signal exported by encoder 401c.Wherein, transmitting element 401d can be light-emitting diode, also can be that other has the element of lighting function.
The state reset cell 401e be connected with pseudo-code generator 401a and transmitting element 401d, after re-powering for transmitting terminal 401 power-off, launch to receiving Ore-controlling Role the state reset signal changed with the unit interval by transmitting element 401d, send condition indicative signal to transmission pseudo-code generator 401a, the pseudo-code sequence which state instruction current slot uses corresponding simultaneously.Wherein, state reset signal comprises state and resets code, state indication code and primary signal (as No. ID), resets code and has unique value, have identical length with conduct optical signals; Condition indicative signal is a random number, consistent with the state indication code in the state reset signal sending to receiving terminal, therefore after transmitting terminal power-off re-powers, the state residing for it may be state X, and encrypting the pseudo-code sequence used also is pseudo-code sequence corresponding to state X.
Wherein, transmitting terminal 401 for the sub-client of dedicated optical, mobile phone and can have the hand-hold electronic equipments launching visible light signal function.
The state synchronized of receiving terminal 404 and transmitting terminal present period state machine.After the state machine of transmitting terminal 401 and the state machine synchronization of receiving terminal 404, do identical change with unit interval and the state of the state machine of transmitting terminal 401.
Receiving terminal 404 comprises receiving element 402a, state resets decision device 402b, pseudo-code decision device 402c and decoder 402d.
Receiving element 402a, receives the visible light signal that transmitting terminal 301a launches, and this visible light signal is converted to digital signal.
The state be connected with receiving element 402a resets decision device 402b, digital signal for changing gained to receiving element 402a is decomposed, be decomposed into and reset code part, state indication code part and ID part, and replacement code and set particular value are contrasted, when the condition is matched, confirm that the visible light signal received is state reset signal, export the instruction of the state state of state machine being adjusted to the instruction of described state reset signal to pseudo-code decision device 402c, wherein, this instruction comprises state indication code part and ID part; When condition is not mated, export the conduct optical signals of encryption and the primary signal of encryption.
Reset with state the pseudo-code decision device 402c that decision device 402b is connected, for receive state reset the instruction that decision device 402b sends time, state machine state is adjusted to the state indicated by instruction.When receiving the conduct optical signals of encryption, the conduct optical signals of encryption is carried out logical operation with all users in the photon Internet of things system prestored at the pseudo-code signal that present period state machine is corresponding by this pseudo-code criterion device, such as, after convolution algorithm, judge according to relevant peaks the pseudo-code signal that current state is corresponding.
Reset with state the decoder 402d that decision device 402b and pseudo-code decision device 402c is connected, the pseudo-code signal exported for adopting pseudo-code decision device 402c is decrypted the primary signal that state resets the encryption that decision device 402b exports, and obtains primary signal.In concrete implementation process, decoder 402d has caching function, the primary signal of the encryption that decision device 402b exports is reset for buffer status, or reset between decision device 402b and decoder 402d in state and be connected with buffer unit, the primary signal being used for resetting state the encryption that decision device 402b exports carries out buffer memory.
In specific implementation process, the ID decision device that is connected with decoder 402d can also be comprised and be connected concrete equipment with this decision device, as door lock, household electrical appliance etc.
Embodiment five,
See Fig. 5, be the system configuration schematic diagram that a kind of recovery that the embodiment of the present invention five provides is shaken hands synchronous, relative to embodiment four, transmitting terminal 401 also comprises:
Be connected to the modulator 401f between described encoder 401c and transmitting element 401d, for modulating scrambler signal.
Accordingly, receiving terminal 402 also comprises:
Be connected between receiving element 402a and state replacement decision device 402b, carry out the demodulator 402e of demodulation for the digital signal exported receiving element 402a.
Further, receiving terminal 402 also comprises:
The primary signal decision device 402f be connected with decoder 402d and pseudo-code decision device 402c, for the primary signal prestored in the primary signal of deciphering and pseudo-code decision device being compared, judge the legitimacy of primary signal received.In concrete implementation process, primary signal decision device 402f has caching function, primary signal for exporting pseudo-code criterion device 402c carries out buffer memory, also can be connected a buffer at pseudo-code criterion device 402c with between primary signal decision device 402f, by this buffer, buffer memory be carried out to the primary signal that pseudo-code criterion device 402c exports.
In concrete implementation process, synchro system 300 also comprises the functional unit be connected with receiving element 402, such as electric lock etc.
Be described in detail the embodiment of the present invention above, apply specific case herein and set forth principle of the present invention and execution mode, the explanation of above embodiment just understands method of the present invention and core concept thereof for helping; Meanwhile, for one of ordinary skill in the art, according to thought of the present invention, all will change in specific embodiments and applications, in sum, this description should not be construed as limitation of the present invention.