Automatic serial port identification device and method
Technical Field
The invention relates to the technical field of communication, in particular to a serial port automatic identification device and method.
Background
With the development of computer networks and the rise of the internet, more and more intelligent instruments are connected to the network, which becomes a trend. After the Ethernet is accessed, the sharing and remote management of data can be realized.
The non-service port on the single board comprises a serial port and a network port. The serial port is one of the commonly used debugging interfaces of the single board, and is the most commonly used and basic interface for single board hardware debugging and problem location. The serial port is an interface initialized earliest after a Central Processing Unit (CPU) is started, and can output an initialization process of the CPU to the single board hardware and issue a control command. The network port is a high-speed interface directly output by the CPU, and can be used for communication with large data volume such as service software in equipment.
An ethernet switch is a device that connects various servers and terminals and is responsible for receiving and forwarding data between them. In the field of switches, serial port lines of different manufacturers need to be debugged and tested, and then serial port lines of corresponding manufacturer equipment are selected.
However, in the actual use or maintenance process, if the serial port line of the corresponding manufacturer equipment is forgotten to be taken, the serial port line cannot be logged in due to different serial port line sequences, great inconvenience is brought to maintenance and debugging, waste of manpower and material resources is caused, and the time efficiency of first-aid repair is delayed.
Disclosure of Invention
In view of the above disadvantages of the prior art, an object of the present invention is to provide an automatic serial port identification apparatus and method, which are used to solve the problems in the prior art that login is impossible due to different serial port line sequences, maintenance and debugging are inconvenient, costs of labor and material resources are high, and first-aid repair timeliness is poor.
In order to achieve the above and other related objects, the present invention provides an automatic serial port identification device, which includes a power supply unit, an analog switch, and a central processing unit, wherein: the power supply unit is respectively connected with the analog switch and the central processing unit and is used for supplying power to the analog switch and the central processing unit; the central processing unit is respectively connected with the power supply unit and the analog switch, and is used for determining the line sequence type of the access equipment connected with the analog switch and triggering the analog switch to a port corresponding to the line sequence type of the access equipment.
In an embodiment of the invention, the power module obtains power through the DB9 port.
In an embodiment of the present invention, the central processing unit is an SCT15W203 chip.
In an embodiment of the invention, the analog switch is an FSUSB30MUX chip.
In an embodiment of the present invention, the analog switch is connected to the access device through an RJ45 port.
In an embodiment of the present invention, the access device is a switch.
Correspondingly, the invention also provides an automatic serial port identification method, which comprises the following steps: determining the line sequence type of access equipment connected with a central processing unit through an analog switch; and switching the analog switch to a port corresponding to the line sequence type of the access equipment according to the line sequence type of the access equipment.
In an embodiment of the present invention, the central processing unit is an SCT15W203 chip.
In an embodiment of the invention, the analog switch is an FSUSB30MUX chip.
In an embodiment of the present invention, the analog switch is connected to the access device through an RJ45 port.
As mentioned above, the serial port automatic identification device and method of the invention have the following beneficial effects:
the serial port automatic identification device is provided with a power supply unit, an analog switch and a central processing unit, wherein the power supply unit is used for supplying power to the analog switch and the central processing unit; the central processing unit is used for determining the line sequence type of the access equipment connected with the analog switch and triggering the analog switch to the port corresponding to the line sequence type of the access equipment. This serial ports automatic identification equipment can automatic identification access equipment line preface type to make analog switch over to the port that corresponds with access equipment line preface type, avoid because of the unable use or the debugging that serial ports line preface type is different and lead to, reduce manpower and material resources cost, improve the ageing of salvageing.
Furthermore, the total current of used device is less than 10mA among the serial ports automatic identification device, can directly adopt the serial ports to get the mode of electricity and provide the power, and power module accessible DB9 port gets the electricity among the serial ports automatic identification device promptly, makes serial ports automatic identification device use more convenient, and application range is wider.
Drawings
Fig. 1 is a schematic structural diagram of an automatic serial port identification apparatus according to an embodiment of the present invention.
Fig. 2 is a schematic structural diagram of a simulation switch in the automatic serial port identification device according to an embodiment of the present invention.
Fig. 3 is a schematic flow chart illustrating an automatic serial port identification method according to an embodiment of the present invention.
Description of the element reference numerals
1 serial port automatic identification device
11 power supply unit
12 central processing unit
13 analog switch
S11-S13
Detailed Description
The embodiments of the present invention are described below with reference to specific embodiments, and other advantages and effects of the present invention will be easily understood by those skilled in the art from the disclosure of the present specification. The invention is capable of other and different embodiments and of being practiced or of being carried out in various ways, and its several details are capable of modification in various respects, all without departing from the spirit and scope of the present invention. It is to be noted that the features in the following embodiments and examples may be combined with each other without conflict.
It should be noted that the drawings provided in the following embodiments are only for illustrating the basic idea of the present invention, and the components related to the present invention are only shown in the drawings rather than drawn according to the number, shape and size of the components in actual implementation, and the type, quantity and proportion of the components in actual implementation may be changed freely, and the layout of the components may be more complicated.
In the prior art, when the access equipment is debugged, used or maintained, due to different serial port line sequence types of equipment of different manufacturers, login cannot be performed, great inconvenience is caused to debugging, use or maintenance of the access equipment, waste of manpower and material resources is caused, and the time efficiency of first-aid repair is delayed. Therefore, if an automatic serial port identification device can be provided, when the access device is debugged, used or maintained, the port corresponding to the line sequence type of the access device can be automatically provided, so that various inconveniences can be avoided, the waste of manpower and material resources is reduced, and the timeliness of first-aid repair is improved.
Referring to fig. 1, the present invention provides a schematic structural diagram of an automatic serial port identification device. The serial port automatic identification device 1 in fig. 1 comprises a power supply unit 11, an analog switch 13 and a central processing unit 12; wherein,
the power supply unit 11 is respectively connected with the analog switch 13 and the central processing unit 12, and is used for supplying power to the analog switch 13 and the central processing unit 12;
the central processing unit 12 is connected to the power supply unit 11 and the analog switch 13, and is configured to determine a line sequence type of an access device connected to the analog switch 13, and trigger the analog switch 13 to switch to a port corresponding to the line sequence type of the access device.
In this embodiment, central processing unit 13 in this serial ports automatic identification device 1 can automatic identification access equipment line preface type to make analog switch 13 switch over to the port that corresponds with access equipment line preface type, avoid because of the unable use or the debugging that lead to of access equipment serial ports line preface type difference, reduce manpower and material resources cost, improve the timeliness of salvageing.
In another embodiment, the power module in the serial port automatic identification device gets power through the DB9 port. Because the total current that used device was less than 10mA among the serial ports automatic identification device, consequently can directly adopt the serial ports to get the mode of electricity and provide the power to it is more convenient to make serial ports automatic identification device use, and application range is wider.
In yet another embodiment, the central processor is an SCT15W203 chip. The analog switch may be a FSUSB30MUX chip. Specifically, the analog switch may be a FSUSB30MUX chip manufactured by fairchild corporation. The serial port identification device is simple in construction and material taking and easy to realize.
Fig. 2 is a schematic structural diagram of the serial port automatic identification device with the analog switch being an FSUSB30MUX chip. The OE and S signals are controlled by a central processor. In the operation of the analog switch in fig. 2:
when OE (output enable) is high, then the D +, D-signal will not be transmitted;
when OE is low, and S (select input) is low, D +, D-will be conducted with 1+, 1-respectively;
when OE is low and S is high, D +, D-will be on with 2+, 2-, respectively.
In yet another embodiment, the analog switch is connected to the access device through an RJ45 port. The access device is a switch. At this time, the central processing unit detects which line-sequential type switch the RJ45 port access device belongs to. If no response is made, the central processing unit is always in a detection state, and after the detection is OK, a detection OK instruction is sent, and the analog switch is controlled to be switched to a port corresponding to the line sequence type of the access equipment. Serial ports automatic identification equipment can effectively improve the convenience that the switch inserts in this embodiment, when the debugging of switch, use and maintenance, does not receive the port restriction, and is more convenient.
Correspondingly, when the access equipment is debugged, used or maintained, the problems that the access equipment cannot be logged in due to different serial port line sequence types of equipment of different manufacturers, the access equipment is inconvenient to debug, use or maintain, the cost of manpower and material resources is high, the emergency repair timeliness is poor and the like are solved.
Referring to fig. 3, the present invention provides a flow chart of a serial port automatic identification method. The method for automatically identifying the serial port in fig. 3 comprises the following steps:
step S11, determining the line sequence type of the access device connected with the central processing unit through the analog switch;
step S12, according to the line sequence type of the access device, the analog switch is switched to a port corresponding to the line sequence type of the access device.
According to the method for automatically identifying the serial port, the line sequence type of the access equipment can be automatically identified, so that the analog switch is switched to the port corresponding to the line sequence type of the access equipment, the problem that the analog switch cannot be used or debugged due to different line sequence types of the serial port is avoided, the manpower and material resource cost is reduced, and the timeliness of rush repair is improved.
In another embodiment, the central processor is an SCT15W203 chip. The analog switch may be a FSUSB30MUX chip. Specifically, the analog switch may be a FSUSB30MUX chip manufactured by fairchild corporation. The serial port identification device is simple in construction and material taking and easy to realize.
In yet another embodiment, the analog switch is connected to the access device through an RJ45 port. The access device may be a switch. At this time, the central processing unit detects which line-sequential type switch the RJ45 port access device belongs to. If no response is made, the central processing unit is always in a detection state, and after the detection is OK, a detection OK instruction is sent, and the analog switch is controlled to be switched to a port corresponding to the line sequence type of the access equipment. Serial ports automatic identification equipment can effectively improve the convenience that the switch inserts in this embodiment, when the debugging of switch, use and maintenance, does not receive the port restriction, and is more convenient.
In summary, the central processing unit in the serial port automatic identification device of the present invention can automatically identify the line sequence type of the access device, so that the analog switch is switched to the port corresponding to the line sequence type of the access device, thereby avoiding the problem that the analog switch cannot be used or debugged due to different line sequence types of the serial ports of the access device, reducing the cost of manpower and material resources, and improving the timeliness of emergency repair. In addition, the total current that used device was less than 10mA among the serial ports automatic identification device, can directly adopt the serial ports to get the mode of electricity and provide the power, power module accessible DB9 port gets the electricity among the serial ports automatic identification device promptly, makes serial ports automatic identification device use more convenient, and application range is wider. Therefore, the invention effectively overcomes various defects in the prior art and has high industrial utilization value.
The foregoing embodiments are merely illustrative of the principles and utilities of the present invention and are not intended to limit the invention. Any person skilled in the art can modify or change the above-mentioned embodiments without departing from the spirit and scope of the present invention. Accordingly, it is intended that all equivalent modifications or changes which can be made by those skilled in the art without departing from the spirit and technical spirit of the present invention be covered by the claims of the present invention.