Switch port fault repair method, device, equipment and medium
By automating the acquisition and monitoring of switch port attribute information, determining the fault level, and performing self-recovery operations, the complexity of switch port fault diagnosis and repair processes is solved, achieving efficient and automated fault handling and improving system stability and reliability.
Patent Information
- Application Number
- CN202411996801.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-11-11
- Estimated Expiration
- 2044-12-30
AI Technical Summary
In AI servers, the diagnosis and repair process of switch port failures is complex, relying on manual collection and analysis of logs. The analysis of the cause of failure is difficult to be accurate and inefficient, especially the long failure reproduction cycle, which affects the efficiency of system use.
By automatically acquiring the type and attribute information of switch ports, real-time monitoring of speed, bandwidth, error count and link status is performed to determine the fault level, and a self-recovery operation strategy is matched according to the level to repair the fault. In-band and out-of-band data transmission is supported to achieve remote control.
It improves fault diagnosis efficiency, reduces manual intervention, lowers maintenance costs, enhances system stability and reliability, reduces downtime, and improves system availability.
Smart Images

Figure CN119814701B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and more specifically to methods, apparatus, equipment and media for repairing switch port faults. Background Technology
[0002] With the development of AI servers, the topology of the high-speed serial computer expansion bus standard (Peripheral Component Interconnect Express, or PCIe) is becoming increasingly complex, and the number of external device models is growing, especially for GPUs. There are many manufacturers, and some products have not undergone large-scale verification, resulting in small shipment volumes. In practical use, various error scenarios inevitably occur. Each time a problem arises, engineers need to go to the site to collect logs and analyze the specific causes. Fault localization requires collecting logs from multiple sources, analyzing and comparing them, which demands a high level of expertise. Moreover, the collected information is fragmented, making it difficult to analyze the cause of the fault. The analysis of the fault cause relies heavily on problem reproduction, but problem reproduction is affected by various factors, resulting in a long reproduction cycle. The reproduction process may also differ from the original situation, making it impossible to accurately analyze the cause. It may even lead to the problem not being fully clarified, thus preventing the analysis of the specific cause.
[0003] In many cases, the problems are simply due to environmental factors or occasional malfunctions and do not affect usability. If every problem requires clarification, it will severely impact the machine's efficiency. Summary of the Invention
[0004] In view of this, the present invention provides a method, apparatus, device and medium for repairing switch port faults to solve the above-mentioned technical problems.
[0005] In a first aspect, the present invention provides a method for repairing switch port faults, the method comprising:
[0006] Obtain the type of the switch port and the target attribute information corresponding to each type of switch port;
[0007] Read and record the actual attribute information corresponding to each type of switch port;
[0008] When a switch port is determined to be faulty based on the target attribute information and the actual attribute information, the fault level is determined.
[0009] Match the self-recovery operation strategy corresponding to the fault level according to the fault level;
[0010] Based on the self-recovery operation strategy, the fault repair of the switch port is completed.
[0011] The present invention provides a method for repairing switch port faults, which has the following advantages:
[0012] By automatically acquiring the type and corresponding actual attribute information of switch ports, the tedious process of engineers manually collecting and analyzing logs is reduced, thereby improving the efficiency of fault diagnosis. By recording actual attribute information and comparing it with target attribute information, port faults can be quickly located, reducing the complexity and time consumption of collecting logs from multiple sources. Due to the automation and systematization of information collection, fault cause analysis no longer relies on problem reproduction, reducing the problems of long reproduction cycles and inconsistent reproduction results. Moreover, fragmented information is integrated, making fault analysis more direct and accurate, helping engineers quickly find the root cause of the problem. Furthermore, this solution can automatically determine whether to execute self-recovery operations based on the fault level, improving the automation level of fault handling. By matching the fault level with the self-recovery operation strategy, rapid and appropriate fault repair can be achieved, reducing the need for manual intervention. For environmental or intermittent faults, the system can automatically identify and handle them without affecting overall usage efficiency, thereby improving system stability and reliability. The automated fault handling mechanism helps reduce downtime caused by faults, improving system availability. Through automated and intelligent fault handling processes, the professional skill requirements for maintenance personnel are reduced, decreasing training and maintenance costs. Quickly locating and repairing faults reduces the number of times engineers need to work on-site, further reducing maintenance costs.
[0013] In one optional implementation, the attribute information corresponding to the switch port includes rate, bandwidth, correctable errors, uncorrectable errors, recovery count, and link status;
[0014] Based on the target attribute information and the actual attribute information, determine whether the switch port is faulty, including:
[0015] When the actual rate is less than the target rate, it is determined that the switch port has failed.
[0016] And / or, when the actual bandwidth is less than the target bandwidth, determine that the switch port has failed;
[0017] And / or, when a correctable error exists, determine that a switch port has failed;
[0018] And / or, when an uncorrectable error exists, determine that a switch port has failed;
[0019] And / or, if a recovery count exists, determine that a switch port has failed;
[0020] And / or, when the duration of the link being in an abnormal link state is greater than or equal to a first preset time threshold, it is determined that the switch port has failed.
[0021] Specifically, by monitoring the switch ports' speed, bandwidth, error count, and link status in real time, the system can promptly detect potential faults, improving system stability and reliability. When actual attribute information does not match target attribute information, such as abnormal speed, bandwidth, error count, or link status, the system can accurately pinpoint the port where the fault occurred, reducing the possibility of false alarms and missed alarms. By monitoring link status, the system can issue early warnings when a link remains in an abnormal state for a duration exceeding a preset threshold, preventing potential major faults. By ensuring that switch ports operate at the expected speed and bandwidth, the system can maintain optimal performance, avoiding performance degradation due to bandwidth limitations or improper error handling. The automated fault detection and repair process reduces the need for manual intervention, lowers maintenance costs, and improves maintenance efficiency.
[0022] In one alternative implementation, the fault levels include: Level 1 fault, Level 2 fault, Level 3 fault, and Level 4 fault.
[0023] When a switch port is determined to be faulty based on target attribute information and actual attribute information, the fault level is determined, including:
[0024] When there are correctable errors and the number of correctable errors is less than or equal to a first preset number threshold, and / or when there are recovery counts and the number of recovery counts is less than or equal to a second preset number threshold, the fault level is determined to be a level one fault.
[0025] Alternatively, when there are correctable errors and the number of correctable errors is greater than the first preset number threshold and less than or equal to the third preset number threshold, and / or when there are uncorrectable errors and the number of uncorrectable errors is less than or equal to the fourth preset number threshold, and / or when the duration of the link being in an abnormal link state is greater than or equal to the first preset time threshold and less than the second preset time threshold, the fault level is determined to be level two.
[0026] Alternatively, when the actual rate is less than the target rate, and / or when the actual bandwidth is less than the target bandwidth, and / or when the duration of the link being in an abnormal link state is greater than or equal to the second preset time threshold and less than the third preset time threshold, the fault level is determined to be level three.
[0027] Alternatively, when the duration of the link being in an abnormal link state is greater than or equal to a third preset time threshold.
[0028] Specifically, by defining different fault levels (Level 1, Level 2, Level 3, and Level 4), the system can classify faults in detail, allowing engineers to take appropriate measures based on the fault level. Level 1 faults typically represent the minorest anomalies and may not require immediate intervention; while Level 4 faults are the most serious and require immediate response. This classification enables the system to respond quickly based on the urgency of the fault. Furthermore, based on the different fault levels, maintenance resources can be allocated more rationally, focusing more resources on handling more serious faults, thereby improving maintenance efficiency and cost-effectiveness. Clear fault levels help avoid over-intervention in non-urgent faults, reducing the risk of misoperation. More serious faults can also be prioritized based on their fault level, improving work efficiency. Rapid response and appropriate handling of faults enhance the overall reliability of the system.
[0029] In one optional implementation, when the fault level is level one, the self-recovery operation strategy includes: not performing self-recovery operation;
[0030] When the fault level is level 2, the self-recovery operation strategy includes: disconnecting the previous link, creating a new link, and clearing the counted error reports, which include reports for uncorrectable errors and reports for correctable errors.
[0031] When the fault level is level three, the self-recovery operation strategy includes: performing a hot restart operation on the downlink equipment;
[0032] When the fault level is level four, the self-recovery operation strategy includes: performing a cold restart operation on the downlink equipment.
[0033] Specifically, different self-recovery strategies can be adopted based on the fault level, providing the most suitable repair strategy for faults of varying severity and thus improving repair effectiveness. For example, for Level 1 faults, not performing self-recovery operations can avoid unnecessary system restarts, reduce resource consumption, and maintain system stability, minimizing the impact of service interruption on objects. For Level 2 faults, disconnecting and creating new links and clearing error reports can quickly restore link performance, helping the system return to normal operation, reducing error accumulation, and optimizing overall system performance. For Level 3 faults, performing a hot restart on downlink devices can quickly restore devices without shutting down services, reducing service interruption time and improving user experience. For Level 4 faults, performing a cold restart can completely shut down and restart devices, clearing all runtime problems, ensuring the system fundamentally solves the problem, preventing recurrence, and thus ensuring stable system operation. Furthermore, effective fault handling strategies reduce the frequency of equipment repair and replacement. Recovery operations improve the overall stability and reliability of the system, reducing service interruptions and providing more stable and reliable services.
[0034] In an optional implementation, when the fault repair of the switch port is not completed according to the self-recovery operation strategy, the method further includes:
[0035] Identify the level at which self-recovery operations will be performed;
[0036] When the self-recovery operation level is the highest pre-configured level, a hot restart operation is performed simultaneously on the switch to which the switch port belongs and the peer device that has established a communication connection with the switch, and / or a cold restart operation is performed simultaneously, and the operation records performed on the switch and peer device are saved.
[0037] Specifically, when the self-recovery operation level is the highest pre-configured level, it indicates a relatively serious fault. The most effective measures must be taken quickly to improve fault resolution efficiency. Therefore, it is necessary to simultaneously perform a warm restart and / or a cold restart on both the switch and the peer device with which it establishes a communication connection. This will rapidly restore the system and ensure the problem is fundamentally resolved, minimizing downtime caused by the fault. Maintaining consistency in software and hardware status between the switch and the peer device enhances overall system stability. Keeping operation logs makes the process transparent, helping other maintenance or management personnel understand the history and details of the fault handling process.
[0038] In one alternative implementation, the method further includes:
[0039] Obtain operation instructions transmitted through a preset data transmission channel, which includes an in-band channel and / or an out-of-band transmission channel;
[0040] According to the operation instructions, perform corresponding operations on the recorded fault data corresponding to the fault of the switch port. The operation instructions include one or more of the following: data reading instructions, parameter setting instructions, and data acquisition method configuration instructions.
[0041] Specifically, by supporting in-band and / or out-of-band transmission channels, the system can flexibly select the most suitable data transmission method according to actual conditions, improving the reliability and efficiency of data transmission. Using out-of-band transmission channels for transmitting operation commands allows for remote control of the switch for fault handling even in the event of a switch port failure, enhancing the system's remote management capabilities. Providing data read commands, parameter setting commands, and data acquisition method configuration commands enables the system to perform various operations, such as reading fault data, adjusting parameters, and configuring data acquisition methods, increasing the system's functionality and adaptability. By directly processing fault data according to operation commands, faults can be responded to quickly, reducing manual intervention time and improving fault handling efficiency. This command-driven fault handling mechanism makes the system more manageable because all operations can be controlled and recorded through centralized commands.
[0042] In one alternative implementation, the method further includes:
[0043] Within a preset time range, the fault repair of the switch port is completed according to the self-recovery operation strategy. The preset time range includes any of the following: at the moment of starting the first link; or, within the time period before performing the uplink warm start operation; or within the preset time period before the uplink is started.
[0044] Specifically, fault repair at the initial stage of link startup ensures the link is in good working order from the outset. Repairing faults before a warm start avoids additional problems during the warm start process, reducing the risk of system instability. Allowing time for fault repair before link startup ensures the link is not affected by faults during startup, improving the success rate. In summary, repairing faults within a preset timeframe limits the impact of faults on other parts of the network. Rapid repair reduces the impact of faults on users, improving user satisfaction. Rapid response and fault repair reduce subsequent maintenance work, thereby lowering maintenance costs. Timely fault repair ensures network performance remains at its best, avoiding performance degradation caused by faults. Fault repair strategies within preset timeframes enhance system resilience, enabling it to better cope with unexpected faults.
[0045] In an optional example, when the number of failed switch ports is multiple, the method further includes:
[0046] Obtain the network traffic for each failed switch port;
[0047] Based on the fault level of the faulty switch port and the historical fault level repair time records to be obtained, predict the fault repair time for each faulty switch port.
[0048] The self-recovery priority of each failed switch port is determined based on the network traffic of each failed switch port and the fault repair time of each failed switch port.
[0049] Based on the self-recovery priority, determine the self-recovery sequence for each faulty switch port;
[0050] Based on the self-recovery sequence, complete the fault repair for each faulty switch port.
[0051] Specifically, prioritizing ports with high network traffic minimizes the impact on critical services and improves overall recovery efficiency. However, if a high-traffic port has a high fault severity and a long repair time, its fault repair priority will be adjusted based on the actual situation. That is, fault repair priority is assessed by combining fault severity and repair time, enabling faster location and repair of critical faults and reducing the overall fault duration. Intelligent fault recovery strategies ensure the continuity and availability of network services. This method analyzes real-time and historical data and can adapt to different network environments and fault modes. The decision-making process is more scientific and accurate, reducing human error. With each fault repair record and feedback, the system can continuously optimize its predictive models and decision rules, improving future decision quality and enhancing network service availability.
[0052] Secondly, the present invention provides a switch port fault repair method apparatus, the apparatus comprising:
[0053] The acquisition module is used to acquire the type of switch port and the target attribute information corresponding to each type of switch port.
[0054] The reading module is used to read and record the actual attribute information corresponding to each type of switch port;
[0055] The processing module is used to determine the fault level when a switch port fault is determined based on the target attribute information and the actual attribute information; and to match the self-recovery operation strategy corresponding to the fault level based on the fault level.
[0056] The fault repair module is used to repair faults in the switch ports according to the self-recovery operation strategy.
[0057] The present invention provides a switch port fault repair method and apparatus, which has the following advantages:
[0058] By automatically acquiring the type and corresponding actual attribute information of switch ports, the tedious process of engineers manually collecting and analyzing logs is reduced, thereby improving the efficiency of fault diagnosis. By recording actual attribute information and comparing it with target attribute information, port faults can be quickly located, reducing the complexity and time consumption of collecting logs from multiple sources. Due to the automation and systematization of information collection, fault cause analysis no longer relies on problem reproduction, reducing the problems of long reproduction cycles and inconsistent reproduction results. Moreover, fragmented information is integrated, making fault analysis more direct and accurate, helping engineers quickly find the root cause of the problem. Furthermore, this solution can automatically determine whether to execute self-recovery operations based on the fault level, improving the automation level of fault handling. By matching the fault level with the self-recovery operation strategy, rapid and appropriate fault repair can be achieved, reducing the need for manual intervention. For environmental or intermittent faults, the system can automatically identify and handle them without affecting overall usage efficiency, thereby improving system stability and reliability. The automated fault handling mechanism helps reduce downtime caused by faults, improving system availability. Through automated and intelligent fault handling processes, the professional skill requirements for maintenance personnel are reduced, decreasing training and maintenance costs. Quickly locating and repairing faults reduces the number of times engineers need to work on-site, further reducing maintenance costs.
[0059] Thirdly, the present invention provides a computer device, including: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the computer instructions to perform the switch port fault repair method described in the first aspect or any corresponding embodiment.
[0060] Fourthly, the present invention provides a computer-readable storage medium storing computer instructions for causing a computer to execute the switch port fault repair method described in the first aspect or any corresponding embodiment thereof.
[0061] Fifthly, the present invention provides a computer program product, including computer instructions, which are used to cause a computer to execute the switch port fault repair method described in the first aspect or any corresponding embodiment. Attached Figure Description
[0062] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0063] Figure 1 This is a flowchart illustrating a switch port fault repair method provided in an embodiment of the present invention;
[0064] Figure 2 This is a flowchart illustrating another method for repairing switch port faults provided in an embodiment of the present invention;
[0065] Figure 3 This is a simplified flowchart illustrating a specific example of a switch port fault repair method provided in an embodiment of the present invention.
[0066] Figure 4 This is a structural block diagram of a switch port fault repair method device provided in an embodiment of the present invention;
[0067] Figure 5 This is a schematic diagram of the hardware structure of a computer device provided in an embodiment of the present invention. Detailed Implementation
[0068] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0069] With the development of AI servers, PCIe topologies are becoming increasingly complex, and the number of external device models is growing, especially for GPUs. There are many manufacturers, and some products haven't undergone large-scale verification, resulting in low shipment volumes. In practical use, issues such as speed reduction, bandwidth reduction, Correctable Errors (CE), and Uncorrectable Errors (UCE) inevitably occur. Each time a problem arises, engineers need to go to the site to collect logs and analyze the specific causes. Fault localization requires collecting logs from multiple sources, analyzing and comparing them, which demands a high level of expertise. Moreover, the collected information is often fragmented, making it difficult to analyze the cause of the fault. Fault cause analysis relies heavily on problem reproduction, but problem reproduction is affected by various factors, resulting in long reproduction cycles. The reproduced process may also differ from the original situation, making precise cause analysis impossible. It may even prevent the problem from being fully clarified, thus hindering the analysis of the specific cause.
[0070] In many cases, the problems are simply due to environmental factors or occasional malfunctions and do not affect usability. If every problem requires clarification, it will severely impact the machine's efficiency.
[0071] Therefore, the methods in the related technologies have three relatively obvious drawbacks:
[0072] 1. It requires a high level of expertise from users, who need to understand relevant fields and collect logs from multiple modules;
[0073] 2. Simple, routine faults lack self-recovery capabilities;
[0074] 3. It is inefficient, requires error reporting and is not easy to reproduce, which is time-consuming and laborious.
[0075] To address the aforementioned problems, this invention provides an embodiment of a switch port fault repair method. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system (computer device) including a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0076] This embodiment provides a method for repairing switch port faults, which can be used in the aforementioned terminal devices, such as mobile phones and tablets. Figure 1 This is a flowchart illustrating a switch port fault repair method provided in an embodiment of the present invention, as shown below. Figure 1 As shown, the process includes the following steps:
[0077] Step S101: Obtain the type of the switch port and the target attribute information corresponding to each type of switch port.
[0078] Specifically, the monitoring thread in the server can be started during firmware initialization and is responsible for maintaining the type of the switch port (PCIe). Port types include, for example, uplink, downlink, and fabric (which typically refers to the physical or logical network connecting various components).
[0079] The attribute information corresponding to the switch port includes, for example, speed, bandwidth, correctable errors, uncorrectable errors, recovery count, and link status.
[0080] Step S102: Read and record the actual attribute information corresponding to each type of switch port.
[0081] Specifically, the system can periodically acquire and record the actual attribute information corresponding to the switch ports in a given row. For example, every 100ms, it can read the actual link status, actual speed information, actual bandwidth, correctable error statistics, uncorrectable error statistics, and recovery count for each port. This specific attribute information will be recorded in the flash memory in the form of logs. This allows staff to use the recorded logs to assist in reproducing problems, clarifying issues, and analyzing the causes of faults. Furthermore, because the information is recorded in log format, it is no longer fragmented, significantly shortening the reproduction cycle and improving the accuracy of the reproduction.
[0082] Step S103: When it is determined that a switch port has failed based on the target attribute information and the actual attribute information, the fault level is determined.
[0083] Specifically, the target attribute information serves as a reference baseline. When the actual attribute information differs from the target attribute information, or is less than the corresponding reference baseline, it indicates a fault has occurred at the switch port, and the fault level needs to be determined. The specific fault level can be determined based on the difference or data gap between the target and actual attribute information.
[0084] Step S104: Match the self-recovery operation strategy corresponding to the fault level according to the fault level.
[0085] Specifically, low-level faults may have little or no impact on the system, so self-recovery operations may not be necessary. High-level faults, however, may have some impact on system performance, thus requiring self-recovery operations. Furthermore, some fault levels are more sensitive to different objects, meaning objects have varying degrees of sensitivity to whether or not self-recovery operations are performed. In such cases, the self-recovery strategy can be adaptively adjusted based on the object's sensitivity.
[0086] Step S105: Based on the self-recovery operation strategy, complete the fault repair of the switch port.
[0087] The switch port fault repair method provided in this embodiment automatically acquires the type and corresponding actual attribute information of the switch port, reducing the tedious process of engineers manually collecting and analyzing logs, thereby improving the efficiency of fault diagnosis. By recording the actual attribute information and comparing it with the target attribute information, port faults can be quickly located, reducing the complexity and time consumption of collecting logs from multiple sources. Due to the automation and systematization of information collection, the analysis of fault causes no longer relies on problem reproduction, reducing the problems of long reproduction cycles and inconsistent reproduction results. Moreover, fragmented information is integrated, making fault analysis more direct and accurate, helping engineers quickly find the root cause of the problem. Furthermore, this solution can automatically decide whether to perform self-recovery operations based on the fault level, improving the automation level of fault handling. By matching the fault level with the self-recovery operation strategy, rapid and appropriate fault repair can be achieved, reducing the need for manual intervention. For environmental or intermittent faults, the system can automatically identify and handle them without affecting overall usage efficiency, thereby improving the stability and reliability of the system. The automated fault handling mechanism helps reduce downtime caused by faults and improves system availability. Through automated and intelligent fault handling processes, the professional skill requirements for maintenance personnel are reduced, and training and maintenance costs are reduced. Quickly locating and repairing faults reduces the number of times engineers need to work on-site, further reducing maintenance costs.
[0088] This embodiment provides a method for repairing switch port faults. Based on the previous embodiments, it determines whether a switch port has failed based on target attribute information and actual attribute information, including the following:
[0089] When the actual rate is less than the target rate, it is determined that the switch port has failed.
[0090] And / or, when the actual bandwidth is less than the target bandwidth, determine that the switch port has failed;
[0091] And / or, when a correctable error exists, determine that a switch port has failed;
[0092] And / or, when an uncorrectable error exists, determine that a switch port has failed;
[0093] And / or, if a recovery count exists, determine that a switch port has failed;
[0094] And / or, when the duration of the link being in an abnormal link state is greater than or equal to a first preset time threshold, it is determined that the switch port has failed.
[0095] Specifically, the attribute information corresponding to a switch port includes speed, bandwidth, correctable errors, uncorrectable errors, recovery count, and link status. Therefore, determining whether a switch port has failed can include one or more of the conditions described above.
[0096] The above situations determine if the switch port is faulty. If none of the above situations apply, it means that the switch port is not faulty.
[0097] By monitoring the switch ports' speed, bandwidth, error count, and link status in real time using the methods described above, the system can promptly detect potential faults, improving system stability and reliability. When actual attribute information does not match target attribute information, such as abnormal speed, bandwidth, error count, or link status, the system can accurately pinpoint the port where the fault occurs, reducing the possibility of false alarms and missed alarms. By monitoring link status, the system can issue early warnings when a link remains in an abnormal state for a duration exceeding a preset threshold, preventing potential major faults. By ensuring that switch ports operate at the expected speed and bandwidth, the system can maintain optimal performance, avoiding performance degradation due to bandwidth limitations or improper error handling. The automated fault detection and repair process reduces the need for manual intervention, lowers maintenance costs, and improves maintenance efficiency.
[0098] In one optional example, the fault levels include: Level 1 fault, Level 2 fault, Level 3 fault, and Level 4 fault;
[0099] Based on the aforementioned method steps, when it is determined that a switch port has failed based on the target attribute information and the actual attribute information, the fault level is determined, including the following:
[0100] When there are correctable errors and the number of correctable errors is less than or equal to a first preset number threshold, and / or when there are recovery counts and the number of recovery counts is less than or equal to a second preset number threshold, the fault level is determined to be a level one fault.
[0101] Alternatively, when there are correctable errors and the number of correctable errors is greater than the first preset number threshold and less than or equal to the third preset number threshold, and / or when there are uncorrectable errors and the number of uncorrectable errors is less than or equal to the fourth preset number threshold, and / or when the duration of the link being in an abnormal link state is greater than or equal to the first preset time threshold and less than the second preset time threshold, the fault level is determined to be level two.
[0102] Alternatively, when the actual rate is less than the target rate, and / or when the actual bandwidth is less than the target bandwidth, and / or when the duration of the link being in an abnormal link state is greater than or equal to the second preset time threshold and less than the third preset time threshold, the fault level is determined to be level three.
[0103] Alternatively, when the duration of the link being in an abnormal link state is greater than or equal to a third preset time threshold.
[0104] Specifically, Level 1 faults have no impact on the system, Level 2 faults have a slight impact on the system, Level 3 faults affect system functionality, and Level 4 faults have a serious impact on the system.
[0105] For example, a few CE or recovery counts do not affect usage; users will see recoverable error counts during startup, which is a Level 1 fault. A large number of CE counts or a few UCEs, with link status changes such as link down or link up, mean the function is ultimately usable, but an anomaly occurred, which is a Level 2 fault. Reduced speed, reduced bandwidth, or continuous fluctuations in link status indicate a Level 3 fault; inability to link normally or repeated error reports indicate a Level 4 fault.
[0106] By defining different fault levels (Level 1, Level 2, Level 3, and Level 4), the system can classify faults in detail, allowing engineers to take appropriate measures based on the fault level. Level 1 faults typically represent the minorest anomalies and may not require immediate intervention, while Level 4 faults are the most serious and require immediate response. This classification enables the system to respond quickly based on the urgency of the fault. Furthermore, maintenance resources can be allocated rationally according to the fault level, allocating more resources to handle more serious faults, thereby improving maintenance efficiency and cost-effectiveness. Clear fault levels help avoid over-intervention in non-urgent faults, reducing the risk of misoperation. More serious faults can also be prioritized based on their fault level, improving work efficiency. Rapid response and appropriate handling of faults enhance the overall reliability of the system.
[0107] Based on the aforementioned embodiments, when the fault level is level one, the self-recovery operation strategy includes: not performing self-recovery operation;
[0108] When the fault level is level 2, the self-recovery operation strategy includes: disconnecting the previous link, creating a new link, and clearing the counted error reports, which include reports for uncorrectable errors and reports for correctable errors.
[0109] When the fault level is level three, the self-recovery operation strategy includes: performing a hot restart operation on the downlink equipment;
[0110] When the fault level is level four, the self-recovery operation strategy includes: performing a cold restart operation on the downlink equipment.
[0111] Specifically, different self-recovery strategies can be adopted based on the fault level, providing the most suitable repair strategy for faults of varying severity and thus improving repair effectiveness. For example, for Level 1 faults, not performing self-recovery operations can avoid unnecessary system restarts, reduce resource consumption, and maintain system stability, minimizing the impact of service interruption on objects. For Level 2 faults, disconnecting and creating new links and clearing error reports can quickly restore link performance, helping the system return to normal operation, reducing error accumulation, and optimizing overall system performance. For Level 3 faults, performing a hot restart on downlink devices can quickly restore devices without shutting down services, reducing service interruption time and improving user experience. For Level 4 faults, performing a cold restart can completely shut down and restart devices, clearing all runtime problems, ensuring the system fundamentally solves the problem, preventing recurrence, and thus ensuring stable system operation. Furthermore, effective fault handling strategies reduce the frequency of equipment repair and replacement. Recovery operations improve the overall stability and reliability of the system, reducing service interruptions and providing more stable and reliable services.
[0112] In addition to implementing the self-recovery strategy described above, the following methods can also be used to optimize system performance.
[0113] For example, under a Level 1 fault, besides not performing self-recovery operations, the system can introduce machine learning algorithms to predict possible fault trends by analyzing historical fault data and the current system state, and take preventative measures before the fault actually occurs. Under a Level 2 fault, when creating a new link, the system can dynamically select the optimal link path based on factors such as network traffic, latency, and reliability, thereby improving the overall network performance.
[0114] When a Level 3 fault occurs, the system can optimize the restart process during a hot restart by adopting a self-recovery strategy. For example, it can implement incremental restarts, reloading only the necessary system modules and services to reduce the time and resource consumption required for restarting.
[0115] Taking a system optimization scheme for a level-three fault as an example, the specific implementation process includes, for example:
[0116] 1. System monitoring and status logging;
[0117] The system continuously monitors the operational status of each module and service, recording the health metrics and performance data of the corresponding modules. It also creates a status record for each module and service, including its startup time, configuration information, and dependencies.
[0118] 2. Perform dependency analysis and construct a dependency graph;
[0119] Analyze the dependencies of each module and service, construct a dependency graph, and identify which modules and services need to be restarted together. Furthermore, maintain version information for each module and service to identify components that need updating during incremental restarts.
[0120] 3. Restart strategy planning;
[0121] Based on the dependency graph and the module's runtime status, determine the order of incremental restarts to ensure that system instability is not caused by an incorrect restart order. Also, plan the resource usage required during the restart process, such as memory and CPU cycles.
[0122] 4. Implement incremental restart;
[0123] When a module requiring a restart is detected, the system identifies which modules need to be reloaded. Services provided by the modules requiring restart are gradually disconnected to ensure no impact on users or other parts of the system. An incremental update mechanism is used to load and start only modules marked as needing updates. The module's configuration file is updated synchronously to ensure correct operation in the new version. After the module loading is complete, the services are restarted, and communication between them is ensured.
[0124] Further, optionally, to verify the effectiveness of the aforementioned operations, the following steps may also be included:
[0125] 5. Verification and monitoring;
[0126] Perform a series of functional tests to ensure that the modules and services function normally after the reboot. Monitor system performance after the reboot to ensure there is no performance degradation. Check the status of all modules to confirm that the system has fully recovered.
[0127] 6. Log recording and feedback;
[0128] The incremental restart process should be documented in detail, including both successful and failed operations. If an error occurs during the restart process, the system should provide a feedback mechanism that allows for a quick rollback to the state before the restart.
[0129] Through this implementation process, the system can effectively perform incremental restarts, reduce restart time, lower resource consumption, and maintain system stability and availability.
[0130] In addition, for level four faults, the optimization operations performed include, for example:
[0131] After a cold restart, the system should automatically generate a detailed fault analysis report, including the cause of the fault, the scope of impact, and the recovery process. This information is used to improve system design and prevent similar faults from occurring in the future.
[0132] Furthermore, if none of the above methods can restore the function, the method may also include:
[0133] Identify the level at which self-recovery operations will be performed;
[0134] When the self-recovery operation level is the highest pre-configured level, a hot restart operation is performed simultaneously on the switch to which the switch port belongs and the peer device that has established a communication connection with the switch, and / or a cold restart operation is performed simultaneously, and the operation records performed on the switch and peer device are saved.
[0135] Specifically, if none of the aforementioned self-recovery strategies can recover from the fault, and the self-recovery strategy level is the highest level, then both the PCIe Switch and the peer device will be reset. Since the Switch cannot obtain previous information after a reset, in this case the Switch will also record a log and write it to the flash, that is, record the operation.
[0136] This embodiment provides a method for repairing switch port faults, which can be used in the aforementioned mobile terminals, such as mobile phones and tablets. Figure 2 This is a flowchart illustrating another method for repairing switch port faults provided in an embodiment of the present invention, as shown below. Figure 2 As shown, the method also includes the following steps:
[0137] Step S201: Obtain operation instructions transmitted through a preset data transmission channel, wherein the preset data transmission channel includes an in-band channel and / or an out-of-band transmission channel.
[0138] Step S202: According to the operation instructions, perform the corresponding operation on the recorded fault data corresponding to the fault of the switch port.
[0139] Specifically, the PCIe Switch provides two channels—in-band and out-of-band—for managing fault information collection and self-recovery operations. In-band management refers to the OS using commands or scripts via the PCIe channel; out-of-band management is handled by the BMC using commands or scripts via the I2C channel. Regardless of the channel through which operation commands are transmitted, the PCIe Switch provides a command interface to accept the corresponding commands. These commands may include, for example, one or more of the following: data read commands, parameter setting commands, and data acquisition method configuration commands.
[0140] The data read command is used to read actual attribute information, fault level, self-recovery operation strategy, and the level of the self-recovery operation strategy. Specifically, the level of the self-recovery operation strategy corresponds to the level of the fault.
[0141] Parameter setting commands are used to make corresponding settings, such as setting the threshold for each attribute; setting the period for reading actual attribute information; setting whether to save data after reading, i.e., whether to disable log control; and whether to perform real-time monitoring.
[0142] Alternatively, since attribute information, fault information, and the acquisition and execution of self-recovery and repair strategies can all be transmitted according to their corresponding types, they can also be packaged together for transmission. The specific transmission method can also be configured.
[0143] In addition, the parameter settings will be saved to flash memory, so they will not affect usage even after a restart or firmware upgrade.
[0144] By supporting in-band and / or out-of-band transmission channels, the system can flexibly select the most suitable data transmission method according to actual conditions, improving the reliability and efficiency of data transmission. Using out-of-band transmission channels for transmitting operation commands allows for remote control of the switch for fault handling even in the event of a switch port failure, enhancing the system's remote management capabilities. Providing data read commands, parameter setting commands, and data acquisition method configuration commands enables the system to perform various operations, such as reading fault data, adjusting parameters, and configuring data acquisition methods, increasing the system's functionality and adaptability. By directly processing fault data according to operation commands, faults can be responded to quickly, reducing manual intervention time and improving fault handling efficiency. This command-driven fault handling mechanism makes the system more manageable because all operations can be controlled and recorded through centralized commands.
[0145] In an optional example, the method also includes:
[0146] Within a preset time range, the fault repair of the switch port is completed according to the self-recovery operation strategy. The preset time range includes any of the following: at the moment of starting the first link; or, within the time period before performing the uplink warm start operation; or within the preset time period before the uplink is started.
[0147] Specifically, fault repair at the initial stage of link startup ensures the link is in good working order from the outset. Repairing faults before a warm start avoids additional problems during the warm start process, reducing the risk of system instability. Allowing time for fault repair before link startup ensures the link is not affected by faults during startup, improving the success rate. In summary, repairing faults within a preset timeframe limits the impact of faults on other parts of the network. Rapid repair reduces the impact of faults on users, improving user satisfaction. Rapid response and fault repair reduce subsequent maintenance work, thereby lowering maintenance costs. Timely fault repair ensures network performance remains at its best, avoiding performance degradation caused by faults. Fault repair strategies within preset timeframes enhance system resilience, enabling it to better cope with unexpected faults.
[0148] In an optional example, when the number of failed switch ports is multiple, the method further includes the following steps:
[0149] Step a1: Obtain the network traffic for each faulty switch port.
[0150] Step a2: Based on the fault level of the faulty switch port and the historical fault level repair time records to be acquired, predict the fault repair time for each faulty switch port.
[0151] Step a3: Determine the self-recovery priority of each faulty switch port based on the network traffic of each faulty switch port and the fault repair time of each faulty switch port.
[0152] Step a4: Determine the self-recovery sequence for each faulty switch port based on the self-recovery priority.
[0153] Step a5: According to the self-recovery sequence, complete the fault repair for each faulty switch port.
[0154] Specifically, when multiple switch ports have failed, in order to minimize the duration of the failure and provide a more effective fault recovery strategy to adapt to changes in the network environment and failure modes, thus ensuring network service availability, the above method steps consider the following: When multiple switch ports fail, the network traffic of each failed port can be pre-determined. Generally, ports with higher network traffic have a higher need for repair, meaning their repair priority should be higher. This minimizes the impact on network services. However, some fault levels may be too high, potentially leading to longer repair times. Other failed switch ports, while having lower network traffic, may have lower fault levels and therefore shorter repair times. Therefore, it's advisable to prioritize repairing the switch ports with shorter repair times.
[0155] Therefore, in this embodiment, after each fault repair, the historical repair time for the switch port under different network traffic levels for different fault grades is recorded. Then, big data statistics are used to predict the next fault repair time for the switch port under different network traffic levels. For example, the average of the historical fault repair times for that grade is used as the predicted fault repair time for the next fault grade.
[0156] Finally, based on the network traffic of each failed switch port and the fault repair time of each failed switch port, the self-recovery priority of each failed switch port is determined.
[0157] Specifically, based on historical data statistics, weighting coefficients can be configured for different network traffic volumes and fault repair times of different fault levels. Then, based on network traffic, fault repair times of different fault levels, and their respective weighting coefficients, the self-recovery priority can be determined. Finally, based on the self-recovery priority, the self-recovery order of each faulty switch port can be determined.
[0158] Once the self-recovery sequence is determined, the self-recovery operation is performed on each faulty switch port in the order of self-recovery.
[0159] In the above method, prioritizing ports with high network traffic minimizes the impact on critical services and improves overall recovery efficiency. However, if a port with high network traffic has a high fault severity and a long repair time, its fault repair priority will be adjusted according to the actual situation. That is, fault repair priority is assessed by combining fault severity and repair time, enabling faster location and repair of critical faults and reducing the overall fault duration. Intelligent fault recovery strategies ensure the continuity and availability of network services. This method analyzes real-time and historical data, adapting to different network environments and fault modes. The decision-making process is more scientific and accurate, reducing human error. With each fault repair record and feedback, the system can continuously optimize its predictive model and decision rules, improving future decision quality and enhancing network service availability.
[0160] It should be noted that the above operation applies to situations where the server can perform self-repair on one or more switch ports of equal priority at the same time when performing fault repair on different types of switch ports.
[0161] Of course, if the server can disregard priority and directly process the self-repair of all switch ports in batches, then the process of determining the self-recovery priority can be skipped, and the self-recovery of each faulty switch port can be completed directly.
[0162] It should also be noted that the self-recovery priority here is used to assess the order of fault repair for switch ports, while the self-recovery level mentioned above is used to assess the user's acceptance of the self-recovery operation.
[0163] Figure 3 The above-described method processing flow diagram provided in the embodiments of the present invention includes:
[0164] Start up and load the adaptive fault self-recovery operation level (corresponding to the fault level) and time period parameters (such as the time period for periodic data acquisition, self-recovery time, and other parameters involving time nodes in the above scheme); obtain port status information and fault information (such as bandwidth, data transmission speed, and other information that may cause device failure mentioned above), and then evaluate whether a fault has occurred according to the above method. If so, determine the fault information and fault level.
[0165] Determine if recovery logic exists, such as the self-recovery operation level and strategy described earlier; and determine if the current time period is suitable for operation, i.e., whether it meets the time requirement for executing a self-recovery operation. If yes, execute the self-recovery operation. Otherwise, log and end the operation. If there is no fault, also log and end the operation.
[0166] The above methods and procedures have been described in detail above, so they will not be repeated here.
[0167] This embodiment also provides a switch port fault repair method apparatus, which is used to implement the above embodiments and preferred embodiments, and will not be repeated for details already described. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0168] This embodiment provides a device for repairing switch port faults, such as... Figure 4 The system includes: an acquisition module 401, a reading module 402, a processing module 403, and a fault repair module 404.
[0169] The acquisition module 401 is used to acquire the type of switch port and the target attribute information corresponding to each type of switch port.
[0170] The reading module 402 is used to read and record the actual attribute information corresponding to each type of switch port;
[0171] The processing module 403 is used to determine the fault level when it is determined that a switch port has failed based on the target attribute information and the actual attribute information; and to match the self-recovery operation strategy corresponding to the fault level based on the fault level.
[0172] The fault repair module 404 is used to complete the fault repair of the switch port according to the self-recovery operation strategy.
[0173] In an optional example, the attribute information corresponding to the switch port includes rate, bandwidth, correctable errors, uncorrectable errors, recovery count, and link status;
[0174] Processing module 403 is specifically used to determine that a switch port has failed when the actual rate is less than the target rate;
[0175] And / or, when the actual bandwidth is less than the target bandwidth, determine that the switch port has failed;
[0176] And / or, when a correctable error exists, determine that a switch port has failed;
[0177] And / or, when an uncorrectable error exists, determine that a switch port has failed;
[0178] And / or, if a recovery count exists, determine that a switch port has failed;
[0179] And / or, when the duration of the link being in an abnormal link state is greater than or equal to a first preset time threshold, it is determined that the switch port has failed.
[0180] In one optional example, the fault levels include: Level 1 fault, Level 2 fault, Level 3 fault, and Level 4 fault;
[0181] The processing module 403 is specifically used to determine the fault level as a level one fault when there is a correctable error and the number of correctable errors is less than or equal to a first preset number threshold, and / or when there is a recovery count and the number of recovery counts is less than or equal to a second preset number threshold.
[0182] Alternatively, when there are correctable errors and the number of correctable errors is greater than the first preset number threshold and less than or equal to the third preset number threshold, and / or when there are uncorrectable errors and the number of uncorrectable errors is less than or equal to the fourth preset number threshold, and / or when the duration of the link being in an abnormal link state is greater than or equal to the first preset time threshold and less than the second preset time threshold, the fault level is determined to be level two.
[0183] Alternatively, when the actual rate is less than the target rate, and / or when the actual bandwidth is less than the target bandwidth, and / or when the duration of the link being in an abnormal link state is greater than or equal to the second preset time threshold and less than the third preset time threshold, the fault level is determined to be level three.
[0184] Alternatively, when the duration of the link being in an abnormal link state is greater than or equal to a third preset time threshold.
[0185] In an optional example, when the fault level is level 1, the self-recovery operation strategy includes: not performing self-recovery operation;
[0186] When the fault level is level 2, the self-recovery operation strategy includes: disconnecting the previous link, creating a new link, and clearing the counted error reports, which include reports for uncorrectable errors and reports for correctable errors.
[0187] When the fault level is level three, the self-recovery operation strategy includes: performing a hot restart operation on the downlink equipment;
[0188] When the fault level is level four, the self-recovery operation strategy includes: performing a cold restart operation on the downlink equipment.
[0189] In an optional example, processing module 403 is also used to identify the level at which a self-recovery operation should be performed;
[0190] When the self-recovery operation level is the highest pre-configured level, a hot restart operation is performed simultaneously on the switch to which the switch port belongs and the peer device that has established a communication connection with the switch, and / or a cold restart operation is performed simultaneously, and the operation records performed on the switch and peer device are saved.
[0191] In an optional example, the acquisition module 401 is also used to acquire operation instructions transmitted through a preset data transmission channel, the preset data transmission channel including an in-band channel and / or an out-of-band transmission channel;
[0192] The processing module 403 is also used to perform corresponding operations on the recorded fault data corresponding to the fault of the switch port according to the operation instructions. The operation instructions include one or more of the following: data reading instructions, parameter setting instructions, and data acquisition method configuration instructions.
[0193] In an optional example, the fault repair module 404 is also used to complete the fault repair of the switch port according to the self-recovery operation strategy within a preset time range, wherein the preset time range includes any of the following: at the moment of starting the first link; or, within the time period before performing the uplink warm start operation; or within the preset time period before the uplink starts.
[0194] In an optional example, module 401 is also used to acquire network traffic for each failed switch port;
[0195] The processing module 403 is also used to predict the fault repair time of each faulty switch port based on the fault level of the faulty switch port and the historical fault level repair time record to be acquired.
[0196] The self-recovery priority of each failed switch port is determined based on the network traffic of each failed switch port and the fault repair time of each failed switch port.
[0197] Based on the self-recovery priority, determine the self-recovery sequence for each faulty switch port;
[0198] The fault repair module 404 is also used to complete the fault repair of each faulty switch port according to the self-recovery sequence.
[0199] The switch port fault repair method device in this embodiment is presented in the form of functional modules. Here, a module refers to an application-specific integrated circuit (ASIC), a processor and memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.
[0200] Further functional descriptions of the above modules and units are the same as those in the corresponding embodiments described above, and will not be repeated here.
[0201] This invention provides a switch port fault repair method and apparatus that automatically acquires the switch port type and corresponding actual attribute information, reducing the tedious process of engineers manually collecting and analyzing logs, thereby improving the efficiency of fault diagnosis. By recording actual attribute information and comparing it with target attribute information, port faults can be quickly located, reducing the complexity and time consumption of collecting logs from multiple sources. Due to the automation and systematization of information collection, the analysis of fault causes no longer relies on problem reproduction, reducing the problems of long reproduction cycles and inconsistent reproduction results. Moreover, fragmented information is integrated, making fault analysis more direct and accurate, helping engineers quickly find the root cause of the problem. Furthermore, this solution can automatically determine whether to perform self-recovery operations based on the fault level, improving the automation level of fault handling. By matching the fault level with the self-recovery operation strategy, rapid and appropriate fault repair can be achieved, reducing the need for manual intervention. For environmental or intermittent faults, the system can automatically identify and handle them without affecting overall usage efficiency, thereby improving the stability and reliability of the system. The automated fault handling mechanism helps reduce downtime caused by faults and improves system availability. Automated and intelligent fault handling processes reduce the professional skill requirements for maintenance personnel, thereby reducing training and maintenance costs. Rapid fault location and repair decrease the number of times engineers need to be on-site, further reducing maintenance costs.
[0202] This invention also provides a computer device having the above-described features. Figure 4 The device shown is a method for repairing switch port faults.
[0203] Please see Figure 5 , Figure 5 This is a schematic diagram of the structure of a computer device provided in an optional embodiment of the present invention, such as... Figure 5As shown, the computer device includes one or more processors 10, memory 20, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components communicate with each other via different buses and can be mounted on a common motherboard or otherwise installed as needed. The processors can process instructions executed within the computer device, including instructions stored in or on memory to display graphical information of a GUI on external input / output devices (such as display devices coupled to the interfaces). In some alternative implementations, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple computer devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system). Figure 5 Take a processor 10 as an example.
[0204] Processor 10 may be a central processing unit, a network processor, or a combination thereof. Processor 10 may further include an integrated circuit. The integrated circuit may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The programmable logic device may be a complex programmable logic device (CAMP), a field-programmable gate array (FPGA), a general-purpose array logic (GPRS), or any combination thereof.
[0205] The memory 20 stores instructions executable by at least one processor 10 to cause at least one processor 10 to perform the method shown in the above embodiments.
[0206] The memory 20 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the computer device as shown by a landing page for an app. Furthermore, the memory 20 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some alternative embodiments, the memory 20 may optionally include memory remotely located relative to the processor 10, which can be connected to the computer device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0207] The memory 20 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk or solid-state drive; the memory 20 may also include a combination of the above types of memory.
[0208] The computer device also includes an input device 30 and an output device 40. The processor 10, memory 20, input device 30, and output device 40 can be connected via a bus or other means. Figure 5 Taking the example of a connection between China and Israel via a bus.
[0209] Input device 30 can receive input numerical or character information, and generate key signal inputs related to user settings and function control of the computer device, such as a touchscreen, keypad, mouse, trackpad, touchpad, joystick, one or more mouse buttons, trackball, joystick, etc. Output device 40 may include display devices, auxiliary lighting devices (e.g., LEDs), and haptic feedback devices (e.g., vibration motors). The aforementioned display devices include, but are not limited to, liquid crystal displays, light-emitting diodes, displays, and plasma displays. In some alternative embodiments, the display device may be a touchscreen.
[0210] This invention also provides a computer-readable storage medium. The methods provided in the above embodiments can be implemented in hardware or firmware, or implemented as computer code that can be recorded on a storage medium, or implemented as computer code downloaded over a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and then stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code, which, when accessed and executed by the computer, processor, or hardware, implements the methods shown in the above embodiments.
[0211] A portion of this invention can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide the methods and / or technical solutions according to the invention through the operation of the computer. Those skilled in the art will understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions, or the computer compiling the instructions and then executing the corresponding compiled program, or the computer reading and executing the instructions, or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.
[0212] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.
Claims
1. A method for repairing switch port faults, characterized in that, The method includes: Obtain the type of the switch port and the target attribute information corresponding to each type of switch port; Read and record the actual attribute information corresponding to each type of switch port; When it is determined that the switch port has failed based on the target attribute information and the actual attribute information, the fault level is determined. Based on the fault level, match the self-recovery operation strategy corresponding to the fault level; According to the self-recovery operation strategy, the fault repair of the switch port is completed; When the number of faulty switch ports is multiple, the method further includes: Obtain the network traffic for each of the aforementioned faulty switch ports; Based on the fault level of the faulty switch port and the historical fault level repair time records to be acquired, predict the fault repair time for each of the faulty switch ports. The self-recovery priority of each faulty switch port is determined based on the network traffic of each faulty switch port and the fault repair time of each faulty switch port. Based on the self-recovery priority, determine the self-recovery sequence for each of the faulty switch ports; According to the self-recovery sequence, the fault repair of each of the faulty switch ports is completed.
2. The method according to claim 1, characterized in that, The attribute information corresponding to the switch port includes rate, bandwidth, correctable errors, uncorrectable errors, recovery count, and link status; Determining whether the switch port is faulty based on the target attribute information and the actual attribute information includes: When the actual rate is less than the target rate, it is determined that the switch port has failed. And / or, when the actual bandwidth is less than the target bandwidth, it is determined that the switch port has failed; And / or, when a correctable error exists, determine that the switch port has failed; And / or, when an uncorrectable error exists, determine that the switch port has failed; And / or, if a recovery count exists, determine that the switch port has failed; And / or, when the duration of the link being in an abnormal link state is greater than or equal to a first preset time threshold, it is determined that the switch port has failed.
3. The method according to claim 2, characterized in that, The fault levels include: Level 1 fault, Level 2 fault, Level 3 fault, and Level 4 fault; When it is determined that the switch port has failed based on the target attribute information and the actual attribute information, the fault level is determined, including: When the correctable error exists and the number of correctable errors is less than or equal to a first preset number threshold, and / or when the recovery count exists and the number of recovery counts is less than or equal to a second preset number threshold, the fault level is determined to be a level one fault. Alternatively, when the correctable error exists and the number of correctable errors is greater than the first preset number threshold and less than or equal to the third preset number threshold, and / or when the uncorrectable error exists and the number of uncorrectable errors is less than or equal to the fourth preset number threshold, and / or when the duration of the link being in an abnormal link state is greater than or equal to the first preset time threshold and less than the second preset time threshold, the fault level is determined to be level two. Alternatively, when the actual rate is less than the target rate, and / or when the actual bandwidth is less than the target bandwidth, and / or when the duration of the link being in an abnormal link state is greater than or equal to the second preset time threshold and less than the third preset time threshold, the fault level is determined to be level three. Alternatively, when the duration of the link being in an abnormal link state is greater than or equal to the third preset time threshold.
4. The method according to claim 3, characterized in that, When the fault level is Level 1, the self-recovery operation strategy includes: not performing self-recovery operation; When the fault level is level two, the self-recovery operation strategy includes: disconnecting the previous link, creating a new link, and clearing the counted error reports, which include reports for uncorrectable errors and reports for correctable errors; When the fault level is level three, the self-recovery operation strategy includes: performing a hot restart operation on the downlink device; When the fault level is level four, the self-recovery operation strategy includes: performing a cold restart operation on the downlink device.
5. The method according to claim 4, characterized in that, When the fault repair of the switch port is not completed according to the self-recovery operation strategy, the method further includes: Identify the level at which the self-recovery operation will be performed; When the self-recovery operation level is the highest pre-configured level, a hot restart operation is performed simultaneously on the switch to which the switch port belongs and the peer device that has established a communication connection with the switch, and / or a cold restart operation is performed simultaneously, and the operation records performed on the switch and the peer device are saved.
6. The method according to any one of claims 2 to 4, characterized in that, The method further includes: Obtain operation instructions transmitted through a preset data transmission channel, wherein the preset data transmission channel includes an in-band channel and / or an out-of-band transmission channel; According to the operation instructions, corresponding operations are performed on the recorded fault data corresponding to the fault of the switch port. The operation instructions include one or more of the following: data reading instructions, parameter setting instructions, and data acquisition method configuration instructions.
7. The method according to any one of claims 1-4, characterized in that, The method further includes: Within a preset time range, the fault repair of the switch port is completed according to the self-recovery operation strategy. The preset time range includes any one of the following: at the moment of starting the first link; or, within a time period before performing the uplink warm start operation; or within a preset time period before the uplink is started.
8. A computer device, characterized in that, include: A memory and a processor are communicatively connected, the memory stores computer instructions, and the processor executes the computer instructions to perform the switch port fault repair method according to any one of claims 1 to 7.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing the computer to execute the switch port fault repair method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Switch traffic abnormality alarm method and device
CN111106961A
Fault repair method and device and storage medium
CN113328872A