Disclosure of Invention
In view of the above problems in the prior art, an adaptive system and an adaptive method for optical fiber transmission standards are provided.
The specific technical scheme is as follows:
the invention comprises a self-adaptive system of optical fiber transmission standard, which comprises a transmitting end and a receiving end connected by an optical fiber cable; two optical protocols with different transmission standards are arranged at the receiving end, and the transmitting end adopts one of the two transmission standards to establish communication connection with the receiving end;
the receiving end enables one of the optical protocols in an initial state;
the receiving end further includes:
the photoelectric conversion module is connected with the optical fiber cable through a connector and is used for receiving the optical signal transmitted by the transmitting end and converting the optical signal into an electric signal;
the standard switching module is connected with the photoelectric conversion module and is started in the process of establishing communication connection between the sending end and the receiving end;
the standard switching module specifically includes:
the signal detection unit is connected with the photoelectric conversion module and is used for receiving the electric signal, continuously detecting the jump rate of the electric signal and outputting the jump rate;
the judging unit is connected with the signal detecting unit and used for judging the transmission standard currently used by the transmitting terminal according to the hopping rate and outputting a judging result;
and the switching unit is respectively connected with the judging unit and the two optical protocols and is used for starting the optical protocol corresponding to the transmission standard currently used by the transmitting terminal according to the judging result so as to establish communication connection between the transmitting terminal and the receiving terminal.
Preferably, the two transmission standards include: the 1000BASEX transfer standard and the 100M transfer standard.
Preferably, the determining unit sets a first threshold in advance, and the determining unit compares the jump rate with the first threshold:
if the jump rate is larger than the first threshold value, the transmitting end sends data by adopting 1000BASEX transmission standard;
and if the hopping rate is not greater than the first threshold value, the transmitting end sends data by adopting a 100M transmission standard.
Preferably, the determining unit is preset with a second threshold and a third threshold, and the determining unit compares the jump rate with the second threshold and the third threshold respectively:
if the jump rate is in an error range around the second threshold value, the transmitting end sends data by adopting a 1000BASEX transmission standard;
and if the hopping rate is within an error range around the third threshold value, the transmitting end is indicated to transmit data by adopting a 100M transmission standard.
Preferably, the standard switching module further comprises:
and the timing unit is connected with the switching unit and is used for starting timing after the switching unit performs one switching and preventing the switching unit from performing switching again within a preset timing period.
Preferably, the time length of the timing period is not less than 1 ms.
Preferably, the standard switching module is located on a physical hardware layer of a bottom layer of the receiving end;
the receiving end also comprises a connection judging module positioned at an upper application layer, connected with the standard switching module and used for detecting whether the communication connection between the transmitting end and the receiving end is successfully established or not and outputting a corresponding detection result;
when the standard switching module receives the detection result indicating that the communication connection is failed to be established, the standard switching module is enabled; and
when the standard switching module receives the detection result indicating that the communication connection is successfully established, the standard switching module is deactivated.
The invention also comprises a self-adaptive method of the optical fiber transmission standard, which is applied to the self-adaptive system and comprises the following steps:
step S1, the optical-to-electrical conversion module receives the optical signal emitted by the emitting end and converts the optical signal into an electrical signal;
step S2, the connection determining module determines whether the sending end and the receiving end establish a communication connection:
if yes, the standard switching module is deactivated and then quit;
if not, the standard switching module is enabled, and the process goes to step S3;
step S3, the signal detection unit receives the electric signal and continuously detects and outputs the jump rate of the electric signal;
step S4, the determining unit determines the transmission standard currently used by the transmitting terminal according to the jump rate, and outputs a determination result:
step S5, the switching unit enables the optical protocol corresponding to the transmission standard currently used by the transmitting end according to the determination result, so that the transmitting end and the receiving end establish a communication connection.
Preferably, a first threshold is preset in the determining unit, and the step S4 specifically includes:
the judging unit compares the jump rate with the first threshold value:
if the jump rate is larger than the first threshold value, the transmitting end sends data by adopting 1000BASEX transmission standard;
and if the hopping rate is not greater than the first threshold value, the transmitting end sends data by adopting a 100M transmission standard.
Preferably, in step S5, after the switching unit enables the optical protocol corresponding to the transmission standard currently used by the transmitting end according to the determination result, the method further includes the following steps:
step S51, when the switching unit enables the optical protocol corresponding to the transmission standard currently used by the transmitting end according to the determination result, timing is started, and the switching unit is prohibited from enabling other optical protocols again;
in step S52, after the timing exceeds a preset timing period, the switching unit is allowed to start other optical protocols again.
The technical scheme of the invention has the beneficial effects that: a receiving end judges the optical protocol used by the transmitting end by actively detecting the signal sent by the transmitting end, and when the optical protocols used by the two parties are different, the receiving end switches the self-adaptation to be consistent with the transmitting end, thereby bringing great convenience to the use of users; meanwhile, due to the active detection of the receiving end, the randomness of switching time is avoided, and the time for establishing communication connection is effectively reduced.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the embodiments and features of the embodiments of the present invention may be combined with each other without conflict.
The invention is further described with reference to the following drawings and specific examples, which are not intended to be limiting.
The invention comprises an adaptive system of optical fiber transmission standards, as shown in fig. 1, comprising a transmitting end 1 and a receiving end 2 connected by an optical fiber cable 3; two optical protocols (100M optical protocol and 1000M optical protocol shown in fig. 1) with different transmission standards are set at the receiving end 2, and the transmitting end 1 establishes communication connection with the receiving end 2 by using one of the two transmission standards;
the receiving end 2 starts one of the optical protocols in an initial state;
the receiving end 2 further includes:
the photoelectric conversion module 201 is connected with the optical fiber cable 3 through a connector 202, and is used for receiving the optical signal emitted by the emitting end 1 and converting the optical signal into an electrical signal;
a standard switching module 203, connected to the photoelectric conversion module 201, wherein the standard switching module 203 is enabled in the process of establishing a communication connection between the transmitting terminal 1 and the receiving terminal 2;
the standard switching module 203 specifically includes:
the signal detection unit 2031, the signal detection unit 2031 is connected to the photoelectric conversion module 201, and is configured to receive the electrical signal, continuously detect a transition rate of the electrical signal, and output the transition rate;
a judging unit 2032, wherein the judging unit 2032 is connected to the signal detecting unit 2031, and is configured to judge the transmission standard currently used by the transmitting end according to the hopping rate, and output a judgment result;
a switching unit 2033, where the switching unit 2033 is respectively connected to the determining unit 2032 and the two optical protocols, and is configured to enable the optical protocol corresponding to the transmission standard currently used by the transmitting end 1 according to the determination result, so that the transmitting end 1 and the receiving end 2 establish a communication connection.
Specifically, in this embodiment, the transmitting end and the receiving end are both provided with two optical protocols, which are a 100M optical protocol and a 1000M optical protocol, respectively, transmission standards used by the two optical protocols are different, the transmission standard used by the 100M optical protocol is 100 baseex, and the transmission standard used by the 1000M optical protocol is 1000 baseex, and the difference in the transmission standards causes that the transmitting end and the receiving end cannot establish a connection on an application layer any more, so that the transmitting end and the receiving end need to use the optical protocols with the same transmission standard to establish a communication connection at the same time.
Specifically, in this embodiment, when the transmitting end and the receiving end cannot establish a communication connection, the receiving end continuously detects an optical signal sent by the transmitting end within a certain period of time, first converts the received optical signal into an electrical signal, and then detects a hopping rate of the electrical signal through the signal detection unit, so that the determining unit determines whether a transmission standard used by the receiving end is the same as that of the transmitting end, and if not, the switching unit switches the transmission standard of the receiving end to be the same as that of the transmitting end, so that the receiving end and the transmitting end establish a communication connection.
Through the technical scheme, the receiving end can actively detect the received signal so as to automatically adapt to the transmission standard of the other side, so that the transmission standards used by the physical layer chips at the two ends are consistent, the physical layer chips do not need to be manually configured by a user, and the use convenience of the user is improved; meanwhile, the randomness of optical protocol switching in the prior art is solved, and the time for establishing connection between the two parties is effectively reduced.
As a preferred embodiment, the determining unit sets a first threshold in advance, and the determining unit compares the jump rate with the first threshold:
if the jump rate is larger than a first threshold value, the transmitting end sends data by adopting 1000BASEX transmission standard;
and if the hopping rate is not greater than the first threshold value, the transmitting end adopts a 100M transmission standard to transmit data.
Specifically, since the transmission rate of the 1000M optical protocol is faster, about 1.25G/s, and the transmission rate of the 100M optical protocol is much lower than that of the 1000M optical protocol, about 125M/s, the transition rate of the signal transmitted by the 1000M optical protocol is about 10 times that of the 100M optical protocol. Therefore, a first threshold value may be preset in the determining unit of the receiving end, where the first threshold value should be higher than the hopping rate of the 100M optical protocol, for example, set to 800M/s, and if the receiving end detects that the hopping rate of the signal sent by the transmitting end is lower than 800M/s, it determines that the optical protocol currently used by the transmitting end is the 100M optical protocol, and if the receiving end also currently uses the 100M optical protocol, the two parties can directly establish a connection; if the receiving end currently uses the 1000M module, the receiving end and the transmitting end cannot directly establish connection, and the receiving end switches the optical protocol of the local end to the 100M optical protocol and then establishes connection with the transmitting end.
As another preferred embodiment, the judgment unit is preset with a second threshold and a third threshold, and the judgment unit compares the jump rate with the second threshold and the third threshold respectively:
if the jump rate is in the error range around the second threshold value, the transmitting end sends data by adopting 1000BASEX transmission standard;
and if the jump rate is in the error range around the third threshold value, the transmitting end adopts the 100M transmission standard to transmit data.
Specifically, the second threshold may be set to 1.25G/s, the third threshold is set to 125M/s, and when the jump rate of the detected signal fluctuates within an error range of 1.25G/s, for example, 1.1 to 1.25G/s, it indicates that the transmitting end currently uses 1000base transmission standard to transmit data; when the jump rate of the detected signal fluctuates within an error range of 125M/s, for example, 100-125M/s, it indicates that the transmitting end currently uses the 100BASEX transmission standard to transmit data.
In a preferred embodiment, as shown in fig. 1, the standard switching module 203 further comprises:
a timing unit 2034 connected to the switching unit 2033, the timing unit is configured to start timing after the switching unit performs a switching operation, and prevent the switching unit from performing the switching operation again within a predetermined timing period.
Specifically, in this embodiment, a timing unit is provided at the receiving end, and the switching unit can perform switching only once within a preset timing period. The timing period is preferably greater than or equal to 1ms, that is, the switching unit does not perform switching again in the next 1ms after switching the optical protocol, so as to avoid frequent switching by the switching unit, which results in that the receiving end and the transmitting end cannot be connected all the time.
The invention also provides an adaptive method of optical fiber transmission standard, as shown in fig. 2, which is applied to the adaptive system in the above technical solution, and comprises the following steps:
step S1, the photoelectric conversion module receives the optical signal emitted by the emitting end and converts the optical signal into an electrical signal;
step S2, the connection determining module determines whether the sending end and the receiving end establish a communication connection:
if yes, the standard switching module is deactivated;
if not, the standard switching module is enabled, and the process goes to step S3;
step S3, the signal detection unit receives the electric signal and continuously detects and outputs the jump rate of the electric signal;
step S4, the judging unit judges the transmission standard used by the transmitting terminal at present according to the jump rate and outputs the judging result;
in step S5, the switching unit enables the optical protocol corresponding to the transmission standard currently used by the transmitting end according to the determination result, so that the transmitting end and the receiving end establish a communication connection.
Specifically, in this embodiment, the standard switching module is enabled only when the transmitting end and the receiving end cannot establish a communication connection. When the receiving end cannot establish communication connection with the transmitting end, firstly, an optical signal sent by the transmitting end is collected and converted into an electrical signal, and then the hopping rate of the electrical signal is detected, because the transmission rate of a 1000M optical protocol is faster and is about 1.25G/s, and the transmission rate of a 100M optical protocol is far lower than the 1000M optical protocol and is about 125M/s, a first threshold value can be preset in a judging unit of the receiving end, the first threshold value is higher than the hopping rate of the 100M optical protocol, for example, set to be 800M/s, if the receiving end detects that the hopping rate of the signal sent by the transmitting end is lower than 800M/s, the optical protocol currently used by the transmitting end is judged to be the 100M optical protocol, and the 100M optical protocol is started by the receiving end; if the receiving end detects that the hopping rate of the signal sent by the transmitting end is higher than 800M/s, the optical protocol currently used by the transmitting end is judged to be 1000M optical protocol, and the receiving end starts the 1000M optical protocol.
Through the technical scheme, the receiving end can actively detect the received signal so as to automatically adapt to the transmission standard of the other side, so that the transmission standards used by the physical layer chips at the two ends are consistent, the physical layer chips do not need to be manually configured by a user, and the use convenience of the user is improved; meanwhile, the randomness of optical protocol switching in the prior art is solved, and the time for establishing connection between the two parties is effectively reduced.
In a preferred embodiment, in step S5, after the switching unit enables the optical protocol corresponding to the transmission standard currently used by the transmitting end according to the determination result, the method further includes the following steps:
step S51, when the switching unit starts timing according to the judgment result, the optical protocol corresponding to the transmission standard currently used by the transmitting terminal is started, and the switching unit is prohibited from starting other optical protocols again;
in step S52, after the timer exceeds a preset timer period, the switching unit is allowed to start other optical protocols again.
Specifically, in this embodiment, a timing unit is provided at the receiving end, and the switching unit can perform switching only once within a preset timing period. The preset timing period is preferably greater than or equal to 1ms, that is, the switching unit does not perform switching again in the next 1ms after switching the optical protocol, so as to avoid frequent switching of the switching unit, which results in that the receiving end and the transmitting end cannot be connected all the time.
The technical scheme of the invention has the beneficial effects that: a receiving end judges the optical protocol used by the transmitting end by actively detecting the signal sent by the transmitting end, and when the optical protocols used by the two parties are different, the receiving end switches the self-adaptation to be consistent with the transmitting end, thereby bringing great convenience to the use of users; meanwhile, due to the active detection of the receiving end, the randomness of switching time is avoided, and the time for establishing communication connection is effectively reduced.
While the invention has been described with reference to a preferred embodiment, it will be understood by those skilled in the art that various changes in form and detail may be made therein without departing from the spirit and scope of the invention.