WO2017101083A1 - Device and method for comparing data - Google Patents

Device and method for comparing data Download PDF

Info

Publication number
WO2017101083A1
WO2017101083A1 PCT/CN2015/097745 CN2015097745W WO2017101083A1 WO 2017101083 A1 WO2017101083 A1 WO 2017101083A1 CN 2015097745 W CN2015097745 W CN 2015097745W WO 2017101083 A1 WO2017101083 A1 WO 2017101083A1
Authority
WO
WIPO (PCT)
Prior art keywords
optical signal
comparison
output
optical
port
Prior art date
Application number
PCT/CN2015/097745
Other languages
French (fr)
Chinese (zh)
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
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to PCT/CN2015/097745 priority Critical patent/WO2017101083A1/en
Publication of WO2017101083A1 publication Critical patent/WO2017101083A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing

Definitions

  • Embodiments of the present invention relate to the field of data processing, and in particular, to an apparatus and method for comparing data.
  • Vector comparison operations are widely used in applications such as image classification, character detection, and recommendation systems.
  • the recommendation system in order to recommend an item to a target user, it is often necessary to find a historical user set similar to the target user's interest, so that the user's interest similarity needs to be calculated.
  • the user's interest can be expressed in the form of a vector according to the user's preference for each item. For example, if an item is interested, it is expressed as '1', and if the item is not interested, it is represented as '0', for multiple items.
  • Interest can be represented as a plurality of '1' and '0' arranged vectors, so the calculation of the user's interest similarity translates into a vector comparison of the comparison vector (the target user's interest) and the reference vector (historical user's interest). Operation; usually in a vector comparison operation, the vector to be compared is compared with multiple reference vectors at a time, and the vector comparison operation is performed in batches.
  • a vector processor is used to perform vector comparison operations, or a vector comparison system built by an electrical device is used; if a general-purpose processor is used for batch vector comparison operations, only a comparison result with one reference vector can be calculated at a time, thus completing The comparison of all reference vectors takes a long time; if the vector comparison system built by the electrical device is used for batch vector comparison operation, since the transmission of the electrical signal is limited by the RC (resistance capacitance) delay and electromagnetic interference of the electronic device, And the working frequency and interconnect bandwidth are facing performance bottlenecks.
  • RC resistance capacitance
  • the present application provides an apparatus and method for comparing data; the preparation method is to realize the comparison of each element in the data with multiple reference vectors simultaneously by using optoelectronic technology.
  • the application provides a device for comparing data, the device is configured to compare a first data with one or more reference data, and specifically compare an element in the reference data with a element in the first data.
  • the elements in the reference data correspond one-to-one with the elements in the first data.
  • the device comprises a conversion module and a comparison module, the comparison module being composed of at least one comparison unit.
  • the conversion module respectively generates optical signals of different wavelengths for respective elements included in the first data, and distributes the optical signals to each of the comparison units.
  • each comparison unit compares its corresponding reference data with the first data;
  • the first comparison unit refers to any one of the comparison units, and the first reference data refers to the first a reference data corresponding to the comparison unit;
  • the first comparison unit is taken as an example to describe the working principle of the comparison unit.
  • the first comparison unit compares the element in the first data with the corresponding element in the first reference data
  • the element in the first data corresponds to the first reference data.
  • the optical signal corresponding to the element in the first data is different from the corresponding element in the first reference data when the element in the first data is different, and the optical signal corresponding to the element in the first data is from the first a comparison unit outputting the output of the comparison unit
  • the first comparison unit may control the light corresponding to the plurality of elements in the first data when the plurality of elements in the first data are the same as the corresponding plurality of elements in the first reference data Signals, each outputted from a different comparison output port or outputted from one or more comparison output ports, for example, each outputted from a second comparison output port of the first comparison unit; the first comparison unit can control a plurality of elements in the first data When the corresponding plurality of elements in the first reference data are different, the optical signals corresponding to the
  • the conversion module generates an optical signal for each element included in the first data, and the wavelengths of the optical signals corresponding to the different elements are different; the first comparison unit implements the first data by controlling the direction of the light. Each element is compared to a corresponding element in the first reference data.
  • the element of the first data corresponds to an element of the first data when the corresponding element of the first reference data is different, and the element corresponding to the element of the first data is the same as the element of the first data when the corresponding element in the first reference data is the same
  • the optical signals are output from different comparison output ports; therefore, the present application can learn from the different comparison output ports which elements in the first data are identical to the first reference data, and know which elements in the first data are not related to the first reference data. the same.
  • each element in the first data belongs to binary data
  • the prime element is either 0 or 1; the first element refers to any one of the first data, and the first reference element refers to an element corresponding to the first element in the first reference data.
  • the first comparison unit has a first comparison input port, a second comparison input port, the first comparison output port, and the second comparison output port;
  • the conversion module generates a first optical signal when the first element is 1, the first optical signal belongs to an optical signal having a wavelength corresponding to the first element, and the first to the first comparison unit
  • the comparison input port outputs a first optical signal.
  • the conversion module generates a second optical signal when the first element is 0, the second optical signal belongs to an optical signal having a wavelength corresponding to the first element, and to a second of the first comparison unit
  • the comparison input port outputs a second optical signal.
  • the first comparing unit controls, when the first reference element is 0, to output the first optical signal input from the first comparison input port from the first comparison output port, and control from the second Comparing the second optical signal input to the input port from the second comparison output port; the first comparing unit controls the input from the first comparison input port when the first reference element is The first optical signal is output from the second comparison output port, and the second optical signal input from the second comparison input port is controlled to be output from the first comparison output port.
  • the first comparing unit is capable of realizing a binary comparison of the first element in the first data with the first reference element in the first reference data, and outputting from the second comparison port when the comparison result is the same, It is output from the first comparison port when the comparison result is different.
  • the first comparison unit includes a 2 ⁇ 2 optical switch having a first input port, a second input port, a first output port, and a second output port. If the first comparison unit includes a plurality of 2 ⁇ 2 optical switches, the plurality of the plurality of 2 ⁇ 2 optical switches are connected in series, that is, in two adjacent 2 ⁇ 2 optical switches connected in series The first output port of the front 2 ⁇ 2 optical switch is connected to the first input port of the second 2 ⁇ 2 optical switch connected in series, and the second output port of the front 2 ⁇ 2 optical switch is connected in series with the second output port The second input port of the 2 x 2 optical switch is connected.
  • the 2 ⁇ 2 optical switch included in the first comparison unit is in one-to-one correspondence with the element included in the first reference data; in the first comparison unit, an optical switch is used to implement a reference element and a corresponding element in the first data. Comparison.
  • the first optical switch refers to a 2 ⁇ 2 optical switch corresponding to the first reference element in the first comparison unit.
  • the first optical switch receives the first optical signal output by the first comparison input port from a first input port of the first optical switch; the first optical switch is 0 at the first reference element Controlling, by the first optical port input from the first input port of the first optical switch, from the first output port of the first optical switch, such that the first comparison unit is from the first comparison
  • the output port outputs the first optical signal; the first optical switch controls the first optical signal input from the first input port of the first optical switch when the first reference element is 1.
  • the second output port output of the first optical switch is such that the first comparison unit outputs the first optical signal from the second comparison output port.
  • the first optical switch receives the second optical signal output by the second comparison input port from a second input port of the first optical switch; the first optical switch is controlled at the first reference element 0, the second optical signal input from the second input port of the first optical switch is output from the second output port of the first optical switch, such that the first comparison unit is compared from the second comparison
  • the output port outputs the second optical signal; the first optical switch controls the second optical signal input from the second input port of the first optical switch when the first reference element is 1.
  • the first output port of the first optical switch is output such that the first comparison unit outputs the second optical signal from the first comparison output port.
  • the first optical switch receiving the first comparison input from a first input port of the first optical switch a third optical signal output by the port, controlling a third optical signal input from the first input port of the first optical switch to be output from the first output port of the first optical switch; if from the first optical switch The second input port receives the third optical signal output by the second comparison input port, and controls the third optical signal input from the second input port of the first optical switch from the first optical switch The second output port is output.
  • the working wavelength of the first optical switch is the wavelength of the first optical signal (ie, the wavelength of the second optical signal), so the first optical switch can change the direction of the first optical signal and the second optical signal; for the third signal, Since the wavelength of the third signal is different from the operating wavelength of the first optical switch, the first optical switch does not change the course of the third signal.
  • the conversion module includes a characterization module, a first multiplexer, a first distributor, a second multiplexer, and a second distributor.
  • the characterization module generates the first optical signal corresponding to the first element when the first element is 1, and sends the first optical signal to the first multiplexer;
  • the one or more optical signals (including the first optical signal) received by the characterization module are multiplexed, and the multiplexed optical signal is output to the first distributor; the first distributor will Distributing the resulting optical signal to each of the comparison units includes outputting the multiplexed optical signal to a first comparison input port of the first comparison unit.
  • the characterization module generates the second optical signal corresponding to the first element when the first element is 0, and sends the second optical signal to the second multiplexer;
  • the processor multiplexes one or more optical signals (including the second optical signal) received from the characterization module, and outputs the multiplexed optical signal to the second distributor; the second distributor will The multiplexed optical signal is distributed to each of the comparison units, including outputting the multiplexed optical signal to a second comparison input port of the first comparison unit.
  • the characterization module generates different optical signals when the first element is a different binary value, and is sent by different distributors to different comparison input ports of the respective units via different multiplexers and distributors, so that the comparison unit compares for different comparisons.
  • the optical signal input to the input port controls the direction of the optical signal in different ways.
  • the characterization module includes a photoelectric modulator, the first data comprising elements in one-to-one correspondence with the photoelectric modulators included in the characterization module; that is, one of the characterization modules, one photoelectric modulator is The binary value of the corresponding element in the first data controls the output of the optical signal to the first multiplexer or the second multiplexer.
  • the first optoelectronic modulator refers to an optoelectronic modulator corresponding to the first element, the first optoelectronic modulator having a first optical output port and a second optical output port.
  • the first optoelectronic modulator modulates an electrical signal representing the first element into the second optical signal when the first element is 0, and transmits the second optical signal to the second multiplexer .
  • the first optoelectronic modulator modulates an electrical signal representing the first element into the first optical signal when the first element is 1, and transmits the first optical signal to the first multiplexer .
  • the photoelectric modulator has a dual optical output port, which can be expressed as an optical signal when the elements of the first data are different binary values, and controls optical signals corresponding to different binary values from different dual optical output ports.
  • the device further includes a result determination module.
  • the result determining module receives the optical signal output by the first comparing unit from the first comparison output port, and converts the optical signal output by the first comparison output port into a first electrical signal, and receives the first comparing unit An optical signal output from the second comparison output port, and converting the optical signal output by the second comparison output port into a second electrical signal; the result determining module is based on the strength and/or the first electrical signal The strength of the second electrical signal determines a matching result of the first data and the first reference data.
  • the result determining module can convert the optical signal into an electrical signal, so that the matching result of the first data and the first reference data can be determined according to the strength of the electrical signal, and the use of the electrical signal to determine the matching result with the optical signal is more intuitive and convenient. .
  • the present application provides a method for comparing data
  • the device to which the method is applicable is referred to the device for comparing data provided in the above application, and details are not described herein again.
  • the conversion module respectively represents each element included in the first data as a different wavelength of an optical signal, and outputs the optical signal to each of the comparison units separately;
  • the first comparison unit controls have And outputting, by the first comparison output port, an optical signal of a wavelength corresponding to an element different from the first reference data, and controlling a wavelength corresponding to an element of the first data and the first reference data
  • the optical signal is output from the second comparison output port.
  • the first data is binary data
  • the first data includes an element of 0 or 1
  • the first element refers to any one of the first data
  • the first reference element is Refers to an element in the first reference data that corresponds to the first element.
  • the first comparison unit has a dual input port and a dual output port. See the description of the first comparison unit described above in the present application.
  • the conversion module respectively indicates the respective elements included in the first data as different wavelengths of the optical signal, and respectively outputs the optical signals to each of the comparing units, specifically including: the converting module is in the first element When 1, the first optical signal is output to the first comparison input port of the first comparison unit, the first optical signal belongs to an optical signal having a wavelength corresponding to the first element; When the first element is 0, outputting a second optical signal to the second comparison input port of the first comparison unit, where the second optical signal belongs to an optical signal having a wavelength corresponding to the first element;
  • the first comparison unit controls an optical signal having a wavelength corresponding to an element different from the first reference data to be output from a first comparison output port, and the control has the first An optical signal of a wavelength corresponding to the same element as the first reference data is output from the second comparison output port, and specifically includes: the first comparing unit controls, when the first reference element is 0, from the The first optical signal input by the first comparison input port is output from the first comparison output port, and the second optical signal input from the second comparison input port is controlled to be output from the second comparison output port; The first comparing unit controls to output the first optical signal input from the first comparison input port from the second comparison output port when the first reference element is 1, and control from the second The second optical signal input to the comparison input port is output from the first comparison output port.
  • the first comparison unit includes a 2 ⁇ 2 optical switch; and the structure relationship of the 2 ⁇ 2 optical switch in the first comparison unit is described in the above description of the present application, and details are not described herein again.
  • the 2 ⁇ 2 optical switch included in the first comparison unit is in one-to-one correspondence with the element included in the first reference data; the first optical switch refers to 2 corresponding to the first reference element in the first comparison unit.
  • the method of comparing data includes the following operational steps of the first optical switch.
  • the first optical switch receives the first optical signal output by the first comparison input port from a first input port of the first optical switch; the first optical switch is 0 at the first reference element Controlling, by the first optical port input from the first input port of the first optical switch, from the first output port of the first optical switch, such that the first comparison unit is from the first comparison
  • the output port outputs the first optical signal; the first optical switch controls the first optical signal input from the first input port of the first optical switch when the first reference element is 1.
  • the second output port output of the first optical switch is such that the first comparison unit outputs the first optical signal from the second comparison output port.
  • the first optical switch receives the second optical signal output by the second comparison input port from a second input port of the first optical switch; the first optical switch is 0 at the first reference element Controlling, by the second optical port input from the second input port of the first optical switch, from the second output port of the first optical switch, such that the first comparison unit is from the second comparison
  • the output port outputs the second optical signal; the first optical switch controls the second optical signal input from the second input port of the first optical switch when the first reference element is 1.
  • the first output port of the first optical switch is output such that the first comparison unit outputs the second optical signal from the first comparison output port.
  • the wavelength of the third optical signal is different from the wavelength of the second optical signal, and the wavelength of the third optical signal is different from the wavelength of the first optical signal. If the first optical switch receives the third optical signal output by the first comparison input port from the first input port of the first optical switch, the first optical switch controls the first optical switch from the first optical switch A third optical signal input to an input port is output from the first output port of the first optical switch. Controlling input from a second input port of the first optical switch if the first optical switch receives the third optical signal output by the second comparison input port from a second input port of the first optical switch The third optical signal is output from a second output port of the first optical switch.
  • the conversion module includes a characterization module, a first multiplexer, a first distributor, a second multiplexer, and a second distributor.
  • the method of comparing data includes the following working steps of the characterization module.
  • the characterization module generates the second optical signal corresponding to the first element when the first element is 0, and sends the second optical signal to the second multiplexer;
  • the processor multiplexes the optical signals received from the characterization module, and outputs the multiplexed optical signals to the second distributor; the second distributor compares the multiplexed optical signals to each of the comparisons
  • the unit distribution includes outputting the multiplexed optical signal to a second comparison input port of the first comparison unit.
  • the characterization module generates the first optical signal corresponding to the first element when the first element is 1, and sends the first optical signal to the first multiplexer;
  • the processor multiplexes the optical signals received from the characterization module, and outputs the multiplexed optical signals to the first distributor; the first distributor compares the multiplexed optical signals to each of the comparisons
  • the unit distribution includes outputting the multiplexed optical signal to a first comparison input port of the first comparison unit.
  • the characterization module includes a photoelectric modulator, the first data comprising elements in one-to-one correspondence with the photoelectric modulators included in the characterization module, the first photoelectric modulator being referred to as the first element A corresponding optoelectronic modulator, the first optoelectronic modulator having a first optical output port and a second optical output port.
  • the method of comparing data includes the following operational steps of the first optoelectronic modulator.
  • the first optoelectronic modulator modulates an electrical signal representing the first element into the second optical signal when the first element is 0, and transmits the second optical signal to the second multiplexer And modulating an electrical signal representing the first element into the first optical signal when the first element is 1, and transmitting the first optical signal to the first multiplexer.
  • the device further includes a result determination module.
  • the method of comparing data includes the following working steps of the result determination module.
  • the result determining module receives the optical signal output by the first comparing unit from the first comparison output port, and converts the optical signal output by the first comparison output port into a first electrical signal, and receives the first Comparing, by the unit, the optical signal output from the second comparison output port, and converting the optical signal output by the second comparison output port into a second electrical signal; the result determining module is based on the intensity of the first electrical signal And / or the strength of the second electrical signal, determining a matching result of the first data and the first reference data.
  • FIG. 1 is a schematic diagram of a hardware structure of a device for comparing data
  • FIG. 2 is a schematic diagram of a hardware structure of a device for comparing data
  • FIG. 3 is a schematic diagram of a hardware structure of a device for comparing data
  • FIG. 4 is a schematic diagram of a first comparison unit controlling the direction of an optical signal
  • FIG. 5 is a schematic diagram of a hardware structure of a device for comparing data
  • FIG. 6 is a schematic diagram of a first photoelectric converter generating an optical signal
  • Figure 7 is a schematic diagram of the operation of the device for comparing data
  • FIG. 8 is a flow chart showing a method of comparing data.
  • the device for comparing data is composed of photonic devices, and can be applied to a computing scenario in which reference data is compared in batches; the device for comparing data can be used as a dedicated processing module or as a coprocessor to accelerate comparison calculation.
  • the photonic device is used to construct the device structure, which improves the computational efficiency and throughput of the comparison data.
  • the reference data is composed of one or more elements, and the elements may be binary Numbers, characters, or other symbols used for characterization, such as the background art using a binary number '1' to characterize an item, using a binary number '0' to characterize the item, where the binary number '1' or binary The number '0' is an element.
  • the elements in the data to be compared are similar to the elements of the reference data, and are not described here; the data to be compared is hereinafter referred to as the first data.
  • the first data and the reference data may be represented in a vector form or may be represented in an array form.
  • the reference data includes elements that correspond one-to-one with the elements included in the first data.
  • comparing the first data with the reference data is to compare each element included in the first data with a corresponding element in the reference data, and compare whether the element included in the first data is the same as the corresponding element in the reference data.
  • the first element refers to any one of the first data
  • the first reference element refers to an element corresponding to the first element in the first reference data; in this embodiment, the first data and the first reference data are used.
  • Element comparison specifically comparing the first element with the corresponding first reference element.
  • any symbol can be represented as binary data in the computer field.
  • the present embodiment describes the reference data and the first data as binary data as an example. That is, if the first data is binary data, the first data includes an element of 0 or 1, for example, the first element is 0 or 1; the first reference data belongs to binary data, and the first reference data The included element is 0 or 1, for example, the first reference element is 0 or 1.
  • the device for comparing data includes a comparison module, and the comparison module includes at least one comparison unit. Different comparison units correspond to different reference data; one of the comparison units is configured to compare one reference data with the first data, so that the plurality of comparison units can implement parallel comparison of the first data with a plurality of different reference data.
  • the first comparison unit refers to any one of the comparison units.
  • the first reference data in this embodiment refers to reference data corresponding to the first comparison unit, that is, the first comparison unit is used to compare the first reference data with the first reference unit. A comparison of data.
  • the device for comparing data includes a conversion module.
  • the conversion module may generate optical signals of different wavelengths for different elements of the first data, and include the respective illumination units by the comparison modules.
  • the conversion module correspondingly represents each element included in the first data. Generating optical signals of different wavelengths for different wavelengths of the optical signal, respectively outputting the generated optical signals to each of the comparing units, including outputting the optical signals to the first comparing unit.
  • the first comparing unit compares the element of the first data with the corresponding element in the first reference data, specifically, the direction of the control optical signal; for the element of the first data and the corresponding element in the first reference data a different comparison scenario, the first comparison unit controls the optical signal having the wavelength corresponding to the element of the first data to be output from the first comparison output port; for the element of the first data and the corresponding one of the first reference data The scene in which the elements are the same, the first comparison unit controls the optical signal having the wavelength corresponding to the same element to be output from the second comparison output port of the first comparison unit.
  • the conversion module For each element included in the first data, the conversion module generates an optical signal, which means that the wavelengths of the optical signals corresponding to different elements are different; the first comparison unit realizes each element of the first data by controlling the direction of the light. Compare with the corresponding elements in the first reference data.
  • the optical signal having the wavelength corresponding to the element is controlled to be output from the first comparison output port; it can be seen that which of the first data can be learned from the first comparison output port. The element is different from the first reference data.
  • the optical signal controlling the wavelength corresponding to the element is output from the second comparison output port; it can be seen that which elements in the first data can be learned from the second comparison output port. Same as the first reference data.
  • each comparison unit in the comparison module has two input ports, and each has two output ports, as shown in FIG. 2 .
  • the first comparison unit has a first comparison input port (shown as in1 in FIG. 2), a second comparison input port (shown as in2 in FIG. 2), and a first comparison output port (FIG. 2 is shown as out1).
  • a second comparison output port (shown as out2 in FIG. 2); the first comparison input port and the second comparison input port are used as two input ports of the first comparison unit to receive an optical signal; the first comparison output port, The second comparison output port serves as two output ports of the first comparison unit, and the first comparison unit can control the optical signal to be output from the first comparison output port and/or the second comparison output port.
  • the following is an example of comparing the first element and the first reference element to explain how the down conversion module inputs an optical signal to the first comparison unit, and how the first comparison unit controls the direction of the optical signal.
  • the conversion module when the first element is 1, a first ratio to the first comparison unit And outputting, by the input port, the first optical signal, the first optical signal belongs to an optical signal having a wavelength corresponding to the first element; and the converting module, when the first element is 0, to the first comparison
  • the second comparison input port of the unit outputs a second optical signal that belongs to an optical signal having a wavelength corresponding to the first element. It can be seen that the two optical signals of the first optical signal and the second optical signal have the same wavelength, but the ports input to the first comparison unit are different.
  • a first comparing unit when the first reference element is 0, controlling the first optical signal input from the first comparison input port to be output from the first comparison output port, and controlling from the second comparison The second optical signal input to the input port is output from the second comparison output port.
  • a first comparing unit when the first reference element is 1, controlling the first optical signal input from the first comparison input port to be output from the second comparison output port, and controlling from the second comparison The second optical signal input to the input port is output from the first comparison output port.
  • each comparison unit in the comparison module can be implemented by using a 2 ⁇ 2 optical switch combination, as shown in FIG. 3 .
  • the 2 ⁇ 2 optical switch in the comparison unit may be a micro-ring resonator type optical switch based on a silicon-based or a tri-five material, or may be a narrow-band 2 ⁇ 2 light such as a grating type or a multi-micro ring type.
  • the switch can be, for example, a narrow band 2 x 2 optical switch such as a MEMS.
  • S represents a 2 ⁇ 2 optical switch
  • m, n are positive integers greater than 0; for example, n 2 ⁇ 2 optical switches S11, S12, ..., S1n constitute a comparison unit, by S21, S22
  • the n 2 ⁇ 2 optical switches of S2n are composed of one comparison unit; the first comparison unit is composed of n 2 ⁇ 2 optical switches Sm1, Sm2, ..., Smn.
  • the first comparison unit includes one or more 2 ⁇ 2 optical switches
  • the first comparison unit shown in FIG. 3 includes n 2 ⁇ 2 optical switches.
  • the 2x2 optical switch has a first input port (shown as in3 in Figure 3), a second input port (shown as in4 in Figure 3), a first output port (shown as out3 in Figure 3), and a second output port (Figure 3 shows The first input port and the second input port serve as two input ports of the 2 ⁇ 2 optical switch, and can receive optical signals; the first output port and the second output port serve as two output ports of the 2 ⁇ 2 optical switch. .
  • the 2 ⁇ 2 optical switch included in the first comparison unit is in one-to-one correspondence with the elements included in the first reference data; for example, in FIG. 3, b represents an element in the reference data, and the n elements are bm1, bm2, ..., bmn. Indicates first reference data; bm1, bm2, ..., bmn sequentially correspond to Sm1, Sm2, ..., Smn.
  • the first optical switch refers to a 2 ⁇ 2 optical switch corresponding to the first reference element in the first comparison unit.
  • bm2 represents a first reference element
  • Sm2 represents a first optical switch.
  • the number of 2 ⁇ 2 optical switches included in the first comparison unit is equal to the number of elements included in the first reference data, and FIG. 3 represents n.
  • the first comparison unit also has only one 2 ⁇ 2 optical switch, and the first input port and the second input port of the 2 ⁇ 2 optical switch
  • the first output port and the second output port correspond to a first comparison input port, a second comparison input port, a first comparison output port, and a second comparison output port of the first comparison unit.
  • the first comparison unit also correspondingly includes a plurality of 2 ⁇ 2 optical switches, and the plurality of the plurality of 2 ⁇ 2 optical switches are connected in series.
  • the implementation of multiple of the plurality of 2 ⁇ 2 optical switches in series is:
  • the first input port and the second input port of the first 2 ⁇ 2 optical switch correspond to the first comparison input port and the second comparison input port of the first comparison unit, and finally a first output port and a second output port of a 2 ⁇ 2 optical switch correspond to a first comparison output port and a second comparison output port of the first comparison unit; and, adjacent two 2 ⁇ 2 lights in series
  • the first output port of the 2 ⁇ 2 optical switch connected in series is connected to the first input port of the 2 ⁇ 2 optical switch connected in series
  • the second output port of the 2 ⁇ 2 optical switch connected in series is connected in series Connected to the second input port of the rear 2 x 2 optical switch.
  • the first correspondence relationship between the 2 ⁇ 2 optical switch included in the first comparison unit and the element included in the first reference data, and the one-to-one correspondence between the element included in the first reference data and the element included in the first data may determine a one-to-one correspondence between the 2 ⁇ 2 optical switch included in the comparison unit and the element included in the first data; a one-to-one correspondence between the 2 ⁇ 2 optical switch included in the first comparison unit and the element included in the first data, and the first A one-to-one correspondence between the elements of the data and the wavelength of the optical signal may determine a one-to-one correspondence between the wavelength of the 2 ⁇ 2 optical switch and the optical signal included in the first comparing unit; and the first comparing unit may utilize the narrow band 2
  • the ⁇ 2 optical switch controls the direction of the optical signal having the wavelength corresponding to the 2 ⁇ 2 optical switch, for example, using the first optical switch to control the direction of the optical signal having the wavelength corresponding to the first element.
  • the first comparison unit transmits the first optical signal received from the first comparison input port (in1 in FIG. 3) to the first input port of the first optical switch (in3 in FIG. 3).
  • the first comparison unit transmits a second optical signal received from the second comparison input port (in2 in FIG. 3) to the second input port of the first optical switch (in4 in FIG. 3).
  • the first optical switch controls the first input port from the first optical switch when the first reference element (bm2 in FIG. 3) is 0 (in FIG. 3 In3) the input first optical signal is output from a first output port (out3 in FIG. 3) of the first optical switch, such that the first comparison unit is from the first comparison output port (in FIG. 3 Out1) outputting the first optical signal, controlling the second optical signal input from the second input port (in4 in FIG. 3) of the first optical switch from the second output of the first optical switch a port (out4 in FIG. 3) is output such that the first comparison unit outputs the second optical signal from the second comparison output port (out2 in FIG. 3);
  • the first optical switch controls the first input port from the first optical switch when the first reference element (bm2 in FIG. 3) is 1.
  • the input first optical signal is output from a second output port (out4 in FIG. 3) of the first optical switch, such that the first comparison unit is from the second comparison output port (FIG. 3) Out2) outputting the first optical signal, controlling the second optical signal input from the second input port (in4 in FIG. 3) of the first optical switch from the first output of the first optical switch
  • the port (out3 in FIG. 3) is output such that the first comparison unit outputs the second optical signal from the first comparison output port (out1 in FIG. 3).
  • FIG. 3 A schematic diagram of the operation of Sm2 in FIG. 3 can be seen in FIG.
  • Sm2 controls the first optical signal input from in3 to be output from out3, so that the first comparison unit outputs the first optical signal from the first comparison output port (out1 in FIG. 3)
  • Sm2 controls the second optical signal input from in4 to be output from out4 such that the first comparison unit outputs the second optical signal from the second comparison output port (out2 in FIG. 3).
  • bm2 1, Sm2 controls the first optical signal input from in3 to be output from out4, so that the first comparison unit outputs the first from the second comparison output port (out2 in FIG. 3)
  • An optical signal Sm2 controls the second optical signal input from in4 to be output from out3, such that the first comparison unit outputs the second optical signal from the first comparison output port (out1 in FIG. 3).
  • the wavelength of the third optical signal is different from the wavelength of the second optical signal, and the wavelength of the third optical signal is different from the wavelength of the first optical signal.
  • the first optical switch does not hinder the passage of the third optical signal, in particular two cases.
  • the first comparison unit transmits the third optical signal received from the first comparison input port (in1 in FIG. 3) to the first input port of the first optical switch (Sm2 in FIG. 3). (in3 in FIG. 3); the first optical switch controls a third optical signal input from a first input port (in3 in FIG. 3) of the first optical switch from a first output port of the first optical switch (out3 in Fig. 3) output; then, the 2x2 optical switch located behind the first optical switch in the first comparison unit controls the direction of the optical signal having the wavelength corresponding to the 2x2 optical switch.
  • the first comparison unit transmits a third optical signal received from the second comparison input port (in2 in FIG. 3) to the second input port of the first optical switch (Sm2 in FIG. 3). (in4 in FIG. 3); the first optical switch controls the third optical signal input from the second input port (in4 in FIG. 3) of the first optical switch from the second of the first optical switch An output port (out4 in FIG. 3) is output; then, a 2 ⁇ 2 optical switch located behind the first optical switch in the first comparison unit controls the direction of the optical signal having the wavelength corresponding to the 2 ⁇ 2 optical switch.
  • the conversion module includes a characterization module, a first multiplexer, a first distributor, a second multiplexer, and a second distributor; the characterization module can be to the first multiplexer and/or the second multiplexer Transmitting the optical signal; the first multiplexer may send the optical signal to the first distributor such that the first distributor distributes the optical signal to each of the comparison units in the comparison module; the second multiplexer may send the second multiplexer to the second distributor The optical signal is such that the second distributor distributes the optical signal to each of the comparison units in the comparison module.
  • the optical channel between the first multiplexer, the first distributor, the comparison unit, and the optical channel between the second multiplexer, the second distributor, and the comparison unit it can carry thousands of different wavelengths Optical signals, so you can support the comparison of thousands of elements at a time.
  • the working principle of the characterization module is described by taking the first element as an example.
  • the characterization module generates the first optical signal corresponding to the first element when the first element is 1, to the first multiplexing. Transmitting the first optical signal; the characterization module generates the second optical signal corresponding to the first element when the first element is 0, and sends the second optical signal to the second multiplexer Two light signals.
  • the characterization module transmits an optical signal (including the first optical signal) corresponding to each element of the first data to the first multiplexer; the first multiplexer will receive from the characterization module of And multiplexing the one or more optical signals, and outputting the multiplexed optical signals to the first distributor; the first distributor distributing the multiplexed optical signals to each of the comparing units, including The first comparison input port of the first comparison unit outputs the multiplexed optical signal.
  • the characterization module transmits an optical signal (including a second optical signal) corresponding to each element of 0 in the first data to a second multiplexer; the second multiplexer will receive from the characterization module And multiplexing the one or more optical signals, outputting the multiplexed optical signal to the second distributor; the second distributor distributing the multiplexed optical signal to each of the comparing units, including The second comparison input port of the first comparison unit outputs the multiplexed optical signal.
  • the characterization module is composed of a photoelectric modulator, as shown in FIG. 5, the photoelectric modulator is represented by M; the characterization module shown in FIG. 5, the n photoelectric modulators of M1, M2, ..., Mn composition.
  • the first data comprises elements in one-to-one correspondence with the photoelectric modulators included in the characterization module; in FIG. 3, a represents elements in the first data, and is composed of a1, a2, ..., an shown in FIG.
  • the first data; a1, a2, ..., an in FIG. 3 are in turn corresponding to M1, M2, ..., Mn in FIG.
  • the first photoelectric modulator (M2 in FIG. 5) refers to a photoelectric modulator corresponding to the first element (a2 in FIG. 5), and the first photoelectric modulator has a first light output port (out5 in FIG. 5) And the second light output port (out6 in Figure 5). Under the condition that the first photoelectric modulator has two output ports (the first light output port and the second light output port) and the above photoelectric modulation function, which type of photoelectric modulator is specifically adopted and which model is specifically adopted The photoelectric modulator as the first photoelectric modulator does not constitute a limitation on the embodiment of the present invention.
  • represents the wavelength of the optical signal
  • the ⁇ 1 source is the optical signal of the wavelength ⁇ 1 directed to M1
  • the ⁇ 2 source is the optical signal of the wavelength ⁇ 2 directed to M2
  • the ⁇ n source is directed to Mn to provide the wavelength ⁇ n Light signal.
  • M2 in Fig. 5 The following describes the working principle of the first photoelectric modulator (M2 in Fig. 5) by taking the first element (a2 in Fig. 5) as an example:
  • the first photoelectric modulator (M2 in FIG. 5) modulates an electrical signal representing the first element into a second optical signal when the first element (a2 in FIG. 5) is 0, and the second light
  • the wavelength of the signal is ⁇ 2, and the second optical signal is transmitted from the second optical output port (out6 in FIG. 5) to the second multiplexer;
  • the first photoelectric modulator (M2 in FIG. 5) is at the first element (a2 in FIG. 5) 1 when an electrical signal representing the first element is modulated into the first optical signal, the wavelength of the first optical signal is ⁇ 2, from the first optical output port (out5 in FIG. 5) to the first multiplexing
  • the transmitter transmits the first optical signal.
  • M2 modulates an electrical signal representing 1 into a first optical signal when a2 is 1, the first optical signal being provided by a ⁇ 2 light source, and transmitting the first optical signal from out5 to the first multiplexer.
  • M2 modulates an electrical signal representing 0 into a second optical signal when a2 is 0, the second optical signal is provided by a ⁇ 2 light source, and transmits a second optical signal from out6 to the second multiplexer.
  • first optical signal and the second optical signal is the same wavelength, because they are all modulated according to the optical signal provided by the ⁇ 2 light source.
  • first optical signal is controlled by the first optical modulator from the first optical output port (in FIG. 5 Out5) output
  • second optical signal is output by the first optical modulator from the second optical output port (out6 in Fig. 5).
  • each comparison unit in the comparison module may be connected to the result determination module.
  • the first comparison unit may send an optical signal from the first comparison output port (out1 in FIG. 5) to the result determination module.
  • the result determination module receives the optical signal transmitted by the first comparison unit from the first comparison output port, and converts the optical signal into a first electrical signal.
  • the first comparison unit may transmit an optical signal from the second comparison output port (out2 in FIG. 5) to the result determination module; the result determination module receives the optical signal output by the first comparison unit from the second comparison output port, and The optical signal is converted to a second electrical signal.
  • the result determining module may determine a matching result of the first data and the first reference data according to an intensity of the first electrical signal and/or an intensity of the second electrical signal. For example, if the intensity of the first electrical signal is close to zero, it may be determined that the first data is the same as the first reference data; if the intensity of the second electrical signal is greater than the strength of the first electrical signal, the first data and the first reference may be determined.
  • the data matching rate is above 50%.
  • the result determining module may determine, according to the optical signal output by each comparing unit, a matching result of the first data and the reference data corresponding to the comparing unit. It is even possible to set a specific rule, and compare the matching results obtained by the optical signals output by the comparison unit with each other, and use the specific rule to analyze the comparison result, and determine the reference data with the highest similarity with the first data, and determine the first The reference data having the lowest data similarity determines the same reference data as the first data, and determines reference data that satisfies a certain similarity threshold with the first data.
  • FIG. 7 shows the various modules participating in the comparison process.
  • the present example is described in detail in FIG. 7 with n being 4 and m being 3 as an example.
  • n 4 and m is 3, it is correspondingly determined that the first data contains 4 elements.
  • the vector A is used to indicate that the first data is [1010]; correspondingly, four photoelectric modulators, including M1 and M2, are determined.
  • M3, M4; correspondingly determined as M1, M2, M3, M4, the four light sources sequentially providing the light source are a ⁇ 1 light source, a ⁇ 2 light source, a ⁇ 3 light source, and a ⁇ 4 light source.
  • the optical switch S11, the optical switch S12, the optical switch S13, and the optical switch S14 are sequentially arranged. It should be understood that the optical switch can be organized in the first comparison unit according to other arrangements. S11, optical switch S12, optical switch S13, optical switch S14 sequence.
  • the first data contains 4 elements, and the reference data also contains 4 elements. As shown in FIG. 7, three reference data are shown: [1001], [1010], [0101].
  • the first element a1 of the first data is 1, and M1 modulates the electrical signal representing a1 into an optical signal representing the wavelength ⁇ 1, and outputs an optical signal of wavelength ⁇ 1 from the first optical output port to the first multiplexer. After passing through the first multiplexer and the first beam splitter, the optical signal is distributed by the first beam splitter to each comparison unit.
  • the reference vector is [1001]; the first output port of the optical switch S11 is the first comparison input port of the first comparison unit; when the optical signal of the wavelength ⁇ 1 is from the optical switch S11 When an output port is input, since the operating wavelength of the optical switch S11 is ⁇ 1, the optical switch S11 controls the optical signal of the wavelength ⁇ 1 input from the first input port of the optical switch S11 according to the first element 1 in the reference vector.
  • the second output port of the optical switch S11 is output; the optical switch S11 controls the optical signals of other wavelengths input from the first input port of the optical switch S11, and is output from the first output port of the optical switch S11; the optical switch S11 controls the slave optical switch S11
  • the optical signal of the other wavelength input by the second input port is output from the second output port of the optical switch S11.
  • the optical signal of the wavelength ⁇ 1 is input from the second input port of the optical switch S12. Since the operating wavelength of the optical switch S12 is ⁇ 2, the optical switch S12 outputs the optical signal of the wavelength ⁇ 1 from the second output port; and so on.
  • the optical signal with the wavelength ⁇ 1 passes through the second input port and the second output port of the optical switch S13 in sequence. Then, the second output port and the second output port of the optical switch S14 are sequentially passed through; wherein the second output port is the second comparison output port of the first comparison unit.
  • the second element a2 of the first data is 0, and M2 modulates the electrical signal representing a2 into an optical signal representing the wavelength ⁇ 2, and outputs an optical signal of wavelength ⁇ 2 from the second optical output port to the second multiplexer. Due to the operating wavelength of the ⁇ 2 non-optical switch S11, the optical signal of the wavelength ⁇ 2 sequentially passes through the second input port and the second output port of the optical switch S11, and enters the second input port of the optical switch S12. ⁇ 2 is the operating wavelength of the optical switch S12. Since the second element of the reference vector [1001] is 0, the optical switch S12 controls the optical signal of the wavelength ⁇ 2 input from the second input port of the optical switch S12 from the second output port. Output.
  • the optical signal of the wavelength ⁇ 2 sequentially passes through the second input port and the second output port of the optical switch S13, and sequentially passes through the second input of the optical switch S14.
  • the port, the second output port; the second output port of the optical switch S14 is the second comparison output port of the first comparison unit.
  • the third element a3 of the first data is 1, and M3 modulates the electrical signal representing a3 into an optical signal representing the wavelength ⁇ 3, and outputs the wavelength ⁇ 3 from the first optical output port to the first multiplexer.
  • Light signal Since the operating wavelength of the optical switch S13 is ⁇ 3, the operating wavelengths of the optical switch S11, the optical switch S12, and the optical switch S14 are not ⁇ 3. Therefore, the optical signal with the wavelength ⁇ 3 passes through the first input port of the optical switch S11 in sequence.
  • An output port which in turn passes through the first input port and the first output port of the optical switch S12; since the third element of the reference vector [1001] is 0, the optical switch S13 controls the wavelength input from the first input port to be The optical signal of ⁇ 3 is output from the first output port; finally, the optical signal of wavelength ⁇ 3 sequentially passes through the first input port and the first output port of the optical switch S14; the first output port of the optical switch S14 is the first comparison The first comparison output port of the unit.
  • the fourth element a4 of the first data is 0, and M4 modulates the electrical signal representing a4 into an optical signal representing the wavelength ⁇ 4, and outputs the wavelength ⁇ 4 from the second optical output port to the second multiplexer.
  • Light signal Since the operating wavelength of the optical switch S14 is ⁇ 4, the operating wavelengths of the optical switch S11, the optical switch S12, and the optical switch S13 are not ⁇ 4. Therefore, the optical signal with the wavelength ⁇ 4 passes through the second input port of the optical switch S11 in sequence.
  • the second output port passes through the second input port and the second output port of the optical switch S12 in turn, and then passes through the second input port and the second output port of the optical switch S13 in sequence; since the reference vector is the fourth element of [1001] For 1, the optical switch S14 will control from the first The optical signal of the wavelength ⁇ 4 input by the two input ports is output from the first output port; the first output port of the optical switch S14 is the first comparison output port of the first comparison unit.
  • the comparison unit controls the optical signals having the wavelengths corresponding to the same elements to be output from the second comparison output port.
  • an optical signal having a wavelength of ⁇ 1, an optical signal having a wavelength of ⁇ 2, an optical signal having a wavelength of ⁇ 3, and an optical signal having a wavelength of ⁇ 4 are all from the second comparison unit.
  • the intensity of the second output port of the comparison unit indicates the similarity between the first data and the reference data; when the first data and the reference data are the same, the first comparison output port of the comparison unit outputs no optical signal, The second comparison output port of the comparison unit outputs the optical signal of the maximum intensity; when the first data and the reference data are different, the second comparison output port of the comparison unit outputs no optical signal, and the first comparison output port of the comparison unit outputs the maximum intensity Light signal. It can be seen from the above that by using the output state of the first data using the dual port electro-optic modulator and calculating through the dual port optical switch, the comparison operation of all the elements of the first data can be realized at one time, greatly improving Data processing efficiency.
  • the device for comparing data can integrate multiple comparison units, enabling multiple comparison units to simultaneously perform batch parallel operation of multiple reference data and first data; since the photonic device is not transmitted Delayed, electromagnetic interference, etc., the data processing device can achieve a data comparison processing speed of nanoseconds (ns) or even higher.
  • the arrangement order of the optical switches in the comparison unit can be arbitrarily adjusted.
  • the result determining module can convert into an electrical signal according to the optical signal output by the three comparing units, and determine according to the strength of the converted electrical signal [1010] and [1001], [1010], [ Match result of 0101].
  • the method for comparing data provided by the method embodiment is applied to the device for comparing data provided by the foregoing device embodiment.
  • the device includes a conversion module and a comparison module, the comparison module includes at least one comparison unit, and the first comparison unit refers to the comparison unit of any one of the at least one comparison unit; different the comparison unit
  • the reference data includes elements corresponding to the elements included in the first data, and the first reference data refers to reference data corresponding to the first comparison unit.
  • FIG. 8 illustrates the basic implementation flow of the method, but for ease of explanation, only the portion related to the embodiment of the method is shown in FIG.
  • the method for comparing data includes steps 801 and 802.
  • Step 801 the conversion module correspondingly represents each element included in the first data as a different wavelength of the optical signal, and respectively outputting the optical signal to each of the comparing units;
  • Step 802 the first comparing unit controls an optical signal having a wavelength corresponding to an element different from the first reference data to be output from a first comparison output port, and the control has the first data and the An optical signal of a wavelength corresponding to the same element of the first reference data is output from the second comparison output port.
  • the first data is binary data
  • the first data includes an element of 0 or 1
  • the first element refers to any one of the first data
  • the first The reference element refers to an element corresponding to the first element in the first reference data
  • the first comparison unit has a first comparison input port, a second comparison input port, the first comparison output port, and the The second comparison output port.
  • the conversion module respectively indicates that each element included in the first data is represented as a different wavelength of the optical signal, and the optical signal is separately output to each of the comparison units, and specifically includes:
  • the conversion module outputs a first optical signal to a first comparison input port of the first comparison unit when the first element is 1, the first optical signal belongs to a wavelength corresponding to the first element Optical signal
  • the conversion module outputs a second optical signal to the second comparison input port of the first comparison unit when the first element is 0, where the second optical signal belongs to a wavelength corresponding to the first element Optical signal.
  • the first comparison unit controls an optical signal having a wavelength corresponding to an element different from the first reference data to be output from a first comparison output port, and the control has the first data and the The optical signal of the wavelength corresponding to the same element of the first reference data is output from the second comparison output port, and specifically includes:
  • the first comparing unit controls, when the first reference element is 0, to output the first optical signal input from the first comparison input port from the first comparison output port, and control from the second Comparing the second optical signal input to the input port from the second comparison output port;
  • the first comparing unit controls to output the first optical signal input from the first comparison input port from the second comparison output port when the first reference element is 1, and control from the second The second optical signal input to the comparison input port is output from the first comparison output port.
  • the conversion module generates the first optical signal or the second optical signal according to the first element in the optional embodiment, refer to the corresponding description in the foregoing device embodiment.
  • the first comparing unit controls the direction of the first optical signal and controls the direction of the second optical signal according to the first reference element, see corresponding description in the above device embodiment.
  • the first comparing unit includes a 2 ⁇ 2 optical switch, and the 2 ⁇ 2 optical switch has a first input port, a second input port, a first output port, and a second output port; If the first comparison unit includes a plurality of 2 ⁇ 2 optical switches, a plurality of the plurality of 2 ⁇ 2 optical switches are connected in series; the first comparison unit includes a 2 ⁇ 2 optical switch and the The first reference data includes one-to-one correspondence; the first optical switch refers to a 2 ⁇ 2 optical switch corresponding to the first reference element in the first comparison unit;
  • the method includes:
  • the first optical switch receives the first optical signal output by the first comparison input port from a first input port of the first optical switch, and receives the first optical port from the first optical switch Second comparing the second optical signal output by the input port;
  • the first optical switch controls the first optical signal input from the first input port of the first optical switch from the first output port of the first optical switch when the first reference element is 0 Outputing, such that the first comparison unit outputs the first optical signal from the first comparison output port, and controls the second optical signal input from a second input port of the first optical switch from the first a second output port of the optical switch is output, such that the first comparing unit outputs the second optical signal from the second comparison output port;
  • the first optical switch controls the first optical signal input from the first input port of the first optical switch from the second output port of the first optical switch when the first reference element is Outputting, causing the first comparison unit to output the first optical signal from the second comparison output port, and controlling the second optical signal input from the second input port of the first optical switch from the first a first output port of an optical switch is output, such that the first comparing unit outputs the second optical signal from the first comparison output port;
  • the first optical switch controls a third optical signal input from a first input port of the first optical switch to be output from a first output port of the first optical switch, or controls a first optical switch from the first optical switch
  • the third optical signal input by the two input ports is output from the second output port of the first optical switch.
  • the conversion module includes a characterization module, a first multiplexer, a first distributor, a second multiplexer, and a second distributor;
  • the method includes:
  • the characterization module generates the second optical signal corresponding to the first element when the first element is 0, and sends the second optical signal to the second multiplexer; When the element is 1, generating the first optical signal corresponding to the first element, and transmitting the first to the first multiplexer An optical signal;
  • the first multiplexer multiplexes optical signals received from the characterization module, and outputs the multiplexed optical signals to the first distributor;
  • the first distributor distributes the multiplexed optical signal to each of the comparing units, and outputs the multiplexed optical signal to a first comparison input port of the first comparing unit;
  • the second multiplexer multiplexes optical signals received from the characterization module, and outputs the multiplexed optical signals to the second distributor;
  • the second distributor distributes the multiplexed optical signal to each of the comparing units, and outputs the multiplexed optical signal to a second comparison input port of the first comparing unit.
  • the steps of the characterization module the first multiplexer, the first distributor, the second multiplexer, and the second distributor in the optional embodiment, refer to the corresponding working principle description in the foregoing device embodiment.
  • the characterization module includes a photoelectric modulator
  • the first data includes an element corresponding to the photoelectric modulator included in the characterization module
  • the first photoelectric modulator refers to the a photoelectric modulator corresponding to the first element, the first photoelectric modulator having a first light output port and a second light output port;
  • the method includes:
  • the first optoelectronic modulator modulates an electrical signal representing the first element into the second optical signal when the first element is 0, and transmits the second optical signal to the second multiplexer And modulating an electrical signal representing the first element into the first optical signal when the first element is 1, and transmitting the first optical signal to the first multiplexer.
  • the device further includes a result determining module
  • the method includes:
  • the result determining module receives the optical signal output by the first comparing unit from the first comparison output port, and converts the optical signal output by the first comparison output port into a first electrical signal, and receives the first Comparing, by the unit, the optical signal outputted from the second comparison output port, and converting the optical signal output by the second comparison output port into a second electrical signal;
  • the result determining module is configured according to an intensity of the first electrical signal and/or the second electrical signal Intensity, determining a matching result of the first data and the first reference data.
  • first,” “second,” “third,” and the like may be employed in the above-described embodiments to describe various modules, comparison units, data, reference data, elements, reference elements, ports (eg, comparison inputs) Port, comparison output port, input port, output port), optical switch, optical signal, electrical signal, for example, describing "first comparison input port”, “second comparison input port”, but should not be limited to these terms, and
  • the terms “a”, “second”, “third” and the like are used only to distinguish one another, and do not mean that there is a sequential relationship between them; for example, “first comparison input port” and “second comparison input port” do not represent The specific comparison input ports do not mean that there is a sequential relationship between them.
  • first and second are only used to distinguish the comparison input ports from each other without departing from the scope of the embodiments of the present invention.
  • the name can be exchanged for "first comparison input port”, “second comparison input port”, or “first comparison input port” can be renamed as “third comparison input port” ; Accordingly, in embodiments of the present invention, the terms “first”, “second,” and the like is not restricted.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Optical Communication System (AREA)

Abstract

A device and a method for comparing data. The device comprises a conversion module and a comparison module, the comparison module consisting of at least one comparison unit. Elements in reference data correspond to elements in first data one by one. The conversion module respectively generates, for each element included in first data, an optical signal of different wavelength, and distributes the optical signal to each comparison unit (801); different comparison units correspond to different reference data, each comparison unit compares the corresponding reference data thereof to the first data; a first comparison unit controls an optical signal, which has a wavelength corresponding to the element that is different in the first data and in first reference data, to be output from a first comparison output port, and control an optical signal, which has a wavelength corresponding to the element that is identical in the first data and in the first reference data, to be output from a second comparison output port (802). Said device achieves the comparison between the first data and one or more reference data.

Description

比较数据的设备和方法Apparatus and method for comparing data 技术领域Technical field
本发明实施例涉及数据处理领域,尤其涉及比较数据的设备和方法。Embodiments of the present invention relate to the field of data processing, and in particular, to an apparatus and method for comparing data.
背景技术Background technique
向量比较运算广泛应用在图像分类、字符检测、推荐系统等应用中。以推荐系统为例,为了将物品推荐给目标用户,往往需要找到和目标用户兴趣相似的历史用户集,从而需要对用户的兴趣相似度进行计算。用户兴趣可以按照用户对每个物品的喜好表示成向量的形式,例如,对某个物品感兴趣则表示成‘1’,对该个物品不感兴趣则表示成‘0’,对多个物品的兴趣可表示成多个‘1’和‘0’排列的向量,因此对用户的兴趣相似度进行计算就转化为对待比较向量(目标用户的兴趣)和参考向量(历史用户的兴趣)的向量比较运算;通常在一次向量比较运算中,是一次性将待比较向量同时与多个参考向量分别比较,批量完成向量比较运算。Vector comparison operations are widely used in applications such as image classification, character detection, and recommendation systems. Taking the recommendation system as an example, in order to recommend an item to a target user, it is often necessary to find a historical user set similar to the target user's interest, so that the user's interest similarity needs to be calculated. The user's interest can be expressed in the form of a vector according to the user's preference for each item. For example, if an item is interested, it is expressed as '1', and if the item is not interested, it is represented as '0', for multiple items. Interest can be represented as a plurality of '1' and '0' arranged vectors, so the calculation of the user's interest similarity translates into a vector comparison of the comparison vector (the target user's interest) and the reference vector (historical user's interest). Operation; usually in a vector comparison operation, the vector to be compared is compared with multiple reference vectors at a time, and the vector comparison operation is performed in batches.
现有技术,采用通用处理器完成向量比较运算,或者采用电学器件组建的向量比较系统实现;若采用通用处理器进行批量的向量比较运算,一次仅能计算与一个参考向量的比较结果,因此完成所有参考向量的比较耗时较长;若采用电学器件组建的向量比较系统进行批量的向量比较运算,由于电信号的传输受限于电子器件的RC(resistance capacitance)延时、电磁干扰等影响,并且工作主频和互连带宽都面临性能瓶颈。In the prior art, a vector processor is used to perform vector comparison operations, or a vector comparison system built by an electrical device is used; if a general-purpose processor is used for batch vector comparison operations, only a comparison result with one reference vector can be calculated at a time, thus completing The comparison of all reference vectors takes a long time; if the vector comparison system built by the electrical device is used for batch vector comparison operation, since the transmission of the electrical signal is limited by the RC (resistance capacitance) delay and electromagnetic interference of the electronic device, And the working frequency and interconnect bandwidth are facing performance bottlenecks.
发明内容Summary of the invention
有鉴于此,本申请提供了一种比较数据的设备和方法;该制备方法是采用光电子技术实现数据中每个元素同时与多个参考向量的比较。In view of this, the present application provides an apparatus and method for comparing data; the preparation method is to realize the comparison of each element in the data with multiple reference vectors simultaneously by using optoelectronic technology.
一方面,本申请提供一种比较数据的设备,该设备用于实现第一数据与一个或多个参考数据的比较,具体是比较参考数据中的元素与第一数据中的元 素,参考数据中的元素与第一数据中的元素一一对应。In one aspect, the application provides a device for comparing data, the device is configured to compare a first data with one or more reference data, and specifically compare an element in the reference data with a element in the first data. The elements in the reference data correspond one-to-one with the elements in the first data.
该设备包括转换模块和比较模块,比较模块由至少一个比较单元组成。该转换模块针对第一数据包含的各个元素,分别生成不同波长的光信号,并将光信号向每个所述比较单元分发。The device comprises a conversion module and a comparison module, the comparison module being composed of at least one comparison unit. The conversion module respectively generates optical signals of different wavelengths for respective elements included in the first data, and distributes the optical signals to each of the comparison units.
不同比较单元对应不同参考数据,每个比较单元将其对应的参考数据与第一数据比较;第一比较单元是指比较模块中任一个所述比较单元,第一参考数据是指与所述第一比较单元对应的参考数据;Different comparison units correspond to different reference data, each comparison unit compares its corresponding reference data with the first data; the first comparison unit refers to any one of the comparison units, and the first reference data refers to the first a reference data corresponding to the comparison unit;
以第一比较单元为例描述比较单元的工作原理;第一比较单元在比较第一数据中的元素与第一参考数据中对应的元素时,第一数据中的元素与第一参考数据中对应的元素相同时第一数据中的元素所对应的光信号,与第一数据中的元素与第一参考数据中对应的元素不相同时第一数据中的元素所对应的光信号,是从第一比较单元的不同比较输出端口输出的;第一比较单元可以控制第一数据中的多个元素与第一参考数据中对应的多个元素相同时第一数据中的多个元素分别对应的光信号,各自从不同比较输出端口输出或者从一个或多个比较输出端口输出,例如均从第一比较单元的第二比较输出端口输出;第一比较单元可以控制第一数据中的多个元素与第一参考数据中对应的多个元素不相同时第一数据中的多个元素分别对应的光信号,各自从不同比较输出端口输出或者从一个或多个比较输出端口输出,例如均从第一比较单元的第一比较输出端口输出。The first comparison unit is taken as an example to describe the working principle of the comparison unit. When the first comparison unit compares the element in the first data with the corresponding element in the first reference data, the element in the first data corresponds to the first reference data. When the elements are the same, the optical signal corresponding to the element in the first data is different from the corresponding element in the first reference data when the element in the first data is different, and the optical signal corresponding to the element in the first data is from the first a comparison unit outputting the output of the comparison unit; the first comparison unit may control the light corresponding to the plurality of elements in the first data when the plurality of elements in the first data are the same as the corresponding plurality of elements in the first reference data Signals, each outputted from a different comparison output port or outputted from one or more comparison output ports, for example, each outputted from a second comparison output port of the first comparison unit; the first comparison unit can control a plurality of elements in the first data When the corresponding plurality of elements in the first reference data are different, the optical signals corresponding to the plurality of elements in the first data respectively are respectively from different comparison outputs Or one or more output from comparator output port, a first comparison example are outputted from the output port of the first comparison unit.
可见,在本申请中,转换模块针对第一数据包含的各个元素,均生成了光信号,并且不同元素对应的光信号的波长不同;第一比较单元通过控制光走向的方式实现对第一数据的各个元素与第一参考数据中对应的元素作比较。第一数据的元素在第一参考数据中对应元素不相同时第一数据的元素所对应的光信号,与第一数据的元素在第一参考数据中对应元素相同时第一数据的元素所对应的光信号,是从不同比较输出端口输出的;因此本申请能够从不同比较输出端口,获知第一数据中哪些元素与第一参考数据相同,获知第一数据中哪些元素与第一参考数据不相同。It can be seen that, in the present application, the conversion module generates an optical signal for each element included in the first data, and the wavelengths of the optical signals corresponding to the different elements are different; the first comparison unit implements the first data by controlling the direction of the light. Each element is compared to a corresponding element in the first reference data. The element of the first data corresponds to an element of the first data when the corresponding element of the first reference data is different, and the element corresponding to the element of the first data is the same as the element of the first data when the corresponding element in the first reference data is the same The optical signals are output from different comparison output ports; therefore, the present application can learn from the different comparison output ports which elements in the first data are identical to the first reference data, and know which elements in the first data are not related to the first reference data. the same.
在一个可能设计中,若第一数据属于二进制数据,则第一数据中各个元 素不是为0就是为1;第一元素是指所述第一数据中的任一个元素,第一参考元素是指第一参考数据中与第一元素对应的元素。In a possible design, if the first data belongs to binary data, each element in the first data The prime element is either 0 or 1; the first element refers to any one of the first data, and the first reference element refers to an element corresponding to the first element in the first reference data.
所述第一比较单元具有第一比较输入端口、第二比较输入端口、所述第一比较输出端口、所述第二比较输出端口;The first comparison unit has a first comparison input port, a second comparison input port, the first comparison output port, and the second comparison output port;
所述转换模块在所述第一元素为1时,生成第一光信号,所述第一光信号属于具有所述第一元素对应的波长的光信号;向所述第一比较单元的第一比较输入端口输出第一光信号。所述转换模块在所述第一元素为0时,生成第二光信号,所述第二光信号属于具有所述第一元素对应的波长的光信号;向所述第一比较单元的第二比较输入端口输出第二光信号。The conversion module generates a first optical signal when the first element is 1, the first optical signal belongs to an optical signal having a wavelength corresponding to the first element, and the first to the first comparison unit The comparison input port outputs a first optical signal. The conversion module generates a second optical signal when the first element is 0, the second optical signal belongs to an optical signal having a wavelength corresponding to the first element, and to a second of the first comparison unit The comparison input port outputs a second optical signal.
所述第一比较单元在所述第一参考元素为0时,控制从所述第一比较输入端口输入的所述第一光信号从所述第一比较输出端口输出,控制从所述第二比较输入端口输入的所述第二光信号从所述第二比较输出端口输出;所述第一比较单元在所述第一参考元素为1时,控制从所述第一比较输入端口输入的所述第一光信号从所述第二比较输出端口输出,控制从所述第二比较输入端口输入的所述第二光信号从所述第一比较输出端口输出。The first comparing unit controls, when the first reference element is 0, to output the first optical signal input from the first comparison input port from the first comparison output port, and control from the second Comparing the second optical signal input to the input port from the second comparison output port; the first comparing unit controls the input from the first comparison input port when the first reference element is The first optical signal is output from the second comparison output port, and the second optical signal input from the second comparison input port is controlled to be output from the first comparison output port.
可见在本申请中,第一比较单元能够实现第一数据中的第一元素与第一参考数据中的第一参考元素的二进制数比较,并在比较结果为相同时从第二比较端口输出,在比较结果为不相同时从第一比较端口输出。It can be seen that, in the present application, the first comparing unit is capable of realizing a binary comparison of the first element in the first data with the first reference element in the first reference data, and outputting from the second comparison port when the comparison result is the same, It is output from the first comparison port when the comparison result is different.
在一个可能设计中,所述第一比较单元包括2×2光开关,所述2×2光开关具有第一输入端口、第二输入端口、第一输出端口、第二输出端口。如果所述第一比较单元包括的2×2光开关的个数为多个,多个所述多个2×2光开关串联,即在串联的相邻两个所述2×2光开关中,串联在前的2×2光开关的第一输出端口与串联在后的2×2光开关的第一输入端口连接,串联在前的2×2光开关的第二输出端口与串联在后的2×2光开关的第二输入端口连接。In one possible design, the first comparison unit includes a 2×2 optical switch having a first input port, a second input port, a first output port, and a second output port. If the first comparison unit includes a plurality of 2×2 optical switches, the plurality of the plurality of 2×2 optical switches are connected in series, that is, in two adjacent 2×2 optical switches connected in series The first output port of the front 2×2 optical switch is connected to the first input port of the second 2×2 optical switch connected in series, and the second output port of the front 2×2 optical switch is connected in series with the second output port The second input port of the 2 x 2 optical switch is connected.
所述第一比较单元包含的2×2光开关与所述第一参考数据包含的元素一一对应;第一比较单元中,一个光开关用于实现一个参考元素与第一数据中对应的元素的比较。第一光开关是指所述第一比较单元中与所述第一参考元素对应的2×2光开关。 The 2×2 optical switch included in the first comparison unit is in one-to-one correspondence with the element included in the first reference data; in the first comparison unit, an optical switch is used to implement a reference element and a corresponding element in the first data. Comparison. The first optical switch refers to a 2×2 optical switch corresponding to the first reference element in the first comparison unit.
所述第一光开关从所述第一光开关的第一输入端口接收所述第一比较输入端口输出的所述第一光信号;所述第一光开关在所述第一参考元素为0时,控制从所述第一光开关的第一输入端口输入的所述第一光信号从所述第一光开关的第一输出端口输出,使得所述第一比较单元从所述第一比较输出端口输出所述第一光信号;所述第一光开关在所述第一参考元素为1时,控制从所述第一光开关的第一输入端口输入的所述第一光信号从所述第一光开关的第二输出端口输出,使得所述第一比较单元从所述第二比较输出端口输出所述第一光信号。The first optical switch receives the first optical signal output by the first comparison input port from a first input port of the first optical switch; the first optical switch is 0 at the first reference element Controlling, by the first optical port input from the first input port of the first optical switch, from the first output port of the first optical switch, such that the first comparison unit is from the first comparison The output port outputs the first optical signal; the first optical switch controls the first optical signal input from the first input port of the first optical switch when the first reference element is 1. The second output port output of the first optical switch is such that the first comparison unit outputs the first optical signal from the second comparison output port.
所述第一光开关从所述第一光开关的第二输入端口接收所述第二比较输入端口输出的所述第二光信号;所述第一光开关控制在所述第一参考元素为0时,从所述第一光开关的第二输入端口输入的所述第二光信号从所述第一光开关的第二输出端口输出,使得所述第一比较单元从所述第二比较输出端口输出所述第二光信号;所述第一光开关在所述第一参考元素为1时,控制从所述第一光开关的第二输入端口输入的所述第二光信号从所述第一光开关的第一输出端口输出,使得所述第一比较单元从所述第一比较输出端口输出所述第二光信号。The first optical switch receives the second optical signal output by the second comparison input port from a second input port of the first optical switch; the first optical switch is controlled at the first reference element 0, the second optical signal input from the second input port of the first optical switch is output from the second output port of the first optical switch, such that the first comparison unit is compared from the second comparison The output port outputs the second optical signal; the first optical switch controls the second optical signal input from the second input port of the first optical switch when the first reference element is 1. The first output port of the first optical switch is output such that the first comparison unit outputs the second optical signal from the first comparison output port.
对于分别与第一光信号的波长和第二光信号的波长不同的第三光信号;所述第一光开关,若从所述第一光开关的第一输入端口接收所述第一比较输入端口输出的第三光信号,控制从所述第一光开关的第一输入端口输入的第三光信号从所述第一光开关的第一输出端口输出;若从所述第一光开关的第二输入端口接收所述第二比较输入端口输出的所述第三光信号,控制从所述第一光开关的第二输入端口输入的所述第三光信号从所述第一光开关的第二输出端口输出。a third optical signal different from a wavelength of the first optical signal and a second optical signal; the first optical switch receiving the first comparison input from a first input port of the first optical switch a third optical signal output by the port, controlling a third optical signal input from the first input port of the first optical switch to be output from the first output port of the first optical switch; if from the first optical switch The second input port receives the third optical signal output by the second comparison input port, and controls the third optical signal input from the second input port of the first optical switch from the first optical switch The second output port is output.
可见,第一光开关的工作波长为第一光信号的波长(即第二光信号的波长),因此第一光开关可改变第一光信号和第二光信号的走向;对于第三信号,因为第三信号的波长与第一光开关的工作波长不同,第一光开关不改变第三信号的走向。It can be seen that the working wavelength of the first optical switch is the wavelength of the first optical signal (ie, the wavelength of the second optical signal), so the first optical switch can change the direction of the first optical signal and the second optical signal; for the third signal, Since the wavelength of the third signal is different from the operating wavelength of the first optical switch, the first optical switch does not change the course of the third signal.
在一个可能设计中,所述转换模块包括表征模块、第一复用器、第一分发器、第二复用器、第二分发器。 In one possible design, the conversion module includes a characterization module, a first multiplexer, a first distributor, a second multiplexer, and a second distributor.
所述表征模块在所述第一元素为1时生成与所述第一元素对应的所述第一光信号,向所述第一复用器发送所述第一光信号;所述第一复用器从所述表征模块接收的一个或多个光信号(包括第一光信号)复用,向所述第一分发器输出复用所得的光信号;所述第一分发器将所述复用所得的光信号向各个所述比较单元分发,包括向所述第一比较单元的第一比较输入端口输出所述复用所得的光信号。The characterization module generates the first optical signal corresponding to the first element when the first element is 1, and sends the first optical signal to the first multiplexer; The one or more optical signals (including the first optical signal) received by the characterization module are multiplexed, and the multiplexed optical signal is output to the first distributor; the first distributor will Distributing the resulting optical signal to each of the comparison units includes outputting the multiplexed optical signal to a first comparison input port of the first comparison unit.
所述表征模块在所述第一元素为0时生成与所述第一元素对应的所述第二光信号,向所述第二复用器发送所述第二光信号;所述第二复用器将从所述表征模块接收的一个或多个光信号(包括第二光信号)复用,向所述第二分发器输出复用所得的光信号;所述第二分发器将所述复用所得的光信号向各个所述比较单元分发,包括向所述第一比较单元的第二比较输入端口输出所述复用所得的光信号。The characterization module generates the second optical signal corresponding to the first element when the first element is 0, and sends the second optical signal to the second multiplexer; The processor multiplexes one or more optical signals (including the second optical signal) received from the characterization module, and outputs the multiplexed optical signal to the second distributor; the second distributor will The multiplexed optical signal is distributed to each of the comparison units, including outputting the multiplexed optical signal to a second comparison input port of the first comparison unit.
表征模块在第一元素为不同二进制值时,生成不同的光信号,从而经不同复用器和分发器,由不同分发器发送至各个单元所具有的不同比较输入端口,以便比较单元针对不同比较输入端口输入的光信号采用不同方式控制光信号的走向。The characterization module generates different optical signals when the first element is a different binary value, and is sent by different distributors to different comparison input ports of the respective units via different multiplexers and distributors, so that the comparison unit compares for different comparisons. The optical signal input to the input port controls the direction of the optical signal in different ways.
在一个可能设计中,所述表征模块包括光电调制器,所述第一数据包含的元素与所述表征模块包括的光电调制器一一对应;即,所述表征模块中,一个光电调制器根据第一数据中对应元素的二进制值控制向第一复用器或者第二复用器输出光信号。In one possible design, the characterization module includes a photoelectric modulator, the first data comprising elements in one-to-one correspondence with the photoelectric modulators included in the characterization module; that is, one of the characterization modules, one photoelectric modulator is The binary value of the corresponding element in the first data controls the output of the optical signal to the first multiplexer or the second multiplexer.
第一光电调制器是指与所述第一元素对应的光电调制器,第一光电调制器具有第一光输出端口和第二光输出端口。所述第一光电调制器在所述第一元素为0时将表示所述第一元素的电信号调制成所述第二光信号,向所述第二复用器发送所述第二光信号。所述第一光电调制器在所述第一元素为1时将表示所述第一元素的电信号调制成所述第一光信号,向所述第一复用器发送所述第一光信号。The first optoelectronic modulator refers to an optoelectronic modulator corresponding to the first element, the first optoelectronic modulator having a first optical output port and a second optical output port. The first optoelectronic modulator modulates an electrical signal representing the first element into the second optical signal when the first element is 0, and transmits the second optical signal to the second multiplexer . The first optoelectronic modulator modulates an electrical signal representing the first element into the first optical signal when the first element is 1, and transmits the first optical signal to the first multiplexer .
可见,光电调制器具有双光输出端口,能够在第一数据的元素为不同二进制值时均能表达成光信号,并控制从不同双光输出端口不同二进制值对应的光信号。 It can be seen that the photoelectric modulator has a dual optical output port, which can be expressed as an optical signal when the elements of the first data are different binary values, and controls optical signals corresponding to different binary values from different dual optical output ports.
在一个可能设计中,所述设备还包括结果确定模块。结果确定模块接收所述第一比较单元从所述第一比较输出端口输出的光信号,并将所述第一比较输出端口输出的光信号转换为第一电信号,接收所述第一比较单元从所述第二比较输出端口输出的光信号,并将所述第二比较输出端口输出的光信号转换为第二电信号;所述结果确定模块根据所述第一电信号的强度和/或所述第二电信号的强度,确定所述第一数据与所述第一参考数据的匹配结果。In one possible design, the device further includes a result determination module. The result determining module receives the optical signal output by the first comparing unit from the first comparison output port, and converts the optical signal output by the first comparison output port into a first electrical signal, and receives the first comparing unit An optical signal output from the second comparison output port, and converting the optical signal output by the second comparison output port into a second electrical signal; the result determining module is based on the strength and/or the first electrical signal The strength of the second electrical signal determines a matching result of the first data and the first reference data.
可见,结果确定模块能够将光信号转换为电信号,从而能够根据电信号的强度来确定第一数据与第一参考数据的匹配结果,利用电信号相对于利用光信号确定匹配结果更加直观和方便。It can be seen that the result determining module can convert the optical signal into an electrical signal, so that the matching result of the first data and the first reference data can be determined according to the strength of the electrical signal, and the use of the electrical signal to determine the matching result with the optical signal is more intuitive and convenient. .
一方面,本申请提供一种比较数据的方法,所述方法适用的设备参见本申请在上述提供的比较数据的设备,在此不再赘述。所述方法中,所述转换模块将所述第一数据包含的各个元素对应表示为光信号的不同波长,向每个所述比较单元分别输出所述光信号;所述第一比较单元控制具有所述第一数据与所述第一参考数据不同的元素所对应波长的光信号从第一比较输出端口输出,控制具有所述第一数据与所述第一参考数据相同的元素所对应波长的光信号从第二比较输出端口输出。On the one hand, the present application provides a method for comparing data, and the device to which the method is applicable is referred to the device for comparing data provided in the above application, and details are not described herein again. In the method, the conversion module respectively represents each element included in the first data as a different wavelength of an optical signal, and outputs the optical signal to each of the comparison units separately; the first comparison unit controls have And outputting, by the first comparison output port, an optical signal of a wavelength corresponding to an element different from the first reference data, and controlling a wavelength corresponding to an element of the first data and the first reference data The optical signal is output from the second comparison output port.
在一个可能设计中,若所述第一数据为二进制数据,所述第一数据包含的元素为0或者1;第一元素是指所述第一数据中的任一个元素,第一参考元素是指所述第一参考数据中与所述第一元素对应的元素。In a possible design, if the first data is binary data, the first data includes an element of 0 or 1; the first element refers to any one of the first data, and the first reference element is Refers to an element in the first reference data that corresponds to the first element.
所述第一比较单元具有双输入端口和双输出端口,参见本申请上述对第一比较单元的描述。The first comparison unit has a dual input port and a dual output port. See the description of the first comparison unit described above in the present application.
所述转换模块将所述第一数据包含的各个元素对应表示为光信号的不同波长,向每个所述比较单元分别输出所述光信号,具体包括:所述转换模块在所述第一元素为1时,向所述第一比较单元的第一比较输入端口输出第一光信号,所述第一光信号属于具有所述第一元素对应的波长的光信号;所述转换模块在所述第一元素为0时,向所述第一比较单元的第二比较输入端口输出第二光信号,所述第二光信号属于具有所述第一元素对应的波长的光信号;The conversion module respectively indicates the respective elements included in the first data as different wavelengths of the optical signal, and respectively outputs the optical signals to each of the comparing units, specifically including: the converting module is in the first element When 1, the first optical signal is output to the first comparison input port of the first comparison unit, the first optical signal belongs to an optical signal having a wavelength corresponding to the first element; When the first element is 0, outputting a second optical signal to the second comparison input port of the first comparison unit, where the second optical signal belongs to an optical signal having a wavelength corresponding to the first element;
对应地,所述第一比较单元控制具有所述第一数据与所述第一参考数据不同的元素所对应波长的光信号从第一比较输出端口输出,控制具有所述第 一数据与所述第一参考数据相同的元素所对应波长的光信号从第二比较输出端口输出,具体包括:所述第一比较单元在所述第一参考元素为0时,控制从所述第一比较输入端口输入的所述第一光信号从所述第一比较输出端口输出,控制从所述第二比较输入端口输入的所述第二光信号从所述第二比较输出端口输出;所述第一比较单元在所述第一参考元素为1时,控制从所述第一比较输入端口输入的所述第一光信号从所述第二比较输出端口输出,控制从所述第二比较输入端口输入的所述第二光信号从所述第一比较输出端口输出。Correspondingly, the first comparison unit controls an optical signal having a wavelength corresponding to an element different from the first reference data to be output from a first comparison output port, and the control has the first An optical signal of a wavelength corresponding to the same element as the first reference data is output from the second comparison output port, and specifically includes: the first comparing unit controls, when the first reference element is 0, from the The first optical signal input by the first comparison input port is output from the first comparison output port, and the second optical signal input from the second comparison input port is controlled to be output from the second comparison output port; The first comparing unit controls to output the first optical signal input from the first comparison input port from the second comparison output port when the first reference element is 1, and control from the second The second optical signal input to the comparison input port is output from the first comparison output port.
在一个可能设计中,所述第一比较单元包括2×2光开关;第一比较单元中2×2光开关的结构关系,参见本申请上述描述,在此不再赘述。所述第一比较单元包含的2×2光开关与所述第一参考数据包含的元素一一对应;第一光开关是指所述第一比较单元中与所述第一参考元素对应的2×2光开关。所述比较数据的方法包括第一光开关的以下工作步骤。In a possible design, the first comparison unit includes a 2×2 optical switch; and the structure relationship of the 2×2 optical switch in the first comparison unit is described in the above description of the present application, and details are not described herein again. The 2×2 optical switch included in the first comparison unit is in one-to-one correspondence with the element included in the first reference data; the first optical switch refers to 2 corresponding to the first reference element in the first comparison unit. ×2 optical switch. The method of comparing data includes the following operational steps of the first optical switch.
所述第一光开关从所述第一光开关的第一输入端口接收所述第一比较输入端口输出的所述第一光信号;所述第一光开关在所述第一参考元素为0时,控制从所述第一光开关的第一输入端口输入的所述第一光信号从所述第一光开关的第一输出端口输出,使得所述第一比较单元从所述第一比较输出端口输出所述第一光信号;所述第一光开关在所述第一参考元素为1时,控制从所述第一光开关的第一输入端口输入的所述第一光信号从所述第一光开关的第二输出端口输出,使得所述第一比较单元从所述第二比较输出端口输出所述第一光信号。The first optical switch receives the first optical signal output by the first comparison input port from a first input port of the first optical switch; the first optical switch is 0 at the first reference element Controlling, by the first optical port input from the first input port of the first optical switch, from the first output port of the first optical switch, such that the first comparison unit is from the first comparison The output port outputs the first optical signal; the first optical switch controls the first optical signal input from the first input port of the first optical switch when the first reference element is 1. The second output port output of the first optical switch is such that the first comparison unit outputs the first optical signal from the second comparison output port.
所述第一光开关从所述第一光开关的第二输入端口接收所述第二比较输入端口输出的所述第二光信号;所述第一光开关在所述第一参考元素为0时,控制从所述第一光开关的第二输入端口输入的所述第二光信号从所述第一光开关的第二输出端口输出,使得所述第一比较单元从所述第二比较输出端口输出所述第二光信号;所述第一光开关在所述第一参考元素为1时,控制从所述第一光开关的第二输入端口输入的所述第二光信号从所述第一光开关的第一输出端口输出,使得所述第一比较单元从所述第一比较输出端口输出所述第二光信号。 The first optical switch receives the second optical signal output by the second comparison input port from a second input port of the first optical switch; the first optical switch is 0 at the first reference element Controlling, by the second optical port input from the second input port of the first optical switch, from the second output port of the first optical switch, such that the first comparison unit is from the second comparison The output port outputs the second optical signal; the first optical switch controls the second optical signal input from the second input port of the first optical switch when the first reference element is 1. The first output port of the first optical switch is output such that the first comparison unit outputs the second optical signal from the first comparison output port.
所述第三光信号的波长与所述第二光信号的波长不同,所述第三光信号的波长与所述第一光信号的波长不同。若所述第一光开关从所述第一光开关的第一输入端口接收所述第一比较输入端口输出的第三光信号,所述第一光开关控制从所述第一光开关的第一输入端口输入的第三光信号从所述第一光开关的第一输出端口输出。若所述第一光开关从所述第一光开关的第二输入端口接收所述第二比较输入端口输出的所述第三光信号,控制从所述第一光开关的第二输入端口输入的所述第三光信号从所述第一光开关的第二输出端口输出。The wavelength of the third optical signal is different from the wavelength of the second optical signal, and the wavelength of the third optical signal is different from the wavelength of the first optical signal. If the first optical switch receives the third optical signal output by the first comparison input port from the first input port of the first optical switch, the first optical switch controls the first optical switch from the first optical switch A third optical signal input to an input port is output from the first output port of the first optical switch. Controlling input from a second input port of the first optical switch if the first optical switch receives the third optical signal output by the second comparison input port from a second input port of the first optical switch The third optical signal is output from a second output port of the first optical switch.
在一个可能设计中,所述转换模块包括表征模块、第一复用器、第一分发器、第二复用器、第二分发器。所述比较数据的方法包括表征模块的以下工作步骤。In one possible design, the conversion module includes a characterization module, a first multiplexer, a first distributor, a second multiplexer, and a second distributor. The method of comparing data includes the following working steps of the characterization module.
所述表征模块在所述第一元素为0时生成与所述第一元素对应的所述第二光信号,向所述第二复用器发送所述第二光信号;所述第二复用器将从所述表征模块接收的光信号复用,向所述第二分发器输出复用所得的光信号;所述第二分发器将所述复用所得的光信号向各个所述比较单元分发,包括向所述第一比较单元的第二比较输入端口输出所述复用所得的光信号。The characterization module generates the second optical signal corresponding to the first element when the first element is 0, and sends the second optical signal to the second multiplexer; The processor multiplexes the optical signals received from the characterization module, and outputs the multiplexed optical signals to the second distributor; the second distributor compares the multiplexed optical signals to each of the comparisons The unit distribution includes outputting the multiplexed optical signal to a second comparison input port of the first comparison unit.
所述表征模块在所述第一元素为1时生成与所述第一元素对应的所述第一光信号,向所述第一复用器发送所述第一光信号;所述第一复用器将从所述表征模块接收的光信号复用,向所述第一分发器输出复用所得的光信号;所述第一分发器将所述复用所得的光信号向各个所述比较单元分发,包括向所述第一比较单元的第一比较输入端口输出所述复用所得的光信号。The characterization module generates the first optical signal corresponding to the first element when the first element is 1, and sends the first optical signal to the first multiplexer; The processor multiplexes the optical signals received from the characterization module, and outputs the multiplexed optical signals to the first distributor; the first distributor compares the multiplexed optical signals to each of the comparisons The unit distribution includes outputting the multiplexed optical signal to a first comparison input port of the first comparison unit.
在一个可能设计中,所述表征模块包括光电调制器,所述第一数据包含的元素与所述表征模块包括的光电调制器一一对应,第一光电调制器是指与所述第一元素对应的光电调制器,第一光电调制器具有第一光输出端口和第二光输出端口。所述比较数据的方法包括第一光电调制器的以下工作步骤。In one possible design, the characterization module includes a photoelectric modulator, the first data comprising elements in one-to-one correspondence with the photoelectric modulators included in the characterization module, the first photoelectric modulator being referred to as the first element A corresponding optoelectronic modulator, the first optoelectronic modulator having a first optical output port and a second optical output port. The method of comparing data includes the following operational steps of the first optoelectronic modulator.
所述第一光电调制器在所述第一元素为0时将表示所述第一元素的电信号调制成所述第二光信号,向所述第二复用器发送所述第二光信号;在所述第一元素为1时将表示所述第一元素的电信号调制成所述第一光信号,向所述第一复用器发送所述第一光信号。 The first optoelectronic modulator modulates an electrical signal representing the first element into the second optical signal when the first element is 0, and transmits the second optical signal to the second multiplexer And modulating an electrical signal representing the first element into the first optical signal when the first element is 1, and transmitting the first optical signal to the first multiplexer.
在一个可能设计中,所述设备还包括结果确定模块。所述比较数据的方法包括结果确定模块的以下工作步骤。In one possible design, the device further includes a result determination module. The method of comparing data includes the following working steps of the result determination module.
所述结果确定模块接收所述第一比较单元从所述第一比较输出端口输出的光信号,并将所述第一比较输出端口输出的光信号转换为第一电信号,接收所述第一比较单元从所述第二比较输出端口输出的光信号,并将所述第二比较输出端口输出的光信号转换为第二电信号;所述结果确定模块根据所述第一电信号的强度和/或所述第二电信号的强度,确定所述第一数据与所述第一参考数据的匹配结果。The result determining module receives the optical signal output by the first comparing unit from the first comparison output port, and converts the optical signal output by the first comparison output port into a first electrical signal, and receives the first Comparing, by the unit, the optical signal output from the second comparison output port, and converting the optical signal output by the second comparison output port into a second electrical signal; the result determining module is based on the intensity of the first electrical signal And / or the strength of the second electrical signal, determining a matching result of the first data and the first reference data.
附图说明DRAWINGS
图1为比较数据的设备的一种硬件结构示意图;1 is a schematic diagram of a hardware structure of a device for comparing data;
图2为比较数据的设备的一种硬件结构示意图;2 is a schematic diagram of a hardware structure of a device for comparing data;
图3为比较数据的设备的一种硬件结构示意图;3 is a schematic diagram of a hardware structure of a device for comparing data;
图4为第一比较单元控制光信号走向的示意图;4 is a schematic diagram of a first comparison unit controlling the direction of an optical signal;
图5为比较数据的设备的一种硬件结构示意图;FIG. 5 is a schematic diagram of a hardware structure of a device for comparing data;
图6为第一光电转换器生成光信号的示意图;6 is a schematic diagram of a first photoelectric converter generating an optical signal;
图7为比较数据的设备的工作示意图;Figure 7 is a schematic diagram of the operation of the device for comparing data;
图8为比较数据的方法的流程示意图。FIG. 8 is a flow chart showing a method of comparing data.
具体实施方式detailed description
下面将结合本发明实施例中的附图,对本发明实施例提供的技术方案进行描述。The technical solutions provided by the embodiments of the present invention are described below in conjunction with the accompanying drawings in the embodiments of the present invention.
本发明的设备实施例Apparatus embodiment of the present invention
比较数据的设备,采用光子器件构成,可以应用于批量比较参考数据的运算场景中;该比较数据的设备,既可以用作专用处理模块,又可以作为协处理器来加速比较计算。采用光子器件搭建该设备结构,提高了比较数据的运算效率和吞吐量。The device for comparing data is composed of photonic devices, and can be applied to a computing scenario in which reference data is compared in batches; the device for comparing data can be used as a dedicated processing module or as a coprocessor to accelerate comparison calculation. The photonic device is used to construct the device structure, which improves the computational efficiency and throughput of the comparison data.
本实施例中,参考数据由一个或多个元素组成,所述的元素可以是二进 制数、字符或者其他用于表征的符号,例如背景技术中采用二进制数‘1’表征对物品感兴趣,采用二进制数‘0’表征对物品不感兴趣,此处的二进制数‘1’或二进制数‘0’便是一个元素。In this embodiment, the reference data is composed of one or more elements, and the elements may be binary Numbers, characters, or other symbols used for characterization, such as the background art using a binary number '1' to characterize an item, using a binary number '0' to characterize the item, where the binary number '1' or binary The number '0' is an element.
待比较的数据中的元素与参考数据的元素类似,在此不再赘述;下面将待比较的数据称为第一数据。可选地,第一数据和参考数据可表示成向量形式,或者可以表示成数组形式。The elements in the data to be compared are similar to the elements of the reference data, and are not described here; the data to be compared is hereinafter referred to as the first data. Alternatively, the first data and the reference data may be represented in a vector form or may be represented in an array form.
所述参考数据包含的元素与第一数据包含的元素一一对应。本实施例中,将第一数据与参考数据比较,就是将第一数据包含的每个元素与参考数据中对应的元素比较,比较第一数据包含的元素与参考数据中对应的元素是否相同。The reference data includes elements that correspond one-to-one with the elements included in the first data. In this embodiment, comparing the first data with the reference data is to compare each element included in the first data with a corresponding element in the reference data, and compare whether the element included in the first data is the same as the corresponding element in the reference data.
第一元素是指所述第一数据中的任一个元素,第一参考元素是指第一参考数据中与所述第一元素对应的元素;本实施例对第一数据与第一参考数据作元素比较,具体是将第一元素与对应的第一参考元素比较。The first element refers to any one of the first data, and the first reference element refers to an element corresponding to the first element in the first reference data; in this embodiment, the first data and the first reference data are used. Element comparison, specifically comparing the first element with the corresponding first reference element.
通常,任何符号在计算机领域均能表示成二进制数据,为便于描述,本实施例以参考数据和第一数据均为二进制数据为例进行描述。即,若所述第一数据为二进制数据,所述第一数据包含的元素为0或者1,例如第一元素为0或者1;所述第一参考数据属于二进制数据,所述第一参考数据包含的元素为0或者1,例如第一参考元素为0或者1。In general, any symbol can be represented as binary data in the computer field. For convenience of description, the present embodiment describes the reference data and the first data as binary data as an example. That is, if the first data is binary data, the first data includes an element of 0 or 1, for example, the first element is 0 or 1; the first reference data belongs to binary data, and the first reference data The included element is 0 or 1, for example, the first reference element is 0 or 1.
参见图1,所述比较数据的设备包括比较模块,所述比较模块包括至少一个比较单元。不同所述比较单元对应不同参考数据;一个所述比较单元用于将一个参考数据与第一数据比较,因此多个所述比较单元可实现并行将第一数据与多个不同参考数据作比较。Referring to FIG. 1, the device for comparing data includes a comparison module, and the comparison module includes at least one comparison unit. Different comparison units correspond to different reference data; one of the comparison units is configured to compare one reference data with the first data, so that the plurality of comparison units can implement parallel comparison of the first data with a plurality of different reference data.
第一比较单元是指比较模块中任一个比较单元,本实施例所述的第一参考数据是指与第一比较单元对应的参考数据,即第一比较单元用于对第一参考数据与第一数据作比较。The first comparison unit refers to any one of the comparison units. The first reference data in this embodiment refers to reference data corresponding to the first comparison unit, that is, the first comparison unit is used to compare the first reference data with the first reference unit. A comparison of data.
参见图1,所述比较数据的设备包括转换模块。转换模块可可针对第一数据的不同元素,生成不同波长的光信号,向所述比较模块包括各个比较单元分发光信号。Referring to FIG. 1, the device for comparing data includes a conversion module. The conversion module may generate optical signals of different wavelengths for different elements of the first data, and include the respective illumination units by the comparison modules.
具体在本实施例中,转换模块将所述第一数据包含的各个元素对应表示 为光信号的不同波长,生成不同波长的光信号,向每个所述比较单元分别输出生成的光信号,包括向第一比较单元输出该光信号。Specifically, in this embodiment, the conversion module correspondingly represents each element included in the first data. Generating optical signals of different wavelengths for different wavelengths of the optical signal, respectively outputting the generated optical signals to each of the comparing units, including outputting the optical signals to the first comparing unit.
本实施例中,第一比较单元将第一数据的元素与第一参考数据中对应的元素比较,具体是指控制光信号的走向;对于第一数据的元素与第一参考数据中对应的元素不相同的场景,第一比较单元控制具有所述第一数据的元素所对应波长的光信号从第一比较输出端口输出;对于所述第一数据的元素与所述第一参考数据中对应的元素相同的场景,第一比较单元控制具有相同元素对应的波长的光信号从第一比较单元的第二比较输出端口输出。In this embodiment, the first comparing unit compares the element of the first data with the corresponding element in the first reference data, specifically, the direction of the control optical signal; for the element of the first data and the corresponding element in the first reference data a different comparison scenario, the first comparison unit controls the optical signal having the wavelength corresponding to the element of the first data to be output from the first comparison output port; for the element of the first data and the corresponding one of the first reference data The scene in which the elements are the same, the first comparison unit controls the optical signal having the wavelength corresponding to the same element to be output from the second comparison output port of the first comparison unit.
可见,针对第一数据包含的各个元素,转换模块均生成了光信号,是指不同元素对应的光信号的波长不同;第一比较单元通过控制光走向的方式实现实现对第一数据的各个元素与第一参考数据中对应的元素作比较。第一数据的元素在第一参考数据中不存在相同元素时,控制具有该元素对应的波长的光信号从第一比较输出端口输出;可见,能够从第一比较输出端口获知第一数据中哪些元素与第一参考数据不同。第一数据的元素在第一参考数据中存在相同元素时,控制具有该元素对应的波长的光信号从第二比较输出端口输出;可见,能够从第二比较输出端口获知第一数据中哪些元素与第一参考数据相同。It can be seen that, for each element included in the first data, the conversion module generates an optical signal, which means that the wavelengths of the optical signals corresponding to different elements are different; the first comparison unit realizes each element of the first data by controlling the direction of the light. Compare with the corresponding elements in the first reference data. When the element of the first data does not have the same element in the first reference data, the optical signal having the wavelength corresponding to the element is controlled to be output from the first comparison output port; it can be seen that which of the first data can be learned from the first comparison output port. The element is different from the first reference data. When the element of the first data has the same element in the first reference data, the optical signal controlling the wavelength corresponding to the element is output from the second comparison output port; it can be seen that which elements in the first data can be learned from the second comparison output port. Same as the first reference data.
可选地,比较模块中各个比较单元,均具有两个输入端口,和均具有两个输出端口,如图2所示。以第一比较单元为例,第一比较单元具有第一比较输入端口(图2表示为in1)、第二比较输入端口(图2表示为in2)、第一比较输出端口(图2表示为out1)、第二比较输出端口(图2表示为out2);第一比较输入端口、第二比较输入端口作为所述第一比较单元的两个输入端口,可接收光信号;第一比较输出端口、第二比较输出端口作为第一比较单元的两个输出端口,第一比较单元可控制光信号从第一比较输出端口和/或第二比较输出端口输出。Optionally, each comparison unit in the comparison module has two input ports, and each has two output ports, as shown in FIG. 2 . Taking the first comparison unit as an example, the first comparison unit has a first comparison input port (shown as in1 in FIG. 2), a second comparison input port (shown as in2 in FIG. 2), and a first comparison output port (FIG. 2 is shown as out1). a second comparison output port (shown as out2 in FIG. 2); the first comparison input port and the second comparison input port are used as two input ports of the first comparison unit to receive an optical signal; the first comparison output port, The second comparison output port serves as two output ports of the first comparison unit, and the first comparison unit can control the optical signal to be output from the first comparison output port and/or the second comparison output port.
下面以比较第一元素和第一参考元素为例,说明下转换模块如何向所述第一比较单元输入光信号,以及说明下第一比较单元如何控制光信号的走向。The following is an example of comparing the first element and the first reference element to explain how the down conversion module inputs an optical signal to the first comparison unit, and how the first comparison unit controls the direction of the optical signal.
所述转换模块,在所述第一元素为1时,向所述第一比较单元的第一比 较输入端口输出第一光信号,所述第一光信号属于具有所述第一元素对应的波长的光信号;所述转换模块,在所述第一元素为0时,向所述第一比较单元的第二比较输入端口输出第二光信号,所述第二光信号属于具有所述第一元素对应的波长的光信号。可见,第一光信号和第二光信号这两个光信号的波长相同,但输入所述第一比较单元的端口不同。The conversion module, when the first element is 1, a first ratio to the first comparison unit And outputting, by the input port, the first optical signal, the first optical signal belongs to an optical signal having a wavelength corresponding to the first element; and the converting module, when the first element is 0, to the first comparison The second comparison input port of the unit outputs a second optical signal that belongs to an optical signal having a wavelength corresponding to the first element. It can be seen that the two optical signals of the first optical signal and the second optical signal have the same wavelength, but the ports input to the first comparison unit are different.
第一比较单元,在所述第一参考元素为0时,控制从所述第一比较输入端口输入的所述第一光信号从所述第一比较输出端口输出,控制从所述第二比较输入端口输入的所述第二光信号从所述第二比较输出端口输出。a first comparing unit, when the first reference element is 0, controlling the first optical signal input from the first comparison input port to be output from the first comparison output port, and controlling from the second comparison The second optical signal input to the input port is output from the second comparison output port.
第一比较单元,在所述第一参考元素为1时,控制从所述第一比较输入端口输入的所述第一光信号从所述第二比较输出端口输出,控制从所述第二比较输入端口输入的所述第二光信号从所述第一比较输出端口输出。a first comparing unit, when the first reference element is 1, controlling the first optical signal input from the first comparison input port to be output from the second comparison output port, and controlling from the second comparison The second optical signal input to the input port is output from the first comparison output port.
进一步可选地,比较模块中的各个比较单元,可采用2×2光开关组合实现,如图3所示。比较单元中的2×2光开关,可以是基于硅基或者三五族材料的微环谐振器型的光开关,还可以是如光栅型的、多微环型的等窄带的2×2光开关,例如可以是MEMS等窄带的2×2光开关。Further optionally, each comparison unit in the comparison module can be implemented by using a 2×2 optical switch combination, as shown in FIG. 3 . The 2×2 optical switch in the comparison unit may be a micro-ring resonator type optical switch based on a silicon-based or a tri-five material, or may be a narrow-band 2×2 light such as a grating type or a multi-micro ring type. The switch can be, for example, a narrow band 2 x 2 optical switch such as a MEMS.
图3中,S表示2×2光开关;m,n均大于0的正整数;例如,由S11、S12、……、S1n这n个2×2光开关组成一个比较单元,由S21、S22、……、S2n这n个2×2光开关组成由一个比较单元;由Sm1、Sm2、……、Smn这n个2×2光开关组成第一比较单元。In Figure 3, S represents a 2 × 2 optical switch; m, n are positive integers greater than 0; for example, n 2 × 2 optical switches S11, S12, ..., S1n constitute a comparison unit, by S21, S22 The n 2×2 optical switches of S2n are composed of one comparison unit; the first comparison unit is composed of n 2×2 optical switches Sm1, Sm2, ..., Smn.
以第一比较单元为例,第一比较单元包含一个或多个2×2光开关,例如图3所示的第一比较单元包含n个2×2光开关。2×2光开关具有第一输入端口(图3表示为in3)、第二输入端口(图3表示为in4)、第一输出端口(图3表示为out3)、第二输出端口(图3表示为out4);第一输入端口、第二输入端口作为2×2光开关的两个输入端口,可接收光信号;第一输出端口、第二输出端口作为2×2光开关的两个输出端口。Taking the first comparison unit as an example, the first comparison unit includes one or more 2×2 optical switches, for example, the first comparison unit shown in FIG. 3 includes n 2×2 optical switches. The 2x2 optical switch has a first input port (shown as in3 in Figure 3), a second input port (shown as in4 in Figure 3), a first output port (shown as out3 in Figure 3), and a second output port (Figure 3 shows The first input port and the second input port serve as two input ports of the 2×2 optical switch, and can receive optical signals; the first output port and the second output port serve as two output ports of the 2×2 optical switch. .
第一比较单元包含的2×2光开关与第一参考数据包含的元素一一对应;例如在图3中,b表示参考数据中的元素,由bm1、bm2、……、bmn这n个元素表示第一参考数据;bm1、bm2、……、bmn依次对应Sm1、Sm2、……、 Smn。The 2×2 optical switch included in the first comparison unit is in one-to-one correspondence with the elements included in the first reference data; for example, in FIG. 3, b represents an element in the reference data, and the n elements are bm1, bm2, ..., bmn. Indicates first reference data; bm1, bm2, ..., bmn sequentially correspond to Sm1, Sm2, ..., Smn.
第一光开关是指所述第一比较单元中与所述第一参考元素对应的2×2光开关,例如在图3中,bm2表示第一参考元素,Sm2表示第一光开关。The first optical switch refers to a 2×2 optical switch corresponding to the first reference element in the first comparison unit. For example, in FIG. 3, bm2 represents a first reference element, and Sm2 represents a first optical switch.
第一比较单元包含的2×2光开关的个数等于第一参考数据包含的元素的个数,图3表示为n个。在第一参考数据和第一数据均仅包含1个元素的情况下,第一比较单元也只具有一个2×2光开关,该个2×2光开关的第一输入端口、第二输入端口、第一输出端口、第二输出端口对应为所述第一比较单元的第一比较输入端口、第二比较输入端口、第一比较输出端口、第二比较输出端口。The number of 2×2 optical switches included in the first comparison unit is equal to the number of elements included in the first reference data, and FIG. 3 represents n. In the case that the first reference data and the first data both contain only one element, the first comparison unit also has only one 2×2 optical switch, and the first input port and the second input port of the 2×2 optical switch The first output port and the second output port correspond to a first comparison input port, a second comparison input port, a first comparison output port, and a second comparison output port of the first comparison unit.
在第一参考数据和第一数据均包含多个元素的情况下,第一比较单元也对应包括多个2×2光开关,多个所述多个2×2光开关串联。多个所述多个2×2光开关串联的实现方式是:In a case where the first reference data and the first data each include a plurality of elements, the first comparison unit also correspondingly includes a plurality of 2×2 optical switches, and the plurality of the plurality of 2×2 optical switches are connected in series. The implementation of multiple of the plurality of 2×2 optical switches in series is:
在串联的多个2×2光开关中,第一个2×2光开关的第一输入端口和第二输入端口对应为第一比较单元的第一比较输入端口、第二比较输入端口,最后一个2×2光开关的第一输出端口和第二输出端口对应为第一比较单元的第一比较输出端口、第二比较输出端口;并且,在串联的相邻两个所述2×2光开关中,串联在前的2×2光开关的第一输出端口与串联在后的2×2光开关的第一输入端口连接,串联在前的2×2光开关的第二输出端口与串联在后的2×2光开关的第二输入端口连接。In a plurality of 2×2 optical switches connected in series, the first input port and the second input port of the first 2×2 optical switch correspond to the first comparison input port and the second comparison input port of the first comparison unit, and finally a first output port and a second output port of a 2×2 optical switch correspond to a first comparison output port and a second comparison output port of the first comparison unit; and, adjacent two 2×2 lights in series In the switch, the first output port of the 2×2 optical switch connected in series is connected to the first input port of the 2×2 optical switch connected in series, and the second output port of the 2×2 optical switch connected in series is connected in series Connected to the second input port of the rear 2 x 2 optical switch.
基于第一比较单元包含的2×2光开关与第一参考数据包含的元素的一一对应关系,以及第一参考数据包含的元素与第一数据包含的元素的一一对应关系,可以确定第一比较单元包含的2×2光开关与第一数据包含的元素的一一对应关系;基于第一比较单元包含的2×2光开关与第一数据包含的元素的一一对应关系,以及第一数据包含的元素与光信号的波长的一一对应关系,可以确定第一比较单元包含的2×2光开关与光信号的波长的一一对应关系;第一比较单元,可利用窄带的2×2光开关来控制具有该2×2光开关对应的波长的光信号的走向,例如利用第一光开关控制具有第一元素对应的波长的光信号的走向。The first correspondence relationship between the 2×2 optical switch included in the first comparison unit and the element included in the first reference data, and the one-to-one correspondence between the element included in the first reference data and the element included in the first data may determine a one-to-one correspondence between the 2×2 optical switch included in the comparison unit and the element included in the first data; a one-to-one correspondence between the 2×2 optical switch included in the first comparison unit and the element included in the first data, and the first A one-to-one correspondence between the elements of the data and the wavelength of the optical signal may determine a one-to-one correspondence between the wavelength of the 2×2 optical switch and the optical signal included in the first comparing unit; and the first comparing unit may utilize the narrow band 2 The ×2 optical switch controls the direction of the optical signal having the wavelength corresponding to the 2×2 optical switch, for example, using the first optical switch to control the direction of the optical signal having the wavelength corresponding to the first element.
以利用第一光开关控制具有第一元素对应的波长的光信号的走向为例, 第一比较单元将从第一比较输入端口(图3中的in1)接收的第一光信号,传输至所述第一光开关的第一输入端口(图3中的in3)。第一比较单元将从第二比较输入端口(图3中的in2)接收的第二光信号,传输至所述第一光开关的第二输入端口(图3中的in4)。Taking the direction of the optical signal having the wavelength corresponding to the first element by the first optical switch as an example, The first comparison unit transmits the first optical signal received from the first comparison input port (in1 in FIG. 3) to the first input port of the first optical switch (in3 in FIG. 3). The first comparison unit transmits a second optical signal received from the second comparison input port (in2 in FIG. 3) to the second input port of the first optical switch (in4 in FIG. 3).
所述第一光开关(图3中的Sm2),在所述第一参考元素(图3中的bm2)为0时,控制从所述第一光开关的第一输入端口(图3中的in3)输入的所述第一光信号从所述第一光开关的第一输出端口(图3中的out3)输出,使得所述第一比较单元从所述第一比较输出端口(图3中的out1)输出所述第一光信号,控制从所述第一光开关的第二输入端口(图3中的in4)输入的所述第二光信号从所述第一光开关的第二输出端口(图3中的out4)输出,使得所述第一比较单元从所述第二比较输出端口(图3中的out2)输出所述第二光信号;The first optical switch (Sm2 in FIG. 3) controls the first input port from the first optical switch when the first reference element (bm2 in FIG. 3) is 0 (in FIG. 3 In3) the input first optical signal is output from a first output port (out3 in FIG. 3) of the first optical switch, such that the first comparison unit is from the first comparison output port (in FIG. 3 Out1) outputting the first optical signal, controlling the second optical signal input from the second input port (in4 in FIG. 3) of the first optical switch from the second output of the first optical switch a port (out4 in FIG. 3) is output such that the first comparison unit outputs the second optical signal from the second comparison output port (out2 in FIG. 3);
所述第一光开关(图3中的Sm2),在所述第一参考元素(图3中的bm2)为1时,控制从所述第一光开关的第一输入端口(图3中的in3)输入的所述第一光信号从所述第一光开关的第二输出端口(图3中的out4)输出,使得所述第一比较单元从所述第二比较输出端口(图3中的out2)输出所述第一光信号,控制从所述第一光开关的第二输入端口(图3中的in4)输入的所述第二光信号从所述第一光开关的第一输出端口(图3中的out3)输出,使得所述第一比较单元从所述第一比较输出端口(图3中的out1)输出所述第二光信号。The first optical switch (Sm2 in FIG. 3) controls the first input port from the first optical switch when the first reference element (bm2 in FIG. 3) is 1. (in FIG. 3 In3) the input first optical signal is output from a second output port (out4 in FIG. 3) of the first optical switch, such that the first comparison unit is from the second comparison output port (FIG. 3) Out2) outputting the first optical signal, controlling the second optical signal input from the second input port (in4 in FIG. 3) of the first optical switch from the first output of the first optical switch The port (out3 in FIG. 3) is output such that the first comparison unit outputs the second optical signal from the first comparison output port (out1 in FIG. 3).
图3中的Sm2的工作原理示意图可参见图4。在bm2为0时,Sm2控制从in3输入的第一光信号从out3输出,使得所述第一比较单元从所述第一比较输出端口(图3中的out1)输出所述第一光信号,Sm2控制从in4输入的第二光信号从out4输出,使得所述第一比较单元从所述第二比较输出端口(图3中的out2)输出所述第二光信号。另外,在bm2为1时,Sm2控制从in3输入的所述第一光信号从out4输出,使得所述第一比较单元从所述第二比较输出端口(图3中的out2)输出所述第一光信号,Sm2控制从in4输入的所述第二光信号从out3输出,使得所述第一比较单元从所述第一比较输出端口(图3中的out1)输出所述第二光信号。 A schematic diagram of the operation of Sm2 in FIG. 3 can be seen in FIG. When bm2 is 0, Sm2 controls the first optical signal input from in3 to be output from out3, so that the first comparison unit outputs the first optical signal from the first comparison output port (out1 in FIG. 3), Sm2 controls the second optical signal input from in4 to be output from out4 such that the first comparison unit outputs the second optical signal from the second comparison output port (out2 in FIG. 3). Further, when bm2 is 1, Sm2 controls the first optical signal input from in3 to be output from out4, so that the first comparison unit outputs the first from the second comparison output port (out2 in FIG. 3) An optical signal, Sm2 controls the second optical signal input from in4 to be output from out3, such that the first comparison unit outputs the second optical signal from the first comparison output port (out1 in FIG. 3).
所述第三光信号的波长与所述第二光信号的波长不同,所述第三光信号的波长与所述第一光信号的波长不同。所述第一光开关不会阻碍第三光信号的通过,具体两种情况。The wavelength of the third optical signal is different from the wavelength of the second optical signal, and the wavelength of the third optical signal is different from the wavelength of the first optical signal. The first optical switch does not hinder the passage of the third optical signal, in particular two cases.
第一种情况,第一比较单元将从第一比较输入端口(图3中的in1)接收的第三光信号,传输至所述第一光开关(图3中的Sm2)的第一输入端口(图3中的in3);第一光开关控制从所述第一光开关的第一输入端口(图3中的in3)输入的第三光信号从所述第一光开关的第一输出端口(图3中的out3)输出;继而,第一比较单元中位于第一光开关后面的2×2光开关,控制具有该2×2光开关对应的波长的光信号的走向。In the first case, the first comparison unit transmits the third optical signal received from the first comparison input port (in1 in FIG. 3) to the first input port of the first optical switch (Sm2 in FIG. 3). (in3 in FIG. 3); the first optical switch controls a third optical signal input from a first input port (in3 in FIG. 3) of the first optical switch from a first output port of the first optical switch (out3 in Fig. 3) output; then, the 2x2 optical switch located behind the first optical switch in the first comparison unit controls the direction of the optical signal having the wavelength corresponding to the 2x2 optical switch.
第二种情况,第一比较单元将从第二比较输入端口(图3中的in2)接收的第三光信号,传输至所述第一光开关(图3中的Sm2)的第二输入端口(图3中的in4);第一光开关控制从所述第一光开关的第二输入端口(图3中的in4)输入的所述第三光信号从所述第一光开关的第二输出端口(图3中的out4)输出;继而,第一比较单元中位于第一光开关后面的2×2光开关,控制具有该2×2光开关对应的波长的光信号的走向。In the second case, the first comparison unit transmits a third optical signal received from the second comparison input port (in2 in FIG. 3) to the second input port of the first optical switch (Sm2 in FIG. 3). (in4 in FIG. 3); the first optical switch controls the third optical signal input from the second input port (in4 in FIG. 3) of the first optical switch from the second of the first optical switch An output port (out4 in FIG. 3) is output; then, a 2×2 optical switch located behind the first optical switch in the first comparison unit controls the direction of the optical signal having the wavelength corresponding to the 2×2 optical switch.
参见图3,所述转换模块包括表征模块、第一复用器、第一分发器、第二复用器、第二分发器;表征模块可向第一复用器和/或第二复用器发送光信号;第一复用器可向第一分发器发送光信号,以便第一分发器将光信号分发至比较模块中的各个比较单元;第二复用器可向第二分发器发送光信号,以便第二分发器将光信号分发至比较模块中的各个比较单元。由于第一复用器、第一分发器、比较单元之间的光通道,和由于第二复用器、第二分发器、比较单元之间的光通道,均可以承载几千个不同波长的光信号,因此可以一次性支持几千个元素的比较。Referring to FIG. 3, the conversion module includes a characterization module, a first multiplexer, a first distributor, a second multiplexer, and a second distributor; the characterization module can be to the first multiplexer and/or the second multiplexer Transmitting the optical signal; the first multiplexer may send the optical signal to the first distributor such that the first distributor distributes the optical signal to each of the comparison units in the comparison module; the second multiplexer may send the second multiplexer to the second distributor The optical signal is such that the second distributor distributes the optical signal to each of the comparison units in the comparison module. Due to the optical channel between the first multiplexer, the first distributor, the comparison unit, and the optical channel between the second multiplexer, the second distributor, and the comparison unit, it can carry thousands of different wavelengths Optical signals, so you can support the comparison of thousands of elements at a time.
下面以第一元素为例介绍表征模块的工作原理;所述表征模块在所述第一元素为1时生成与所述第一元素对应的所述第一光信号,向所述第一复用器发送所述第一光信号;所述表征模块在所述第一元素为0时生成与所述第一元素对应的所述第二光信号,向所述第二复用器发送所述第二光信号。The working principle of the characterization module is described by taking the first element as an example. The characterization module generates the first optical signal corresponding to the first element when the first element is 1, to the first multiplexing. Transmitting the first optical signal; the characterization module generates the second optical signal corresponding to the first element when the first element is 0, and sends the second optical signal to the second multiplexer Two light signals.
所述表征模块将第一数据中的为1的各个元素所对应的光信号(包括第一光信号),发送至第一复用器;所述第一复用器将从所述表征模块接收的 一个或多个光信号复用,向所述第一分发器输出复用所得的光信号;所述第一分发器将所述复用所得的光信号向各个所述比较单元分发,包括向所述第一比较单元的第一比较输入端口输出所述复用所得的光信号。The characterization module transmits an optical signal (including the first optical signal) corresponding to each element of the first data to the first multiplexer; the first multiplexer will receive from the characterization module of And multiplexing the one or more optical signals, and outputting the multiplexed optical signals to the first distributor; the first distributor distributing the multiplexed optical signals to each of the comparing units, including The first comparison input port of the first comparison unit outputs the multiplexed optical signal.
所述表征模块将第一数据中的为0的各个元素所对应的光信号(包括第二光信号),发送至第二复用器;所述第二复用器将从所述表征模块接收的一个或多个光信号复用,向所述第二分发器输出复用所得的光信号;所述第二分发器将所述复用所得的光信号向各个所述比较单元分发,包括向所述第一比较单元的第二比较输入端口输出所述复用所得的光信号。The characterization module transmits an optical signal (including a second optical signal) corresponding to each element of 0 in the first data to a second multiplexer; the second multiplexer will receive from the characterization module And multiplexing the one or more optical signals, outputting the multiplexed optical signal to the second distributor; the second distributor distributing the multiplexed optical signal to each of the comparing units, including The second comparison input port of the first comparison unit outputs the multiplexed optical signal.
可选地,所述表征模块由光电调制器组成,如图5所示,用M表示光电调制器;图5示出的表征模块,由M1、M2、……、Mn这n个光电调制器组成。Optionally, the characterization module is composed of a photoelectric modulator, as shown in FIG. 5, the photoelectric modulator is represented by M; the characterization module shown in FIG. 5, the n photoelectric modulators of M1, M2, ..., Mn composition.
所述第一数据包含的元素与所述表征模块包括的光电调制器一一对应;图3中,a表示第一数据中的元素,由图3示出的a1、a2、……、an组成第一数据;图3中的a1、a2、……、an,依次与图3中的M1、M2、……、Mn一一对应。The first data comprises elements in one-to-one correspondence with the photoelectric modulators included in the characterization module; in FIG. 3, a represents elements in the first data, and is composed of a1, a2, ..., an shown in FIG. The first data; a1, a2, ..., an in FIG. 3 are in turn corresponding to M1, M2, ..., Mn in FIG.
第一光电调制器(图5中的M2)是指与所述第一元素(图5中的a2)对应的光电调制器,第一光电调制器具有第一光输出端口(图5中的out5)和第二光输出端口(图5中的out6)。在满足第一光电调制器具有两个输出端口(第一光输出端口和第二光输出端口)及上述光电调制功能的条件下,对具体采用哪种类型的光电调制器以及具体采用哪种型号的光电调制器作为第一光电调制器,均不构成对本发明实施例的限定。The first photoelectric modulator (M2 in FIG. 5) refers to a photoelectric modulator corresponding to the first element (a2 in FIG. 5), and the first photoelectric modulator has a first light output port (out5 in FIG. 5) And the second light output port (out6 in Figure 5). Under the condition that the first photoelectric modulator has two output ports (the first light output port and the second light output port) and the above photoelectric modulation function, which type of photoelectric modulator is specifically adopted and which model is specifically adopted The photoelectric modulator as the first photoelectric modulator does not constitute a limitation on the embodiment of the present invention.
图5中,λ表示光信号的波长,λ1光源是指向M1提供波长为λ1的光信号,λ2光源是指向M2提供波长为λ2的光信号,以此类推,λn光源是指向Mn提供波长为λn的光信号。下面以第一元素(图5中的a2)为例介绍第一光电调制器(图5中的M2)的工作原理:In Fig. 5, λ represents the wavelength of the optical signal, the λ1 source is the optical signal of the wavelength λ1 directed to M1, the λ2 source is the optical signal of the wavelength λ2 directed to M2, and so on, and the λn source is directed to Mn to provide the wavelength λn Light signal. The following describes the working principle of the first photoelectric modulator (M2 in Fig. 5) by taking the first element (a2 in Fig. 5) as an example:
所述第一光电调制器(图5中的M2)在所述第一元素(图5中的a2)为0时将表示所述第一元素的电信号调制成第二光信号,第二光信号的波长为λ2,从第二光输出端口(图5中的out6)向所述第二复用器发送所述第二光信号;The first photoelectric modulator (M2 in FIG. 5) modulates an electrical signal representing the first element into a second optical signal when the first element (a2 in FIG. 5) is 0, and the second light The wavelength of the signal is λ2, and the second optical signal is transmitted from the second optical output port (out6 in FIG. 5) to the second multiplexer;
所述第一光电调制器(图5中的M2)在所述第一元素(图5中的a2)为 1时将表示所述第一元素的电信号调制成所述第一光信号,第一光信号的波长为λ2,从第一光输出端口(图5中的out5)向所述第一复用器发送所述第一光信号。The first photoelectric modulator (M2 in FIG. 5) is at the first element (a2 in FIG. 5) 1 when an electrical signal representing the first element is modulated into the first optical signal, the wavelength of the first optical signal is λ2, from the first optical output port (out5 in FIG. 5) to the first multiplexing The transmitter transmits the first optical signal.
图5中的M2的工作原理示意图可参见图6。图6中,M2在a2为1时将表示1的电信号调制成第一光信号,第一光信号由λ2光源提供,从out5向所述第一复用器发送所述第一光信号。图6中,M2在a2为0时将表示0的电信号调制成第二光信号,第二光信号由λ2光源提供,从out6向所述第二复用器发送第二光信号。A schematic diagram of the operation of M2 in FIG. 5 can be seen in FIG. In Fig. 6, M2 modulates an electrical signal representing 1 into a first optical signal when a2 is 1, the first optical signal being provided by a λ2 light source, and transmitting the first optical signal from out5 to the first multiplexer. In Fig. 6, M2 modulates an electrical signal representing 0 into a second optical signal when a2 is 0, the second optical signal is provided by a λ2 light source, and transmits a second optical signal from out6 to the second multiplexer.
可见,第一光信号与第二光信号的相同点是波长相同,原因是都是根据λ2光源提供的光信号进行调制的。使用“第一”和“第二”区分“第一光信号”与“第二光信号”的原因是:第一光信号由第一光电调制器控制从第一光输出端口(图5中的out5)输出的,第二光信号由第一光电调制器控制从第二光输出端口(图5中的out6)输出的。It can be seen that the same point of the first optical signal and the second optical signal is the same wavelength, because they are all modulated according to the optical signal provided by the λ2 light source. The reason for distinguishing the "first optical signal" from the "second optical signal" using "first" and "second" is that the first optical signal is controlled by the first optical modulator from the first optical output port (in FIG. 5 Out5) output, the second optical signal is output by the first optical modulator from the second optical output port (out6 in Fig. 5).
参见图5,比较模块中的各个比较单元可以连接结果确定模块;以第一比较单元为例,第一比较单元可以从第一比较输出端口(图5中的out1)向结果确定模块发送光信号;结果确定模块接收所述第一比较单元从所述第一比较输出端口发送的光信号,并将该光信号转换为第一电信号。第一比较单元可以从第二比较输出端口(图5中的out2)向结果确定模块发送光信号;结果确定模块接收所述第一比较单元从所述第二比较输出端口输出的光信号,并将该光信号转换为第二电信号。Referring to FIG. 5, each comparison unit in the comparison module may be connected to the result determination module. Taking the first comparison unit as an example, the first comparison unit may send an optical signal from the first comparison output port (out1 in FIG. 5) to the result determination module. The result determination module receives the optical signal transmitted by the first comparison unit from the first comparison output port, and converts the optical signal into a first electrical signal. The first comparison unit may transmit an optical signal from the second comparison output port (out2 in FIG. 5) to the result determination module; the result determination module receives the optical signal output by the first comparison unit from the second comparison output port, and The optical signal is converted to a second electrical signal.
所述结果确定模块可以根据所述第一电信号的强度和/或所述第二电信号的强度,确定所述第一数据与所述第一参考数据的匹配结果。例如,如果第一电信号的强度接近零,可确定为第一数据与第一参考数据相同;如果第二电信号的强度大于第一电信号的强度,可确定为第一数据与第一参考数据的匹配率在50%以上。The result determining module may determine a matching result of the first data and the first reference data according to an intensity of the first electrical signal and/or an intensity of the second electrical signal. For example, if the intensity of the first electrical signal is close to zero, it may be determined that the first data is the same as the first reference data; if the intensity of the second electrical signal is greater than the strength of the first electrical signal, the first data and the first reference may be determined. The data matching rate is above 50%.
以此类推,所述结果确定模块可根据各个比较单元输出的光信号,确定第一数据与该比较单元对应的参考数据的匹配结果。甚至还可以设定特定规则,根据比较单元输出的光信号所得的匹配结果作进行相互比较,采用该特定规则分析比较结果,确定与第一数据相似度最高的参考数据,确定与第一 数据相似度最低的参考数据,确定与第一数据相同的参考数据确定与第一数据满足一定相似度阈值的参考数据等。And so on, the result determining module may determine, according to the optical signal output by each comparing unit, a matching result of the first data and the reference data corresponding to the comparing unit. It is even possible to set a specific rule, and compare the matching results obtained by the optical signals output by the comparison unit with each other, and use the specific rule to analyze the comparison result, and determine the reference data with the highest similarity with the first data, and determine the first The reference data having the lowest data similarity determines the same reference data as the first data, and determines reference data that satisfies a certain similarity threshold with the first data.
下面举例详述下第一数据的比较过程,图7示出了参与比较过程的各个模块。相对于图5,本例在图7中具体以n为4、m为3为例进行比较过程描述。假设n为4、m为3的情况下,对应地确定第一数据包含4个元素,本例采用向量A表示第一数据为[1010];对应地确定四个光电调制器,包括M1、M2、M3、M4;对应地确定为M1、M2、M3、M4依次提供光源的四个光源为λ1光源、λ2光源、λ3光源、λ4光源。图7所示的第一个比较单元中,光开关S11、光开关S12、光开关S13、光开关S14是依次排列,应知,还可以按照其他排列方式在第一个比较单元中组织光开关S11、光开关S12、光开关S13、光开关S14的先后顺序。The following is a detailed description of the comparison process of the first data, and FIG. 7 shows the various modules participating in the comparison process. With respect to FIG. 5, the present example is described in detail in FIG. 7 with n being 4 and m being 3 as an example. Assuming that n is 4 and m is 3, it is correspondingly determined that the first data contains 4 elements. In this example, the vector A is used to indicate that the first data is [1010]; correspondingly, four photoelectric modulators, including M1 and M2, are determined. M3, M4; correspondingly determined as M1, M2, M3, M4, the four light sources sequentially providing the light source are a λ1 light source, a λ2 light source, a λ3 light source, and a λ4 light source. In the first comparison unit shown in FIG. 7, the optical switch S11, the optical switch S12, the optical switch S13, and the optical switch S14 are sequentially arranged. It should be understood that the optical switch can be organized in the first comparison unit according to other arrangements. S11, optical switch S12, optical switch S13, optical switch S14 sequence.
第一数据包含4个元素,相应地参考数据也包含4个元素,如图7示出了三个参考数据,分别为:[1001],[1010],[0101]。The first data contains 4 elements, and the reference data also contains 4 elements. As shown in FIG. 7, three reference data are shown: [1001], [1010], [0101].
详述以比较[1010]与[1001]为例的比较过程,如下:The comparison process comparing [1010] and [1001] is described in detail as follows:
第一数据的第一个元素a1为1,M1将表示a1的电信号调制成表示波长为λ1的光信号,并从第一光输出端口向第一复用器输出波长为λ1的光信号。该光信号经过第一复用器和第一分束器后,被第一分束器分发到每个比较单元中。以第一个比较单元为例,参考向量为[1001];光开关S11的第一输出端口为第一个比较单元的第一比较输入端口;当波长为λ1的光信号从光开关S11的第一输出端口输入时,由于光开关S11的工作波长为λ1,光开关S11根据参考向量中的第一个元素1,控制从光开关S11的第一输入端口输入的波长为λ1的光信号将从光开关S11的第二输出端口输出;光开关S11控制从光开关S11的第一输入端口输入的其他波长的光信号,从光开关S11的第一输出端口输出;光开关S11控制从光开关S11的第二输入端口输入的其他波长的光信号,从光开关S11的第二输出端口输出。该波长为λ1的光信号从光开关S12的第二输入端口输入,由于光开关S12的工作波长为λ2,光开关S12将波长为λ1的光信号从第二输出端口输出;以此类推,该波长为λ1的光信号会依次通过光开关S13的第二输入端口、第二输出端口, 再依次通过光开关S14的第二输入端口、第二输出端口;其中,第二输出端口即为第一个比较单元的第二比较输出端口。The first element a1 of the first data is 1, and M1 modulates the electrical signal representing a1 into an optical signal representing the wavelength λ1, and outputs an optical signal of wavelength λ1 from the first optical output port to the first multiplexer. After passing through the first multiplexer and the first beam splitter, the optical signal is distributed by the first beam splitter to each comparison unit. Taking the first comparison unit as an example, the reference vector is [1001]; the first output port of the optical switch S11 is the first comparison input port of the first comparison unit; when the optical signal of the wavelength λ1 is from the optical switch S11 When an output port is input, since the operating wavelength of the optical switch S11 is λ1, the optical switch S11 controls the optical signal of the wavelength λ1 input from the first input port of the optical switch S11 according to the first element 1 in the reference vector. The second output port of the optical switch S11 is output; the optical switch S11 controls the optical signals of other wavelengths input from the first input port of the optical switch S11, and is output from the first output port of the optical switch S11; the optical switch S11 controls the slave optical switch S11 The optical signal of the other wavelength input by the second input port is output from the second output port of the optical switch S11. The optical signal of the wavelength λ1 is input from the second input port of the optical switch S12. Since the operating wavelength of the optical switch S12 is λ2, the optical switch S12 outputs the optical signal of the wavelength λ1 from the second output port; and so on. The optical signal with the wavelength λ1 passes through the second input port and the second output port of the optical switch S13 in sequence. Then, the second output port and the second output port of the optical switch S14 are sequentially passed through; wherein the second output port is the second comparison output port of the first comparison unit.
第一数据的第二个元素a2为0,M2将表示a2的电信号调制成表示波长为λ2的光信号,并从第二光输出端口向第二复用器输出波长为λ2的光信号。由于λ2非光开关S11的工作波长,波长为λ2的光信号依次经过光开关S11的第二输入端口、第二输出端口,进入到光开关S12的第二输入端口。λ2为光开关S12的工作波长,由于参考向量[1001]的第二个元素为0,光开关S12控制从光开关S12的第二输入端口输入的波长为λ2的光信号从从第二输出端口输出。因为光开关S13的工作波长和光开关S14的工作波长均不为λ2,波长为λ2的光信号依次通过光开关S13的第二输入端口、第二输出端口,再依次通过光开关S14的第二输入端口、第二输出端口;光开关S14的第二输出端口即为第一个比较单元的第二比较输出端口。The second element a2 of the first data is 0, and M2 modulates the electrical signal representing a2 into an optical signal representing the wavelength λ2, and outputs an optical signal of wavelength λ2 from the second optical output port to the second multiplexer. Due to the operating wavelength of the λ2 non-optical switch S11, the optical signal of the wavelength λ2 sequentially passes through the second input port and the second output port of the optical switch S11, and enters the second input port of the optical switch S12. Λ2 is the operating wavelength of the optical switch S12. Since the second element of the reference vector [1001] is 0, the optical switch S12 controls the optical signal of the wavelength λ2 input from the second input port of the optical switch S12 from the second output port. Output. Because the operating wavelength of the optical switch S13 and the operating wavelength of the optical switch S14 are not λ2, the optical signal of the wavelength λ2 sequentially passes through the second input port and the second output port of the optical switch S13, and sequentially passes through the second input of the optical switch S14. The port, the second output port; the second output port of the optical switch S14 is the second comparison output port of the first comparison unit.
以此类推,第一数据的第三个元素a3为1,M3将表示a3的电信号调制成表示波长为λ3的光信号,并从第一光输出端口向第一复用器输出波长为λ3的光信号。由于光开关S13的工作波长为λ3,光开关S11、光开关S12、光开关S14的工作波长均不为λ3,因此,波长为λ3的光信号会依次经过光开关S11的第一输入端口、第一输出端口,再依次经过光开关S12的第一输入端口、第一输出端口;由于参考向量为[1001]的第三个元素为0,光开关S13会控制从第一输入端口输入的波长为λ3的光信号,从第一输出端口输出;最后,波长为λ3的光信号依次经过光开关S14的第一输入端口、第一输出端口;光开关S14的第一输出端口即为第一个比较单元的第一比较输出端口。By analogy, the third element a3 of the first data is 1, and M3 modulates the electrical signal representing a3 into an optical signal representing the wavelength λ3, and outputs the wavelength λ3 from the first optical output port to the first multiplexer. Light signal. Since the operating wavelength of the optical switch S13 is λ3, the operating wavelengths of the optical switch S11, the optical switch S12, and the optical switch S14 are not λ3. Therefore, the optical signal with the wavelength λ3 passes through the first input port of the optical switch S11 in sequence. An output port, which in turn passes through the first input port and the first output port of the optical switch S12; since the third element of the reference vector [1001] is 0, the optical switch S13 controls the wavelength input from the first input port to be The optical signal of λ3 is output from the first output port; finally, the optical signal of wavelength λ3 sequentially passes through the first input port and the first output port of the optical switch S14; the first output port of the optical switch S14 is the first comparison The first comparison output port of the unit.
以此类推,第一数据的第四个元素a4为0,M4将表示a4的电信号调制成表示波长为λ4的光信号,并从第二光输出端口向第二复用器输出波长为λ4的光信号。由于光开关S14的工作波长为λ4,光开关S11、光开关S12、光开关S13的工作波长均不为λ4,因此,波长为λ4的光信号会依次经过光开关S11的第二输入端口、第二输出端口,再依次经过光开关S12的第二输入端口、第二输出端口,再依次经过光开关S13的第二输入端口、第二输出端口;由于参考向量为[1001]的第四个元素为1,光开关S14会控制从第 二输入端口输入的波长为λ4的光信号,从第一输出端口输出;光开关S14的第一输出端口即为第一个比较单元的第一比较输出端口。By analogy, the fourth element a4 of the first data is 0, and M4 modulates the electrical signal representing a4 into an optical signal representing the wavelength λ4, and outputs the wavelength λ4 from the second optical output port to the second multiplexer. Light signal. Since the operating wavelength of the optical switch S14 is λ4, the operating wavelengths of the optical switch S11, the optical switch S12, and the optical switch S13 are not λ4. Therefore, the optical signal with the wavelength λ4 passes through the second input port of the optical switch S11 in sequence. The second output port passes through the second input port and the second output port of the optical switch S12 in turn, and then passes through the second input port and the second output port of the optical switch S13 in sequence; since the reference vector is the fourth element of [1001] For 1, the optical switch S14 will control from the first The optical signal of the wavelength λ4 input by the two input ports is output from the first output port; the first output port of the optical switch S14 is the first comparison output port of the first comparison unit.
可见,[1010]与[1001]比较,前两个元素相同,波长为λ1的光信号、波长为λ2的光信号均从第一个比较单元的第二比较输出端口。以此类推,第一数据中的元素和参考向量的元素相同时,比较单元控制具有相同元素对应的波长的光信号从第二比较输出端口输出。It can be seen that [1010] compared with [1001], the first two elements are the same, and the optical signal of wavelength λ1 and the optical signal of wavelength λ2 are all from the second comparison output port of the first comparison unit. By analogy, when the elements in the first data and the elements of the reference vector are the same, the comparison unit controls the optical signals having the wavelengths corresponding to the same elements to be output from the second comparison output port.
可见,[1010]与[1001]比较,后两个元素不相同,波长为λ3的光信号、波长为λ4的光信号均从第一个比较单元的第一比较输出端口。以此类推,第一数据中的元素和参考数据的元素不相同时,比较单元控制具有第一数据中的元素所对应的波长的光信号从第一比较输出端口输出。It can be seen that [1010] compared with [1001], the latter two elements are different, and the optical signal of wavelength λ3 and the optical signal of wavelength λ4 are all from the first comparison output port of the first comparison unit. By analogy, when the elements in the first data and the elements of the reference data are different, the comparison unit controls the optical signal having the wavelength corresponding to the element in the first data to be output from the first comparison output port.
例如图7中,[1010]与[1010]比较时,波长为λ1的光信号、波长为λ2的光信号、波长为λ3的光信号、波长为λ4的光信号均从第二个比较单元的第二比较输出端口输出;[1010]与[0101]比较时,波长为λ1的光信号、波长为λ2的光信号、波长为λ3的光信号、波长为λ4的光信号均从第三个比较单元的第一比较输出端口输出。For example, in FIG. 7, when [1010] is compared with [1010], an optical signal having a wavelength of λ1, an optical signal having a wavelength of λ2, an optical signal having a wavelength of λ3, and an optical signal having a wavelength of λ4 are all from the second comparison unit. Second comparison output port output; [1010] When compared with [0101], the optical signal of wavelength λ1, the optical signal of wavelength λ2, the optical signal of wavelength λ3, and the optical signal of wavelength λ4 are all compared from the third The first comparison output port output of the unit.
由此可见,比较单元的第二输出端口的光强大小表示了第一数据与参考数据的相似度;当第一数据和参考数据相同时,比较单元的第一比较输出端口无光信号输出,比较单元的第二比较输出端口输出最大强度的光信号;当第一数据和参考数据不相同时,比较单元的第二比较输出端口无光信号输出,比较单元的第一比较输出端口输出最大强度的光信号。由上可以看出,通过将第一数据采用双端口的电光调制器的输出状态表示,并且通过双端口的光开关进行计算,可一次性实现对第一数据的所有元素的比较运算,大大提高了数据处理效率。另外,由于光通道的低衰减和易于广播特性,比较数据的设备可以集成多个比较单元,实现多个比较单元同时进行多个参考数据与第一数据的批量并行运算;由于光子器件不受传输延时、电磁干扰等的影响,比较数据的设备实现一次数据比较的处理速度可以达到纳秒(ns)量级甚至更高。It can be seen that the intensity of the second output port of the comparison unit indicates the similarity between the first data and the reference data; when the first data and the reference data are the same, the first comparison output port of the comparison unit outputs no optical signal, The second comparison output port of the comparison unit outputs the optical signal of the maximum intensity; when the first data and the reference data are different, the second comparison output port of the comparison unit outputs no optical signal, and the first comparison output port of the comparison unit outputs the maximum intensity Light signal. It can be seen from the above that by using the output state of the first data using the dual port electro-optic modulator and calculating through the dual port optical switch, the comparison operation of all the elements of the first data can be realized at one time, greatly improving Data processing efficiency. In addition, due to the low attenuation of the optical channel and the easy-to-broadcast feature, the device for comparing data can integrate multiple comparison units, enabling multiple comparison units to simultaneously perform batch parallel operation of multiple reference data and first data; since the photonic device is not transmitted Delayed, electromagnetic interference, etc., the data processing device can achieve a data comparison processing speed of nanoseconds (ns) or even higher.
由于比较单元中不同光开关是对其工作波长的光信号有光走向的控制作用,因此可随意调整比较单元中各个光开关的排列顺序。 Since the different optical switches in the comparison unit have a control effect on the optical direction of the optical signal of the working wavelength, the arrangement order of the optical switches in the comparison unit can be arbitrarily adjusted.
如图7所示,所述结果确定模块可根据三个比较单元输出的光信号,转换成电信号,根据转换出的电信号的强度确定[1010]依次与[1001]、[1010]、[0101]的匹配结果。As shown in FIG. 7, the result determining module can convert into an electrical signal according to the optical signal output by the three comparing units, and determine according to the strength of the converted electrical signal [1010] and [1001], [1010], [ Match result of 0101].
本发明的方法实施例Method embodiment of the present invention
本方法实施例提供的比较数据的方法,应用于上述设备实施例提供的比较数据的设备。如图1所示,该设备包括转换模块和比较模块,所述比较模块包括至少一个比较单元,第一比较单元是指所述至少一个比较单元中任一个所述比较单元;不同所述比较单元对应不同参考数据,所述参考数据包含的元素与第一数据包含的元素一一对应,第一参考数据是指与所述第一比较单元对应的参考数据。The method for comparing data provided by the method embodiment is applied to the device for comparing data provided by the foregoing device embodiment. As shown in FIG. 1, the device includes a conversion module and a comparison module, the comparison module includes at least one comparison unit, and the first comparison unit refers to the comparison unit of any one of the at least one comparison unit; different the comparison unit Corresponding to different reference data, the reference data includes elements corresponding to the elements included in the first data, and the first reference data refers to reference data corresponding to the first comparison unit.
基于图1所示的设备,图8示意了本方法的基本实现流程,但为便于说明,仅在图8示出与本方法实施例相关的部分。Based on the apparatus shown in FIG. 1, FIG. 8 illustrates the basic implementation flow of the method, but for ease of explanation, only the portion related to the embodiment of the method is shown in FIG.
该比较数据的方法,包括步骤801和步骤802。The method for comparing data includes steps 801 and 802.
步骤801,所述转换模块将所述第一数据包含的各个元素对应表示为光信号的不同波长,向每个所述比较单元分别输出所述光信号; Step 801, the conversion module correspondingly represents each element included in the first data as a different wavelength of the optical signal, and respectively outputting the optical signal to each of the comparing units;
步骤802,所述第一比较单元控制具有所述第一数据与所述第一参考数据不同的元素所对应波长的光信号从第一比较输出端口输出,控制具有所述第一数据与所述第一参考数据相同的元素所对应波长的光信号从第二比较输出端口输出。 Step 802, the first comparing unit controls an optical signal having a wavelength corresponding to an element different from the first reference data to be output from a first comparison output port, and the control has the first data and the An optical signal of a wavelength corresponding to the same element of the first reference data is output from the second comparison output port.
步骤801和步骤802的具体实现以及工作原理参见上面对转换模块和第一比较单元的相关描述,在此不再赘述。For the specific implementation and working principles of the steps 801 and 802, refer to the related descriptions of the conversion module and the first comparison unit, and details are not described herein again.
一种可选的具体实施例,若所述第一数据为二进制数据,所述第一数据包含的元素为0或者1;第一元素是指所述第一数据中的任一个元素,第一参考元素是指所述第一参考数据中与所述第一元素对应的元素;所述第一比较单元具有第一比较输入端口、第二比较输入端口、所述第一比较输出端口、所述第二比较输出端口。An optional specific embodiment, if the first data is binary data, the first data includes an element of 0 or 1; the first element refers to any one of the first data, the first The reference element refers to an element corresponding to the first element in the first reference data; the first comparison unit has a first comparison input port, a second comparison input port, the first comparison output port, and the The second comparison output port.
所述转换模块将所述第一数据包含的各个元素对应表示为光信号的不同波长,向每个所述比较单元分别输出所述光信号,具体包括: The conversion module respectively indicates that each element included in the first data is represented as a different wavelength of the optical signal, and the optical signal is separately output to each of the comparison units, and specifically includes:
所述转换模块在所述第一元素为1时,向所述第一比较单元的第一比较输入端口输出第一光信号,所述第一光信号属于具有所述第一元素对应的波长的光信号;The conversion module outputs a first optical signal to a first comparison input port of the first comparison unit when the first element is 1, the first optical signal belongs to a wavelength corresponding to the first element Optical signal
所述转换模块在所述第一元素为0时,向所述第一比较单元的第二比较输入端口输出第二光信号,所述第二光信号属于具有所述第一元素对应的波长的光信号。The conversion module outputs a second optical signal to the second comparison input port of the first comparison unit when the first element is 0, where the second optical signal belongs to a wavelength corresponding to the first element Optical signal.
对应地,所述第一比较单元控制具有所述第一数据与所述第一参考数据不同的元素所对应波长的光信号从第一比较输出端口输出,控制具有所述第一数据与所述第一参考数据相同的元素所对应波长的光信号从第二比较输出端口输出,具体包括:Correspondingly, the first comparison unit controls an optical signal having a wavelength corresponding to an element different from the first reference data to be output from a first comparison output port, and the control has the first data and the The optical signal of the wavelength corresponding to the same element of the first reference data is output from the second comparison output port, and specifically includes:
所述第一比较单元在所述第一参考元素为0时,控制从所述第一比较输入端口输入的所述第一光信号从所述第一比较输出端口输出,控制从所述第二比较输入端口输入的所述第二光信号从所述第二比较输出端口输出;The first comparing unit controls, when the first reference element is 0, to output the first optical signal input from the first comparison input port from the first comparison output port, and control from the second Comparing the second optical signal input to the input port from the second comparison output port;
所述第一比较单元在所述第一参考元素为1时,控制从所述第一比较输入端口输入的所述第一光信号从所述第二比较输出端口输出,控制从所述第二比较输入端口输入的所述第二光信号从所述第一比较输出端口输出。The first comparing unit controls to output the first optical signal input from the first comparison input port from the second comparison output port when the first reference element is 1, and control from the second The second optical signal input to the comparison input port is output from the first comparison output port.
本可选具体实施例中转换模块如何根据第一元素生成第一光信号或者第二光信号的具体实现,参见上述设备实施例中的对应描述。类似地,第一比较单元根据第一参考元素控制第一光信号的走向和控制第二光信号的走向,参见上述设备实施例中的对应描述。For a specific implementation of how the conversion module generates the first optical signal or the second optical signal according to the first element in the optional embodiment, refer to the corresponding description in the foregoing device embodiment. Similarly, the first comparing unit controls the direction of the first optical signal and controls the direction of the second optical signal according to the first reference element, see corresponding description in the above device embodiment.
一种可选的具体实施例,所述第一比较单元包括2×2光开关,所述2×2光开关具有第一输入端口、第二输入端口、第一输出端口、第二输出端口;如果所述第一比较单元包括的2×2光开关的个数为多个,多个所述多个2×2光开关串联;所述第一比较单元包含的2×2光开关与所述第一参考数据包含的元素一一对应;第一光开关是指所述第一比较单元中与所述第一参考元素对应的2×2光开关;In an optional specific embodiment, the first comparing unit includes a 2×2 optical switch, and the 2×2 optical switch has a first input port, a second input port, a first output port, and a second output port; If the first comparison unit includes a plurality of 2×2 optical switches, a plurality of the plurality of 2×2 optical switches are connected in series; the first comparison unit includes a 2×2 optical switch and the The first reference data includes one-to-one correspondence; the first optical switch refers to a 2×2 optical switch corresponding to the first reference element in the first comparison unit;
所述方法包括:The method includes:
所述第一光开关从所述第一光开关的第一输入端口接收所述第一比较输入端口输出的所述第一光信号,从所述第一光开关的第二输入端口接收所述 第二比较输入端口输出的所述第二光信号;The first optical switch receives the first optical signal output by the first comparison input port from a first input port of the first optical switch, and receives the first optical port from the first optical switch Second comparing the second optical signal output by the input port;
所述第一光开关在所述第一参考元素为0时,控制从所述第一光开关的第一输入端口输入的所述第一光信号从所述第一光开关的第一输出端口输出,使得所述第一比较单元从所述第一比较输出端口输出所述第一光信号,控制从所述第一光开关的第二输入端口输入的所述第二光信号从所述第一光开关的第二输出端口输出,使得所述第一比较单元从所述第二比较输出端口输出所述第二光信号;The first optical switch controls the first optical signal input from the first input port of the first optical switch from the first output port of the first optical switch when the first reference element is 0 Outputing, such that the first comparison unit outputs the first optical signal from the first comparison output port, and controls the second optical signal input from a second input port of the first optical switch from the first a second output port of the optical switch is output, such that the first comparing unit outputs the second optical signal from the second comparison output port;
所述第一光开关在所述第一参考元素为1时,控制从所述第一光开关的第一输入端口输入的所述第一光信号从所述第一光开关的第二输出端口输出,使得所述第一比较单元从所述第二比较输出端口输出所述第一光信号,控制从所述第一光开关的第二输入端口输入的所述第二光信号从所述第一光开关的第一输出端口输出,使得所述第一比较单元从所述第一比较输出端口输出所述第二光信号;The first optical switch controls the first optical signal input from the first input port of the first optical switch from the second output port of the first optical switch when the first reference element is Outputting, causing the first comparison unit to output the first optical signal from the second comparison output port, and controlling the second optical signal input from the second input port of the first optical switch from the first a first output port of an optical switch is output, such that the first comparing unit outputs the second optical signal from the first comparison output port;
所述第一光开关从所述第一光开关的第一输入端口接收所述第一比较输入端口输出的第三光信号,或者从所述第一光开关的第二输入端口接收所述第二比较输入端口输出的所述第三光信号,其中,所述第三光信号的波长与所述第二光信号的波长不同,所述第三光信号的波长与所述第一光信号的波长不同;Receiving, by the first optical switch, a third optical signal output by the first comparison input port from a first input port of the first optical switch, or receiving the first optical port from a second input port of the first optical switch Comparing the third optical signal output by the input port, wherein a wavelength of the third optical signal is different from a wavelength of the second optical signal, and a wavelength of the third optical signal is related to the first optical signal Different wavelengths;
所述第一光开关控制从所述第一光开关的第一输入端口输入的第三光信号从所述第一光开关的第一输出端口输出,或者控制从所述第一光开关的第二输入端口输入的所述第三光信号从所述第一光开关的第二输出端口输出。The first optical switch controls a third optical signal input from a first input port of the first optical switch to be output from a first output port of the first optical switch, or controls a first optical switch from the first optical switch The third optical signal input by the two input ports is output from the second output port of the first optical switch.
本可选具体实施例中第一光开关的工作原理,参见上述设备实施例中的对应描述。For the working principle of the first optical switch in this optional embodiment, refer to the corresponding description in the foregoing device embodiment.
一种可选的具体实施例,所述转换模块包括表征模块、第一复用器、第一分发器、第二复用器、第二分发器;An optional specific embodiment, the conversion module includes a characterization module, a first multiplexer, a first distributor, a second multiplexer, and a second distributor;
所述方法包括:The method includes:
所述表征模块在所述第一元素为0时生成与所述第一元素对应的所述第二光信号,向所述第二复用器发送所述第二光信号;在所述第一元素为1时生成与所述第一元素对应的所述第一光信号,向所述第一复用器发送所述第 一光信号;The characterization module generates the second optical signal corresponding to the first element when the first element is 0, and sends the second optical signal to the second multiplexer; When the element is 1, generating the first optical signal corresponding to the first element, and transmitting the first to the first multiplexer An optical signal;
所述第一复用器将从所述表征模块接收的光信号复用,向所述第一分发器输出复用所得的光信号;The first multiplexer multiplexes optical signals received from the characterization module, and outputs the multiplexed optical signals to the first distributor;
所述第一分发器将所述复用所得的光信号向各个所述比较单元分发,包括向所述第一比较单元的第一比较输入端口输出所述复用所得的光信号;The first distributor distributes the multiplexed optical signal to each of the comparing units, and outputs the multiplexed optical signal to a first comparison input port of the first comparing unit;
所述第二复用器将从所述表征模块接收的光信号复用,向所述第二分发器输出复用所得的光信号;The second multiplexer multiplexes optical signals received from the characterization module, and outputs the multiplexed optical signals to the second distributor;
所述第二分发器将所述复用所得的光信号向各个所述比较单元分发,包括向所述第一比较单元的第二比较输入端口输出所述复用所得的光信号。The second distributor distributes the multiplexed optical signal to each of the comparing units, and outputs the multiplexed optical signal to a second comparison input port of the first comparing unit.
本可选具体实施例中表征模块、第一复用器、第一分发器、第二复用器、第二分发器的步骤实现,参见上述设备实施例中对应的工作原理描述。For the implementation of the steps of the characterization module, the first multiplexer, the first distributor, the second multiplexer, and the second distributor in the optional embodiment, refer to the corresponding working principle description in the foregoing device embodiment.
一种可选的具体实施例,所述表征模块包括光电调制器,所述第一数据包含的元素与所述表征模块包括的光电调制器一一对应,第一光电调制器是指与所述第一元素对应的光电调制器,第一光电调制器具有第一光输出端口和第二光输出端口;An optional specific embodiment, the characterization module includes a photoelectric modulator, the first data includes an element corresponding to the photoelectric modulator included in the characterization module, the first photoelectric modulator refers to the a photoelectric modulator corresponding to the first element, the first photoelectric modulator having a first light output port and a second light output port;
所述方法包括:The method includes:
所述第一光电调制器在所述第一元素为0时将表示所述第一元素的电信号调制成所述第二光信号,向所述第二复用器发送所述第二光信号;在所述第一元素为1时将表示所述第一元素的电信号调制成所述第一光信号,向所述第一复用器发送所述第一光信号。The first optoelectronic modulator modulates an electrical signal representing the first element into the second optical signal when the first element is 0, and transmits the second optical signal to the second multiplexer And modulating an electrical signal representing the first element into the first optical signal when the first element is 1, and transmitting the first optical signal to the first multiplexer.
本可选具体实施例中第一光电调制器的步骤实现,参见上述设备实施例中对应的工作原理描述。For the implementation of the steps of the first optoelectronic modulator in the optional embodiment, refer to the corresponding working principle description in the device embodiment.
一种可选的具体实施例,所述设备还包括结果确定模块;An optional specific embodiment, the device further includes a result determining module;
所述方法包括:The method includes:
所述结果确定模块接收所述第一比较单元从所述第一比较输出端口输出的光信号,并将所述第一比较输出端口输出的光信号转换为第一电信号,接收所述第一比较单元从所述第二比较输出端口输出的光信号,并将所述第二比较输出端口输出的光信号转换为第二电信号;The result determining module receives the optical signal output by the first comparing unit from the first comparison output port, and converts the optical signal output by the first comparison output port into a first electrical signal, and receives the first Comparing, by the unit, the optical signal outputted from the second comparison output port, and converting the optical signal output by the second comparison output port into a second electrical signal;
所述结果确定模块根据所述第一电信号的强度和/或所述第二电信号的 强度,确定所述第一数据与所述第一参考数据的匹配结果。The result determining module is configured according to an intensity of the first electrical signal and/or the second electrical signal Intensity, determining a matching result of the first data and the first reference data.
本可选具体实施例中结果确定模块的步骤实现,参见上述设备实施例中对应的工作原理描述。For the implementation of the steps of the result determination module in the optional embodiment, refer to the corresponding working principle description in the device embodiment.
应当理解,尽管在上述实施例中可能采用术语“第一”、“第二”、“第三”等来描述各个模块、比较单元、数据、参考数据、元素、参考元素、端口(例如比较输入端口、比较输出端口、输入端口、输出端口)、光开关、光信号、电信号,例如描述“第一比较输入端口”、“第二比较输入端口”,但不应限于这些术语,并且“第一”、“第二”、“第三”等术语仅用于相互区分,并不代表它们之间存在顺序的关系;例如“第一比较输入端口”、“第二比较输入端口”并不代表特指的比较输入端口,也不代表它们之间存在顺序的关系,“第一”和“第二”仅用来将比较输入端口彼此区分开,在不脱离本发明实施例范围的情况下,可以对“第一比较输入端口”、“第二比较输入端口”互换名称,或者将“第一比较输入端口”改称为“第三比较输入端口”;因此,在本发明实施例中,对术语“第一”、“第二”等不做限制。It should be understood that although the terms "first," "second," "third," and the like may be employed in the above-described embodiments to describe various modules, comparison units, data, reference data, elements, reference elements, ports (eg, comparison inputs) Port, comparison output port, input port, output port), optical switch, optical signal, electrical signal, for example, describing "first comparison input port", "second comparison input port", but should not be limited to these terms, and The terms “a”, “second”, “third” and the like are used only to distinguish one another, and do not mean that there is a sequential relationship between them; for example, “first comparison input port” and “second comparison input port” do not represent The specific comparison input ports do not mean that there is a sequential relationship between them. The "first" and "second" are only used to distinguish the comparison input ports from each other without departing from the scope of the embodiments of the present invention. The name can be exchanged for "first comparison input port", "second comparison input port", or "first comparison input port" can be renamed as "third comparison input port" ; Accordingly, in embodiments of the present invention, the terms "first", "second," and the like is not restricted.
最后应说明的是:以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的保护范围。 It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and are not limited thereto; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that The technical solutions described in the foregoing embodiments are modified, or some of the technical features are equivalently replaced; and the modifications or substitutions do not deviate from the technical scope of the embodiments of the present invention.

Claims (12)

  1. 一种比较数据的设备,其特征在于,所述设备包括转换模块和比较模块,所述比较模块包括至少一个比较单元,第一比较单元是指所述至少一个比较单元中任一个所述比较单元;不同所述比较单元对应不同参考数据,所述参考数据包含的元素与第一数据包含的元素一一对应,第一参考数据是指与所述第一比较单元对应的参考数据;A device for comparing data, characterized in that the device comprises a conversion module and a comparison module, the comparison module comprises at least one comparison unit, and the first comparison unit refers to the comparison unit of any one of the at least one comparison unit The different reference units correspond to different reference data, and the reference data includes elements corresponding to the elements included in the first data, and the first reference data refers to reference data corresponding to the first comparison unit;
    所述转换模块,用于将所述第一数据包含的各个元素对应表示为光信号的不同波长,向每个所述比较单元分别输出所述光信号;The conversion module is configured to represent each element included in the first data as a different wavelength of the optical signal, and output the optical signal to each of the comparing units respectively;
    所述第一比较单元,用于控制具有所述第一数据与所述第一参考数据不同的元素所对应波长的光信号从第一比较输出端口输出,控制具有所述第一数据与所述第一参考数据相同的元素所对应波长的光信号从第二比较输出端口输出。The first comparison unit is configured to control, by the first comparison output port, an optical signal for controlling a wavelength corresponding to an element different from the first reference data, and the control has the first data and the An optical signal of a wavelength corresponding to the same element of the first reference data is output from the second comparison output port.
  2. 根据权利要求1所述的设备,其特征在于,若所述第一数据为二进制数据,所述第一数据包含的元素为0或者1;第一元素是指所述第一数据中的任一个元素,第一参考元素是指所述第一参考数据中与所述第一元素对应的元素;所述第一比较单元具有第一比较输入端口、第二比较输入端口、所述第一比较输出端口、所述第二比较输出端口;The device according to claim 1, wherein if the first data is binary data, the first data includes an element of 0 or 1; and the first element refers to any one of the first data. An element, the first reference element refers to an element corresponding to the first element in the first reference data; the first comparison unit has a first comparison input port, a second comparison input port, and the first comparison output a port, the second comparison output port;
    所述转换模块,具体用于在所述第一元素为1时,向所述第一比较单元的第一比较输入端口输出第一光信号,所述第一光信号属于具有所述第一元素对应的波长的光信号;The conversion module is configured to: when the first element is 1, output a first optical signal to a first comparison input port of the first comparison unit, where the first optical signal belongs to the first element Corresponding wavelength optical signal;
    所述转换模块,具体用于在所述第一元素为0时,向所述第一比较单元的第二比较输入端口输出第二光信号,所述第二光信号属于具有所述第一元素对应的波长的光信号;The conversion module is configured to output a second optical signal to the second comparison input port of the first comparison unit when the first element is 0, where the second optical signal belongs to the first element Corresponding wavelength optical signal;
    所述第一比较单元,具体用于在所述第一参考元素为0时,控制从所述第一比较输入端口输入的所述第一光信号从所述第一比较输出端口输出,控制从所述第二比较输入端口输入的所述第二光信号从所述第二比较输出端口输出;The first comparing unit is configured to: when the first reference element is 0, control the first optical signal input from the first comparison input port to be output from the first comparison output port, and control the slave The second optical signal input by the second comparison input port is output from the second comparison output port;
    所述第一比较单元,具体用于在所述第一参考元素为1时,控制从所述第一比较输入端口输入的所述第一光信号从所述第二比较输出端口输出,控 制从所述第二比较输入端口输入的所述第二光信号从所述第一比较输出端口输出。The first comparing unit is configured to: when the first reference element is 1, control the first optical signal input from the first comparison input port to be output from the second comparison output port, and control The second optical signal input from the second comparison input port is output from the first comparison output port.
  3. 根据权利要求2所述的设备,其特征在于,所述第一比较单元包括2×2光开关,所述2×2光开关具有第一输入端口、第二输入端口、第一输出端口、第二输出端口;如果所述第一比较单元包括的2×2光开关的个数为多个,多个所述多个2×2光开关串联;所述第一比较单元包含的2×2光开关与所述第一参考数据包含的元素一一对应;第一光开关是指所述第一比较单元中与所述第一参考元素对应的2×2光开关;The device according to claim 2, wherein the first comparison unit comprises a 2×2 optical switch, the 2×2 optical switch has a first input port, a second input port, a first output port, and a a second output port; if the first comparison unit includes a plurality of 2×2 optical switches, a plurality of the plurality of 2×2 optical switches are connected in series; the first comparison unit includes 2×2 light The switch is in one-to-one correspondence with the element included in the first reference data; the first optical switch is a 2×2 optical switch corresponding to the first reference element in the first comparison unit;
    所述第一光开关,用于从所述第一光开关的第一输入端口接收所述第一比较输入端口输出的所述第一光信号,从所述第一光开关的第二输入端口接收所述第二比较输入端口输出的所述第二光信号;The first optical switch is configured to receive, by the first input port of the first optical switch, the first optical signal output by the first comparison input port, from a second input port of the first optical switch Receiving the second optical signal output by the second comparison input port;
    所述第一光开关,用于在所述第一参考元素为0时,控制从所述第一光开关的第一输入端口输入的所述第一光信号从所述第一光开关的第一输出端口输出,使得所述第一比较单元从所述第一比较输出端口输出所述第一光信号,控制从所述第一光开关的第二输入端口输入的所述第二光信号从所述第一光开关的第二输出端口输出,使得所述第一比较单元从所述第二比较输出端口输出所述第二光信号;The first optical switch is configured to control, when the first reference element is 0, the first optical signal input from the first input port of the first optical switch from the first optical switch An output port output, such that the first comparison unit outputs the first optical signal from the first comparison output port, and controls the second optical signal input from a second input port of the first optical switch The second output port of the first optical switch is output, such that the first comparison unit outputs the second optical signal from the second comparison output port;
    所述第一光开关,用于在所述第一参考元素为1时,控制从所述第一光开关的第一输入端口输入的所述第一光信号从所述第一光开关的第二输出端口输出,使得所述第一比较单元从所述第二比较输出端口输出所述第一光信号,控制从所述第一光开关的第二输入端口输入的所述第二光信号从所述第一光开关的第一输出端口输出,使得所述第一比较单元从所述第一比较输出端口输出所述第二光信号;The first optical switch is configured to control, when the first reference element is 1, to control the first optical signal input from the first input port of the first optical switch from the first optical switch Outputting, by the first output unit, the first comparison unit outputs the first optical signal from the second comparison output port, and controls the second optical signal input from the second input port of the first optical switch The first output port of the first optical switch is output, such that the first comparison unit outputs the second optical signal from the first comparison output port;
    所述第一光开关,用于从所述第一光开关的第一输入端口接收所述第一比较输入端口输出的第三光信号,或者从所述第一光开关的第二输入端口接收所述第二比较输入端口输出的所述第三光信号,其中,所述第三光信号的波长与所述第二光信号的波长不同,所述第三光信号的波长与所述第一光信号的波长不同;The first optical switch is configured to receive a third optical signal output by the first comparison input port from a first input port of the first optical switch, or receive from a second input port of the first optical switch The third optical signal output by the second comparison input port, wherein a wavelength of the third optical signal is different from a wavelength of the second optical signal, and a wavelength of the third optical signal is different from the first The wavelength of the optical signal is different;
    所述第一光开关,用于控制从所述第一光开关的第一输入端口输入的第三光信号从所述第一光开关的第一输出端口输出,或者控制从所述第一光开 关的第二输入端口输入的所述第三光信号从所述第一光开关的第二输出端口输出。The first optical switch is configured to control a third optical signal input from a first input port of the first optical switch to be output from a first output port of the first optical switch, or to control from the first optical Open The third optical signal input from the closed second input port is output from the second output port of the first optical switch.
  4. 根据权利要求2或3所述的设备,其特征在于,所述转换模块包括表征模块、第一复用器、第一分发器、第二复用器、第二分发器;The device according to claim 2 or 3, wherein the conversion module comprises a characterization module, a first multiplexer, a first distributor, a second multiplexer, and a second distributor;
    所述表征模块,用于在所述第一元素为0时生成与所述第一元素对应的所述第二光信号,向所述第二复用器发送所述第二光信号;在所述第一元素为1时生成与所述第一元素对应的所述第一光信号,向所述第一复用器发送所述第一光信号;The characterization module is configured to generate the second optical signal corresponding to the first element when the first element is 0, and send the second optical signal to the second multiplexer; Generating the first optical signal corresponding to the first element when the first element is 1, and transmitting the first optical signal to the first multiplexer;
    所述第一复用器,用于将从所述表征模块接收的光信号复用,向所述第一分发器输出复用所得的光信号;The first multiplexer is configured to multiplex the optical signals received from the characterization module, and output the multiplexed optical signals to the first distributor;
    所述第二复用器,用于将从所述表征模块接收的光信号复用,向所述第二分发器输出复用所得的光信号;The second multiplexer is configured to multiplex the optical signals received from the characterization module, and output the multiplexed optical signals to the second distributor;
    所述第一分发器,用于将所述复用所得的光信号向各个所述比较单元分发,包括向所述第一比较单元的第一比较输入端口输出所述复用所得的光信号;The first distributor, configured to distribute the multiplexed optical signal to each of the comparing units, including outputting the multiplexed optical signal to a first comparison input port of the first comparing unit;
    所述第二分发器,用于将所述复用所得的光信号向各个所述比较单元分发,包括向所述第一比较单元的第二比较输入端口输出所述复用所得的光信号。The second distributor is configured to distribute the multiplexed optical signal to each of the comparing units, and output the multiplexed optical signal to a second comparison input port of the first comparing unit.
  5. 根据权利要求4所述的设备,其特征在于,所述表征模块包括光电调制器,所述第一数据包含的元素与所述表征模块包括的光电调制器一一对应,第一光电调制器是指与所述第一元素对应的光电调制器,第一光电调制器具有第一光输出端口和第二光输出端口;The apparatus according to claim 4, wherein said characterization module comprises a photoelectric modulator, said first data comprising elements in one-to-one correspondence with said photoelectric modulators included in said characterization module, said first photoelectric modulator being Means a photoelectric modulator corresponding to the first element, the first photoelectric modulator having a first light output port and a second light output port;
    所述第一光电调制器,用于在所述第一元素为0时将表示所述第一元素的电信号调制成所述第二光信号,向所述第二复用器发送所述第二光信号;在所述第一元素为1时将表示所述第一元素的电信号调制成所述第一光信号,向所述第一复用器发送所述第一光信号。The first photoelectric modulator is configured to modulate an electrical signal representing the first element into the second optical signal when the first element is 0, and send the first to the second multiplexer a second optical signal; when the first element is 1, modulating an electrical signal representing the first element into the first optical signal, and transmitting the first optical signal to the first multiplexer.
  6. 根据权利要求1至5任一项所述的设备,其特征在于,所述设备还包括:The device according to any one of claims 1 to 5, further comprising:
    结果确定模块,用于接收所述第一比较单元从所述第一比较输出端口输出的光信号,并将所述第一比较输出端口输出的光信号转换为第一电信号, 接收所述第一比较单元从所述第二比较输出端口输出的光信号,并将所述第二比较输出端口输出的光信号转换为第二电信号;a result determining module, configured to receive an optical signal output by the first comparing unit from the first comparison output port, and convert the optical signal output by the first comparison output port into a first electrical signal, Receiving, by the first comparison unit, an optical signal output from the second comparison output port, and converting the optical signal output by the second comparison output port into a second electrical signal;
    所述结果确定模块,用于根据所述第一电信号的强度和/或所述第二电信号的强度,确定所述第一数据与所述第一参考数据的匹配结果。The result determining module is configured to determine a matching result of the first data and the first reference data according to an intensity of the first electrical signal and/or an intensity of the second electrical signal.
  7. 一种比较数据的方法,其特征在于,所述方法适用的设备包括转换模块和比较模块,所述比较模块包括至少一个比较单元,第一比较单元是指所述至少一个比较单元中任一个所述比较单元;不同所述比较单元对应不同参考数据,所述参考数据包含的元素与第一数据包含的元素一一对应,第一参考数据是指与所述第一比较单元对应的参考数据;所述方法包括:A method for comparing data, characterized in that the device to which the method is applicable includes a conversion module and a comparison module, the comparison module includes at least one comparison unit, and the first comparison unit refers to any one of the at least one comparison unit. a comparison unit; different comparison units correspond to different reference data, the reference data includes elements corresponding to the elements included in the first data, and the first reference data refers to reference data corresponding to the first comparison unit; The method includes:
    所述转换模块将所述第一数据包含的各个元素对应表示为光信号的不同波长,向每个所述比较单元分别输出所述光信号;The conversion module respectively represents each element included in the first data as a different wavelength of the optical signal, and outputs the optical signal to each of the comparison units respectively;
    所述第一比较单元控制具有所述第一数据与所述第一参考数据不同的元素所对应波长的光信号从第一比较输出端口输出,控制具有所述第一数据与所述第一参考数据相同的元素所对应波长的光信号从第二比较输出端口输出。The first comparison unit controls an optical signal having a wavelength corresponding to an element different from the first reference data to be output from a first comparison output port, and the control has the first data and the first reference An optical signal of a wavelength corresponding to the same element of the data is output from the second comparison output port.
  8. 根据权利要求7所述的方法,其特征在于,若所述第一数据为二进制数据,所述第一数据包含的元素为0或者1;第一元素是指所述第一数据中的任一个元素,第一参考元素是指所述第一参考数据中与所述第一元素对应的元素;所述第一比较单元具有第一比较输入端口、第二比较输入端口、所述第一比较输出端口、所述第二比较输出端口;The method according to claim 7, wherein if the first data is binary data, the first data contains an element of 0 or 1; the first element refers to any one of the first data. An element, the first reference element refers to an element corresponding to the first element in the first reference data; the first comparison unit has a first comparison input port, a second comparison input port, and the first comparison output a port, the second comparison output port;
    所述转换模块将所述第一数据包含的各个元素对应表示为光信号的不同波长,向每个所述比较单元分别输出所述光信号,具体包括:所述转换模块在所述第一元素为1时,向所述第一比较单元的第一比较输入端口输出第一光信号,所述第一光信号属于具有所述第一元素对应的波长的光信号;所述转换模块在所述第一元素为0时,向所述第一比较单元的第二比较输入端口输出第二光信号,所述第二光信号属于具有所述第一元素对应的波长的光信号;The conversion module respectively indicates the respective elements included in the first data as different wavelengths of the optical signal, and respectively outputs the optical signals to each of the comparing units, specifically including: the converting module is in the first element When 1, the first optical signal is output to the first comparison input port of the first comparison unit, the first optical signal belongs to an optical signal having a wavelength corresponding to the first element; When the first element is 0, outputting a second optical signal to the second comparison input port of the first comparison unit, where the second optical signal belongs to an optical signal having a wavelength corresponding to the first element;
    对应地,所述第一比较单元控制具有所述第一数据与所述第一参考数据不同的元素所对应波长的光信号从第一比较输出端口输出,控制具有所述第 一数据与所述第一参考数据相同的元素所对应波长的光信号从第二比较输出端口输出,具体包括:所述第一比较单元在所述第一参考元素为0时,控制从所述第一比较输入端口输入的所述第一光信号从所述第一比较输出端口输出,控制从所述第二比较输入端口输入的所述第二光信号从所述第二比较输出端口输出;所述第一比较单元在所述第一参考元素为1时,控制从所述第一比较输入端口输入的所述第一光信号从所述第二比较输出端口输出,控制从所述第二比较输入端口输入的所述第二光信号从所述第一比较输出端口输出。Correspondingly, the first comparison unit controls an optical signal having a wavelength corresponding to an element different from the first reference data to be output from a first comparison output port, and the control has the first An optical signal of a wavelength corresponding to the same element as the first reference data is output from the second comparison output port, and specifically includes: the first comparing unit controls, when the first reference element is 0, from the The first optical signal input by the first comparison input port is output from the first comparison output port, and the second optical signal input from the second comparison input port is controlled to be output from the second comparison output port; The first comparing unit controls to output the first optical signal input from the first comparison input port from the second comparison output port when the first reference element is 1, and control from the second The second optical signal input to the comparison input port is output from the first comparison output port.
  9. 根据权利要求8所述的方法,其特征在于,所述第一比较单元包括2×2光开关,所述2×2光开关具有第一输入端口、第二输入端口、第一输出端口、第二输出端口;如果所述第一比较单元包括的2×2光开关的个数为多个,多个所述多个2×2光开关串联;所述第一比较单元包含的2×2光开关与所述第一参考数据包含的元素一一对应;第一光开关是指所述第一比较单元中与所述第一参考元素对应的2×2光开关;The method according to claim 8, wherein the first comparison unit comprises a 2×2 optical switch, the 2×2 optical switch has a first input port, a second input port, a first output port, and a a second output port; if the first comparison unit includes a plurality of 2×2 optical switches, a plurality of the plurality of 2×2 optical switches are connected in series; the first comparison unit includes 2×2 light The switch is in one-to-one correspondence with the element included in the first reference data; the first optical switch is a 2×2 optical switch corresponding to the first reference element in the first comparison unit;
    所述方法包括:The method includes:
    所述第一光开关从所述第一光开关的第一输入端口接收所述第一比较输入端口输出的所述第一光信号,从所述第一光开关的第二输入端口接收所述第二比较输入端口输出的所述第二光信号;The first optical switch receives the first optical signal output by the first comparison input port from a first input port of the first optical switch, and receives the first optical port from the first optical switch Second comparing the second optical signal output by the input port;
    所述第一光开关在所述第一参考元素为0时,控制从所述第一光开关的第一输入端口输入的所述第一光信号从所述第一光开关的第一输出端口输出,使得所述第一比较单元从所述第一比较输出端口输出所述第一光信号,控制从所述第一光开关的第二输入端口输入的所述第二光信号从所述第一光开关的第二输出端口输出,使得所述第一比较单元从所述第二比较输出端口输出所述第二光信号;The first optical switch controls the first optical signal input from the first input port of the first optical switch from the first output port of the first optical switch when the first reference element is 0 Outputing, such that the first comparison unit outputs the first optical signal from the first comparison output port, and controls the second optical signal input from a second input port of the first optical switch from the first a second output port of the optical switch is output, such that the first comparing unit outputs the second optical signal from the second comparison output port;
    所述第一光开关在所述第一参考元素为1时,控制从所述第一光开关的第一输入端口输入的所述第一光信号从所述第一光开关的第二输出端口输出,使得所述第一比较单元从所述第二比较输出端口输出所述第一光信号,控制从所述第一光开关的第二输入端口输入的所述第二光信号从所述第一光开关的第一输出端口输出,使得所述第一比较单元从所述第一比较输出端口输出所述第二光信号; The first optical switch controls the first optical signal input from the first input port of the first optical switch from the second output port of the first optical switch when the first reference element is Outputting, causing the first comparison unit to output the first optical signal from the second comparison output port, and controlling the second optical signal input from the second input port of the first optical switch from the first a first output port of an optical switch is output, such that the first comparing unit outputs the second optical signal from the first comparison output port;
    所述第一光开关从所述第一光开关的第一输入端口接收所述第一比较输入端口输出的第三光信号,或者从所述第一光开关的第二输入端口接收所述第二比较输入端口输出的所述第三光信号,其中,所述第三光信号的波长与所述第二光信号的波长不同,所述第三光信号的波长与所述第一光信号的波长不同;Receiving, by the first optical switch, a third optical signal output by the first comparison input port from a first input port of the first optical switch, or receiving the first optical port from a second input port of the first optical switch Comparing the third optical signal output by the input port, wherein a wavelength of the third optical signal is different from a wavelength of the second optical signal, and a wavelength of the third optical signal is related to the first optical signal Different wavelengths;
    所述第一光开关控制从所述第一光开关的第一输入端口输入的第三光信号从所述第一光开关的第一输出端口输出,或者控制从所述第一光开关的第二输入端口输入的所述第三光信号从所述第一光开关的第二输出端口输出。The first optical switch controls a third optical signal input from a first input port of the first optical switch to be output from a first output port of the first optical switch, or controls a first optical switch from the first optical switch The third optical signal input by the two input ports is output from the second output port of the first optical switch.
  10. 根据权利要求8或9所述的方法,其特征在于,所述转换模块包括表征模块、第一复用器、第一分发器、第二复用器、第二分发器;The method according to claim 8 or 9, wherein the conversion module comprises a characterization module, a first multiplexer, a first distributor, a second multiplexer, and a second distributor;
    所述方法包括:The method includes:
    所述表征模块在所述第一元素为0时生成与所述第一元素对应的所述第二光信号,向所述第二复用器发送所述第二光信号;在所述第一元素为1时生成与所述第一元素对应的所述第一光信号,向所述第一复用器发送所述第一光信号;The characterization module generates the second optical signal corresponding to the first element when the first element is 0, and sends the second optical signal to the second multiplexer; When the element is 1, the first optical signal corresponding to the first element is generated, and the first optical signal is sent to the first multiplexer;
    所述第一复用器将从所述表征模块接收的光信号复用,向所述第一分发器输出复用所得的光信号;The first multiplexer multiplexes optical signals received from the characterization module, and outputs the multiplexed optical signals to the first distributor;
    所述第一分发器将所述复用所得的光信号向各个所述比较单元分发,包括向所述第一比较单元的第一比较输入端口输出所述复用所得的光信号;The first distributor distributes the multiplexed optical signal to each of the comparing units, and outputs the multiplexed optical signal to a first comparison input port of the first comparing unit;
    所述第二复用器将从所述表征模块接收的光信号复用,向所述第二分发器输出复用所得的光信号;The second multiplexer multiplexes optical signals received from the characterization module, and outputs the multiplexed optical signals to the second distributor;
    所述第二分发器将所述复用所得的光信号向各个所述比较单元分发,包括向所述第一比较单元的第二比较输入端口输出所述复用所得的光信号。The second distributor distributes the multiplexed optical signal to each of the comparing units, and outputs the multiplexed optical signal to a second comparison input port of the first comparing unit.
  11. 根据权利要求10所述的方法,其特征在于,所述表征模块包括光电调制器,所述第一数据包含的元素与所述表征模块包括的光电调制器一一对应,第一光电调制器是指与所述第一元素对应的光电调制器,第一光电调制器具有第一光输出端口和第二光输出端口;The method according to claim 10, wherein said characterization module comprises a photoelectric modulator, said first data comprising elements in one-to-one correspondence with said photoelectric modulators included in said characterization module, said first photoelectric modulator being Means a photoelectric modulator corresponding to the first element, the first photoelectric modulator having a first light output port and a second light output port;
    所述方法包括:The method includes:
    所述第一光电调制器在所述第一元素为0时将表示所述第一元素的电 信号调制成所述第二光信号,向所述第二复用器发送所述第二光信号;在所述第一元素为1时将表示所述第一元素的电信号调制成所述第一光信号,向所述第一复用器发送所述第一光信号。The first photo-electric modulator will represent the electrical energy of the first element when the first element is zero Transmitting a signal into the second optical signal, transmitting the second optical signal to the second multiplexer; and modulating an electrical signal representing the first element into the first element when the first element is An optical signal that transmits the first optical signal to the first multiplexer.
  12. 根据权利要求7至11任一项所述的设备,其特征在于,所述设备还包括结果确定模块;The device according to any one of claims 7 to 11, wherein the device further comprises a result determining module;
    所述方法包括:The method includes:
    所述结果确定模块接收所述第一比较单元从所述第一比较输出端口输出的光信号,并将所述第一比较输出端口输出的光信号转换为第一电信号,接收所述第一比较单元从所述第二比较输出端口输出的光信号,并将所述第二比较输出端口输出的光信号转换为第二电信号;The result determining module receives the optical signal output by the first comparing unit from the first comparison output port, and converts the optical signal output by the first comparison output port into a first electrical signal, and receives the first Comparing, by the unit, the optical signal outputted from the second comparison output port, and converting the optical signal output by the second comparison output port into a second electrical signal;
    所述结果确定模块根据所述第一电信号的强度和/或所述第二电信号的强度,确定所述第一数据与所述第一参考数据的匹配结果。 The result determining module determines a matching result of the first data and the first reference data according to an intensity of the first electrical signal and/or an intensity of the second electrical signal.
PCT/CN2015/097745 2015-12-17 2015-12-17 Device and method for comparing data WO2017101083A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2015/097745 WO2017101083A1 (en) 2015-12-17 2015-12-17 Device and method for comparing data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2015/097745 WO2017101083A1 (en) 2015-12-17 2015-12-17 Device and method for comparing data

Publications (1)

Publication Number Publication Date
WO2017101083A1 true WO2017101083A1 (en) 2017-06-22

Family

ID=59055463

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/097745 WO2017101083A1 (en) 2015-12-17 2015-12-17 Device and method for comparing data

Country Status (1)

Country Link
WO (1) WO2017101083A1 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6462726B1 (en) * 1998-02-19 2002-10-08 Matsushita Electric Industrial Co., Ltd. Video signal processor
CN101292149A (en) * 2005-10-17 2008-10-22 佐鸟新 Freshness sensor
CN101458836A (en) * 2007-12-14 2009-06-17 广州广电运通金融电子股份有限公司 Identifying method and system for papers of value
CN104331482A (en) * 2014-11-07 2015-02-04 武汉大学 Method and system for hyper-spectrum matching based on feature index
CN104866474A (en) * 2014-02-20 2015-08-26 阿里巴巴集团控股有限公司 Personalized data searching method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6462726B1 (en) * 1998-02-19 2002-10-08 Matsushita Electric Industrial Co., Ltd. Video signal processor
CN101292149A (en) * 2005-10-17 2008-10-22 佐鸟新 Freshness sensor
CN101458836A (en) * 2007-12-14 2009-06-17 广州广电运通金融电子股份有限公司 Identifying method and system for papers of value
CN104866474A (en) * 2014-02-20 2015-08-26 阿里巴巴集团控股有限公司 Personalized data searching method and device
CN104331482A (en) * 2014-11-07 2015-02-04 武汉大学 Method and system for hyper-spectrum matching based on feature index

Similar Documents

Publication Publication Date Title
JP6852115B2 (en) Quantum communication network
US11329730B2 (en) Quantum communication system having time to frequency conversion and associated methods
WO2015124954A3 (en) Detector remodulator and optoelectronic switch
CN111989878B (en) Systems, methods, and media for performing connectivity verification testing and topology discovery
WO2021248810A1 (en) Calculation device, calculation method and calculation system
Zhang et al. Next-generation optically-interconnected high-performance data centers
JP5561678B2 (en) Multiport optical spectral phase encoder
WO2017101083A1 (en) Device and method for comparing data
US10530515B2 (en) OADM node and method in WDM system
EP1960944B1 (en) Correlation apparatus
Wang et al. AI-enabled large-scale entanglement distribution quantum networks
US10476625B2 (en) Optical network system using wavelength channels included in O-band
Tait et al. Silicon microring weight banks for multivariate RF photonics
CN114565091A (en) Optical neural network device, chip and optical implementation method for neural network calculation
EP3016402A1 (en) Optical circuit switch
US8582967B2 (en) Device for multicast of optical signals in the internet and other networks
Kao et al. Design of high bandwidth photonic NoC architectures using optical multilevel signaling
RU2421793C1 (en) Method to send multi-protocol information flows and device for its realisation
US10615878B2 (en) Optical signal modulation
JP5722253B2 (en) Optical packet switch device and signal processing method
WO2022206191A1 (en) Optical communication system, and optical communication method
Lima et al. Fast Polarization Switch for Polarization-Based Quantum Communication
US20230170995A1 (en) Optical communication system, control circuit, storage medium, and optical communication method
WO2023116496A1 (en) Optical computing device, method and system
WO2023138585A1 (en) Optical computing apparatus and optical computing method

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: 15910554

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15910554

Country of ref document: EP

Kind code of ref document: A1