Serial connection system, method, device, storage medium and program product

By introducing a backup register mechanism and a register switcher into the controller, the system switches to the backup register during firmware upgrades, thus solving the problem of serial port configuration loss caused by controller firmware upgrades and achieving reliability and stability of system communication.

CN120804008BActive Publication Date: 2025-11-21INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511261259.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-04
Publication Date
2025-11-21
Estimated Expiration
2045-09-04

AI Technical Summary

Technical Problem

Due to limited physical serial port resources, multiple devices need to share the same physical serial port. During firmware upgrades, the controller's internal registers may be reset, resulting in the loss of serial port switching configurations and affecting the reliability of system communication.

Method used

A backup register mechanism is adopted to store serial port configuration information in a preset isolation area of ​​the controller and switch to the backup register during firmware upgrade to ensure that the serial port configuration information is not lost. The serial port connection of the target device is realized through the register switcher.

Benefits of technology

During firmware upgrades, serial port configuration information is preserved and serial port connections are not interrupted, thus improving the reliability and stability of system communication.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120804008B_ABST
    Figure CN120804008B_ABST
Patent Text Reader

Abstract

The application discloses a serial port connection system, method, device, storage medium and program product, relates to the technical field of controllers, and the serial port connection system can comprise a serial port input end, a controller and a serial port output end. The controller can comprise a main register, a backup register, a serial port connector and a register switcher. The register switcher can store serial port configuration information of the main register as serial port backup information of the backup register based on a firmware upgrade request of the controller, disconnect the main register from the serial port connector, and connect the backup register with the serial port connector. The backup register is arranged in a preset isolation area of the controller. During the firmware upgrade process of the controller, the serial port connector can determine a target device serial port corresponding to the serial port input end based on the serial port backup information of the backup register, and connect the serial port output end with the target device serial port, so that the reliability of system communication can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of controllers, and particularly relates to a serial port connection system, method, device, storage medium and program product. BACKGROUND

[0002] Embedded systems are widely used in the fields of servers, network devices, industrial control, etc., and usually need to communicate between devices through serial ports (UART).

[0003] In the related art, due to the limited physical serial port resources, multiple devices (such as CPUs, BMCs, etc.) often need to share the same physical serial port, and serial port switching control can be performed through a controller. However, during the firmware upgrade process of the controller, the internal registers thereof can be reset, resulting in the loss of serial port switching configuration, and thus the reliability of system communication is low. SUMMARY

[0004] The present application provides a serial port connection system, method, device, storage medium and program product to at least solve the problem of low reliability of system communication in the related art.

[0005] In a first aspect, the present application provides a serial port connection system, which comprises a serial port input end, a controller and a serial port output end, the controller comprises a main register, a backup register, a serial port connector and a register switcher, the serial port input end is connected with the main register and the backup register respectively, the register switcher is connected with the main register, the backup register and the serial port connector respectively, and the serial port connector is connected with the serial port output end, wherein,

[0006] The register switcher is configured to, based on a firmware upgrade request of the controller, store serial port configuration information of the main register as serial port backup information of the backup register, disconnect the main register from the serial port connector, and connect the backup register with the serial port connector, and the backup register is arranged in a preset isolation area of the controller.

[0007] The serial port connector is configured to, during a firmware upgrade process of the controller, determine a target device serial port corresponding to the serial port input end based on the serial port backup information of the backup register, and connect the serial port output end with the target device serial port, and the target device serial port is one of multiple device serial ports connected with the serial port input end.

[0008] In a second aspect, the present application further provides a serial port connection method applied to the serial port connection system of any one of the first aspect, and the method comprises the following steps.

[0009] Receiving a firmware upgrade request, the firmware upgrade request is used for firmware upgrade processing of the controller.

[0010] According to the firmware upgrade request, the serial port configuration information of the main register is stored as the serial port backup information of the backup register, and the main register is disconnected from the serial port connector, and the backup register is connected to the serial port connector;

[0011] According to the serial port backup information of the backup register, a target device serial port is determined from a plurality of device serial ports, and a serial port output end is connected to the target device serial port.

[0012] In a third aspect, the present application also provides an electronic device, comprising: a memory for storing a computer program; and a processor for executing the computer program to implement the steps of any of the serial port switching methods described above.

[0013] In a fourth aspect, the present application also provides a computer readable storage medium, which stores a computer program, wherein the computer program is executed by a processor to implement the steps of any of the serial port switching methods described above.

[0014] In a fifth aspect, the present application also provides a computer program product comprising a computer program, wherein the computer program is executed by a processor to implement the steps of any of the serial port switching methods described above.

[0015] Through the serial port connection system, method, device, storage medium and program product provided by the present application, the register switcher can store the serial port configuration information of the main register as the serial port backup information of the backup register based on the firmware upgrade request of the controller, and disconnect the main register from the serial port connector and connect the backup register to the serial port connector. During the firmware upgrade process of the controller, based on the serial port backup information of the backup register, the target device serial port corresponding to the serial port input end is determined, and the serial port output end is connected to the target device serial port. The backup register is set in a predetermined isolation area, and during firmware upgrade, the serial port configuration information can be backed up to the backup register, ensuring that the backup register remains in a running state during firmware upgrade, so that the serial port configuration information is not lost and the serial port connection is not interrupted, improving the reliability of system communication. BRIEF DESCRIPTION OF DRAWINGS

[0016] In order to more clearly illustrate the embodiments of the present application, the drawings needed in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0017] Figure 1 The schematic diagram of the application scenario provided for the embodiments of the present application;

[0018] Figure 2 A structure diagram of a serial port connection system provided by an embodiment of the present application is shown in FIG. 1.

[0019] Figure 3 A structure diagram of another serial port connection system provided by an embodiment of the present application is shown in FIG. 2.

[0020] Figure 4 A flow diagram of a serial port connection method provided by an embodiment of the present application is shown in FIG. 3.

[0021] Figure 5 A flow diagram of another serial port switching method provided by an embodiment of the present application is shown in FIG. 4.

[0022] Figure 6 A structure diagram of an electronic device provided by an embodiment of the present application is shown in FIG. 5. DETAILED DESCRIPTION

[0023] 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. Obviously, the described embodiments are only some of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, other embodiments obtained by those of ordinary skill in the art without creative work fall within the protection scope of the present application.

[0024] It should be noted that, in the description of the present application, the terms “include”, “contain” or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such a process, method, article or device. The terms “first”, “second” and the like in the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence.

[0025] Embedded system communication technology: Embedded systems are widely used in servers, network devices, industrial control and other fields, and usually need to communicate between devices through serial ports (UART). Due to its simplicity and reliability, serial port communication plays an important role in device debugging, system management and data transmission. However, due to the limited physical serial port resources, multiple devices (such as CPUs, BMCs, etc.) often need to share the same physical serial port, so an efficient serial port switching mechanism is needed.

[0026] CPLD (Complex Programmable Logic Device): CPLD is a programmable logic device with high reliability, low delay and reconfigurability, commonly used to implement hardware logic control. In the serial port switching scenario, CPLD can dynamically parse serial port instructions and control the switching of multiple serial ports, avoiding the flexibility and slow response problems of traditional hardware switches or multiplexers.

[0027] Seamless Upgrade: Seamless upgrade refers to ensuring system function uninterrupted and user unaware during device firmware upgrade. For CPLD, upgrade usually involves logic reconfiguration, which may cause internal register reset and affect serial port switching configuration preservation. Traditional solutions (such as forced switching to default serial port, dual CPLD redundancy design or writing UFM) have problems such as communication interruption, high cost or large delay.

[0028] Shadow Register: Shadow register is a backup register mechanism that temporarily stores key configuration data when the main register is reset due to upgrade, etc. Through physical isolation design (such as layout in the reserved area of CPLD), shadow register can keep data unchanged during upgrade and ensure system function continuity.

[0029] Figure 1 The application scenario provided by the embodiments of the present application is shown in the schematic diagram. Please refer to Figure 1 , the serial port connection system 100 includes a serial port input end 101, a controller 102 and a serial port output end 103, the controller 102 is provided with an internal register, and the internal register is connected with the serial port input end 101 and the serial port output end 103 respectively.

[0030] The serial port input end 101 can be connected with multiple devices (such as CPU and BMC, etc.) through external hardware (such as serial port expander). When multiple devices share the same physical serial port, the signals of multiple devices are input into the serial port input end 101 through the expander, and the controller 102 realizes the serial port switching mechanism based on the serial port configuration information stored in its internal register, so as to output the signal of the target device (such as CPU or BMC) from the serial port output end 103.

[0031] After multiple devices access the serial port connection system 100 through the same physical serial port, the signals of multiple devices can be input into the serial port input end 101, and then the serial port switching mechanism is realized through the main controller 102. The serial port configuration information can be stored in the internal register of the controller 102, and the serial port switching mechanism of multiple devices can be realized based on the serial port configuration information, so as to output the device signal of the target device from the serial port output end 103, wherein the target device is one of multiple devices.

[0032] In the related art, the physical serial port resource is limited, and multiple devices (such as CPU, BMC, etc.) often need to share the same physical serial port, which can be controlled by the controller for serial port switching. However, during the firmware upgrade of the controller, its internal register may be reset to the default value, resulting in loss of serial port switching configuration and affecting the reliability of system communication.

[0033] In the embodiment of the present application, the serial port connection system can include a serial port input end, a controller and a serial port output end. The controller can include a main register, a backup register, a serial port connector and a register switcher. The register switcher can store the serial port configuration information of the main register as the serial port backup information of the backup register based on the firmware upgrade request of the controller, and disconnect the main register from the serial port connector and connect the backup register to the serial port connector. The backup register is arranged in a preset isolation area of the controller. The serial port connector can determine the target device serial port corresponding to the serial port input end based on the serial port backup information of the backup register during the firmware upgrade process of the controller, and connect the serial port output end to the target device serial port.

[0034] The backup register is arranged in the preset isolation area, and the serial port configuration information is backed up to the backup register during firmware upgrade. The backup register can remain in a running state during firmware upgrade, so that the serial port configuration information is not lost and the serial port connection is not interrupted, thereby improving the reliability of system communication.

[0035] Figure 2 A structural diagram of a serial port connection system according to an embodiment of the present application is provided. Referring to FIG. 1, Figure 2 The serial port connection system can include a serial port input end, a controller and a serial port output end. The controller can include a main register, a backup register, a serial port connector and a register switcher. The serial port input end is connected to the main register and the backup register respectively. The register switcher is connected to the main register, the backup register and the serial port connector respectively. The serial port connector is connected to the serial port output end.

[0036] Each device can be connected to the serial port connection system through its corresponding UART_TX (Universal Asynchronous Receiver-Transmitter Transmit) and UART_RX (Universal Asynchronous Receiver-Transmitter Receive) pins. The serial port connection system can send serial form data to each device, and can also receive serial form data sent by each device. The serial form is to send or receive one bit of device data with one bit of device data.

[0037] The serial port input end can be used to analyze the serial signals received from the central processing unit (CPU) and the baseboard management controller (BMC), such as converting serial signals to parallel signals, data verification, etc.

[0038] The serial port input end can connect multiple devices through a serial port expander, and the serial input signals of each device can enter the controller from the serial port input end. For example, the multiple devices can be a CPU and a BMC.

[0039] The serial port expander can be a hardware device that increases the number of serial ports, and can expand a single serial port into multiple independent serial ports, enabling multiple devices to be connected to the main system simultaneously.

[0040] The serial port output end can convert data in the controller into a serial output signal in serial format and send the serial output signal to an RS232 serial port through the UART_TX pin. The RS232 serial port is connected to the serial port output end through the UART_TX and UART_RX pins. Through the RS232 serial port, the serial output signal can be sent to an external device or the serial signal of an external device can be received.

[0041] The RS232 serial port is a commonly used serial communication standard interface and can be used for low-speed communication between a computer and an external device.

[0042] UART_TX is the transmission pin in the UART interface. When a device (such as a CPU or BMC) needs to send data, the device sends serial data through the UART_TX pin.

[0043] UART_RX is the receiving pin in the UART interface. When a device needs to receive data, the device receives serial data from another device through the UART_RX pin.

[0044] The main register is the main configuration data source for the operation of the serial port. The main register can be used to store serial port configuration information, which can include serial port configuration parameters and serial port switching logic.

[0045] The serial port configuration parameters can include the baud rate, data bits, and stop bits of the serial port.

[0046] The serial port switching logic can define the conditions under which the serial port switching is performed, such as switching the serial port based on specific control signals or data packet content.

[0047] The serial port connector can determine the target device serial port to be connected to the serial port output end based on the serial port configuration information among the multiple device serial ports at the serial port input end, and implement the output of the serial port signal of the target device to the serial port output end.

[0048] The upgrade control device can send a firmware upgrade request to the controller, which is used for firmware upgrade of the controller. The upgrade control device can be a CPU or a BMC.

[0049] The controller reconfigures and resumes the normal working mode after the firmware upgrade is completed. The reconfiguration causes the serial port configuration information stored in the main register to return to the default configuration information, and the serial port configuration information before the firmware upgrade is lost.

[0050] The backup register can backup the serial port configuration information as serial port backup information before the firmware upgrade.

[0051] The main storage address corresponding to the main register and the backup storage address corresponding to the backup register are different, and the backup storage address corresponding to the backup register is not reconfigured after the firmware upgrade is completed, and the serial port backup information in the backup register can be preserved.

[0052] The backup storage address corresponding to the backup register is a preset isolation area of the controller. The preset isolation area is an independent area pre-divided in the storage system of the controller, and is isolated from other areas in terms of read-write permission and function. In the preset isolation area, the backup register is not affected by the firmware upgrade. The data in the backup register can be protected from being modified.

[0053] The register switcher can store the serial port configuration information of the main register as the serial port backup information of the backup register based on the firmware upgrade request of the controller, and disconnect the main register from the serial port connector and connect the backup register to the serial port connector.

[0054] The serial port connector can determine the target device serial port corresponding to the serial port input end based on the serial port backup information of the backup register during the firmware upgrade of the controller, and connect the serial port output end to the target device serial port.

[0055] The target device serial port can be one of the plurality of device serial ports connected to the serial port input end.

[0056] The serial port connection system provided in the application can store the serial port configuration information of the main register as the serial port backup information of the backup register based on the firmware upgrade request of the controller, disconnect the main register from the serial port connector, and connect the backup register to the serial port connector. During the firmware upgrade of the controller, the target device serial port corresponding to the serial port input end is determined based on the serial port backup information of the backup register, and the serial port output end is connected to the target device serial port. The backup register is arranged in the preset isolation area, and the serial port configuration information can be backed up to the backup register during the firmware upgrade. The backup register remains in the running state during the firmware upgrade, so that the serial port configuration information is not lost, the serial port connection is not interrupted, and the reliability of system communication is improved.

[0057] Figure 3 Another structure diagram of a serial port connection system provided by the embodiment of the application is provided. Please refer to Figure 3The register switcher further comprises a first detector and a current mode logic circuit, the first detector is connected with a first detection pin of the upgrade control device, the first detector is connected with the current mode logic circuit, and the current mode logic circuit is connected with the first detector, the main register and the backup register respectively.

[0058] The first detector can be an analog comparator, and the first detector can detect an upgrade signal of the first detection pin to determine whether a firmware upgrade request is received.

[0059] The first detector is specifically configured to send a first jump signal to the current mode logic circuit if the upgrade signal is a first preset signal, and the first preset signal can be used to indicate that the firmware upgrade request is received.

[0060] In some possible embodiments, the first preset signal can be a high level, and when the upgrade control device sends the firmware upgrade request, the first detection pin changes from a low level to a high level.

[0061] In a normal state, an output signal of the first detector can be a low level, and after detecting that the upgrade signal is the first preset signal, the first jump signal changes from a low level to a high level.

[0062] The first detector can realize detection of a high-speed firmware upgrade request event, and can ensure that a firmware upgrade request event capture has no delay.

[0063] The current mode logic circuit (CML) can receive the first jump signal, and based on the first jump signal, disconnect the main register from the serial port connector, and connect the backup register to the serial port connector, to realize switching of the register.

[0064] The current mode logic circuit comprises a differential current switch, and the differential current switch can cut off a clock path between the main register and a clock source pin according to the first jump signal, and connect the backup register to the clock source pin, to realize transfer of control right of serial port switching.

[0065] The clock source pin is a global time reference in a timing system, and can provide a synchronous beat for the register. The clock path can refer to a signal transmission link from the clock source to a clock port of the register.

[0066] After cutting off the clock path between the main register and the clock source pin, the differential current switch can close a current switch of a clock tree of the main register, so that a clock pin of the main register is in a high resistance state (i.e., equivalent clock freezing), so that the main register is in a processing frozen state.

[0067] The differential current switch can open a current switch of a clock path of the backup register, and can connect the backup register to the clock source pin, so that the backup register is in a running state.

[0068] The differential current switch comprises a differential pair and a tail current source. The differential pair is composed of two differential transistors, and the differential pair can be an N-type Metal-Oxide-Semiconductor Field-Effect Transistor (MOS) pair or a P-type MOS pair.

[0069] The tail current source can provide a constant bias current, and two input terminals of the differential pair are connected to complementary clock signals respectively. When the clock signal is high, the corresponding differential transistor is turned on, and the current flows to the branch; otherwise, the transistor is turned off.

[0070] According to the first jump signal, the first enable signal of the differential transistor corresponding to the main register is updated from high to low (i.e., from the on state to the off state), and the second enable signal of the differential transistor corresponding to the standby register is updated from low to high (i.e., from the off state to the on state).

[0071] The clock pin of the main register is usually connected to one output terminal of the differential pair. When the first enable signal corresponding to the main register is low, the differential transistor corresponding to the main register is biased to the off state, at this time, the gate voltage of the main register differential pair is pulled low, the transistor is turned off, and the tail current no longer flows through the clock path of the main register.

[0072] The clock pin of the standby register is usually connected to the other output terminal of the differential pair. When the second enable signal corresponding to the standby register is high, the differential transistor corresponding to the standby register is turned on, at this time, the differential transistor corresponding to the standby register is turned on, the tail current flows through the clock path of the standby register, and the differential signal of the clock source pin is transmitted to the standby register through the turned-on differential pair.

[0073] Please refer to Figure 3 The register switch further comprises a second detector connected to a second detection pin of the upgrade control device, and the second detector can detect an upgrade result signal of the second detection pin.

[0074] The upgrade result signal is a state identification signal generated after the end of the firmware upgrade process, and is specifically divided into two types of upgrade success signal and upgrade failure signal, that is, the upgrade result signal is the upgrade success signal or the upgrade failure signal.

[0075] The second detection pin can be a pin in the upgrade control device, and the second detection pin can be a special interface on the upgrade control device for outputting the upgrade result signal, which is a physical connection point for signal transmission between the upgrade control device and the second detector.

[0076] The upgrade control device can send an upgrade result signal through the second detection pin after detecting that the firmware upgrade is completed.

[0077] After the firmware upgrade is completed, the register switcher can update the serial port configuration information of the main register based on the upgrade result signal.

[0078] If the upgrade result signal is an upgrade success signal, the serial port backup information of the main register can be updated according to the serial port backup information of the backup register.

[0079] Specifically, if the upgrade result signal is an upgrade success signal, the serial port backup information of the backup register is checked to obtain a check result; when the check result is a check pass, the serial port configuration information of the main register is updated according to the serial port backup information of the backup register; when the check result is a check fail, a plurality of historical backup information in the backup register is obtained, target backup information is determined from the plurality of historical backup information, and the serial port configuration information of the main register is updated according to the target backup information.

[0080] The target backup information is the historical backup information with the highest backup times in the plurality of historical backup information.

[0081] If the upgrade result signal is an upgrade fail signal, the controller may have a fault and cannot be upgraded before the backup register is backed up, or the serial port configuration information in the main register may make it impossible to upgrade, at which time the serial port backup information in the backup register may be incorrect, the target backup information can be determined from a plurality of historical backup information of the backup register, and the serial port backup information of the main register is updated through the target backup information.

[0082] The controller can be rolled back to the historical backup information after the serial port backup information of the backup register is checked to fail or the controller upgrade fails, so as to maintain the normal use of the serial port switching.

[0083] After the upgrade processing of the controller is completed, the register switcher can also update the serial port configuration information of the main register according to the backup information of the backup register; the backup register is disconnected from the serial port connector, and the main register is connected to the serial port connector.

[0084] The switching logic described herein can refer to the description of the main register switching to the backup register described above, which will not be described again.

[0085] After switching to the main register connected to the serial port connector, the serial port connector can determine a target device serial port from a plurality of device serial ports according to the updated serial port configuration information of the main register, and connect the serial port output end to the target device serial port.

[0086] The serial port connection system provided by the embodiment of the application can include a first detector and a current mode logic circuit. After the firmware upgrade is detected by the first detector, the main register is switched to the backup register by the current mode logic circuit, so that the detection and switching efficiency can be improved. Meanwhile, after the firmware upgrade is detected to be completed, the serial port configuration information of the main register can be updated in time, so that the reliability of the serial port connection can be improved.

[0087] Figure 4 A flowchart of a serial port connection method provided by the embodiment of the application is shown. Please refer to Figure 4 The method can include the following steps.

[0088] S401, receiving a firmware upgrade request.

[0089] The firmware upgrade request can be used for firmware upgrade processing of the controller.

[0090] S402, based on the firmware upgrade request, storing the serial port configuration information of the main register as the serial port backup information of the backup register, disconnecting the main register from the serial port connector, and connecting the backup register to the serial port connector.

[0091] The first detection pin can be detected by the first detector. If the upgrade signal is a first preset signal, a first jump signal is sent to the current mode logic circuit. Based on the first jump signal, the current mode logic circuit disconnects the main register from the serial port connector and connects the backup register to the serial port connector.

[0092] Specifically, according to the first jump signal, the clock path between the main register and the clock source pin is cut off; and the backup register is connected to the clock source pin.

[0093] S403, according to the serial port backup information of the backup register, determining a target device serial port in the plurality of device serial ports, and connecting the serial port output end to the target device serial port.

[0094] During the firmware upgrade process, the serial port backup information in the backup register is in a read-only state, so that the serial port output can be ensured not to jump.

[0095] According to the serial port switching logic in the serial port backup information, the target device serial port corresponding to the serial port output end at the current time can be determined, and the target device serial port is the current active serial port. The serial port signal of the target device corresponding to the target device serial port is transmitted to the external device connected to the serial port output end.

[0096] The serial port connection method provided by the embodiments of the present application can back up serial port configuration information to a backup register during firmware upgrading, so that the backup register can keep running during firmware upgrading, the serial port configuration information is not lost, the serial port connection is not interrupted, and the reliability of system communication can be improved.

[0097] Figure 5 The flowchart of another serial port switching method provided by the embodiments of the present application is shown in FIG. 4. Figure 5 The method can include the following steps.

[0098] S501, performing upgrading processing on the controller according to a firmware upgrading request.

[0099] During the upgrading processing on the controller, the backup register can replace the main register to provide serial port switching logic for the serial port output end, so that the serial port communication can be ensured not to be interrupted during the upgrading process, the user cannot feel the influence of firmware upgrading on the serial port switching, and the upgrading can be implemented without feeling.

[0100] In some possible embodiments, if an exception occurs during the upgrading process, the system can automatically roll back to the serial port configuration before the upgrading to ensure communication continuity.

[0101] S502, updating the serial port configuration information of the main register according to the backup information of the backup register after the upgrading processing is completed.

[0102] The second detector can be used to detect an upgrading result signal of the second detection pin, and the upgrading result signal can indicate whether the upgrading processing of the controller is successful.

[0103] If the upgrading result signal is an upgrading success signal, the serial port backup information is subjected to a verification processing to obtain a verification result. If the verification result is a verification pass, the serial port configuration information of the main register is updated according to the serial port backup information of the backup register. If the verification result is a verification failure, target backup information is determined from the multiple historical backup information of the backup register, and the serial port configuration information of the main register is updated according to the target backup information.

[0104] The verification processing can be a CRC verification. Through the verification processing, it can be verified whether the serial port backup information is tampered with. If the serial port backup information is tampered with, the verification result is a verification failure, the serial port backup information is not allowed to be restored to the main register, and the safety of the system can be ensured.

[0105] When the target backup information is determined from the multiple historical backup information of the backup register, the historical backup information with the highest backup times in the multiple historical backup information can be determined as the target backup information.

[0106] For example, the serial port configuration parameters and the serial port switching logic are included in the historical backup information. Generally, the serial port configuration parameters are unchanged, and the historical backup information of the same serial port switching logic can be recorded as the same backup information. Then, the historical backup information with the highest backup times is determined.

[0107] If the upgrade result signal is the upgrade failure signal, the target backup information is determined from the multiple historical backup information of the backup register, and the serial port configuration information of the main register is updated according to the target backup information.

[0108] The target backup information can be the historical backup information with the highest backup times from the multiple historical backup information of the backup register.

[0109] S503, disconnect the backup register from the serial port connector, and connect the main register to the serial port connector.

[0110] The execution process of S503 can refer to the execution process in the above embodiments, which will not be described here.

[0111] S504, according to the updated serial port configuration information of the main register, determine the target device serial port from the multiple device serial ports, and connect the serial port output end to the target device serial port.

[0112] The execution process of the target device serial port according to the updated serial port configuration information can refer to the execution process of the target device serial port according to the serial port backup information, which will not be described here.

[0113] The serial port switching method provided by the application can restore the serial port backup information in the backup register to the main register after the firmware upgrade is completed, which can ensure that the serial port switching logic remains consistent before and after the firmware upgrade, and can improve the stability of the serial port switching. In addition, the serial port backup information can be verified to avoid tampering with the serial port backup information restored to the main register, which can improve the security of the controller.

[0114] Figure 6 A structural schematic diagram of an electronic device provided by an embodiment of the application is provided. As shown in Figure 6 The electronic device 600 provided by the embodiment includes at least one processor 601 and a memory 602. Optionally, the electronic device 600 further includes a communication component 603. The processor 601, the memory 602 and the communication component 603 are connected through a bus.

[0115] In the specific implementation process, the at least one processor 601 executes the computer execution instructions stored in the memory 602, so that the at least one processor 601 executes the serial port switching method embodiments described above.

[0116] The specific implementation process of the processor 601 can refer to the method embodiments described above, which have similar implementation principles and technical effects, and thus will not be described here.

[0117] In the above embodiments, it should be understood that the processor can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of the method disclosed in the application can be directly embodied as hardware processor execution, or executed by a combination of hardware and software modules in the processor.

[0118] The memory can include a random access memory (RAM), and can also include a non-volatile memory (NVM), such as at least one disk memory.

[0119] The bus can be an industry standard architecture (ISA) bus, a peripheral component (PCI) bus, an extended industry standard architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application does not limit to only one bus or one type of bus.

[0120] The embodiments of the present application also provide a computer readable storage medium, which stores a computer program, and the computer program is configured to execute the steps in any of the above serial port switching method embodiments when running.

[0121] In an example embodiment, the above computer readable storage medium can include, but is not limited to, a U disk, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and various computer program storage media.

[0122] The embodiment of the present application further provides a computer program product, which comprises a computer program, and the computer program realizes the steps in any of the serial port switching method embodiments when executed by a processor.

[0123] The embodiment of the present application further provides another computer program product, which comprises a nonvolatile computer readable storage medium, and the nonvolatile computer readable storage medium stores a computer program, and the computer program realizes the steps in any of the serial port switching method embodiments when executed by a processor.

[0124] Those skilled in the art can further realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be realized in electronic hardware, computer software or a combination of both. In order to clearly illustrate the interchangeability of hardware and software, the components and steps of the examples have been described in the above description in general terms. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0125] The above describes in detail a serial port switching method provided by the present application. The principles and implementation manners of the present application are described by applying specific examples in this paper, and the above description of the examples is only used to help understand the method of the present application and its core idea. It should be pointed out that, for those skilled in the art, some improvements and modifications can be made to the present application without departing from the principles of the present application, and these improvements and modifications also fall within the protection scope of the claims of the present application.

Claims

1. A serial port connection system, characterized in that, The system includes a serial port input terminal, a controller, and a serial port output terminal. The controller includes a main register, a spare register, a serial port connector, and a register switch. The serial port input terminal is connected to the main register and the spare register, respectively. The register switch is connected to the main register, the spare register, and the serial port connector, respectively. The serial port connector is connected to the serial port output terminal. The register switcher is used to store the serial port configuration information of the main register as the serial port backup information of the backup register based on the firmware upgrade request of the controller, disconnect the main register from the serial port connector, and connect the backup register to the serial port connector. The backup register is set in a preset isolation area of ​​the controller. The serial port connector is used to determine the target device serial port corresponding to the serial port input terminal based on the serial port backup information of the spare register during the firmware upgrade process of the controller, and to connect the serial port output terminal to the target device serial port. The target device serial port is one of the multiple device serial ports connected to the serial port input terminal.

2. The system according to claim 1, characterized in that, The register switcher also includes a first detector and a current-mode logic circuit. The first detector is connected to a first detection pin of the upgrade control device, and the first detector is connected to the current-mode logic circuit. The current-mode logic circuit is connected to the first detector, the main register, and the spare register, respectively. The first detector is used to detect the upgrade signal of the first detection pin, and send a first switching signal to the current-mode logic circuit according to the upgrade signal; The current-mode logic circuit is used to disconnect the main register from the serial port connector and connect the spare register to the serial port connector based on the first transition signal.

3. The system according to claim 2, characterized in that, The current-mode logic circuit includes a differential current switch, which is used to cut off the clock path between the main register and the clock source pin according to the first transition signal, and connect the spare register to the clock source pin to realize the transfer of control of serial port switching.

4. The system according to claim 3, characterized in that, The differential current switch is specifically used to turn off the current switch flowing to the main register clock path and turn on the current switch flowing to the backup register clock path.

5. The system according to claim 2, characterized in that, The first detector is specifically used to send a first switching signal to the current-mode logic circuit if the upgrade signal is a first preset signal. The first preset signal is used to indicate that the firmware upgrade request has been received.

6. The system according to claim 1, characterized in that, The register switcher further includes a second detector, which is connected to a second detection pin of the upgrade control device, wherein... The second detector is used to detect the upgrade result signal of the second detection pin, wherein the upgrade result signal is an upgrade success signal or an upgrade failure signal; The register switcher is also used to update the serial port configuration information of the master register based on the upgrade result signal.

7. The system according to claim 6, characterized in that, The register switcher is specifically used for, If the upgrade result signal is a successful upgrade signal, the serial port backup information of the backup register is verified to obtain the verification result; When the verification result is successful, the serial port configuration information of the main register is updated according to the serial port backup information of the backup register. When the verification result is a verification failure, multiple historical backup information in the spare register is obtained, target backup information is determined from the multiple historical backup information, and the serial port configuration information of the main register is updated according to the target backup information; If the upgrade result signal is an upgrade failure signal, the target backup information is determined from the multiple historical backup information in the spare register, and the serial port backup information in the main register is updated through the target backup information; The target backup information is the historical backup information with the highest number of backups among the multiple historical backup information.

8. The system according to claim 1, characterized in that, The register switcher is also used for, After the controller upgrade process is completed, the serial port configuration information of the main register is updated according to the backup information of the spare register. Disconnect the spare register from the serial port connector and connect the main register to the serial port connector.

9. The system according to claim 8, characterized in that, The serial port connector is also used to determine the target device serial port among the multiple device serial ports according to the serial port configuration information updated by the master register, and connect the serial port output terminal to the target device serial port.

10. A serial port connection method, characterized in that, Applied to the serial port connection system according to any one of claims 1-9; the method includes: Receive a firmware upgrade request, which is used to perform a firmware upgrade on the controller; According to the firmware upgrade request, the serial port configuration information of the main register is stored as the serial port backup information of the backup register, and the connection between the main register and the serial port connector is disconnected, and the backup register is connected to the serial port connector. Based on the serial port backup information of the backup register, the target device serial port is determined among multiple device serial ports, and the serial port output is connected to the target device serial port.

Citation Information

Patent Citations

  • Upgrading processing system of complex programmable logic device (CPLD)

    CN106610841A

  • Serial port control system based on complex programmable logic device (CPLD) and communication method thereof

    CN113377701A