Serial port connection method, serial port connection device and electronic equipment
By detecting the external serial port input signal and determining the target input signal, the timely connection between the server serial port and the external serial port with data transmission is achieved, the problem of low connection efficiency and timeliness in the existing technology is solved, and the efficiency and stability of the serial port connection are improved. sex.
Patent Information
- Application Number
- CN202110750686.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-01
- Publication Date
- 2024-11-29
- Estimated Expiration
- 2041-07-01
AI Technical Summary
The connection efficiency and timeliness of the server serial port are low, resulting in some external serial ports without data transmission occupying the server serial port, while external serial ports with data transmission cannot be connected in time.
By obtaining the input signal of the external serial port, detecting whether there is a target input signal, determining the external serial port with data transmission, and connecting the server serial port with the target external serial port, preferentially connecting the serial port with data transmission, and processing multiple targets according to the preset priority External serial port connection.
It improves the connection efficiency and timeliness between the server serial port and the external serial port, ensures the stable transmission of important data, and improves the effective utilization rate of the server serial port.
Smart Images

Figure CN113656222B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the technical field of serial port debugging, and in particular relates to a serial port connection method, a serial port connection device, an electronic device and a computer-readable storage medium. Background Art
[0002] Inside the server, there are both business systems and single-board management systems (Baseboard Management Controller, BMC), and they all have their own independent serial ports. In order to facilitate system debugging and subsequent system maintenance, these server serial ports must be able to connect to external serial port connectors and also be able to achieve remote communication through the SOL (Serial Over LAN) function.
[0003] At present, the connection of server serial ports mostly relies on manual testing. This method causes some external serial ports without data transmission to occupy the server serial ports, while the external serial ports with data transmission cannot be connected to the server serial ports in time, resulting in low connection efficiency and timeliness. Summary of the invention
[0004] The present application provides a serial port connection method, a serial port connection device, an electronic device and a computer-readable storage medium, which can improve the efficiency and timeliness of connecting a server serial port to an external serial port.
[0005] In a first aspect, the present application provides a serial port connection method, comprising:
[0006] Get the input signal of each external serial port;
[0007] Detecting whether there is a target input signal in the input signal, the target input signal is used to indicate that there is data transmission at the target external serial port, and the target external serial port is the external serial port corresponding to the target input signal;
[0008] If the above target input signal exists, the server serial port is connected to the above target external serial port.
[0009] In a second aspect, the present application provides a serial port connection device, comprising:
[0010] An acquisition module is used to acquire input signals from each external serial port;
[0011] A first detection module is used to detect whether there is a target input signal in the input signal, the target input signal is used to indicate that there is data transmission at the target external serial port, and the target external serial port is the external serial port corresponding to the target input signal;
[0012] The first connection module is used to connect the server serial port with the target external serial port if the target input signal exists.
[0013] In a third aspect, the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method of the first aspect when executing the computer program.
[0014] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method of the first aspect are implemented.
[0015] In a fifth aspect, the present application provides a computer program product, which includes a computer program. When the computer program is executed by one or more processors, it implements the steps of the method of the first aspect.
[0016] Compared with the prior art, the present application has the following beneficial effects: the present application first obtains the input signal of the external serial port, then determines the target input signal from the input signal, and determines the target external serial port corresponding to the target input signal based on the target input signal, and finally connects the server serial port with the target external serial port. The method can timely connect the external serial port with data transmission, thereby improving the efficiency and timeliness of the connection between the server serial port and the external serial port. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0018] Figure 1 It is a flowchart of the serial port connection method provided in the embodiment of the present application;
[0019] Figure 2 It is a schematic diagram of a serial port connection structure in a specific application scenario provided by an embodiment of the present application;
[0020] Figure 3 is a structural diagram of a serial port connection device provided in an embodiment of the present application;
[0021] Figure 4 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0022] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0023] The serial port connection method provided in the embodiment of the present application can be applied to electronic devices such as tablet computers, laptop computers, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), etc. The embodiment of the present application does not impose any restrictions on the specific types of electronic devices.
[0024] In order to illustrate the technical solution proposed in this application, a specific embodiment is provided below for illustration.
[0025] Figure 1 A schematic flow chart of the serial port connection method provided in the present application is shown, which is an example but not a limitation. The method can be applied to any of the above-mentioned electronic devices.
[0026] Step 101: Obtain input signals from each external serial port.
[0027] The external serial port generally includes the front panel serial port (Front UART), the rear panel serial port (Rear / RTM UART) and the SOL remote serial port. In order to detect whether each external serial port has data input, the input signal of each external serial port can be obtained, so that the external serial port with data input can be determined according to the input signal, thereby realizing the effective connection between the server serial port and the external serial port. The input signal refers to the serial port signal timing, that is, the level signal corresponding to the serial port.
[0028] Step 102: Detect whether there is a target input signal in the input signal.
[0029] In order to debug and subsequently maintain the server system, the server serial port needs to be connected to an external serial port. However, the number of server serial ports is limited, so the server serial port is generally connected to an external serial port with data input through detection, so as to receive data from the external serial port to debug the server system and perform subsequent maintenance. To determine the external serial port with data input, that is, the target external serial port, it is possible to detect whether there is a target input signal in the input signal. The target input signal is used to indicate that the target external serial port has data transmission, and the external serial port corresponding to the target data signal is the target external serial port.
[0030] In some embodiments, based on the timing characteristics of the input signal of the serial port, the target input signal can be determined by the following steps:
[0031] A1. Determine whether there is a jumping input signal in the input signal.
[0032] A2. If there is a jumping input signal, the jumping input signal is determined as the target input signal.
[0033] The input signal of the external serial port is a positive logic transistor-transistor logic (TTL) level, referred to as TTL level. For the positive logic TTL level, its start bit is a bit with a value of 0, that is, the start bit is a low level for one bit time; the stop bit is a bit with a value of 1, that is, the stop bit is a high level for one bit time. For the external serial port when the line is idle or the data transmission is completed, the TTL level signal is always at a high level, that is, a value of 1. However, it should be noted that there are two situations for signal jumps, one is a high level jump to a low level, and the other is a low level jump to a high level. For the line with data transmission, it will always be in an alternating jump between high and low levels. To determine whether there is a target input signal, it can be determined whether there is an input signal that jumps from a high level to a low level, or an input signal that is always in an alternating jump between high and low levels. If such input signals exist, such input signals can be determined as target input signals.
[0034] Step 103: If there is a target input signal, connect the server serial port to the target external serial port.
[0035] After the target input signal is determined, the target external serial port can be further determined according to the target input signal. After the target external serial port is determined, the server serial port is connected to the target external serial port to facilitate data transmission. Through the above process, the efficiency and timeliness of the connection between the server serial port and the external serial port can be improved.
[0036] In some embodiments, if there are multiple target input signals, in order to ensure stable transmission of important data, the above step 103 specifically includes:
[0037] B1. Check whether the number of target input signals is greater than the number of server serial ports.
[0038] B2. If the number of target input signals is greater than the number of server serial ports, the server serial port is connected to each target external serial port in sequence according to the preset priority of each target external serial port.
[0039] If there are multiple target input signals, it means that there are multiple target external serial ports to be connected. At this time, it is necessary to first determine whether the currently available server serial port can meet the connection requirements of the current target external serial port. If the currently available server serial port cannot meet the connection requirements of the current target external serial port, then the preset priority of each target external serial port can be determined first, and then the available server serial port can be connected to each target external serial port in turn according to the priority of each target external serial port.
[0040] For ease of understanding, an example is given: assuming that 4 target input signals are determined at the same time, then there are 4 target external serial ports with data waiting to be transmitted. At this time, there are only 2 available server serial ports, which cannot meet the connection requirements of the target external serial ports at the same time, so it is necessary to determine the preset priorities of the 4 target external serial ports. Among them, the external serial ports with high preset priorities are generally used to transmit important data, which can be connected first, and then the 4 target external serial ports are arranged in order from high to low according to the preset priorities, and the server serial ports are connected to the target external serial ports in sequence according to the arrangement order. That is, two server serial ports are used to connect to the target external serial ports arranged in the first two positions first, and when the target external serial ports arranged in the first two positions have no data transmission, the above two server serial ports are respectively connected to the target external serial ports arranged in the last two positions, thereby ensuring the reliability of important data transmission. Optionally, in order to ensure the integrity of data transmission, after the two server serial ports are used to connect to the target external serial ports arranged in the first two positions first, the remaining two target external serial ports can be abandoned and not connected.
[0041] In some embodiments, in order to prevent the server serial port from being occupied by an idle external serial port, after connecting the server serial port to the target external serial port, the serial port connection method may include:
[0042] C1. Within a preset time period, if the target input signal changes to a non-target input signal, detecting whether there is a new target input signal.
[0043] C2. If there is a new target input signal, the server serial port switch is connected to the new target external serial port.
[0044] For the target external serial port that has been connected to the server serial port, it is possible to detect whether the data transmission is completed, that is, whether the target external serial port is in an idle state without data transmission. Specifically, by detecting whether the target input signal is converted into a non-target input signal within a preset time period, such as within 10 seconds, that is, detecting whether the TTL level signal of the target external serial port is always 1. If it is always 1, it means that the target external serial port is currently not transmitting data and is in an idle state. At this time, if there is a new target input signal, the server serial port is switched to the new target external serial port, wherein the new target external serial port is the external serial port corresponding to the new target input signal. Through this method, the effective utilization rate of the server serial port and the timeliness of the connection of the new target external serial port can be improved. It should be understood that the switching connection here belongs to a specific application scenario of the connection, that is, when the target external serial port connected to the server serial port is in an idle state, the server serial port can be switched to the new target external serial port to improve the flexibility of the server serial port connection.
[0045] It can be understood that all the above serial port connection methods belong to smart connection solutions.
[0046] In some embodiments, in addition to the intelligent connection, a forced switch of the board management system may also be received. After connecting the server serial port to the target external serial port, the serial port connection method may include:
[0047] D1. If a switching instruction is received from the single board management system, the server serial port to be switched and the external serial port to be connected are determined according to the switching instruction.
[0048] D2. Connect the server serial port to be switched to the external serial port to be connected.
[0049] If a forced switching instruction is received from the single board management system, the server serial port to be switched and the external serial port to be connected can be determined according to the switching specification, and then the server serial port and the external serial port to be connected are connected to realize the switching of the server serial port.
[0050] In some embodiments, in order to improve the stability of important data transmission, the above step D1 specifically includes:
[0051] D11. Check whether there is an unconnected server serial port.
[0052] D12. If there is no unconnected server serial port, the server serial port to be switched is determined according to the preset priority of each target external serial port.
[0053] D13. Determine the external serial port to be connected according to the switching instruction.
[0054] After receiving the switching instruction from the single board management system, the switching instruction has been specified for the external serial port to be connected. For the server serial port to be switched, first check whether there is an unconnected server serial port; if the current server serial ports are all in a connected state, the preset priority of each connected external serial port, that is, each target external serial port, can be determined; finally, the target external serial port with the lowest preset priority can be selected as the server serial port to be switched. Therefore, after determining the external serial port to be connected and the server serial port to be switched, a forced switching method can be adopted to connect the server serial port to be switched with the external serial port to be connected.
[0055] It should be understood that in the scenario where there is an unconnected server serial port, there may be two situations:
[0056] One is the case where the number of unconnected server serial ports is less than the external serial ports to be connected. For example, there is one unconnected server serial port and three external serial ports to be connected. You can first connect one unconnected server to one external serial port; then determine two target external serial ports with the lowest preset priority from the target external serial ports, and use the server serial ports connected to these two target external serial ports as the server serial ports to be switched; finally, connect the two server serial ports to be switched to the two external serial ports to be connected.
[0057] The other is the case where the number of unconnected server serial ports is equal to or greater than the external serial ports to be connected. When the number of unconnected server serial ports is equal to the external serial ports to be connected, the unconnected server serial ports can be connected to the external serial ports to be connected in sequence. When the number of unconnected server serial ports is greater than the external serial ports to be connected, server serial ports equal to the number of external serial ports to be connected can be randomly selected from the unconnected server serial ports and connected to the external serial ports to be connected in sequence.
[0058] In some embodiments, in order to facilitate the management of the server serial port, after connecting the server serial port to the target external serial port, the serial port connection method may include:
[0059] The board management system records the connection events of the server serial port.
[0060] Since the number of server serial ports and / or external serial ports may be large, errors may occur during data transmission, affecting server debugging. Therefore, each connection of the server serial port can be recorded, so that when the user manages the server serial port in the future, the server serial port can be tracked and traced in real time, improving the manageability of the server serial port.
[0061] The embodiment of the present application first obtains the input signal of the external serial port, then determines the target input signal from the input signal, and determines the target external serial port corresponding to the target input signal based on the target input signal, and finally connects the server serial port to the target external serial port. This method can timely connect the external serial port with data transmission, thereby improving the efficiency and timeliness of the connection between the server serial port and the external serial port.
[0062] Furthermore, when there are multiple target external serial ports to be connected and the number of available server serial ports cannot meet the connection requirements, each target external serial port can be connected according to the preset priority of the target external serial port to improve the reliability of important data transmission.
[0063] Furthermore, if a switching instruction from the single board management system is received, the switching instruction from the single board management system is satisfied first. During the switching process, if the number of external serial ports to be connected is greater than the number of available server serial ports, the server serial port to be switched can be determined according to the preset priority level of the connected target external serial port, thereby improving the reliability of important data transmission.
[0064] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0065] For ease of understanding, the serial port connection method proposed in the embodiment of the present application is explained below using an actual application scenario.
[0066] Figure 2 The serial port switching method in a specific application scenario is shown. The server serial port includes the single board management system serial port and the system serial port. These two serial ports can pass through the field programmable gate array (FPGA) or complex programmable logic device (CPLD). The CPLD / FPGA has a built-in data selector (Multiplexer, MUX) for using any one of the multiplexers as the current data transmission line as needed during the multi-channel data transmission process. After the single board management system serial port and the system serial port pass through the data selector, they can be multiplexed to the external serial port. For example, the front panel serial port, the rear panel serial port, and the SOL remote serial port shown in the figure. Two data selectors can be set, such as the first data selector and the second data selector shown in the figure. The first data selector can output the system serial port by default, or it can be set through the single board management system and configured as the troubleshooting serial port of the single board management system itself.
[0067] The second data selector can be configured as an intelligent switching mode. In this mode, the CPLD / FPGA detects the input signals by acquiring the input signals of the front panel serial port, the rear panel serial port, and the SOL remote serial port to determine whether there is a target input signal. Assuming that the TTL level signal of the front panel serial port is detected to jump from a high level to a low level, it means that there is data transmission on the front panel serial port, and the second data selector will connect the currently available server serial port to the front panel serial port. After the connection, if no jump of the TTL level signal of the front panel serial port is detected within the preset time period, it means that there is no data transmission on the front panel serial port, and the second data selector will switch the server serial port connected to the front panel serial port to other external serial ports with data transmission. However, if no other external serial ports with data transmission are detected, the switching can be temporarily stopped until other external serial ports with data transmission are detected, and then the server serial port is switched to other external serial ports with data transmission.
[0068] Corresponding to the serial port connection method described in the above embodiment, Figure 3 A structural block diagram of a serial port connection device 3 provided in an embodiment of the present application is shown. For ease of explanation, only the parts related to the embodiment of the present application are shown.
[0069] Reference Figure 3 , the serial port connection device 3 comprises:
[0070] An acquisition module 301 is used to acquire input signals of each external serial port;
[0071] A first detection module 302 is used to detect whether there is a target input signal in the input signal, the target input signal is used to indicate that there is data transmission at the target external serial port, and the target external serial port is the external serial port corresponding to the target input signal;
[0072] The first connection module 303 is used to connect the server serial port to the target external serial port if there is a target input signal.
[0073] Optionally, the first detection module 302 may include:
[0074] A judging unit, used for judging whether there is a jumping input signal in the input signal;
[0075] The determining unit is used to determine the jumping input signal as the target input signal if there is a jumping input signal.
[0076] Optionally, the first connection module 303 may include:
[0077] A first detection unit, used to detect whether the number of target input signals is greater than the number of server serial ports;
[0078] The first connecting unit is used to connect the server serial port with each target external serial port in sequence according to the preset priority of each target external serial port if the number of target input signals is greater than the number of server serial ports.
[0079] Optionally, the serial port connection device 3 may further include:
[0080] A second detection module, configured to detect whether there is a new target input signal if the target input signal is transformed into a non-target input signal within a preset time period;
[0081] The second connection module is used for switching the server serial port to connect to a new target external serial port if there is a new target input signal, and the new target external serial port is an external serial port corresponding to the new target input signal.
[0082] Optionally, the serial port connection device 3 may further include:
[0083] A determination module, for determining the server serial port to be switched and the external serial port to be connected according to the switching instruction if a switching instruction from the single board management system is received;
[0084] The third connection module is used to connect the server serial port to be switched to the external serial port to be connected.
[0085] Optionally, the above-mentioned determination module may include:
[0086] The second detection unit is used to detect whether there is an unconnected server serial port;
[0087] A second determining unit is used to determine the server serial port to be switched according to the preset priority of each target external serial port if there is no unconnected server serial port;
[0088] The third determining unit determines the external serial port to be connected according to the switching instruction.
[0089] Optionally, the serial port connection device 3 may further include:
[0090] The recording module is used to record the connection events of the server serial port through the single board management system.
[0091] It should be noted that the information interaction and execution process between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0092] Figure 4 This is a schematic diagram of the structure of an electronic device provided by an embodiment of the present application. Figure 4 As shown, the electronic device 4 of this embodiment includes: at least one processor 40 ( Figure 4 Only one is shown in the figure) a processor, a memory 41, and a computer program 42 stored in the memory 41 and executable on at least one processor 40. When the processor 40 executes the computer program 42, the steps in any of the above-mentioned serial port connection method embodiments are implemented, for example Figure 1 Steps 101-103 are shown.
[0093] The processor 40 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0094] In some embodiments, the memory 41 may be an internal storage unit of the electronic device 4, such as a hard disk or memory of the electronic device 4. In other embodiments, the memory 41 may also be an external storage device of the electronic device 4, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 4. Further, the memory 41 may also include both an internal storage unit and an external storage device of the terminal device 4. The memory 41 is used to store operating devices, application programs, boot loaders (BootLoader), data, and other programs, such as program codes of computer programs, etc. The memory 41 may also be used to temporarily store data that has been output or is to be output.
[0095] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0096] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.
[0097] An embodiment of the present application provides a computer program product. When the computer program product runs on a mobile terminal, the mobile terminal can implement the steps in the above-mentioned method embodiments when executing the computer program product.
[0098] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned various method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device that can carry the computer program code to the camera / electronic device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, RandomAccess Memory), electric carrier signal, telecommunication signal and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.
[0099] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0100] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0101] In the embodiments provided in the present application, it should be understood that the disclosed devices / network equipment and methods can be implemented in other ways. For example, the device / network equipment embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0102] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0103] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A serial port connection method, characterized in that: The serial port connection method comprises: Get the input signal of each external serial port; Detecting whether there is a target input signal in the input signal, the target input signal is used to indicate that there is data transmission at the target external serial port, and the target external serial port is the external serial port corresponding to the target input signal; If the target input signal exists, connecting the server serial port to the target external serial port; Wherein, after connecting the server serial port to the target external serial port, the method further includes: If a switch command is received from the board management system, it detects whether there is an unconnected server serial port; If the unconnected server serial port does not exist, determining the server serial port to be switched according to the preset priority of each target external serial port; Determine the external serial port to be connected according to the switching instruction; Connect the server serial port to be switched to the external serial port to be connected.
2. The serial port connection method according to claim 1, characterized in that: The detecting whether there is a target input signal in the input signal includes: Determining whether there is a jumping input signal in the input signal; If there is a jumping input signal, the jumping input signal is determined as the target input signal.
3. The serial port connection method according to claim 1, characterized in that: If the target input signal exists, connecting the server serial port to the target external serial port includes: Detecting whether the number of the target input signals is greater than the number of the server serial ports; If the number of the target input signals is greater than the number of the server serial ports, the server serial ports are connected to the target external serial ports in sequence according to the preset priorities of the target external serial ports.
4. The serial port connection method according to any one of claims 1 to 3, characterized in that: After the server serial port is connected to the target external serial port, the method further includes: If the target input signal changes to a non-target input signal within a preset time period, detecting whether there is a new target input signal; If the new target input signal exists, the server serial port is switched and connected to a new target external serial port, and the new target external serial port is an external serial port corresponding to the new target input signal.
5. The serial port connection method according to any one of claims 1 to 3, characterized in that: After the server serial port is connected to the target external serial port, the method further includes: The connection events of the server serial port are recorded through the single board management system.
6. A serial port connection device, characterized in that: include: An acquisition module is used to acquire input signals from each external serial port; A first detection module is used to detect whether there is a target input signal in the input signal, the target input signal is used to indicate that there is data transmission at the target external serial port, and the target external serial port is the external serial port corresponding to the target input signal; A first connection module, configured to connect the server serial port to the target external serial port if the target input signal exists; The serial port connection device also includes: A determination module, used for: after the server serial port is connected to the target external serial port, if a switching instruction from the single board management system is received, detecting whether there is an unconnected server serial port; if there is no unconnected server serial port, determining the server serial port to be switched according to the preset priority of each target external serial port; determining the external serial port to be connected according to the switching instruction; The third connection module is used to connect the server serial port to be switched to the external serial port to be connected.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the serial port connection method according to any one of claims 1 to 5 is implemented.
8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the serial port connection method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Method and device for testing serial ports of servers
CN105468486A
A fault information monitoring method and a device thereof
CN109101354A
Method and device for processing events asynchronously based on SPI, and storage medium
CN109891400A
Method and device for server system to share serial port, controlled terminal and storage medium
CN109902014A
Serial port switching method and device
CN110597749A
