WO2014019526A1 - 可见光的加密方法、解密方法、通信装置及通信系统 - Google Patents

可见光的加密方法、解密方法、通信装置及通信系统 Download PDF

Info

Publication number
WO2014019526A1
WO2014019526A1 PCT/CN2013/080579 CN2013080579W WO2014019526A1 WO 2014019526 A1 WO2014019526 A1 WO 2014019526A1 CN 2013080579 W CN2013080579 W CN 2013080579W WO 2014019526 A1 WO2014019526 A1 WO 2014019526A1
Authority
WO
WIPO (PCT)
Prior art keywords
signal
visible light
pseudo code
code sequence
light signal
Prior art date
Application number
PCT/CN2013/080579
Other languages
English (en)
French (fr)
Inventor
刘若鹏
栾琳
肖光锦
Original Assignee
深圳光启创新技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Priority claimed from CN201210268555.5A external-priority patent/CN102820922B/zh
Priority claimed from CN201210277987.2A external-priority patent/CN102833065B/zh
Priority claimed from CN201310314157.7A external-priority patent/CN103840891B/zh
Priority claimed from CN201310323062.1A external-priority patent/CN104348607B/zh
Application filed by 深圳光启创新技术有限公司 filed Critical 深圳光启创新技术有限公司
Priority to JP2015524622A priority Critical patent/JP6082461B2/ja
Priority to EP13825464.4A priority patent/EP2882117B1/en
Priority to KR1020157003312A priority patent/KR101670194B1/ko
Publication of WO2014019526A1 publication Critical patent/WO2014019526A1/zh
Priority to US14/608,793 priority patent/US10250384B2/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0816Key establishment, i.e. cryptographic processes or cryptographic protocols whereby a shared secret becomes available to two or more parties, for subsequent use
    • H04L9/0852Quantum cryptography
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04BTRANSMISSION
    • H04B10/00Transmission systems employing electromagnetic waves other than radio-waves, e.g. infrared, visible or ultraviolet light, or employing corpuscular radiation, e.g. quantum communication
    • H04B10/11Arrangements specific to free-space transmission, i.e. transmission through air or vacuum
    • H04B10/114Indoor or close-range type systems
    • H04B10/116Visible light communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords
    • H04L9/0869Generation of secret information including derivation or calculation of cryptographic keys or passwords involving random numbers or seeds
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/12Transmitting and receiving encryption devices synchronised or initially set up in a particular manner
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2209/00Additional information or applications relating to cryptographic mechanisms or cryptographic arrangements for secret or secure communication H04L9/00
    • H04L2209/80Wireless
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y04INFORMATION OR COMMUNICATION TECHNOLOGIES HAVING AN IMPACT ON OTHER TECHNOLOGY AREAS
    • Y04SSYSTEMS INTEGRATING TECHNOLOGIES RELATED TO POWER NETWORK OPERATION, COMMUNICATION OR INFORMATION TECHNOLOGIES FOR IMPROVING THE ELECTRICAL POWER GENERATION, TRANSMISSION, DISTRIBUTION, MANAGEMENT OR USAGE, i.e. SMART GRIDS
    • Y04S40/00Systems for electrical power generation, transmission, distribution or end-user application management characterised by the use of communication or information technologies, or communication or information technology specific aspects supporting them
    • Y04S40/20Information technology specific aspects, e.g. CAD, simulation, modelling, system security

Definitions

  • the present invention relates to the field of communications, and more particularly to an encryption method, a decryption method, a communication device, and a communication system for visible light.
  • the traditional Internet of Things generally interconnects through various wireless or wired communication networks, using conventional communication technologies. Recently, an Internet of Things technology that uses visible light to transmit short-range communication in free space has emerged. This kind of Internet of Things using visible light communication technology is called photonic Internet of Things.
  • the photonic IoT has the function of the traditional Internet of Things, but the communication method uses visible light for communication. Since visible light has high directivity and cannot penetrate obstacles, it has higher security than wireless communication.
  • the Photonic IoT already has some visible light communication systems that synchronize encryption and decryption.
  • This system uses the synchronous method to allow the visible light transmitter and the receiver to always use the same and time-changing pseudo code sequence for encryption and decryption.
  • the stroboscopic signal captured and reproduced by the high-speed camera can be disabled, and can not be recognized by the receiver, thereby effectively preventing the safety hazard.
  • the synchronous encryption and decryption visible light communication system utilizes handshake synchronization by separately scrambling the light guiding signal and the baseband data in the transmitter, and then synthesizing a set of signals and transmitting them by modulation.
  • the pseudo-code decision is performed on the light guide signal encrypted therein, and the pseudo code sequence used for encryption is selected by traversing the query, and then the baseband data is decrypted, and finally the decrypted ID is decrypted by the ID determiner.
  • the information and the ID information held by the corresponding register are judged to determine whether it is a legal signal or an illegally copied signal, thereby completing the decryption.
  • the use of such a synchronous visible light communication system requires time in the visible light transmitter and the visible light receiver.
  • the changes must be identical, that is, the internal clocks of the transmitter and receiver must be identical, and the time error must be very small. It is difficult to achieve complete agreement on the crystal components currently used, and the longer the time used, the two The time difference of the time system is larger, and finally the synchronization information is lost, resulting in inconsistent state changes between the transmitter and the receiver, that is, the pseudo code sequence used by the two may change when one end changes, and the other end does not reach the change.
  • the embodiments of the present invention provide an encryption method, a decryption method, a communication device, and a communication system for visible light, which may cause decryption failure in encryption and decryption in visible light.
  • a method for decrypting a visible light signal including: receiving a visible light signal from a transmitting end, wherein the visible light signal is encrypted by a key at the transmitting end; acquiring the key, Decrypting the visible light signal according to the key, wherein acquiring the key comprises: acquiring the key corresponding to a state of a state machine of the receiving end; or acquiring the information according to the visible light signal for obtaining The indication information of the key is obtained according to the indication information.
  • the obtaining the indication information for obtaining the key according to the visible light signal comprises: converting the received visible light signal into a digital signal; Decomposing the signal into a signal including a pseudo code sequence indicator code and a pseudo code signal; querying a pseudo code sequence corresponding to the pseudo code sequence indicator code, wherein the pseudo code sequence is the key; according to the pseudo code sequence pair The pseudo code signal is decrypted.
  • the digital signal is decomposed into a signal including a pseudo code sequence indicator code and a pseudo code signal
  • querying the pseudo code sequence corresponding to the pseudo code sequence indicator code comprises: decomposing the digital signal into a device addressing code and a first combined signal; decomposing the first combined signal into the pseudo code sequence indicator code and the pseudo code signal; determining, according to the device addressing code, the legitimacy of the pseudo code sequence indicator code, if If it is legal, the pseudo code sequence corresponding to the pseudo code sequence indicator code is queried.
  • the querying the pseudo code sequence corresponding to the pseudo code sequence indicator comprises: determining whether the code is valid according to the received pseudo code sequence indicator, and querying the pseudo code sequence corresponding to the pseudo code sequence indicator according to the law; wrong password.
  • the method further includes: querying the device corresponding ID information according to the device addressing code, and comparing the ID information with the decoded ID information. If the determination is legal, the legal ID information is output.
  • the method further includes: controlling the corresponding device according to the legal ID information.
  • the method further comprises: demodulating the digital signal.
  • the determining, according to the device addressing code, the validity of the pseudo code sequence indicator code comprises: when the pseudo code sequence indicator code is a large number from small to large, according to the device The addressing code queries the received pseudo code sequence indicator, if the pseudo code sequence indicator is less than or equal to the received pseudo code sequence indicator, the determination is invalid, otherwise the determination is legal; or, when the pseudo code
  • the sequence indicator code is a large number that does not loop from large to small
  • the received pseudo code sequence indicator code is queried according to the device addressing code, if the pseudo code sequence indicator code is greater than or equal to the received pseudo code. If the sequence indicator is used, the judgment is invalid, otherwise the judgment is legal.
  • decrypting the pseudo code signal according to the pseudo code sequence comprises: performing logical operations on the pseudo code sequence and the pseudo code signal to decrypt the pseudo code signal.
  • the indication information for obtaining the key according to the visible light signal comprises: determining, according to the visible light signal, a clock variation parameter of the transmitting end and a clock variation parameter of the receiving end; according to the clock of the transmitting end The change parameter and the clock change parameter of the receiving end determine a clock speed factor of the transmitting end; and the clock information of the transmitting end locally stored by the receiving end is updated every predetermined time according to the clock speed factor of the transmitting end, where The clock information is indication information for obtaining the key.
  • the clock change parameter of the transmitting end refers to a standard time actually experienced by a unit time corresponding to the system time of the transmitting end
  • the clock change parameter of the receiving end refers to the system time corresponding to the receiving end.
  • the standard time actually experienced per unit time, wherein the standard time actually experienced is measured in units of the system period of the crystal oscillator of the receiving end.
  • the clock speed factor of the transmitting end is a ratio of a standard time actually experienced by the unit time corresponding to the system time of the receiving end to a standard time actually experienced by the unit time corresponding to the system time of the transmitting end.
  • the predetermined time is a predetermined time of the system time of the receiving end
  • the error of the clock information of the transmitting end locally stored by the receiving end is the predetermined time minus the predetermined time Determining a product of a clock speed factor of the transmitting end and the predetermined time, wherein updating the clock information of the transmitting end locally stored by the receiving end comprises subtracting the error by using the locally stored clock information of the transmitting end.
  • said unit time is a nominal duration of an optical pulse of said visible light signal received from said transmitting end, said nominal duration being equal to a reciprocal of a nominal baud rate of said visible light signal.
  • the standard time actually experienced by the unit time corresponding to the system time of the transmitting end is obtained by measuring the duration of one light pulse of the visible light signal received from the transmitting end at the receiving end and
  • the system period of the crystal oscillator of the receiving end is recorded as a unit of M ⁇ T2
  • the standard time actually experienced by the unit time corresponding to the system time of the receiving end is calculated as ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ , where
  • the nominal duration of a light pulse of a visible light signal, 2 »* is the nominal frequency of the crystal at the receiving end, and the system period of the crystal at the receiving end.
  • measuring the duration of an optical pulse of said visible light signal received from said transmitting end at said receiving end comprises: converting said visible light signal received from said transmitting end into a digital signal; and from said digital The high level or low level of a pulse of the signal begins until the high level or low level ends, and how many are counted, the resulting number is preferably, the one to be received from the transmitting end
  • Converting the visible light signal into a digital signal comprises: converting the visible light signal into an electrical pulse signal by a photodiode, outputting a high voltage level when a current value passed by the photodiode is higher than a threshold value, and when the photodiode The low voltage level is output when the passing current value is lower than the threshold value.
  • the threshold value is determined according to a predetermined mathematical model by at least a distance between the receiving end and the transmitting end.
  • the method further includes: repeating, after each receiving the visible light signal from the transmitting end, determining the clock variation parameter of the transmitting end and the clock variation parameter of the receiving end to update the stored location of the transmitting end The steps of the clock information.
  • the corresponding pseudo code signal is selected according to the stored clock information of the transmitting end to decode the received visible light signal.
  • the clock information of the transmitting end locally stored by the receiving end is initially stored and associated with the identifier of the transmitting end when the receiving end first receives the visible light signal of the transmitting end and is set equal to The clock information at the receiving end.
  • acquiring the key corresponding to the state of the state machine of the receiving end and decrypting the visible light signal according to the key comprises: acquiring and using the current state of the state machine with the receiving end and the current state
  • the visible light signal is decrypted by a key corresponding to at least one of the preceding and/or following states, wherein the visible light signal is encrypted with a key that varies with the state of the state machine of the transmitting end.
  • decrypting the visible light signal with a key corresponding to the current state of the state machine of the receiving end and the at least one state before and/or after the current state comprises: Decrypting the visible light signal by a key corresponding to the current state of the state machine of the receiving end; and if the decryption of the visible light signal is unsuccessful by using a key corresponding to the current state of the state machine of the receiving end, The visible light signal is then decrypted with a key corresponding to the at least one state before and/or after the current state.
  • the visible light signal is decrypted with a key corresponding to the at least one state before and/or after the current state: in a predetermined order before and/or after the current state Decrypting the visible light signal by a key corresponding to each of the at least one state until the visible light signal is successfully decrypted or used in the at least one state before and/or after the current state
  • the key corresponding to all the states decrypts the visible light signal.
  • the visible light signal comprises communication data and an identifier of the transmitting end.
  • the communication data is encrypted with the key that changes with the state of the state machine of the transmitting end, and the identifier of the transmitting end is not encrypted, and the receiving end locally stores and Communication data associated with the identifier of the transmitting end.
  • the communication data includes user information
  • the user information includes ID information, a fingerprint, a face, an iris, an input password, or a combination of two or more
  • the method further includes: if Decoding the visible light signal as the current state of the state machine of the receiving end and the decryption of the visible light signal by the key corresponding to the at least one state before and/or after the current state is not successful Illegal signal, otherwise the visible light signal is identified as a legitimate signal.
  • decrypting the visible light signal with a key corresponding to the current state of the state machine of the receiving end and the at least one state before and/or after the current state comprises: using in a predetermined order Decrypting the visible light signal with a key corresponding to the current state and each of the at least one state before and/or after the current state until the visible light signal is successfully decrypted or used The visible light signal is decrypted with a key corresponding to the current state and all of the at least one state before and/or after the current state.
  • said at least one state comprises a predetermined number of states prior to said current state and said predetermined number of states subsequent to said current state.
  • a key that changes with the state of the state machine of the transmitting end and a key corresponding to the current state of the state machine of the receiving end and the at least one state before and/or after the current state It is a sequence that changes over time.
  • said sequence of time varying is a pseudo code sequence, said method further comprising converting said visible light signal into a digital signal, wherein said decrypting comprises a logical AND, logical OR of said digital signal and a pseudo code sequence A logical exclusive OR, or a combination of two or more of the above.
  • a communication apparatus including: a receiver, configured to receive a visible light signal from a transmitting end, where the visible light signal is encrypted by a key at the transmitting end; a decoder, And acquiring the key, and decrypting the visible light signal according to the key, where acquiring the key comprises: acquiring the key corresponding to a state of a state machine of a receiving end; or The indication information obtained by the visible light signal for obtaining the key is obtained, and the key is acquired according to the indication information.
  • the receiver is a visible light receiver for receiving a visible light signal and outputting a digital signal
  • the decoder comprises: a pseudo component for decomposing the digital signal into a pseudo code sequence indicator code and a pseudo code signal a code sequence indicator decoding unit; a pseudo code sequence query unit for querying a pseudo code sequence corresponding to the pseudo code sequence indicator, wherein the pseudo code sequence is the key; and the pseudo code sequence is used to
  • the pseudo code signal performs a logical operation, and outputs a convolutional decoder of the logical operation result.
  • the decoder further comprises: a device addressing code decomposing unit for decomposing the digital signal into a device addressing code and a first combining signal; the pseudo code sequence indicating code decomposition unit, Decoding the first combined signal into a pseudo code sequence indicator code and a pseudo code signal; the pseudo code sequence query unit is configured to determine, according to the device addressing code, the legality of the pseudo code sequence indicator code, if legal And querying the pseudo code sequence corresponding to the pseudo code sequence indicator code. .
  • the pseudo code sequence query unit is configured to determine whether the code is normal according to the received pseudo code sequence indicator code, and if the law is to query the pseudo code code sequence corresponding to the pseudo code sequence indicator code, if the code is not legal, the password is incorrect.
  • the apparatus further comprises: a query unit for querying corresponding ID information according to the device addressing code; and ID information for outputting the convolutional decoder and ID information output by the query unit For comparison, if the same decision is legal, the ID determiner of the legal ID information is output.
  • the device further comprises: a device control circuit connected to the ID determiner, configured to control the corresponding device according to the received ID information.
  • the apparatus further includes: a demodulator connected between the visible light receiver and the device addressing code decomposition unit for demodulating the digital signal.
  • said receiver receives a visible light signal from a transmitting device, said visible light signal being encrypted at least in part by a key that varies with a state of a state machine of said transmitting device;
  • the decoder decrypts the visible light signal with a key corresponding to a current state of the state machine of the communication device and at least one state before and/or after the current state.
  • said decoder decrypts said visible light signal with a key corresponding to said current state of said state machine of said communication device, and if said current state corresponding to said state machine of said communication device The decryption of the visible light signal by the key is unsuccessful, and then the visible light signal is continued to be decrypted with a key corresponding to the at least one state before and/or after the current state.
  • said decoder decrypts said visible light signal with a key corresponding to each of said at least one state before and/or after said current state in a predetermined order until said visible light signal The visible light signal is successfully decrypted or has been decrypted using a key corresponding to all of the at least one state before and/or after the current state.
  • said decoder decrypts said visible light signal in a predetermined order with a key corresponding to said current state and each of said at least one state before and/or after said current state, The visible light signal is decrypted until the visible light signal is successfully decrypted or has been used with a key corresponding to the current state and all of the at least one state before and/or after the current state.
  • the receiver is configured to receive a visible light signal from a transmitting end;
  • the decoder includes: a clock change parameter determining module, configured to determine a clock change parameter of the transmitting end according to the visible light signal received from the transmitting end a clock change parameter of the communication device; a clock speed factor determining module, determining a clock speed factor of the transmitting end according to the clock change parameter of the transmitting end and the clock change parameter of the communication device; and a clock information adjusting module And updating the clock information of the transmitting end stored locally by the communication device every predetermined time according to the clock speed factor of the transmitting end.
  • the clock change parameter of the transmitting end refers to a standard time actually experienced by a unit time corresponding to the system time of the transmitting end
  • the clock change parameter of the communication device refers to a system time corresponding to the communication device.
  • the standard time actually experienced by the unit time wherein the standard time actually experienced is measured in units of the system period of the crystal oscillator of the communication device.
  • the clock speed factor determining module determines a clock speed factor of the transmitting end as a standard time actually experienced by the unit time corresponding to a system time of the communication device and the unit corresponding to a system time of the transmitting end. The ratio of the standard time actually experienced by time.
  • the predetermined time is a predetermined time of a system time of the communication device
  • the error of the clock information of the transmitting end stored locally by the communication device is the predetermined time minus every predetermined time
  • said unit time is a nominal duration of an optical pulse of said visible light signal received from said transmitting end, said nominal duration being equal to a reciprocal of a nominal baud rate of said visible light signal.
  • the standard time actually experienced by the unit time corresponding to the system time of the transmitting end is measured by the clock variation parameter module at the communication device for measuring a light pulse of the visible light signal received from the transmitting end
  • the duration is obtained and recorded in units of the system period of the crystal oscillator of the communication device as a system, and the standard time actually experienced by the unit time corresponding to the system time of the communication device is calculated by the clock variation parameter For ( ⁇ « ⁇ ⁇ ** ⁇ 7 ⁇ , where ⁇ * is the nominal duration of a light pulse of the visible light signal, /2 «» is the nominal frequency of the crystal of the communication device, and ⁇ is the system period of the crystal of the communication device.
  • the decoder is further configured to select a corresponding pseudo code signal to receive the visible light signal according to the stored clock information of the transmitting end when receiving the visible light signal from the transmitting end each time.
  • Decode a method for encrypting a visible light signal is provided, including: encrypting a data usage key; transmitting the encrypted data as a visible light signal, wherein the key is associated with a transmitting end The state of the state machine changes, or the visible light signal carries indication information for obtaining the key.
  • the visible light signal carries the indication information
  • the data is encrypted by using the key
  • transmitting the encrypted data as the visible light signal comprises: generating a generated pseudo code sequence and The data is encoded to obtain a pseudo code signal, where the pseudo code sequence is the key; and the pseudo code sequence indicator code corresponding to the pseudo code sequence is merged into the pseudo code signal header, and the obtained a combined signal of the pseudo code sequence indicator code and the pseudo code signal; the combined signal is transmitted in the form of visible light.
  • obtaining a combined signal including the pseudo code sequence indicator code and the pseudo code signal, and transmitting the combined signal in the form of visible light comprises: merging the pseudo code sequence indicator code corresponding to the pseudo code sequence into the a pseudo-code signal header, obtaining a first combined signal; combining the device addressing code in the first combined signal header to obtain a second combined signal: transmitting the second combined signal in visible form.
  • the method before the transmitting the second combined signal in the form of a visible light signal, the method further includes: modulating the second combined signal.
  • the pseudo code sequence indicates that the code is a large number that does not cycle from small to large or from large to small, and varies with the number of times of transmitting signals.
  • a communication device including: an encryption device, configured to encrypt a data usage key, and a transmitting unit, configured to transmit the encrypted data as a visible light signal, where The key changes according to a state change of a state machine of the transmitting end, or the visible light signal carries indication information for obtaining the key.
  • the encryption device includes: a pseudo code generator for outputting a pseudo code sequence and a corresponding pseudo code sequence indicator code; a volume for performing logical operations on the pseudo code sequence and the data, and outputting a pseudo code signal a code encoder; configured to merge the pseudo code sequence indicator into the pseudo code signal header, and output a pseudo code sequence indicator combining unit including the pseudo code sequence indicator and the combined signal of the pseudo code signal;
  • the pseudo code sequence is the key
  • the pseudo code sequence indicator code is the indication information
  • the transmitting unit is configured to send the combined signal in the form of a visible light signal.
  • the pseudo code sequence indicator code combining unit is further configured to merge the pseudo code sequence indicator code into the pseudo code signal header, and output a first merge signal;
  • the encryption device further includes: a first combined signal header merging device addressing code, a device addressing code combining unit that outputs a second combined signal; and a transmitting unit configured to transmit the second combined signal in the form of a visible light signal.
  • said transmitting means further comprises a modulator coupled between said device addressing code processing unit and said transmitting unit for modulating said second combined signal.
  • the transmitting unit is an LED lamp.
  • the pseudo code sequence indicates that the code is a large number that does not cycle from small to large or from large to small, and varies with the number of times of transmitting signals.
  • a communication system comprising: the above communication device.
  • the invention solves the problem of the inability to decrypt in the visible light encryption and decryption, and improves the accuracy of the decryption.
  • FIG. 1 is a schematic flowchart of a method for asynchronously encrypting visible light communication according to an embodiment of the present invention
  • FIG. 2 is a schematic diagram showing a structure of a transmitting end of an asynchronous encrypted visible light communication system according to an embodiment of the present invention
  • FIG. 4 is a schematic diagram of a structure of a transmitting signal according to an embodiment of the present invention
  • FIG. 4 is a schematic structural diagram of a transmitting apparatus based on multi-user asynchronous encryption according to an embodiment of the present invention
  • FIG. 3 is a flowchart of a method for transmitting based on multi-user asynchronous encryption according to an embodiment of the present invention
  • FIG. FIG. 5 is a schematic diagram of a data structure of a second merged data provided by an embodiment of the present invention
  • FIG. 5 is a schematic diagram showing a data structure of a second merged data provided by an embodiment of the present invention
  • FIG. Figure c2 is a visible light diagram that can be seen in Figure cl
  • FIG. c3 is a schematic diagram showing changes in state of a transmitting end and a receiving end in the visible light communication system of FIG. 1c;
  • FIG. 4 is a diagram showing use in a visible light communication system A flowchart of a loose decryption method;
  • FIG. c5 is a block diagram showing a communication device;
  • Figure c6 is a block diagram showing a communication device;
  • Figure d1 is a block diagram showing a visible light communication system in which the present invention can be implemented;
  • Figure d2 is a diagram showing an encryption and decryption method usable in the visible light communication system of Figure dl
  • Figure d3 is a schematic diagram showing the state of the transmitting end and the receiving end in the visible light communication system of Figure dl as a function of time;
  • Figure d4 is a diagram showing the automatic adjustment of the visible light communication system according to an aspect of the present invention A flowchart of a method of clock in the middle;
  • Figure d5 is a block diagram showing a communication device in accordance with an aspect of the present invention;
  • Figure d6 is a block diagram showing a communication device in accordance with
  • a method for decrypting a visible light signal including: receiving a visible light signal from a transmitting end, wherein the visible light signal is encrypted by a key at the transmitting end; acquiring the key, and according to the key Decrypting the visible light signal, wherein: obtaining the key comprises: acquiring the key corresponding to the state of the state machine of the receiving end; or obtaining the indication information for obtaining the key according to the visible light signal and acquiring according to the indication information The key.
  • the key corresponding to the state machine state is adopted, or the indication information is used to indicate the key used by the receiving end, thereby solving the problem that the decryption has the possibility of failure in the related art.
  • the obtaining the indication information for obtaining the key according to the visible light signal comprises: converting the received visible light signal into a digital signal; and decomposing the digital signal into a pseudo code a sequence indicator code and a signal of the pseudo code signal; querying the pseudo code sequence corresponding to the pseudo code sequence indicator code, wherein the pseudo code sequence is the key; and decrypting the pseudo code signal according to the pseudo code sequence.
  • the digital signal is decomposed into a signal including a pseudo code sequence indicator code and a pseudo code signal
  • querying the pseudo code sequence corresponding to the pseudo code sequence indicator code comprises: decomposing the digital signal into a device addressing code and a first merge Transmitting the first combined signal into the pseudo code sequence indicator code and the pseudo code signal; determining the legality of the pseudo code sequence indicator according to the device addressing code, and if so, querying the pseudo code sequence The pseudo code sequence corresponding to the indicator code.
  • the following embodiment further provides a communication device, the device comprising: a receiver, configured to receive a visible light signal from a transmitting end, wherein the visible light signal is encrypted by a key at the transmitting end; and a decoder is configured to acquire the secret Decrypting the visible light signal according to the key, and acquiring the key includes: acquiring the key corresponding to the state of the state machine of the receiving end; or acquiring the key according to the visible light signal
  • the indication information is obtained according to the indication information.
  • a method for encrypting a visible light signal including: encrypting a data using a key; and transmitting the encrypted data as a visible light signal, wherein the key changes according to a state of the state machine of the transmitting end.
  • the visible light signal carries indication information for obtaining the key.
  • the encryption method uses a method in which an optical signal carries indication information or a key corresponding to a state machine state, thereby solving the problem that the decryption has a possibility of failure in the related art.
  • the visible light signal carries the indication information
  • the data is encrypted by using the key
  • transmitting the encrypted data as the visible light signal comprises: encoding the generated pseudo code sequence and the data to obtain a pseudo code signal, wherein the pseudo code sequence is the key; and the pseudo code sequence indicator code corresponding to the pseudo code sequence is merged into the pseudo code signal header to obtain a combination including the pseudo code sequence indicator code and the pseudo code signal Signal; the combined signal is transmitted in the form of visible light.
  • obtaining the combined signal including the pseudo code sequence indicator code and the pseudo code signal, and transmitting the combined signal in the form of visible light comprises: combining the pseudo code sequence indication code corresponding to the pseudo code sequence into the pseudo code signal header, Obtaining a first combined signal; combining the device addressing code in the first combined signal header to obtain a second combined signal: transmitting the second combined signal in visible form.
  • a communication device including: an encryption device, configured to encrypt a data usage key; and a transmitting unit, configured to transmit the encrypted data as a visible light signal, where the key is associated with the transmitting end The state of the state machine changes, or the visible light signal carries indication information for obtaining the key.
  • the encryption apparatus comprises: a pseudo code generator for outputting a pseudo code sequence and a corresponding pseudo code sequence indicator; a convolutional encoder for performing a logical operation on the pseudo code sequence and the data, and outputting the pseudo code signal And combining the pseudo code sequence indicator code into the pseudo code signal header, and outputting a pseudo code sequence indicator code combining unit including the pseudo code sequence indicator code and the combined signal of the pseudo code signal; wherein the pseudo code sequence is The key, the pseudo code sequence indicator is the indication information, and the transmitting unit is configured to send the combined signal in the form of a visible light signal.
  • the pseudo code sequence indicator code combining unit is configured to merge the pseudo code sequence indicator code into the pseudo code signal header, and output a pseudo code sequence indicator code of the first combined signal.
  • the apparatus further includes: The signal header merges the device addressing code, and the device addressing code combining unit outputs the second combined signal.
  • the transmitting unit is configured to transmit the second combined signal in the form of a visible light signal.
  • the baseband data and the pseudo code sequence generated by the pseudo code generator 101 perform logical operations in the convolutional encoder 102 to obtain data to be encrypted (for example, the data may include ID data, and the encrypted data may also be pseudo code.
  • the signal is described below by taking the ID data as an example.
  • the encrypted ID data is transmitted to the pseudo code sequence designating code processing unit 103, and the pseudo code sequence indicating code is added and sent to the modulator 104 for signal modulation.
  • the modulated signal is sent to the LED 105, and the LED 105 transmits the modulated signal to the visible light receiver in the form of a stroboscopic visible light signal.
  • the visible light receiver 201 converts the stroboscopic visible light signal into a binary digital signal for transmission to the demodulator 202 for demodulation, and the demodulator 202 transmits the demodulated signal to the pseudo code sequence designating code processing unit 203.
  • the pseudo code sequence indicator processing unit 203 separates the demodulated signal into two parts, a pseudo code sequence indicator code and an encrypted ID data, and sends the pseudo code sequence indicator code to the pseudo code sequence query unit 204 to send the encrypted ID data.
  • the pseudo-code sequence query unit 204 determines whether the code is based on the received pseudo-code sequence indication code. If it is legal, it queries the corresponding pseudo-code sequence, and sends the pseudo-code sequence to the convolutional decoder 205. If it is illegal, the password is incorrect.
  • the encrypted ID data and the queried pseudo code sequence are XORed in the convolutional decoder 205 to obtain the decrypted ID data, and sent to the ID determiner 206.
  • the ID determiner 206 compares the ID data with the set ID data, and if it is the same, it is legal, and sends the valid ID data to the device control circuit 207. Otherwise, the password is incorrect.
  • the original data is a digital sequence signal, also referred to as baseband data.
  • the ID data is mainly composed of ID data, and the ID data refers to each user's unique identification code.
  • the receiving device control circuit is based on the decryption. The ID data determines whether there is a corresponding authority to determine whether to control the device.
  • the pseudo code sequence is a sequence of binary digits generated by the pseudo code generator, and may be a digital sequence such as a PN code, a Turbo code, a 3 ⁇ 4sh code, a Barker code, or a user-defined binary number sequence.
  • the pseudo code sequence indicator code is a natural number indicating the state of the corresponding unit state machine, and is used to indicate which group of pseudo code sequences used by the transmitting end and the receiving end for encryption and decryption.
  • the pseudo code sequence indicator code when the pseudo code sequence indicator code is a binary number 00000100, it is represented by a decimal number as 4, which means that its unit state machine is state 4, and a pseudo code sequence corresponding thereto is 1010110110011100, when the pseudo code sequence indicator code is a binary number 00000101 When it is represented by a decimal number, it means that its unit state machine is state 5, corresponding to another pseudo code sequence 1010110110011001, and so on, different pseudo code sequence indicator codes correspond to different pseudo code sequences, and pseudo code There is a one-to-one correspondence between the sequence indicator code and the pseudo code sequence.
  • the pseudo code sequence indicator code is arranged in ascending order or descending order.
  • the ascending rule means that the transmitting end of the signal pseudo code sequence indicator itself is incremented by one at the transmitting end, and the descending order is arranged, that is, the transmitting end transmits the signal pseudo code sequence indicating code itself minus 1 .
  • the pseudo code sequence indicator code is used to indicate that the transmitting end and the receiving end use the corresponding pseudo code sequence for encryption and decryption, and each time the transmitting end transmits the signal, the pseudo code sequence indicator code is automatically incremented by 1 (or automatically decremented by 1).
  • the logical operations are logical XORs, and include, for example, logical OR, logical AND or equivalent operations.
  • the visible light signal transmitted by the transmitting end and the receiving end of the asynchronous encrypted visible light communication method in this embodiment is not the original data, but the encrypted scrambling code signal, and the scrambling code is generated after performing a certain logical operation on the original data. Data, such as convolution or shift operation operations on raw data and pseudo code sequences.
  • the embodiment further provides an asynchronous encrypted visible light communication system, which includes a transmitting end and a receiving end, and the transmitting end and the receiving end communicate by the asynchronous encrypted visible light communication method. Referring to FIG. 2, a schematic diagram of a structure of a transmitting end of an asynchronously encrypted visible light communication system is provided.
  • the transmitting end of the embodiment includes a pseudo code generator 101 for generating a pseudo code sequence indicator code, a convolutional encoder 102 for encoding, and the like.
  • the pseudo code sequence indicator processing unit 103 for processing the pseudo code sequence indicator code and the LED 105 for transmitting the visible light signal further includes a modulator 104 for signal modulation.
  • the structure of the receiving end of the asynchronously encrypted visible light communication system is used in this embodiment.
  • the receiving end includes a visible light receiver 201 for receiving visible light signals, and a pseudo code sequence for acquiring the pseudo code sequence indicating code and the encrypted ID data.
  • the receiving end also includes a demodulator 202 for demodulating the signal. It should be understood that a password error may be prompted, without limitation, using a buzzer or a signal light.
  • FIG a4 a schematic diagram of a structure of a transmitted signal in this embodiment.
  • the transmitted signal data in this embodiment is mainly composed of a pseudo code sequence indicator code and an encrypted ID data.
  • the ID data set by the transmitting end and the receiving end are both 16 bits.
  • the binary number 0000000000000100, the pseudo code sequence indicator is an 8-bit binary number 00000010, and the corresponding pseudo code sequence is a 16-bit binary number 1010101100100010, Bay 1J:
  • the S, the baseband data and the pseudo code sequence generated by the pseudo code generator 101 are XORed in the convolutional encoder 102 to obtain the encrypted ID data, and the operation result is as shown in the following table.
  • the encrypted ID data is 1010101100100110, which is different from the original ID data, that is, the original data is encrypted.
  • the encrypted ID data is sent to the pseudo code sequence indicator processing unit 103, the encrypted ID data is added with the pseudo code sequence indicator code 00000010 as a header, and the pseudo code sequence indicator code is added and sent to the modulator 104 for signal modulation.
  • the sequence of numbers output is 000000101010101100100110.
  • the modulated signal is sent to the LED 105, and the LED 105 transmits the modulated signal 000000101010101100100110 to the visible light receiver as a stroboscopic visible light signal.
  • the visible light receiver 201 converts the stroboscopic visible light signal into a binary digital signal for transmission to the demodulator 202 for demodulation, and the demodulator 202 transmits the demodulated signal to the pseudo code sequence designating code processing unit 203.
  • the pseudo code sequence indicator processing unit 203 separates the demodulated signal 000000101010101100100110 into a pseudo code sequence indicator code 00000010 and an encrypted ID data 1010101100100110, and sends the pseudo code sequence indicator code 00000010 to the pseudo code sequence query unit 204.
  • the encrypted ID data 1010101100100110 is sent to the convolutional decoder 205.
  • S5 the pseudo code sequence query unit 204 inputs the pseudo code sequence indicator code 00000010, and the pseudo code sequence query unit 204 compares the previously saved pseudo code sequence indicator code with the currently received pseudo code sequence indicator code, according to the received The pseudo code sequence indicator code determines whether it is legal.
  • the pseudo code sequence indicator code adopts an ascending order (when the transmitting end sends the signal pseudo code sequence indicator code itself plus 1), if the currently received pseudo code sequence indicator code is larger than the saved The pseudo code sequence indicator code, the currently received signal is a legitimate signal, and the received pseudo code sequence is sent to the convolutional decoder 205. Otherwise, the currently received signal is an illegal signal, prompting a password error.
  • the descending rule is adopted (the transmitting end of the signal pseudo code sequence indicator itself is decremented by 1), if the currently received pseudo code sequence indicator is smaller than the saved pseudo code sequence indicator, the currently received signal It is a legitimate signal, and the received pseudo code sequence is sent to the convolutional decoder 205. Otherwise, the currently received signal is an illegal signal, and the same goes to the prompt password error.
  • the decrypted ID data is 0000000000000100, which is sent to the ID determiner 206.
  • the ID determiner 206 compares the received decrypted ID data with the set ID data, and if it is the same, it is legal, and sends the valid ID data to the device control circuit 207. If it is different, it is illegal, and the password is incorrect. At this point, the ID judging unit 206 receives the signal 0000000000000100, and the ID data set by the receiving end is also 0000000000000100. Therefore, the received signal is a legal signal, and the receiving end successfully decrypts the encrypted signal sent by the transmitting end.
  • the high-speed camera can avoid the visible light signal and copy the visible light signal.
  • the encrypted ID data sent by the embodiment is captured by the high-speed camera and copied during the communication process of the transceiver, and the copied signal is the air interface signal 000000101010101100100110. Since the receiving end has saved the pseudo code sequence indicator code as 00000010 when receiving the legal signal, when it receives the copied signal again, it also obtains 00000010 by separating the pseudo code sequence indicator code therein. However, according to the encryption ascending rule, the pseudo code sequence indicator received later should be greater than 00000010 (when the descending rule is used, it should be less than 00000010), and the copied signal is equal to each other, so it can be judged that the copied signal is an illegal signal, and the password will be prompted. error.
  • the visible light signal is captured by the high speed camera and the visible light signal is copied and then a new signal is forged by modification, that is, the pseudo code sequence indicator code is modified to 00000011, and the rest remains unchanged.
  • the pseudo code sequence query unit 204 determines that it is a legal signal, and queries the pseudo code sequence corresponding to the pseudo code sequence indicator 00000011, the pseudo code sequence and the encrypted pseudo code. Different sequences, It is assumed that the pseudo code sequence query unit queries the corresponding pseudo code sequence to be 1010101100100011, and uses the pseudo code sequence to decrypt the ID data.
  • the operation process is as follows:
  • the ID data of the forged signal decryption is 0000000000000101
  • the ID data set by the receiving end is 0000000000000100
  • the IDs of the two are different
  • the ID determiner 206 determines that the received signal is an illegal signal, prompting a password error.
  • the S, the baseband data and the pseudo code sequence generated by the pseudo code generator 101 are XORed in the convolutional encoder 102 to obtain the encrypted ID data, and the operation result is as shown in the following table.
  • the encrypted ID data is 1010101100100000, which is different from the original ID data, that is, the original data is encrypted.
  • the encrypted ID data is sent to the pseudo code sequence indicator processing unit 103, the encrypted ID data is added with the pseudo code sequence indicator code 00000010 as a header, and the pseudo code sequence indicator code is added and sent to the modulator 104 for signal modulation.
  • the sequence of numbers output is 000000101010101100100000.
  • the modulated signal is sent to the LED 105, and the LED 105 transmits the modulated signal 000000101010101100100000 to the visible light receiver as a stroboscopic visible light signal.
  • the visible light receiver 201 converts the stroboscopic visible light signal into a binary digital signal and sends it to the demodulator 202 for demodulation.
  • the demodulator 202 transmits the demodulated signal to the pseudo code sequence indicator code processing unit 203.
  • the pseudo code sequence indicator processing unit 203 separates the demodulated signal 000000101010101100100000 into a pseudo code sequence indicator code 00000010 and an encrypted ID data 1010101100100000, and sends the pseudo code sequence indicator code 00000010 to the pseudo code sequence query unit 204.
  • the encrypted ID data 1010101100100000 is sent to the convolutional decoder 205.
  • the pseudo code sequence query unit 204 inputs a pseudo code sequence indicator code 00000010, and the pseudo code sequence query unit 204 compares the previously stored pseudo code sequence indicator code with the currently received pseudo code sequence indicator code, according to the received The pseudo code sequence indicator code determines whether it is legal.
  • the pseudo code sequence indicator code adopts an ascending order (when the transmitting end sends the signal pseudo code sequence indicator code itself plus 1), if the currently received pseudo code sequence indicator code is larger than the saved
  • the pseudo code sequence indicator code the currently received signal is a legitimate signal, and the received pseudo code sequence is sent to the convolutional decoder 205. Otherwise, the currently received signal is an illegal signal, prompting a password error.
  • the transmitting end of the signal pseudo code sequence indicator itself is decremented by 1
  • the currently received pseudo code sequence indicator is smaller than the saved pseudo code sequence indicator
  • the currently received signal It is a legal signal to send the received pseudo code sequence to the convolutional decoder 205. Otherwise, the currently received signal is an illegal signal, and the same goes to the prompt password error.
  • the decrypted ID data is 0000000000000010, which is sent to the ID determiner 206.
  • the ID determiner 206 compares the received decrypted ID data with the set ID data, and if it is the same, it is legal, and sends the valid ID data to the device control circuit 207. If it is different, it is illegal, and the password is incorrect. At this point, the signal received by the ID determiner 206 is 00000000000000010, and the ID data set by the receiving end is also 00000000000000010. Therefore, the received signal is a legitimate signal, and the receiving end successfully decrypts the encrypted signal sent by the transmitting end.
  • the pseudo-code sequence generated by the Sl, baseband data and pseudo-code generator 101 is subjected to or not calculated by the convolutional encoder 102 to obtain the ID data to be encrypted, and the operation result is as shown in the following table.
  • the encrypted ID data is 1111111111011100, which is different from the original ID data, that is, the original data is encrypted.
  • the encrypted ID data is sent to the pseudo code sequence indicator processing unit 103, the encrypted ID data is added with the pseudo code sequence indicator code 00000010 as a header, and the pseudo code sequence indicator code is added and sent to the modulator 104 for signal modulation.
  • the sequence of numbers output is 000000101111111111011100.
  • the modulated signal is sent to the LED 105, and the LED 105 transmits the modulated signal 000000101111111111011100 to the visible light receiver as a stroboscopic visible light signal.
  • the visible light receiver 201 converts the stroboscopic visible light signal into a binary digital signal and sends it to the demodulator 202 for demodulation.
  • the demodulator 202 sends the demodulated signal to the pseudo code sequence indicator code processing unit 203.
  • the pseudo code sequence indicator processing unit 203 separates the demodulated signal 000000101111111111011100 into a pseudo code sequence indicator code 00000010 and an encrypted ID data 1111111111011100, and sends the pseudo code sequence indicator code 00000010 to the pseudo code sequence query unit 204.
  • the encrypted ID data 1111111111011100 is sent to the convolutional decoder 205.
  • the pseudo code sequence query unit 204 inputs the pseudo code sequence indicator code 00000010, and the pseudo code sequence query unit 204 compares the previously saved pseudo code sequence indicator code with the currently received pseudo code sequence indicator code, according to the received The pseudo code sequence indicator code determines whether it is legal.
  • the pseudo code sequence indicator code adopts an ascending order (when the transmitting end sends the signal pseudo code sequence indicator code itself plus 1), if the currently received pseudo code sequence indicator code is larger than the saved The pseudo code sequence indicator code, the currently received signal is a legitimate signal, and the received pseudo code sequence is sent to the convolutional decoder 205. Otherwise, the currently received signal is an illegal signal, prompting a password error.
  • the transmitting end of the signal pseudo code sequence indicator itself is decremented by 1
  • the currently received pseudo code sequence indicator is smaller than the saved pseudo code sequence indicator, the currently received signal It is a legitimate signal, and the received pseudo code sequence is sent to the convolutional decoder 205. Otherwise, the currently received signal is an illegal signal, and the same goes to the prompt password error.
  • the decrypted ID data is 0000000000000011, which is sent to the ID determiner 206.
  • the ID determiner 206 compares the received decryption ID data with the set ID data, and if it is the same, sends the legal ID data to the device control circuit 207, and the difference is illegal, and the password is incorrect. At this point, the ID judging unit 206 receives the signal 0000000000000011, and the ID data set by the receiving end is also 0000000000000011. Therefore, the received signal is a legal signal, and the receiving end successfully decrypts the encrypted signal sent by the transmitting end.
  • the pseudo-code sequence indicator code is an 8-bit binary digit 10000000
  • the corresponding pseudo-code sequence is a 16-bit binary digit 0000100000000000.
  • the S, the baseband data and the pseudo code sequence generated by the pseudo code generator 101 are subjected to the same or operation in the convolutional encoder 102 to obtain the ID data to be encrypted, and the operation result is as shown in the following table.
  • the encrypted ID data is 1111011111101111, which is different from the original ID data, that is, the original data is encrypted.
  • the encrypted ID data is sent to the pseudo code sequence indicator processing unit 103, the encrypted ID data is added with the pseudo code sequence indicator code 10000000 as a header, and the pseudo code sequence indicator code is added and sent to the modulator 104 for signal modulation.
  • the sequence of numbers output is 100000001111011111101111.
  • the modulated signal is sent to the LED 105, and the LED 105 transmits the modulated signal 100000001111011111101111 to the visible light receiver as a stroboscopic visible light signal.
  • the visible light receiver 201 converts the stroboscopic visible light signal into a binary digital signal for transmission to the demodulator 202 for demodulation, and the demodulator 202 transmits the demodulated signal to the pseudo code sequence designating code processing unit 203.
  • the pseudo code sequence indicator processing unit 203 separates the demodulated signal 100000001111011111101111 into a pseudo code sequence indicator code 10000000 and an encrypted ID data 1111011111101111, and sends the pseudo code sequence indicator code 10000000 to the pseudo code sequence query unit 204.
  • the encrypted ID data 1111011111101111 is sent to the convolutional decoder 205.
  • the pseudo code sequence query unit 204 inputs the pseudo code sequence indicator code 10000000, and the pseudo code sequence query unit 204 compares the previously stored pseudo code sequence indicator code with the currently received pseudo code sequence indicator code, according to the received The pseudo code sequence indicator code determines whether it is legal.
  • the pseudo code sequence indicator code adopts an ascending order (when the transmitting end sends the signal pseudo code sequence indicator code itself plus 1), if the currently received pseudo code sequence indicator code is larger than the saved
  • the pseudo code sequence indicator code the currently received signal is a legitimate signal, and the received pseudo code sequence is sent to the convolutional decoder 205. Otherwise, the currently received signal is an illegal signal, prompting a password error.
  • the transmitting end of the signal pseudo code sequence indicator itself is decremented by 1
  • the currently received pseudo code sequence indicator is smaller than the saved pseudo code sequence indicator
  • the currently received signal It is a legal signal to send the received pseudo code sequence to the convolutional decoder 205. Otherwise, the currently received signal is an illegal signal, and the same goes to the prompt password error.
  • the decrypted ID data is 0000000000010000, which is sent to the ID determiner 206.
  • the ID determiner 206 compares the received decrypted ID data with the set ID data, and if it is the same, it is legal, and sends the valid ID data to the device control circuit 207. If it is different, it is illegal, and the password is incorrect.
  • the ID judging unit 206 receives the signal 0000000000010000, and the ID data set by the receiving end is also 0000000000010000. Therefore, the received signal is a legal signal, and the receiving end successfully decrypts the encrypted signal sent by the transmitting end.
  • the asynchronous encrypted visible light communication method and system provided by the embodiment are simpler and more cost-effective than the synchronous encryption method, and do not require the same clock on the transmitting end and the receiving end, and can avoid high-speed camera shooting.
  • the visible light signal and the visible light signal cause password leakage, which greatly improves the security performance of the photonic Internet of Things.
  • This embodiment can be used in a photon lock and photon access control system.
  • Embodiment 2 Please refer to FIG. bl, which is a schematic structural diagram of a transmitting apparatus based on multi-user asynchronous encryption according to an embodiment of the present invention.
  • the transmitting apparatus includes a baseband data memory 100b, a pseudo code generator 101b, and a convolutional encoder 102b.
  • the pseudo code sequence indicating code combining unit 103b, the device addressing code combining unit 104b, the modulator 105b, and the visible light transmitting unit 106b are configured to store ID information, and the ID information is data for indicating the identity of the user.
  • the pseudo code generator 101b is configured to provide a pseudo code sequence for the convolutional encoder 102b, and a pseudo code sequence indication code for the pseudo code sequence indicator code combining unit 103b; the convolutional encoder 102b And performing a logical operation on the pseudo code sequence and the ID information of the transmitting device to output a pseudo code signal;
  • the pseudo code sequence indicating code combining unit 103b is configured to add a pseudo code to the pseudo code signal output by the convolutional encoder 102b.
  • FIG. 2 is a schematic structural diagram of a receiving apparatus based on multi-user asynchronous encryption according to Embodiment 2 of the present invention.
  • the receiving apparatus includes a visible light receiver 201b, a demodulator 202b, a device addressing code decomposition unit 203b, and a pseudo device.
  • a code sequence query unit 204b a pseudo code sequence indicator code decomposition unit 205b, a convolutional decoder 206b, a query unit 207b, an ID decider 208b, and a device control circuit 20%
  • the visible light receiver 201b is configured to use the transmitting device
  • the transmitted optical signal is converted into an electrical signal, and the electrical signal is converted into a digital signal
  • the demodulator 202b is configured to demodulate the digital signal output by the visible light receiver 201b
  • the device addressing code decomposition unit 203b Separating the device addressing code from the first combined signal from the signal output from the demodulator 202b
  • the pseudo code sequence query unit 204b is configured to output a corresponding pseudo code sequence according to the device addressing code
  • the pseudo code sequence indication code decomposition unit 205b is
  • the query unit 207b is configured to determine, according to the device addressing code, the legality of the pseudo code sequence indicator of the current signal; the convolutional decoder 206b is configured to use the pseudo code output by the pseudo code sequence query unit 204b.
  • the sequence and the pseudo code signal are logically operated to output ID information;
  • the ID determiner 208b is configured to determine whether the ID information output by the convolutional decoder 206 and the query unit 207b are the same, and if they are the same, the The ID information is transmitted to the device controller;
  • the device control circuit 209b is configured to control or communicate with the host device according to the signal output by the ID determiner 208b.
  • the above embodiment describes a transmitting apparatus and a receiving apparatus based on multi-user asynchronous encryption, and a transmitting method and a receiving method based on multi-user asynchronous encryption are described below.
  • FIG. b3 it is a flowchart of a method for transmitting a multi-user asynchronous encryption according to Embodiment 3 of the present invention.
  • the transmitting method includes: performing logical operations on the ID information of the S1 K transmitting device and the generated pseudo code sequence to form a pseudo code. signal.
  • S12 Combine the pseudo code sequence indication code corresponding to the pseudo code sequence into the pseudo code signal header to obtain a first combined signal.
  • the pseudo code sequence indicator code is a large number that does not cycle from small to large or from large to small, and varies with the number of times of the transmitted signal. For example, the pseudo code sequence indicator code is incremented or decremented by one every time the signal is transmitted.
  • S13. Combine the device addressing code in the first combined signal header to obtain a second combined signal.
  • the logical operation is an exclusive OR operation; in the step S13, the device addressing code is different from the ID information, but corresponds to the ID information, and each ID information represents a user. .
  • FIG. 4 is a flow chart of a receiving method based on multi-user asynchronous encryption according to Embodiment 4 of the present invention, where the transmitting method includes:
  • S2K converts the received visible light signal into a digital signal. 522. Demodulate the digital signal.
  • the pseudo code sequence indicator code is a large number that does not loop from small to large, the received pseudo code sequence indicator code is queried according to the device addressing code, if the pseudo code sequence indicator code is less than or equal to received. If the pseudo-code sequence indication code is obtained, the determination is invalid, otherwise the determination is legal; or, when the pseudo-code sequence indication code is a large number that does not loop from large to small, the received pseudo-code is queried according to the device addressing code.
  • the sequence indicator code is invalid if the pseudo code sequence indicator code is greater than or equal to the received pseudo code sequence indicator code, otherwise the determination is legal.
  • the device addressing code Query the device corresponding ID information according to the device addressing code, and compare the ID information with the decoded ID information. If the information is the same, the determination is legal, and the legal ID information is output.
  • the visible light information transmitted between the transmitting device and the receiving device of the photonic IoT is not the original data, but the encrypted scrambling signal.
  • the scrambling code referred to herein refers to data generated after a certain logical operation on the original data, such as convolution of the original data and the pseudo code sequence or a shift operation operation.
  • a pseudocode sequence is a sequence of binary digits produced by a pseudocode generator.
  • the original data is a digital sequence signal, also referred to herein as baseband data, which in this example is ID information
  • ID information refers to a unique identification code of each transmitting device
  • the device control circuit of the visible light receiving device is based on decryption.
  • the subsequent ID information determines whether there is a corresponding right, so that it is possible to control the device to respond accordingly.
  • the pseudo code sequence indicator code is a large number, from small to large (or large to small) without looping, used to indicate which corresponding pseudo code sequence is used by the transmitting device and the receiving device for encryption and decryption, and the visible light emitting device transmits a signal every time. , the pseudo code sequence indicator will be incremented by 1 (or decremented by 1).
  • the device addressing code is a unique identification number of each transmitting device, which is different from the ID, but corresponding to the ID-1, the device addressing code is used by the receiving device to search for the ID information preset by the corresponding device and the last time
  • the pseudo code sequence indicator received by the device As shown in Figure b5, the data structure of the second merged data is assumed to be a 16-bit binary number 0000000000000100; the pseudo-code sequence indicator is an 8-bit binary number 00000010, and the corresponding pseudo-code sequence is a 16 Bit binary number 1010101100100010;
  • the device addressing code is also an 8-bit binary number 10101010.
  • the ID information and the pseudo code sequence are logically operated (for example, exclusive OR operation) in the convolutional encoder 102, and the operation result is as shown in the following table -
  • the convolutional coding process table is known from the table bl.
  • the encrypted ID information is 1010101100100110, which is different from the original ID information, and has a certain encryption effect on the data.
  • the encrypted ID information is sent to the pseudo code sequence indicator combining unit 103.
  • the pseudo code generator 101 also transmits the pseudo code sequence indicator corresponding to the pseudo code sequence to the pseudo code sequence indicator.
  • Unit 103 The encrypted ID information is added to the pseudo code sequence indicating code combining unit 103 by the pseudo code sequence indicating code 00000010 as a header, and then output to the device addressing code combining unit 104, and the output digital sequence is 000000101010101100100110.
  • the signal output by the pseudo code sequence indicating code combining unit 103 is added to the device addressing code 10101010 as a header, and then output, and the result of the output is 10101010000000101010101100100110.
  • the device addressing code combining unit 104 outputs The signal is then sent to modulator 105 for signal modulation and then output to the LED for transmission in the form of a fast-flashing visible light signal. After the visible light emitted from the LED of the transmitting device is transmitted over a short distance in the air, it is received in the visible light receiver 201 in the receiving device, converted into a digital electrical signal, and then demodulated and demodulated at the demodulator 202.
  • the signal is then sent to the device addressing code decomposition unit 203.
  • the device addressing code decomposing unit 203 performs device addressing terminal separation on the received demodulated signal, that is, 10101010000000101010101100100110, obtains a device addressing code 10101010, and respectively sends the device addressing code 10101010 to the pseudo code sequence.
  • the pseudo code sequence indication code decomposing unit 205 performs header separation on the received data to obtain a pseudo code sequence indication code 00000010, and transmits the pseudo code sequence indication code to the pseudo code sequence inquiring unit 204.
  • the remaining portion 1010101100100110 after the pseudo code sequence instruction code decomposition unit 205 separates the pseudo code sequence designation code is the encrypted ID information, and transmits the ID information to the convolutional decoder 206.
  • the input signals of the pseudo code sequence query unit 204 are a device address code 10101010 and a pseudo code sequence indicator code 00000010, respectively.
  • the register corresponding to the device addressing code 10101010 holds a pseudo code sequence indicator code received last time corresponding to the device.
  • the pseudo code sequence inquiring unit 204 compares the previously saved pseudo code sequence indicator code with the currently received pseudo code sequence indicator code, and adopts an ascending order (the transmitting device transmits a signal pseudo code sequence indicating code itself plus 1) In case, if the currently received pseudo code sequence indicator is larger than the saved pseudo code sequence indicator, the currently received signal is a legal signal; otherwise, the current received signal is an illegal signal, and The alarm message is sent to the alarm unit (not shown) for alarm.
  • the pseudo code sequence inquiring unit 204 saves the currently received pseudo code sequence indicator code, that is, updates the originally stored pseudo code sequence indicator code. Then, the pseudo code sequence query unit 204 queries the pseudo code sequence database according to the new pseudo code sequence indicator code.
  • the pseudo code sequence query unit 204 can The pseudo code sequence used for the corresponding encryption is found, and this pseudo code sequence is sent to the convolutional decoder 206. Since the receiving device and the transmitting device use the same security machine, the pseudo code sequence indicating code 00000010 transmitted by the transmitting device can query the receiving device for the pseudo code sequence 1010101100100010 used for encrypting with the transmitting device.
  • the input signals of the convolutional decoder 206 are the encrypted ID information 1010101100100110 and the pseudo code sequence 1010101100100010, respectively. The two data are XORed as follows: Pseudo code sequence
  • the decrypted output ID information is 0000000000000100.
  • an ID determiner 208 and an inquiry unit 207 are also provided in the receiving device. Since some of the forged signals may set the pseudo code sequence indicator to be relatively large, the pseudo code sequence query unit 204 may be mistaken for a legitimate signal, thereby selecting a pseudo code sequence corresponding thereto for decryption, and also obtaining an ID information. However, this data is not a real ID, and it does not correspond to the device addressing code. This will cause security problems.
  • the inquiring unit 207 of the receiving device will perform a database query to obtain a real ID of 0000000000000100, and send it to the ID determiner 208.
  • the ID determiner 208 After receiving the ID information outputted by the convolutional decoder 206 and the query unit 207, the ID determiner 208 compares the two values. If they are the same, the received signal is a legal signal, and then the legal ID information is sent. To the device control circuit; if they are different, indicating that the received signal is a forged signal, if it is illegal, an alarm is issued.
  • the two ID informations received by the UE are 0000000000000100, which is a legal signal, that is, the receiving device successfully decrypts. It is assumed that the data exemplified by the present invention is captured by the high speed camera and copied during the communication process at the transmitting end, and the copied signal is the air interface signal 10101010000000101010101100100110.
  • the receiving device Since the receiving device has saved the pseudo code sequence indicator code as 00000010 when receiving the legal signal, when it receives the copied signal again, it also obtains 00000010 by separating the pseudo code sequence indicator code therein. According to the ascending order of encryption, the pseudo code sequence indicator received later should be greater than 00000010 (when the descending rule is used, it should be less than 00000010), but the copied signal is equal, so it can be determined as the illegal signal copied. It is assumed that after copying the signal, a new signal is falsified by modification, that is, the pseudo code sequence indicator code therein is modified to 00000011, and the other parts are unchanged.
  • the pseudo code sequence query unit 204 determines the signal as a valid, and queries the pseudo code sequence corresponding to the pseudo code sequence indicator 00000011, but the pseudo code sequence It is definitely not the same as the encrypted pseudo code sequence.
  • the pseudo code sequence query unit 204 queries the corresponding pseudo code sequence to be 1010101100100011, and uses this pseudo code sequence to decrypt the ID information.
  • the process table is as follows:
  • Table b3 Forged Signal Convolution Decoding Process Table From Table b3, the ID information decrypted by the forged signal is 0000000000000101. As can be seen from the above embodiment, the ID information obtained by the query unit 207 for the device addressing code 10101010 is
  • Embodiment 3 Figure cl shows a visible light communication system 100 in which the present invention may be implemented.
  • the visible light communication system 100 includes a transmitting end 110 and a receiving end 120.
  • the transmitting end 110 includes an encoder 111 and a pseudo code signal generator 112 coupled to the encoder 111.
  • the encoder 111 receives the original communication data and encodes the original communication data using the pseudo code signal generated by the pseudo code signal generator 112 to generate a scrambled signal. Since the generated scrambling code signal is different from the original communication data, it plays the role of encryption. As used herein, the terms “encryption” and “encoding”, as well as “decryption” and “decoding” are used interchangeably.
  • the raw communication data may be identity information associated with the transmitting end 110.
  • the encoder 111 outputs the scrambling code signal to the light emitting unit 113, which transmits the received scramble code signal in the form of visible light.
  • the light emitting unit 113 may be an LED or other element having a light emitting function.
  • the transmitting end 110 can be a handheld client in the photonic IoT.
  • the receiving end 120 includes a receiving unit 123 for receiving a visible light signal emitted by the transmitting end 110 and converting the visible light signal into a digital signal.
  • the decoder 121 receives the digital signal output by the receiving unit 123 and adopts a pseudo The pseudo code signal generated by the code signal generator 122 decodes it to recover the original communication data. Only one transmitting end 110 is shown in the visible light communication system 100 shown in FIG. cl, but those skilled in the art will readily appreciate that there are often multiple transmitting ends 110 corresponding to one receiving end 120.
  • a time-varying sequence such as a pseudo code is used in both the transmitting end 110 and the receiving end 120.
  • the original communication data is encrypted and decrypted by a sequence, a pseudo-random sequence or a pseudo-random code. Therefore, as shown in FIG. 15c, the pseudo code signal generator 112 outputs a pseudo code signal that changes with time according to the state of the state machine of the transmitting end 110 with reference to the clock signal supplied from the crystal oscillator 114.
  • the pseudo code signal transmitter 122 in the receiving end 120 also outputs a time-varying pseudo code signal according to the state of the state machine of the receiving end 120 with reference to the clock signal provided by the crystal oscillator 124.
  • Figure c2 shows a flow chart of an encryption and decryption method used in the visible light communication system 100.
  • the transmitting end 110 logically operates the original communication data with the first pseudo code signal that changes with time to obtain a scrambling code signal.
  • the original communication data may be user information to be sent, such as user ID information, fingerprint, face, iris, input password, other information for assisting verification of user identity, etc., of course, may also include a combination of the above two or more, and may Is a digital sequence signal.
  • the pseudo code signal may be a sequence of numbers that varies with unit time, wherein the unit time may be set as desired, for example, daily, hourly, minute, second, and the like.
  • the logical operation of the original communication data and the first pseudo code signal may be a logical AND, a logical OR, a logical exclusive OR, or a combination of any two or more of the above operations.
  • the original communication data is the user ID of the transmitting end, and is always 00001101.
  • the first pseudo code signal may be 10101010, and the logical operation of the original communication data and the first pseudo code signal, for example, the process of "exclusive OR" is as follows The table shows:
  • the transmitting end 110 transmits the scrambling code signal in the form of a visible light signal.
  • the transmitting end 110 transmits the modulated signal in the form of a flash by means of an LED lamp.
  • the LED lamp can generate high frequency flicker, the light can represent 1, the light can represent 0, or vice versa, thereby effectively realizing visible light communication.
  • the receiving end 120 receives the visible light signal transmitted by the transmitting end 110, and converts the visible light signal into a digital signal. For example, for high frequency flicker produced by an LED lamp, light may represent 1 and no light may represent 0, or vice versa, thereby converting the received visible light signal into a digital signal.
  • the receiving end 120 decodes the digital signal and the second pseudo code signal, for example, a logical operation to obtain original communication data.
  • the second pseudo code signal is also 10101010, which is the same as the first pseudo code signal pattern and the starting and ending phases.
  • the receiving end 120 performs a logical operation on the received signal and the second pseudo code signal, for example, the "exclusive OR" process is as shown in the following table -
  • the decoded output signal is 00001101, which is the same as the original communication data, that is, the original communication data is decoded.
  • the pseudo code signal generated by the pseudo code signal generator of the receiving end needs to be changed synchronously with the pseudo code signal generated by the pseudo code signal generator of the transmitting end.
  • the change of the pseudo code signal is determined by the state of the state machine at both ends of the transceiver, and has different pseudo code signals corresponding to different states of the state machine.
  • the state of the state machine at the transmitting end and the receiving end is synchronously changed, so that the pseudo code signals of the transmitting end and the receiving end can also change synchronously.
  • the state of the state machine at both ends of the transmission and reception simultaneously jumps from the previous state N to the next state N+1, and accordingly,
  • the pseudo code signals used for encryption and decryption at the transmitting end and the receiving end also change from the pseudo code signal corresponding to the state N to the pseudo code signal corresponding to the state N+1.
  • the accuracy of the clock systems of the visible light transmitting end 110 and the receiving end 120 is determined by the respective crystal oscillators 114, 124.
  • the state changes of the transmitting end 110 and the receiving end 120 are all based on their own clock system. Due to the error between the clock systems at the two ends of the transmitting and receiving, the state changes of the state machine of the transmitting end 110 and the receiving end 120 may be out of synchronization. . Taking the state machine at both ends of the transceiver as a standard unit time T change as an example, assuming the transmitting end 110 The clock system is slower than the standard time, and the clock system at the receiving end 120 is faster than the standard time. After a certain standard time, the system time of the transmitting end 110 and the receiving end 120 differ by one unit time T.
  • Figure c3 is a diagram showing the state of the state machine of the transmitting end and the receiving end as a function of time. As shown in FIG. c3, at the standard time to time, it is assumed that the clock systems of the transmitting end and the receiving end are aligned, and both the transmitting end and the receiving end are in the state N, and after a period of time, the standard time t1 is reached.
  • the present invention provides a loose decryption method in a visible light communication system.
  • the received visible light signal is decrypted not only by the key corresponding to the current state of the state machine of the receiving end, but also when the decryption is unsuccessful.
  • FIG. c4 shows a flow chart of a loose decryption method in a visible light communication system in accordance with an aspect of the present invention.
  • a visible light signal from the transmitting end is received at the receiving end, the visible light signal being at least partially encrypted at the transmitting end with a key that changes with the state of the state machine of the transmitting end.
  • the visible light signal includes communication data and an identifier of the transmitting end, wherein the communication data is encrypted with a key that changes with a state of the state machine of the transmitting end, and the identifier of the transmitting end is not encrypted.
  • the communication data may be user identity (ID) information
  • the identifier of the transmitter may be the device number of the transmitter.
  • the device number at the transmitting end is unique to the transmitting end and can be used to uniquely identify the transmitting end.
  • the communication data such as the user ID is stored in association with the identification number of the transmitting end at the receiving end.
  • the visible light signal is decrypted with a key corresponding to the current state of the state machine of the receiving end and at least one state before and/or after the current state.
  • the receiving end may also select a predetermined number of states before the current state, and select a reservation after the current state. A number of states, or both a predetermined number of states before the current state and a predetermined number of states after the current state are selected.
  • the receiving end may select only a predetermined number of states before the current state.
  • the receiving end in addition to the current state of the state machine at the receiving end, the receiving end may select only a predetermined number of states after the current state.
  • the relative speed of the clock system at the receiving end and the transmitting end is uncertain, in addition to the current state of the state machine at the receiving end, the receiving end can select both the current The predetermined number of states before the state again selects a predetermined number of states after the current state.
  • the predetermined number of sizes may depend on factors such as the accuracy of the crystal oscillator in the receiving end and the transmitting end, the processing capability of the receiving end and the transmitting end.
  • the receiving end may first decrypt the visible light signal with a key corresponding to its current state of the state machine. If the decryption is successful, the process ends. If the decryption is unsuccessful, then decryption is continued with a key corresponding to a predetermined number of states before and/or after the current state. For example, the receiving end may sequentially decrypt the visible light signal with a key corresponding to each of a predetermined number of states before and/or after the current state until the visible light signal is successfully decrypted or has been used with the current state.
  • the visible light signal is decrypted by a key corresponding to all of the predetermined number of states before and/or after.
  • the receiving end may first obtain an identifier of the transmitting end from the visible light signal, and retrieve the locally stored communication data associated with the identifier. .
  • the receiving end recovers the communication data by using the key corresponding to one of the selected states, the recovered communication data is compared with the communication data stored locally at the receiving end, and if the two are the same, it is considered The decryption was successful. For example, if the recovered user ID is consistent with the user ID stored locally at the receiving end, the visible light signal is considered to be a legitimate signal.
  • the visible light signal continues to be decrypted with the key corresponding to the remaining state until the decryption is successful or the visible light signal has been decrypted using the key corresponding to all of the selected states. If the decryption of the visible light signal by the key corresponding to the current state and all of the predetermined number of states before and/or after is unsuccessful, the visible light signal is considered to be an illegal signal.
  • the order of decryption is to first adopt a key corresponding to the current state, and then a key corresponding to a predetermined number of states before and after the current state.
  • the receiving end may decrypt in a predetermined order with a key corresponding to each of the current state and at least one of the states before and/or after the current state. Until the visible light signal is successfully decrypted or the visible light signal has been decrypted using a key corresponding to all of these states.
  • the above described relaxed decryption method is illustrated and described as a series of acts for simplicity of the explanation, it should be understood and appreciated that the methods are not limited by the order of the acts, as some acts may vary according to one or more embodiments. The order occurs and/or occurs concurrently with other acts from what is illustrated and described herein or that are not illustrated and described herein but that are understood by those skilled in the art.
  • the process of selecting a state decryption not only in the current state may be to retrieve a state at a time.
  • the decryption of the key corresponding to the state is unsuccessful, the next state is retrieved and decrypted correspondingly until the decryption succeeds or all the retrieved has been retrieved.
  • the predetermined number of states may be, or may be to retrieve the current state and a predetermined number of states before and after, and then decrypt the keys corresponding to each state in turn until the decryption is successful.
  • the above loose decryption method is described below with reference to the state diagram of FIG. c3.
  • the receiving end receives the visible light signal emitted by the transmitting end at the standard time t1.
  • the receiving end can convert the received visible light signal into a digital signal, and first obtain an unencrypted device number of the transmitting end.
  • the current state of the state machine at the receiving end is N+6.
  • the receiving end may also select a predetermined number (for example, two) of states N+4, N+5 before the current state, and two states N+7, N+8 after the current state.
  • the receiving end may first decrypt the digital signal with a pseudo code sequence corresponding to the current state N+6. For example, a logical exclusive OR operation may be performed to obtain a user ID.
  • the receiving end compares the decrypted user ID with the locally stored user ID associated with the transmitting end, and the two are not the same, so the decryption is unsuccessful. Subsequently, the receiving end performs a logical exclusive OR operation on the digital signal in a predetermined order with a pseudo code sequence corresponding to the four states before and after the current state.
  • the predetermined order may be in order from the near state to the current state, for example, may be N+7, N+5, N+8, N+4.
  • the receiving end decrypts with the pseudo code sequence corresponding to the state N+7. Since the decrypted user ID does not coincide with the locally stored user ID, the receiving end continues to decrypt using the pseudo code sequence corresponding to the state N+5.
  • FIG. 5 is a block diagram showing a communication device 500 in accordance with an aspect of the present invention.
  • the communication device 500 includes a receiver 502 that receives visible light signals from a transmitting device that is encrypted at least in part by a key that varies with the state of the state machine of the transmitting device.
  • the communication device 500 also includes a decoder 504.
  • the decoder 504 decrypts the visible light signal with a key corresponding to the current state of the state machine of the communication device 500 and at least one state before and/or after the current state.
  • the decoder 504 may select a predetermined number of states before the current state, and select A predetermined number of states after the current state, or both a predetermined number of states before the current state and a predetermined number of states after the current state are selected.
  • decoder 504 may first decrypt the visible light signal with a key corresponding to the current state of the state machine of communication device 500. If the decryption is successful, the process ends. If the decryption is unsuccessful, the decoder 504 continues to decrypt with a key corresponding to a predetermined number of states before and/or after the current state. For example, decoder 504 can sequentially decrypt the visible light signal with a key corresponding to each of a predetermined number of states before and/or after the current state until the visible light signal is successfully decrypted or has been used with the current The key corresponding to all of the predetermined number of states before and/or after the state decrypts the visible light signal.
  • the pseudo code signal generator 508 can generate a key, such as a pseudo code sequence signal, that varies with the state of the state machine of the communication device 500.
  • Communication device 500 can also include a memory 510.
  • Memory 510 can store state information 512, such as a state machine of communication device 500.
  • Communication device 500 can also include a processor 506.
  • the processor 506 can be dedicated to points A processor that analyzes the information received by the receiver 502, a processor that controls one or more components of the communication device 500, and/or both analyzes the information received by the receiver 502 and controls one or more components of the communication device 500. processor.
  • FIG. 6 is a block diagram showing a communication device 600 in accordance with an aspect of the present invention.
  • communication device 600 is represented as including functional blocks that can represent functional blocks implemented by a processor, software, or a combination thereof (e.g., firmware).
  • Communication device 600 includes a logical grouping 602 of collaborative electronic components.
  • logical grouping 602 can include an electronic component for receiving a visible light signal from a transmitting end at a receiving end that is encrypted 604 at the transmitting end, at least in part, with a key that varies with the state of the state machine of the transmitting end.
  • logical grouping 602 can also include an electrical component 606 for decrypting the visible light signal with a key corresponding to the current state of the state machine at the receiving end and at least one state before and/or after the current state.
  • communication device 600 can include a memory 608 that holds instructions for executing functions associated with electronic components 604 and 606. Although shown external to memory 608, it should be understood that one or more of electronic components 604 and 606 may be present within memory 608.
  • Embodiment 4 The clock adjustment method in this embodiment can be applied not only to the acquisition of the key at the receiving end but also to other aspects. The clock adjustment method in this embodiment can exist as a separate technical solution.
  • Figure dl shows a visible light communication system 100d in which the present invention may be implemented.
  • the visible light communication system 100d includes a transmitting end 110d and a receiving end 120d.
  • the transmitting end l lOd includes an encoder 11 Id and a pseudo code signal generator 112d coupled to the encoder 11 Id.
  • the encoder 11d receives the original communication data and encodes the original communication data using the pseudo code signal generated by the pseudo code signal generator 112 to generate a scrambled signal. Since the generated scrambling code signal is different from the original communication data, it plays the role of encryption. As used herein, the terms “encryption” and “encoding”, as well as “decryption” and “decoding” are used interchangeably.
  • the original communication data may be ID information associated with the transmitting end l10d.
  • the encoder 111 outputs the scramble code signal to the light emitting unit 113d, which transmits the received scramble code signal in the form of visible light.
  • the light emitting unit 113d may be an LED or other element having a light emitting function.
  • the transmitting end l lOd can be a handheld client in the photonic IoT.
  • the receiving end 120d includes a receiving unit 123d for receiving the visible light signal emitted by the transmitting end 110d and converting the visible light signal into a digital signal.
  • the decoder 121d receives the digital signal output from the receiving unit 123d and decodes it using the pseudo code signal generated by the pseudo code signal generator 122d to recover the original communication data. Only one transmitting end 110d is shown in the visible light communication system 100d shown in FIG. d1, but those skilled in the art will readily appreciate that there are often multiple transmitting ends 110d corresponding to one receiving end 120d.
  • the pseudo-code changing with time is used in both the transmitting end l10d and the receiving end 120d.
  • the sequence encrypts and decrypts the original communication data. Therefore, as shown in FIG. d1, the pseudo code signal generator 112d outputs a pseudo code signal which changes with time in accordance with the state of the state machine of the transmitting terminal 110d with reference to the clock signal supplied from the crystal oscillator 114d.
  • the pseudo code signal transmitter 122d in the receiving end 120d also outputs a time-varying pseudo code signal based on the state of the state machine of the receiving end 120d with reference to the clock signal supplied from the crystal oscillator 124d.
  • Figure d2 shows a flow chart of an encryption and decryption method used in the visible light communication system 100d.
  • the transmitting end 110d performs a logical operation on the original communication data and the first pseudo code signal that changes with time to obtain a scrambling code signal.
  • the original communication data may be information to be transmitted, such as user identity (ID) information, etc., and may be a digital sequence signal.
  • the pseudo code signal may be a sequence of numbers that varies with unit time, wherein the unit time may be set as desired, for example, daily, hourly, minute, second, and the like.
  • the logical operation of the original communication data and the first pseudo code signal may be a logical AND, a logical OR, a logical exclusive OR, or a combination of any two or more of the above operations.
  • the original communication data is the user ID of the transmitting end, and is always 00001101.
  • the first pseudo code signal may be 10101010, and the logical operation of the original communication data and the first pseudo code signal, for example, the process of "exclusive OR" is as follows The table shows:
  • the transmitting end 110d transmits the scrambling code signal in the form of a visible light signal.
  • the transmitting end 110d transmits the modulated signal in the form of a flash by means of an LED lamp.
  • the LED lamp can generate high frequency flicker, the light can represent 1, the light can represent 0, or vice versa, thereby effectively realizing visible light communication.
  • the receiving end 120d receives the visible light signal transmitted by the transmitting end 110d, and converts the visible light signal into a digital signal. For example, for a high frequency flicker produced by an LED lamp, light may represent 1 and no light may represent 0, or vice versa, thereby converting the received visible light signal into a digital signal.
  • the process of converting an optical signal into a digital signal is as follows: First, photoelectric conversion, using an electrical signal of a photodiode and a characteristic of an optical signal to form an electrical pulse signal. However, since the positions of the transmitting end and the receiving end are different, that is, the intensity of the optical signal transmitted from each transmitting end to the receiving end is different, the electrical signal strength is also different, so the current formed by the photodiode needs to be rectified. Comparison. For example, when the current value of the diode is higher than a certain threshold, the photoelectric conversion circuit adjusts the output voltage level to a high level; when the current value through the photodiode is below a certain threshold, the photoelectric conversion The circuit adjusts the output voltage level to a low level.
  • the threshold is set by a mathematical model
  • the type is set according to different environments. If the distance is long, the threshold value may decrease; the distance near time threshold may be relatively increased, that is, the relationship between the threshold value and the threshold value is determined by mathematics.
  • the model determines whether it can be a linear relationship or a nonlinear relationship. Through the above process, the level can be adjusted to a certain range to ensure the correct pulse shape to ensure the correct sampling, thus ensuring the correctness of the clock calculation.
  • the receiving end 120d decodes the digital signal and the second pseudo code signal, for example, a logical operation to obtain original communication data.
  • the second pseudo code signal is also 10101010, which is the same as the first pseudo code signal pattern and the starting and ending phases.
  • the receiving end 120d performs a logical operation on the received signal and the second pseudo code signal, for example, the "exclusive OR" process is as shown in the following table -
  • the decoded output signal is 00001101, which is the same as the original communication data, that is, the original communication data is decoded.
  • the pseudo code signal generated by the pseudo code signal generator of the receiving end needs to be changed synchronously with the pseudo code signal generated by the pseudo code signal generator of the transmitting end.
  • the change of the pseudo code signal is determined by the state of the state machine at both ends of the transmitting and receiving, and after a certain unit time (for example, 1 second, 1 minute, or other specified time period), the state of the state machine at both ends of the transmitting and receiving ends It will change from the previous state to the next state, and the pseudo-code signals used for encryption and decryption corresponding to the state machine state will also change the same.
  • the accuracy of the clock systems of the visible light emitting end 110d and the receiving end 120d is determined by the respective crystal oscillators 114d, 124d.
  • the time variation of the clock system at both ends of the transceiver is measured by the minimum unit time of the respective system, that is, the period of the crystal oscillator.
  • the period of the crystal oscillator refers to the actual period of the crystal oscillator.
  • the transmitter system time is 1 second equal to the standard time of 1 second.
  • ⁇ System ⁇ 10-6 seconds, however, the receiving end 120d still records the nominal (ie 106) system as 1 second of the clock system time. At this time, the one second of the clock system at the receiving end 120d actually experiences the standard time of ⁇ ,, and the actual time of the actual experience is less than the standard time of 1 second, that is, the system time at the receiving end 120d is faster than the standard time. It can be clearly seen that the system time of the clock system at both ends of the transceiver is faster or slower than the standard time. The state changes of the transmitting end 110d and the receiving end 120d are all based on their own clock system.
  • the state changes of the state machine of the transmitting end 110d and the receiving end 120d may be out of synchronization. .
  • T change Taking the state machine at both ends of the transceiver as a standard unit time T change, it is assumed that the clock system of the transmitting end 110d is slower than the standard time, and the clock system of the receiving end 120d is faster than the standard time. After a certain standard time, the system time of the transmitting end 110d and the receiving end 120d differ by one unit time T.
  • Figure d3 is a diagram showing the state of the state machine of the transmitting end and the receiving end as a function of time. As shown in Figure d3, at the standard time tO, it is assumed that the clock systems of the transmitting end and the receiving end are aligned, and both the transmitting end and the receiving end are in the state N, and after a period of time, the standard time t1 is reached.
  • the transmitting end is still in the state N+5 because the clock system is slow, and the receiving end is already in the state N+6 because the clock system is faster. Therefore, the decrypted pseudo code signal selected by the receiving end is inconsistent with the encrypted pseudo code signal selected by the transmitting end, resulting in a decryption error.
  • the system time of the clock system may be faster or slower than the standard time.
  • clock change parameter may be a standard time actually experienced per unit time corresponding to the system time. It is assumed to be in units of 1 second.
  • the transmitting end corresponding to the unit of l lOd system time 1 second, the actual time standard experienced ' ⁇ system.
  • the actual time of the actual experience ' ⁇ may be less than or greater than 1 second standard time.
  • the standard time is /2 » * T ⁇ , and the actual elapsed time may be less than or greater than 1 second standard time depending on the speed of the system clock.
  • the ratio of the standard time actually experienced by the unit time corresponding to the system time of the receiving end 120d to the standard time actually experienced by the same unit time corresponding to the system time of the transmitting end l10d is referred to as the clock of the transmitting end l10d.
  • the clock speed factor is equal to the ratio of the change in the system time of the transmitter at the same time to the change in the system time at the receiver.
  • the change in the system time of the transmitting terminal 110d can be determined at the receiving end 120d according to the change in the system time of the receiving terminal 120d.
  • the number of system cycles 7 ⁇ of the local crystal oscillator of the receiving end 120d can be used to measure the standard time actually experienced by the unit time corresponding to the system time at both ends of the transmitting and receiving.
  • ⁇ nominal duration of a light pulse is emitted per unit of time enabling the end of the visible light signals emitted nod.
  • Nominal. ⁇ * is determined by the nominal baud rate of the signal, specifically the reciprocal of the baud rate.
  • the baud rate of visible light used for communication is generally agreed by the transmitting and receiving ends, and thus is already the receiving end.
  • the standard time of the actual experience of the system time corresponding to the receiving end 120d can be calculated, specifically ( ⁇ . Nominal ⁇ 2 nominal) ⁇ ⁇ system, ie ( ⁇ . Nominal ⁇ 2 nominal) systems cycle.
  • the actual time of the system time can be obtained by actually measuring the duration of one light pulse of the visible light signal from the transmitting end 110d at the receiving end 120d and recording it as M in the system period of the crystal of the receiving end 120. T2 system.
  • the change in the system time of the transmitting end 110d can be calculated.
  • the receiving end 120d communicates with the transmitting end 110d for the first time, for example, during the device debugging, the clock information of the transmitting end 110d is locally stored at the receiving end 120d.
  • the clock information of the transmitting end 110d can be set to be the receiving end 120d.
  • the clock information is consistent.
  • the clock information can refer to the system time value of the clock system.
  • the system time value of the clock system of the transmitting end 110d and the receiving end 120d is 0 at this time.
  • the clock information of the transmitting end HOd stored locally at the receiving end 120d is consistent with the real clock information of the transmitting end 110d.
  • the change of the clock information of the transmitting end 110d held at the receiving end 120d is consistent with the change of the system time of the receiving end 120d itself, and therefore, the transmission saved at the receiving end 120d as time passes after the system is established. An error occurs between the clock information of the terminal 110d and the real clock information at the transmitting end 110d.
  • the predetermined time of the system time of the receiving end 120d, the amplitude of the change of the clock information of the transmitting end 110d stored locally by the receiving end 120d is also the predetermined time, but in fact, the true amplitude of the clock information of the transmitting end 110d should be changed.
  • the predetermined time is multiplied by the time rate factor of the transmitting end 110d. Therefore, every other predetermined time, the error generated is equal to the predetermined time minus the product of the clock speed factor of the transmitting terminal 110d and the predetermined time. Accordingly, the error can be subtracted from the stored clock information of the transmitting terminal 110d to update it.
  • the receiving end 120d eliminates the error amount on the stored clock information of the transmitting end 110d every predetermined period of time, so that the clock information of the updated transmitting end 110d coincides with the real clock information at the transmitting end 110d.
  • the predetermined time is 5 minutes
  • Q 4/5.
  • the clock information of the transmitting end 110d stored locally by the receiving end 120d is 0:5.
  • the clock information of the locally stored transmitter 110d is subtracted from the clock offset of 0 to 5 minutes, and updated to 0:4.
  • the clock information of the locally stored transmitting end 110d is 0:9, which further includes the generated error for 1 minute. Therefore, the updated transmitting end 110d
  • the clock information is 0:8. Since the error of the crystal oscillator at both ends of the transceiver may change with environmental conditions such as temperature, the clock speed factor of the transmitting terminal 110d may also change. Therefore, each time the visible light signal of the transmitting end 110d is received, the clock speed factor can be recalculated according to the newly received visible light.
  • the receiving end 120d is stored according to the local The clock information of the transmitting end nod is used to select the pseudo code signal for decryption. Since the clock information of the locally stored transmitting end 110 is automatically adjusted every predetermined period of time, the error with the real clock information at the transmitting end l10d is not amplified. Further, it is ensured that the pseudo code signal selected according to the clock information of the transmitting end l lOd stored at the receiving end 120d can be synchronized with the pseudo code signal selected by the transmitting end l lOd according to the real transmitting end l lOd clock information.
  • Figure d4 is a flow chart showing a method for automatically adjusting a clock in a visible light communication system in accordance with an aspect of the present invention.
  • the method is illustrated and described as a series of acts for simplicity of the explanation, it should be understood and appreciated that the methods are not limited by the order of the acts, as some acts may occur in different orders in accordance with one or more embodiments. And/or occur concurrently with other acts from the illustrations and descriptions herein.
  • the receiving end receives a visible light signal from a first one of the at least one transmitting end.
  • the receiving end may be the receiving end 120d in Figure dl
  • the first transmitting end may be the transmitting end 110d in Figure dl.
  • the visible light signal is an optical pulse signal, such as having light for 1, no light for 0, or vice versa.
  • the visible light signal generally includes user identity (ID) information of the first transmitting end, and the ID information is encrypted by using a pseudo code signal that varies with the system time of the first transmitting end.
  • the visible light signal further includes an identifier for identifying the first transmitting end, such as a device number of the first transmitting end.
  • the device number at the transmitting end is unique in the system, so a certain transmitter can be uniquely identified by the device number.
  • the identifier is unencrypted and can be directly interpreted by the receiving end.
  • a clock change parameter of the first transmitting end and a clock change parameter of the receiving end are determined according to the visible light signal received from the first transmitting end.
  • the clock variation parameter of the first transmitting end is a standard time actually experienced by the unit time corresponding to the system time of the first transmitting end, wherein the actually experienced standard time can be calculated by the system period of the crystal oscillator of the receiving end. Measurement.
  • the unit time is the nominal duration of a light pulse of the visible light signal from the first transmitting end, the latter being equal to the reciprocal of the nominal baud rate of the visible light signal.
  • the standard time actually experienced by the unit time corresponding to the system time of the first transmitting end can be obtained by actually measuring the duration of one light pulse of the visible light signal at the receiving end and is recorded as the system period of the crystal oscillator of the receiving end as ⁇ ⁇ ⁇ 2 system.
  • the receiving end can convert the visible light signal into a digital signal, and from the high level or the low level of one pulse of the digital signal until the high level or low level ends, how many ⁇ 2 have experienced The system counts and the number obtained is ⁇ .
  • the clock change parameter of the receiving end may refer to a standard time actually experienced by the unit time corresponding to the system time of the receiving end, wherein the standard time actually experienced may be measured by the system period of the crystal oscillator of the receiving end. In the example where the unit time is the nominal duration ⁇ **» of a light pulse of the visible light signal from the first transmitting end, the standard time actually experienced by the unit time corresponding to the system time of the receiving end is calculated as
  • the clock speed factor of the first transmitting end is determined according to the clock variation parameter of the first transmitting end and the clock variation parameter of the receiving end.
  • the clock speed factor of the first transmitting end is the ratio of the standard time actually experienced by the unit time corresponding to the system time of the receiving end to the standard time actually experienced by the unit time corresponding to the system time of the first transmitting end.
  • step 404 the clock information of the first transmitting end locally stored by the receiving end is updated every predetermined time according to the clock speed factor of the first transmitting end.
  • the clock speed factor is equal to the ratio of the variation of the system time of the first transmitting end to the variation of the system time of the receiving end over the same time.
  • the system time of the predetermined time is elapsed at the receiving end, and the true change amplitude of the system time of the first transmitting end should be the product of the clock speed factor and the predetermined time, but the system time of the first transmitting end locally stored at the receiving end is The magnitude of the change is the predetermined time, so the error of the clock information of the locally stored first transmitting end is the predetermined time minus the product. Furthermore, subtracting the error from the clock information of the locally stored first transmitting end for updating can eliminate the error. In this way, the clock information of the locally stored first transmitting end is updated every time the predetermined time elapses.
  • the clock information of the first transmitting end local to the receiving end may be initially stored at the receiving end and the first transmitting end when the system is initially established (for example, first time), and may be set equal to the clock information of the receiving end. This is because the first communication between the transmitting and receiving ends in the visible light communication system is generally in the initial stage of system establishment, for example, during system establishment and debugging, at this time, the clock information of the first transmitting end is not stored at the receiving end.
  • the clock information of the receiving and sending ends is basically the same at the initial stage of the system establishment. Therefore, the current clock information of the receiving end can be directly stored as the clock information of the first transmitting end in the receiving end.
  • the clock information can refer to the system time of the clock system.
  • the receiving end receives the visible light signal of the first transmitting end for the first time
  • the identifier of the first transmitting end such as the device number
  • the method may further include recalculating the clock speed factor according to the newly received visible light each time after receiving the visible light signal from the first transmitting end, thereby calculating according to the new
  • the clock speed factor updates the clock information of the locally stored first transmitting terminal every predetermined time.
  • FIG. d5 is a block diagram showing a communication device 500d in accordance with an aspect of the present invention.
  • Receiver 502d can receive a visible light signal from a first one of the at least one transmitting device.
  • the clock change parameter determining module 504d may determine a clock change parameter of the first transmitting device and a clock change parameter of the communication device 500d itself according to the visible light signal received from the first transmitting device.
  • the clock change parameter may be a standard time actually experienced per unit time corresponding to the system time. In the case where the unit time is the nominal duration of one light pulse of the visible light signal from the first transmitting device, the standard time actually experienced by the unit time corresponding to the system time of the first transmitting device is determined by the clock variation parameter determining module 504d.
  • the duration of one optical pulse of the visible light signal received from the first transmitting device is obtained and recorded as the M ⁇ T2 system in units of the system period of the crystal oscillator of the communication device 500d, and corresponding to the communication device 500d
  • the standard time actually experienced by the unit time of the system time is calculated by the clock change parameter determining module 504d as 2 2 ), where is the nominal duration of one light pulse of the visible light signal, which is the crystal of the communication device 500d The nominal frequency, as well as the system period of the crystal of the communication device 500d.
  • the clock speed factor module 506d may determine the clock speed factor of the first transmitting device according to the clock variation parameter of the first transmitting device and the clock variation parameter of the communication device 500d itself.
  • the clock speed factor determining module determines the clock speed factor of the first transmitting device as the standard time actually experienced by the unit time corresponding to the system time of the communication device 500d and the system corresponding to the first transmitting device The ratio of the standard time actually experienced by the unit time of time.
  • the clock information modulation module 508d updates the clock information of the first transmitting device locally stored by the communication device 500d every predetermined time according to the clock speed factor of the first transmitting device.
  • the predetermined time is a predetermined time of the system time of the communication device 500d
  • the error of the clock information of the first transmitting device locally stored by the communication device 500d is the predetermined time minus the first time every predetermined time
  • the clock speed factor of the transmitting device is multiplied by the predetermined time, whereby the clock information adjusting module 508d subtracts the error from the clock information of the locally stored first transmitting device for updating.
  • the decoder 510d may select the corresponding pseudo code signal to decode the received visible light signal according to the stored clock information of the first transmitting device.
  • the communication device 500d may also include a memory 514d.
  • Memory 514d can store clock information 516d, such as clock information for the first transmitting device.
  • the communication device 500d also includes a processor 512d.
  • the processor 512d may be a processor dedicated to analyzing information received by the receiver 502d, a processor controlling one or more components of the communication device 500d, and/or both analyzing information received by the receiver 502d and controlling the communication device.
  • Figure d6 is a block diagram showing a communication device 600d in accordance with an aspect of the present invention. It should be appreciated that communication device 600d is represented as including functional blocks that can represent functional blocks implemented by a processor, software, or combination thereof (e.g., firmware).
  • Communication device 600d includes a logical grouping 602d of collaborative electronic components.
  • Logical grouping 602d can include an electrical component 604d for receiving a visible light signal from a first one of the at least one transmitting device.
  • the logical grouping 602d can include an electronic component 606d for determining a clock variation parameter of the first transmitting device and a clock variation parameter of the receiving device based on the visible light signal received from the first transmitting device.
  • the logical grouping 602d can also include an electrical component 608d for determining a clock speed factor of the first transmitting device based on the clock variation parameter of the first transmitting device and the clock variation parameter of the receiving device.
  • the logical grouping 602d may further include an electronic component 610d for updating clock information of the first transmitting device locally stored by the receiving device every predetermined time according to the clock speed factor of the first transmitting device.
  • communication device 600d can include a memory 612d that holds instructions for executing functions associated with electronic components 604d, 606d, 608d, and 610d. Although illustrated as being external to memory 612, it should be understood that one or more of electronic components 604d, 606d, 608d, and 610d may be present within memory 612d.
  • Those skilled in the art will appreciate that information and signals may be represented using any of a variety of different technologies and techniques.
  • the data, instructions, commands, information, signals, bits (bits), symbols, and chips referenced throughout the above description may be by voltage, current, electromagnetic wave, magnetic field or magnetic particle, light field or optical particle, or any thereof. Combined to represent.
  • Those skilled in the art will further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps are described above generally in the form of their functionality. Whether such functionality is implemented as hardware or software depends on the particular application and design constraints imposed on the overall system.
  • DSPs digital signal processors
  • ASICs application specific integrated circuits
  • FPGAs field programmable gate arrays
  • Programmable logic devices discrete gate or transistor logic, discrete hardware components, or any combination thereof designed to perform or perform the functions described herein.
  • a general purpose processor may be a microprocessor, but in the alternative, the processor may be any conventional processor, controller, microcontroller, or state machine.
  • the processor may also be implemented as a combination of computing devices, such as a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors in cooperation with a DSP core, or any other such configuration.
  • the steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied in hardware, in a software module executed by a processor, or in a combination of the two.
  • the software modules may reside in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disk, removable disk, CD_ROM, or any other form of storage medium known in the art.
  • An exemplary storage medium is coupled to the processor such that the The processor can read and write information from/to the storage medium.
  • the storage medium can be integrated into the processor.
  • the processor and the storage medium can reside in an ASIC.
  • the ASIC can reside in the user terminal.
  • the processor and the storage medium may reside as a discrete component in the user terminal.
  • the functions described may be implemented in hardware, software, firmware, or any combination thereof. If implemented as a computer program product in software, the functions may be stored on or transmitted as one or more instructions or code on a computer readable medium.
  • Computer readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another.
  • a storage medium may be any available media that can be accessed by a computer.
  • such computer readable media may comprise RAM, wake up, EEPROM, CD-ROM or other optical disk storage, disk storage or other magnetic storage device, or can be used to carry or store instructions or data structures. Any other medium that is desirable for program code and that can be accessed by a computer. Any connection is also properly referred to as a computer readable medium.
  • the software is transmitted from a web site, server, or other remote source using coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or wireless technology such as infrared, radio, and microwave.
  • coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of the medium.
  • Disks and discs as used herein include compact discs (CDs), laser discs, optical discs, digital versatile discs (DVDs), floppy discs, and Blu-ray discs, in which disks are often magnetically reproduced. Data, and discs optically reproduce data with a laser. Combinations of the above should also be included within the scope of computer readable media.
  • CDs compact discs
  • DVDs digital versatile discs
  • Blu-ray discs in which disks are often magnetically reproduced. Data, and discs optically reproduce data with a laser. Combinations of the above should also be included within the scope of computer readable media.
  • the above is only the preferred embodiment of the present invention, and is not intended to limit the present invention, and various modifications and changes can be made to the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and scope of the present invention are intended to be included within the scope of the present invention.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • Electromagnetism (AREA)
  • Computer Security & Cryptography (AREA)
  • Theoretical Computer Science (AREA)
  • Optical Communication System (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

本发明公开了可见光的加密方法、解密方法、通信装置及通信系统,其中,该方法包括接收来自发射端的可见光信号,其中,可见光信号在发射端被密钥加密;获取密钥,并根据密钥对可见光信号进行解密,其中,获取密钥包括:获取与接收端状态机的状态对应的密钥;或者,根据可见光信号获取的用于获得密钥的指示信息并根据指示信息获取密钥。通过本发明解决了可见光加密解密中存在的无法解密的问题,提高了解密的准确性。

Description

可见光的加密方法、 解密方法、 通信装置及通信系统 技术领域 本发明涉及通信领域, 更具体地说, 涉及可见光的加密方法、 解密方法、 通信装 置及通信系统。 背景技术 传统的物联网一般通过各种无线或有线的通讯网络实现互联互通, 采用传统的通 信技术。 最近兴起了一种利用可见光在自由空间进行传播近距离通信的物联网技术, 这种利用可见光通信技术的物联网我们称之为光子物联网。 光子物联网具有传统物联 网的功能, 只是通信的方式采用可见光进行通信。 由于可见光的指向性高, 不能穿透障碍物, 比使用无线通信方式具有更高的安全 性, 因而光子物联网等场合逐渐利用可见光进行近距离通信。 目前光子物联网已经存 在一些同步进行加密与解密的可见光通信系统, 这种系统在使用同步方式让可见光发 射机与接收机始终使用相同的并且随时间不断变化的伪码序列进行加密与解密。 通过 这种可见光通信的加密与解密, 能使利用高速摄像机进行拍摄并复制出的频闪光信号 失效, 无法被接收机进行识别, 可以有效地杜绝安全隐患。 这种同步加密与解密的可见光通信系统利用握手同步的方法是在发射机中对导光 信号和基带数据分别进行加扰, 然后合成一组信号再通过调制后发射出去。 在接收机 中接收解调后再对其中加密的导光信号进行伪码判决, 通过遍历查询选择出加密所用 的伪码序列, 然后对基带数据进行解密, 最后利用 ID判决器对解密出来的 ID信息和 对应寄存器所保存的 ID信息进行判断,最终确定是合法信号还是非法复制的信号, 从 而完成解密。 由于发射机中加密所用的伪码序列和接收机中解密所用的伪码序列都是相同并且 不断随时间变化的, 所以采用这种同步可见光通信系统就要求可见光发射机和可见光 接收机中的时间变化必须完全一致, 即发射机和接收机的内部时钟必须完全一致, 时 间误差必须非常小, 就目前所使用的晶振元件而言, 很难达到完全一致, 所使用的时 间越长, 两者的时间系统的时间差就越大, 最终失去同步信息, 导致发射机与接收机 的状态变化不一致, 即两者所使用的伪码序列可能在其中一端发生变化时, 而另一端 并未达到需要变化的时间点而继续使用原来的伪码序列, 从而会导致解密失败。 此外, 由于同步的加密方法需要发射机和接收机进行时间上的同步, 当某一端断 电后, 就会失去同步信息, 这样重新上电后如果要恢复同步信息, 就需要使用复位信 号令未断电的一端重新与之同步, 这样会增加系统的复杂度, 并且可能会带来使用上 的不便。 发明内容 本发明实施例针对可见光中的加密解密可能会导致解密失败的问题, 提供了可见 光的加密方法、 解密方法、 通信装置及通信系统。 根据本发明实施例的一个方面, 提供了一种可见光信号的解密方法, 包括: 接收 来自发射端的可见光信号, 其中, 所述可见光信号在所述发射端被密钥加密; 获取所 述密钥, 并根据所述密钥对所述可见光信号进行解密, 其中, 获取所述密钥包括: 获 取与接收端状态机的状态对应的所述密钥; 或者, 根据所述可见光信号获取的用于获 得所述密钥的指示信息并根据所述指示信息获取所述密钥。 优选地, 根据所述可见光信号获取的用于获得所述密钥的指示信息, 并根据所述 指示信息获取所述密钥包括: 将接收的所述可见光信号转换为数字信号; 将所述数字 信号分解为包括伪码序列指示码和伪码信号的信号; 查询所述伪码序列指示码对应的 伪码序列, 其中, 所述伪码序列为所述密钥; 根据所述伪码序列对所述伪码信号进行 解密。 优选地, 将所述数字信号分解为包括伪码序列指示码和伪码信号的信号, 查询所 述伪码序列指示码对应的伪码序列包括: 将所述数字信号分解为设备寻址码和第一合 并信号; 将所述第一合并信号分解为所述伪码序列指示码和所述伪码信号; 根据所述 设备寻址码对所述伪码序列指示码的合法性进行判决, 若合法, 则查询所述伪码序列 指示码对应的伪码序列。 优选地, 查询所述伪码序列指示码对应的伪码序列包括: 根据接收到的伪码序列 指示码判断是否合法, 合法则查询所述伪码序列指示码对应的伪码序列, 不合法则提 示密码错误。优选地,所述方法还包括:根据所述设备寻址码查询该设备对应 ID信息, 将该 ID信息与译码获得的 ID信息进行对比, 若相同, 判定合法, 则输出合法的 ID 信息。 优选地, 所述方法还包括: 根据合法的 ID信息控制对应的设备。 优选地, 所述将接收的可见光信号转换为数字信号之后, 还包括: 对所述数字信 号进行解调。 优选地,所述根据所述设备寻址码对所述伪码序列指示码的合法性进行判决包括: 当所述伪码序列指示码是从小到大不循环的大数时, 根据所述设备寻址码查询已接收 到的伪码序列指示码, 若所述伪码序列指示码小于或者等于已接收到的伪码序列指示 码, 则判定无效, 否则判定合法; 或者, 当所述伪码序列指示码是从大到小不循环的 大数时, 根据所述设备寻址码查询已接收到的伪码序列指示码, 若所述伪码序列指示 码大于或者等于已接收到的伪码序列指示码, 则判定无效, 否则判定合法。 优选地, 根据所述伪码序列对所述伪码信号进行解密包括: 将所述伪码序列与所 述伪码信号进行逻辑运算, 以对所述伪码信号进行解密。 优选地, 根据所述可见光信号获取的用于获得所述密钥的指示信息包括: 根据所 述可见光信号确定所述发射端的时钟变化参数和所述接收端的时钟变化参数; 根据所 述发射端的时钟变化参数和所述接收端的时钟变化参数确定所述发射端的时钟快慢因 子; 根据所述发射端的所述时钟快慢因子每隔预定时间更新所述接收端本地存储的所 述发射端的时钟信息, 其中, 所述时钟信息为用于获得所述密钥的指示信息。 优选地, 所述发射端的时钟变化参数是指对应于所述发射端的系统时间的单位时 间实际经历的标准时间, 以及所述接收端的时钟变化参数是指对应于所述接收端的系 统时间的所述单位时间实际经历的标准时间, 其中所述实际经历的标准时间都是以所 述接收端的晶振的系统周期为单位来计量的。 优选地, 所述发射端的时钟快慢因子为对应于所述接收端的系统时间的所述单位 时间实际经历的标准时间与对应于发射端的系统时间的所述单位时间实际经历的标准 时间之比。 优选地,所述预定时间是所述接收端的系统时间的预定时间,每隔所述预定时间, 所述接收端本地存储的所述发射端的所述时钟信息的误差为所述预定时间减去所述发 射端的时钟快慢因子与所述预定时间的乘积, 其中更新所述接收端本地存储的所述发 射端的所述时钟信息包括用本地存储的所述发射端的所述时钟信息减去所述误差。 优选地, 所述单位时间为接收自所述发射端的所述可见光信号的一个光脉冲的标 称持续时间, 所述标称持续时间等于所述可见光信号的标称波特率的倒数。 优选地, 对应于所述发射端的系统时间的所述单位时间实际经历的标准时间是在 所述接收端处测量接收自所述发射端的所述可见光信号的一个光脉冲的持续时间得到 的并以所述接收端的晶振的系统周期为单位记为 M · T2系统, 以及对应于所述接收端 的系统时间的所述单位时间实际经历的标准时间被计算为 赫 ' ^^ ^^, 其中 为所述可见光信号的一个光脉冲的标称持续时间, 2»*为所述接收端的晶振的标 称频率, 以及 为所述接收端的晶振的系统周期。 优选地, 在所述接收端处测量接收自所述发射端的所述可见光信号的一个光脉冲 的持续时间包括: 将接收自所述发射端的所述可见光信号转换成数字信号; 以及从所 述数字信号的一个脉冲的高电平或低电平开始直至所述高电平或低电平结束对经历了 多少个 进行计数, 得到的数目即为 优选地, 所述将接收自所述发射端的所述可见光信号转换成数字信号包括: 通过 光电二极管将所述可见光信号转换成电脉冲信号, 当所述光电二极管通过的电流值高 于门限值时输出高电压电平, 以及当所述光电二极管通过的电流值低于所述门限值时 输出低电压电平。 优选地, 所述门限值是根据预定数学模型至少由所述接收端与所述发射端之间的 距离来决定的。 优选地, 还包括: 在后续每一次接收到来自所述发射端的可见光信号时, 重复所 述确定所述发射端的时钟变化参数和所述接收端的时钟变化参数至更新所存储的所述 发射端的所述时钟信息的步骤。 优选地, 在后续每一次接收到来自所述发射端的可见光信号时, 根据所存储的所 述发射端的所述时钟信息来选择对应的伪码信号对接收到的可见光信号进行解码。 优选地, 所述接收端本地存储的所述发射端的时钟信息最初是在所述接收端首次 接收到所述发射端的可见光信号时与所述发射端的标识符相关联的存储的并且被设为 等于所述接收端当时的时钟信息。 优选地, 获取与接收端状态机的状态对应的所述密钥并根据所述密钥对所述可见 光信号进行解密包括: 获取并用与所述接收端的状态机的当前状态以及在所述当前状 态之前和 /或之后的至少一个状态对应的密钥对所述可见光信号进行解密,其中,所述 可见光信号用随所述发射端的状态机的状态变化的密钥被加密。 优选地, 用与所述接收端的状态机的所述当前状态以及在所述当前状态之前和 / 或之后的所述至少一个状态对应的密钥对所述可见光信号进行解密包括: 用与所述接 收端的状态机的所述当前状态对应的密钥对所述可见光信号进行解密; 以及若用与所 述接收端的状态机的所述当前状态对应的密钥对所述可见光信号的解密未成功, 则继 续用与在所述当前状态之前和 /或之后的所述至少一个状态对应的密钥对所述可见光 信号进行解密。 优选地,用与在所述当前状态之前和 /或之后的所述至少一个状态对应的密钥对所 述可见光信号进行解密:按预定次序用与在所述当前状态之前和 /或之后的所述至少一 个状态中的每个状态对应的密钥对所述可见光信号进行解密, 直至所述可见光信号被 成功解密或已使用与在所述当前状态之前和 /或之后的所述至少一个状态中的所有状 态对应的密钥对所述可见光信号进行了解密为止。 优选地, 所述可见光信号包括通信数据以及所述发射端的标识符。 优选地, 所述通信数据用随所述发射端的状态机的状态变化的所述密钥被加密, 而所述发射端的所述标识符未被加密, 并且所述接收端本地存储有与所述发射端的所 述标识符相关联的通信数据。 优选地, 还包括: 从所述可见光信号获得所述发射端的所述标识符; 其中如果用 与所述接收端的状态机的所述当前状态以及在所述当前状态之前和 /或之后的所述至 少一个状态中的一个状态对应的密钥对所述可见光信号解密得到的通信数据与所述接 收端本地存储的与所述发射端的所述标识符相关联的通信数据相同, 则用与所述一个 状态对应的密钥对所述可见光信号的解密成功, 否则解密未成功。 优选地, 所述通信数据包括用户信息, 所述用户信息包括 ID信息、 指纹、 面部、 虹膜、 输入的密码、 或者以上两者或更多者的组合, 所述方法还包括: 如果用与所述 接收端的状态机的所述当前状态以及在所述当前状态之前和 /或之后的所述至少一个 状态对应的密钥对所述可见光信号的解密皆未成功, 则将所述可见光信号标识为非法 信号, 否则将所述可见光信号标识为合法信号。 优选地, 用与所述接收端的状态机的所述当前状态以及在所述当前状态之前和 / 或之后的所述至少一个状态对应的密钥对所述可见光信号进行解密包括: 按预定次序 用与所述当前状态以及在所述当前状态之前和 /或之后的所述至少一个状态中的每个 状态对应的密钥对所述可见光信号进行解密, 直至所述可见光信号被解密成功或已使 用与所述当前状态以及在所述当前状态之前和 /或之后的所述至少一个状态中的所有 状态对应的密钥对所述可见光信号进行了解密。 优选地, 所述至少一个状态包括在所述当前状态之前的预定数目个状态和在所述 当前状态之后的所述预定数目个状态。 优选地, 随所述发射端的状态机的状态变化的密钥以及与所述接收端的状态机的 所述当前状态以及在所述当前状态之前和 /或之后的所述至少一个状态对应的密钥是 随时间变化的序列。 优选地, 所述随时间变化的序列为伪码序列, 所述方法还包括将所述可见光信号 转换成数字信号, 其中所述解密包括所述数字信号与伪码序列的逻辑与、 逻辑或、 逻 辑异或、 或者以上两者或更多者的组合。 根据本发明实施例的另一方面, 提供了一种通信装置, 包括: 接收器, 用于接收 来自发射端的可见光信号, 其中, 所述可见光信号在所述发射端被密钥加密; 解码器, 用于获取所述密钥, 并根据所述密钥对所述可见光信号进行解密, 其中, 获取所述密 钥包括: 获取与接收端状态机的状态对应的所述密钥; 或者, 根据所述可见光信号获 取的用于获得所述密钥的指示信息并根据所述指示信息获取所述密钥。 优选地, 所述接收器为用于接收可见光信号, 并输出数字信号的可见光接收器; 所述解码器包括: 用于将所述数字信号分解为包括伪码序列指示码和伪码信号的伪码 序列指示码分解单元;用于查询伪码序列指示码对应的伪码序列的伪码序列查询单元, 其中,所述伪码序列为所述密钥; 用于将所述伪码序列与所述伪码信号进行逻辑运算, 输出逻辑运算结果的卷积译码器。 优选地, 所述解码器还包括: 用于将所述数字信号分解为设备寻址码和第一合并 信号的设备寻址码分解单元; 所述伪码序列指示码分解单元, 用于将所述第一合并信 号分解为伪码序列指示码和伪码信号; 所述伪码序列查询单元, 用于根据所述设备寻 址码对所述伪码序列指示码的合法性进行判决, 若合法, 查询伪码序列指示码对应的 伪码序列。。 优选地, 所述伪码序列查询单元, 用于根据接收到的伪码序列指示码判断是否合 法, 合法则查询所述伪码序列指示码对应的伪码序列, 不合法则提示密码错误。 优选地,所述装置还包括:用于根据所述设备寻址码查询对应 ID信息的查询单元; 以及用于对所述卷积译码器输出的 ID信息与所述查询单元输出的 ID信息进行对比, 若相同判定合法, 输出合法 ID信息的 ID判决器。 优选地, 所述装置还包括: 与所述 ID判决器连接的设备控制电路, 用于根据接收 的 ID信息控制对应的设备。 优选地, 所述装置还包括: 连接于所述可见光接收器与所述设备寻址码分解单元 之间、 用于对所述数字信号进行解调的解调器。 优选地, 所述接收器, 其接收来自发射设备的可见光信号, 所述可见光信号在所 述发射设备至少部分地用随所述发射设备的状态机的状态变化的密钥被加密; 以及所 述解码器,用与所述通信装置的状态机的当前状态以及在所述当前状态之前和 /或之后 的至少一个状态对应的密钥对所述可见光信号进行解密。 优选地, 所述解码器用与所述通信装置的状态机的所述当前状态对应的密钥对所 述可见光信号进行解密, 并且若用与所述通信装置的状态机的所述当前状态对应的密 钥对所述可见光信号的解密未成功,则继续用与在所述当前状态之前和 /或之后的所述 至少一个状态对应的密钥对所述可见光信号进行解密。 优选地,所述解码器按预定次序用与在所述当前状态之前和 /或之后的所述至少一 个状态中的每个状态对应的密钥对所述可见光信号进行解密, 直至所述可见光信号被 成功解密或已使用与在所述当前状态之前和 /或之后的所述至少一个状态中的所有状 态对应的密钥对所述可见光信号进行了解密为止。 优选地, 所述解码器按预定次序用与所述当前状态以及在所述当前状态之前和 / 或之后的所述至少一个状态中的每个状态对应的密钥对所述可见光信号进行解密, 直 至所述可见光信号被解密成功或已使用与所述当前状态以及在所述当前状态之前和 / 或之后的所述至少一个状态中的所有状态对应的密钥对所述可见光信号进行了解密。 优选地, 所述接收器, 用于接收来自发射端的可见光信号; 所述解码器包括: 时 钟变化参数确定模块, 其根据接收自所述发射端的所述可见光信号确定所述发射端的 时钟变化参数和所述通信装置的时钟变化参数; 时钟快慢因子确定模块, 根据所述发 射端的所述时钟变化参数和所述通信装置的所述时钟变化参数确定所述发射端的时钟 快慢因子; 以及时钟信息调整模块, 其根据所述发射端的所述时钟快慢因子每隔预定 时间更新所述通信装置本地存储的所述发射端的时钟信息。 优选地, 所述发射端的时钟变化参数是指对应于所述发射端的系统时间的单位时 间实际经历的标准时间, 以及所述通信装置的时钟变化参数是指对应于所述通信装置 的系统时间的所述单位时间实际经历的标准时间, 其中所述实际经历的标准时间都是 以所述通信装置的晶振的系统周期为单位来计量的。 优选地, 所述时钟快慢因子确定模块将所述发射端的时钟快慢因子确定为对应于 所述通信装置的系统时间的所述单位时间实际经历的标准时间与对应于发射端的系统 时间的所述单位时间实际经历的标准时间之比。 优选地, 所述预定时间是所述通信装置的系统时间的预定时间, 每隔所述预定时 间, 所述通信装置本地存储的所述发射端的所述时钟信息的误差为所述预定时间减去 所述发射端的时钟快慢因子与所述预定时间的乘积, 所述时钟信息调整模块用本地存 储的所述发射端的所述时钟信息减去所述误差。 优选地, 所述单位时间为接收自所述发射端的所述可见光信号的一个光脉冲的标 称持续时间, 所述标称持续时间等于所述可见光信号的标称波特率的倒数。 优选地, 对应于所述发射端的系统时间的所述单位时间实际经历的标准时间由所 述时钟变化参数模块在所述通信装置处测量接收自所述发射端的所述可见光信号的一 个光脉冲的持续时间得到并以所述通信装置的晶振的系统周期为单位记为 Μ · Τ2 系 统, 以及对应于所述通信装置的系统时间的所述单位时间实际经历的标准时间由所述 时钟变化参数计算为 (^«^ Ά**^ 7^^, 其中 ^* 为所述可见光信号的一个光脉冲 的标称持续时间, /2«»为所述通信装置的晶振的标称频率, 以及 ^^^为所述通信装置 的晶振的系统周期。 优选地,解码器,还用于其在后续每一次接收到来自所述发射端的可见光信号时, 根据所存储的所述发射端的所述时钟信息来选择对应的伪码信号对接收到的可见光信 号进行解码。 根据本发明实施例的另一个方面, 还提供了一种可见光信号的加密方法, 包括: 对数据使用密钥进行加密; 将所述加密数据作为可见光信号发射, 其中, 所述密钥随 发射端的状态机的状态变化而变化, 或者, 所述可见光信号携带有用于获得所述密钥 的指示信息。 优选地, 在所述可见光信号携带有所述指示信息的情况下, 将所述数据使用所述 密钥进行加密, 将所述加密数据作为所述可见光信号发射包括: 将生成的伪码序列与 所述数据进行编码, 获得伪码信号, 其中, 所述伪码序列为所述密钥; 将所述伪码序 列对应的伪码序列指示码合并至所述伪码信号首部, 获得包括所述伪码序列指示码和 所述伪码信号的合并信号; 以可见光的形式发送所述合并信号。 优选地, 获得包括所述伪码序列指示码和所述伪码信号的合并信号, 以可见光的 形式发送所述合并信号包括: 将所述伪码序列对应的伪码序列指示码合并至所述伪码 信号首部, 获得第一合并信号; 在所述第一合并信号首部合并设备寻址码, 获得第二 合并信号: 以可见光形式发送所述第二合并信号。 优选地, 所述以可见光信号的形式发送所述第二合并信号之前, 还包括: 对所述 第二合并信号进行调制。 优选地, 所述伪码序列指示码是从小到大或从大到小不循环的大数, 随发射信号 的次数变化。 根据本发明实施例的另一个方面, 还提供了一种通信装置, 包括: 加密装置, 用 于对数据使用密钥进行加密; 发射单元, 用于将所述加密数据作为可见光信号发射, 其中, 所述密钥随发射端的状态机的状态变化而变化, 或者, 所述可见光信号携带有 用于获得所述密钥的指示信息。 优选地, 所述加密装置包括: 用于输出伪码序列和对应伪码序列指示码的伪码发 生器; 用于对所述伪码序列与所述数据进行逻辑运算, 输出伪码信号的卷积编码器; 用于将所述伪码序列指示码合并至所述伪码信号首部, 输出包括所述伪码序列指示码 和所述伪码信号的合并信号的伪码序列指示码合并单元; 其中, 所述伪码序列为所述 密钥, 所述伪码序列指示码为所述指示信息; 所述发射单元, 用于以可见光信号的形 式发送所述合并信号。 优选地, 所述伪码序列指示码合并单元还用于将所述伪码序列指示码合并至所述 伪码信号首部, 输出第一合并信号; 所述加密装置还包括; 用于在所述第一合并信号 首部合并设备寻址码, 输出第二合并信号的设备寻址码合并单元;; 所述发射单元, 用 于以可见光信号的形式发送所述第二合并信号。 优选地, 所述发射装置还包括连接于所述设备寻址码处理单元与所述发射单元之 间、 用于对所述第二合并信号进行调制的调制器。 优选地, 所述发射单元是 LED灯。 优选地, 所述伪码序列指示码是从小到大或从大到小不循环的大数, 随发射信号 的次数变化。 根据本发明实施例的另一个方面, 还提供了一种通信系统, 包括: 上述的通信装 置。 通过本发明解决了可见光加密解密中存在的无法解密的问题, 提高了解密的准确 性。 附图说明 此处所说明的附图用来提供对本发明的进一步理解, 构成本申请的一部分, 本发 明的示意性实施例及其说明用于解释本发明, 并不构成对本发明的不当限定。 在附图 中- 图 al是根据本发明实施例的异步加密可见光通信方法流程示意图; 图 a2是根据本发明实施例的异步加密可见光通信系统发射端结构示意图; 图 a3是根据本发明实施例的异步加密可见光通信系统接收端结构示意图; 图 a4是根据本发明实施例的发射信号结构示意图; 图 M 是根据本发明实施例提供的一种基于多用户异步加密的发射装置结构示意 图; 图 b2 是根据本发明实施例提供的一种基于多用户异步加密的接收装置结构示意 图; 图 b3是根据本发明实施例提供的一种基于多用户异步加密的发射方法流程图; 图 b4是根据本发明实施例提供的一种基于多用户异步加密的接收方法流程图; 图 b5是本发明实施例提供的第二合并数据的数据结构示意图; 图 cl是示出了可在其中实现本发明的可见光通信系统的框图; 图 c2是示出了可在图 cl的可见光通信系统中使用的加解密方法的流程图; 图 c3是示出了图 cl的可见光通信系统中的发射端和接收端的状态随时间变化的 示意图; 图 c4是示出了用于可见光通信系统中的宽松解密方法的流程图; 图 c5是示出了通信装置的框图; 图 c6是示出了通信装置的框图; 图 dl是示出了可在其中实现本发明的可见光通信系统的框图; 图 d2是示出了可在图 dl的可见光通信系统中使用的加解密方法的流程图; 图 d3是示出了图 dl的可见光通信系统中的发射端和接收端的状态随时间变化的 示意图; 图 d4 是示出了根据本发明的一方面的用于自动调整可见光通信系统中的时钟的 方法的流程图; 图 d5是示出了根据本发明的一方面的通信装置的框图; 图 d6是示出了根据本发明的一方面的通信装置的框图。 具体实施方式 下文中将参考附图并结合实施例来详细说明本发明实施例。 需要说明的是, 在不 冲突的情况下, 本申请中的实施例及实施例中的特征可以相互组合。 在以下实施例中提供了一种可见光信号的解密方法, 包括: 接收来自发射端的可 见光信号, 其中, 该可见光信号在该发射端被密钥加密; 获取该密钥, 并根据该密钥 对该可见光信号进行解密, 其中, 获取该密钥包括: 获取与接收端状态机的状态对应 的该密钥; 或者, 根据该可见光信号获取的用于获得该密钥的指示信息并根据该指示 信息获取该密钥。 通过上述步骤, 采用了状态机状态对应的密钥, 或者采用了指示信息来指示接收 端所使用的密钥, 从而解决了相关技术中解密存在失败可能性的问题。 优选地, 根据该可见光信号获取的用于获得该密钥的指示信息, 并根据该指示信 息获取该密钥包括: 将接收的该可见光信号转换为数字信号; 将该数字信号分解为包 括伪码序列指示码和伪码信号的信号; 查询该伪码序列指示码对应的伪码序列,其中, 该伪码序列为该密钥; 根据该伪码序列对该伪码信号进行解密。 优选地, 将该数字信号分解为包括伪码序列指示码和伪码信号的信号, 查询该伪 码序列指示码对应的伪码序列包括:将该数字信号分解为设备寻址码和第一合并信号; 将该第一合并信号分解为该伪码序列指示码和该伪码信号; 根据该设备寻址码对该伪 码序列指示码的合法性进行判决,若合法, 则查询该伪码序列指示码对应的伪码序列。 在以下实施例还提供了一种通信装置, 该装置包括: 接收器, 用于接收来自发射 端的可见光信号, 其中, 该可见光信号在该发射端被密钥加密; 解码器, 用于获取该 密钥, 并根据该密钥对该可见光信号进行解密, 其中, 获取该密钥包括: 获取与接收 端状态机的状态对应的该密钥; 或者, 根据该可见光信号获取的用于获得该密钥的指 示信息并根据该指示信息获取该密钥。 在以下实施例中还提供了一种可见光信号的加密方法, 包括: 对数据使用密钥进 行加密; 将该加密数据作为可见光信号发射, 其中, 该密钥随发射端的状态机的状态 变化而变化, 或者, 该可见光信号携带有用于获得该密钥的指示信息。 该加密方法使用了光信号中携带指示信息, 或者采用状态机状态对应的密钥的方 式, 从而解决了相关技术中解密存在失败可能性的问题。 优选地, 在该可见光信号携带有该指示信息的情况下, 将该数据使用该密钥进行 加密, 将该加密数据作为该可见光信号发射包括: 将生成的伪码序列与该数据进行编 码, 获得伪码信号, 其中, 该伪码序列为该密钥; 将该伪码序列对应的伪码序列指示 码合并至该伪码信号首部, 获得包括该伪码序列指示码和该伪码信号的合并信号; 以 可见光的形式发送该合并信号。 优选地, 获得包括该伪码序列指示码和该伪码信号的合并信号, 以可见光的形式 发送该合并信号包括: 将该伪码序列对应的伪码序列指示码合并至该伪码信号首部, 获得第一合并信号; 在该第一合并信号首部合并设备寻址码, 获得第二合并信号: 以 可见光形式发送该第二合并信号。 在以下实施例中还提供了一种通信装置, 包括: 加密装置, 用于对数据使用密钥 进行加密; 发射单元, 用于将该加密数据作为可见光信号发射, 其中, 该密钥随发射 端的状态机的状态变化而变化, 或者, 该可见光信号携带有用于获得该密钥的指示信 息。 优选地, 该加密装置包括: 用于输出伪码序列和对应伪码序列指示码的伪码发生 器; 用于对该伪码序列与该数据进行逻辑运算, 输出伪码信号的卷积编码器; 用于将 该伪码序列指示码合并至该伪码信号首部, 输出包括该伪码序列指示码和该伪码信号 的合并信号的伪码序列指示码合并单元; 其中, 该伪码序列为该密钥, 该伪码序列指 示码为该指示信息; 该发射单元, 用于以可见光信号的形式发送该合并信号。 优选地, 该伪码序列指示码合并单元, 用于将该伪码序列指示码合并至该伪码信 号首部, 输出第一合并信号的伪码序列指示码。所述装置还包括:; 用于在该第一合并 信号首部合并设备寻址码, 输出第二合并信号的设备寻址码合并单元。 此时, 该发射 单元, 用于以可见光信号的形式发送该第二合并信号。 下面结合四个优选实施例进行说明, 这四个优选实施例中的技术特征可以组合使 用。 实施例一 根据图 al本实施例异步加密可见光通信方法流程示意图可知,一种异步加密可见 光通信方法, 包括以下步骤:
51、 基带数据与伪码发生器 101产生的伪码序列在卷积编码器 102中进行逻辑运 算后得到将加密的数据(例如, 该数据可以包括 ID数据, 该加密的数据也可以为伪码 信号, 以下以 ID数据为例进行说明),将加密的 ID数据发送到伪码序列指示码处理单 元 103中, 加入伪码序列指示码后发送到调制器 104进行信号调制。
52、将调制后的信号发送到 LED105, LED105将调制后的信号以频闪可见光信号形 式发射到可见光接收器。
53、可见光接收器 201将频闪可见光信号转化为二进制数字信号发送到解调器 202 进行解调, 解调器 202将解调后的信号发送到伪码序列指示码处理单元 203。
54、 伪码序列指示码处理单元 203将解调后的信号分离成伪码序列指示码和加密 ID数据两部分,将伪码序列指示码发送到伪码序列查询单元 204,将加密 ID数据发送 到卷积译码器 205。
55、 伪码序列查询单元 204根据接收到的伪码序列指示码判断是否合法, 合法则 查询对应的伪码序列, 将伪码序列发送到卷积译码器 205, 不合法则提示密码错误。
56、加密 ID数据和查询出的伪码序列在卷积译码器 205中进行异或运算后得出解 密后的 ID数据, 发往 ID判断器 206。
57、 ID判断器 206将 ID数据和设定的 ID数据进行比对, 相同则合法, 将合法的 ID数据发送到设备控制电路 207, 不同则提示密码错误。 原始数据是一种数字序列信号, 也称为基带数据, 在本实施例优选实施例中主要 由 ID数据组成, ID数据是指每一个用户的唯一识别码, 接收端设备控制电路就是根 据解密后的 ID数据确定是否具有相应的权限, 从而确定是否控制设备的。 伪码序列是由伪码发生器产生的一组二进制数字序列, 可以是 PN码、 Turbo码、 ¾lsh码、 Barker码等数字序列, 也可以是用户自定义的二进制数字序列。 伪码序列指示码是一个自然数, 表示对应单元状态机的状态, 用于指示发射端和 接收端采用哪组伪码序列进行加密和解密。 例如: 伪码序列指示码为二进制数 00000100时, 用十进制数字表示为 4, 代表其单元状态机为状态 4, 与之对应的一个 伪码序列为 1010110110011100, 当伪码序列指示码为二进制数 00000101时, 用十进 制数字表示为 5, 代表其单元状态机为状态 5, 所对应的是另一个伪码序列 1010110110011001 , 以此类推, 不同的伪码序列指示码对应不同的伪码序列, 且伪码 序列指示码与伪码序列之间存在一一对应的关系。 伪码序列指示码采用升序规则排列 或降序规则排列, 升序规则即发射端每发送一次信号伪码序列指示码自身加 1, 降序 规则排列即发射端每发送一次信号伪码序列指示码自身减 1。 伪码序列指示码用于指 示发射端和接收端采用相对应的伪码序列进行加密与解密, 发射端每发射一次信号, 伪码序列指示码将自动加 1 (或自动减 1 )。 在本实施例的优选实施例中, 逻辑运算为逻辑异或, 还包括例如逻辑或非、 逻辑 同或等运算方式。 应当理解, 本实施例异步加密可见光通信方法的发射端和接收端传输的可见光信 号不是原始数据, 而是经过加密后的扰码信号, 扰码是指对原始数据进行一定逻辑运 算后所产生的数据, 如对原始数据和伪码序列进行卷积或移位操作运算等。 本实施例还提供一种异步加密可见光通信系统, 包括发射端和接收端, 发射端和 接收端通过上述异步加密可见光通信方法进行通信。 参见图 a2, 本实施例异步加密可见光通信系统发射端结构示意图, 本实施例的发 射端包括用于产生伪码序列指示码的伪码发生器 101、用于编码的卷积编码器 102、用 于处理伪码序列指示码的伪码序列指示码处理单元 103 及用于发射可见光信号的 LED105, 发射端还包括用于信号调制的调制器 104。 参见图 a3, 本实施例异步加密可见光通信系统接收端结构示意图, 本实施例接收 端包括用于接收可见光信号的可见光接收器 201、 用于获取伪码序列指示码和加密 ID 数据的伪码序列指示码处理单元 203、用于输出伪码序列的伪码序列查询单元 204、用 于译码的卷积译码器 205、用于输出 ID数据的 ID判断器 206及设备控制电路 207。接 收端还包括用于解调信号的解调器 202。 应当理解, 可以采用且不限于采用蜂鸣器或信号灯等方式提示密码错误。 参见图 a4, 本实施例发射信号结构示意图, 本实施例发射信号数据主要由伪码序 列指示码和加密 ID数据两部分组成, 设发射端和接收端设定的 ID数据均为一个 16 比特的二进制数字 0000000000000100, 伪码序列指示码为一个 8 比特的二进制数字 00000010, 其对应的伪码序列为一个 16比特的二进制数字 1010101100100010, 贝 1J :
Sl、 基带数据与伪码发生器 101产生的伪码序列在卷积编码器 102中进行异或运 算后得到将加密的 ID数据, 运算结果如下表所示,
Figure imgf000017_0001
由上表可知, 加密后的 ID数据为 1010101100100110, 与原始的 ID数据不相同, 即对原始数据进行了加密。 将加密的 ID数据发送到伪码序列指示码处理单元 103中, 将加密的 ID数据加上 伪码序列指示码 00000010作为头部,加入伪码序列指示码后发送到调制器 104进行信 号调制, 输出的数字序列为 000000101010101100100110ο
S2 、 将调制后 的信号发送到 LED105 , LED105 将调制后 的信号 000000101010101100100110以频闪可见光信号形式发射到可见光接收器。
53、可见光接收器 201将频闪可见光信号转化为二进制数字信号发送到解调器 202 进行解调, 解调器 202将解调后的信号发送到伪码序列指示码处理单元 203。
54、 伪码序列指示码处理单元 203 将解调后的信号 000000101010101100100110 分离成伪码序列指示码 00000010和加密 ID数据 1010101100100110两部分,将伪码序 列指示码 00000010发送到伪码序列查询单元 204, 将加密 ID数据 1010101100100110 发送到卷积译码器 205。 S5、伪码序列查询单元 204输入伪码序列指示码 00000010,伪码序列查询单元 204 会将之前保存的伪码序列指示码与当前所接收到的伪码序列指示码进行对比, 根据接 收到的伪码序列指示码判断其是否合法, 伪码序列指示码在采用升序规则 (发射端每 发送一次信号伪码序列指示码自身加 1 ) 时, 如果当前所接收到的伪码序列指示码大 于保存的伪码序列指示码, 则当前所接收的信号是合法的信号, 将接收到的伪码序列 发送到卷积译码器 205, 否则, 当前所接收的信号是非法信号, 提示密码错误。 另外, 在采用降序规则 (发射端每发送一次信号伪码序列指示码自身减 1 ) 时, 如果当前所接收到的伪码序列指示码小于保存的伪码序列指示码, 则当前所接收的信 号是合法的信号, 将接收到的伪码序列发送到卷积译码器 205, 否则, 当前所接收的 信号是非法信号, 同样转到提示密码错误。
S6、加密 ID数据 1010101100100110和查询出的伪码序列 1010101100100010在卷 积译码器 205中进行异或运算, 运算结果如下表所示:
Figure imgf000018_0001
由上表可知,解密后的 ID数据为 0000000000000100,将其发送至 ID判断器 206。
S7、 ID判断器 206将接收到的解密 ID数据和设定的 ID数据进行比对, 相同则合 法, 将合法的 ID数据发送到设备控制电路 207, 不同则非法, 提示密码错误。 至此, ID 判断器 206 接收的信号为 0000000000000100, 而接收端设定的 ID 数据也为 0000000000000100, 因此, 本次接收的信号为合法信号, 接收端成功将发射端发送的 加密信号进行解密。 本实施例能够避免高速摄像机拍摄可见光信号并复制可见光信号, 例如, 本实施 例发出的加密 ID数据在收发端通信过程中被高速摄像机拍摄并进行复制,则复制的信 号为空口信号 000000101010101100100110。 由于接收端在接收到合法的信号时, 已经 将其中的伪码序列指示码保存为 00000010, 当它再接收到被复制的信号时, 通过分离 其中的伪码序列指示码, 也得到 00000010。 但根据加密升序规则, 后面接收到的伪码 序列指示码应大于 00000010 (采用降序规则时, 应小于 00000010), 复制的信号为两 者相等, 因此可以判断复制的信号为非法信号, 将提示密码错误。 优选的, 假设经高速摄像机拍摄可见光信号并复制可见光信号再通过修改伪造一 个新信号, 也就是将其中的伪码序列指示码修改为 00000011, 其余部分不变。 伪码序 列指示码按升序规则排列时, 伪码序列查询单元 204会判断其为合法的信号, 查询与 伪码序列指示码 00000011相对应的伪码序列, 此伪码序列与经加密的伪码序列不同, 假设伪码序列查询单元查询到对应的伪码序列为 1010101100100011,用该伪码序列对 ID数据进行解密, 运算过程如下表所示:
Figure imgf000019_0001
由上表可知, 伪造信号解密的 ID数据为 0000000000000101, 而接收端设定的 ID 数据为 0000000000000100,两者 ID不同, ID判断器 206将判断接收信号为非法信号, 提示密码错误。 设发射端和接收端设定的 ID 数据均为一个 16 比特的二进制数字 0000000000000010, 伪码序列指示码为一个 8比特的二进制数字 00000100, 其对应的 伪码序列为一个 16比特的二进制数字 1010101100100010, 贝 1J :
Sl、 基带数据与伪码发生器 101产生的伪码序列在卷积编码器 102中进行异或运 算后得到将加密的 ID数据, 运算结果如下表所示,
Figure imgf000019_0002
由上表可知, 加密后的 ID数据为 1010101100100000, 与原始的 ID数据不相同, 即对原始数据进行了加密。 将加密的 ID数据发送到伪码序列指示码处理单元 103中, 将加密的 ID数据加上 伪码序列指示码 00000010作为头部,加入伪码序列指示码后发送到调制器 104进行信 号调制, 输出的数字序列为 000000101010101100100000。
S2、 将调制后的信号发送到 LED105 , LED105 将调制后的信号 000000101010101100100000以频闪可见光信号形式发射到可见光接收器。 53、可见光接收器 201将频闪可见光信号转化为二进制数字信号发送到解调器 202 进行解调, 解调器 202将解调后的信号发送到伪码序列指示码处理单元 203。
54、 伪码序列指示码处理单元 203 将解调后的信号 000000101010101100100000 分离成伪码序列指示码 00000010和加密 ID数据 1010101100100000两部分,将伪码序 列指示码 00000010发送到伪码序列查询单元 204, 将加密 ID数据 1010101100100000 发送到卷积译码器 205。
55、伪码序列查询单元 204输入伪码序列指示码 00000010,伪码序列查询单元 204 会将之前保存的伪码序列指示码与当前所接收到的伪码序列指示码进行对比, 根据接 收到的伪码序列指示码判断其是否合法, 伪码序列指示码在采用升序规则 (发射端每 发送一次信号伪码序列指示码自身加 1 ) 时, 如果当前所接收到的伪码序列指示码大 于保存的伪码序列指示码, 则当前所接收的信号是合法的信号, 将接收到的伪码序列 发送到卷积译码器 205, 否则, 当前所接收的信号是非法信号, 提示密码错误。 另外, 在采用降序规则 (发射端每发送一次信号伪码序列指示码自身减 1 ) 时, 如果当前所接收到的伪码序列指示码小于保存的伪码序列指示码, 则当前所接收的信 号是合法的信号, 将接收到的伪码序列发送到卷积译码器 205, 否则, 当前所接收的 信号是非法信号, 同样转到提示密码错误。
S6、加密 ID数据 1010101100100000和查询出的伪码序列 1010101100100010在卷 积译码器 205中进行异或运算, 运算结果如下表所示:
Figure imgf000020_0001
由上表可知,解密后的 ID数据为 0000000000000010,将其发送至 ID判断器 206。
S7、 ID判断器 206将接收到的解密 ID数据和设定的 ID数据进行比对, 相同则合 法, 将合法的 ID数据发送到设备控制电路 207, 不同则非法, 提示密码错误。 至此, ID 判断器 206 接收的信号为 0000000000000010, 而接收端设定的 ID 数据也为 0000000000000010, 因此, 本次接收的信号为合法信号, 接收端成功将发射端发送的 加密信号进行解密。 设发射端和接收端设定的 ID 数据均为一个 16 比特的二进制数字 0000000000000011 , 伪码序列指示码为一个 8比特的二进制数字 00000010, 其对应的 伪码序列为一个 16比特的二进制数字 0000000000100000, 贝 1J :
Sl、 基带数据与伪码发生器 101产生的伪码序列在卷积编码器 102中进行或非运 算后得到将加密的 ID数据, 运算结果如下表所示,
Figure imgf000021_0001
由上表可知, 加密后的 ID数据为 1111111111011100, 与原始的 ID数据不相同, 即对原始数据进行了加密。 将加密的 ID数据发送到伪码序列指示码处理单元 103中, 将加密的 ID数据加上 伪码序列指示码 00000010作为头部,加入伪码序列指示码后发送到调制器 104进行信 号调制, 输出的数字序列为 000000101111111111011100。
S2 、 将调制后 的信号发送到 LED105 , LED105 将调制后 的信号 000000101111111111011100以频闪可见光信号形式发射到可见光接收器。
S3、可见光接收器 201将频闪可见光信号转化为二进制数字信号发送到解调器 202 进行解调, 解调器 202将解调后的信号发送到伪码序列指示码处理单元 203。 S4、 伪码序列指示码处理单元 203 将解调后的信号 000000101111111111011100 分离成伪码序列指示码 00000010和加密 ID数据 1111111111011100两部分,将伪码序 列指示码 00000010发送到伪码序列查询单元 204, 将加密 ID数据 1111111111011100 发送到卷积译码器 205。
S5、伪码序列查询单元 204输入伪码序列指示码 00000010,伪码序列查询单元 204 会将之前保存的伪码序列指示码与当前所接收到的伪码序列指示码进行对比, 根据接 收到的伪码序列指示码判断其是否合法, 伪码序列指示码在采用升序规则 (发射端每 发送一次信号伪码序列指示码自身加 1 ) 时, 如果当前所接收到的伪码序列指示码大 于保存的伪码序列指示码, 则当前所接收的信号是合法的信号, 将接收到的伪码序列 发送到卷积译码器 205, 否则, 当前所接收的信号是非法信号, 提示密码错误。 另外, 在采用降序规则 (发射端每发送一次信号伪码序列指示码自身减 1 ) 时, 如果当前所接收到的伪码序列指示码小于保存的伪码序列指示码, 则当前所接收的信 号是合法的信号, 将接收到的伪码序列发送到卷积译码器 205, 否则, 当前所接收的 信号是非法信号, 同样转到提示密码错误。
S6、加密 ID数据 1111111111011100和查询出的伪码序列 0000000000100000在卷 积译码器 205中进行或非运算, 运算结果如下表所示:
Figure imgf000022_0001
由上表可知,解密后的 ID数据为 0000000000000011,将其发送至 ID判断器 206。
S7、 ID判断器 206将接收到的解密 ID数据和设定的 ID数据进行比对, 相同则合 法, 将合法的 ID数据发送到设备控制电路 207, 不同则非法, 提示密码错误。 至此, ID 判断器 206 接收的信号为 0000000000000011, 而接收端设定的 ID 数据也为 0000000000000011 , 因此, 本次接收的信号为合法信号, 接收端成功将发射端发送的 加密信号进行解密。 设发射端和接收端设定的 ID 数据均为一个 16 比特的二进制数字 0000000000010000, 伪码序列指示码为一个 8比特的二进制数字 10000000, 其对应的 伪码序列为一个 16比特的二进制数字 0000100000000000, 贝 U:
Sl、 基带数据与伪码发生器 101产生的伪码序列在卷积编码器 102中进行同或运 算后得到将加密的 ID数据, 运算结果如下表所示,
Figure imgf000022_0002
由上表可知, 加密后的 ID数据为 1111011111101111, 与原始的 ID数据不相同, 即对原始数据进行了加密。 将加密的 ID数据发送到伪码序列指示码处理单元 103中, 将加密的 ID数据加上 伪码序列指示码 10000000作为头部,加入伪码序列指示码后发送到调制器 104进行信 号调制, 输出的数字序列为 100000001111011111101111 ο
S2 、 将调制后 的信号发送到 LED105 , LED105 将调制后 的信号 100000001111011111101111以频闪可见光信号形式发射到可见光接收器。
53、可见光接收器 201将频闪可见光信号转化为二进制数字信号发送到解调器 202 进行解调, 解调器 202将解调后的信号发送到伪码序列指示码处理单元 203。
54、 伪码序列指示码处理单元 203 将解调后的信号 100000001111011111101111 分离成伪码序列指示码 10000000和加密 ID数据 1111011111101111两部分,将伪码序 列指示码 10000000发送到伪码序列查询单元 204, 将加密 ID数据 1111011111101111 发送到卷积译码器 205。
55、伪码序列查询单元 204输入伪码序列指示码 10000000,伪码序列查询单元 204 会将之前保存的伪码序列指示码与当前所接收到的伪码序列指示码进行对比, 根据接 收到的伪码序列指示码判断其是否合法, 伪码序列指示码在采用升序规则 (发射端每 发送一次信号伪码序列指示码自身加 1 ) 时, 如果当前所接收到的伪码序列指示码大 于保存的伪码序列指示码, 则当前所接收的信号是合法的信号, 将接收到的伪码序列 发送到卷积译码器 205, 否则, 当前所接收的信号是非法信号, 提示密码错误。 另外, 在采用降序规则 (发射端每发送一次信号伪码序列指示码自身减 1 ) 时, 如果当前所接收到的伪码序列指示码小于保存的伪码序列指示码, 则当前所接收的信 号是合法的信号, 将接收到的伪码序列发送到卷积译码器 205, 否则, 当前所接收的 信号是非法信号, 同样转到提示密码错误。
S6、加密 ID数据 1111011111101111和查询出的伪码序列 0000100000000000在卷 积译码器 205中进行同或运算, 运算结果如下表所示:
Figure imgf000023_0001
由上表可知,解密后的 ID数据为 0000000000010000,将其发送至 ID判断器 206。 S7、 ID判断器 206将接收到的解密 ID数据和设定的 ID数据进行比对, 相同则合 法, 将合法的 ID数据发送到设备控制电路 207, 不同则非法, 提示密码错误。 至此, ID 判断器 206 接收的信号为 0000000000010000, 而接收端设定的 ID 数据也为 0000000000010000, 因此, 本次接收的信号为合法信号, 接收端成功将发射端发送的 加密信号进行解密。 综上所述, 本实施例提供的异步加密可见光通信方法及系统, 与同步加密方法相 比技术更简单并且节约成本, 不需要发射端和接收端具有相同的时钟, 同时, 能够避 免高速摄像机拍摄可见光信号并复制可见光信号造成密码泄露, 大大提高了光子物联 网的安全性能, 本实施例可用于光子锁、 光子门禁系统中。 实施例二 请参阅图 bl, 是本发明实施例提供的一种基于多用户异步加密的发射装置结构示 意图, 所述发射装置包括基带数据存储器 100b、 伪码发生器 101b、 卷积编码器 102b、 伪码序列指示码合并单元 103b、 设备寻址码合并单元 104b、 调制器 105b及可见光发 射单元 106b, 所述基带数据存储器 100b用于存储 ID信息, 所述 ID信息为用于表示 用户身份的数据; 所述伪码发生器 101b用于为所述卷积编码器 102b提供伪码序列、 以及为所述伪码序列指示码合并单元 103b提供伪码序列指示码;所述卷积编码器 102b 用于将所述伪码序列与所述发射装置的 ID信息进行逻辑运算,输出伪码信号; 伪码序 列指示码合并单元 103b用于对所述卷积编码器 102b输出的伪码信号加伪码序列指示 码,获得第一合并信号,然后再将第一合并信号输出到所述设备寻址码合并单元 104b; 所述设备寻址码合并单元 104b用于在所述卷积编码器 102b传过来的第一合并信号首 部加设备寻址码,输出第二合并信号; 所述调制器 105b用于将所述设备寻址码合并单 元 104b输出的第二合并信号进行调制, 并传送到所述可见光发射单元 106b上, 将第 二合并信号以可见光的形式发射出去。 其中, 所述发射单元 106b是 LED灯。 请参阅图 b2, 是本发明实施例二提供的一种基于多用户异步加密的接收装置结构 示意图, 所述接收装置包括可见光接收器 201b、 解调器 202b、 设备寻址码分解单元 203b、 伪码序列查询单元 204b、 伪码序列指示码分解单元 205b、 卷积译码器 206b、 查询单元 207b、 ID判决器 208b及设备控制电路 20%, 所述可见光接收器 201b用于 将所述发射装置发射过来的光信号转换成电信号, 将电信号转换为数字信号; 所述解 调器 202b用于将所述可见光接收器 201b输出的数字信号进行解调; 所述设备寻址码 分解单元 203b用于从解调器 202b输出的信号中将设备寻址码和第一合并信号分离出 来; 所述伪码序列查询单元 204b用于根据所述设备寻址码输出相应的伪码序列; 所述 伪码序列指示码分解单元 205b用于将所述设备寻址码分解单元 203b输出的第一合并 信号分解出伪码序列指示码及伪码信号, 并将伪码序列指示码及伪码信号分别传送给 所述伪码序列查询单元 204b及卷积译码器 206b。所述查询单元 207b用于根据设备寻 址码对当前信号的伪码序列指示码的合法性进行判断;所述卷积译码器 206b用于对所 述伪码序列查询单元 204b输出的伪码序列及伪码信号进行逻辑运算, 输出 ID信息; 所述 ID判决器 208b用于判断所述卷积译码器 206及所述查询单元 207b输出的 ID信 息是否相同, 若相同, 则将所述 ID 信息传送给所述设备控制器; 所述设备控制电路 209b用于根据所述 ID判决器 208b输出的信号对相应的设备进行控制或与上位机进行 通信。 上述实施例描述了基于多用户异步加密的发射装置和接收装置, 下面对基于多用 户的异步加密的发射方法和接收方法进行描述。 参见图 b3, 是本发明实施例三提供的一种基于多用户异步加密的发射方法流程 图, 该发射方法包括: S1 K 发射装置的 ID信息与生成的伪码序列进行逻辑运算, 形成伪码信号。
S12、将所述伪码序列对应的伪码序列指示码合并至所述伪码信号首部, 获得第一 合并信号。 其中, 所述伪码序列指示码是从小到大或从大到小不循环的大数, 随发射信号的 次数变化, 例如, 每发射一次信号所述伪码序列指示码加 1或者减 1。 S13、 在所述第一合并信号首部合并设备寻址码, 获得第二合并信号。 其中, 所述步骤 S11中, 所述逻辑运算为异或运算; 所述步骤 S13中, 所述设备 寻址码与 ID信息不相同, 但与 ID信息一一对应, 每一个 ID信息代表一个用户。
514、 对所述第二合并信号进行调制。
515、 以可见光信号的形式发送调制后的第二合并信号。 参见图 b4, 是本发明实施例四提供的一种基于多用户异步加密的接收方法流程 图, 该发射方法包括:
S2K 将接收的可见光信号转换为数字信号。 522、 对所述数字信号进行解调。
523、 将解调后的数字信号分解为设备寻址码和第一合并信号。
524、 将所述第一合并信号分解为伪码序列指示码和伪码信号。
525、根据设备寻址码对伪码序列指示码的合法性进行判决, 若合法, 查询伪码序 列指示码对应的伪码序列的伪码序列。 例如, 当伪码序列指示码是从小到大不循环的大数时, 根据所述设备寻址码查询 已接收到的伪码序列指示码, 若所述伪码序列指示码小于或者等于已接收到的伪码序 列指示码, 则判定无效, 否则判定合法; 或者, 当伪码序列指示码是从大到小不循环 的大数时, 根据所述设备寻址码查询已接收到的伪码序列指示码, 若所述伪码序列指 示码大于或者等于已接收到的伪码序列指示码, 则判定无效, 否则判定合法。
527、 将伪码序列与伪码信号进行译码, 输出 ID信息。
528、根据所述设备寻址码查询该设备对应 ID信息,将该 ID信息与译码获得的所 述 ID信息进行对比, 若相同, 判定合法, 输出合法的 ID信息。
529、 根据合法的 ID信息控制对应的设备。 下面以本发明实施例应用在光子物联网为例,对上述实施例进一步进行详细说明。 光子物联网的发射装置和接收装置之间所传播的可见光信息并不是原始数据, 而 是加密后的扰码信号。 这里所指的扰码, 是指对原始数据进行一定逻辑运算后所产生 的数据, 如对原始数据和伪码序列进行卷积或者进行移位操作运算等。 伪码序列是由 伪码发生器产生的一组二进制数字序列。 原始数据是一种数字序列信号, 在这里也称为基带数据, 在本例中其为 ID信息, 所述 ID信息指每一个发射装置的唯一识别码,可见光接收装置的设备控制电路就是根 据解密后的 ID 信息确定是否具有相应的权限, 从而是否能够控制设备作出相应的响 应。 伪码序列指示码是一个大数, 从小到大 (或从大到小) 不循环, 用于指示发射装 置及接收装置采用哪个对应的伪码序列进行加密与解密, 可见光发射装置每发射一次 信号, 伪码序列指示码将自加 1 (或自减 1 )。 设备寻址码是每个发射装置的唯一标识 号, 与 ID不相同, 但与 ID—一对应, 所述设备寻址码用于接收装置中查找对应设备 所预设的 ID信息和上一次该设备所接收到的伪码序列指示码。 如图 b5所示的第二合并数据的数据结构示意图,假设 ID信息为一个 16比特的二 进制数字 0000000000000100; 伪码序列指示码为一个 8比特的二进制数字 00000010, 其对应的伪码序列为一个 16 比特的二进制数字 1010101100100010; 设备寻址码也是 一个 8比特的二进制数字 10101010。 首先, ID信息与伪码序列在卷积编码器 102中进行逻辑运算 (如异或运算), 运 算结果如下表所示-
Figure imgf000027_0001
卷积编码过程表 从表 bl可知, 加密后的 ID信息为 1010101100100110, 与原始 ID信息不相同, 对数据起到了一定的加密作用。 所述加密后的 ID信息发送到伪码序列指示码合并单元 103, 与此同时, 伪码发生 器 101 也会将与伪码序列相对应的伪码序列指示码传送给伪码序列指示码合并单元 103。 加密的 ID 信息在所述伪码序列指示码合并单元 103 加上伪码序列指示码 00000010 作为头部, 然后输出到设备寻址码合并单元 104, 输出的数字序列为 000000101010101100100110ο 在所述设备寻址码合并单元 104中, 将伪码序列指示码合并单元 103输出的信号 再加上设备寻址码 10101010 作为头部, 然后输出, 所述输出的结果为 10101010000000101010101100100110ο 所述设备寻址码合并单元 104输出的所述信号 再发送到调制器 105进行信号调制, 再输出到 LED以快速闪灭的可见光信号的形式发 射出去。 从发射装置 LED灯发出的可见光经空中短距离传播后, 在接收装置中的可见光接 收器 201中进行接收, 并转化为数字电信号, 然后在解调器 202进行解调, 解调后的 输出信号再发送到设备寻址码分解单元 203。 所述设备寻址码分解单元 203 对接收到 的解调后 的信号 即 10101010000000101010101100100110 进行设备寻址码头部分离, 得到设备寻址码 10101010,并分别将所述设备寻址码 10101010发送到伪码序列查询单元 204和查询单 元 207。 所述设备寻址码头部分离后剩余的部分为 000000101010101100100110, 该数 据输入到伪码序列指示码分解单元 205。 所述伪码序列指示码分解单元 205对接收到的数据进行头部分离, 得到伪码序列 指示码 00000010, 并将所述伪码序列指示码发送到伪码序列查询单元 204。 在伪码序 列指示码分解单元 205将伪码序列指示码分离后剩下的部分 1010101100100110为加密 了的 ID信息, 将所述 ID信息发送到卷积译码器 206。 所述伪码序列查询单元 204的输入信号分别为设备寻址码 10101010和伪码序列指 示码 00000010。 在伪码序列查询单元 204中, 与设备寻址码 10101010对应的寄存器 保存有一个与该设备对应的上一次接收到的伪码序列指示码。 伪码序列查询单元 204 将之前保存的伪码序列指示码与当前所接收到的伪码序列指示码进行对比, 在采用升 序规则 (发射装置每发送一次信号伪码序列指示码自身加 1 ) 的情况下, 如果当前所 接收到的伪码序列指示码大于保存的伪码序列指示码, 则当前所接收的信号是合法的 信号; 否则, 说明当前所接收的信号是非法信号, 此时可将报警信息发送给报警单元 (图中未示) 进行报警。 另一种情况, 在采用除序规则 (发射装置每发送一次信号伪码序列指示码自身减 1 )的情况下, 如果当前所接收到的伪码序列指示码小于保存的伪码序列指示码, 则当 前所接收的信号是合法的信号; 否则, 说明当前所接收的信号是非法信号, 同样进行 报警。 如果判断为合法信号, 则伪码序列查询单元 204会将当前所接收到的伪码序列 指示码进行保存, 即更新原来所保存的伪码序列指示码。然后,伪码序列查询单元 204 根据新的伪码序列指示码对伪码序列数据库进行查询, 因为伪码序列指示码与所用的 伪码序列是一一对应的, 所以伪码序列查询单元 204能找出所对应的加密所用的伪码 序列, 并将这个伪码序列发送到卷积译码器 206。 由于接收装置与发射装置采用相同 的保密机,所以发射装置发送的伪码序列指示码 00000010能在接收装置查询到与发射 装置加密所用的伪码序列 1010101100100010。 卷积译码器 206的输入信号分别为加密了的 ID信息 1010101100100110和伪码序 列 1010101100100010。 这两个数据进行异或运算, 过程如下:
Figure imgf000028_0001
伪码序列
1 0 1 0 1 0 1 1 0 0 1 0 0 0 1 0 异或运算
输出 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 卷积译码过程表 从表 b2可以看出, 解密后的输出 ID信息为 0000000000000100。 为了进一步杜绝安全隐患,接收装置中还设置有一个 ID判决器 208和一个查询单 元 207。 由于可能有些伪造的信号可能会将伪码序列指示码设置得比较大, 会让伪码 序列查询单元 204误认为是合法信号, 从而选择与之对应的伪码序列进行解密, 同样 得到一个 ID信息, 但这个数据并不是真实的 ID, 而且是与设备寻址码对应不上的, 这样会存在安全问题。 由于接收装置与发射装置采用相同的保密机, 所以接收装置的查询单元 207接收 到设备寻址码 10101010后,将进行数据库查询,得到真实的 ID为 0000000000000100, 并将其发送到 ID判决器 208。
ID判决器 208在接收到卷积译码器 206及查询单元 207输出的 ID信息后, 将两 者进行数值对比, 如果相同, 说明接收到的信号为合法的信号, 然后将合法的 ID信息 发送到设备控制电路; 如果不相同, 说明接收到的信号为伪造的信号, 是非法的, 则 进行报警。 在本实施例中, 其接收到的两所述 ID信息都为 0000000000000100, 为合 法的信号, 即接收装置成功进行了解密。 假设本发明所举例说明的数据在收发端进行通信过程中被高速摄像机拍摄并进行 复制, 则复制的信号为空口信号 10101010000000101010101100100110。 由于接收装置 在接收到合法的信号时, 已经将其中的伪码序列指示码保存为 00000010, 当它再接收 到被复制的信号时, 通过分离其中的伪码序列指示码, 也得到 00000010。 根据加密的 升序规则, 后面接收到的伪码序列指示码应该大于 00000010 (采用降序规则时, 应小 于 00000010), 但复制的信号为两者是相等的, 因此可以判定为复制的非法信号。 再假设复制信号后, 再通过修改伪造一个新信号, 也就是将其中的伪码序列指示 码修改为 00000011, 其它部分不变。 在升序规则时, 伪码序列查询单元 204会判断为 合法的信号, 并查询与伪码序列指示码 00000011相对应的伪码序列,但这个伪码序列 肯定是与加密的伪码序列是不相同的, 我们假设伪码序列查询单元 204查询到对应的 伪码序列为 1010101100100011, 用此伪码序列对 ID信息进行解密, 过程表如下:
Figure imgf000030_0001
表 b3 伪造信号卷积译码过程表 由表 b3可知, 伪造信号解密出来的 ID信息为 0000000000000101。 由上述实施例可知, 查询单元 207对设备寻址码 10101010查询得到的 ID信息为
0000000000000100。 由于解密出来的 ID 信息和查询单元根据设备寻址码查询得到的 ID并不相同, 因此, ID判决器 208会判断所接收到的信号是伪造的非法信号。 综上所述, 本实施例所述的基于多用户的异步加密方法与同步加密方法相比, 在 技术上更容易实现, 并且能节省成本, 而且能够防范高速摄像机进行拍摄复制光信号, 在一定程度上提高了光子物联网的安全性。 实施例三 图 cl示出了一种可在其中实现本发明的可见光通信系统 100。可见光通信系统 100 包括发射端 110和接收端 120。 发射端 110包括编码器 111以及与编码器 111相耦合 的伪码信号发生器 112。 编码器 111接收原始通信数据, 并采用伪码信号发生器 112 产生的伪码信号对原始通信数据进行编码以产生扰码信号。 由于产生的扰码信号与原 始通信数据不同, 因此起到了加密的作用。 如在本文中使用的, 术语 "加密"和 "编 码", 以及 "解密"和 "解码"可以互换地使用。 原始通信数据可以是与发射端 110 相关联的身份信息。 编码器 111将扰码信号输出至发光单元 113, 后者将接收到的扰 码信号以可见光的形式发送出去。 发光单元 113可以是 LED或其他具有发光功能的元 件。 发射端 110可以是光子物联网中的手持式客户端。 接收端 120包括用于接收发射端 110 发射的可见光信号、并将可见光信号转换为 数字信号的接收单元 123。 解码器 121接收由接收单元 123输出的数字信号并采用伪 码信号发生器 122 产生的伪码信号对其进行解码, 以恢复出原始通信数据。 在图 cl 所示的可见光通信系统 100中仅示出了一个发射端 110, 但是本领域技术人员容易领 会, 对应于一个接收端 120往往存在多个发射端 110。 为了使发射端 110和接收端 120之间的通信具有更高的安全性, 防止高速摄像机 拍摄复制光信号, 所以在发射端 110和接收端 120中都使用了随时间变化的序列, 如 伪码序列, 伪随机序列或伪随机码对原始通信数据进行了加密和解密。 因此, 如图 cl 所示, 伪码信号发生器 112以晶振 114提供的时钟信号为基准根据发射端 110的状态 机的状态输出随时间变化的伪码信号。 相应地, 接收端 120中的伪码信号发射器 122 也以晶振 124提供的时钟信号为基准根据接收端 120的状态机的状态输出随时间变化 的伪码信号。 图 c2示出了一种在可见光通信系统 100中使用的加解密方法的流程图。 在步骤 201,发射端 110对原始通信数据与随时间变化的第一伪码信号进行逻辑运算以获得扰 码信号。 原始通信数据可以是要发送的用户信息, 例如用户 ID信息、 指纹、 面部、 虹 膜、 输入的密码其他辅助验证用户身份的信息等, 当然也可以包括以上两者或更多者 的组合, 并且可以是一种数字序列信号。伪码信号可以是随单位时间变化的数字序列, 其中该单位时间可以根据需要设置, 例如, 每天、 每小时、 每分钟、 每秒等。 原始通 信数据与第一伪码信号的逻辑运算可以是逻辑与、 逻辑或、 逻辑异或等, 也可以是上 述运算中的任意两者或更多者的组合。 例如原始通信数据为发射端的用户 ID, 并且始终为 00001101。在经过 5个单位时 间 T后所对应的发射端状态 N+5下, 第一伪码信号可以为 10101010, 则原始通信数据 与第一伪码信号的逻辑运算, 例如 "异或" 的过程如下表所示:
Figure imgf000031_0001
在步骤 202, 发射端 110将该扰码信号以可见光信号的形式发送出去。 例如, 发 射端 110通过 LED灯以闪光形式将调制信号发送出去。 针对上述扰码信号 10100111, LED灯可产生高频率闪烁, 有光可代表 1, 无光可代表 0, 或者反之亦然, 从而有效地 实现了可见光通信。 在步骤 203, 接收端 120接收发射端 110发送的可见光信号, 并将该可见光信号 转换为数字信号。例如,对于 LED灯产生的高频率闪烁,有光可代表 1,无光可代表 0, 或反之, 从而可将接收的可见光信号转换为数字信号。 在步骤 204, 接收端 120对该数字信号与第二伪码信号进行解码例如逻辑运算, 以获得原始通信数据。具体地,在经过 5个单位时间 T后所对应的接收端状态 N+5下, 第二伪码信号也为 10101010, 与第一伪码信号码型、 起止相位相同。 接收端 120对接 收到的信号与第二伪码信号的逻辑运算, 例如 "异或"过程如下表所示-
Figure imgf000032_0001
可见, 解码输出信号为 00001101, 与原始通信数据相同, 即解码出了原始通信数 据。 如上文所述, 为了使接收端能正确解码, 接收端的伪码信号发生器产生的伪码信 号需要与发射端的伪码信号发生器产生的伪码信号同步变化。 具体地, 伪码信号的变 化是由收发两端的状态机的状态决定的, 对应于状态机的不同状态, 具有不同伪码信 号。 理想地, 发射端与接收端的状态机的状态是同步变化的, 使得发射端和接收端的 伪码信号也能同步变化。 例如在经过一定的单位时间 (例如, 1秒、 1分钟或其他规定 的时间段)后, 收发两端的状态机的状态同时由上一个状态 N跳变到下一个状态 N+l, 相应地, 发射端与接收端处用于加密和解密的伪码信号也会同时从与状态 N相对应的 伪码信号变为与状态 N+1相对应的伪码信号。 在可见光通信系统中, 可见光发射端 110和接收端 120的时钟系统的精准度由各 自的晶振 114、 124所决定。 由于制造工艺、工作环境等各方面的原因, 晶振 114、 124 都会存在一定的误差, 这就使得发射端 110和接收端 120的时间变化会不一样。 假设 收发两端都从 0秒开始计时, 但接收端 120的时钟系统相对快点, 如以标准的时间为 参照, 经过 1秒的时间, 可能发射端 110中的时钟系统才到达 0. 999999秒, 但这时接 收端 120 的时钟系统已经到达 1. 000001秒, 两者的误差为 1. 000001 - 0. 999999 = 0. 000002秒, 在经过标准时间的 500000秒后, 收发两端的时钟系统显示将相差 1秒。 发射端 110和接收端 120的状态变化都是以自身的时钟系统为基准的, 由于上述 收发两端的时钟系统之间的误差, 导致发射端 110和接收端 120的状态机的状态变化 可能不同步。 以收发两端的状态机以标准的单位时间 T变化为例, 假设发射端 110的 时钟系统比标准时间慢, 而接收端 120的时钟系统比标准时间快。 在经过某一标准时 间后, 发射端 110和接收端 120的系统时间相差一个单位时间 T。 此时, 发射端 110 处于状态^ 而接收端 120处于状态 N+l, 即接收端 120用来解密的伪码信号与发射端 110用来加密的伪码信号不一样, 因此接收端 120不能正确解密。 图 c3是示出了发射端和接收端的状态机的状态随时间变化的示意图。 如图 c3所 示, 在标准时间 to时刻, 假设发射端和接收端的时钟系统是对准的, 发射端与接收端 都处于状态 N, 在经过一段时间后, 到达标准时间 tl时刻。 此时, 发射端由于时钟系 统较慢, 还处于状态 N+5, 而接收端由于时钟系统较快, 已经处于状态 N+6。 因此接收 端所选用的解密的伪码信号与发射端选用的加密的伪码信号不一致, 导致解密出错。 为此, 本发明提供了一种可见光通信系统中的宽松解密方法。 根据本发明的一方 面, 在接收到来自发射端的可见光信号时, 不仅用接收端的状态机的当前状态对应的 密钥对收到的可见光信号进行解密, 而且在解密未成功的情况下还使用与在该当前状 态之前和 /或之后的至少一个状态对应的密钥对可见光信号进行解密。 以这种方式,避 免了因发射端与接收端的时钟系统的误差而导致的误检。 图 c4示出了根据本发明的一方面的可见光通信系统中的宽松解密方法的流程图。 在步骤 401, 在接收端处接收来自发射端的可见光信号, 该可见光信号在该发射端至 少部分地用随该发射端的状态机的状态变化的密钥被加密。 在一实例中, 该可见光信 号包括通信数据以及该发射端的标识符, 其中该通信数据用随该发射端的状态机的状 态变化的密钥被加密, 而该发射端的该标识符未被加密。 例如, 该通信数据可以是用 户身份 (ID) 信息, 而该发射端的标识符可以是该发射端的设备号。 在可见光通信系 统中, 发射端的设备号对于发射端是独一无二的, 从而可被用于唯一地标识发射端。 该通信数据诸如用户 ID是与发射端的标识号一起相关联地存储在接收端的。 在步骤 402, 用与该接收端的状态机的当前状态以及在该当前状态之前和 /或之后 的至少一个状态对应的密钥对该可见光信号进行解密。 根据本发明的一方面, 除了接 收端的状态机的当前状态外, 取决于接收端与发射端的时钟系统的相对快慢, 接收端 还可以选用当前状态之前的预定数目个状态、 选用当前状态之后的预定数目个状态、 或者既选用当前状态之前的预定数目个状态又选用当前状态之后的预定数目个状态。 例如, 在已知接收端的时钟系统比发射端的时钟系统快的实例中, 除了接收端的状态 机的当前状态外, 接收端可以仅选用当前状态之前的预定数目个状态。 在已知接收端 的时钟系统比发射端的时钟系统慢的实例中, 除了接收端的状态机的当前状态外, 接 收端可以仅选用当前状态之后的预定数目个状态。 在接收端与发射端的时钟系统的相 对快慢不确定的实例中, 除了接收端的状态机的当前状态外, 接收端可以既选用当前 状态之前的预定数目个状态又选用当前状态之后的预定数目个状态。 该预定数目的大 小可取决于接收端和发射端中晶振的精准度、 接收端和发射端的处理能力等因素。 在一实例中, 接收端可以首先用与其状态机的当前状态对应的密钥对该可见光信 号进行解密。 如果该解密成功, 则该过程结束。 若该解密未成功, 则继续用与该当前 状态之前和 /或之后的预定数目个状态对应的密钥进行解密。例如,接收端可以依次用 与该当前状态之前和 /或之后的预定数目个状态中的每个状态对应的密钥对可见光信 号进行解密,直至该可见光信号被成功解密或者已使用与该当前状态之前和 /或之后的 预定数目个状态中的所有状态对应的密钥对可见光信号进行了解密。 在可见光信号包括加密的通信数据以及未加密的该发射端的标识符的实例中, 接 收端可首先从可见光信号中获得发射端的标识符, 并检索出本地存储的与该标识符相 关联的通信数据。 在接收端使用与所选用的这些状态中的某一状态对应的密钥恢复出 通信数据后, 将恢复出的通信数据与在接收端本地存储的通信数据作比较, 若两者相 同, 则认为解密成功。例如, 如果恢复出的用户 ID与接收端本地存储的用户 ID—致, 则认为该可见光信号为合法信号。 否则, 继续用与余下的状态对应的密钥对该可见光 信号解密, 直至解密成功或已经使用了与所选用的所有状态对应的密钥对可见光信号 进行了解密为止。如果与该当前状态以及之前和 /或之后的预定数目个状态中的所有状 态对应的密钥对可见光信号的解密皆未成功, 则认为该可见光信号为非法信号。 在上述宽松解密过程中, 解密的次序是首先采用与当前状态对应的密钥, 然后是 与当前状态前后的预定数目个状态对应的密钥。然而, 该次序仅是示例性的, 事实上, 接收端可以按任意的预定次序用与当前状态以及在当前状态之前和 /或之后的至少一 个状态中的每个状态对应的密钥进行解密, 直至可见光信号被成功解密或已使用与这 些状态中的所有状态对应的密钥对可见光信号进行了解密为止。 尽管为使解释简单化将上述宽松解密方法图示并描述为一系列动作, 但是应理解 并领会, 这些方法不受动作的次序所限, 因为根据一个或多个实施例, 一些动作可按 不同次序发生和 /或与来自本文中图示和描述或本文中未图示和描述但本领域技术人 员可以理解的其他动作并发地发生。 例如, 上述选用不止当前状态一个状态解密的过 程可以是一次检索一个状态, 当用该状态对应的密钥解密不成功时, 再检索下一个状 态并相应地解密, 直至解密成功或已经检索了所有预定数目个状态, 或者可以是一次 检索当前状态以及前后的预定数目个状态, 然后再依次用对应每个状态的密钥进行解 密, 直至解密成功为止。 下文参照图 c3的状态图来描述上述宽松解密方法。 接收端在标准时间 t l接收到 发射端发射的可见光信号。 接收端可以将收到的可见光信号转换成数字信号, 并首先 获得未加密的该发射端的设备号。 此时, 接收端的状态机的当前状态为 N+6。 除了当 前状态 N+6,接收端还可以选用当前状态之前的预定数目个(例如 2个)状态 N+4、N+5, 以及当前状态之后的 2个状态 N+7、 N+8。 接收端可以首先用对应当前状态 N+6的伪码 序列对该数字信号进行解密, 例如可以执行逻辑异或运算, 以得到一用户 ID。 接收端 将解密得到的该用户 ID与本地存储的与该发射端相关联的用户 ID作比较, 两者并不 相同, 因此该解密不成功。 随后, 接收端按预定次序用与当前状态的前后四个状态相 对应的伪码序列对该数字信号进行逻辑异或运算。 该预定次序可以是依距离当前状态 从近到远的顺序, 例如, 可以是 N+7、 N+5、 N+8、 N+4。 接收端用与状态 N+7对应的伪 码序列进行解密, 由于解密出的用户 ID与本地存储的用户 ID不一致, 接收端继续使 用与状态 N+5对应的伪码序列进行解密。此时,解密得到的用户 ID与本地存储的用户 ID—致, 因此解密成功, 将该可见光信号标识为合法信号, 该过程终止。 如上所述, 该预定次序可以是符合实际需要的任意次序。例如接收端可以按 N+4、 N+5、 N+6、 N+7、 N+8的次序用相应伪码序列解密, 直至解密成功。 图 5是示出了根据本发明的一方面的通信装置 500的框图。 通信装置 500包括接 收来自发射设备的可见光信号的接收器 502, 该可见光信号在发射设备至少部分地用 随发射设备的状态机的状态变化的密钥被加密。 通信装置 500还包括解码器 504。 解 码器 504用与通信装置 500的状态机的当前状态以及在当前状态之前和 /或之后的至少 一个状态对应的密钥对该可见光信号进行解密。 根据本发明的一方面, 除了通信装置 500的状态机的当前状态外, 取决于通信装置 500与发射设备的时钟系统的相对快慢, 解码器 504还可以选用当前状态之前的预定数目个状态、 选用当前状态之后的预定数 目个状态、 或者既选用当前状态之前的预定数目个状态又选用当前状态之后的预定数 目个状态。 在一实例中, 解码器 504可以首先用与通信装置 500的状态机的当前状态 对应的密钥对该可见光信号进行解密。 如果该解密成功, 则该过程结束。 若该解密未 成功,则解码器 504继续用与该当前状态之前和 /或之后的预定数目个状态对应的密钥 进行解密。例如,解码器 504可以依次用与该当前状态之前和 /或之后的预定数目个状 态中的每个状态对应的密钥对可见光信号进行解密, 直至该可见光信号被成功解密或 者已使用与该当前状态之前和 /或之后的预定数目个状态中的所有状态对应的密钥对 可见光信号进行了解密。 伪码信号发生器 508可生成随通信装置 500的状态机的状态 变化的密钥, 例如伪码序列信号。 通信装置 500还可包括存储器 510。存储器 510可存储状态信息 512,例如通信装 置 500的状态机。 通信装置 500还可包括处理器 506。 该处理器 506可以是专用于分 析接收器 502收到的信息的处理器、 控制通信装置 500的一个或多个组件的处理器、 和 /或既分析接收器 502收到的信息又控制通信装置 500的一个或多个组件的处理器。 图 6是示出了根据本发明的一方面的通信装置 600的框图。 应当领会到, 通信装 置 600被表示为包括功能块, 这些功能块可以表示由处理器、 软件或其组合 (例如固 件) 实现的功能块。 通信装置 600包括可协作的电子组件的逻辑分组 602。 例如, 逻 辑分组 602可包括用于在接收端接收来自发射端的可见光信号的电子组件, 该可见光 信号在发射端至少部分地用随发射端的状态机的状态变化的密钥被加密 604。 此外, 逻辑分组 602 还可包括用于用与接收端的状态机的当前状态以及在当前状态之前和 / 或之后的至少一个状态对应的密钥对该可见光信号进行解密的电子组件 606。 另外, 通信装置 600可包括保存用于执行与电子组件 604和 606相关联的功能的指令的存储 器 608。 尽管示为处于存储器 608的外部, 但是应当理解电子组件 604和 606中的一 个或多个可存在于存储器 608内。 实施例四 本实施例中的时钟调整方法不仅仅可以应用于接收端的密钥的获取, 也可以应用 于其他方面。 本实施例中的时钟调整方法可以作为一个单独的技术方案存在。 图 dl示出了一种可在其中实现本发明的可见光通信系统 100d。 可见光通信系统 100d包括发射端 l lOd和接收端 120d。发射端 l lOd包括编码器 11 Id以及与编码器 11 Id 相耦合的伪码信号发生器 112d。 编码器 l l ld接收原始通信数据, 并采用伪码信号发 生器 112产生的伪码信号对原始通信数据进行编码以产生扰码信号。 由于产生的扰码 信号与原始通信数据不同,因此起到了加密的作用。如在本文中使用的,术语 "加密" 和 "编码" , 以及 "解密"和 "解码"可以互换地使用。 原始通信数据可以是与发射 端 l lOd相关联的 ID信息。 编码器 111将扰码信号输出至发光单元 113d, 后者将接收 到的扰码信号以可见光的形式发送出去。发光单元 113d可以是 LED或其他具有发光功 能的元件。 发射端 l lOd可以是光子物联网中的手持式客户端。 接收端 120d包括用于接收发射端 110 d发射的可见光信号、并将可见光信号转换 为数字信号的接收单元 123d。解码器 121d接收由接收单元 123d输出的数字信号并采 用伪码信号发生器 122d产生的伪码信号对其进行解码, 以恢复出原始通信数据。在图 dl所示的可见光通信系统 100d中仅示出了一个发射端 110d, 但是本领域技术人员容 易领会, 对应于一个接收端 120d往往存在多个发射端 110d。 为了使发射端 l lOd和接收端 120d之间的通信具有更高的安全性, 防止高速摄像 机拍摄复制光信号, 所以在发射端 l lOd和接收端 120d中都使用了随时间变化的伪码 序列对原始通信数据进行了加密和解密。 因此, 如图 dl所示, 伪码信号发生器 112d 以晶振 114d提供的时钟信号为基准根据发射端 110d的状态机的状态输出随时间变化 的伪码信号。相应地,接收端 120d中的伪码信号发射器 122d也以晶振 124d提供的时 钟信号为基准根据接收端 120d的状态机的状态输出随时间变化的伪码信号。 图 d2示出了一种在可见光通信系统 100d中使用的加解密方法的流程图。 在步骤 201d,发射端 110d对原始通信数据与随时间变化的第一伪码信号进行逻辑运算以获得 扰码信号。 原始通信数据可以是要发送的信息, 例如用户身份 (ID ) 信息等, 并且可 以是一种数字序列信号。 伪码信号可以是随单位时间变化的数字序列, 其中该单位时 间可以根据需要设置, 例如, 每天、 每小时、 每分钟、 每秒等。 原始通信数据与第一 伪码信号的逻辑运算可以是逻辑与、 逻辑或、 逻辑异或等, 也可以是上述运算中的任 意两者或更多者的组合。 例如原始通信数据为发射端的用户 ID, 并且始终为 00001101。在经过 5个单位时 间 T后所对应的发射端状态 N+5下, 第一伪码信号可以为 10101010, 则原始通信数据 与第一伪码信号的逻辑运算, 例如 "异或" 的过程如下表所示:
Figure imgf000037_0001
在步骤 202, 发射端 110d将该扰码信号以可见光信号的形式发送出去。 例如, 发 射端 110d通过 LED灯以闪光形式将调制信号发送出去。针对上述扰码信号 10100111, LED灯可产生高频率闪烁, 有光可代表 1, 无光可代表 0, 或者反之亦然, 从而有效地 实现了可见光通信。 在步骤 203, 接收端 120d接收发射端 110d发送的可见光信号, 并将该可见光信 号转换为数字信号。 例如, 对于 LED灯产生的高频率闪烁, 有光可代表 1, 无光可代 表 0, 或反之, 从而可将接收的可见光信号转换为数字信号。 光信号转换为数字信号 的过程如下: 首先是光电转换, 利用光电二极管的电信号与光信号的特性, 形成电脉 冲信号。 但是由于发射端与接收端的位置不一样, 即每个发射端发射到接收端的光信 号强度是不一样的, 所以其电信号强弱也是不一样的, 所以需要对光电二极管所形成 的电流进行整流比较。 如当二极管通过的电流值高于某一定门限值时, 光电转换电路 将输出的电压电平值调整为高电平; 当通过光电二极管的电流值低于某一门限值时, 光电转换电路将输出的电压电平值调整为低电平。 该门限值的设定是通过一个数学模 型根据不同的环境来设定的, 如距离较远时, 门限值可能会降低; 距离近时门限值可 能会相对升高, 即门限值与门限值之间的变化关系由数学模型决定,可以是线性关系, 也可以是非线性关系。 通过以上过程, 可以将电平调整到一定范围内, 以此保证正确 的脉冲形状, 以保证采样的正确, 从而保证时钟计算的正确性。 在步骤 204, 接收端 120d对该数字信号与第二伪码信号进行解码例如逻辑运算, 以获得原始通信数据。具体地,在经过 5个单位时间 T后所对应的接收端状态 N+5下, 第二伪码信号也为 10101010, 与第一伪码信号码型、 起止相位相同。 接收端 120d对 接收到的信号与第二伪码信号的逻辑运算, 例如 "异或"过程如下表所示-
Figure imgf000038_0001
可见, 解码输出信号为 00001101, 与原始通信数据相同, 即解码出了原始通信数 据。 如上文所述, 为了使接收端能正确解码, 接收端的伪码信号发生器产生的伪码信 号需要与发射端的伪码信号发生器产生的伪码信号同步变化。 具体地, 伪码信号的变 化是由收发两端的状态机的状态决定的, 在经过一定的单位时间 (例如, 1秒、 1分钟 或其他规定的时间段) 后, 收发两端的状态机的状态就会由上一个状态跳变到下一个 状态, 同时与状态机状态对应的加密和解密所使用的伪码信号也会作相同的变化。 在可见光通信系统中, 可见光发射端 110d和接收端 120d的时钟系统的精准度由 各自的晶振 114d、 124d所决定。由于制造工艺、工作环境等各方面的原因,晶振 114d、 124d都会存在一定的误差,这就使得发射端 110d和接收端 120d的时间变化会不一样。 假设收发两端都从 0秒开始计时, 但接收端 120的时钟系统相对快点, 如以标准的时 间为参照, 经过 1秒的时间, 可能发射端 110d中的时钟系统才到达 0. 999999秒, 但 这时接收端 120d 的时钟系统已经到达 1. 000001 秒, 两者的误差为 1. 000001 - 0. 999999 = 0. 000002秒, 在经过标准时间的 500000秒后, 收发两端的时钟系统显示 将相差 1秒。 在系统的具体实现中, 收发两端时钟系统的时间变化是以各自的系统最小单位时 间——即晶振的周期——数目来计量的, 注意, 此处晶振的周期是指晶振的实际周期
(下文称为晶振的系统周期)。 例如, 假设发射端 nod 的晶振 i i4d 的标称频率为 标称 =lfflz, 晶振的标称周期 1标 =10_6s。 理想地, 若晶振 114绝对精准没有误差, 即晶振 114 的实际频率 (下文称为晶振的系统频率) 系统 = 标称 =1ΜΗζ, 则晶振 114 的实际周期 ι系统 = ι标称 =10_6s, 发射端 110d处每 标称 ( = 106) 个 ι系统记为发射端时 钟系统的系统时间 1秒钟, 这种理想情况下, 发射端系统时间 1秒钟等于标准时间 1 秒钟。 类似地, 假设接收端 120d的晶振 124d的标称频率为 /2标 =lfflz, 晶振的标称 周期 ^««^ΙΟ-δ^ 理想地, 若晶振 124d绝对精准没有误差, 即晶振 124的系统频率 2系统 = 2标称 =1ΜΗζ, 则晶振 124d的实际周期 ^系统 = 标称 =10_6s,接收端 120处每 2标称
( = 106)个 记为接收端时钟系统的系统时间 1秒钟, 这种理想情况下, 接收端系 统时间 1秒钟等于标准时间 1秒钟。 然而, 由于制造工艺或工作环境等各方面的因素, 晶振的实际频率与标称频率之 间存在一定误差, 并不相等。 例如, 若 系统〈 1标称 =1ΜΗζ, 贝 系统〉 ι标称 =10-6秒, 然 而发射端 110d仍然是将 (即 106) 个7^ 记为时钟系统时间的 1秒钟, 这一点 对于理解发射端的系统时间的快慢原因非常重要。此时, 发射端 110d处的时钟系统的
1秒钟, 实际经历了即 标称 " ι系统的标准时间, 该实际经历的标准时间大于 1秒的标 准时间, 即发射端 110d 处的系统时间较标准时间慢。 若 /2系统 〉 /2标称 =lfflz, 则
^系统〈 称 =10-6秒, 然而接收端 120d仍然是将 标称 (即 106)个 ^系统记为时钟系统 时间的 1秒钟。此时, 接收端 120d处的时钟系统的 1秒钟, 实际经历了^ Ί 的 标准时间, 该实际经历的标准时间小于 1秒的标准时间, 即接收端 120d处的系统时间 较标准时间快。 由此可清楚地看到, 收发两端的时钟系统的系统时间是缘何快于或慢 于标准时间的。 发射端 110d和接收端 120d的状态变化都是以自身的时钟系统为基准的, 由于上 述收发两端的时钟系统之间的误差, 导致发射端 110d和接收端 120d的状态机的状态 变化可能不同步。以收发两端的状态机以标准的单位时间 T变化为例,假设发射端 110d 的时钟系统比标准时间慢, 而接收端 120d的时钟系统比标准时间快。在经过某一标准 时间后, 发射端 110d和接收端 120d的系统时间相差一个单位时间 T。 此时, 发射端 110d处于状态^ 而接收端 120d处于状态 N+l, 即接收端 120用来解密的伪码信号与 发射端 110d用来加密的伪码信号不一样, 因此接收端 120d不能正确解密。 图 d3是示出了发射端和接收端的状态机的状态随时间变化的示意图。 如图 d3所 示, 在标准时间 tO时刻, 假设发射端和接收端的时钟系统是对准的, 发射端与接收端 都处于状态 N, 在经过一段时间后, 到达标准时间 tl时刻。 此时, 发射端由于时钟系 统较慢, 还处于状态 N+5, 而接收端由于时钟系统较快, 已经处于状态 N+6。 因此接收 端所选用的解密的伪码信号与发射端选用的加密的伪码信号不一致, 导致解密出错。 如上所述, 时钟系统的系统时间可能快于或慢于标准时间, 为了衡量发射端 l lOd 和接收端 120d的系统时间的快慢程度,本发明中引入了 "时钟变化参数" 的概念。时 钟变化参数可以是对应于系统时间的单位时间实际经历的标准时间。 假定以 1秒钟为 单位时间。如上所述, 对应于发射端 l lOd的系统时间的单位 1秒钟时间, 实际经历的 标准时间为 ' Τι系统。取决于系统时钟的快慢,该实际经历的标准时间 ' ^ 可 能小于或大于 1秒钟标准时间。对应于接收端 120d的系统时间的单位 1秒钟时间, 实 际经历的标准时间为 /2» * T^, 该实际经历的时间取决于系统时钟的快慢也可能小 于或大于 1秒钟标准时间。 对应于收发两端同样大小的系统时间, 却实际经历不同标准时间的事实反映了它 们系统时间之间的快慢关系。在本文中,将对应于接收端 120d的系统时间的单位时间 实际经历的标准时间与对应于发射端 l lOd 的系统时间的同样单位时间实际经历的标 准时间之比称为发射端 l lOd的时钟快慢因子。以单位时间为 1秒钟为例,发射端 l lOd 的时钟快慢因子2 = ( ^*» * 7^ )/(^«; * 7^ )。 显然, 该时钟快慢因子等于经过相 同时间发射端的系统时间的变化幅度与接收端的系统时间的变化幅度之比。 因此, 可 以在接收端 120d处根据接收端 120d的系统时间的变化确定发射端 l lOd的系统时间的 变化。 为了能够在接收端 120d处确定该时钟快慢因子, 可以用接收端 120d本地晶振的 系统周期7^ 的数目来计量对应于收发两端的系统时间的单位时间实际经历的标准 时间。 令该单位时间为发射端 nod 发射的可见光信号的一个光脉冲的标称持续时间 Γ。标称 。 ^* 是由信号的标称波特率决定的, 具体地为波特率的倒数。 例如, 在标称波 特率为 4800bps的情况下, 一个光脉冲的标称持续时间 ^* =1/4800秒。 在可见光通 信系统中, 用于通信的可见光的波特率一般是由收发两端协定的, 因此已为接收端
120d所知晓。 对应于接收端 120d的系统时间的 ^*»实际经历的标准时间可以计算得 到, 具体为 (Γ。标称 · 2标称 ) · ^系统, 即 (Γ。标称 · 2标称 )个系统周期。 对应于发射端 110d的 系统时间的 <* 实际经历的标准时间可以在接收端 120d处实际测量来自发射端 110d 的可见光信号的一个光脉冲的持续时间得到并以接收端 120的晶振的系统周期为单位 记为 M . T2系统。 相应地, 发射端 110的时钟快慢因子2 = ( *称 · /2标称) /M。 由此, 根据接收端 120d经过的系统时间, 可以计算出发射端 110d的系统时间的变化。 一般地, 在可见光通信系统建立的早期, 收发两端时钟系统的误差还没有随时间 被放大, 因此可以认为是对准的。 因此, 在早期例如设备调试期间接收端 120d与发射 端 110d初次通信时,在接收端 120d本地存储发射端 110d的时钟信息, 具体地可以将 发射端 110d的时钟信息设为与此时接收端 120d的时钟信息一致。 时钟信息可以指时 钟系统的系统时间值。 假设此时发射端 110d与接收端 120d的时钟系统的系统时间值 为 0时。 由于收发两端时钟系统是对准的, 所以此时接收端 120d本地存储的发射端 HOd的时钟信息与发射端 110d的真实的时钟信息是一致的。 注意,接收端 120d处保存的发射端 110d的时钟信息的变化是与接收端 120d自身 的系统时间的变化相一致的, 因此, 在系统建立后随着时间的流逝, 接收端 120d处保 存的发射端 110d的时钟信息与发射端 110d处的真实的时钟信息之间产生误差。 具体 地, 经过接收端 120d的系统时间的预定时间, 接收端 120d本地存储的发射端 110d 的时钟信息的变化幅度也为该预定时间,但是实际上, 发射端 110d真实的时钟信息的 变化幅度应为该预定时间乘以发射端 110d的时间快慢因子。 因此, 每隔该预定时间, 产生的该误差等于该预定时间减去发射端 110d的时钟快慢因子与该预定时间的乘积。 相应地,可用所存储的发射端 110d的时钟信息减去该误差以对其进行更新。每隔预定 时间段, 接收端 120d就在所存储的发射端 110d的时钟信息上消除该误差量, 以使得 更新后的发射端 110d的时钟信息与发射端 110d处的真实的时钟信息相一致。 作为说明性示例, 假设该预定时间为 5分钟, 并且假设 Q=4/5。 从 0时开始, 当 接收端 120d处经过系统时间 5分钟时,接收端 120d本地保存的发射端 110d的时钟信 息为 0时 5分。然而, 发射端 110真实的时钟系统的变化是 5 X 4/5=4分钟, 即误差为 5-4=1分钟。相应地,将本地保存的发射端 110d的时钟信息 0时 5分减去 1分钟误差, 更新为 0时 4分。 类似地, 当接收端 120处再经过 5分钟系统时间时, 本地保存的发 射端 110d的时钟信息为 0时 9分, 其中又包含所产生的误差 1分钟, 因此, 更新后的 发射端 110d的时钟信息为 0时 8分。 由于收发两端晶振的误差有可能随温度等环境条件变化,因此发射端 110d的时钟 快慢因子也可能变化。所以, 后续每次收到该发射端 110d的可见光信号时, 都可以根 据新接收到的可见光重新计算该时钟快慢因子。相应地,接收端 120d根据本地所存储 的发射端 nod 的时钟信息来选择用于解密的伪码信号。 由于, 本地所存储的发射端 110的时钟信息是每隔预定时间段自动调整的, 所以与发射端 l lOd处的真实的时钟信 息的误差不会放大。 进而, 保证了根据接收端 120d处所存储的发射端 l lOd的时钟信 息选择的伪码信号能够与发射端 l lOd处根据真实的发射端 l lOd时钟信息选择的伪码 信号能够同步。 图 d4 是示出了根据本发明的一方面的用于自动调整可见光通信系统中的时钟的 方法的流程图。 尽管为使解释简单化将该方法图示并描述为一系列动作, 但是应理解 并领会, 这些方法不受动作的次序所限, 因为根据一个或多个实施例, 一些动作可按 不同次序发生和 /或与来自本文中图示和描述的其他动作并发地发生。 在步骤 401, 接收端接收来自至少一个发射端中的第一发射端的可见光信号。 该 接收端可以是图 dl中的接收端 120d,第一发射端可以是图 dl中的发射端 110d。该可 见光信号是光脉冲信号, 例如有光代表 1, 无光代表 0, 或反之。 该可见光信号一般包 含该第一发射端的用户身份(ID)信息, 该 ID信息是采用随第一发射端的系统时间变 化的伪码信号进行加密的。 另外, 该可见光信号还包括用于标识该第一发射端的标识 符, 例如第一发射端的设备号。 发射端的设备号在系统中是唯一性的, 因此可通过设 备号来唯一地标识某一发射端。 该标识符是未加密的, 可以被接收端直接解读得到。 在步骤 402, 根据接收自第一发射端的可见光信号确定第一发射端的时钟变化参 数和接收端的时钟变化参数。 如上文提及的, 第一发射端的时钟变化参数是对应于第 一发射端的系统时间的单位时间所实际经历的标准时间, 其中该实际经历的标准时间 可以用接收端的晶振的系统周期为单位来计量。 在一实例中, 该单位时间为来自第一 发射端的可见光信号的一个光脉冲的标称持续时间, 后者等于可见光信号的标称波特 率的倒数。 对应于第一发射端的系统时间的该单位时间所实际经历的标准时间可以通 过在接收端处实际测量该可见光信号的一个光脉冲的持续时间得到并以接收端的晶振 的系统周期为单位记为 Μ · Τ2系统。 在一实例中, 接收端可以将该可见光信号转换成 数字信号, 并且从该数字信号的一个脉冲的高电平或低电平开始直至该高电平或低电 平结束对经历了多少个 Τ2系统进行计数, 得到的数目即为 Μ。 接收端的时钟变化参数可以是指对应于接收端的系统时间的该单位时间实际经历 的标准时间, 其中该实际经历的标准时间可以用接收端的晶振的系统周期为单位来计 量。在该单位时间为来自第一发射端的可见光信号的一个光脉冲的标称持续时间 ^**» 的实例中, 对应于接收端的系统时间的该单位时间实际经历的标准时间被计算为
(^)标称 * Λ标称 ) * ^2系统 在步骤 403, 根据第一发射端的该时钟变化参数和接收端的该时钟变化参数确定 第一发射端的时钟快慢因子。 第一发射端的时钟快慢因子为对应于接收端的系统时间 的该单位时间实际经历的标准时间与对应于第一发射端的系统时间的该单位时间实际 经历的标准时间之比。 在该单位时间为来自第一发射端的可见光信号的一个光脉冲的 标称持续时间 ^* 的实例中, 该第一发射端的时钟快慢因子2 = (7«» ' /2»»)/ 。 由 于7 « 、 /2«»皆是接收端已知的, 而 M是实际测量得到的, 因此, 在接收端可以得到 第一发射端的时钟快慢因子的大小。 在步骤 404, 根据第一发射端的该时钟快慢因子每隔预定时间更新该接收端本地 存储的第一发射端的时钟信息。 如上所述, 时钟快慢因子等于经过相同时间, 第一发 射端的系统时间的变化幅度与接收端的系统时间的变化幅度之比。 因此, 接收端处每 流逝该预定时间的系统时间, 第一发射端的系统时间的真实变化幅度应为该时钟快慢 因子与该预定时间的乘积, 但接收端本地存储的第一发射端的系统时间的变化幅度为 该预定时间,所以本地存储的第一发射端的时钟信息的误差为该预定时间减去该乘积。 进而, 用本地存储的第一发射端的时钟信息减去该误差以进行更新可以消除该误差。 以此方式, 每经过该预定时间, 就更新一次本地存储的第一发射端的时钟信息。 接收端本地的该第一发射端的时钟信息最初可以是在接收端与第一发射端在系统 建立初期 (例如, 首次) 通信时存储的并且可以被设为等于接收端当时的时钟信息。 这是因为可见光通信系统中的收发两端的首次通信一般是在系统建立初期, 例如在系 统建立调试期间, 此时接收端处还没有存储第一发射端的时钟信息。 由于在系统建立 初期认为收发两端的时钟信息基本是一致的, 所以, 可以直接将接收端当前的时钟信 息作为第一发射端的时钟信息存储在接收端本地。 时钟信息可以指时钟系统的系统时 间。 例如, 接收端在首次接收到第一发射端的可见光信号时, 可以从可见光信号中直 接解读出第一发射端的标识符, 诸如设备号, 并在本地与该第一发射端的标识符相关 联地存储第一发射端的时钟信息。 尽管图 d4中未明确示出,但是该方法还可以包括在后续每一次接收到来自该第一 发射端的可见光信号时, 可以根据新接收到的可见光重新计算该时钟快慢因子, 从而 根据新计算出的时钟快慢因子每隔该预定时间来更新本地存储的第一发射端的时钟信 息。 通过这种方式, 接收端本地保存的发射端的时钟信息可以及时地更新, 从而与发 射端真实的时钟信息基本一致。 接收端在后续接收到第一发射端的可见光时, 可以用 根据本地所存储的第一发射端的时钟信息来选择对应的伪码信号对接收到的可见光信 号进行解码。由此选择的伪码序列必然与第一发射端处用于加密的伪码序列是对应的, 从而保证了正确地解密。 图 d5是示出了根据本发明的一方面的通信装置 500d的框图。接收器 502d可接收 来自至少一个发射设备中的第一发射设备的可见光信号。 时钟变化参数确定模块 504d 可根据接收自第一发射设备的可见光信号确定第一发射设备的时钟变化参数和通信装 置 500d自身的时钟变化参数。如前文所述的, 时钟变化参数可以是对应于系统时间的 单位时间实际经历的标准时间。 在该单位时间为来自第一发射设备的可见光信号的一 个光脉冲的标称持续时间的情况下, 对应于第一发射设备的系统时间的单位时间实际 经历的标准时间由时钟变化参数确定模块 504d在该通信装置 500d处测量接收自第一 发射设备的可见光信号的一个光脉冲的持续时间得到并以通信装置 500d 的晶振的系 统周期为单位记为 M · T2系统,以及对应于该通信装置 500d的系统时间的该单位时间 实际经历的标准时间由时钟变化参数确定模块 504d计算为 · 2» ) · , 其中 为该可见光信号的一个光脉冲的标称持续时间, 为该通信装置 500d的晶振 的标称频率,以及 为该通信装置 500d的晶振的系统周期。时钟快慢因子模块 506d 可根据第一发射设备的时钟变化参数和通信装置 500d 自身的时钟变化参数确定第一 发射设备的时钟快慢因子。 根据本发明的一方面, 时钟快慢因子确定模块将第一发射 设备的时钟快慢因子确定为对应于该通信装置 500d 的系统时间的该单位时间实际经 历的标准时间与对应于第一发射设备的系统时间的该单位时间实际经历的标准时间之 比。时钟信息调制模块 508d根据第一发射设备的时钟快慢因子每隔预定时间更新通信 装置 500d本地存储的第一发射设备的时钟信息。根据本发明的一方面, 该预定时间是 通信装置 500d的系统时间的预定时间, 每隔该预定时间, 通信装置 500d本地存储的 第一发射设备的时钟信息的误差为该预定时间减去第一发射设备的时钟快慢因子与该 预定时间的乘积, 由此, 时钟信息调整模块 508d用本地存储的第一发射设备的时钟信 息减去该误差以进行更新。 在后续每一次接收到来自第一发射设备的可见光信号时, 解码器 510d可根据所存储的第一发射设备的时钟信息来选择对应的伪码信号对接收 到的可见光信号进行解码。 通信装置 500d还可包括存储器 514d。存储器 514d可存储时钟信息 516d,例如第 一发射设备的时钟信息。 通信装置 500d还包括处理器 512d。 该处理器 512d可以是专 用于分析接收器 502d收到的信息的处理器、 控制通信装置 500d的一个或多个组件的 处理器、和 /或既分析接收器 502d收到的信息又控制通信装置 500d的一个或多个组件 的处理器。 图 d6是示出了根据本发明的一方面的通信装置 600d的框图。 应当领会到, 通信 装置 600d被表示为包括功能块, 这些功能块可以表示由处理器、 软件或其组合(例如 固件) 实现的功能块。 通信装置 600d包括可协作的电子组件的逻辑分组 602d。 例如, 逻辑分组 602d可包括用于接收来自至少一个发射设备中的第一发射设备的可见光信 号的电子组件 604d。 逻辑分组 602d可包括用于根据接收自该第一发射设备的该可见 光信号确定该第一发射设备的时钟变化参数和接收设备的时钟变化参数的电子组件 606d。逻辑分组 602d还可包括用于根据该第一发射设备的该时钟变化参数和该接收设 备的该时钟变化参数确定该第一发射设备的时钟快慢因子的电组件 608d。 此外, 逻辑 分组 602d还可包括用于根据该第一发射设备的该时钟快慢因子每隔预定时间更新接 收设备本地存储的该第一发射设备的时钟信息的电子组件 610d。另外,通信装置 600d 可包括保存用于执行与电子组件 604d、 606d、 608d、 和 610d相关联的功能的指令的 存储器 612d。 尽管示为处于存储器 612的外部, 但是应当理解电子组件 604d、 606d、 608d、 和 610d中的一个或多个可存在于存储器 612d内。 本领域技术人员将可理解, 信息和信号可使用各种不同技术和技艺中的任何技术 和技艺来表示。 例如, 以上描述通篇引述的数据、 指令、 命令、 信息、 信号、 位 (比 特)、 码元、 和码片可由电压、 电流、 电磁波、 磁场或磁粒子、 光场或光学粒子、 或其 任何组合来表示。 本领域技术人员将进一步领会, 结合本文中所公开的实施例来描述的各种解说性 逻辑板块、 模块、 电路、 和算法步骤可实现为电子硬件、 计算机软件、 或这两者的组 合。 为清楚地解说硬件与软件的这一可互换性, 各种解说性组件、 框、 模块、 电路、 和步骤在上面是以其功能性的形式作一般化描述的。 此类功能性是被实现为硬件还是 软件取决于具体应用和施加于整体系统的设计约束。 技术人员对于每种特定应用可用 不同的方式来实现所描述的功能性, 但这样的实现决策不应被解读成导致脱离了本发 明的范围。 结合本文所公开的实施例描述的各种解说性逻辑板块、 模块、 和电路可用通用处 理器、 数字信号处理器(DSP)、 专用集成电路(ASIC)、 现场可编程门阵列 (FPGA) 或 其它可编程逻辑器件、 分立的门或晶体管逻辑、 分立的硬件组件、 或其设计成执行本 文所描述功能的任何组合来实现或执行。 通用处理器可以是微处理器, 但在替换方案 中, 该处理器可以是任何常规的处理器、 控制器、 微控制器、 或状态机。 处理器还可 以被实现为计算设备的组合, 例如 DSP与微处理器的组合、 多个微处理器、 与 DSP核 心协作的一个或多个微处理器、 或任何其他此类配置。 结合本文中公开的实施例描述的方法或算法的步骤可直接在硬件中、 在由处理器 执行的软件模块中、或在这两者的组合中体现。 软件模块可驻留在 RAM存储器、 闪存、 ROM存储器、 EPR0M存储器、 EEPR0M存储器、 寄存器、 硬盘、 可移动盘、 CD_R0M、 或 本领域中所知的任何其他形式的存储介质中。 示例性存储介质耦合到处理器以使得该 处理器能从 /向该存储介质读取和写入信息。在替换方案中,存储介质可以被整合到处 理器。 处理器和存储介质可驻留在 ASIC中。 ASIC可驻留在用户终端中。 在替换方案 中, 处理器和存储介质可作为分立组件驻留在用户终端中。 在一个或多个示例性实施例中, 所描述的功能可在硬件、 软件、 固件或其任何组 合中实现。 如果在软件中实现为计算机程序产品, 则各功能可以作为一条或更多条指 令或代码存储在计算机可读介质上或藉其进行传送。 计算机可读介质包括计算机存储 介质和通信介质两者, 其包括促成计算机程序从一地向另一地转移的任何介质。 存储 介质可以是能被计算机访问的任何可用介质。 作为示例而非限定, 这样的计算机可读 介质可包括 RAM、醒、 EEPR0M、 CD-ROM或其它光盘存储、磁盘存储或其它磁存储设备、 或能被用来携带或存储指令或数据结构形式的合意程序代码且能被计算机访问的任何 其它介质。 任何连接也被正当地称为计算机可读介质。 例如, 如果软件是使用同轴电 缆、 光纤电缆、 双绞线、 数字订户线 (DSL)、 或诸如红外、 无线电、 以及微波之类的 无线技术从 web网站、 服务器、 或其它远程源传送而来, 则该同轴电缆、 光纤电缆、 双绞线、 DSL、 或诸如红外、 无线电、 以及微波之类的无线技术就被包括在介质的定义 之中。 如本文中所使用的盘 (disk) 和碟 (disc) 包括压缩碟 (CD)、 激光碟、 光碟、 数字多用碟 (DVD)、 软盘和蓝光碟, 其中盘 (disk) 往往以磁的方式再现数据, 而碟 ( disc) 用激光以光学方式再现数据。 上述的组合也应被包括在计算机可读介质的范 围内。 以上所述仅为本发明的优选实施例而已, 并不用于限制本发明, 对于本领域的技 术人员来说, 本发明可以有各种更改和变化。 凡在本发明的精神和原则之内, 所作的 任何修改、 等同替换、 改进等, 均应包含在本发明的保护范围之内。

Claims

权 利 要 求 书
1、 一种可见光信号的解密方法, 包括: 接收来自发射端的可见光信号,其中,所述可见光信号在所述发射端被密钥加密; 获取所述密钥, 并根据所述密钥对所述可见光信号进行解密, 其中, 获取所述密 钥包括: 获取与接收端状态机的状态对应的所述密钥; 或者, 根据所述可见光信号获 取的用于获得所述密钥的指示信息并根据所述指示信息获取所述密钥。
2、根据权利要求 1所述的方法, 其中, 根据所述可见光信号获取的用于获得所述 密钥的指示信息, 并根据所述指示信息获取所述密钥包括: 将接收的所述可见光信号转换为数字信号; 将所述数字信号分解为包括伪码序列指示码和伪码信号的信号; 查询所述伪码序列指示码对应的伪码序列, 其中, 所述伪码序列为所述密钥; 根据所述伪码序列对所述伪码信号进行解密。
3、根据权利要求 2所述的方法, 其中, 将所述数字信号分解为包括伪码序列指示 码和伪码信号的信号, 查询所述伪码序列指示码对应的伪码序列包括: 将所述数字信号分解为设备寻址码和第一合并信号; 将所述第一合并信号分解为所述伪码序列指示码和所述伪码信号; 根据所述设备寻址码对所述伪码序列指示码的合法性进行判决, 若合法, 则查询 所述伪码序列指示码对应的伪码序列。
4、根据权利要求 2所述的方法, 其中, 查询所述伪码序列指示码对应的伪码序列 包括: 根据接收到的伪码序列指示码判断是否合法, 合法则查询所述伪码序列指示码对 应的伪码序列, 不合法则提示密码错误。
5、 根据权利要求 4所述的方法, 其中, 所述方法还包括: 根据所述设备寻址码查询该设备对应 ID信息,将该 ID信息与译码获得的 ID信息 进行对比, 若相同, 判定合法, 则输出合法的 ID信息。
6、 根据权利要求 5所述的方法, 其中, 所述方法还包括: 根据合法的 ID信息控制对应的设备。
7、根据权利要求 4所述的方法, 其中, 所述将接收的可见光信号转换为数字信号 之后, 还包括: 对所述数字信号进行解调。
8、根据权利要求 4所述的方法, 其中, 所述根据所述设备寻址码对所述伪码序列 指示码的合法性进行判决包括: 当所述伪码序列指示码是从小到大不循环的大数时, 根据所述设备寻址码查询已 接收到的伪码序列指示码, 若所述伪码序列指示码小于或者等于已接收到的伪码序列 指示码, 则判定无效, 否则判定合法; 或者, 当所述伪码序列指示码是从大到小不循环的大数时, 根据所述设备寻址码查询已 接收到的伪码序列指示码, 若所述伪码序列指示码大于或者等于已接收到的伪码序列 指示码, 则判定无效, 否则判定合法。
9、根据权利要求 2至 8中任一项所述的方法, 其中, 根据所述伪码序列对所述伪 码信号进行解密包括: 将所述伪码序列与所述伪码信号进行逻辑运算, 以对所述伪码信号进行解密。
10、 根据权利要求 1所述的方法, 其中, 根据所述可见光信号获取的用于获得所 述密钥的指示信息包括- 根据所述可见光信号确定所述发射端的时钟变化参数和所述接收端的时钟变化参 数; 根据所述发射端的时钟变化参数和所述接收端的时钟变化参数确定所述发射端的 时钟快慢因子; 根据所述发射端的所述时钟快慢因子每隔预定时间更新所述接收端本地存储的所 述发射端的时钟信息, 其中, 所述时钟信息为用于获得所述密钥的指示信息。
11、根据权利要求 10所述的方法, 其中, 所述发射端的时钟变化参数是指对应于 所述发射端的系统时间的单位时间实际经历的标准时间, 以及所述接收端的时钟变化 参数是指对应于所述接收端的系统时间的所述单位时间实际经历的标准时间, 其中所 述实际经历的标准时间都是以所述接收端的晶振的系统周期为单位来计量的。
12、根据权利要求 11所述的方法, 其中, 所述发射端的时钟快慢因子为对应于所 述接收端的系统时间的所述单位时间实际经历的标准时间与对应于发射端的系统时间 的所述单位时间实际经历的标准时间之比。
13、根据权利要求 12所述的方法, 其中, 所述预定时间是所述接收端的系统时间 的预定时间, 每隔所述预定时间, 所述接收端本地存储的所述发射端的所述时钟信息 的误差为所述预定时间减去所述发射端的时钟快慢因子与所述预定时间的乘积, 其中 更新所述接收端本地存储的所述发射端的所述时钟信息包括用本地存储的所述发射端 的所述时钟信息减去所述误差。
14、根据权利要求 13所述的方法, 其中, 所述单位时间为接收自所述发射端的所 述可见光信号的一个光脉冲的标称持续时间, 所述标称持续时间等于所述可见光信号 的标称波特率的倒数。
15、根据权利要求 14所述的方法, 其中, 对应于所述发射端的系统时间的所述单 位时间实际经历的标准时间是在所述接收端处测量接收自所述发射端的所述可见光信 号的一个光脉冲的持续时间得到的并以所述接收端的晶振的系统周期为单位记为 Μ · Τ2 系统, 以及对应于所述接收端的系统时间的所述单位时间实际经历的标准时间 被计算为 ί7# /2«») # 7^ , 其中 Γ。标称为所述可见光信号的一个光脉冲的标称持续 时间, /2«为所述接收端的晶振的标称频率, 以及 ^ 为所述接收端的晶振的系统周 期。
16、根据权利要求 15所述的方法, 其中, 在所述接收端处测量接收自所述发射端 的所述可见光信号的一个光脉冲的持续时间包括: 将接收自所述发射端的所述可见光信号转换成数字信号; 以及 从所述数字信号的一个脉冲的高电平或低电平开始直至所述高电平或低电平结束 对经历了多少个7 进行计数, 得到的数目即为¾1。
17、根据权利要求 16所述的方法, 其中, 所述将接收自所述发射端的所述可见光 信号转换成数字信号包括: 通过光电二极管将所述可见光信号转换成电脉冲信号, 当所述光电二极管通过的电流值高于门限值时输出高电压电平, 以及 当所述光电二极管通过的电流值低于所述门限值时输出低电压电平。
18、根据权利要求 17所述的方法, 其中, 所述门限值是根据预定数学模型至少由 所述接收端与所述发射端之间的距离来决定的。
19、 根据权利要求 10所述的方法, 其中, 还包括: 在后续每一次接收到来自所述发射端的可见光信号时, 重复所述确定所述发射端 的时钟变化参数和所述接收端的时钟变化参数至更新所存储的所述发射端的所述时钟 信息的步骤。
20、根据如权利要求 19所述的方法, 其中, 在后续每一次接收到来自所述发射端 的可见光信号时, 根据所存储的所述发射端的所述时钟信息来选择对应的伪码信号对 接收到的可见光信号进行解码。
21、根据权利要求 10所述的方法, 其中, 所述接收端本地存储的所述发射端的时 钟信息最初是在所述接收端首次接收到所述发射端的可见光信号时与所述发射端的标 识符相关联的存储的并且被设为等于所述接收端当时的时钟信息。
22、 根据权利要求 1所述的方法, 其中, 获取与接收端状态机的状态对应的所述 密钥并根据所述密钥对所述可见光信号进行解密包括: 获取并用与所述接收端的状态机的当前状态以及在所述当前状态之前和 /或之后 的至少一个状态对应的密钥对所述可见光信号进行解密, 其中, 所述可见光信号用随 所述发射端的状态机的状态变化的密钥被加密。
23、根据权利要求 22所述的方法, 其中, 用与所述接收端的状态机的所述当前状 态以及在所述当前状态之前和 /或之后的所述至少一个状态对应的密钥对所述可见光 信号进行解密包括- 用与所述接收端的状态机的所述当前状态对应的密钥对所述可见光信号进行解 密; 以及 若用与所述接收端的状态机的所述当前状态对应的密钥对所述可见光信号的解密 未成功,则继续用与在所述当前状态之前和 /或之后的所述至少一个状态对应的密钥对 所述可见光信号进行解密。
24、 根据权利要求 23所述的方法, 其中, 用与在所述当前状态之前和 /或之后的 所述至少一个状态对应的密钥对所述可见光信号进行解密: 按预定次序用与在所述当前状态之前和 /或之后的所述至少一个状态中的每个状 态对应的密钥对所述可见光信号进行解密, 直至所述可见光信号被成功解密或已使用 与在所述当前状态之前和 /或之后的所述至少一个状态中的所有状态对应的密钥对所 述可见光信号进行了解密为止。
25、根据权利要求 24所述的方法, 其中, 所述可见光信号包括通信数据以及所述 发射端的标识符。
26、根据权利要求 25所述的方法, 其中, 所述通信数据用随所述发射端的状态机 的状态变化的所述密钥被加密, 而所述发射端的所述标识符未被加密, 并且所述接收 端本地存储有与所述发射端的所述标识符相关联的通信数据。
27、 根据权利要求 25或 26所述的方法, 其中, 还包括: 从所述可见光信号获得所述发射端的所述标识符; 其中如果用与所述接收端的状态机的所述当前状态以及在所述当前状态之前和 / 或之后的所述至少一个状态中的一个状态对应的密钥对所述可见光信号解密得到的通 信数据与所述接收端本地存储的与所述发射端的所述标识符相关联的通信数据相同, 则用与所述一个状态对应的密钥对所述可见光信号的解密成功, 否则解密未成功。
28、 根据权利要求 27所述的方法, 其中, 所述通信数据包括用户信息, 所述用户 信息包括 ID信息、 指纹、 面部、 虹膜、 输入的密码、 或者以上两者或更多者的组合, 所述方法还包括: 如果用与所述接收端的状态机的所述当前状态以及在所述当前状态之前和 /或之 后的所述至少一个状态对应的密钥对所述可见光信号的解密皆未成功, 则将所述可见 光信号标识为非法信号, 否则将所述可见光信号标识为合法信号。
29、根据权利要求 22所述的方法, 其中, 用与所述接收端的状态机的所述当前状 态以及在所述当前状态之前和 /或之后的所述至少一个状态对应的密钥对所述可见光 信号进行解密包括- 按预定次序用与所述当前状态以及在所述当前状态之前和 /或之后的所述至少一 个状态中的每个状态对应的密钥对所述可见光信号进行解密, 直至所述可见光信号被 解密成功或已使用与所述当前状态以及在所述当前状态之前和 /或之后的所述至少一 个状态中的所有状态对应的密钥对所述可见光信号进行了解密。
30、根据权利要求 22所述的方法, 其中, 所述至少一个状态包括在所述当前状态 之前的预定数目个状态和在所述当前状态之后的所述预定数目个状态。
31、根据权利要求 22所述的方法, 其中, 随所述发射端的状态机的状态变化的密 钥以及与所述接收端的状态机的所述当前状态以及在所述当前状态之前和 /或之后的 所述至少一个状态对应的密钥是随时间变化的序列。
32、 根据权利要求 22所述的方法, 其中, 所述随时间变化的序列为伪码序列, 所 述方法还包括将所述可见光信号转换成数字信号, 其中所述解密包括所述数字信号与 伪码序列的逻辑与、 逻辑或、 逻辑异或、 或者以上两者或更多者的组合。
33、 一种通信装置, 包括: 接收器, 用于接收来自发射端的可见光信号, 其中, 所述可见光信号在所述发射 端被密钥加密; 解码器, 用于获取所述密钥, 并根据所述密钥对所述可见光信号进行解密, 其中, 获取所述密钥包括: 获取与接收端状态机的状态对应的所述密钥; 或者, 根据所述可 见光信号获取的用于获得所述密钥的指示信息并根据所述指示信息获取所述密钥。
34、 根据权利要求 33所述的装置, 其中, 所述接收器为用于接收可见光信号, 并输出数字信号的可见光接收器; 所述解码器包括: 用于将所述数字信号分解为包括伪码序列指示码和伪码信号的 伪码序列指示码分解单元; 用于查询伪码序列指示码对应的伪码序列的伪码序列查询 单元, 其中, 所述伪码序列为所述密钥; 用于将所述伪码序列与所述伪码信号进行逻 辑运算, 输出逻辑运算结果的卷积译码器。
35、 根据权利要求 34所述的装置, 其中, 所述解码器还包括: 用于将所述数字信号分解为设备寻址码和第一合并信号的设 备寻址码分解单元; 所述伪码序列指示码分解单元, 用于将所述第一合并信号分解为伪码序列指示码 和伪码信号; 所述伪码序列查询单元, 用于根据所述设备寻址码对所述伪码序列指示码的合法 性进行判决, 若合法, 查询伪码序列指示码对应的伪码序列。
36、 根据权利要求 34所述的装置, 其中, 所述伪码序列查询单元, 用于根据接收到的伪码序列指示码判断是否合法, 合法 则查询所述伪码序列指示码对应的伪码序列, 不合法则提示密码错误。
37、 根据权利要求 35所述的装置, 其中, 所述装置还包括: 用于根据所述设备寻址码查询对应 ID信息的查询单元;以及用于对所述卷积译码 器输出的 ID信息与所述查询单元输出的 ID信息进行对比, 若相同判定合法, 输出合 法 ID信息的 ID判决器。
38、 根据权利要求 37所述的装置, 其中, 所述装置还包括: 与所述 ID判决器连接的设备控制电路,用于根据接收的 ID信息控制对应的设备。
39、 根据权利要求 35所述的装置, 其中, 所述装置还包括: 连接于所述可见光接收器与所述设备寻址码分解单元之间、 用于对所述数字信号 进行解调的解调器。
40、 根据权利要求 33所述的装置, 其中, 所述接收器, 其接收来自发射设备的可见光信号, 所述可见光信号在所述发射设 备至少部分地用随所述发射设备的状态机的状态变化的密钥被加密; 以及 所述解码器,用与所述通信装置的状态机的当前状态以及在所述当前状态之前和 / 或之后的至少一个状态对应的密钥对所述可见光信号进行解密。
41、根据权利要求 40所述的装置, 其中, 所述解码器用与所述通信装置的状态机 的所述当前状态对应的密钥对所述可见光信号进行解密, 并且若用与所述通信装置的 状态机的所述当前状态对应的密钥对所述可见光信号的解密未成功, 则继续用与在所 述当前状态之前和 /或之后的所述至少一个状态对应的密钥对所述可见光信号进行解 密。
42、根据权利要求 41所述的装置, 其中, 所述解码器按预定次序用与在所述当前 状态之前和 /或之后的所述至少一个状态中的每个状态对应的密钥对所述可见光信号 进行解密,直至所述可见光信号被成功解密或已使用与在所述当前状态之前和 /或之后 的所述至少一个状态中的所有状态对应的密钥对所述可见光信号进行了解密为止。
43、根据权利要求 40所述的装置, 其中, 所述解码器按预定次序用与所述当前状 态以及在所述当前状态之前和 /或之后的所述至少一个状态中的每个状态对应的密钥 对所述可见光信号进行解密, 直至所述可见光信号被解密成功或已使用与所述当前状 态以及在所述当前状态之前和 /或之后的所述至少一个状态中的所有状态对应的密钥 对所述可见光信号进行了解密。
44、 根据权利要求 33所述的装置, 其中, 所述接收器, 用于接收来自发射端的可见光信号; 所述解码器包括: 时钟变化参数确定模块, 其根据接收自所述发射端的所述可见 光信号确定所述发射端的时钟变化参数和所述通信装置的时钟变化参数; 时钟快慢因 子确定模块, 根据所述发射端的所述时钟变化参数和所述通信装置的所述时钟变化参 数确定所述发射端的时钟快慢因子; 以及时钟信息调整模块, 其根据所述发射端的所 述时钟快慢因子每隔预定时间更新所述通信装置本地存储的所述发射端的时钟信息。
45、根据权利要求 44所述的装置, 其中, 所述发射端的时钟变化参数是指对应于 所述发射端的系统时间的单位时间实际经历的标准时间, 以及所述通信装置的时钟变 化参数是指对应于所述通信装置的系统时间的所述单位时间实际经历的标准时间, 其 中所述实际经历的标准时间都是以所述通信装置的晶振的系统周期为单位来计量的。
46、根据权利要求 45所述的装置, 其中, 所述时钟快慢因子确定模块将所述发射 端的时钟快慢因子确定为对应于所述通信装置的系统时间的所述单位时间实际经历的 标准时间与对应于发射端的系统时间的所述单位时间实际经历的标准时间之比。
47、根据权利要求 46所述的通信装置, 其中, 所述预定时间是所述通信装置的系 统时间的预定时间, 每隔所述预定时间, 所述通信装置本地存储的所述发射端的所述 时钟信息的误差为所述预定时间减去所述发射端的时钟快慢因子与所述预定时间的乘 积, 所述时钟信息调整模块用本地存储的所述发射端的所述时钟信息减去所述误差。
48、根据权利要求 47所述的装置, 其中, 所述单位时间为接收自所述发射端的所 述可见光信号的一个光脉冲的标称持续时间, 所述标称持续时间等于所述可见光信号 的标称波特率的倒数。
49、根据权利要求 48所述的装置, 其中, 对应于所述发射端的系统时间的所述单 位时间实际经历的标准时间由所述时钟变化参数模块在所述通信装置处测量接收自所 述发射端的所述可见光信号的一个光脉冲的持续时间得到并以所述通信装置的晶振的 系统周期为单位记为 M · T2系统, 以及对应于所述通信装置的系统时间的所述单位时 间实际经历的标准时间由所述时钟变化参数计算为 ' /2«) ' ¾¾, 其中 为 所述可见光信号的一个光脉冲的标称持续时间, /2«»为所述通信装置的晶振的标称频 率, 以及 为所述通信装置的晶振的系统周期。
50、 根据权利要求 44所述的装置, 其中, 解码器, 还用于其在后续每一次接收到来自所述发射端的可见光信号时, 根据所 存储的所述发射端的所述时钟信息来选择对应的伪码信号对接收到的可见光信号进行 解码。
51、 一种可见光信号的加密方法, 包括: 对数据使用密钥进行加密; 将所述加密数据作为可见光信号发射, 其中, 所述密钥随发射端的状态机的状态 变化而变化, 或者, 所述可见光信号携带有用于获得所述密钥的指示信息。
52、根据权利要求 51所述的方法, 其中, 在所述可见光信号携带有所述指示信息 的情况下, 将所述数据使用所述密钥进行加密, 将所述加密数据作为所述可见光信号 发射包括: 将生成的伪码序列与所述数据进行编码, 获得伪码信号, 其中, 所述伪码序列为 所述密钥; 将所述伪码序列对应的伪码序列指示码合并至所述伪码信号首部, 获得包括所述 伪码序列指示码和所述伪码信号的合并信号; 以可见光的形式发送所述合并信号。
53、根据权利要求 52所述的方法, 其中, 获得包括所述伪码序列指示码和所述伪 码信号的合并信号, 以可见光的形式发送所述合并信号包括- 将所述伪码序列对应的伪码序列指示码合并至所述伪码信号首部, 获得第一合并 信号; 在所述第一合并信号首部合并设备寻址码, 获得第二合并信号: 以可见光形式发送所述第二合并信号。
54、根据权利要求 53所述的方法, 其中, 所述以可见光信号的形式发送所述第 合并信号之前, 还包括- 对所述第二合并信号进行调制。
55、根据权利要求 53所述的方法, 其中, 所述伪码序列指示码是从小到大或从大 到小不循环的大数, 随发射信号的次数变化。
56、 一种通信装置, 包括: 加密装置, 用于对数据使用密钥进行加密; 发射单元, 用于将所述加密数据作为可见光信号发射, 其中, 所述密钥随发射端 的状态机的状态变化而变化, 或者, 所述可见光信号携带有用于获得所述密钥的指示 信息。
57、 根据权利要求 56所述的装置, 其中, 所述加密装置包括: 用于输出伪码序列和对应伪码序列指示码的伪码发生器; 用 于对所述伪码序列与所述数据进行逻辑运算, 输出伪码信号的卷积编码器; 用于将所 述伪码序列指示码合并至所述伪码信号首部, 输出包括所述伪码序列指示码和所述伪 码信号的合并信号的伪码序列指示码合并单元; 其中, 所述伪码序列为所述密钥, 所 述伪码序列指示码为所述指示信息; 所述发射单元, 用于以可见光信号的形式发送所述合并信号。
58、 根据权利要求 57所述的装置, 其中, 所述伪码序列指示码合并单元还用于将所述伪码序列指示码合并至所述伪码信号 首部, 输出第一合并信号; 所述加密装置还包括; 用于在所述第一合并信号首部合并设备寻址码, 输出第二 合并信号的设备寻址码合并单元;
所述发射单元, 用于以可见光信号的形式发送所述第二合并信号。
59、根据权利要求 58所述的装置, 其中, 所述发射装置还包括连接于所述设备寻 址码处理单元与所述发射单元之间、 用于对所述第二合并信号进行调制的调制器。
60、 根据权利要求 56所述的装置, 其中, 所述发射单元是 LED灯。
61、根据权利要求 56所述的装置, 其中, 所述伪码序列指示码是从小到大或从大 到小不循环的大数, 随发射信号的次数变化。
62、 一种通信系统, 包括: 权利要求 56至 61中任一项所述的通信装置以及权利 要求 33至 50中任一项所述的通信装置。
PCT/CN2013/080579 2012-07-31 2013-07-31 可见光的加密方法、解密方法、通信装置及通信系统 WO2014019526A1 (zh)

Priority Applications (4)

Application Number Priority Date Filing Date Title
JP2015524622A JP6082461B2 (ja) 2012-07-31 2013-07-31 可視光の暗号化方法、復号化方法、通信装置及び通信システム
EP13825464.4A EP2882117B1 (en) 2012-07-31 2013-07-31 Visible light encryption method, decryption method, communication device and communication system
KR1020157003312A KR101670194B1 (ko) 2012-07-31 2013-07-31 가시 광선의 암호 설정방법, 암호 해지방법, 통신장치 및 통신 시스템
US14/608,793 US10250384B2 (en) 2012-07-31 2015-01-29 Visible light encryption method, decryption method, communication device and communication system

Applications Claiming Priority (8)

Application Number Priority Date Filing Date Title
CN201210268555.5A CN102820922B (zh) 2012-07-31 2012-07-31 一种异步加密可见光通信方法及系统
CN201210268555.5 2012-07-31
CN201210277987.2A CN102833065B (zh) 2012-08-07 2012-08-07 基于多用户异步加密的发射装置及方法、接收装置及方法
CN201210277987.2 2012-08-07
CN201310314157.7A CN103840891B (zh) 2013-07-24 2013-07-24 可见光通信系统中的宽松解密方法和装置
CN201310314157.7 2013-07-24
CN201310323062.1A CN104348607B (zh) 2013-07-29 2013-07-29 用于可见光通信系统中时钟自动调整的方法和装置
CN201310323062.1 2013-07-29

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US14/608,793 Continuation US10250384B2 (en) 2012-07-31 2015-01-29 Visible light encryption method, decryption method, communication device and communication system

Publications (1)

Publication Number Publication Date
WO2014019526A1 true WO2014019526A1 (zh) 2014-02-06

Family

ID=50027275

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/080579 WO2014019526A1 (zh) 2012-07-31 2013-07-31 可见光的加密方法、解密方法、通信装置及通信系统

Country Status (5)

Country Link
US (1) US10250384B2 (zh)
EP (1) EP2882117B1 (zh)
JP (1) JP6082461B2 (zh)
KR (1) KR101670194B1 (zh)
WO (1) WO2014019526A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20170056562A (ko) * 2014-09-05 2017-05-23 쿠앙치 인텔리전트 포토닉 테크놀로지 리미티드 지불 시스템
CN113810121A (zh) * 2021-09-02 2021-12-17 中国科学院国家授时中心 一种基于加密通信的光纤时间同步方法及系统

Families Citing this family (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101738792B1 (ko) * 2012-08-13 2017-05-22 쿠앙-치 이노베이티브 테크놀로지 리미티드 광신호 처리장치 및 광신호 수신 모니터링장치 디코딩 방법
WO2015112702A1 (en) * 2014-01-22 2015-07-30 Hamilton Christopher Chad Portable social communication client
US9735868B2 (en) * 2014-07-23 2017-08-15 Qualcomm Incorporated Derivation of an identifier encoded in a visible light communication signal
KR20160041147A (ko) * 2014-10-06 2016-04-18 삼성전자주식회사 제어 방법 및 그 방법을 처리하는 전자장치
EP3257172A4 (en) * 2015-02-10 2018-10-10 Darabi, Amir System and method for providing optically coded information
CN104980217B (zh) * 2015-06-19 2017-12-19 邹骁 一种可见光通信系统、方法及相关设备
US10084758B2 (en) 2015-10-28 2018-09-25 International Business Machines Corporation System, method, and recording medium for communication and message comparison with encrypted light signals
DE102015222450A1 (de) * 2015-11-13 2017-05-18 Osram Gmbh Beleuchtungseinrichtung und Verfahren zur Bereitstellung einer Datenübertragung an ein mobiles Endgerät
JP6985379B2 (ja) * 2016-09-27 2021-12-22 レイセオン カンパニー 波面補正なく自由空間光信号を復調するためのシステムおよび方法
US9876770B1 (en) * 2016-10-28 2018-01-23 International Business Machines Corporation Group permission based Li-Fi file transfer
JP6986079B2 (ja) * 2016-11-29 2021-12-22 シグニファイ ホールディング ビー ヴィSignify Holding B.V. 可視光通信の検出及び/又は復号
CN110832893B (zh) * 2017-07-11 2023-12-01 昕诺飞控股有限公司 用于向用户设备提供对资源或数据的访问的系统及其方法
JP7110386B2 (ja) 2018-04-12 2022-08-01 レイセオン カンパニー 光信号における位相変化検出
CN108566247B (zh) * 2018-04-27 2020-12-04 杭州绿岛智能电子有限公司 一种车载互联互通的交互方法、可读存储介质和车载终端
US10727937B1 (en) * 2019-03-01 2020-07-28 Huawei Technologies Co., Ltd. Multi-layer encoding of optical signals
US20220311606A1 (en) * 2020-06-10 2022-09-29 Beijing Boe Technology Development Co., Ltd. Optical communication apparatus, optical communication system and method
CN117240361B (zh) * 2023-11-13 2024-03-15 新唐信通(浙江)科技有限公司 一种定向加密的电视屏幕和智能手机间可见光通信方法

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1947373A (zh) * 2004-03-05 2007-04-11 韩国电子通信研究院 在无线便携因特网系统中管理通讯加密密钥的方法及其协议配置方法、以及在用户台中的通讯加密密钥状态机的操作方法
CN101645771A (zh) * 2008-08-04 2010-02-10 深圳华为通信技术有限公司 密钥同步的方法、装置和系统
CN102035642A (zh) * 2010-12-20 2011-04-27 西安西电捷通无线网络通信股份有限公司 一种分组密码计数器运行模式中计数器的选择和同步方法
CN102289634A (zh) * 2011-08-31 2011-12-21 北京航空航天大学 基于可见光通信的限定区域权限认证装置及文件保密方法
CN102378168A (zh) * 2010-08-17 2012-03-14 中兴通讯股份有限公司 多系统核心网通知密钥的方法和多系统网络
CN102820922A (zh) * 2012-07-31 2012-12-12 深圳光启创新技术有限公司 一种异步加密可见光通信方法及系统
CN102833065A (zh) * 2012-08-07 2012-12-19 深圳光启创新技术有限公司 基于多用户异步加密的发射装置及方法、接收装置及方法

Family Cites Families (26)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4811394A (en) * 1982-07-28 1989-03-07 Communications Satellite Corporation Variable starting state scrambling circuit
US4757536A (en) * 1984-10-17 1988-07-12 General Electric Company Method and apparatus for transceiving cryptographically encoded digital data
JPH01113440U (zh) * 1988-01-22 1989-07-31
JP2595899B2 (ja) * 1994-05-17 1997-04-02 日本電気株式会社 オンライン伝文暗号化装置
US5809148A (en) 1996-05-17 1998-09-15 Motorola, Inc. Decryption of retransmitted data in an encrypted communication system
US7155016B1 (en) * 1999-08-20 2006-12-26 Paradyne Corporation Communication device and method for using non-self-synchronizing scrambling in a communication system
JP2001285276A (ja) * 2000-04-03 2001-10-12 Yazaki Corp ストリーム暗号化方法、復号方法、及び暗号通信システム
US20030149869A1 (en) 2002-02-01 2003-08-07 Paul Gleichauf Method and system for securely storing and trasmitting data by applying a one-time pad
CN100440775C (zh) 2002-10-31 2008-12-03 华为技术有限公司 一种加密通讯方法和装置
JP2005151056A (ja) * 2003-11-13 2005-06-09 Oki Electric Ind Co Ltd デスクランブル回路
JP2007110276A (ja) * 2005-10-12 2007-04-26 Sony Corp 通信システム、通信装置および方法、並びにプログラム
US20080044012A1 (en) 2006-08-15 2008-02-21 Nokia Corporation Reducing Security Protocol Overhead In Low Data Rate Applications Over A Wireless Link
CN101001142A (zh) 2007-01-17 2007-07-18 张建华 一种基于迭代随机数产生器的加解密方法
JP4084832B1 (ja) * 2007-06-26 2008-04-30 松下電器産業株式会社 受信装置、送信装置、乱数シード値取得方法及び無線通信システム
US8718485B2 (en) * 2007-07-13 2014-05-06 Nec Corporation Quantum key distribution system, optical transmitter, optical modulation control circuit, and optical modulation control method
KR101524873B1 (ko) * 2009-02-17 2015-06-02 삼성전자주식회사 가시광 통신 방법 및 시스템
JP2011044051A (ja) * 2009-08-24 2011-03-03 Konica Minolta Business Technologies Inc 情報提供方法及び情報提供システム
KR101654934B1 (ko) * 2009-10-31 2016-09-23 삼성전자주식회사 가시광 통신 방법 및 장치
US8683555B2 (en) * 2010-02-10 2014-03-25 Raytheon Company Systems and methods to prevent denial of service attacks
CN101938310A (zh) 2010-07-21 2011-01-05 中国科学院半导体研究所 一种可见光通信控制系统及其实现方法
JP5450303B2 (ja) * 2010-07-27 2014-03-26 パナソニック株式会社 電気錠システム
CN102542640A (zh) * 2011-11-16 2012-07-04 深圳光启高等理工研究院 门禁方法及系统、led门匙和led光控密码锁
CN102479398A (zh) 2011-11-16 2012-05-30 深圳光启高等理工研究院 一种门锁控制方法及门锁
CN102610013A (zh) 2012-02-29 2012-07-25 深圳光启创新技术有限公司 可见光通信方法和基于可见光通信的数据存储系统
CN102780695B (zh) 2012-06-20 2014-12-24 深圳光启创新技术有限公司 基于可见光通信的握手同步方法和系统
CN102932142B (zh) 2012-10-08 2015-10-21 中国科学院西安光学精密机械研究所 光纤通信系统中光数据信号加解密方法

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1947373A (zh) * 2004-03-05 2007-04-11 韩国电子通信研究院 在无线便携因特网系统中管理通讯加密密钥的方法及其协议配置方法、以及在用户台中的通讯加密密钥状态机的操作方法
CN101645771A (zh) * 2008-08-04 2010-02-10 深圳华为通信技术有限公司 密钥同步的方法、装置和系统
CN102378168A (zh) * 2010-08-17 2012-03-14 中兴通讯股份有限公司 多系统核心网通知密钥的方法和多系统网络
CN102035642A (zh) * 2010-12-20 2011-04-27 西安西电捷通无线网络通信股份有限公司 一种分组密码计数器运行模式中计数器的选择和同步方法
CN102289634A (zh) * 2011-08-31 2011-12-21 北京航空航天大学 基于可见光通信的限定区域权限认证装置及文件保密方法
CN102820922A (zh) * 2012-07-31 2012-12-12 深圳光启创新技术有限公司 一种异步加密可见光通信方法及系统
CN102833065A (zh) * 2012-08-07 2012-12-19 深圳光启创新技术有限公司 基于多用户异步加密的发射装置及方法、接收装置及方法

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20170056562A (ko) * 2014-09-05 2017-05-23 쿠앙치 인텔리전트 포토닉 테크놀로지 리미티드 지불 시스템
KR101897593B1 (ko) * 2014-09-05 2018-09-12 쿠앙치 인텔리전트 포토닉 테크놀로지 리미티드 지불 시스템
CN113810121A (zh) * 2021-09-02 2021-12-17 中国科学院国家授时中心 一种基于加密通信的光纤时间同步方法及系统

Also Published As

Publication number Publication date
EP2882117B1 (en) 2017-07-05
EP2882117A4 (en) 2016-04-20
JP2015532030A (ja) 2015-11-05
JP6082461B2 (ja) 2017-02-15
KR101670194B1 (ko) 2016-10-27
KR20150038018A (ko) 2015-04-08
EP2882117A1 (en) 2015-06-10
US20150146871A1 (en) 2015-05-28
US10250384B2 (en) 2019-04-02

Similar Documents

Publication Publication Date Title
WO2014019526A1 (zh) 可见光的加密方法、解密方法、通信装置及通信系统
US9098691B2 (en) Method and apparatus for encoding and decoding data transmitted to an authentication token
US20230118320A1 (en) Methods for secure data storage
US9768958B2 (en) Visible-light communication-based encryption, decryption and encryption/decryption method and system
US9184915B2 (en) Strong authentication token with acoustic data input over multiple carrier frequencies
US9800335B2 (en) Visible light signal transmitting and receiving processing method, transmitting terminal, receiving terminal, and system
US9717001B2 (en) Authentication system and authentication method
WO2015153559A1 (en) System and method for biometric key management
US9780874B2 (en) Light signal-based information processing method and device
CN102957513B (zh) 基于可见光通信的纠错方法和装置
US10911247B2 (en) Photon-based CA authentication method and system
CN106780911B (zh) 一种门禁语音编码、解码系统及方法
TWI633762B (zh) Decryption method for visible light communication system and communication device thereof
CN103840891B (zh) 可见光通信系统中的宽松解密方法和装置
CN102983976A (zh) 基于光信号的授权方法和装置
CN109840776B (zh) 利用超声波验证码的交易凭证认证方法与交易验证方法
US11622271B2 (en) Methods and systems for access control
JP5351079B2 (ja) 受信装置
JP2007020159A (ja) データ送信装置、及びデータ受信装置
JP2000059342A (ja) 光送信装置及び光受信装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 13825464

Country of ref document: EP

Kind code of ref document: A1

REEP Request for entry into the european phase

Ref document number: 2013825464

Country of ref document: EP

WWE Wipo information: entry into national phase

Ref document number: 2013825464

Country of ref document: EP

ENP Entry into the national phase

Ref document number: 2015524622

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 20157003312

Country of ref document: KR

Kind code of ref document: A