Port fault detection method and device, electronic equipment and storage medium
By sending a detection message when the channel link communication times out, judging the port recovery conditions and performing recovery actions or determining the fault, the problem of the existing technology that cannot detect ports with unavailable links but not down is solved, and the coverage of fault detection and equipment stability are improved.
Patent Information
- Application Number
- CN202510920930.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-03
- Publication Date
- 2025-10-03
AI Technical Summary
The existing technology can only detect port failures that are DOWN, but cannot detect port failures that are not DOWN but have a link failure, resulting in communication abnormalities.
When the channel link communication times out, the first port sends a probe message to the second port at a preset time interval. Based on the number of probe message transmissions and the reception of loopback messages, the port recovery condition is determined and a recovery action is taken or a fault is determined.
Improves fault detection coverage, can detect and restore ports that are not down but have communication abnormalities, and improves device stability.
Smart Images

Figure CN120750801A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, device, electronic device, and storage medium for detecting a port failure. Background Art
[0002] Currently, most network devices utilize a distributed system design, typically consisting of a main control board (SCC) and multiple service boards. The SCC manages each service board through channels. A channel can be understood as a communication link between different SCCs within the device. A channel provides functions such as control management, protocol communication, information synchronization, and data forwarding. The port used for channel communication is called a channel port. Problems with a channel port can affect inter-board communication, leading to configuration data loss and traffic interruptions. Summary of the Invention
[0003] In view of this, the present application provides a port fault detection method, device, electronic device and storage medium, which can not only detect faults of DOWN ports, but also detect faults of ports with unavailable links.
[0004] According to a first aspect of the present application, a port fault detection method is provided for detecting a fault on a port of a channel link, wherein the port of the channel link includes a first port provided on a processing chip and a second port provided on a switching chip; the method includes:
[0005] When the channel link communication times out, sending a detection message to the second port through the first port at a preset time interval;
[0006] Determining whether a port recovery condition is met based on the number of times the probe message is sent;
[0007] If the port recovery condition is met, performing a recovery action on the first port, and returning to the step of sending a detection message to the second port through the first port at a preset time interval;
[0008] If the port recovery condition is not met, it is determined that the first port is faulty when the number of times the probe message is sent reaches a preset threshold and no loopback message is received from the second port.
[0009] In some possible embodiments, determining whether a port recovery condition is met based on the number of times the probe message is sent includes:
[0010] When the number of times the detection message is sent reaches a preset number and no loopback message is received from the second port, it is determined that the port recovery condition is met.
[0011] In some possible embodiments, performing a recovery action on the first port includes:
[0012] The first port is closed and then opened.
[0013] In some possible embodiments, after determining that the first port is faulty, the method further includes:
[0014] The first port is removed from a list of available ports for the channel.
[0015] In some possible embodiments, the method further includes:
[0016] If a loopback message sent by the second port is received after any one of the detection messages is sent, it is determined that there is no abnormality on the first end;
[0017] In response to the first port not being abnormal, determining whether the first port is in a channel available port list;
[0018] If the first port is not in the channel available port list, add the first port to the channel available port list.
[0019] In some possible embodiments, the method further includes:
[0020] In response to a trigger event for a target port state change, determining the trigger event type, the trigger event type including an active recovery trigger event; the active recovery trigger event refers to a trigger event generated by the target port performing a recovery action;
[0021] When the trigger event is an online trigger event and the type of the trigger event is not the active recovery trigger event, the target port is added to a channel available port list.
[0022] In some possible embodiments, the method further includes:
[0023] In a case where the trigger event is an offline trigger event, the target port is removed from a channel available port list.
[0024] According to a second aspect of the present application, a port fault detection device is provided, the device comprising:
[0025] a message sending module, configured to send a detection message to the second port through the first port at a preset time interval when the channel link communication times out;
[0026] A condition judgment module, configured to determine whether a port recovery condition is met based on the number of times the detection message is sent;
[0027] a port recovery module, configured to, if the port recovery condition is met, perform a recovery action on the first port and return to the step of sending a detection message to the second port through the first port at a preset time interval;
[0028] The fault determination module is configured to determine that the first port is faulty if the port recovery condition is not met and the number of times the detection message is sent reaches a preset threshold and no loopback message is received from the second port.
[0029] In some possible embodiments, the condition judgment module is specifically used to:
[0030] When the number of times the detection message is sent reaches a preset number and no loopback message is received from the second port, it is determined that the port recovery condition is met.
[0031] In some possible embodiments, the port recovery module is specifically configured to:
[0032] The first port is closed and then opened.
[0033] In some possible embodiments, the fault determination module is further configured to:
[0034] The first port is removed from a list of available ports for the channel.
[0035] In some possible embodiments, the fault determination module is further configured to:
[0036] If a loopback message sent by the second port is received after any one of the detection messages is sent, it is determined that there is no abnormality on the first end;
[0037] In response to the first port not being abnormal, determining whether the first port is in a channel available port list;
[0038] If the first port is not in the channel available port list, add the first port to the channel available port list.
[0039] In some possible embodiments, the fault determination module is further configured to:
[0040] In response to a trigger event for a target port state change, determining the trigger event type, the trigger event type including an active recovery trigger event; the active recovery trigger event refers to a trigger event generated by the target port performing a recovery action;
[0041] When the trigger event is an online trigger event and the type of the trigger event is not the active recovery trigger event, the target port is added to a channel available port list.
[0042] In some possible embodiments, the fault determination module is further configured to:
[0043] In a case where the trigger event is an offline trigger event, the target port is removed from a channel available port list.
[0044] According to a third aspect of the present application, an electronic device is provided, comprising: a processor, a memory, and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the port fault detection method described in the first aspect is performed.
[0045] According to a fourth aspect of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the port fault detection method described in the first aspect is executed.
[0046] The port fault detection method, device, electronic device and storage medium provided in the present application can send a probe message to the second port at a preset time interval through the first port when the channel link communication times out; then determine whether the port recovery condition is met based on the number of times the probe message is sent; if the port recovery condition is met, perform a recovery action on the first port, and return to the step of sending a probe message to the second port at a preset time interval through the first port; if the port recovery condition is not met, determine that the first port is faulty when the number of times the probe message is sent reaches a preset threshold and no loopback message is received from the second port.
[0047] In this way, not only can fault detection be performed on DOWN ports, but for ports that are not DOWN but cannot transmit files normally, an attempt to recover the port will be made first if the port recovery conditions are met. If the port is still abnormal after the recovery action, the port is determined to be faulty. Then, ports that are not DOWN but have communication abnormalities can be detected, thereby improving the coverage of fault detection, adding an escape mechanism, and helping to improve the stability of the equipment.
[0048] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following briefly introduces the drawings required for use in the embodiments. The drawings herein are incorporated into and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and, together with the specification, are used to illustrate the technical solutions of the present disclosure. It should be understood that the following drawings only illustrate certain embodiments of the present disclosure and should not be regarded as limiting the scope. For those of ordinary skill in the art, other relevant drawings can be obtained based on these drawings without inventive effort.
[0050] Figure 1 is a schematic diagram of a channel link in an electronic device shown in an exemplary embodiment of the present application;
[0051] Figure 2 This is a flow chart of a method for detecting a port failure according to an exemplary embodiment of the present application;
[0052] Figure 3 is a flow chart of another method for detecting a port failure according to an exemplary embodiment of the present application;
[0053] Figure 4 This is a schematic diagram of a process for processing port event reporting shown in an exemplary embodiment of the present application;
[0054] Figure 5 This is a structural diagram of a port fault detection device shown in an exemplary embodiment of the present application;
[0055] Figure 6 It is a structural diagram of an electronic device shown in an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0056] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
[0057] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. As used in this application and the appended claims, the singular forms "a," "an," "the," and "the" are intended to include the plural forms, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
[0058] It should be understood that although the terms first, second, third, etc. may be used in this application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0059] The term "and / or" herein simply describes an association relationship, indicating that three relationships can exist. For example, A and / or B can represent the existence of A alone, the simultaneous existence of A and B, and the existence of B alone. In addition, the term "at least one" herein refers to any combination of at least two of any one or more of a plurality of items. For example, "at least one of A, B, and C" can represent any one or more elements selected from the set consisting of A, B, and C.
[0060] Electronic devices typically contain multiple physical ports. To increase network bandwidth and load balancing, link aggregation is often used on electronic devices. Multiple physical ports on an electronic device are grouped into a link aggregation group, which forwards service packets from the electronic device. Each physical port is a member port of the link aggregation group.
[0061] For example, network equipment usually includes a main control board and multiple service boards. The main control board can manage each service board through channels. Figure 1 As shown, the main control board can include a main control chip and a switching chip, and the service board can include a service chip. The switching chip is mainly used to implement data forwarding and routing. The main control chip can implement data communication and control, system coordination and management, and signal processing and conversion.
[0062] It should be noted that for different application scenarios, the business board can be a circuit board that implements different business functions in the target scenario. Figure 1 The channel link situation in the figure is merely illustrative. In other embodiments, the electronic device may include multiple main control boards and multiple service boards, so that there are more link combinations.
[0063] Specifically, port 0 and port 2 form channel link 1, port 1 and port 3 form channel link 2, and port 4 and port 5 form channel link 3. It is understood that in actual applications, link 1 and link 3 can be used in combination, and link 2 and link 3 can also be used in combination, without specific limitations. It is understood that ports used for channel link communication are called channel ports. When a channel port has problems, it can affect inter-board communication, resulting in configuration data loss, traffic interruption, and other problems.
[0064] Research has found that current port detection methods can only detect when a port is down. That is, packets will not be routed through that port unless it is down. When a port is abnormal (i.e., the port is not down, but traffic is blocked), packets cannot avoid the abnormal port and may still be routed through it, causing packet transmission problems.
[0065] A message is a unit of data exchanged and transmitted on a network, a block of data that a station sends at one time. A message contains the complete data to be sent and has an unlimited and variable length.
[0066] Based on the above research, an embodiment of the present application provides a method for detecting port failure, which can send a probe message to the second port through the first port at a preset time interval when the channel link communication times out; then determine whether the port recovery condition is met based on the number of times the probe message is sent; if the port recovery condition is met, perform a recovery action on the first port, and return to the step of sending a probe message to the second port through the first port at a preset time interval; if the port recovery condition is not met, it is determined that the first port is faulty when the number of times the probe message is sent reaches a preset threshold and no loopback message is received from the second port.
[0067] The port fault detection method provided in the embodiment of the present application can not only realize fault detection of the DOWN port, but also for the port that is not DOWN but cannot transmit files normally, if the port recovery conditions are met, the recovery action is first attempted. If the abnormality still occurs after the recovery action, the port fault is determined, and then the port that is not DOWN but has communication abnormalities can be detected, thereby improving the coverage of fault detection, adding an escape mechanism, and helping to improve the stability of the equipment.
[0068] To facilitate understanding of this embodiment, the execution entity of the port fault detection method provided in the embodiment of the present disclosure is first introduced in detail. The execution entity of the port fault detection method provided in the embodiment of the present disclosure is an electronic device. The electronic device can be a terminal device or a server. The terminal device can be a mobile device, a user terminal, a handheld device, a computing device, a wearable device, etc. The server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud storage, big data, and artificial intelligence platforms.
[0069] In other implementations, the port failure detection method may also be implemented by a processor calling computer-readable instructions stored in a memory.
[0070] The following describes in detail the port fault detection method provided in the embodiment of the present application with reference to the accompanying drawings.
[0071] See also Figure 2 The figure shows a flow chart of a port fault detection method provided in an embodiment of the present application. The method is used to detect faults on the ports of the aforementioned channel link. The ports of the channel link include a first port provided on a processing chip and a second port provided on a switching chip. The processing chip can be the aforementioned main control chip or service chip. The method includes the following steps S101 to S104:
[0072] S101 : When the channel link communication times out, send a detection message to the second port through the first port at a preset time interval.
[0073] For example, the processing chip may send a heartbeat signal to the second port via the first port, and if no reply signal is received within a preset time, determine that the communication of the channel link has timed out. For example, the preset time may be 20 seconds, 30 seconds, etc. In other embodiments, the preset time may be determined based on actual needs and is not specifically limited.
[0074] Heartbeat signals are a mechanism used in communication systems to monitor link status. They periodically send small data packets and confirm responses to determine whether a connection is up. Their core function is to identify link disconnections caused by extended periods of inactivity. Signals are typically sent at intervals no greater than a specified interval to prevent firewalls from misjudging them as failures. In other words, heartbeat signals are used to determine whether both connected parties are still online after extended periods of inactivity, or whether the communication link between them has been disconnected.
[0075] A probe message refers to a message used to implement a detection function. In the event of a channel link communication timeout, a probe message can be sent to the second port through the first port at a preset time interval. If a loopback message returned by the second port is received after sending the probe message, it is determined that the channel link connection is normal, that is, the status of the first port and the second port are normal.
[0076] For example, please refer again to Figure 1 When the processing chip is a main control chip, the first port can be port 0 or port 1, and correspondingly, the second port can be port 2 or port 3; when the processing chip is a service chip, the first port can be port 5, and the second port can be port 4.
[0077] In addition, the preset time interval can be set according to actual needs and is not specifically limited here.
[0078] S102: Determine whether a port recovery condition is met based on the number of times the detection message is sent.
[0079] Exemplarily, the port recovery condition may be determined to be satisfied when the number of probe message transmissions reaches a preset number and no loopback message is received from the second port. That is, determining whether the port recovery condition is satisfied based on the number of probe message transmissions may include determining that the port recovery condition is satisfied when the number of probe message transmissions reaches a preset number and no loopback message is received from the second port.
[0080] Among them, the preset number of times may include at least one numerical value, for example, the preset number of times may include 3 times, or the preset number of times may include 3 times and 5 times, or the preset number of times may include 4 times, 6 times or 7 times, that is, the number of numerical values included in the preset number of times and the size of the numerical values can be determined according to actual needs.
[0081] For example, when the preset number of times includes 3 times and 5 times, when the third detection message is sent through the first port and the loopback message of the second port is not received, it is determined that the port recovery condition is met; when the fifth detection message is sent through the first port and the loopback message of the second port is not received, it is determined that the port recovery condition is met.
[0082] S103: If the port recovery condition is met, perform a recovery action on the first port and return to step S101.
[0083] If the detection message has been sent several times but no loopback message has been received, it indicates that there may be a problem with the communication of the first port, and the port recovery condition is met, and a recovery action needs to be performed on the first port. After the recovery action is completed, the process returns to step S101 and continues to send the detection message.
[0084] Exemplarily, performing a recovery operation on the first port may include closing and then reopening the first port, i.e., restarting the first port. It is understandable that since the first port is directly connected to the second port, performing a recovery operation on the first port is equivalent to performing a recovery operation on the second port.
[0085] S104: If the port recovery condition is not met, when the number of times the probe message is sent reaches a preset threshold and no loopback message is received from the second port, determine that the first port is faulty.
[0086] If the port recovery condition is not met, it indicates that the number of detection messages sent may not reach the preset threshold, or the loopback message of the second port has been received. If the loopback message of the second port has been received, it indicates that there is no abnormality in the channel link.
[0087] If the port recovery condition is not met and the number of probe message transmissions reaches a preset threshold, but no loopback message is received from the second port, then the first port is faulty. The value corresponding to the preset threshold is greater than the value corresponding to the preset number of transmissions. For example, the preset threshold may be 10 times, and the preset number of transmissions may be 5 times.
[0088] It should be noted that the preset threshold and the preset number of times are not specifically limited and can be determined according to actual needs, as long as the value corresponding to the preset threshold is greater than the value corresponding to the preset number of times.
[0089] If the number of probe messages sent exceeds the maximum number of probes (preset threshold) and no loopback message is received, the port probe timeout condition is considered met (because probe messages are sent at intervals, when the maximum number of times is reached, the time also reaches the preset time threshold). It can be determined that the communication capability of the first port is completely abnormal and the first port needs to be removed from the channel's available port list. If a loopback message is received within the probe period, the first port is considered a valid port and can be added to the channel's available port list.
[0090] Therefore, in some embodiments, the method may further include: after determining that the first port is faulty, removing the first port from the channel available port list, so that the faulty port can be removed in a timely manner to ensure communication stability.
[0091] See also Figure 3 FIG. 2 is a flow chart of another method for detecting a port failure according to an embodiment of the present application. In this embodiment, the method includes the following steps S201 to S205:
[0092] S201 : When a channel link communication times out, send a detection message to the second port through the first port at a preset time interval.
[0093] This step is similar to the aforementioned step S101 and will not be described again here.
[0094] S202, determining whether a port recovery condition is met based on the number of times the probe message is sent; if so, executing step S203; if not, executing step S204.
[0095] This step is similar to the aforementioned step S102 and will not be repeated here.
[0096] S203: Perform a recovery operation on the first port and return to step S201.
[0097] This step is similar to the aforementioned step S103 and will not be described again here.
[0098] S204, determining whether the number of times the probe message is sent reaches a preset threshold; if so, executing step S205; if not, executing step S201.
[0099] For example, if the port recovery condition is not met, it is necessary to determine whether the number of times the message has been sent has reached a preset threshold. If not, it is necessary to continue sending until the preset threshold is reached.
[0100] S205: If no loopback message is received from the second port, determine that the first port is faulty.
[0101] If the number of detection messages sent reaches a preset threshold and no loopback message is received from the second port, it indicates that the first port is faulty.
[0102] It should be understood that after any detection message is sent, if a loopback message is received from the second port, it can be determined that there is no abnormality in the first port, that is, although the channel link communication has timed out, there is no abnormality in the first port. At this time, it can be determined whether the first port is in the channel available port list; if the first port is not in the channel available port list, the first port can be added to the channel available port list, which can ensure that the first port can be used normally, and thus avoid the situation where the first port is unavailable due to misjudgment or misoperation, which is conducive to improving resource utilization.
[0103] In some embodiments, the method further comprises:
[0104] In response to a trigger event for a state change of a target port, determining a trigger event type, the trigger event type including an active recovery trigger event; the active recovery trigger event is a trigger event generated by a recovery action performed by the target port (e.g., a trigger event generated by a recovery action performed on a first port);
[0105] When the trigger event is an online trigger event and the type of the trigger event is not the active recovery trigger event, adding the target port to a channel available port list;
[0106] In a case where the trigger event is an offline trigger event, the target port is removed from a channel available port list.
[0107] The target port can be any port in a channel link of an electronic device. An online event refers to an event indicating that the target port changes from an unavailable state to an available state. A offline trigger event refers to a change event indicating that the target port changes from an available state to an unavailable state (e.g., offline).
[0108] Here, see Figure 4 The channel available port list needs to respond to the port UP (online) and DOWN (offline or disconnected) event reporting. At the same time, the UP and DOWN response processes need to distinguish whether it is an active online process caused by a recovery action or a passive DOWN and UP process caused by link problems.
[0109] Therefore, for the event report of the target port, when the event is an online trigger (UP) event, if the UP is not caused by active recovery action, then the port is directly added to the channel available port list. If the UP is caused by active recovery, it is not directly added to the channel available port list, but needs to be added according to the above detection process (Figure 2 or Figure 3 The method flow in ( ) determines whether to add the port to the available port list. If a DOWN event is triggered for the target port, the port is directly removed from the available port list.
[0110] Those skilled in the art will understand that in the above-mentioned method of the specific implementation method, the writing order of each step does not mean a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of each step should be determined by its function and possible internal logic.
[0111] Based on the same technical concept, the embodiment of the present disclosure also provides a port fault detection device corresponding to the port fault detection method. Since the principle of solving the problem by the device in the embodiment of the present disclosure is similar to the above-mentioned port fault detection method in the embodiment of the present disclosure, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0112] Reference Figure 5 FIG2 is a schematic diagram of a port fault detection device provided by an embodiment of the present disclosure. The port fault detection device 500 is used to detect faults on a port of a channel link, wherein the port of the channel link includes a first port provided on a processing chip and a second port provided on a switching chip; the device includes:
[0113] A message sending module 501 is configured to send a detection message to the second port through the first port at a preset time interval when the channel link communication times out;
[0114] A condition judgment module 502 is used to determine whether a port recovery condition is met based on the number of times the probe message is sent;
[0115] A port recovery module 503 is configured to perform a recovery action on the first port if the port recovery condition is met, and return to the step of sending a detection message to the second port through the first port at a preset time interval;
[0116] The fault determination module 504 is configured to determine that the first port is faulty if the port recovery condition is not met and the number of times the probe message is sent reaches a preset threshold and no loopback message is received from the second port.
[0117] In some possible embodiments, the condition determination module 502 is specifically configured to:
[0118] When the number of times the detection message is sent reaches a preset number and no loopback message is received from the second port, it is determined that the port recovery condition is met.
[0119] In some possible embodiments, the port recovery module 503 is specifically configured to:
[0120] The first port is closed and then opened.
[0121] In some possible embodiments, the fault determination module 504 is further configured to:
[0122] The first port is removed from a list of available ports for the channel.
[0123] In some possible embodiments, the fault determination module 504 is further configured to:
[0124] If a loopback message sent by the second port is received after any one of the detection messages is sent, it is determined that there is no abnormality on the first end;
[0125] In response to the first port not being abnormal, determining whether the first port is in a channel available port list;
[0126] If the first port is not in the channel available port list, add the first port to the channel available port list.
[0127] In some possible embodiments, the fault determination module 504 is further configured to:
[0128] In response to a trigger event for a target port state change, determining the trigger event type, the trigger event type including an active recovery trigger event; the active recovery trigger event refers to a trigger event generated by the target port performing a recovery action;
[0129] When the trigger event is an online trigger event and the type of the trigger event is not the active recovery trigger event, the target port is added to a channel available port list.
[0130] In some possible embodiments, the fault determination module 504 is further configured to:
[0131] In a case where the trigger event is an offline trigger event, the target port is removed from a channel available port list.
[0132] It should be noted that the device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present application. A person of ordinary skill in the art can understand and implement the present invention without inventive effort.
[0133] Based on the same technical concept, the embodiment of the present disclosure also provides an electronic device. Figure 6 6 is a schematic diagram of the structure of an electronic device 600 provided in an embodiment of the present disclosure, including a processor 601, a memory 602, and a bus 603. The memory 602 is used to store execution instructions and includes a memory 6021 and an external memory 6022. The memory 6021 is also referred to as internal memory and is used to temporarily store operation data in the processor 601 and data exchanged with an external memory 6022 such as a hard disk. The processor 601 exchanges data with the external memory 6022 through the memory 6021.
[0134] In the embodiment of the present application, the memory 602 is specifically used to store application code for executing the solution of the present application, and the execution is controlled by the processor 601. That is, when the electronic device 600 is running, the processor 601 communicates with the memory 602 via the bus 603, so that the processor 601 executes the application code stored in the memory 602, thereby performing the method described in any of the aforementioned embodiments.
[0135] Among them, the memory 602 can be, but is not limited to, random access memory (RAM), read only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), etc.
[0136] The processor 601 may be an integrated circuit chip with signal processing capabilities. The above-mentioned processor may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The various methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0137] It is understood that, when the electronic device 600 is the same device as the aforementioned electronic device, the processor 601 may be the aforementioned processing chip, or may exist independently of the aforementioned processing chip, without limitation. In addition, the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 600. In other embodiments of the present application, the electronic device 600 may include more or fewer components than shown, or combine certain components, or split certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0138] The present disclosure also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, executes the steps of the scheduling method for a simulated robot in the above-mentioned method embodiment. The storage medium may be a volatile or non-volatile computer-readable storage medium.
[0139] The embodiments of the present disclosure also provide a computer program product, which carries program code. The instructions included in the program code can be used to execute the steps of the scheduling method of the simulation robot in the above method embodiment. For details, please refer to the above method embodiment and will not be repeated here.
[0140] The computer program product may be implemented in hardware, software, or a combination thereof. In one embodiment, the computer program product is implemented as a computer storage medium. In another embodiment, the computer program product is implemented as a software product, such as a software development kit (SDK).
[0141] In addition, embodiments of the subject matter and functional operations described in this specification may be implemented in the following: digital electronic circuits, tangibly embodied computer software or firmware, computer hardware including the structures disclosed in this specification and their structural equivalents, or a combination of one or more thereof. Embodiments of the subject matter described in this specification may be implemented as one or more computer programs, i.e., one or more modules of computer program instructions encoded on a tangible, non-transitory program carrier to be executed by a data processing device or to control the operation of the data processing device. Alternatively or additionally, the program instructions may be encoded on an artificially generated propagation signal, such as a machine-generated electrical, optical, or electromagnetic signal, which is generated to encode information and transmit it to a suitable receiver device for execution by the data processing device. The computer storage medium may be a machine-readable storage device, a machine-readable storage substrate, a random or serial access memory device, or a combination of one or more thereof.
[0142] The processes and logic flows described in this specification can be performed by one or more programmable computers executing one or more computer programs to perform the corresponding functions by operating on input data and generating output. The processes and logic flows can also be performed by, and apparatus can be implemented as, special purpose logic circuitry, such as an FPGA (field programmable gate array) or an ASIC (application-specific integrated circuit).
[0143] Computers suitable for executing computer programs include, for example, general-purpose and / or special-purpose microprocessors, or any other type of central processing unit. Typically, the central processing unit will receive instructions and data from a read-only memory and / or random access memory. The basic components of a computer include a central processing unit for implementing or executing instructions and one or more memory devices for storing instructions and data. Typically, a computer will also include one or more mass storage devices for storing data, such as magnetic disks, magneto-optical disks, or optical disks, or the computer will be operably coupled to such mass storage devices to receive data from them or to transmit data to them, or both. However, a computer does not necessarily have such devices. In addition, a computer can be embedded in another device, such as a mobile phone, a personal digital assistant (PDA), a mobile audio or video player, a game console, a global positioning system (GPS) receiver, or a portable storage device such as a universal serial bus (USB) flash drive, to name a few.
[0144] Computer-readable media suitable for storing computer program instructions and data include all forms of non-volatile memory, media, and storage devices, including, for example, semiconductor memory devices (e.g., EPROM, EEPROM, and flash memory devices), magnetic disks (e.g., internal hard disks or removable disks), magneto-optical disks, and CD ROM and DVD-ROM disks. The processor and memory can be supplemented by, or incorporated in, special purpose logic circuitry.
[0145] Although this specification includes many specific implementation details, these should not be interpreted as limiting the scope of any invention or the scope of protection claimed, but are mainly used to describe the features of specific embodiments of specific inventions. Certain features described in multiple embodiments within this specification may also be implemented in combination in a single embodiment. On the other hand, the various features described in a single embodiment may also be implemented separately in multiple embodiments or in any suitable sub-combination. In addition, although features may work in certain combinations as described above and even initially claimed as such, one or more features from the claimed combination may be removed from the combination in some cases, and the claimed combination may point to a sub-combination or a variation of the sub-combination.
[0146] Similarly, although operations are depicted in a particular order in the accompanying drawings, this should not be understood as requiring that these operations be performed in the particular order shown or performed sequentially, or that all illustrated operations be performed to achieve the desired results. In some cases, multitasking and parallel processing may be advantageous. In addition, the separation of various system modules and components in the above-described embodiments should not be understood as requiring such separation in all embodiments, and it should be understood that the described program components and systems can generally be integrated together in a single software product, or packaged into multiple software products.
[0147] Thus, specific embodiments of the subject matter have been described. Other embodiments are within the scope of the following claims. In some cases, the actions recited in the claims can be performed in a different order and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the particular order shown or sequential sequence to achieve the desired results. In some implementations, multitasking and parallel processing may be advantageous.
[0148] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A method for detecting a port failure, characterized in that: The method is used to detect faults on ports of a channel link, wherein the ports of the channel link include a first port provided on a processing chip and a second port provided on a switching chip; the method includes: When the channel link communication times out, sending a detection message to the second port through the first port at a preset time interval; Determining whether a port recovery condition is met based on the number of times the probe message is sent; If the port recovery condition is met, performing a recovery action on the first port, and returning to the step of sending a detection message to the second port through the first port at a preset time interval; If the port recovery condition is not met, it is determined that the first port is faulty when the number of times the probe message is sent reaches a preset threshold and no loopback message is received from the second port.
2. The method according to claim 1, characterized in that The determining whether a port recovery condition is met based on the number of times the probe message is sent includes: When the number of times the detection message is sent reaches a preset number and no loopback message is received from the second port, it is determined that the port recovery condition is met.
3. The method according to claim 1, characterized in that The performing a recovery operation on the first port includes: The first port is closed and then opened.
4. The method according to claim 1, wherein After determining that the first port is faulty, the method further includes: The first port is removed from a list of available ports for the channel.
5. The method according to claim 1, wherein The method further comprises: If a loopback message sent by the second port is received after any one of the detection messages is sent, it is determined that there is no abnormality on the first end; In response to the first port not being abnormal, determining whether the first port is in a channel available port list; If the first port is not in the channel available port list, add the first port to the channel available port list.
6. The method according to claim 1, characterized in that The method further comprises: In response to a trigger event for a target port state change, determining the trigger event type, the trigger event type including an active recovery trigger event; the active recovery trigger event refers to a trigger event generated by the target port performing a recovery action; When the trigger event is an online trigger event and the type of the trigger event is not the active recovery trigger event, the target port is added to a channel available port list.
7. The method according to claim 6, characterized in that The method further comprises: In a case where the trigger event is an offline trigger event, the target port is removed from a channel available port list.
8. A port fault detection device, characterized in that: The device is used to detect faults on ports of a channel link, wherein the ports of the channel link include a first port provided on a processing chip and a second port provided on a switching chip; the device includes: a message sending module, configured to send a detection message to the second port through the first port at a preset time interval when the channel link communication times out; A condition judgment module, configured to determine whether a port recovery condition is met based on the number of times the detection message is sent; a port recovery module, configured to, if the port recovery condition is met, perform a recovery action on the first port and return to the step of sending a detection message to the second port through the first port at a preset time interval; The fault determination module is configured to determine that the first port is faulty if the port recovery condition is not met and the number of times the detection message is sent reaches a preset threshold and no loopback message is received from the second port.
9. An electronic device, characterized in that: include: A processor, a memory, and a bus, wherein the memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor and the memory communicate via the bus. When the machine-readable instructions are executed by the processor, the port fault detection method according to any one of claims 1 to 7 is performed.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for detecting a port failure according to any one of claims 1 to 7 is executed.