CN108667515B - Port configuration method and communication equipment - Google Patents
Port configuration method and communication equipment Download PDFInfo
- Publication number
- CN108667515B CN108667515B CN201810365875.XA CN201810365875A CN108667515B CN 108667515 B CN108667515 B CN 108667515B CN 201810365875 A CN201810365875 A CN 201810365875A CN 108667515 B CN108667515 B CN 108667515B
- Authority
- CN
- China
- Prior art keywords
- value
- register
- optical
- optical module
- port
- Prior art date
- Legal status (The legal status 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 status listed.)
- Active
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04B—TRANSMISSION
- H04B10/00—Transmission systems employing electromagnetic waves other than radio-waves, e.g. infrared, visible or ultraviolet light, or employing corpuscular radiation, e.g. quantum communication
- H04B10/40—Transceivers
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04Q—SELECTING
- H04Q11/00—Selecting arrangements for multiplex systems
- H04Q11/0001—Selecting arrangements for multiplex systems using optical switching
- H04Q11/0062—Network aspects
- H04Q11/0071—Provisions for the electrical-optical layer interface
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Physics & Mathematics (AREA)
- Electromagnetism (AREA)
- Signal Processing (AREA)
- Optical Communication System (AREA)
Abstract
The application provides a port configuration method and communication equipment, wherein the communication equipment comprises an optical port, an in-place register and a plug flag register, and the in-place register is connected with the optical port through a circuit line. And setting the value of the plugging flag register according to the level jump condition of the circuit line. Determining whether an optical module is currently on the optical port according to the value of the on-position register, determining whether the optical module on the optical port is pulled out according to the value of the plugging flag register, and configuring the optical port according to a configuration instruction set corresponding to the insertion of the optical module when the current optical module on the optical port is determined to be on the position and the optical module on the optical port is not pulled out; and when determining that no optical module is in place at present on the optical port and/or the optical module on the optical port is pulled out, configuring the optical port according to a configuration instruction set corresponding to the pulling-out of the optical module. Thus, port configuration errors caused by the fact that the operation of instant extraction and insertion cannot be sensed can be avoided.
Description
Technical Field
The present application relates to the field of communications technologies, and in particular, to a port configuration method and a communication device.
Background
A small form-factor pluggable (SFP) transceiver (also called an optical module) is a small pluggable optical transceiver, which is a key device used on interface boards of most communication devices (e.g., switches). In practical application, when an optical module is inserted into an optical port of an interface board, a corresponding insertion configuration instruction set is executed, and when the optical module is pulled out from the interface board, a corresponding pull configuration instruction set is executed.
At present, whether an optical module is in place on an optical port is mainly recorded through an in-place register, and then the value of the in-place register is polled, so that whether the optical module is plugged in or pulled out is judged according to the change of the in-place state of the optical module detected twice adjacent to each other, and then a corresponding configuration instruction set is executed.
However, when the optical module on the optical port is quickly plugged and inserted in the process of configuring the optical port, since the speed of plugging and unplugging the optical module is fast, the detection results of the communication device before and after two times are all that the optical module is in place, the plugging and unplugging process cannot be sensed, and the plugging and unplugging configuration instruction set is still executed according to the previous detection result, so that the executed configuration instruction set does not conform to the actual situation, and configuration errors are caused.
Disclosure of Invention
In view of the above, an object of the present application is to provide a port configuration method and a communication device, so as to improve the above problem.
In order to achieve the above purpose, the embodiment of the present application adopts the following technical solutions:
in a first aspect, an embodiment of the present application provides a port configuration method, which is applied to a communication device, where the communication device includes an optical port, a bit register, and a plug flag register, where the bit register and the optical port are connected by a circuit line, and a level of the circuit line generates a corresponding jump when an optical module is plugged in or plugged out on the optical port to prompt a value of the bit register to be changed, and the method includes:
setting the value of a plugging flag register according to the level jump condition of a circuit line;
reading the value of an in-place register and the value of the plug flag register every interval preset time length, determining whether an optical module is in place at the optical port currently according to the value of the in-place register, and determining whether the optical module at the optical port is plugged out according to the value of the plug flag register;
when the optical module is in place at present on the optical port and the optical module on the optical port is not pulled out, configuring the optical port according to a configuration instruction set corresponding to the insertion of the optical module;
and when determining that no optical module is in place at present on the optical port and/or the optical module on the optical port is pulled out, configuring the optical port according to a configuration instruction set corresponding to the pulling-out of the optical module.
Optionally, in the port configuration method provided in the first aspect of the embodiment of the present application, the method further includes: and when the optical module on the optical port is determined to be pulled out, resetting the value of the pull-out flag register.
Optionally, in the port configuration method provided in the first aspect of the embodiment of the present application, after reading values of the bit register and the plug flag register, the method further includes:
judging whether the read value of the in-place register is the same as the last value of the in-place register and judging whether the read value of the plugging flag register is the same as the last value of the plugging flag register;
if the judgment results are the same, determining whether an optical module is currently in place on the optical port according to the value of the in-place register, and determining whether the optical module on the optical port is pulled out according to the value of the plug flag register.
Optionally, in the port configuration method provided in the first aspect of the embodiment of the present application, the communication device further includes a programmable logic device, and the bit register and the plug flag register are registers in the programmable logic device; the method for setting the value of the plug flag register according to the level jump condition of the circuit line comprises the following steps:
the programmable logic device detects the circuit line at intervals of a preset clock period, and when the level of the circuit line is detected to generate a jump corresponding to the action of pulling out the optical module, the value of the plugging flag register is set to be a preset value so as to indicate that the optical module on the optical port is pulled out.
Optionally, in the port configuration method provided in the first aspect of the embodiment of the present application, the method further includes: and when the programmable logic device detects that the level of the circuit line is changed from high level to low level, determining that the level of the circuit line sends a jump corresponding to the action of pulling out the optical module.
In a second aspect, an embodiment of the present application further provides a communication device, including an optical port, an in-place register, and a plug flag register, where the in-place register is connected to the optical port through a circuit line, and a level of the circuit line generates a corresponding jump when an optical module is plugged in or pulled out from the optical port to prompt a value of the in-place register to be changed;
the communication equipment is used for setting the value of the plug flag register according to the level jump condition of the circuit line, reading the value of the on-position register and the value of the plug flag register at intervals of preset duration, determining whether an optical module is on position at the optical port currently according to the value of the on-position register, and determining whether the optical module on the optical port is pulled out according to the value of the plug flag register;
the communication equipment is also used for configuring the optical port according to a configuration instruction set corresponding to the insertion of the optical module when the current optical module on the optical port is determined to be in place and the optical module on the optical port is not pulled out; and determining that no optical module is currently pulled out of the corresponding configuration instruction set on the optical port to configure the optical port.
Optionally, in the communication device provided in the second aspect of the embodiments of the present application, the communication device is further configured to reset a value of the plug flag register when it is determined that the optical module on the optical port is plugged out.
Optionally, in the communication device provided in the second aspect of the embodiment of the present application, after reading the values of the in-place register and the plug flag register, the communication device is further configured to determine whether the read value of the in-place register is the same as the last value of the in-place register, determine whether the read value of the plug flag register is the same as the last value of the plug flag register, and determine whether the optical module on the optical port is pulled out according to the value of the plug flag register when the determination results are the same.
Optionally, in the communication device provided in the second aspect of the embodiment of the present application, the communication device further includes a programmable logic device, and the bit register and the plug flag register are registers in the programmable logic device;
the programmable logic device is used for detecting the circuit line at intervals of a preset clock period, and setting the value of the plugging flag register as a preset value when detecting that the level of the circuit line jumps corresponding to the action of plugging out the optical module, so as to indicate that the optical module on the optical port is plugged out.
Optionally, in the communication device provided in the second aspect of the embodiments of the present application, the programmable logic device is further configured to determine that a level of the circuit line has a jump corresponding to an action of pulling out the optical module when it is detected that the level of the circuit line jumps from a high level to a low level.
Compared with the prior art, the embodiment of the application has the following beneficial effects:
the communication device comprises an optical port, an in-place register and a plug flag register, wherein the in-place register is connected with the optical port through a circuit line, and the level of the circuit line generates corresponding jump when an optical module is plugged in or pulled out of the optical port so as to change the value of the in-place register. The communication equipment sets the value of the plug flag register according to the level jump condition of the circuit line, reads the value of the on-position register and the value of the plug flag register at intervals of preset duration, determines whether an optical module is on position at the optical port currently according to the value of the on-position register, and determines whether the optical module on the optical port is pulled out according to the value of the plug flag register. And when the optical module is determined to be in place at present on the optical port and the optical module on the optical port is not pulled out, configuring the optical port according to a configuration instruction set corresponding to the in-place position of the optical module. And when determining that no optical module is in place at present on the optical port and/or the optical module on the optical port is pulled out, configuring the optical port according to a configuration instruction set corresponding to the optical module out of place. Through the process, the port configuration error caused by the fact that the action of instantly pulling out and inserting the optical module cannot be sensed can be avoided.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained from the drawings without inventive effort.
Fig. 1 is a connection block diagram of a communication device according to an embodiment of the present disclosure;
fig. 2 is a schematic flowchart of a port configuration method according to an embodiment of the present application;
fig. 3 is a connection block diagram of another communication device provided in an embodiment of the present application;
fig. 4 is a flowchart illustrating a port configuration method according to an embodiment of the present application;
fig. 5 is a second flowchart illustrating a port configuration method according to an embodiment of the present application;
fig. 6 is a third schematic flowchart of a port configuration method according to an embodiment of the present application;
fig. 7 is a fourth flowchart illustrating a port configuration method according to an embodiment of the present application.
Icon: 10. 30-a communication device; 11. 31-a processor; 12. 32-programmable logic devices; 121. 321-a bit register; 122. 322-plug flag register; 13. 33, 34, 35-light port.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. 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 application.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
In a communication device including an optical port, a presence register (Present) is generally provided, and the optical port is connected to the presence register through a circuit line, and when an optical module is inserted into or pulled out of the optical port, a level of the circuit line is changed, for example, the level of the circuit line is pulled down or pulled up. When the level of the circuit line changes, the value of the on-bit register connected with the circuit line changes. For example, when the level of the circuit line is pulled high, the value of the bit register is set to 1; when the level of this circuit line is pulled low, the value in the bit register is set to 0.
The inventors have found that in some embodiments, it is common to poll the bit register to read the value of the bit register, and determine whether the optical module is currently in place on the optical port according to the read value. Then comparing the results of the two polling, when the optical module is found to be changed from in-place to out-of-place, determining that the optical module on the optical port is pulled out, and performing a series of configuration on the optical port according to a configuration instruction set corresponding to the pulling-out action; when the optical module is found to be changed from no-in-place to in-place, if it is determined that the optical module is inserted into the optical port, the optical port needs to be configured in a series according to a configuration instruction set corresponding to the insertion motion.
However, the above-described method cannot sense the quick removal and reinsertion operation. For example, if it is detected that an optical module on a certain optical port is changed from no place to a place at a certain time, it is determined that an optical module is inserted into the optical port, and at this time, the communication device executes a series of configuration instruction sets corresponding to the insertion action to configure the optical port. If the optical module on the optical port is quickly pulled out and then inserted again in the process of executing the configuration instruction set, the optical module on the optical port may be inserted again when the communication device reads the value of the bit register again, that is, when the communication device reads the value of the bit register again, the value of the bit register changes from "not in bit" to "in bit". For the communication device, that is, the results of polling the presence register twice consecutively are all that the optical module is "in place", so that it can be determined that the optical module is not pulled out, and the configuration is continued according to the configuration instruction set corresponding to the insertion action, which causes a configuration error, and in a serious case, even may cause the port to be unusable, such as the port not UP.
Based on the above-mentioned drawbacks, embodiments of the present application provide a port configuration method and a communication device, which will be described in detail below.
As shown in fig. 1, which is a block schematic diagram of a communication device 10 provided in the embodiment of the present application, the communication device 10 includes a processor 11, a bit register 121, a plug flag (plug _ flag) register 122, and an optical port 13, where the optical port 13 is electrically connected to the bit register 121 through a circuit line, and the bit register 121 and the plug flag register 122 are electrically connected to the processor 11.
In this embodiment, the communication device 10 may set the value of the plug flag register 122 according to the level transition condition of the circuit line to indicate whether the optical module on the optical port 13 has been plugged out.
Optionally, in this embodiment, the communication device 10 may further include a programmable logic device 12, and the bit register 121 and the plug flag register 122 may be registers in the programmable logic device 12. The Programmable Logic Device 12 may be a Complex Programmable Logic Device (CPLD) or a Field-Programmable Gate Array (FPGA).
Fig. 2 is a schematic flowchart of a port configuration method applied to the communication device 10 shown in fig. 1 according to an embodiment of the present disclosure, and details of the port configuration method will be described below.
Step S201, setting the value of the plugging flag register 122 according to the level jump condition of the circuit line.
The step S201 may be implemented by the programmable logic device 12, and in detail, may be implemented by the following steps:
the programmable logic device 12 detects the circuit line at preset clock cycles at intervals, and sets the value of the plug flag register 122 to a preset value when detecting that the level of the circuit line jumps corresponding to the action of pulling out the optical module, so as to indicate that the optical module on the optical port 13 is pulled out.
In practice, the plug flag register 122 may be set according to the specific circuit between the optical port 13 and the bit register 121.
For example, when an optical module is inserted into the optical port 13 of the communication device 10, the level of the circuit line jumps from a low level to a high level; when the optical module is pulled out from the optical port 13 of the communication device 10, the level of the circuit line jumps from the high level to the low level. In view of the above situation, the programmable logic device 12 may set the value of the plug flag register 122 to the preset value, for example, 1, when detecting that the level of the circuit line jumps from the high level to the low level, so as to indicate that the optical module on the optical port 13 is unplugged.
For another example, when an optical module is inserted into the optical port 13 of the communication device 10, the level of the circuit line jumps from a high level to a low level; when the optical module is pulled out from the optical port 13 of the communication device 10, the level of the circuit line jumps from low level to high level. For this situation, when detecting that the level of the circuit line jumps from the low level to the high level, the programmable logic device 12 may set the value of the plug flag register 122 to the preset value, so as to indicate that the optical module on the optical port 13 is plugged out.
In some ways, the processor 11 polls the bit register 121 to determine whether the optical module is unplugged, which is actually implemented by a software module running in the processor 10.
In this embodiment, the programmable logic device 12 is implemented based on a hardware circuit, the operation speed is very fast, whether the level of the circuit line jumps or not can be detected by polling according to the clock cycle, and compared with polling by a software module, the clock cycle of the programmable logic device 12 is usually in the microsecond level, the time is very short, and the detection of the rapid optical module pulling-out action can be ensured.
The preset clock period may be one clock period, two clock periods, or multiple clock periods, and may be set according to the required detection accuracy, which is not limited in this embodiment.
Step S202, reading the value of the in-place register 121 and the value of the plug flag register 122 every preset time interval, determining whether an optical module is currently in place on the optical port 13 according to the value of the in-place register 121, and determining whether the optical module on the optical port 13 is pulled out according to the value of the plug flag register 122.
The preset time period may be flexibly set, for example, may be 1ms, 2ms, 10ms, and the like, which is not limited in this embodiment.
It should be understood that, in the present embodiment, there is no limitation on the order of reading the bit register 121 and the plug flag register 122, and there is no limitation on the order of determining the bit state of the optical module according to the value of the bit register 121 and determining whether the optical module is plugged out according to the value of the plug flag register 122.
Alternatively, in this embodiment, after reading the value of the bit register 121 and the value of the plug flag register 122, the processor 11 of the communication device 10 may determine whether the read value of the bit register 121 is the same as the last value of the bit register 121, and determine whether the read value of the plug flag register 122 is the same as the last value of the plug flag register 122.
If the judgment results are the same, determining whether an optical module is currently in place on the optical port according to the value of the in-place register 121, and determining whether the optical module on the optical port is pulled out according to the value of the plug flag register 122.
The reason is that, when neither the value of the bit register 121 nor the value of the insertion/extraction flag register 122 changes, it indicates that the optical module is not inserted or extracted in the period between the last detection and the current detection, and the previous arrangement can be maintained.
If at least one of the two determination results is different, that is, the value of the read in-place register 121 is different from the value of the last read in-place register 121, and/or the value of the read plug flag register 122 is different from the value of the last read plug flag register 122, it may be determined that an insertion or extraction action of the optical module occurs during the process, and the configuration of the optical port needs to be performed again. It is thus possible to determine what configuration should be performed according to the read value of the in-bit register 121 and the value of the plug flag register 122.
Step S203, when it is determined that there is an optical module currently in place on the optical port 13 and the optical module on the optical port 13 is not pulled out, configuring the optical port 13 according to a configuration instruction set corresponding to the insertion of the optical module.
In this case, it can be determined that the optical module is inserted, and the optical module is not pulled out too fast and then inserted, and further, the optical port 13 can be configured according to the configuration instruction set corresponding to the insertion of the optical module, for example, the related information of the optical module is acquired, and the operating mode, the communication rate, the full duplex/half duplex, and the like of the optical port 13 are configured.
Step S204, when it is determined that no optical module is currently in place on the optical port 13 and/or the optical module on the optical port 13 is pulled out, configuring the optical port 13 according to a configuration instruction set corresponding to the optical module pulling-out.
In this case, it is indicated that the optical module is removed, and the optical port 13 can be arranged according to the arrangement instruction set corresponding to the optical module removing operation.
In this embodiment, the programmable logic device 12 periodically detects a level jump condition of a circuit line, and sets the value of the plug flag register 122 according to the detection result, so that the value of the plug flag register 122 can be reset every time the optical module on the optical port 13 is determined to be pulled out according to the value of the plug flag register 122, so that the programmable logic device 12 can continue to set in the plug flag register 122 in a subsequent process, thereby recording whether the optical module is pulled out between the previous detection time and the current time in real time.
In practical applications, as shown in fig. 3, there may be multiple optical ports on the communication device 30, such as optical port 33, optical port 34, and optical port 35 shown in fig. 3. The bit register 321 may be electrically connected to the plurality of optical ports through the circuit lines, respectively, where the circuit lines may be communication buses. In this case, a plurality of flag bits are included in the bit register 321, and each flag bit corresponds to one optical port. Correspondingly, the plug flag register 322 may also include a plurality of flag bits, and each flag bit corresponds to one optical port.
In this embodiment, different flag bits of the bit register 321 and the plug flag register 322 may have different addresses, and a flag bit corresponding to any optical port may be determined according to the addresses.
When the communication device 30 includes a plurality of optical ports, the processor 31 of the communication device 30 may sequentially read the values of the flag bits corresponding to the plurality of optical ports from the bit register 321 and the plug flag register 322 at preset time intervals, and then determine the configuration to be executed on the optical port according to the read values.
A specific example will be given below in conjunction with fig. 4 to 7 to explain in detail a port configuration method applied to the communication device 30 shown in fig. 3.
It is assumed that in the communication device 30 shown in fig. 3, when an optical module is inserted into any optical port, a flag bit corresponding to the optical port in the bit register 321 is set to a high level; when an optical module on any optical port is pulled out, the flag bit corresponding to the optical port in the bit register 321 is set to a low level; when the programmable logic device 32 detects that the level of the circuit line jumps from the high level to the low level, the flag bit corresponding to the optical port in the plug flag register 322 is set to 1. Based on this, the port configuration method may include the following steps.
In step S401, the processor 31 of the communication device 30 executes the optical port polling task at preset intervals, and reads the value of the flag bit corresponding to the optical port 33 in the bit register 321 and the value of the flag bit corresponding to the optical port 33 in the plug flag register 322 each time the optical port polling task is executed.
Assume that the value corresponding to the optical port 33 read from the bit register last time is 1, and the value corresponding to the optical port 33 read from the plug flag register is 0. If the value corresponding to the optical port 33 read from the bit register at this time is 1 and the value corresponding to the optical port 33 read from the plug flag register is 0, steps S402 and S403 shown in fig. 4 may be executed.
In step S402, it is determined that the value of the flag bit corresponding to the optical port 33 in the read bit register 321 is the same as the value of the flag bit corresponding to the optical port 33 in the last read bit register 321, and the value of the flag bit corresponding to the optical port 33 in the read plug flag register 322 is the same as the value of the flag bit corresponding to the optical port 33 in the last read plug flag register 322, so that the optical port 33 is skipped, and step S403 is performed.
In step S403, the value of the flag bit corresponding to the optical port 34 in the bit register 321 and the value of the flag bit corresponding to the optical port 34 in the plug/unplug flag register 322 are read.
If the value corresponding to the optical port 33 read from the bit register at this time is 1 and the value corresponding to the optical port 33 read from the plug flag register is 1, steps S504 and S505 shown in fig. 5 may be executed.
In step S504, it is determined by judgment that the value of the flag bit corresponding to the optical port 33 in the read plug flag register 322 is different from the value of the flag bit corresponding to the optical port 33 in the last plug flag register 322.
Step S505 is to determine that the optical module is currently located on the optical port 33 according to the read value, and the optical module on the optical port 33 is pulled out, execute the configuration instruction set corresponding to the optical module pull-out to configure the optical port 33, set the flag position corresponding to the optical port 33 in the pull-out flag register 322 to 0, and execute step S403.
If the value corresponding to the optical port 33 read from the bit register at this time is 0 and the value corresponding to the optical port 33 read from the plug flag register is 1, steps S606 and S607 shown in fig. 6 may be executed.
In step S606, it is determined by determining that the value of the flag bit corresponding to the optical port 33 in the read bit register 321 is different from the value of the flag bit corresponding to the optical port 33 in the last read bit register 321, and the value of the flag bit corresponding to the optical port 33 in the read plug flag register 322 is different from the value of the flag bit corresponding to the optical port 33 in the last read plug flag register 322.
Step S607, determining that no optical module is currently located on the optical port 33 according to the read value, and the optical module on the optical port 33 is pulled out, executing a configuration instruction set corresponding to the optical module pull-out to configure the optical port 33, setting the flag position corresponding to the optical port 33 in the pull-out flag register 322 to be 0, and executing step S403.
When the value corresponding to the optical port 33 read from the bit register 321 at this time is 0 and the value corresponding to the optical port 33 read from the plug flag register 322 is 0, the procedure shown in fig. 7 may be executed.
In step S708, it is determined by the judgment that the value of the flag bit corresponding to the optical port 33 in the read bit register 321 is different from the value of the flag bit corresponding to the optical port 33 in the bit register 321 read last time.
Step S709, determining that no optical module is currently in place on the optical port 33 according to the read value, and no optical module pulling-out action occurs on the optical port 33, executing a configuration instruction set corresponding to optical module pulling-out to configure the optical port 33, and executing step S403.
In the present embodiment, the detection process for the light ports 34 and 35 is similar to the detection process for the light port 33. When the optical ports 33, 34 and 35 are polled, the optical port polling task is finished once, and the process is repeated when the next interval is reached.
In summary, the present application provides a port configuration method and a communication device, where the communication device includes an optical port, an in-place register and a plug flag register, and the in-place register is connected to the optical port through a circuit line. And setting the value of the plugging flag register according to the level jump condition of the circuit line. Determining whether an optical module is currently on the optical port according to the value of the on-position register, determining whether the optical module on the optical port is pulled out according to the value of the plugging flag register, and configuring the optical port according to a configuration instruction set corresponding to the insertion of the optical module when the current optical module on the optical port is determined to be on the position and the optical module on the optical port is not pulled out; and when determining that no optical module is in place at present on the optical port and/or the optical module on the optical port is pulled out, configuring the optical port according to a configuration instruction set corresponding to the pulling-out of the optical module. Thus, port configuration errors caused by the fact that the operation of instant extraction and insertion cannot be sensed can be avoided.
In the several embodiments provided in the embodiments of the present application, it should be understood that the disclosed system and method may be implemented in other ways. The system and method embodiments described above are merely illustrative, for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, the functional modules in the embodiments of the present invention may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims (10)
1. A port configuration method is applied to communication equipment which comprises an optical port, a bit register and a plug flag register, wherein the bit register is connected with the optical port through a circuit line, and the level of the circuit line generates corresponding jump when an optical module is plugged in or pulled out of the optical port so as to promote the value of the bit register to change, and the method comprises the following steps:
setting the value of the plug flag register according to the level jump condition of the circuit line;
reading the value of the on-position register and the value of the plug flag register every interval preset time, determining whether an optical module is on position on the optical port currently according to the value of the on-position register, and determining whether the optical module on the optical port is pulled out according to the value of the plug flag register;
when it is determined that the current optical module is in place on the optical port and the optical module on the optical port is not pulled out, configuring the optical port according to a configuration instruction set corresponding to the insertion of the optical module;
and when determining that no optical module is in place at present on the optical port and/or the optical module on the optical port is pulled out, configuring the optical port according to a configuration instruction set corresponding to the pulling-out of the optical module.
2. The port configuration method of claim 1, further comprising:
and when the optical module on the optical port is determined to be pulled out, resetting the value of the pull-out mark register.
3. A port configuration method according to claim 1 or 2, characterized in that after reading the values of said bit register and said plug flag register, the method comprises:
judging whether the read value of the in-place register is the same as the last value of the in-place register and judging whether the read value of the plug flag register is the same as the last value of the plug flag register;
and if the judgment results are the same, determining whether an optical module is currently in place on the optical port according to the value of the in-place register, and determining whether the optical module on the optical port is pulled out according to the value of the plugging flag register.
4. The port configuration method according to claim 1 or 2, wherein the communication device further comprises a programmable logic device, and the bit register and the plug flag register are registers in the programmable logic device;
setting the value of the plugging flag register according to the level jump condition of the circuit line, comprising:
and the programmable logic device detects the circuit line at intervals of a preset clock period, and when the level of the circuit line is detected to generate jump corresponding to the action of pulling out the optical module, the value of the plugging flag register is set as a preset value so as to indicate that the optical module on the optical port is pulled out.
5. The port configuration method of claim 4, further comprising:
and when the programmable logic device detects that the level of the circuit line is changed from high level to low level, determining that the level of the circuit line generates jump corresponding to the action of pulling out the optical module.
6. A communication device is characterized by comprising an optical port, an in-place register and a plug flag register, wherein the in-place register is connected with the optical port through a circuit line, and the level of the circuit line generates corresponding jump when an optical module is plugged in or pulled out of the optical port so as to change the value of the in-place register;
the communication equipment is used for setting the value of the plug flag register according to the level jump condition of the circuit line, reading the value of the on-bit register and the value of the plug flag register at intervals of preset duration, determining whether an optical module is on the position on the optical port currently according to the value of the on-bit register, and determining whether the optical module on the optical port is pulled out according to the value of the plug flag register;
the communication equipment is also used for configuring the optical port according to a configuration instruction set corresponding to the insertion of the optical module when the optical module is determined to be in place at the present time on the optical port and the optical module on the optical port is not pulled out; and when determining that no optical module is in place at present on the optical port and/or the optical module on the optical port is pulled out, configuring the optical port according to a configuration instruction set corresponding to the pulling-out of the optical module.
7. The communication device of claim 6, further configured to reset the value of the plug flag register upon determining that a light module on the optical port is plugged out.
8. The communication device according to claim 6 or 7, wherein the communication device is further configured to, after reading the values of the on-site register and the plug flag register, determine whether the read value of the on-site register is the same as the last value of the on-site register, determine whether the read value of the plug flag register is the same as the last value of the plug flag register, and determine whether the optical module on the optical port has been pulled out according to the value of the plug flag register when the determination results are the same.
9. The communication device according to claim 6 or 7, wherein the communication device further comprises a programmable logic device, and the bit register and the plug flag register are registers in the programmable logic device;
the programmable logic device is used for detecting the circuit line at intervals of a preset clock cycle, and setting the value of the plugging flag register as a preset value when detecting that the level of the circuit line jumps corresponding to the action of pulling out the optical module, so as to indicate that the optical module on the optical port is pulled out.
10. The communication device according to claim 9, wherein the programmable logic device is further configured to determine that a transition corresponding to an action of pulling out the optical module occurs in the level of the circuit line when it is detected that the level of the circuit line is transitioned from the high level to the low level.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810365875.XA CN108667515B (en) | 2018-04-23 | 2018-04-23 | Port configuration method and communication equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810365875.XA CN108667515B (en) | 2018-04-23 | 2018-04-23 | Port configuration method and communication equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108667515A CN108667515A (en) | 2018-10-16 |
CN108667515B true CN108667515B (en) | 2020-01-14 |
Family
ID=63780824
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810365875.XA Active CN108667515B (en) | 2018-04-23 | 2018-04-23 | Port configuration method and communication equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108667515B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110430016B (en) * | 2019-08-01 | 2022-02-11 | 青岛海信宽带多媒体技术有限公司 | Data receiving method and device and optical module |
CN110677292A (en) * | 2019-09-27 | 2020-01-10 | 杭州迪普科技股份有限公司 | Optical interface rate configuration method and device |
CN111786912A (en) * | 2020-05-18 | 2020-10-16 | 深圳震有科技股份有限公司 | Switch port mode switching method, switch and storage medium |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102118660A (en) * | 2011-01-12 | 2011-07-06 | 中兴通讯股份有限公司 | Method and device for accessing optical module |
CN102590689A (en) * | 2011-01-14 | 2012-07-18 | 中兴通讯股份有限公司 | Device for detecting in-place of small form-factor pluggable (SFP) optical modules |
CN102955733A (en) * | 2012-11-12 | 2013-03-06 | 中兴通讯股份有限公司 | Method and device for detecting single board hot plug |
CN103701725A (en) * | 2013-12-20 | 2014-04-02 | 上海斐讯数据通信技术有限公司 | Hot plug method for switch router 40G interface |
CN105656546A (en) * | 2014-11-13 | 2016-06-08 | 中兴通讯股份有限公司 | Method and device for filtering optical signal lost signal burr |
CN105790830A (en) * | 2014-12-26 | 2016-07-20 | 华为技术有限公司 | Optical module in-situ detection method and device |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7689751B2 (en) * | 2008-02-15 | 2010-03-30 | Sun Microsystems, Inc. | PCI-express system |
CN101951343A (en) * | 2010-09-21 | 2011-01-19 | 北京星网锐捷网络技术有限公司 | Device, network switching equipment and method for realizing port configuration |
KR20160118207A (en) * | 2013-09-24 | 2016-10-11 | 콤스코프 테크놀로지스, 엘엘씨 | Pluggable active optical module with managed connectivity support and simulated memory table |
CN106294040B (en) * | 2015-06-11 | 2020-07-03 | 中兴通讯股份有限公司 | Method and device for acquiring optical module state information |
CN107547265B (en) * | 2017-07-28 | 2020-12-04 | 新华三技术有限公司 | Port configuration method and device |
-
2018
- 2018-04-23 CN CN201810365875.XA patent/CN108667515B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102118660A (en) * | 2011-01-12 | 2011-07-06 | 中兴通讯股份有限公司 | Method and device for accessing optical module |
CN102590689A (en) * | 2011-01-14 | 2012-07-18 | 中兴通讯股份有限公司 | Device for detecting in-place of small form-factor pluggable (SFP) optical modules |
CN102955733A (en) * | 2012-11-12 | 2013-03-06 | 中兴通讯股份有限公司 | Method and device for detecting single board hot plug |
CN103701725A (en) * | 2013-12-20 | 2014-04-02 | 上海斐讯数据通信技术有限公司 | Hot plug method for switch router 40G interface |
CN105656546A (en) * | 2014-11-13 | 2016-06-08 | 中兴通讯股份有限公司 | Method and device for filtering optical signal lost signal burr |
CN105790830A (en) * | 2014-12-26 | 2016-07-20 | 华为技术有限公司 | Optical module in-situ detection method and device |
Non-Patent Citations (1)
Title |
---|
交换机独立验证平台中设备和接口管理的设计与实现;孟娜娜;《中国优秀硕士学位论文全文数据库 信息科技辑》;20160515;第I136-161页 * |
Also Published As
Publication number | Publication date |
---|---|
CN108667515A (en) | 2018-10-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108667515B (en) | Port configuration method and communication equipment | |
CN103399254A (en) | Board in-situ detection method and device | |
TWI521378B (en) | Apparatus and method for detecting fault injection | |
CN112463689B (en) | OCP card hot plug device, method and computer readable storage medium | |
CN106294040B (en) | Method and device for acquiring optical module state information | |
WO2017032265A1 (en) | Application push method and apparatus, and a serving device | |
CN104063296A (en) | Veneer in-place state detection method and device | |
CN103546704A (en) | Method and television for recognizing USB (universal serial bus) devices plugged in television | |
CN105573884A (en) | Multi-TF-card plugging and unplugging detection method and system | |
CN111736678B (en) | Chip reset circuit, method and equipment | |
CN105354116A (en) | Hot-plug detection method, apparatus, system and mobile terminal | |
CN106776054A (en) | A kind of deadlock detection method, device and circuit | |
CN102339236B (en) | Method for detecting pluggable storage device and electronic device | |
DE102014206752A1 (en) | Determining the state of an I2C bus | |
CN107423196B (en) | Multi-card-slot state detection method, detection equipment and mobile terminal | |
CN108369565B (en) | Communication device, communication method, storage medium, and communication system | |
CN110990316B (en) | Method and programmable logic circuit for outputting hot-swap device status | |
CN110851297A (en) | Method, device, system and medium for processing interface jitter state | |
CN113177063A (en) | Thermal reset method and related device of PCI bus equipment | |
CN111290915A (en) | Multipath equipment shielding system, method, equipment and readable storage medium | |
CN112235221B (en) | BPSK signal decoding method and device | |
CN100576894C (en) | Menu setting system and method to set up | |
US20140201420A1 (en) | Transmission interface system with detection function and method | |
CN105100344A (en) | Hot plug processing method for user recognition module card, and mobile terminal | |
CN113765504A (en) | Universal dynamic delay jitter elimination method, device, terminal and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right |
Effective date of registration: 20230612 Address after: 310052 11th Floor, 466 Changhe Road, Binjiang District, Hangzhou City, Zhejiang Province Patentee after: H3C INFORMATION TECHNOLOGY Co.,Ltd. Address before: 310052 Changhe Road, Binjiang District, Hangzhou, Zhejiang Province, No. 466 Patentee before: NEW H3C TECHNOLOGIES Co.,Ltd. |
|
TR01 | Transfer of patent right |