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
element
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; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING; COUNTING
    • G06KRECOGNITION OF DATA; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K9/00Methods or arrangements for reading or recognising printed or written characters or for recognising patterns, e.g. fingerprints

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

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.

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.

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;

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.

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.

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.

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.

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.

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.

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.

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.

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.

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;

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.

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.

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.

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.

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.

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.

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 is a schematic diagram of a hardware structure of a device for comparing data;

2 is a schematic diagram of a hardware structure of a device for comparing data;

3 is a schematic diagram of a hardware structure of a device for comparing data;

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;

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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. .

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. For example, in FIG. 3, bm2 represents a first reference element, and 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. 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.

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:

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.

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.

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).

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);

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).

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.

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.

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.

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.

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.

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.

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.

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:

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.

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.

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).

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.

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.

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.

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 comparison process comparing [1010] and [1001] is described in detail as follows:

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.

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.

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.

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.

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.

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.

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.

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.

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

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.

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.

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.

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.

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:

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.

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:

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.

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.

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;

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;

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:

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:

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. 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;
    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;
    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;
    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;
    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. 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;
    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;
    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. 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;
    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. 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;
    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. 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. 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;
    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;
    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. 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;
    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;
    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. 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:
    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. 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:
    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. 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
JP5215857B2 (en) Light modulator
US6025944A (en) Wavelength division multiplexing/code division multiple access hybrid
Miller Perfect optics with imperfect components
US7177543B2 (en) Method for routing optical packets using multiple wavelength labels, optical packet router using multiple wavelength labels, and optical packet network that uses multiple wavelength labels
EP1646165B1 (en) Optical communication system using optical frequency code, optical transmission device and optical reception device thereof, and reflection type optical communication device
US5541756A (en) Apparatus and method for routing optical signals through wavelength-coding in a self-routed wavelength addressable network
JP2001503160A (en) Programmable wavelength router
JP2012515468A (en) Multi-wavelength coherent receiver (Shared Receiver) with shared optical hybrid and multi-wavelength local oscillator
US5446572A (en) Optical interconnects for high speed backplanes using spectral slicing
JP5842428B2 (en) Optical network and optical connection method
US20130259055A1 (en) Reconfigurable branching unit for submarine optical communication networks
JP2008503920A (en) Flexible wavelength band aggregator, deaggregator and hierarchical hybrid optical cross-connect system
US4956834A (en) Coherence multiplexed optical signal transmission system and method
US7962038B2 (en) High performance gigabit passive optical network
US20110096925A1 (en) Optical fiber secure communication apparatus and data encrption method therefor
Scott et al. Dynamic optical arbitrary waveform generation and measurement
CA1328308C (en) Switched optical network
US8965203B1 (en) Flexible non-modular data center with reconfigurable extended-reach optical network fabric
US9106359B2 (en) Optical network system, optical multiplexing apparatus, and receiving apparatus
NL8003869A (en) Apparatus and method for providing a modulation format for the transmission of a plurality of high-bandwidth signals.
CN105229945B (en) Wavelength-selective switches with integrated channel monitor
US8009986B2 (en) Optical node for mesh-type WDM optical network
CN1437703A (en) Wavelength monitor for WDM systems
US6594049B1 (en) Optical router
WO2007001090A1 (en) Dpsk modulation/demodulation method, and optical communication device and system using the 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 in:

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