A network switching chip indicator light control method and system based on pulse technology
By setting pulse frequency and indication rules in the network switching chip, the indicator light of the network switching chip is controlled, and the problem of incompatibility with the network card chip is solved, and compatibility with the network port socket indicator light of the network card chip is achieved, which improves user experience and improves control accuracy.
Patent Information
- Application Number
- CN202510187305.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-20
- Publication Date
- 2025-04-22
- Estimated Expiration
- 2045-02-20
AI Technical Summary
When the network switching chip controls the indicator light, it is not compatible with the network port socket indicator light used by the network card chip, which affects the user experience.
By setting the pulse frequency F and the indication rules for the matrix light group in the network switching chip, low-level pulses are sent to the negative pins of each port of the matrix light group in turn, and the positive pin is controlled to light or flash the indicator light according to the network rate and indication rules.
It realizes compatibility with network card chip network socket indicators, improves user experience, and improves the accuracy of dual-color indicator control through 2x sampling rate redundancy verification.
Smart Images

Figure CN119653535B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of indicator light pulse signal decoding, and in particular to a network switching chip indicator light control method and system based on pulse technology. Background Art
[0002] Currently in the field of network security, switches are increasingly using network switching chips to replace network card chips to realize the functions of network ports; each service port of the switch has two indicator lights, one indicator light is called the network activity (Active) indicator light, when the network activity indicator light is green, it means the line is activated; the other indicator light is called the network speed (Speed) indicator light, the network speed indicator light is yellow to indicate the speed is 1000M, green to indicate the speed is 100M, and no light to indicate the speed is 10M (the network activity indicator light is on at this time).
[0003] The network card chip can easily indicate network activity and network speed through indicator lights. However, since the network switching chip has more network ports and needs to output more network port indicator lights, the network switching chip does not directly output the driving indicator lights through GPIO when designing the pins. Instead, it uses pulse signals to drive the matrix light group. As a result, the scene displayed by the indicator light is inconsistent with the network card chip, and is not compatible with the dual-color indicator light display function of the existing network card chip.
[0004] The circuit of the network card chip controlling the indicator light is as follows Figure 4 As shown, P14 is connected to the positive pole of the power supply through the current limiting resistor R1, and the network card chip is connected to P13 through the LED2 pin. When the LED2 pin is at a low level, D11 is on, and when the LED2 pin is at a high level, D11 is off. When there is network activity, the network card chip pulls the LED2 pin down or up according to a specific frequency, which can be manifested as D11 flashing. P12 connects the D12 input end and the D13 output end, and P11 connects the D13 input end and the D12 output end, that is, D12 and D13 are interconnected in both directions. The network card chip is connected to P12 through the LED1 pin and to P11 through the LED0 pin; when the rate is 1000M, the LED1 pin is at a low level, the LED0 pin is at a high level, and D13 is on; when the rate is 100M, the LED1 pin is at a high level, the LED0 pin is at a low level, and D12 is on; when the rate is 10M, the LED1 pin is at a high level, the LED0 pin is at a low level, and D12 is on; when the rate is 10M, the LED1 pin is at a high level, the LED0 pin is at a high level, and D12 and D13 are not on.
[0005] The circuit of the network switching chip controlling the indicator light is as follows Figure 5As shown, the network switching chip controls the network activity indicator light and the network rate indicator light through pulse signals (rows R0 / R1 / R2 / R3 / R4, columns C0 / C1 / C2 / C3), and uses 9 signal lines to realize the display of 10 ports (2 indicator lights for each port); C0 / C1 / C2 / C3 are connected to the positive pole of the indicator light, and R0 / R1 / R2 / R3 / R4 are connected to the negative pole of the indicator light; when the R row signal is low and the C row signal is high, the indicator light is on. For example, the Chinese invention patent with application number CN201180029017.4 and classification number H03K discloses a direction indicator light control device, a direction indicating device, and a control method for a direction indicating device. This patent controls the indicator light group through pulse signals.
[0006] In the matrix light group controlled by the network switching chip, the negative pole of the indicator light of each port is connected together, and the positive pole is connected to different pins respectively. This is different from the wiring of the two indicator lights in the network card chip scenario where the two indicator lights are interconnected in both directions. In addition, each port has only two indicator lights, while there are three indicator lights (D11, D12, and D13) in the network card chip scenario. As a result, the pulse signal used to control the matrix light group cannot adapt to the network port socket indicator light used by the network card chip. Users need to adapt to the new indication method, affecting the user experience.
[0007] Therefore, how to provide a network switching chip indicator light control method and system based on pulse technology to achieve a network port socket indicator light used by a compatible network card chip to improve user experience has become a technical problem that needs to be solved urgently. Summary of the invention
[0008] The technical problem to be solved by the present invention is to provide a method and system for controlling indicator lights of a network switching chip based on pulse technology, so as to achieve a network port socket indicator light used by a compatible network card chip, so as to improve the user experience.
[0009] In a first aspect, the present invention provides a method for controlling an indicator light of a network switching chip based on a pulse technology, comprising the following steps:
[0010] Step S1, the network switching chip sets a pulse frequency F and an indication rule of a matrix light group. When the network is connected and there is no network activity, within the period of the pulse frequency F, a low-level pulse is sent to the negative pin of each port of the matrix light group in turn, and based on the current network rate and the indication rule, within the period when each port receives the low-level pulse, a high-level pulse is sent to the first positive pin or the second positive pin of the corresponding port to light up the indicator light of the corresponding port; when the network is connected and there is network activity, the number of the low-level pulses sent to the negative pin of the corresponding port is reduced to make the indicator light of the corresponding port flash;
[0011] Step S2, the MCU sets a collection period T and a duration threshold Δt, sets a counter for each port of the matrix light group, collects pulse level values from each first positive pin, second positive pin and negative pin of the matrix light group based on the collection period T, and collects the high level duration of each negative pin based on the counter;
[0012] Step S3, the MCU decodes each pulse level value and high level duration based on the indication rule to obtain a pulse signal decoding result;
[0013] Step S4: The MCU outputs a control signal to the network port socket indicator light of the network card chip based on the pulse signal decoding result.
[0014] Furthermore, in step S1, the indication rule is specifically:
[0015] When the network is disconnected, a high level is output to the negative pin of the corresponding port, and a low level is output to the first positive pin and the second positive pin of the corresponding port;
[0016] When the network is connected and there is no network activity, a low-level pulse is output to the negative pin of the corresponding port, and when the network rate is 1000M, a high-level pulse is output to the first positive pin and the second positive pin of the corresponding port; when the network rate is 100M, a low-level pulse is output to the first positive pin of the corresponding port, and a high-level pulse is output to the second positive pin; when the network rate is 10M, a high-level pulse is output to the first positive pin of the corresponding port, and a low-level pulse is output to the second positive pin;
[0017] When the network is connected and there is network activity, reduce the number of low-level pulses sent to the negative pin of the corresponding port to make the indicator light of the corresponding port flash;
[0018] The first positive pin is connected to the input end of the yellow indicator light of the port; the second positive pin is connected to the input end of the green indicator light of the port.
[0019] Furthermore, in step S2, the value of the acquisition period T is: T<1 / (10*F);
[0020] The value of the duration threshold Δt is 18 milliseconds;
[0021] When the negative electrode pin is at a high level, the counter counts with a gradient of 200 microseconds, thereby collecting the high level duration of each negative electrode pin.
[0022] Furthermore, the step S3 is specifically as follows:
[0023] Based on the indication rule, the MCU first analyzes the pulse level value within the 100 millisecond time slice to determine the network connection. If there is a network connection, the network activity is determined, specifically:
[0024] Determine whether the high level duration is greater than the duration threshold Δt. If so, it means that there is no network activity. If not, analyze the pulse level value of each pin. When the negative pin is collected as low level within two consecutive collection cycles T:
[0025] When the pulse level values of the first positive pin and the second positive pin are both high within a time slice of 100 milliseconds, it indicates that there is network activity and the network rate is 1000M; when the pulse level value of the first positive pin is low and the pulse level value of the second positive pin is high, it indicates that there is network activity and the network rate is 100M; when the pulse level value of the first positive pin is high and the pulse level value of the second positive pin is low, it indicates that there is network activity and the network rate is 10M;
[0026] Then, it is obtained whether there is a network connection, and the pulse signal decoding results of the network rate being 1000M, the network rate being 100M, or the network rate being 10M.
[0027] Furthermore, the step S4 is specifically as follows:
[0028] The MCU analyzes the decoding result of the pulse signal, and when there is network activity, a high level and a low level are alternately output through the LED2 pin; when the network is connected but there is no network activity, a low level is output through the LED2 pin; when the network is disconnected, a high level is output through the LED2 pin;
[0029] When the network rate of the pulse signal decoding result is 1000M, a high level is output through the LED0 pin, and a low level is output through the LED1 pin;
[0030] When the network rate of the pulse signal decoding result is 100M, a low level is output through the LED0 pin, and a high level is output through the LED1 pin;
[0031] When the network rate of the pulse signal decoding result is 10M, a high level is output through the LED0 pin, and a high level is output through the LED1 pin;
[0032] The MCU outputs a high-level or low-level control signal to the network port socket indicator light of the network card chip based on the LED0 pin, LED1 pin, and LED2 pin.
[0033] In a second aspect, the present invention provides a network switching chip indicator light control system based on pulse technology, comprising the following modules:
[0034] The matrix light group control module is used for the network switching chip to set a pulse frequency F and an indication rule of the matrix light group. When the network is connected and there is no network activity, a low-level pulse is sent to the negative pin of each port of the matrix light group in turn within the period of the pulse frequency F, and based on the current network rate and the indication rule, a high-level pulse is sent to the first positive pin or the second positive pin of the corresponding port within the period when each port receives the low-level pulse to light up the indicator light of the corresponding port; when the network is connected and there is network activity, the number of the low-level pulses sent to the negative pin of the corresponding port is reduced to make the indicator light of the corresponding port flash;
[0035] The pulse signal acquisition module is used for the MCU to set an acquisition cycle T and a duration threshold Δt, and to set a counter for each port of the matrix light group. Based on the acquisition cycle T, the pulse level value is collected from each first positive pin, second positive pin and negative pin of the matrix light group, and the high level duration of each negative pin is collected based on the counter.
[0036] A pulse signal decoding module is used for the MCU to decode each pulse level value and high level duration based on the indication rule to obtain a pulse signal decoding result;
[0037] The control signal output module is used for the MCU to output a control signal to the network port socket indicator light of the network card chip based on the pulse signal decoding result.
[0038] Furthermore, in the matrix light group control module, the indication rule is specifically:
[0039] When the network is disconnected, a high level is output to the negative pin of the corresponding port, and a low level is output to the first positive pin and the second positive pin of the corresponding port;
[0040] When the network is connected and there is no network activity, a low-level pulse is output to the negative pin of the corresponding port, and when the network rate is 1000M, a high-level pulse is output to the first positive pin and the second positive pin of the corresponding port; when the network rate is 100M, a low-level pulse is output to the first positive pin of the corresponding port, and a high-level pulse is output to the second positive pin; when the network rate is 10M, a high-level pulse is output to the first positive pin of the corresponding port, and a low-level pulse is output to the second positive pin;
[0041] When the network is connected and there is network activity, reduce the number of low-level pulses sent to the negative pin of the corresponding port to make the indicator light of the corresponding port flash;
[0042] The first positive pin is connected to the input end of the yellow indicator light of the port; the second positive pin is connected to the input end of the green indicator light of the port.
[0043] Further, in the pulse signal acquisition module, the value of the acquisition period T is: T<1 / (10*F);
[0044] The value of the duration threshold Δt is 18 milliseconds;
[0045] When the negative electrode pin is at a high level, the counter counts with a gradient of 200 microseconds, thereby collecting the high level duration of each negative electrode pin.
[0046] Furthermore, the pulse signal decoding module is specifically used for:
[0047] Based on the indication rule, the MCU first analyzes the pulse level value within the 100 millisecond time slice to determine the network connection. If there is a network connection, the network activity is determined, specifically:
[0048] Determine whether the high level duration is greater than the duration threshold Δt. If so, it means that there is no network activity. If not, analyze the pulse level value of each pin. When the negative pin is collected as low level within two consecutive collection cycles T:
[0049] When the pulse level values of the first positive pin and the second positive pin are both high within a time slice of 100 milliseconds, it indicates that there is network activity and the network rate is 1000M; when the pulse level value of the first positive pin is low and the pulse level value of the second positive pin is high, it indicates that there is network activity and the network rate is 100M; when the pulse level value of the first positive pin is high and the pulse level value of the second positive pin is low, it indicates that there is network activity and the network rate is 10M;
[0050] Then, it is obtained whether there is a network connection, and the pulse signal decoding results of the network rate being 1000M, the network rate being 100M, or the network rate being 10M.
[0051] Furthermore, the control signal output module is specifically used for:
[0052] The MCU analyzes the decoding result of the pulse signal, and when there is network activity, a high level and a low level are alternately output through the LED2 pin; when the network is connected but there is no network activity, a low level is output through the LED2 pin; when the network is disconnected, a high level is output through the LED2 pin;
[0053] When the network rate of the pulse signal decoding result is 1000M, a high level is output through the LED0 pin, and a low level is output through the LED1 pin;
[0054] When the network rate of the pulse signal decoding result is 100M, a low level is output through the LED0 pin, and a high level is output through the LED1 pin;
[0055] When the network rate of the pulse signal decoding result is 10M, a high level is output through the LED0 pin, and a high level is output through the LED1 pin;
[0056] The MCU outputs a high-level or low-level control signal to the network port socket indicator light of the network card chip based on the LED0 pin, LED1 pin, and LED2 pin.
[0057] The advantages of the present invention are:
[0058] 1. Set the pulse frequency F and indication rules through the network switching chip. When the network is connected and there is no network activity, within the period of the pulse frequency F, send low-level pulses to the negative pins of each port of the matrix light group in turn, and based on the network rate and indication rules, within the period of receiving the low-level pulses at each port, send high-level pulses to the first positive pin or the second positive pin of the corresponding port to light up the indicator light of the corresponding port; when the network is connected and there is network activity, reduce the number of low-level pulses sent to the negative pin of the corresponding port to make the indicator light of the corresponding port flash; then the MCU sends a high-level pulse from the first positive pin, the second positive pin and the negative pin of the matrix light group based on the acquisition period T. The pulse level values of the positive and negative pins are collected, the high level duration of each negative pin is collected, and each pulse level value and high level duration are decoded based on the indication rule to obtain the pulse signal decoding result. Finally, based on the pulse signal decoding result, a control signal is output to the network port socket indicator light of the network card chip; that is, the pulse signal (matrix signal) of the matrix light group controlled by the network switching chip is scanned in rows and columns to obtain the pulse level value and high level duration of each pin of the matrix light group, and then the pulse level value and high level duration are decoded based on the indication rule of the matrix light group, and converted into the control signal of the network port socket indicator light, thereby achieving compatibility with the network port socket indicator light used by the network card chip, which greatly improves the user experience.
[0059] 2. Since the matrix light group has a 5*4 row and column structure, that is, there are 5 rows of negative pins, and within the period of the pulse frequency F, low-level pulses are sent to the negative pins of each port of the matrix light group in turn, that is, the polling period of each negative pin is 1 / (5*F); by setting the acquisition period T<1 / (10*F), that is, within the polling period of the negative pin, it is necessary to collect the negative pin as a low level twice in a row before determining the network rate, ensuring that within the pulse period of each negative pin, at least 2 samples are consistent before determining the network rate, solving the problem of inaccurate sampling caused by the MCU sampling moment being the jump edge, that is, through 2 times sampling rate redundancy check, it is ensured that there will be no capture abnormality when the sampling period is not synchronized, thereby greatly improving the accuracy of the two-color indicator light control.
[0060] 3. When the network rate is 1000M, the first positive pin and the second positive pin are not triggered synchronously, and the fastest flashing frequency of the indicator light is 12Hz≈83.33ms. Therefore, a 100-millisecond time slice is set. Within this time slice, a level state that reflects the network rate must appear. As long as a high level appears within this time slice, it means that there is network activity and the network rate is 1000M, avoiding misjudgment caused by asynchronous triggering of different pins, and further improving the accuracy of dual-color indicator light control. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] The present invention will be further described below in conjunction with embodiments with reference to the accompanying drawings.
[0062] Figure 1 The present invention is a flow chart of a method for controlling an indicator light of a network switching chip based on pulse technology.
[0063] Figure 2 The present invention is a schematic structural diagram of a network switching chip indicator light control system based on pulse technology.
[0064] Figure 3 It is a circuit diagram of the MCU of the present invention.
[0065] Figure 4 This is a circuit diagram of the network card chip controlling the indicator light.
[0066] Figure 5 This is a circuit diagram of the network switching chip controlling the indicator light (matrix light group). DETAILED DESCRIPTION
[0067] The technical solution in the embodiment of the present application has the following overall idea: the pulse signal of the matrix light group controlled by the network switching chip is scanned in rows and columns to obtain the pulse level value and high level duration of each pin of the matrix light group, and then the pulse level value and high level duration are decoded based on the indication rule of the matrix light group, and converted into a control signal of the network port socket indicator light, thereby achieving compatibility with the network port socket indicator light used by the network card chip to enhance the user experience.
[0068] Please refer to Figures 1 to 5 As shown, a preferred embodiment of a method for controlling an indicator light of a network switching chip based on pulse technology of the present invention comprises the following steps:
[0069] Step S1, the network switching chip sets a pulse frequency F and an indication rule of a matrix light group. When the network is connected and there is no network activity, within the period of the pulse frequency F, a low-level pulse is sent to the negative pin of each port of the matrix light group in turn, and based on the current network rate and the indication rule, within the period when each port receives the low-level pulse, a high-level pulse is sent to the first positive pin or the second positive pin of the corresponding port to light up the indicator light of the corresponding port; when the network is connected and there is network activity, the number of the low-level pulses sent to the negative pin of the corresponding port is reduced to make the indicator light of the corresponding port flash;
[0070] In order to ensure that the 20 indicator lights of the matrix light group can be observed by the human eye, it is necessary to use a refresh rate higher than the human eye recognition to scan and light up the indicator lights in turn, so the pulse frequency F is set to 450Hz; since low-level pulses are sent to the negative pins of each port of the matrix light group in turn, the pulse width of the low-level pulse is (1 / 50Hz) / 5≈444 microseconds; within the 444 microsecond time slice, according to the setting of the network switching chip, a high-level pulse is sent to the C0 / C1 / C2 / C3 input to light up the corresponding indicator light;
[0071] Step S2, the MCU sets a collection period T and a duration threshold Δt, sets a counter for each port of the matrix light group, collects pulse level values from each first positive pin, second positive pin and negative pin of the matrix light group based on the collection period T, and collects the high level duration of each negative pin based on the counter; pins 10, 11, 12, 13, 14, 15, 16, 17, 29 of the MCU are respectively connected to the positive pins C0, C1, C2, C3 and the negative pins R0, R1, R2, R3, R4 of the matrix light group; pins 18, 19, 20 of the MCU are connected to one of the network port socket indicator lights, and pins 39, 40, 41 are connected to the other network port socket indicator lights;
[0072] Step S3, the MCU decodes each pulse level value and high level duration based on the indication rule to obtain a pulse signal decoding result;
[0073] Step S4: The MCU outputs a control signal to the network port socket indicator light of the network card chip based on the pulse signal decoding result.
[0074] In step S1, the indication rule is specifically:
[0075] When the network is disconnected, a high level is output to the negative pin of the corresponding port, and a low level is output to the first positive pin and the second positive pin of the corresponding port;
[0076] When the network is connected and there is no network activity, a low-level pulse is output to the negative pin of the corresponding port, and when the network rate is 1000M, a high-level pulse is output to the first positive pin and the second positive pin of the corresponding port; when the network rate is 100M, a low-level pulse is output to the first positive pin of the corresponding port, and a high-level pulse is output to the second positive pin; when the network rate is 10M, a high-level pulse is output to the first positive pin of the corresponding port, and a low-level pulse is output to the second positive pin;
[0077] When the network is connected and there is network activity, reduce the number of low-level pulses sent to the negative pin of the corresponding port to make the indicator light of the corresponding port flash;
[0078] Since the period corresponding to the flashing frequency of the indicator light is 90ms, a time interval of the negative pin is divided into 4 time slices, which control C0, C1, C2, and C3 respectively, and the time slice of c0 / c1 / c2 / c3 is about 450us, that is, a time interval is about 450us*4=1.8ms, 90ms / 1.8ms=50, that is, to make the indicator light of the corresponding port flash, the number of low-level pulses sent to the negative pin of the corresponding port needs to be reduced to 50.
[0079] The first positive pin is connected to the input end of the yellow indicator light of the port; the second positive pin is connected to the input end of the green indicator light of the port.
[0080] The matrix light group has the following 7 states: ① Network 10M connection, no network activity; ② Network 100M connection, no network activity; ③ Network 1000M connection, no network activity; ④ Network 10M connection, network activity; ⑤ Network 100M connection, network activity; ⑥ Network 1000M connection, network activity; ⑦ Network disconnected. When the network is disconnected, the matrix light group goes out; when the network is connected but there is no network activity, the corresponding indicator lights up; when the network is connected and there is network activity, the corresponding indicator flashes.
[0081] The indication rules of the matrix light group and the logic of the network card chip controlling the indicator light are shown in Table 1.
[0082] Table 1: Indicator light control comparison table
[0083]
[0084] In the step S2, the value of the acquisition period T is: T<1 / (10*F);
[0085] The MCU needs to collect matrix signals (row and column pulse signals) in an acquisition period that is less than half of 444 microseconds. For example, T=200 microseconds is set to ensure that there are at least two consistent samples within the acquisition period of R0 / R1 / R2 / R3 / R4, so as to solve the problem of inaccurate sampling caused by the MCU sampling moment being the transition edge. When the MCU collects two consecutive R0 values of 0, the current network rate is determined according to the values of C0 / C1 / C2 / C3.
[0086] The value of the duration threshold Δt is 18 milliseconds;
[0087] When the network switching chip works in 10M / 100M / 1000M mode, if there is no network activity on the port, the indicator light will be always on. At this time, the low pulse intervals of the R0 / R1 / R2 / R3 / R4 signals are very short, ensuring that the human eye cannot see the flicker. The low pulse interval is less than the 60Hz cycle, corresponding to 16.7 milliseconds. If there is network activity on the port, the time when the R0 / R1 / R2 / R3 / R4 signals appear at a high level must be greater than 16.7 milliseconds to allow the human eye to recognize the flicker. The MCU uses this time characteristic to identify the network activity status.
[0088] Take port 1 as an example, to determine the level of R0 (negative pin) when the current port is connected, if R0 is 1, the count will increase by 1 every 200 microseconds, if R0 is 0, the count value will remain at 0. When the count value exceeds 90 times (corresponding to 18 milliseconds), it means that R0 has a high level greater than 16.7 milliseconds, so the indicator light will be turned off until the next time R0 has a low level, then the indicator light will be turned on again. That is, the characteristic waveform of network activity is analyzed to control the indicator light.
[0089] When the negative electrode pin is at a high level, the counter counts with a gradient of 200 microseconds, thereby collecting the high level duration of each negative electrode pin.
[0090] The step S3 is specifically as follows:
[0091] Based on the indication rule, the MCU first analyzes the pulse level value within the 100 millisecond time slice to determine the network connection. If there is a network connection, the network activity is determined, specifically:
[0092] Determine whether the high level duration is greater than the duration threshold Δt. If so, it means that there is no network activity. If not, analyze the pulse level value of each pin. When the negative pin is collected as low level within two consecutive collection cycles T:
[0093] When the pulse level values of the first positive pin and the second positive pin are both high within a time slice of 100 milliseconds, it indicates that there is network activity and the network rate is 1000M; when the pulse level value of the first positive pin is low and the pulse level value of the second positive pin is high, it indicates that there is network activity and the network rate is 100M; when the pulse level value of the first positive pin is high and the pulse level value of the second positive pin is low, it indicates that there is network activity and the network rate is 10M;
[0094] Then, it is obtained whether there is a network connection, and the pulse signal decoding results of the network rate being 1000M, the network rate being 100M, or the network rate being 10M.
[0095] Because C1 (the second positive pin) and C0 (the first positive pin) are not triggered synchronously when the network switching chip is working, it is necessary to record the triggering conditions of C1=1 and C0=1 within a fixed time slice; because the fastest flashing rate of the indicator light is 12Hz, the time slice is set to 100 milliseconds. Within this time slice, the indicator light must output a status that reflects the network rate.
[0096] The step S4 is specifically as follows:
[0097] The MCU analyzes the decoding result of the pulse signal, and when there is network activity, a high level and a low level are alternately output through the LED2 pin; when the network is connected but there is no network activity, a low level is output through the LED2 pin; when the network is disconnected, a high level is output through the LED2 pin;
[0098] When the network rate of the pulse signal decoding result is 1000M, a high level is output through the LED0 pin, and a low level is output through the LED1 pin;
[0099] When the network rate of the pulse signal decoding result is 100M, a low level is output through the LED0 pin, and a high level is output through the LED1 pin;
[0100] When the network rate of the pulse signal decoding result is 10M, a high level is output through the LED0 pin, and a high level is output through the LED1 pin;
[0101] The MCU outputs a high-level or low-level control signal to the network port socket indicator light of the network card chip based on the LED0 pin, LED1 pin, and LED2 pin.
[0102] A preferred embodiment of a network switching chip indicator light control system based on pulse technology of the present invention includes the following modules:
[0103] The matrix light group control module is used for the network switching chip to set a pulse frequency F and an indication rule of the matrix light group. When the network is connected and there is no network activity, a low-level pulse is sent to the negative pin of each port of the matrix light group in turn within the period of the pulse frequency F, and based on the current network rate and the indication rule, a high-level pulse is sent to the first positive pin or the second positive pin of the corresponding port within the period when each port receives the low-level pulse to light up the indicator light of the corresponding port; when the network is connected and there is network activity, the number of the low-level pulses sent to the negative pin of the corresponding port is reduced to make the indicator light of the corresponding port flash;
[0104] In order to ensure that the 20 indicator lights of the matrix light group can be observed by the human eye, it is necessary to use a refresh rate higher than the human eye recognition to scan and light up the indicator lights in turn, so the pulse frequency F is set to 450Hz; since low-level pulses are sent to the negative pins of each port of the matrix light group in turn, the pulse width of the low-level pulse is (1 / 50Hz) / 5≈444 microseconds; within the 444 microsecond time slice, according to the setting of the network switching chip, a high-level pulse is sent to the C0 / C1 / C2 / C3 input to light up the corresponding indicator light;
[0105] The pulse signal acquisition module is used for the MCU to set an acquisition cycle T and a duration threshold Δt, and to set a counter for each port of the matrix light group. Based on the acquisition cycle T, pulse level values are collected from each first positive pin, second positive pin and negative pin of the matrix light group, and the high level duration of each negative pin is collected based on the counter; pins 10, 11, 12, 13, 14, 15, 16, 17, and 29 of the MCU are respectively connected to the positive pins C0, C1, C2, and C3 and the negative pins R0, R1, R2, R3, and R4 of the matrix light group; pins 18, 19, and 20 of the MCU are connected to one of the network port socket indicator lights, and pins 39, 40, and 41 are connected to the other network port socket indicator lights;
[0106] A pulse signal decoding module is used for the MCU to decode each pulse level value and high level duration based on the indication rule to obtain a pulse signal decoding result;
[0107] The control signal output module is used for the MCU to output a control signal to the network port socket indicator light of the network card chip based on the pulse signal decoding result.
[0108] In the matrix light group control module, the indication rule is specifically:
[0109] When the network is disconnected, a high level is output to the negative pin of the corresponding port, and a low level is output to the first positive pin and the second positive pin of the corresponding port;
[0110] When the network is connected and there is no network activity, a low-level pulse is output to the negative pin of the corresponding port, and when the network rate is 1000M, a high-level pulse is output to the first positive pin and the second positive pin of the corresponding port; when the network rate is 100M, a low-level pulse is output to the first positive pin of the corresponding port, and a high-level pulse is output to the second positive pin; when the network rate is 10M, a high-level pulse is output to the first positive pin of the corresponding port, and a low-level pulse is output to the second positive pin;
[0111] When the network is connected and there is network activity, reduce the number of low-level pulses sent to the negative pin of the corresponding port to make the indicator light of the corresponding port flash;
[0112] Since the period corresponding to the flashing frequency of the indicator light is 90ms, a time interval of the negative pin is divided into 4 time slices, which control C0, C1, C2, and C3 respectively, and the time slice of c0 / c1 / c2 / c3 is about 450us, that is, a time interval is about 450us*4=1.8ms, 90ms / 1.8ms=50, that is, to make the indicator light of the corresponding port flash, the number of low-level pulses sent to the negative pin of the corresponding port needs to be reduced to 50.
[0113] The first positive pin is connected to the input end of the yellow indicator light of the port; the second positive pin is connected to the input end of the green indicator light of the port.
[0114] The matrix light group has the following 7 states: ① Network 10M connection, no network activity; ② Network 100M connection, no network activity; ③ Network 1000M connection, no network activity; ④ Network 10M connection, network activity; ⑤ Network 100M connection, network activity; ⑥ Network 1000M connection, network activity; ⑦ Network disconnected. When the network is disconnected, the matrix light group goes out; when the network is connected but there is no network activity, the corresponding indicator lights up; when the network is connected and there is network activity, the corresponding indicator flashes.
[0115] The indication rules of the matrix light group and the logic of the network card chip controlling the indicator light are shown in Table 2.
[0116] Table 2: Indicator light control comparison table
[0117]
[0118] In the pulse signal acquisition module, the value of the acquisition period T is: T<1 / (10*F);
[0119] The MCU needs to collect matrix signals (row and column pulse signals) in an acquisition period that is less than half of 444 microseconds. For example, T=200 microseconds is set to ensure that there are at least two consistent samples within the acquisition period of R0 / R1 / R2 / R3 / R4, so as to solve the problem of inaccurate sampling caused by the MCU sampling moment being the transition edge. When the MCU collects two consecutive R0 values of 0, the current network rate is determined according to the values of C0 / C1 / C2 / C3.
[0120] The value of the duration threshold Δt is 18 milliseconds;
[0121] When the network switching chip works in 10M / 100M / 1000M mode, if there is no network activity on the port, the indicator light will be always on. At this time, the low pulse intervals of the R0 / R1 / R2 / R3 / R4 signals are very short, ensuring that the human eye cannot see the flicker. The low pulse interval is less than the 60Hz cycle, corresponding to 16.7 milliseconds. If there is network activity on the port, the time when the R0 / R1 / R2 / R3 / R4 signals appear at a high level must be greater than 16.7 milliseconds to allow the human eye to recognize the flicker. The MCU uses this time characteristic to identify the network activity status.
[0122] Take port 1 as an example, to determine the level of R0 (negative pin) when the current port is connected, if R0 is 1, the count will increase by 1 every 200 microseconds, if R0 is 0, the count value will remain at 0. When the count value exceeds 90 times (corresponding to 18 milliseconds), it means that R0 has a high level greater than 16.7 milliseconds, so the indicator light will be turned off until the next time R0 has a low level, then the indicator light will be turned on again. That is, the characteristic waveform of network activity is analyzed to control the indicator light.
[0123] When the negative electrode pin is at a high level, the counter counts with a gradient of 200 microseconds, thereby collecting the high level duration of each negative electrode pin.
[0124] The pulse signal decoding module is specifically used for:
[0125] Based on the indication rule, the MCU first analyzes the pulse level value within the 100 millisecond time slice to determine the network connection. If there is a network connection, the network activity is determined, specifically:
[0126] Determine whether the high level duration is greater than the duration threshold Δt. If so, it means that there is no network activity. If not, analyze the pulse level value of each pin. When the negative pin is collected as low level within two consecutive collection cycles T:
[0127] When the pulse level values of the first positive pin and the second positive pin are both high within a time slice of 100 milliseconds, it indicates that there is network activity and the network rate is 1000M; when the pulse level value of the first positive pin is low and the pulse level value of the second positive pin is high, it indicates that there is network activity and the network rate is 100M; when the pulse level value of the first positive pin is high and the pulse level value of the second positive pin is low, it indicates that there is network activity and the network rate is 10M;
[0128] Then, it is obtained whether there is a network connection, and the pulse signal decoding results of the network rate being 1000M, the network rate being 100M, or the network rate being 10M.
[0129] Because C1 (the second positive pin) and C0 (the first positive pin) are not triggered synchronously when the network switching chip is working, it is necessary to record the triggering conditions of C1=1 and C0=1 within a fixed time slice; because the fastest flashing rate of the indicator light is 12Hz, the time slice is set to 100 milliseconds. Within this time slice, the indicator light must output a status that reflects the network rate.
[0130] The control signal output module is specifically used for:
[0131] The MCU analyzes the decoding result of the pulse signal, and when there is network activity, a high level and a low level are alternately output through the LED2 pin; when the network is connected but there is no network activity, a low level is output through the LED2 pin; when the network is disconnected, a high level is output through the LED2 pin;
[0132] When the network rate of the pulse signal decoding result is 1000M, a high level is output through the LED0 pin, and a low level is output through the LED1 pin;
[0133] When the network rate of the pulse signal decoding result is 100M, a low level is output through the LED0 pin, and a high level is output through the LED1 pin;
[0134] When the network rate of the pulse signal decoding result is 10M, a high level is output through the LED0 pin, and a high level is output through the LED1 pin;
[0135] The MCU outputs a high-level or low-level control signal to the network port socket indicator light of the network card chip based on the LED0 pin, LED1 pin, and LED2 pin.
[0136] In summary, the advantages of the present invention are:
[0137] 1. Set the pulse frequency F and indication rules through the network switching chip. When the network is connected and there is no network activity, within the period of the pulse frequency F, send low-level pulses to the negative pins of each port of the matrix light group in turn, and based on the network rate and indication rules, within the period of receiving the low-level pulses at each port, send high-level pulses to the first positive pin or the second positive pin of the corresponding port to light up the indicator light of the corresponding port; when the network is connected and there is network activity, reduce the number of low-level pulses sent to the negative pin of the corresponding port to make the indicator light of the corresponding port flash; then the MCU sends a high-level pulse from the first positive pin, the second positive pin and the negative pin of the matrix light group based on the acquisition period T. The pulse level values of the positive and negative pins are collected, the high level duration of each negative pin is collected, and each pulse level value and high level duration are decoded based on the indication rule to obtain the pulse signal decoding result. Finally, based on the pulse signal decoding result, a control signal is output to the network port socket indicator light of the network card chip; that is, the pulse signal (matrix signal) of the matrix light group controlled by the network switching chip is scanned in rows and columns to obtain the pulse level value and high level duration of each pin of the matrix light group, and then the pulse level value and high level duration are decoded based on the indication rule of the matrix light group, and converted into the control signal of the network port socket indicator light, thereby achieving compatibility with the network port socket indicator light used by the network card chip, which greatly improves the user experience.
[0138] 2. Since the matrix light group has a 5*4 row and column structure, that is, there are 5 rows of negative pins, and within the period of the pulse frequency F, low-level pulses are sent to the negative pins of each port of the matrix light group in turn, that is, the polling period of each negative pin is 1 / (5*F); by setting the acquisition period T<1 / (10*F), that is, within the polling period of the negative pin, it is necessary to collect the negative pin as a low level twice in a row before determining the network rate, ensuring that within the pulse period of each negative pin, at least 2 samples are consistent before determining the network rate, solving the problem of inaccurate sampling caused by the MCU sampling moment being the jump edge, that is, through 2 times sampling rate redundancy check, it is ensured that there will be no capture abnormality when the sampling period is not synchronized, thereby greatly improving the accuracy of the two-color indicator light control.
[0139] 3. When the network rate is 1000M, the first positive pin and the second positive pin are not triggered synchronously, and the fastest flashing frequency of the indicator light is 12Hz≈83.33ms. Therefore, a 100-millisecond time slice is set. Within this time slice, a level state that reflects the network rate must appear. As long as a high level appears within this time slice, it means that there is network activity and the network rate is 1000M, avoiding misjudgment caused by asynchronous triggering of different pins, and further improving the accuracy of dual-color indicator light control.
[0140] Although the specific implementation modes of the present invention are described above, those skilled in the art should understand that the specific implementation modes described are only illustrative and are not intended to limit the scope of the present invention. Equivalent modifications and changes made by those skilled in the art in accordance with the spirit of the present invention should be included in the scope of protection of the claims of the present invention.
Claims
1. A method for controlling an indicator light of a network switching chip based on pulse technology, characterized in that: The network switch chip controls the indicators of 10 ports through pins R0 / R1 / R2 / R3 / R4 and C0 / C1 / C2 / C3. Each port contains 1 yellow indicator and 1 green indicator. Pins R0 / R1 / R2 / R3 / R4 are connected to the negative pole of the indicator, and pins C0 / C1 / C2 / C3 are connected to the positive pole of the indicator. The method comprises the following steps: Step S1, the network switching chip sets a pulse frequency F and an indication rule of a matrix light group. When the network is connected and there is no network activity, within the period of the pulse frequency F, a low-level pulse is sent to the negative pin of each port of the matrix light group in turn, and based on the current network rate and the indication rule, within the period when each port receives the low-level pulse, a high-level pulse is sent to the first positive pin or the second positive pin of the corresponding port to light up the indicator light of the corresponding port; when the network is connected and there is network activity, the number of the low-level pulses sent to the negative pin of the corresponding port is reduced to make the indicator light of the corresponding port flash; the first positive pin is connected to the input end of the yellow indicator light of the port, and the second positive pin is connected to the input end of the green indicator light of the port; Step S2, the MCU sets a collection period T and a duration threshold Δt, sets a counter for each port of the matrix light group, collects pulse level values from each first positive pin, second positive pin and negative pin of the matrix light group based on the collection period T, and collects the high level duration of each negative pin based on the counter; Step S3, the MCU decodes each pulse level value and high level duration based on the indication rule to obtain a pulse signal decoding result; Step S4, the MCU outputs a high-level or low-level control signal to the 10 network port socket indicator lights of the network card chip based on the pulse signal decoding result. Each network port socket indicator light has 3 indicator lights, corresponding to the MCU pins LED0, LED1, and LED2.
2. A method for controlling a network switch chip indicator light based on pulse technology as claimed in claim 1, characterized in that: In step S1, the indication rule is specifically: When the network is disconnected, a high level is output to the negative pin of the corresponding port, and a low level is output to the first positive pin and the second positive pin of the corresponding port; When the network is connected and there is no network activity, a low-level pulse is output to the negative pin of the corresponding port, and when the network rate is 1000M, a high-level pulse is output to the first positive pin and the second positive pin of the corresponding port; when the network rate is 100M, a low-level pulse is output to the first positive pin of the corresponding port, and a high-level pulse is output to the second positive pin; when the network rate is 10M, a high-level pulse is output to the first positive pin of the corresponding port, and a low-level pulse is output to the second positive pin; When the network is connected and there is network activity, reduce the number of low-level pulses sent to the negative pin of the corresponding port to make the indicator light of the corresponding port flash.
3. A method for controlling a network switch chip indicator light based on pulse technology as claimed in claim 1, characterized in that: In the step S2, the value of the acquisition period T is: T<1 / (10*F); The value of the duration threshold Δt is 18 milliseconds; When the negative electrode pin is at a high level, the counter counts with a gradient of 200 microseconds, thereby collecting the high level duration of each negative electrode pin.
4. A method for controlling a network switch chip indicator light based on pulse technology as claimed in claim 1, characterized in that: The step S3 is specifically as follows: Based on the indication rule, the MCU first analyzes the pulse level value within the 100 millisecond time slice to determine the network connection. If there is a network connection, the network activity is determined, specifically: Determine whether the high level duration is greater than the duration threshold Δt. If so, it means that there is no network activity. If not, analyze the pulse level value of each pin. When the negative pin is collected as low level within two consecutive collection cycles T: When the pulse level values of the first positive pin and the second positive pin are both high within a time slice of 100 milliseconds, it indicates that there is network activity and the network rate is 1000M; when the pulse level value of the first positive pin is low and the pulse level value of the second positive pin is high, it indicates that there is network activity and the network rate is 100M; when the pulse level value of the first positive pin is high and the pulse level value of the second positive pin is low, it indicates that there is network activity and the network rate is 10M; Then, it is obtained whether there is a network connection, and the pulse signal decoding results of the network rate being 1000M, the network rate being 100M, or the network rate being 10M.
5. A method for controlling a network switch chip indicator light based on pulse technology as claimed in claim 1, characterized in that: The step S4 is specifically as follows: The MCU analyzes the decoding result of the pulse signal, and when there is network activity, a high level and a low level are alternately output through the LED2 pin; when the network is connected but there is no network activity, a low level is output through the LED2 pin; when the network is disconnected, a high level is output through the LED2 pin; When the network rate of the pulse signal decoding result is 1000M, a high level is output through the LED0 pin, and a low level is output through the LED1 pin; When the network rate of the pulse signal decoding result is 100M, a low level is output through the LED0 pin, and a high level is output through the LED1 pin; When the network rate of the pulse signal decoding result is 10M, a high level is output through the LED0 pin, and a high level is output through the LED1 pin; The MCU outputs a high-level or low-level control signal to the network port socket indicator light of the network card chip based on the LED0 pin, LED1 pin, and LED2 pin.
6. A network switching chip indicator light control system based on pulse technology, characterized in that: The network switch chip controls the indicators of 10 ports through pins R0 / R1 / R2 / R3 / R4 and C0 / C1 / C2 / C3. Each port contains 1 yellow indicator and 1 green indicator. Pins R0 / R1 / R2 / R3 / R4 are connected to the negative pole of the indicator, and pins C0 / C1 / C2 / C3 are connected to the positive pole of the indicator. The system includes the following modules: A matrix light group control module is used for a network switching chip to set a pulse frequency F and an indication rule of a matrix light group. When the network is connected and there is no network activity, a low-level pulse is sent to the negative pin of each port of the matrix light group in turn within the period of the pulse frequency F, and based on the current network rate and the indication rule, a high-level pulse is sent to the first positive pin or the second positive pin of the corresponding port within the period when each port receives the low-level pulse to light up the indicator light of the corresponding port; when the network is connected and there is network activity, the number of the low-level pulses sent to the negative pin of the corresponding port is reduced to make the indicator light of the corresponding port flash; the first positive pin is connected to the input end of the yellow indicator light of the port, and the second positive pin is connected to the input end of the green indicator light of the port; The pulse signal acquisition module is used for the MCU to set an acquisition cycle T and a duration threshold Δt, and to set a counter for each port of the matrix light group. Based on the acquisition cycle T, the pulse level value is collected from each first positive pin, second positive pin and negative pin of the matrix light group, and the high level duration of each negative pin is collected based on the counter. A pulse signal decoding module is used for the MCU to decode each pulse level value and high level duration based on the indication rule to obtain a pulse signal decoding result; The control signal output module is used for the MCU to output a high-level or low-level control signal to the 10 network port socket indicator lights of the network card chip based on the pulse signal decoding result. Each network port socket indicator light has 3 indicator lights, corresponding to the MCU pins LED0, LED1, and LED2.
7. A network switching chip indicator light control system based on pulse technology as claimed in claim 6, characterized in that: In the matrix light group control module, the indication rule is specifically: When the network is disconnected, a high level is output to the negative pin of the corresponding port, and a low level is output to the first positive pin and the second positive pin of the corresponding port; When the network is connected and there is no network activity, a low-level pulse is output to the negative pin of the corresponding port, and when the network rate is 1000M, a high-level pulse is output to the first positive pin and the second positive pin of the corresponding port; when the network rate is 100M, a low-level pulse is output to the first positive pin of the corresponding port, and a high-level pulse is output to the second positive pin; when the network rate is 10M, a high-level pulse is output to the first positive pin of the corresponding port, and a low-level pulse is output to the second positive pin; When the network is connected and there is network activity, reduce the number of low-level pulses sent to the negative pin of the corresponding port to make the indicator light of the corresponding port flash.
8. A network switching chip indicator light control system based on pulse technology as claimed in claim 6, characterized in that: In the pulse signal acquisition module, the value of the acquisition period T is: T<1 / (10*F); The value of the duration threshold Δt is 18 milliseconds; When the negative electrode pin is at a high level, the counter counts with a gradient of 200 microseconds, thereby collecting the high level duration of each negative electrode pin.
9. A network switching chip indicator light control system based on pulse technology as claimed in claim 6, characterized in that: The pulse signal decoding module is specifically used for: Based on the indication rule, the MCU first analyzes the pulse level value within the 100 millisecond time slice to determine the network connection. If there is a network connection, the network activity is determined, specifically: Determine whether the high level duration is greater than the duration threshold Δt. If so, it means that there is no network activity. If not, analyze the pulse level value of each pin. When the negative pin is collected as low level within two consecutive collection cycles T: When the pulse level values of the first positive pin and the second positive pin are both high within a time slice of 100 milliseconds, it indicates that there is network activity and the network rate is 1000M; when the pulse level value of the first positive pin is low and the pulse level value of the second positive pin is high, it indicates that there is network activity and the network rate is 100M; when the pulse level value of the first positive pin is high and the pulse level value of the second positive pin is low, it indicates that there is network activity and the network rate is 10M; Then, it is obtained whether there is a network connection, and the pulse signal decoding results of the network rate being 1000M, the network rate being 100M, or the network rate being 10M.
10. A network switching chip indicator light control system based on pulse technology as claimed in claim 6, characterized in that: The control signal output module is specifically used for: The MCU analyzes the decoding result of the pulse signal, and when there is network activity, a high level and a low level are alternately output through the LED2 pin; when the network is connected but there is no network activity, a low level is output through the LED2 pin; when the network is disconnected, a high level is output through the LED2 pin; When the network rate of the pulse signal decoding result is 1000M, a high level is output through the LED0 pin, and a low level is output through the LED1 pin; When the network rate of the pulse signal decoding result is 100M, a low level is output through the LED0 pin, and a high level is output through the LED1 pin; When the network rate of the pulse signal decoding result is 10M, a high level is output through the LED0 pin, and a high level is output through the LED1 pin; The MCU outputs a high-level or low-level control signal to the network port socket indicator light of the network card chip based on the LED0 pin, LED1 pin, and LED2 pin.
Citation Information
Patent Citations
Turn-signal-light control device, turn-signal device, and control method for turn-signal device
CN104040889A
Network indicating device
CN102761421A
System and method for managing multiple switch port states
CN109347664A