A communication method, device and system for key signals
By detecting and automatically switching the data line connection status in dual-channel redundant signal transmission, the data error problem caused by dummy wire connection is solved, and the communication quality of key signals and system stability is improved.
Patent Information
- Application Number
- CN202411379659.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2024-12-10
- Estimated Expiration
- 2044-09-30
AI Technical Summary
The existing dual-channel redundant signal transmission can easily lead to data errors when the wires are connected, affecting the quality of key signals.
By dividing the pin connection lines into the first and second sets of data lines, the connection status of each set of data lines is detected, and the transmission protocol is automatically switched when there is a problem with one set of data lines, and the key signals are used by another set of data lines. For transmission, if there is a problem with both sets of data lines, calculate the number of normal pins to determine the parallel or serial communication method.
It reduces data errors during dual-channel redundant transmission, improves the communication quality of key signals, ensures the stability of each bit data during high-speed communication, and improves the communication stability of the system.
Smart Images

Figure CN118890312B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of dual-channel redundancy, and in particular to a communication method, device and system for key signals. Background Art
[0002] At present, when transmitting key signals, dual-channel redundancy is usually used to ensure signal reliability. When a channel is detected to have a problem and cannot be used, it is passively switched to another channel. However, in the existing transmission method, if communication is still carried out when a wire is loosely connected in one of the channels, the transmitted data is prone to being partially wrong and partially correct, which in turn brings the risk of data disaster to the system.
[0003] In view of the above-mentioned related technologies, the inventors have found that the existing dual-channel redundant transmission of key signals has transmission data errors when communicating through channels with virtual wire connections, which affects the quality of key signal communication. Summary of the invention
[0004] In order to improve the communication quality of key signals and reduce the phenomenon of data errors occurring during dual-channel redundant transmission, the present application provides a communication method, device and system for key signals.
[0005] In a first aspect, the present application provides a communication method for a key signal.
[0006] This application is achieved through the following technical solutions:
[0007] A key signal communication method comprises the following steps:
[0008] Divide the target pins belonging to the working pins in the pin connection lines into a first group of data lines and a second group of data lines, wherein the number of the target pins is less than the total number of the working pins and is an even number;
[0009] Before the key signal is transmitted, detecting the connection status of the first group of data lines and the connection status of the second group of data lines;
[0010] If there is a problem with one of the data lines, another set of data lines is used to automatically switch the transmission protocol to transmit key signals between the first module and the second module.
[0011] In a preferred example, the present application may be further configured as follows: after the step of detecting the connection status of the first group of data lines and the connection status of the second group of data lines, the step further includes:
[0012] If both sets of data lines have problems, calculate the total number of normal pins;
[0013] Determine whether the total number of normal pins meets a preset maximum threshold;
[0014] When the total number of normal pins meets the maximum threshold, the normal pins are used in combination with the line numbers corresponding to the normal pins, and parallel communication is used to transmit key signals.
[0015] In a preferred example, the present application may be further configured as follows: after the step of determining whether the total number of normal pins meets a preset maximum threshold, the step further includes:
[0016] When the total number of normal pins does not meet the maximum threshold, determining whether the total number of normal pins meets a preset minimum threshold;
[0017] When the total number of normal pins meets the minimum threshold, the normal pins are used to transmit key signals using serial communication.
[0018] In a preferred example, the present application may be further configured as follows: the step of detecting the connection status of the first group of data lines includes:
[0019] The microcontroller unit of the first module triggers connection status detection of the first data line of the first group of data lines according to the communication protocol;
[0020] When the first module receives data, a preset resistance detection circuit is used to detect the output resistance of the first data line;
[0021] Determine the difference between the output resistance of the first data line and a preset first resistance threshold;
[0022] If the output resistance of the first data line exceeds the first resistance threshold, setting the pin of the first data line to a high level, and determining that there is a problem with the first data line;
[0023] When there is a problem with any of the data lines, it is determined that there is a problem with the first group of data lines.
[0024] In a preferred example, the present application may be further configured as follows: the step of detecting the connection status of the first group of data lines further includes:
[0025] The microcontroller unit of the first module triggers connection status detection of the second data line of the first group of data lines according to the communication protocol;
[0026] When the second module receives data, a preset resistance detection circuit is used to detect the output resistance of the second data line;
[0027] Determine the difference between the output resistance of the second data line and a preset second resistance threshold;
[0028] If the output resistance of the second data line exceeds the second resistance threshold, the pin of the second data line is set to a high level, and it is determined that there is a problem with the second data line.
[0029] In a preferred example, the present application can be further configured as follows: it also includes the following steps:
[0030] After the connection status of all the data lines of the first group of data lines is detected, the connection status of all the data lines of the second group of data lines is detected in sequence.
[0031] In a preferred example, the present application can be further configured as follows: it also includes the following steps:
[0032] A pin connection line is provided between the first module and the second module for communication, wherein the number of pins of the pin connection line is 20;
[0033] The first 16 pins in the pin connection line are taken as target pins, and the target pins are divided to obtain a first group of data lines and a second group of data lines.
[0034] In a preferred example, the present application can be further configured as follows: the step of calculating the total number of normal pins includes:
[0035] Obtaining the total number of working pins;
[0036] Counting the number of problematic data lines in the first group of data lines and the second group of data lines to obtain a total number of problematic pins;
[0037] A subtraction operation is performed based on the total number of working pins and the total number of problem pins to obtain the total number of normal pins.
[0038] In a preferred example, the present application may be further configured as follows: when the automatic switching transmission protocol is used to transmit key signals between the first module and the second module, the following steps are included:
[0039] The analog switch is used to connect the data line of the first module and the data line of the second module to the
[0040] The first set of data lines;
[0041] Alternatively, an analog switching switch is used to connect the data line of the first module and the data line of the second module to the second group of data lines.
[0042] In a preferred example, the present application can be further configured as follows: when the automatic switching transmission protocol is used to transmit key signals between the first module and the second module, the following steps are also included:
[0043] The first module or the second module carries a packet header each time a key signal is transmitted, and sets the level of the corresponding encryption cable to a high level;
[0044] The second module detects the level of the second encrypted cable, or the first module detects the level of the first encrypted cable;
[0045] When the second module detects that the second encryption cable is at a high level, or when the first module detects that the first encryption cable is at a high level, reading the sent data and determining whether it is a packet header;
[0046] If it is detected as a packet header, the second module is controlled to receive the key signal, or the first module is controlled to receive the key signal.
[0047] In a second aspect, the present application provides a communication device for key signals.
[0048] This application is achieved through the following technical solutions:
[0049] A communication device for a key signal, comprising:
[0050] A grouping module, used for dividing the target pins belonging to the working pins in the pin connection lines into a first group of data lines and a second group of data lines, wherein the number of the target pins is less than the total number of the working pins and is an even number;
[0051] A state detection module, used for detecting the connection state of the first group of data lines and the connection state of the second group of data lines before the key signal is transmitted;
[0052] The switching module is used to use another group of data lines to automatically switch the transmission protocol to transmit key signals between the first module and the second module when there is a problem with one group of data lines.
[0053] In a preferred example, the present application may be further configured as follows: it also includes pin connection lines for communication between the first module and the second module, and the total number of pins of the pin connection lines is greater than or equal to 20.
[0054] In a preferred example, the present application can be further configured as follows: further comprising:
[0055] A normal pin calculation module is used to calculate the total number of normal pins when there are problems with both sets of data lines;
[0056] A first judging module, used to judge whether the total number of normal pins meets a preset maximum threshold;
[0057] The parallel communication module is used to transmit key signals using parallel communication by utilizing normal pins in combination with line numbers corresponding to the normal pins when the total number of normal pins meets the maximum threshold.
[0058] In a preferred example, the present application can be further configured as follows: further comprising:
[0059] A second judgment module is used to judge whether the total number of normal pins meets a preset minimum threshold when the total number of normal pins does not meet the maximum threshold;
[0060] The serial communication module is used to transmit key signals using serial communication by utilizing normal pins when the total number of normal pins meets the minimum threshold.
[0061] In a preferred example, the present application can be further configured as follows: further comprising:
[0062] A packet header sending module, used for the first module or the second module to carry the packet header each time a key signal is transmitted, and to set the level of the corresponding encrypted cable to a high level;
[0063] An encryption detection module, used for the second module to detect the level of the second encryption cable, or the first module to detect the level of the first encryption cable;
[0064] A packet header detection module, used for reading the transmitted data and determining whether it is a packet header when the second module detects that the second encrypted cable is at a high level, or when the first module detects that the first encrypted cable is at a high level;
[0065] The communication module is used to control the second module to receive the key signal, or control the first module to receive the key signal when detecting that it is a packet header.
[0066] In a third aspect, the present application provides a computer device.
[0067] This application is achieved through the following technical solutions:
[0068] A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any one of the above-mentioned key signal communication methods when executing the computer program.
[0069] In a fourth aspect, the present application provides a computer-readable storage medium.
[0070] This application is achieved through the following technical solutions:
[0071] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any one of the above-mentioned key signal communication methods are implemented.
[0072] In a fifth aspect, the present application provides a computer program product.
[0073] This application is achieved through the following technical solutions:
[0074] A computer program product comprises a computer program, wherein when the computer program is executed by a processor, the steps of any one of the above-mentioned key signal communication methods are implemented.
[0075] In a sixth aspect, the present application provides a communication system for key signals.
[0076] This application is achieved through the following technical solutions:
[0077] A critical signal communication system comprises a first module and a second module based on dual-channel redundant communication, wherein the first module and the second module are connected by a pin connection line communication;
[0078] It also includes a resistance detection circuit for detecting the pin connection line before the key signal is transmitted, wherein the target pins belonging to the working pins in the pin connection line are divided into a first group of data lines and a second group of data lines, the number of the target pins is less than the total number of the working pins and is an even number, and the resistance detection circuit detects the connection state of the first group of data lines and the connection state of the second group of data lines;
[0079] The first module and the second module each include a microcontroller unit for controlling the resistance detection circuit, and
[0080] The microcontroller unit is used to use another group of data lines to automatically switch the transmission protocol to transmit key signals between the first module and the second module when there is a problem with one group of data lines.
[0081] In a preferred example, the present application can be further configured as follows: the microcontroller unit is also used to calculate the total number of normal pins when problems exist in both groups of data lines; determine whether the total number of normal pins meets a preset maximum threshold; when the total number of normal pins meets the maximum threshold, use normal pins, combined with the line numbers corresponding to the normal pins, and use parallel communication to transmit key signals.
[0082] In a preferred example, the present application can be further configured as follows: the microcontroller unit is also used to determine whether the total number of normal pins meets a preset minimum threshold when the total number of normal pins does not meet the maximum threshold; when the total number of normal pins meets the minimum threshold, normal pins are used in combination with a wire switching device to use serial communication to transmit key signals.
[0083] In summary, compared with the prior art, the technical solution provided by this application has at least the following beneficial effects:
[0084] Communication is performed by setting pin connection lines to ensure as much as possible that there are enough connection lines for redundant use during communication; target pins belonging to working pins in the pin connection lines are divided into a first group of data lines and a second group of data lines, so that a part of the pins belonging to working pins in the pin connection lines are grouped as target pins, so that only one group of data lines can be used in each communication, and the other group of data lines is reserved for backup; before the transmission of key signals, the connection status of the first group of data lines and the connection status of the second group of data lines are first detected to detect the connection quality of the connected data lines, thereby reducing the situation of virtual connection of wires during key signal transmission, which is beneficial to reducing the risk of data disasters; if there is a problem with one group of data lines, the other group of data lines is used to automatically switch the transmission protocol for key signal transmission between the first module and the second module, thereby reducing the phenomenon of data errors during dual-channel redundant transmission, improving the communication quality of key signals, and being beneficial to the system to ensure that each bit of data is stable during high-speed communication, thereby improving the communication stability of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0085] Figure 1 A schematic diagram of the main flow of a key signal communication method provided for an exemplary embodiment of the present application.
[0086] Figure 2 A main structural block diagram of a key signal communication device provided for yet another exemplary embodiment of the present application. DETAILED DESCRIPTION
[0087] This specific embodiment is merely an explanation of the present application and is not a limitation of the present application. After reading this specification, those skilled in the art may make modifications to the present embodiment without any creative contribution as needed, but such modifications are protected by the patent law as long as they are within the scope of the claims of the present application.
[0088] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0089] In addition, the term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article, unless otherwise specified, generally means that the associated objects before and after are in an "or" relationship.
[0090] The embodiments of the present application are further described in detail below in conjunction with the drawings in the specification.
[0091] Reference Figure 1 , an embodiment of the present application provides a communication method for key signals, and the main steps of the method are described as follows.
[0092] S1: Divide the target pins belonging to the working pins in the pin connection lines into a first group of data lines and a second group of data lines, wherein the number of the target pins is less than the total number of the working pins and is an even number;
[0093] S2: Before the key signal is transmitted, detecting the connection status of the first group of data lines and the connection status of the second group of data lines;
[0094] S31: If there is a problem with one of the data lines, use another set of data lines to automatically switch the transmission protocol to transmit key signals between the first module and the second module.
[0095] In one embodiment, after the step of detecting the connection status of the first group of data lines and the connection status of the second group of data lines, the method further includes:
[0096] S321: If there are problems with both groups of data lines, calculate the total number of normal pins;
[0097] S322: Determine whether the total number of normal pins meets a preset maximum threshold;
[0098] S323: When the total number of normal pins meets the maximum threshold, the normal pins are used in combination with the line numbers corresponding to the normal pins, and parallel communication is used to transmit key signals.
[0099] In one embodiment, after the step of determining whether the total number of normal pins meets a preset maximum threshold, the method further includes:
[0100] S324: When the total number of normal pins does not meet the maximum threshold, determine whether the total number of normal pins meets a preset minimum threshold;
[0101] S325: When the total number of normal pins meets the minimum threshold, the normal pins are used to transmit key signals using serial communication.
[0102] The dual-channel redundancy mode provides two independent communication or processing channels to ensure that when one of the channels fails, it passively switches to another channel for communication, so that the system can continue to operate normally, but there is a risk of data disaster. Therefore, this application has made a more perfect design based on dual-channel redundancy when transmitting key signals. During transmission, the second module is the main one and the first module is the auxiliary one. Specifically,
[0103] A pin connection line is set between the first module and the second module for communication, and the total number of pins of the pin connection line is greater than or equal to 20. For example, the first module and the second module are connected by a 20P connection line; or, the first module and the second module are connected by a connection line greater than 20P, but the system only uses the first 20P as working pins when working.
[0104] Next, data lines are grouped, and target pins belonging to working pins in the pin connection lines are divided into a first group of data lines and a second group of data lines, wherein the number of target pins is less than the total number of working pins and is an even number.
[0105] For example, a 20P connection line is set between the first module and the second module for communication, the total number of working pins is 20, and the first 16 pins are used as target pins, and the target pins are divided, and 16P is used as two groups of 8-bit data lines to obtain the first group of data lines (data line group A) and the second group of data lines (data line group B). Among them, the odd numbers are group A, and the even numbers are group B. The working data line group is set by the USE_A1 / 2 line. In this embodiment, when USE_A1 is low, the data line group A is used, and when USE_A1 is high, the data line group B is used.
[0106] In this embodiment, the 20P cable refers to a cable or connector with 20 pins, each of which can transmit a signal, and the pin connector serves as a hardware interface for connecting two modules. The 20P cable is usually composed of a wire, a cable sheath, and 20 metal pins. The pin arrangement can be single-row, double-row, or even multi-row, and the specific setting depends on the actual application requirements.
[0107] Then, before the key signal is transmitted, the connection state of the first group of data lines and the connection state of the second group of data lines are detected.
[0108] In one embodiment, the step of detecting the connection status of the first group of data lines includes:
[0109] The microcontroller unit of the first module triggers connection status detection of the first data line of the first group of data lines according to the communication protocol;
[0110] When the first module receives data, a preset resistance detection circuit is used to detect the output resistance of the first data line;
[0111] Determine the difference between the output resistance of the first data line and a preset first resistance threshold;
[0112] If the output resistance of the first data line exceeds the first resistance threshold, setting the pin of the first data line to a high level, and determining that there is a problem with the first data line;
[0113] When there is a problem with any of the data lines, it is determined that there is a problem with the first group of data lines.
[0114] By detecting the connection status of the first data line of the first group of data lines: the microcontroller unit MCU1 of the first module periodically performs connection status detection according to the IIC communication protocol, triggers the connection status detection of the first data line of the first group of data lines, so as to inform the system to start up and detect the connection status of the first data line of the first group of data lines. In this embodiment, the chip U10 is set so that the output pin D of the chip U10 is connected to the first data line S1 of the first group of data lines, that is, the output pin D of the chip U10 is connected to pin 1 of the 20P connecting line, and the first resistance threshold is collected; when the first module receives data, the chip U9 is set, and the output pin D of the chip U9 is connected to the first data line S1 of the first group of data lines, that is, the output pin D of the chip U9 is connected to pin 1 of the 20P connecting line, and then the resistance detection is performed with the help of the resistance detection circuit. When it is found that the output resistance of the first data line exceeds the first resistance threshold, the TR_RESULT line is set to a high level, that is, the pin of the first data line is set to a high level. At this time, it is determined that there is a problem with the first data line. If the output resistance of the first data line is less than or equal to the first resistance threshold, the first data line is normal and the TR_RESULT line is set to a low level.
[0115] Among them, the IIC protocol (Inter-Integrated Circuit, analog serial communication protocol) only uses two lines, SDA serial data line and SCL serial clock line, to transmit data and clock signals. USE_A1 / 2 is SCLK, USEB1 / 2 is data, and each slave device on the IIC bus has a unique address. The master device selects the target communication device by sending the slave device address. The master device controls the clock signal and initiates communication. The slave device responds to the master device's request.
[0116] Next, the microcontroller unit of the first module triggers connection status detection of the second data line of the first group of data lines according to the communication protocol;
[0117] When the second module receives data, a preset resistance detection circuit is used to detect the output resistance of the second data line;
[0118] Determine the difference between the output resistance of the second data line and a preset second resistance threshold;
[0119] If the output resistance of the second data line exceeds the second resistance threshold, the pin of the second data line is set to a high level, and it is determined that there is a problem with the second data line.
[0120] Specifically, the connection state of the second data line of the first group of data lines is detected: the microcontroller unit MCU1 of the first module periodically performs connection state detection according to the IIC communication protocol, triggers the connection state detection of the second data line of the first group of data lines, so as to inform the system to detect the connection state of the second data line of the first group of data lines when it is turned on, and the chip U10 is set so that the output pin D of the chip U10 is connected to the second data line S2 of the first group of data lines, that is, the output pin D of the chip U10 is connected to the 2nd pin of the 20P connection line, so as to collect and obtain the second resistance threshold; when the microcontroller unit MCU2 of the second module detects that the USE_B1 pin When there are 2 square waves, that is, the second module receives data, and the chip U9 is set at this time, and the output pin D of the chip U9 is connected to the second data line S2 of the first group of data lines, that is, the output pin D of the chip U9 is connected to the 2nd pin of the 20P connecting line; at this time, with the help of the resistance detection circuit, when it is found that the output resistance of the second data line exceeds the second resistance threshold, by setting the TR_RESULT line to a high level, that is, the pin of the second data line is set to a high level, it is determined that there is a problem with the second data line; if the output resistance of the second data line is less than or equal to the second resistance threshold, the second data line is normal, and the TR_RESULT line is set to a low level.
[0121] The same process is repeated in this way until the connection status of the eight connection lines of the first group of data lines is detected.
[0122] After the connection status of all the data lines of the first group of data lines is detected, the connection status of all the data lines of the second group of data lines is detected in sequence one by one.
[0123] If both groups of data cables are OK, set the communication data cables to group A. You can also set group B to be used first.
[0124] If there is a problem with one of the data lines, the other data line is used to automatically switch the transmission protocol to transmit key signals between the first module and the second module, ensuring the normal operation of the system communication and issuing an alarm to detect the problem in time.
[0125] In one embodiment, when automatically switching the transmission protocol to transmit the key signal between the first module and the second module, the following steps are included:
[0126] The analog switch is used to connect the data line of the first module and the data line of the second module to the
[0127] The first set of data lines;
[0128] Alternatively, an analog switching switch is used to connect the data line of the first module and the data line of the second module to the second group of data lines.
[0129] MCU1 and MCU2 connect the corresponding 8-bit data lines data[0.. .7] to data line group A or data line group B through analog switching switches.
[0130] If there are problems with both sets of data lines, an alarm is issued and the total number of normal pins is calculated;
[0131] Determine whether the total number of normal pins meets a preset maximum threshold, where the maximum threshold may be 8;
[0132] When the total number of normal pins meets the maximum threshold, the normal pins are used in combination with the line numbers corresponding to the normal pins, and parallel communication is used to transmit key signals.
[0133] When the total number of normal pins reaches 8, that is, the number of wires with good contact is 8, the wire number to be used is notified according to the IIC communication protocol to continue to use the 8 normal pins for parallel communication to ensure the normal operation of the system communication.
[0134] In one embodiment, the step of calculating the total number of normal pins includes:
[0135] Obtaining the total number of working pins;
[0136] Counting the number of problematic data lines in the first group of data lines and the second group of data lines to obtain a total number of problematic pins;
[0137] A subtraction operation is performed based on the total number of working pins and the total number of problem pins to obtain the total number of normal pins.
[0138] In one embodiment, after the step of determining whether the total number of normal pins meets a preset maximum threshold, the method further includes:
[0139] When the total number of normal pins does not meet the maximum threshold, it is determined whether the total number of normal pins meets a preset minimum threshold, and the minimum threshold may be 4;
[0140] When the total number of normal pins meets the minimum threshold, that is, the number of remaining wires with good contact is equal to 4, the normal pins are used in combination with the wire switching device to use serial communication to transmit key signals, and these 4 wires are switched to serial communication to expand the dual-channel redundancy according to the line number, such as the smallest line number is SCLK, the larger line number is MOSI, the next one is MISO, etc., to ensure the normal operation of the system communication.
[0141] In one embodiment, when transmitting the key signal, the following steps are also included:
[0142] The first module or the second module carries a packet header each time a key signal is transmitted, and sets the level of the corresponding encryption cable to a high level;
[0143] The second module detects the level of the second encrypted cable, or the first module detects the level of the first encrypted cable;
[0144] When the second module detects that the second encryption cable is at a high level, or when the first module detects that the first encryption cable is at a high level, reading the sent data and determining whether it is a packet header;
[0145] If it is detected as a packet header, the second module is controlled to receive the key signal, or the first module is controlled to receive the key signal.
[0146] Specifically, JM_A1 / 2 is an encryption line (encryption factor). For example, the second module carries a packet header each time it sends data, and sets the JM_A1 line to a high level. After sending the packet header, the JM_A1 line is set to a low level.
[0147] When the first module detects that JA_A1 is at a high level, it reads the data sent by the second module to determine whether it carries a packet header.
[0148] If the packet header is carried, the data sent by the second module is received, and the first module is controlled to receive the key signal.
[0149] If the packet header is not carried, the first module will not work.
[0150] JM_A1 / 2 is an encryption line used to protect the confidentiality and integrity of the transmitted data and prevent the data from being intercepted or tampered with during the transmission process. The packet header can help detect errors in the data transmission process and request data retransmission when necessary. By synchronizing the packet header, the order of transmitted data can be guaranteed, which is conducive to enhancing the stability and reliability of data transmission; at the same time, the encryption factor is set to enhance the security of data transmission.
[0151] In summary, a communication method for key signals communicates by setting pin connection lines, and the total number of pins of the pin connection lines is greater than or equal to 20, so as to ensure as much as possible that there are a sufficient number of connection lines for redundant use during communication; the target pins belonging to the working pins in the pin connection lines are divided into a first group of data lines and a second group of data lines, so that a part of the pins belonging to the working pins in the pin connection lines are grouped as target pins, so that only one group of data lines can be used in each communication, and the other group of data lines is reserved for backup; before the key signal is transmitted, the connection status of the first group of data lines and the connection status of the second group of data lines are first detected to detect the connection quality of the connected data lines, thereby reducing the key signal transmission time. When key signals are transmitted, there is a situation where the wires are loosely connected, which is helpful to reduce the risk of data disasters; if there is a problem with one set of data lines, the other set of data lines is used, and the transmission protocol is automatically switched to transmit key signals between the first module and the second module; if there are problems with both sets of data lines, an alarm is issued, and the total number of normal pins is calculated and compared with the preset conditions, and parallel communication or serial communication is used when the corresponding conditions are met; the automatic conversion of protocol communication inside the device is realized, which reduces the phenomenon of data errors during dual-channel redundant transmission, improves the communication quality of key signals, and is beneficial for the system to ensure that each bit of data is stable during high-speed communication, thereby improving the communication stability of the system.
[0152] A communication method for key signals can more reliably ensure the communication quality of key signals by designing multiple redundant communication methods, and in the case where it is impossible to shut down for maintenance, it can extend the operating time of the equipment and leave enough time for equipment maintenance.
[0153] A critical signal communication method utilizes the device to automatically perform periodic wire connection status quality checks to avoid transmission errors and data disasters, fully ensuring the communication stability and accuracy of the system.
[0154] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0155] Reference Figure 2The embodiment of the present application also provides a communication device for a key signal, and the communication device for a key signal corresponds one-to-one with a communication method for a key signal in the above embodiment. The communication device for a key signal includes:
[0156] A grouping module, used for dividing the target pins belonging to the working pins in the pin connection lines into a first group of data lines and a second group of data lines, wherein the number of the target pins is less than the total number of the working pins and is an even number;
[0157] A state detection module, used for detecting the connection state of the first group of data lines and the connection state of the second group of data lines before the key signal is transmitted;
[0158] The switching module is used to use another group of data lines to automatically switch the transmission protocol to transmit key signals between the first module and the second module when there is a problem with one group of data lines.
[0159] A communication device for a key signal also includes a pin connection line for communication between a first module and a second module, wherein the total number of pins of the pin connection line is greater than or equal to 20.
[0160] A critical signal communication device also includes,
[0161] A normal pin calculation module is used to calculate the total number of normal pins when there are problems with both sets of data lines;
[0162] A first judging module, used to judge whether the total number of normal pins meets a preset maximum threshold;
[0163] The parallel communication module is used to transmit key signals using parallel communication by utilizing normal pins in combination with line numbers corresponding to the normal pins when the total number of normal pins meets the maximum threshold.
[0164] A critical signal communication device also includes,
[0165] A second judgment module is used to judge whether the total number of normal pins meets a preset minimum threshold when the total number of normal pins does not meet the maximum threshold;
[0166] The serial communication module is used to transmit key signals using serial communication by utilizing normal pins when the total number of normal pins meets the minimum threshold.
[0167] A critical signal communication device also includes,
[0168] A packet header sending module, used for the first module or the second module to carry the packet header each time a key signal is transmitted, and to set the level of the corresponding encrypted cable to a high level;
[0169] An encryption detection module, used for the second module to detect the level of the second encryption cable, or the first module to detect the level of the first encryption cable;
[0170] A packet header detection module, used for reading the transmitted data and determining whether it is a packet header when the second module detects that the second encrypted cable is at a high level, or when the first module detects that the first encrypted cable is at a high level;
[0171] The communication module is used to control the second module to receive the key signal, or control the first module to receive the key signal when detecting that it is a packet header.
[0172] The specific definition of a communication device for a key signal can be found in the above definition of a communication method for a key signal, which will not be repeated here.
[0173] Each module in the above-mentioned key signal communication device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0174] In one embodiment, a computer device is provided, which may be a server. The computer device includes a processor, a memory, a network interface, and a database connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, the communication method of any one of the above-mentioned key signals is implemented.
[0175] In one embodiment, a computer-readable storage medium is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, any one of the above-mentioned key signal communication methods is implemented.
[0176] In one embodiment, a computer program product is provided. The computer program product includes a computer program. When the computer program is executed by a processor, the computer program implements any one of the above-mentioned key signal communication methods.
[0177] In one embodiment, a critical signal communication system is provided, including a first module and a second module based on dual-channel redundant communication, wherein the first module and the second module are connected by pin connection lines.
[0178] A communication system for key signals also includes a resistance detection circuit for detecting the pin connection line before the key signal is transmitted, wherein the target pins belonging to the working pins in the pin connection line are divided into a first group of data lines and a second group of data lines, the number of the target pins is less than the total number of working pins and is an even number, and the resistance detection circuit detects the connection status of the first group of data lines and the connection status of the second group of data lines.
[0179] The resistance detection circuit can use a known current source to measure the voltage across any data line of the first group of data lines or any data line of the second group of data lines by passing a known current through the data line, and use Ohm's law to indirectly measure the output resistance value for fault diagnosis.
[0180] The resistance detection circuit can also use a known voltage source to apply voltage through any data line of the first group of data lines or any data line of the second group of data lines, measure the current flowing through, and use Ohm's law to indirectly measure the output resistance value for fault diagnosis.
[0181] Of course, for scenarios requiring high precision, the resistance can be measured using a bridge circuit method or a four-wire measurement method, which will not be discussed here.
[0182] The first module and the second module both include a microcontroller unit MCU for controlling the resistance detection circuit. The microcontroller unit includes MCU1 located in the first module and MCU2 located in the second module.
[0183] The microcontroller unit is used to use another group of data lines to automatically switch the transmission protocol to transmit key signals between the first module and the second module when there is a problem with one group of data lines.
[0184] When the transmission protocol is automatically switched, the analog switch is controlled by the microcontroller unit to switch between different analog signal paths. Among them, the analog switch can use ADG788BCPZ-REEL7, which has the advantages of low voltage, low on-resistance and low power consumption.
[0185] In one embodiment, the microcontroller unit is also used to calculate the total number of normal pins when problems exist in both groups of data lines; determine whether the total number of normal pins meets a preset maximum threshold; when the total number of normal pins meets the maximum threshold, use normal pins, combined with the line numbers corresponding to the normal pins, and use parallel communication to transmit key signals.
[0186] In one embodiment, the microcontroller unit is also used to determine whether the total number of normal pins meets a preset minimum threshold when the total number of normal pins does not meet the maximum threshold; when the total number of normal pins meets the minimum threshold, normal pins are used in combination with a wire switching device to use serial communication to transmit key signals.
[0187] The wire switching device can be a relay or a transistor, etc. The wire switching device is controlled by a microcontroller unit to achieve the purpose of switching between different wires and guiding the signal to a designated line. It is easy to use and highly flexible.
[0188] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. When the computer program is executed, it may include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in the present application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0189] Those skilled in the art will clearly understand that for the sake of convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the system can be divided into different functional units or modules to complete all or part of the functions described above.
Claims
1. A method of communicating key signals, It is characterized in that The following steps are involved: Divide the target pins belonging to the working pins in the pin connection lines into a first group of data lines and a second group of data lines, wherein the number of the target pins is less than the total number of the working pins and is an even number; Before the key signal is transmitted, detecting the connection status of the first group of data lines and the connection status of the second group of data lines; If there is a problem with one of the data lines, another set of data lines is used to automatically switch the transmission protocol to transmit key signals between the first module and the second module; The step of detecting the connection status of the first group of data lines comprises: The microcontroller unit of the first module triggers connection status detection of the first data line of the first group of data lines according to the communication protocol; When the first module receives data, a preset resistance detection circuit is used to detect the output resistance of the first data line; Determine the difference between the output resistance of the first data line and a preset first resistance threshold; If the output resistance of the first data line exceeds the first resistance threshold, setting the pin of the first data line to a high level, and determining that there is a problem with the first data line; When any data line has a problem, it is determined that the first group of data lines has a problem; When the automatic switching transmission protocol is used to transmit key signals between the first module and the second module, the following steps are included: Using an analog switch, connecting the data line of the first module and the data line of the second module to the first group of data lines; Alternatively, an analog switching switch is used to connect the data line of the first module and the data line of the second module to the second group of data lines.
2. The key signal communication method according to claim 1, It is characterized in that After the step of detecting the connection status of the first group of data lines and the connection status of the second group of data lines, the method further includes: If both sets of data lines have problems, calculate the total number of normal pins; Determine whether the total number of normal pins meets a preset maximum threshold; When the total number of normal pins meets the maximum threshold, the normal pins are used in combination with the line numbers corresponding to the normal pins, and parallel communication is used to transmit key signals.
3. The key signal communication method according to claim 2, It is characterized in that After the step of determining whether the total number of normal pins meets the preset maximum threshold, the method further includes: When the total number of normal pins does not meet the maximum threshold, determining whether the total number of normal pins meets a preset minimum threshold; When the total number of normal pins meets the minimum threshold, the normal pins are used to transmit key signals using serial communication.
4. The key signal communication method according to claim 1, It is characterized in that The step of detecting the connection status of the first group of data lines also includes: The microcontroller unit of the first module triggers connection status detection of the second data line of the first group of data lines according to the communication protocol; When the second module receives data, a preset resistance detection circuit is used to detect the output resistance of the second data line; Determine the difference between the output resistance of the second data line and a preset second resistance threshold; If the output resistance of the second data line exceeds the second resistance threshold, the pin of the second data line is set to a high level, and it is determined that there is a problem with the second data line.
5. The key signal communication method according to claim 4, It is characterized in that The following steps are also included: After the connection status of all the data lines of the first group of data lines is detected, the connection status of all the data lines of the second group of data lines is detected in sequence.
6. The key signal communication method according to claim 1, It is characterized in that The following steps are also included: A pin connection line is provided between the first module and the second module for communication, wherein the number of pins of the pin connection line is 20; The first 16 pins in the pin connection line are taken as target pins, and the target pins are divided to obtain a first group of data lines and a second group of data lines.
7. The key signal communication method according to claim 2, It is characterized in that The step of calculating the total number of normal pins includes: Obtaining the total number of working pins; Counting the number of problematic data lines in the first group of data lines and the second group of data lines to obtain a total number of problematic pins; A subtraction operation is performed based on the total number of working pins and the total number of problem pins to obtain the total number of normal pins.
8. The key signal communication method according to any one of claims 1 to 7, It is characterized in that When transmitting key signals, the following steps are also included: The first module or the second module carries a packet header each time a key signal is transmitted, and sets the level of the corresponding encryption cable to a high level; The second module detects the level of the second encrypted cable, or the first module detects the level of the first encrypted cable; When the second module detects that the second encryption cable is at a high level, or when the first module detects that the first encryption cable is at a high level, reading the transmitted data and determining whether it is a packet header; If it is detected as a packet header, the second module is controlled to receive the key signal, or the first module is controlled to receive the key signal.
9. A communication device for key signals, It is characterized in that A communication method for a key signal as claimed in any one of claims 1 to 8, comprising: A grouping module, used for dividing the target pins belonging to the working pins in the pin connection lines into a first group of data lines and a second group of data lines, wherein the number of the target pins is less than the total number of the working pins and is an even number; A state detection module, used for detecting the connection state of the first group of data lines and the connection state of the second group of data lines before the key signal is transmitted; The switching module is used to use another group of data lines to automatically switch the transmission protocol to transmit key signals between the first module and the second module when there is a problem with one group of data lines.
10. The critical signal communication device according to claim 9, It is characterized in that It also includes a pin connection line for communication between the first module and the second module, and the total number of pins of the pin connection line is greater than or equal to 20.
11. The critical signal communication device according to claim 9, It is characterized in that Also includes, A normal pin calculation module is used to calculate the total number of normal pins when there are problems with both sets of data lines; A first judging module, used to judge whether the total number of normal pins meets a preset maximum threshold; The parallel communication module is used to transmit key signals using parallel communication by utilizing normal pins in combination with line numbers corresponding to the normal pins when the total number of normal pins meets the maximum threshold.
12. The critical signal communication device according to claim 11, It is characterized in that Also includes, A second judgment module is used to judge whether the total number of normal pins meets a preset minimum threshold when the total number of normal pins does not meet the maximum threshold; The serial communication module is used to utilize the normal pins to transmit key signals using serial communication when the total number of the normal pins meets the minimum threshold.
13. The critical signal communication device according to any one of claims 9 to 12, It is characterized in that Also includes, A packet header sending module, used for the first module or the second module to carry the packet header each time a key signal is transmitted, and to set the level of the corresponding encrypted cable to a high level; An encryption detection module, used for the second module to detect the level of the second encryption cable, or the first module to detect the level of the first encryption cable; A packet header detection module, used for reading the transmitted data and determining whether it is a packet header when the second module detects that the second encrypted cable is at a high level, or when the first module detects that the first encrypted cable is at a high level; The communication module is used to control the second module to receive the key signal, or control the first module to receive the key signal when detecting that it is a packet header.
14. A computer device, It is characterized in that The method comprises a memory, a processor and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the method according to any one of claims 1 to 8.
15. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.
16. A computer program product, It is characterized in that The invention comprises a computer program, which implements the steps of the method according to any one of claims 1 to 8 when being executed by a processor.
17. A communication system for critical signals, It is characterized in that A communication method for a critical signal as claimed in any one of claims 1 to 8, comprising a first module and a second module based on dual-channel redundant communication, wherein the first module and the second module are connected by a pin connection line communication; It also includes a resistance detection circuit for detecting the pin connection line before the key signal is transmitted, wherein the target pins belonging to the working pins in the pin connection line are divided into a first group of data lines and a second group of data lines, the number of the target pins is less than the total number of the working pins and is an even number, and the resistance detection circuit detects the connection state of the first group of data lines and the connection state of the second group of data lines; The first module and the second module each include a microcontroller unit for controlling the resistance detection circuit, and The microcontroller unit is used to use another group of data lines to automatically switch the transmission protocol to transmit key signals between the first module and the second module when there is a problem with one group of data lines.
18. The critical signal communication system according to claim 17, It is characterized in that The microcontroller unit is also used to calculate the total number of normal pins when problems exist in both groups of data lines; determine whether the total number of normal pins meets a preset maximum threshold; when the total number of normal pins meets the maximum threshold, use normal pins, combined with the line numbers corresponding to the normal pins, and use parallel communication to transmit key signals.
19. The critical signal communication system according to claim 18, It is characterized in that The microcontroller unit is also used to determine whether the total number of normal pins meets a preset minimum threshold when the total number of normal pins does not meet the maximum threshold; when the total number of normal pins meets the minimum threshold, normal pins are used in combination with a wire switching device to use serial communication to transmit key signals.
