Shared serial port identification method and device, computer device and storage medium
Patent Information
- Application Number
- CN202211247811.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-12
- Publication Date
- 2026-10-30
- Estimated Expiration
- 2042-10-12
AI Technical Summary
[0008]现有技术中通过将串口接入器所接收的串口数据结合其来自数据通道所分配有的标识信息进行编码以作区分标识,采用高亮、带颜色的显示方式,解决了设备与串口一一对应情况下,区分多个数据通道的串口数据的问题,但是并没有解决在多设备共享串口的条件下,识别出共享串口当前连接设备的问题
[0039]本申请中通过通道切换标识字符检测逻辑实时检测数据,若有所述通道切换标识字符,则发送目标通道序号至维护端由维护端设置目标字体颜色设置命令锁定字体颜色设置逻辑,使用不同的串口字符字体颜色和背景颜色来标识当前连接的设备,返回到通道切换标识字符检测逻辑,继续实时检测数据。
Smart Images

Figure CN115576752B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data transmission technology, and in particular to a shared serial port identification method, apparatus, computer device, and storage medium. Background Technology
[0002] With the development of the domestic storage industry, the "one-frame, four-controller" storage control chassis has gradually become a trend in high-end storage due to its strong reliability of three out of four failures. "One-frame, four-controller" refers to a chassis containing four controllers (i.e., motherboards).
[0003] In existing technologies, each controller contains at least an x86 main operating system and a BMC management subsystem. Some designs also include an additional FPGA system or a dedicated ASIC system. All of these systems need to provide external debugging serial ports for R&D and maintenance personnel.
[0004] As the number of controllers adapted within the frame reaches four, with the controllers providing the X86 business main operating system and the BMC management subsystem, the total number of serial ports will reach eight.
[0005] The storage control unit is highly integrated, and due to space limitations, only one serial port can usually be reserved on the front panel of the chassis. Therefore, it is necessary for four controllers to share a single serial port.
[0006] A single-pole eight-way switch is implemented by connecting all serial ports to the CPLD on the management module. The user inputs a character to the CPLD through the "headphone jack" input channel, and the CPLD controls the toggle of the single-pole eight-way switch by recognizing different characters.
[0007] The constant switching between the eight serial ports can lead to confusion. For example, the serial port output characters of the main operating system on controller 1 and controller 2 might be identical. When a user switches from controller 1 to controller 2, they cannot determine whether the switch was successful. Similarly, the user cannot know which controller the current serial port is connected to. Users can only determine this indirectly through other methods (such as checking the controller serial number or IP address), causing significant inconvenience for development and maintenance.
[0008] In existing technologies, the serial port data received by the serial port access device is encoded by combining it with the identification information allocated from the data channel for identification, and a highlighted, color-coded display method is used. This solves the problem of distinguishing serial port data from multiple data channels when there is a one-to-one correspondence between devices and serial ports. However, it does not solve the problem of identifying the currently connected device when multiple devices share a serial port. Summary of the Invention
[0009] The purpose of this invention is to provide a shared serial port identification method, device, computer equipment, and storage medium.
[0010] The technical solution of this invention is:
[0011] Firstly, a shared serial port identification method is provided, the method comprising:
[0012] Based on the preset channel switching identifier character detection logic, the running data is detected in real time to determine whether there is a channel switching identifier character input;
[0013] If so, the target channel number is obtained based on the input channel switching identifier character;
[0014] Send the target channel number to the maintenance terminal and obtain the target font color setting command returned by the maintenance terminal based on the target channel number;
[0015] Based on the target font color setting command, modify the font color and font background color of the corresponding identifier of the target channel to distinguish each serial port channel.
[0016] Furthermore, the step of detecting running data in real time based on the preset channel switching identifier character detection logic to determine whether there is a channel switching identifier character input includes:
[0017] The system detects running data based on the RX input from the headphone jack and the preset channel switching identifier character to determine whether there is a channel switching identifier character input.
[0018] Furthermore, after determining whether there is a channel switching identifier input based on the RX input from the headphone jack and the preset channel switching identifier character detection running data, the method further includes:
[0019] The single-pole multi-throw switch is controlled by recognizing the preset channel switching identifier character.
[0020] Furthermore, after the method detects running data in real time based on the preset channel switching identifier character detection logic to determine whether there is a channel switching identifier character input, if so, the method further includes:
[0021] The single-pole multi-throw switch is set to a floating state.
[0022] Furthermore, after modifying the font color and background color of the corresponding identifier of the target channel based on the target font color setting command to distinguish each serial port channel, the method further includes:
[0023] Determine whether the font color and background color of the corresponding label for each channel have been modified;
[0024] Disable UART-transmit logic;
[0025] Switch the single-pole multi-throw switch according to the target channel number.
[0026] Furthermore, the target font color setting command includes at least font color setting logic, which includes:
[0027] Set the color control combination as: ESC character + character "[" + character "color code" + character "m";
[0028] Set the ASSIC character to hexadecimal or binary.
[0029] Furthermore, after determining whether a channel switching identifier character has been input by real-time detection of running data based on a preset channel switching identifier character, the method further includes:
[0030] If not, then continue with the real-time detection.
[0031] Secondly, a shared serial port identification device is provided, the device comprising:
[0032] The detection and judgment module is used to detect the running data in real time based on the preset channel switching identifier character detection logic to determine whether there is a channel switching identifier character input;
[0033] The acquisition module is used to acquire the target channel number based on the input channel switching identifier character when the judgment result of the detection and judgment module is yes;
[0034] The send-return module is used to send the target channel number to the maintenance terminal and obtain the target font color setting command returned by the maintenance terminal based on the target channel number;
[0035] The modification module is used to modify the font color and font background color of the corresponding identifier of the target channel based on the target font color setting command in order to distinguish each serial port channel.
[0036] Thirdly, a computer device is provided, the computer device including one or more processors; and a memory associated with the one or more processors, the memory for storing program instructions, which, when read and executed by the one or more processors, perform the steps of the shared serial port identification method as described in any one of the first aspects above.
[0037] Fourthly, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, performs the steps of the shared serial port identification method as described in any one of the first aspects above.
[0038] The technical solution described in this application has the following advantages over the prior art:
[0039] In this application, data is detected in real time through channel switching identifier character detection logic. If the channel switching identifier character is present, the target channel number is sent to the maintenance terminal, which sets the target font color setting command to lock the font color setting logic. Different serial port character font colors and background colors are used to identify the currently connected device. Then, the system returns to the channel switching identifier character detection logic to continue detecting data in real time.
[0040] This invention can solve the problem that the inability to display the devices connected by the shared serial port causes reduced performance of the storage controller, risk of data loss, and great trouble for research and development and maintenance. Attached Figure Description
[0041] The present invention will be further described below with reference to the accompanying drawings and embodiments:
[0042] Figure 1 This is a front view of a memory in the prior art;
[0043] Figure 2 This is a rear view of a memory in the prior art;
[0044] Figure 3 A block diagram showing the structure of four controllers sharing a single serial port in the memory;
[0045] Figure 4 A block diagram showing the structure of the CPLD in the management module for implementing serial port switching;
[0046] Figure 5 This is a schematic diagram of the first process of the shared serial port identification method provided in an embodiment of the present invention;
[0047] Figure 6 This is a schematic diagram of the second process of the shared serial port identification method provided in an embodiment of the present invention;
[0048] Figure 7 This is a schematic diagram illustrating the effect of the shared serial port identification method provided in this embodiment of the invention;
[0049] Figure 8 This is a structural block diagram of the shared serial port identification device provided in an embodiment of the present invention;
[0050] Figure 9 An architectural diagram of a computer device provided for an embodiment of the present invention. Detailed Implementation
[0051] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0052] As described in the background section, current storage control enclosures with four controllers per enclosure are gradually becoming a trend in high-end storage due to their robust reliability (four out of four fail). A four-controller enclosure means that four controllers (i.e., motherboards) are installed within a single chassis. Taking a current storage control enclosure as an example... Figure 1 and Figure 2 As shown.
[0053] in, Figure 1 This is the front view; the arrow indicates the controller. Figure 2 This is the rear view; the arrow indicates the shared serial port.
[0054] Each controller contains at least an x86 main operating system and a BMC management subsystem; some designs also include an FPGA system or a dedicated ASIC system. All of these systems need to provide external debugging serial ports for R&D and maintenance personnel.
[0055] As the number of controllers adapted within the frame reaches four, even with the controllers providing an X86 business main operating system and a BMC management subsystem, the total number of serial ports will reach eight.
[0056] from Figure 2 As shown in the image, the storage control box is highly integrated, and due to space limitations, only one serial port can usually be reserved on the chassis panel. Therefore, it is necessary for four controllers to share a single serial port.
[0057] Its implementation method is generally as follows: Figure 3 As shown.
[0058] like Figure 4 As shown, all serial ports are connected to the CPLD on the management module. The CPLD performs internal synthesis, implementing a switch similar to a single-pole eight-way switch. The user inputs special characters through the headphone jack to the CPLD, which then controls the toggle of the single-pole eight-way switch by recognizing different characters.
[0059] CPLD stands for Complex Programming Logic Device.
[0060] However, repeatedly switching between eight serial ports will inevitably lead to switching confusion. For example, the serial port output characters of the main operating system of Controller 1 and Controller 2 might be identical. When a user switches from Controller 1 to Controller 2, they cannot determine whether the switch was successful. Similarly, the user cannot know which controller the current serial port is connected to. Users can only determine this indirectly through other methods (such as checking the controller serial number or IP address). This will cause significant problems for development and maintenance, greatly reduce user-friendliness, and ultimately lead to a negative customer experience and criticism.
[0061] Example 1:
[0062] This invention provides a shared serial port identification method, which may include the following steps:
[0063] S510: Based on the preset channel switching identifier character detection logic, the running data is detected in real time to determine whether there is a channel switching identifier character input.
[0064] If the judgment result of real-time detection of running data based on the preset channel switching identifier character detection logic to determine whether there is a channel switching identifier character input is yes, then proceed to step S520.
[0065] In one implementation, the process of this step may include:
[0066] S511. Based on the RX input from the headphone jack and the preset channel switching identifier character, detect the running data to determine whether there is a channel switching identifier character input.
[0067] The RX input from the headphone jack is a channel switching identifier character.
[0068] In one embodiment, before step S510, which uses preset channel switching identifier character detection logic to detect running data in real time to determine whether a channel switching identifier character has been input, the method further includes:
[0069] Connect all serial ports to a complex programmable logic device to enable the configuration of a single-pole multi-throw switch.
[0070] In one embodiment, after step S510, which involves real-time detection of running data based on a preset channel switching identifier character detection logic to determine whether a channel switching identifier character has been input, the method further includes the following steps:
[0071] S1. Control the toggle of the single-pole multi-throw switch by recognizing the preset channel switching identifier character.
[0072] Specifically,
[0073] If the judgment result of real-time detection of running data based on preset channel switching identifier character detection logic to determine whether there is a channel switching identifier character input is yes, then the single-pole multi-throw switch is set to a floating state.
[0074] If the judgment result of real-time detection of running data based on the preset channel switching identifier character detection logic is negative, then return to the channel switching identifier character detection logic.
[0075] S520: Obtain the target channel number based on the input channel switching identifier character.
[0076] S530. Send the target channel number to the maintenance terminal and obtain the target font color setting command returned by the maintenance terminal based on the target channel number.
[0077] The maintenance terminal is a serial terminal software (such as xshell, TeraTerm, etc.) on the PC of the R&D and maintenance personnel.
[0078] When the serial terminal software (such as xshell, Tera Term, etc.) on the PCs of R&D and maintenance personnel receives the aforementioned characters sent from the debugging device, it will modify the display font color and font background color. The debugging device is a complex programmable logic device, i.e., a CPLD.
[0079] Down Figure 7 This is to demonstrate the effect after color adjustment.
[0080] S540. Modify the font color and background color of the corresponding identifier of the target channel based on the target font color setting command to distinguish each serial port channel.
[0081] The implementation process of step S540, which modifies the font color and background color of the corresponding identifier of the target channel based on the target font color setting command to distinguish each serial port channel, may include the following steps:
[0082] S541. Set the color control combination to: ESC character + character "[" + character "color code" + character "m".
[0083] Figure 7 This is a schematic diagram illustrating the effect of the shared serial port identification method provided in this embodiment of the invention. (Refer to...) Figure 7 As shown, the color codes are divided into characters 30-37 to set the font color and characters 40-47 to set the font background.
[0084] 30: Black 40: Black
[0085] 31: Red 41: Red
[0086] 32: Green 42: Green
[0087] 33: Yellow 43: Yellow
[0088] 34: Blue 44: Blue
[0089] 35: Purple 45: Purple
[0090] 36: Green 46: Green
[0091] 37: White 47: White
[0092] Use the serial port font color and font background color mentioned above to identify the currently connected device, for example:
[0093] White text on a black background indicates the serial port output of the controller 1-X86 business main operating system.
[0094] Blue text on a black background indicates the serial port output of the controller 1-BMC management subsystem.
[0095] White text with a green background indicates the serial port output of the controller 2-X86 business main operating system.
[0096] Blue text with a green background indicates the serial port output of the controller 2-BMC management subsystem.
[0097] White text with a yellow background indicates the serial port output of the controller's 3-X86 business main operating system.
[0098] Blue text with a yellow background indicates the serial port output of the controller 3-BMC management subsystem.
[0099] White text with a red background indicates the serial port output of the controller's 4-X86 business main operating system.
[0100] Blue text with a red background indicates the serial port output of the controller 4-BMC management subsystem.
[0101] The color control combination is then:
[0102] White text on a black background indicates the serial port output of the controller 1-X86 business main operating system.
[0103] ESC character (0x1b) + character "[" (0x5b) + character "color code" + character "m" (0x6d)
[0104] 0x1b 0x5b 0x33 0x37 0x6d / / Set font color
[0105] 0x1b 0x5b 0x340x400x6d / / Set font background color
[0106] Blue text on a black background indicates serial port output of the controller 1-BMC management subsystem.
[0107] ESC character (0x1b) + character "[" (0x5b) + character "color code" + character "m" (0x6d)
[0108] 0x1b 0x5b 0x33 0x34 0x6d / / Set font color
[0109] 0x1b 0x5b 0x340x400x6d / / Set font background color
[0110] White text with a green background indicates the serial port output of the controller 2-X86 business main operating system.
[0111] 0x1b 0x5b 0x33 0x37 0x6d / / Set font color
[0112] 0x1b 0x5b 0x34 0x4 20x6d / / Set font background color
[0113] Blue text with a green background indicates serial port output from the controller 2-BMC management subsystem.
[0114] 0x1b 0x5b 0x33 0x34 0x6d / / Set font color
[0115] 0x1b 0x5b 0x34 0x4 20x6d / / Set font background color
[0116] S542. Set the ASSIC character to hexadecimal or binary.
[0117] In one implementation, after step S540 modifies the font color and background color of the identifier corresponding to the target channel based on the target font color setting command to distinguish each serial port channel, the method further includes the following steps:
[0118] S2. Determine whether the font color and background color of the corresponding label for each channel have been modified.
[0119] S3, disable UART-send logic.
[0120] S4. Switch the single-pole multi-throw switch according to the target channel number.
[0121] In one implementation, step S540 is followed by:
[0122] S5, Return Channel Switching Identifier Character Detection Logic.
[0123] Example 2:
[0124] Reference Figure 8 As shown, this embodiment of the invention provides a shared serial port identification device, which may include the following modules:
[0125] The detection and judgment module 810 is used to detect the running data in real time based on the preset channel switching identifier character detection logic to determine whether there is a channel switching identifier character input.
[0126] The acquisition module 820 is used to acquire the target channel number based on the input channel switching identifier character when the judgment result of the detection and judgment module is yes.
[0127] The send-return module 830 is used to send the target channel number to the maintenance terminal and obtain the target font color setting command returned by the maintenance terminal based on the target channel number.
[0128] Modification module 840 is used to modify the font color and font background color of the corresponding identifier of the target channel based on the target font color setting command in order to distinguish each serial port channel.
[0129] The detection and judgment module 810 includes:
[0130] The detection and judgment unit 811 is used to detect running data based on the RX input from the headphone jack and the preset channel switching identifier character to determine whether there is a channel switching identifier character input.
[0131] Preferably, the device further includes:
[0132] The identification control module 850 is used to control the toggle of the single-pole multi-throw switch by identifying the preset channel switching identifier character after the detection and judgment module 810 detects the running data based on the RX input from the headphone jack and the preset channel switching identifier character to determine whether there is a channel switching identifier character input.
[0133] Preferably, the device further includes:
[0134] Setting module 860 is used to set the single-pole multi-throw switch to a floating state when the detection and judgment module 810 determines whether there is a channel switching identifier input based on the RX input from the headphone jack and the preset channel switching identifier character detection running data.
[0135] Preferably, the device further includes:
[0136] The judgment module 870 is used to determine whether the font color and font background color of the corresponding identifier of each channel have been modified after the modification module 840 modifies the font color and font background color of the target channel corresponding identifier based on the target font color setting command to distinguish each serial port channel.
[0137] Module 880 is used to disable the UART-transmit logic.
[0138] The switching module 890 is used to switch the single-pole multi-throw switch according to the target channel number.
[0139] The aforementioned modified module 840 includes:
[0140] Color setting unit 841 is used to set the color control combination as: ESC character + character "[" + character "color code" + character "m".
[0141] Character setting unit 842 is used to set the ASSIC character to hexadecimal or binary.
[0142] Preferably, the device further includes:
[0143] The detection module 8A0 is used to continue real-time detection when the detection judgment module 810 determines whether there is a channel switching identifier input based on the RX input from the headphone jack and the preset channel switching identifier character detection running data, and the result is negative.
[0144] Example 3:
[0145] Corresponding to Embodiments 1 and 2 above, the following will be combined with Figure 9 This embodiment describes a computer device. In one example... Figure 9 As shown, this application provides a computer device, which includes:
[0146] One or more processors;
[0147] and a memory associated with the one or more processors, the memory storing program instructions that, when read and executed by the one or more processors, perform the following steps:
[0148] Based on the preset channel switching identifier character detection logic, the running data is detected in real time to determine whether there is a channel switching identifier character input;
[0149] If so, the target channel number is obtained based on the input channel switching identifier character;
[0150] Send the target channel number to the maintenance terminal and obtain the target font color setting command returned by the maintenance terminal based on the target channel number;
[0151] Based on the target font color setting command, modify the font color and font background color of the corresponding identifier of the target channel to distinguish each serial port channel.
[0152] When the program instructions are read and executed by the one or more processors, the processors also perform the following steps when executing the computer program:
[0153] The system detects running data based on the RX input from the headphone jack and the preset channel switching identifier character to determine whether there is a channel switching identifier character input.
[0154] When the program instructions are read and executed by the one or more processors, the processors, when executing the computer program, also perform the following steps:
[0155] The single-pole multi-throw switch is controlled by recognizing the preset channel switching identifier character.
[0156] When the program instructions are read and executed by the one or more processors, the processors, when executing the computer program, also perform the following steps:
[0157] The single-pole multi-throw switch is set to a floating state.
[0158] When the program instructions are read and executed by the one or more processors, the processors, when executing the computer program, also perform the following steps:
[0159] Determine whether the font color and background color of the corresponding label for each channel have been modified;
[0160] Disable UART-transmit logic;
[0161] Switch the single-pole multi-throw switch according to the target channel number.
[0162] When the program instructions are read and executed by the one or more processors, the processors, when executing the computer program, also perform the following steps:
[0163] Set the color control combination as: ESC character + character "[" + character "color code" + character "m";
[0164] Set the ASSIC character to hexadecimal or binary.
[0165] When the program instructions are read and executed by the one or more processors, the processors, when executing the computer program, also perform the following steps:
[0166] If the real-time detection of running data based on the preset channel switching identifier character detection logic results in a negative result, then the real-time detection continues.
[0167] When the program instructions are read and executed by the one or more processors, they can also perform operations corresponding to the steps in the above method embodiments, as described above, and will not be repeated here. (Reference) Figure 9 This exemplifies the architecture of a computer device, which may include a processor 910, a video display adapter 911, a disk drive 912, an input / output interface 913, a network interface 914, and a memory 920. The processor 910, video display adapter 911, disk drive 912, input / output interface 913, network interface 914, and memory 920 can communicate with each other via a communication bus 930.
[0168] The processor 910 can be implemented using a general-purpose central processing unit (CPU), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to achieve the technical solution provided in this application.
[0169] The memory 920 can be implemented as a read-only memory (ROM), random access memory (RAM), static storage device, dynamic storage device, etc. The memory 920 can store the operating system 921 for controlling the operation of the computer device 900, and the basic input / output system (BIOS) 922 for controlling the low-level operations of the computer device 900. Additionally, it can store a web browser 923, data storage management 924, and an icon font processing system 925, etc. The aforementioned icon font processing system 925 can be the application program that specifically implements the aforementioned steps in this embodiment. In summary, when implementing the technical solution provided in this application through software or firmware, the relevant program code is stored in the memory 920 and executed by the processor 910.
[0170] Input / output interface 913 is used to connect input / output modules to realize information input and output. Input / output modules can be configured as components in the device (not shown in the figure) or externally connected to the device to provide corresponding functions. Input devices may include keyboards, mice, touch screens, microphones, various sensors, etc., and output devices may include displays, speakers, vibrators, indicator lights, etc.
[0171] Network interface 914 is used to connect a communication module (not shown in the figure) to enable communication between this device and other devices. The communication module can communicate via wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).
[0172] Bus 930 includes a pathway for transmitting information between various components of the device, such as processor 910, video display adapter 911, disk drive 912, input / output interface 913, network interface 914, and memory 920.
[0173] In addition, the computer device 900 can also obtain information on specific acquisition conditions from the virtual resource object acquisition condition information database 941 for condition judgment, etc.
[0174] It should be noted that although the computer device 900 described above only shows a processor 910, a video display adapter 911, a disk drive 912, an input / output interface 913, a network interface 914, a memory 920, and a bus 930, in specific implementations, the computer device may also include other components necessary for normal operation. Furthermore, those skilled in the art will understand that the above device may only include the components necessary for implementing the solution of this application, and does not necessarily include all the components shown in the figures.
[0175] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, cloud server, or network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments of this application.
[0176] Example 4:
[0177] Corresponding to Embodiments 1 to 3 above, this embodiment provides a computer-readable storage medium storing a computer program. When executed by a processor, the computer program implements the steps of the shared serial port identification method in the above embodiments, such as steps S510 to S540 and other extensions and related steps of the method. Alternatively, when executed by a processor, the computer program implements the functions of each module / unit of the shared serial port identification device in the above embodiments, such as the functions of modules 810 to 8A0. To avoid repetition, further details are omitted here.
[0178] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double-rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0179] Specifically, when the computer program is executed by the processor, it performs the following steps:
[0180] Based on the preset channel switching identifier character detection logic, the running data is detected in real time to determine whether there is a channel switching identifier character input;
[0181] If so, the target channel number is obtained based on the input channel switching identifier character;
[0182] Send the target channel number to the maintenance terminal and obtain the target font color setting command returned by the maintenance terminal based on the target channel number;
[0183] Based on the target font color setting command, modify the font color and font background color of the corresponding identifier of the target channel to distinguish each serial port channel.
[0184] When the computer program is executed by the processor, it also performs the following steps:
[0185] The system detects running data based on the RX input from the headphone jack and the preset channel switching identifier character to determine whether there is a channel switching identifier character input.
[0186] When the computer program is executed by the processor, it also performs the following steps:
[0187] The single-pole multi-throw switch is controlled by recognizing the preset channel switching identifier character.
[0188] When the computer program is executed by the processor, it also performs the following steps:
[0189] The single-pole multi-throw switch is set to a floating state.
[0190] When the computer program is executed by the processor, it also performs the following steps:
[0191] Determine whether the font color and background color of the corresponding label for each channel have been modified;
[0192] Disable UART-transmit logic;
[0193] Switch the single-pole multi-throw switch according to the target channel number.
[0194] When the computer program is executed by the processor, it also performs the following steps:
[0195] Set the color control combination as: ESC character + character "[" + character "color code" + character "m";
[0196] Set the ASSIC character to hexadecimal or binary.
[0197] When the computer program is executed by the processor, it also performs the following steps:
[0198] If the real-time detection of running data based on the preset channel switching identifier character detection logic results in a negative result, then the real-time detection continues.
[0199] Of course, the above embodiments are only for illustrating the technical concept and features of the present invention, and their purpose is to enable those skilled in the art to understand the content of the present invention and implement it accordingly. They should not be used to limit the scope of protection of the present invention. All modifications made according to the spirit and essence of the main technical solution of the present invention should be covered within the scope of protection of the present invention.
Claims
1. A shared serial port identification method, characterized in that, include: Based on the preset channel switching identifier character detection logic, the running data is detected in real time to determine whether there is a channel switching identifier character input; If so, the target channel number is obtained based on the input channel switching identifier character; Set the single-pole multi-throw switch to the floating state; Send the target channel number to the maintenance terminal and obtain the target font color setting command returned by the maintenance terminal according to the target channel number. The maintenance terminal is a serial terminal software. After receiving the target channel number from the debugging device, the maintenance terminal actively modifies the display font color and font background color according to the target channel number. Based on the target font color setting command, modify the font color and font background color of the corresponding identifier of the target channel to distinguish each serial port channel; Determine whether the font color and background color of the corresponding label for each channel have been modified; Disable UART-transmit logic; Switch the single-pole multi-throw switch according to the target channel number.
2. The shared serial port identification method according to claim 1, characterized in that, The real-time detection of running data based on the preset channel switching identifier character detection logic to determine whether there is a channel switching identifier character input includes: The system detects running data based on the RX input from the headphone jack and the preset channel switching identifier character to determine whether there is a channel switching identifier character input.
3. The shared serial port identification method according to claim 2, characterized in that, After determining whether there is a channel switching identifier input based on the RX input from the headphone jack and the preset channel switching identifier character detection running data, the method further includes: The single-pole multi-throw switch is controlled by recognizing the preset channel switching identifier character.
4. The shared serial port identification method according to claim 1, characterized in that, The target font color setting command includes at least font color setting logic, which includes: Set the color control combination as: ESC character + character "[" + character "color code" + character "m"; Set the ASSIC character to hexadecimal or binary.
5. The shared serial port identification method according to claim 1, characterized in that, After determining whether a channel switching identifier character has been input by real-time detection of running data based on a preset channel switching identifier character, the method further includes: If not, then continue with the real-time detection.
6. A shared serial port identification device, characterized in that, The device includes: The detection and judgment module is used to detect the running data in real time based on the preset channel switching identifier character detection logic to determine whether there is a channel switching identifier character input; The acquisition module is used to acquire the target channel number based on the input channel switching identifier character when the judgment result of the detection and judgment module is yes; The setting module is used to set the single-pole multi-throw switch to the floating state; The send-return module is used to send the target channel number to the maintenance terminal and obtain the target font color setting command returned by the maintenance terminal according to the target channel number. The maintenance terminal is a serial terminal software. After receiving the target channel number from the debugging device, the maintenance terminal actively modifies the display font color and font background color according to the target channel number. The modification module is used to modify the font color and font background color of the corresponding identifier of the target channel based on the target font color setting command in order to distinguish each serial port channel; The judgment module is used to determine whether the font color and font background color of the corresponding identifier for each channel have been modified; The shutdown module is used to disable the UART-transmit logic; The switching module is used to switch the single-pole multi-throw switch according to the target channel number.
7. A computer device, characterized in that, The computer device includes: One or more processors; And a memory associated with the one or more processors, the memory being used to store program instructions that, when read and executed by the one or more processors, perform the steps of the shared serial port identification method as described in any one of claims 1 to 5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Method for switching serial ports and sharing device of serial ports
CN101520763A
Device and method for processing serial port data of multiple devices
CN105357077A