Optical fiber link recovery method and device, equipment and storage medium

By receiving and classifying recovery events, generating event queues and processing them according to priority, the problem that the target controller cannot complete host link recovery on time during the recovery process is solved, and the link recovery success rate and data transmission stability are improved.

CN120090695APending Publication Date: 2025-06-03INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510272407.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-07
Publication Date
2025-06-03

AI Technical Summary

Technical Problem

In the prior art, the target controller receives multiple recovery requests during the recovery process, resulting in the inability to complete the host link recovery within a specified time, thereby affecting the data storage on the host side.

Method used

By receiving recovery events sent by the working controller and the host side, event classification and sorting are performed, event queues are generated, and each event polls are processed according to the event queue to restore the cluster link and host link of the target controller. The processing priority of cluster events is greater than that of non-cluster events.

Benefits of technology

It realizes that when facing a large number of events, the event is handled in an orderly manner, improves the success rate of fiber link recovery, ensures the stability of data transmission, and facilitates data storage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120090695A_ABST
    Figure CN120090695A_ABST
Patent Text Reader

Abstract

The invention discloses an optical fiber link recovery method and device, equipment and a storage medium, and relates to the technical field of communication, and the method comprises the steps: receiving a cluster event for recovering a cluster link and a non-cluster event for recovering a host link, classifying the events, arranging the events according to the receiving time sequence, generating an event queue, and storing the event queue in a storage medium; then, processing each cluster event and each non-cluster event according to event queue polling, and due to the fact that the events are sequentially processed according to categories and a time sequence, a target controller has a certain processing sequence when processing a large number of events; in each polling, the processing priority of each cluster event is greater than the processing priority of each non-cluster event, so that the cluster events are processed firstly, and then the non-cluster events are processed until all the events are polled according to the category and time sequence, and therefore, on the basis of recovering the cluster link, the processing efficiency of the cluster events is improved. And the host link is recovered in order, and the success rate of recovering the link is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technologies, and in particular, to a fiber optic link recovery method, apparatus, device, and storage medium. Background Art

[0002] Nowadays, with the rise of the Internet entering the big data era, the amount of data has shown an exponential growth, and thus the demand for data access and storage is also increasing. Currently, many industries use external storage to store data. External storage is that the front-end host sends the data to be stored to the external storage disks at the back-end, and the external storage disks serve as storage nodes to store the data to be stored. Among them, the data to be stored needs to be forwarded through a controller, so it is crucial to ensure the stable operation of the controller.

[0003] In the related art, after a target controller fails and recovers, it is necessary to restore the fiber optic links between the target controller and the other controllers and make it join the storage cluster. Therefore, the other controllers send a cluster link recovery request to the target controller, and at the same time, the host end sends a host link recovery request to the target controller. As a result, the target controller restores the two types of links based on the recovery requests. However, when the target controller receives multiple recovery requests, it may fail to complete the host link recovery within the specified time, and then the host link recovery fails, affecting the data storage at the host end. Summary of the Invention

[0004] This application provides a fiber optic link recovery method, apparatus, device, and storage medium to at least solve the problem in the related art that the host link recovery fails and affects the data storage at the host end.

[0005] In a first aspect, this application provides a fiber optic link recovery method, which is applied to a target controller after a failure recovery. The target controller is located in a storage cluster, and the storage cluster further includes at least two working controllers. The method includes:

[0006] Receiving cluster events for restoring the cluster link sent by at least two working controllers;

[0007] Receiving non-cluster events for restoring the host link sent by at least one host end;

[0008] Classifying each cluster event and each non-cluster event and arranging them in the order of the receiving time to generate an event queue; the processing priority of each cluster event is higher than that of each non-cluster event;

[0009] Polling and processing each cluster event and each non-cluster event according to the event queue to restore the cluster link and the host link of the target controller; the cluster link and the host link are fiber optic links.

[0010] In a second aspect, the present application provides an optical fiber link recovery device. The device is located in a target controller after a fault recovery. The target controller is located in a storage cluster, and the storage cluster further includes at least two working controllers, including:

[0011] A receiving module, configured to receive cluster events for recovering the cluster link sent by at least two working controllers;

[0012] The receiving module is further configured to receive non-cluster events for recovering the host link sent by at least one host side;

[0013] A generating module, configured to classify each cluster event and each non-cluster event and arrange them in the order of the receiving time to generate an event queue; the processing priority of each cluster event is higher than that of each non-cluster event;

[0014] A recovery module, configured to poll and process each cluster event and each non-cluster event according to the event queue to recover the cluster link and the host link of the target controller; the cluster link and the host link are optical fiber links.

[0015] In a third aspect, the present application further provides an electronic device, including: a memory, configured to store a computer program; a processor, configured to implement the steps of any of the above optical fiber link recovery methods when executing the computer program.

[0016] In a fourth aspect, the present application further provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above optical fiber link recovery methods are implemented.

[0017] Through a fiber optic link recovery method provided by this application, the target controller after fault recovery is in a powered state and can receive at least one cluster event for recovering the cluster link and a non-cluster event for recovering the host link, where the cluster link and the host link can be used for data transmission; then, classify each event and arrange them in the order of receipt time to generate an event queue. It can be seen that each event in the event queue is classified, and each event category is arranged in the order of receipt time, so that the event queue is in order. Then, poll and process each cluster event and each non-cluster event according to the event queue. Since they are processed in order of category and time, when the target controller faces a large number of event processing, there is a certain order, that is, a rule, so that the target controller can process events in an orderly manner; in each poll, the processing priority of each cluster event is higher than that of each non-cluster event. Therefore, in each poll, first process the cluster events and then process the non-cluster events. This ensures that in each poll, the corresponding cluster link and host link are recovered until all events are polled and processed in order of category and time, thus ensuring that on the basis of recovering the cluster link, the target controller also orderly recovers the host link, thereby improving the success rate of link recovery, improving data transmission, and facilitating data storage. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] To more clearly illustrate the embodiments of this application, the following will briefly introduce the drawings required for the embodiments. Obviously, the drawings in the following description are only some embodiments of this application. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0019] Figure 1 It is a diagram of the application scenario of a fiber optic link recovery method provided by this application;

[0020] Figure 2 It is a schematic diagram of a recovery system provided for Embodiment 1;

[0021] Figure 3 It is a schematic diagram of the flow of a fiber optic link recovery method provided for Embodiment 1;

[0022] Figure 4 It is a schematic diagram of the flow of a fiber optic link recovery method provided for Embodiment 3;

[0023] Figure 5 It is a schematic diagram of an event queue provided for Embodiment 3;

[0024] Figure 6 It is a schematic diagram of the flow of a fiber optic link recovery method provided for Embodiment 4;

[0025] Figure 7 Schematic flowchart of an optical fiber link recovery method provided for Embodiment VII;

[0026] Figure 8 Schematic structural diagram of an optical fiber link recovery device provided in an embodiment of the present application;

[0027] Figure 9 Schematic structural diagram of an electronic device provided by the present application. Specific embodiments

[0028] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the protection scope of the present application.

[0029] It should be noted that in the description of the present application, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements but also includes other elements not explicitly listed, or further includes elements inherent to such process, method, article or device. The terms "first", "second", etc. in the present application are used to distinguish similar objects and are not used to describe a specific order or sequence.

[0030] In the related art, after a certain target controller fails and recovers, it is necessary to restore the optical fiber link between the target controller and the remaining controllers and make it join the storage cluster. Thus, the remaining controllers send a cluster link recovery request to the target controller, and at the same time, the host side in the storage system also sends a host link recovery request to the target controller, so that the target controller restores the two links based on the recovery request. However, when the target controller receives multiple recovery requests, due to accumulation, the target controller may be processing the cluster link recovery request and ignore the host link recovery request, which may cause the host link not to be restored within the request time of the host link recovery request, resulting in the failure of the host link recovery and affecting the data storage on the host side. The above recovery request is an event. In the related art, even when the host side has not restored the host link, the host side can send a host link recovery request to the target controller again to request the restoration of the host link, but there may also be a situation where the host link cannot be restored.

[0031] To address the deficiencies in the related art, this solution has undergone a series of improvements and proposes a fiber optic link recovery method. To solve the problem in the related art where host link recovery fails and affects data storage at the host end, after the target controller in this solution receives two types of events, it classifies each event into cluster events and non-cluster events and arranges them in the order of reception time, thereby generating an event queue. The event queue includes each event. Among them, the event queue is a queue that has been classified and arranged in the order of time. Further, the target controller can poll and process each event in turn according to the event queue. Therefore, it is reflected that both cluster events and non-cluster events need to be processed in each poll, and non-cluster events will not be ignored. Since the processing priority of cluster events is higher than that of non-cluster events, in this solution, the target controller can first process cluster events and then process non-cluster events, thus orderly implementing the processing of each event, reducing the situation where non-cluster events are ignored due to a large number of events accumulating, and then the corresponding host link can be restored in each poll, thereby increasing the success rate of host link recovery, and there is a certain order or rule in the host link recovery process. In this solution, after processing each event, all links can be restored. The links herein refer to cluster links and host links.

[0032] To enable those skilled in the art of this technology to better understand the solution of this application, the following further elaborates on this application in combination with the accompanying drawings and specific implementation manners.

[0033] Combined with the specific application environment architecture or specific hardware architecture on which the execution of the fiber optic link recovery method depends, the specific application environment architecture or specific hardware architecture is described herein. Figure 1 This is an application scenario diagram of a fiber optic link recovery method provided by this application. As Figure 1 shown, it includes: a target controller 101, a working controller 102, and a host end 103.

[0034] Among them, the target controller 101 is the controller after fault recovery and needs to perform the recovery of the fiber optic link.

[0035] Among them, the working controller 102 is the controller that is working properly in the current state.

[0036] Among them, the host end 103 can be a server or a computer, and there is no restriction here. Among them, the host end 103, as a computing node, can generate data.

[0037] In this scenario, the working controller 102 and the host end 103 are one. The working controller 102 generates cluster events for recovering the cluster link and sends them to the target controller 101; the host end 103 generates non-cluster events for recovering the host link and sends them to the target controller 101.

[0038] Further, the target controller 101 classifies based on cluster events and non-cluster events to generate an event queue.

[0039] Further, within the current polling, the target controller 101 first processes the cluster events based on the event queue to restore the corresponding cluster link; then, within the current polling, it processes the non-cluster events to restore the corresponding host link.

[0040] In this scenario, the cluster link refers to the optical fiber link between the target controller 101 and the working controller 102; the host link refers to the optical fiber link between the target controller 101 and the host side 103.

[0041] It should be noted that in practical applications, when there are multiple working controllers 102 or multiple host sides 103, multiple events are generated. The events need to be classified and arranged in the order of receiving time to generate an event queue.

[0042] It should be noted that the target controller of this application is more stable when restoring the optical fiber link, and can automatically, safely, and reliably restore the access service after the optical fiber link is restored.

[0043] It should be noted that classifying each event in this embodiment, that is, implementing a segmented strategy, orderly guarantees the restoration of the optical fiber link and enables the stable restoration of the optical fiber link.

[0044] It should be noted that the polling mechanism adopted in this application can be used to process different types of events within the corresponding preset time slices, and it is also processed in the order of time.

[0045] Embodiment 1

[0046] The execution subject of Embodiment 1 to Embodiment 7 of this application is an optical fiber link restoration device (hereinafter referred to as the restoration device), which is located in the target controller after fault repair, and the target controller is an electronic device.

[0047] The method in this embodiment is applied to the target controller after fault recovery. The target controller is located in the storage cluster, and the storage cluster further includes at least two working controllers.

[0048] Figure 2 A schematic diagram of a restoration system provided for Embodiment 1. As Figure 2 shown, the restoration system includes a storage cluster 201 and a host cluster 204.

[0049] The storage cluster 201 includes a first chassis 202 and a second chassis 203, wherein the first chassis 202 includes a target controller 2021, and the second chassis 203 includes at least two working controllers 2031. It should be noted that in actual applications, each chassis includes at least two controllers. Figure 2 In the following description, two controllers are used in each chassis as an example.

[0050] The controller in the first chassis 202 that is adjacent to the target controller 2021 is the adjacent controller 2022 .

[0051] The host cluster 204 includes multiple host terminals 205 . Figure 2 In the figure, three host ends 205 are taken as an example, but in actual application, a larger number of host ends 205 may be included.

[0052] It should be noted that the working controller 2031 and the adjacent controller 2022 in the storage cluster 201 can be used as control management devices. Alternatively, a control management device is deployed separately in the storage cluster 201 to control and coordinate the entire recovery system.

[0053] Among them, in the first chassis 202, the target controller 2021 and the adjacent controller 2022 are structurally connected through each end of the backplane 2024, and the other end of the backplane 2024 is structurally connected to multiple storage disks 2023; in the second chassis 203, the two working controllers 2031 are structurally connected through each end of the backplane 2032, and the other end of the backplane 2032 is structurally connected to multiple storage disks 2033. Figure 2 In the description, it is taken that each chassis includes two storage disks as an example. In actual applications, each chassis may include a larger number of storage disks.

[0054] Among them, exemplary, Figure 2 Taking a cluster link as an example, a cluster link is formed between the target controller 2021 and a working controller 2031, and other cluster links can also be formed. The other cluster links include cluster links between any two controllers in different chassis, and two cluster links can be formed between any two controllers in different chassis.

[0055] Among them, exemplary, Figure 2 Taking one host link as an example, specifically, a host link is formed between the target controller 2021 and a host terminal 205, and other host links may also be formed. The other host links include the host links formed between the other host terminals 205 and each controller.

[0056] It should be noted that the number of storage disks in each chassis may be the same.

[0057] It should be noted that in practical applications, the storage cluster 201 may further include other chassis, and the number of controllers included in each chassis may be the same.

[0058] It should be noted that the working controller and the target controller in this application are in different chassis.

[0059] Figure 3 It is a schematic flowchart of a fiber optic link recovery method provided for Embodiment 1. As Figure 3 shown, it includes:

[0060] S301, receiving cluster events for recovering the cluster link sent by at least two working controllers.

[0061] Among them, the target controller is located in the target chassis, the working controller is located in the working chassis, and there are at least two working controllers in the working chassis.

[0062] Among them, the target controller refers to the controller after fault recovery.

[0063] Among them, the working controller refers to the controller that is working normally in the other chassis when the target controller recovers from a fault.

[0064] Among them, the controller is a device used to control the data transmission between the host end and the storage disk, and serves as an intermediate device for data transmission.

[0065] Among them, the cluster event is also a request for recovering the link, and is a fiber optic protocol message.

[0066] Among them, the cluster event may include the fiber optic identifier or other information of the corresponding working controller. Among them, the fiber optic identifier refers to the identifier of the fiber optic channel port. It should be noted that the target controller may include multiple fiber optic channel ports, and each fiber optic channel port may form a fiber optic link with the fiber optic channel port of the working controller.

[0067] Among them, the cluster link is a fiber optic link formed between the target controller and the working controller due to the fiber optic channel ports.

[0068] It should be noted that after the target controller recovers from a fault, the user triggers the target controller fault recovery component based on the control and management device, and then the control and management device sends a cluster link recovery instruction to each working controller, so that the working controller generates a cluster event based on the cluster link recovery instruction.

[0069] S302, receiving non-cluster events for recovering the host link sent by at least one host end.

[0070] Among them, the host link is a fiber optic link formed between the target controller and the host end due to the fiber optic channel ports.

[0071] Among them, the optical fiber link can be used for data transmission.

[0072] Among them, the non-cluster event can be an event sent by the host side. The non-cluster event includes the corresponding host optical fiber identifier. Among them, the host optical fiber identifier refers to the identifier of the optical fiber channel port in the host side. In this embodiment, the host optical fiber identifier is specifically the identifier of the optical fiber channel port that sends the non-cluster event in the host side.

[0073] S303. Classify each cluster event and each non-cluster event and arrange them in the order of receiving time to generate an event queue; the processing priority of each cluster event is higher than that of each non-cluster event.

[0074] It should be noted that the events received by the target controller within a certain period of time are messy. Therefore, the target controller can first classify each cluster event and non-cluster event, and for each category, arrange the events in this category in the order of receiving time, so as to generate an event queue. Among them, the event refers to the cluster event and the non-cluster event.

[0075] Among them, the processing priority of the cluster event being higher than that of the non-cluster event means that the target controller processes the cluster event with a higher priority than the non-cluster event.

[0076] It should be noted that one event corresponds to the recovery of one optical fiber link.

[0077] S304. Poll and process each cluster event and each non-cluster event according to the event queue to recover the cluster link and the host link of the target controller; the cluster link and the host link are optical fiber links.

[0078] Among them, polling means that the events included in the event queue are processed in sequence according to the category.

[0079] Exemplarily, assume that one poll processes 3 cluster events and 2 non-cluster events. If the event queue includes 6 cluster events and 3 non-cluster events, then, polling and processing each event according to the event queue, in the first poll, the target controller first processes the 3 cluster events with the earliest priority in the event queue, and then processes the 2 non-cluster events with the earliest priority. At this time, the remaining events are not processed. Then enter the next poll. In the second poll, the target controller first processes the remaining 3 cluster events and can finish processing them, and then processes the remaining 1 non-cluster event, so as to complete the processing of all events in the second poll to achieve polling processing.

[0080] It should be noted that after each event is processed, the optical fiber link corresponding to the event can be recovered.

[0081] It should be noted that what this embodiment aims to achieve is the restoration of the cluster link between the target controller and the working controller, as well as the restoration of the host link between the target controller and the host side. Before the target controller fails, the corresponding cluster link and host link of the target controller are in a normal state and can be used for data transmission. After the target controller fails and recovers, the target controller needs to re - establish the link connection.

[0082] It should be noted that in this embodiment, when a cluster event is received, it can be marked as a high - priority event.

[0083] It should be noted that the target controller is connected to the adjacent controller in the same chassis through the backplane. When the target controller recovers, it automatically makes a physical connection with the backplane, thereby realizing the connection between the target controller and the adjacent controller. In addition, when the target controller realizes the connection with the backplane, it can connect to the corresponding storage disk through the other end of the backplane.

[0084] It should be noted that in this embodiment, two cluster links can be established between the target controller and a working controller to ensure communication between the target controller and the working controller.

[0085] This embodiment provides a method for restoring an optical fiber link. In this embodiment, the target controller after failure recovery is in a powered - on state and can receive at least one cluster event for restoring the cluster link and a non - cluster event for restoring the host link. Among them, the cluster link and the host link can be used for data transmission; then, each event is classified and arranged in the order of reception time to generate an event queue. It can be seen that in the event queue, each event is classified, and in each event category, it is arranged in the order of reception time, so that the event queue is ordered. Then, each cluster event and each non - cluster event are processed by polling according to the event queue. Since the processing is carried out in sequence according to the category and the order of reception time, when the target controller faces a large number of event processing, there is a certain order, that is, a rule, so that the target controller can process events in an orderly manner; in each polling, the processing priority of each cluster event is greater than that of each non - cluster event. Therefore, in each polling process, the cluster events are processed first, and then the non - cluster events are processed. In this way, it is ensured that in each polling, the corresponding cluster link and host link are restored until all events are polled and processed in order according to the category and the order of reception time. Thus, it is ensured that on the basis of restoring the cluster link, the target controller also restores the host link in an orderly manner, thereby improving the success rate of link restoration and improving data transmission.

[0086] Embodiment Two

[0087] This embodiment is a further refinement of the above-mentioned Embodiment 1. This embodiment is an optional way to receive cluster events for restoring cluster links sent by at least two working controllers, including:

[0088] Use a Fibre Channel port to receive cluster events for restoring cluster links sent by at least two working controllers; the cluster event is a Fibre Channel protocol handshake message sent by the Fibre Channel port of the corresponding working controller.

[0089] Specifically, there are multiple Fibre Channel ports on the target controller. When the working controller sends a cluster event, the Fibre Channel port of the target controller that receives the cluster event is included in the cluster event. Then, the target controller uses this Fibre Channel port to receive the cluster event.

[0090] It should be noted that this cluster event is a Fibre Channel protocol handshake message, and thus the handshake message can be sent through two Fibre Channel ports.

[0091] This embodiment is an optional way to receive non-cluster events for restoring host links sent by at least one host end, including:

[0092] Use a Fibre Channel port to receive non-cluster events for restoring host links sent by at least one host end; the non-cluster event is a Fibre Channel protocol handshake message sent by the Fibre Channel port of the corresponding host end.

[0093] Specifically, there are multiple Fibre Channel ports on the target controller. When the host end sends a non-cluster event, the Fibre Channel port of the target controller that receives the non-cluster event is included in the non-cluster event. Then, the target controller uses this Fibre Channel port to receive the non-cluster event.

[0094] It should be noted that this non-cluster event is a Fibre Channel protocol handshake message, and thus the handshake message can be sent through two Fibre Channel ports.

[0095] It should be noted that the distribution of events can be physically implemented through the Fibre Channel port via the Fibre Channel protocol.

[0096] Embodiment 3

[0097] This embodiment is a further refinement of any of the above embodiments. This embodiment is an optional way to classify each cluster event and each non-cluster event and arrange them in the order of reception time to generate an event queue.

[0098] Figure 4 A schematic flow diagram of a Fibre Channel link restoration method provided for Embodiment 3. As Figure 4 shown, it includes:

[0099] S401. For each cluster event, arrange all the cluster events in the order of their respective reception times to generate a cluster event queue; the reception time is the time when the event is received.

[0100] Among them, the cluster event queue includes all the cluster events, and all the cluster events are arranged in the order of their reception times.

[0101] S402. For each non-cluster event, arrange all the non-cluster events in the order of their respective reception times to generate a non-cluster event queue.

[0102] Among them, the non-cluster event queue includes all the non-cluster events, and all the non-cluster events are arranged in the order of their reception times.

[0103] S403. Arrange the cluster event queue in front of the non-cluster event queue to generate an event queue.

[0104] Figure 5 It is a schematic diagram of an event queue provided for Embodiment 3. As Figure 5 shown, the event queue 500 includes a cluster event queue 501 and a non-cluster event queue 502.

[0105] Among them, the cluster event queue 501 includes N cluster events, and the reception times of all the cluster events increase sequentially from left to right.

[0106] Among them, the non-cluster event queue 502 includes M non-cluster events, and the reception times of all the non-cluster events increase sequentially from left to right.

[0107] Among them, the cluster event queue 501 is arranged in front of the non-cluster event queue 502, which means that the processing priority of the cluster event queue 501 is higher than that of the non-cluster event queue 502.

[0108] This embodiment provides a fiber optic link recovery method. In this embodiment, for each type of event, they are arranged in their respective queues in the order of their reception times, and then a cluster event queue and a non-cluster event queue are obtained. Therefore, the order of time is reflected, and it is more orderly; in addition, in the event queue, the cluster event queue is arranged in front of the non-cluster event queue, thereby reflecting that the processing priority of the cluster event queue is higher than that of the non-cluster event queue.

[0109] Embodiment 4

[0110] This embodiment is a further refinement of any of the above embodiments. This embodiment is an optional method for polling and processing each cluster event and each non-cluster event in the event queue to restore the cluster link and host link of the target controller.

[0111] Figure 6 Schematic diagram of a fiber optic link recovery method provided for the fourth embodiment. As Figure 6 shown, it specifically includes:

[0112] S601, within the first polling, process each cluster event in sequence within a preset cluster time slice according to the order in the cluster queue, so as to recover the cluster link corresponding to the processed cluster event.

[0113] Among them, the preset cluster time slice refers to the preset time period for processing cluster events. For example, 2 seconds.

[0114] Specifically, within the first polling, since the processing priority of the cluster queue is higher than that of the non-cluster queue, the target controller first processes the cluster events in the cluster queue.

[0115] First, the target controller processes each cluster event included therein in sequence within the preset cluster time slice. If some cluster events are processed within the preset cluster time slice, then recover the cluster link corresponding to the above-mentioned part of the cluster events.

[0116] S602, after recovering the cluster link corresponding to the processed cluster event, process each non-cluster event in sequence within a preset non-cluster time slice according to the order in the non-cluster queue, so as to recover the host link corresponding to the non-cluster event processed within the first polling.

[0117] Among them, the preset non-cluster time slice refers to the preset time period for processing non-cluster events. For example, 1 second.

[0118] Among them, the preset cluster time slice is greater than the preset non-cluster time slice.

[0119] According to step S601, after recovering the cluster link corresponding to the above-mentioned part of the cluster events, within the first polling, process each cluster event in sequence within the preset non-cluster time slice according to the order in the non-cluster queue. If some non-cluster events are processed within the preset non-cluster time slice, then recover the host link corresponding to the above-mentioned part of the non-cluster events.

[0120] After the first polling, generate a first polling result based on whether the cluster events and non-cluster events are processed.

[0121] S603, in response to the first polling result indicating that there are unprocessed events, enter the next polling to continue processing the events, so as to recover the remaining cluster links and host links of the target controller.

[0122] Among them, the first polling result can be two results: there are unprocessed events and the events are processed.

[0123] It should be noted that if the first polling result indicates that there are unprocessed events, in order to handle all events, polling is continued and processed sequentially to restore the remaining cluster links and host links.

[0124] It should be noted that in this embodiment, a polling mechanism for events in the event queue according to a preset time slice is implemented, and the events are processed according to priorities with the polling scheduling algorithm as the core, which can ensure that different types of events are effectively processed within the corresponding time slices.

[0125] This embodiment provides a method for restoring optical fiber links. In this embodiment, the first polling is first performed to obtain the optical fiber links corresponding to the events after processing. In response to the first polling result indicating that there are unprocessed events, it means that there are still events in the event queue that have not been processed, and then the next polling is entered to restore the remaining cluster links and host links. Therefore, polling is used in this embodiment to process events orderly, avoiding the situation where the target controller is overwhelmed by a large number of events and has no clue to process the events, resulting in the inability to restore the host link; in this embodiment, the cluster link can also be accurately restored, improving the success rate of optical fiber link restoration.

[0126] This embodiment also includes another method:

[0127] This method is an optional way to process each cluster event and each non-cluster event according to the polling of the event queue to restore the cluster link and host link of the target controller, and specifically includes the following steps:

[0128] Step 1: Process each cluster event in sequence according to the order in the cluster queue to restore the cluster link of the target controller.

[0129] Specifically, the processing priority of the target controller for the cluster queue is higher than that of the non-cluster queue. First, each cluster event in the cluster queue is processed in sequence, that is, processed in the order of receiving time, so as to restore the cluster links corresponding to each cluster event.

[0130] Step 2: After processing the cluster events, process each non-cluster event in sequence according to the order in the non-cluster queue to restore the host link of the target controller.

[0131] Specifically, after the target controller finishes processing the cluster events, it then processes each non-cluster event in the non-cluster queue in sequence, so as to restore the host links corresponding to each non-cluster event.

[0132] Embodiment 5

[0133] This embodiment is a further refinement of any of the above embodiments. This embodiment is an optional way to respond to the first polling result indicating that there are unprocessed events, enter the next polling to continue processing the events, and restore the remaining cluster links and host links of the target controller. Specifically, it includes:

[0134] In the next polling, continue to process the unprocessed cluster events in sequence within the preset cluster time slice, and then continue to process the unprocessed non-cluster events in sequence within the preset non-cluster time slice. Continue polling until all events are processed to restore the remaining cluster links and host links of the target controller.

[0135] It should be noted that when the result of the next polling indicates that there are unprocessed events, continue polling until all events are processed, thereby restoring the remaining fiber optic links.

[0136] This embodiment also includes the following several methods:

[0137] Method 1: Respond to the first polling result indicating that there are unprocessed cluster events and non-cluster events, enter the next polling, and continue to process the unprocessed cluster events in sequence within the preset cluster time slice according to the order in the cluster queue to restore the cluster links corresponding to the cluster events processed in this polling; continue to process the unprocessed non-cluster events in sequence within the preset non-cluster time slice according to the order in the non-cluster queue to restore the host links corresponding to the non-cluster events processed in this polling. Continue polling until all events are processed to restore the remaining cluster links and host links.

[0138] Exemplarily, assume that the first polling result indicates that there are 3 unprocessed cluster events and 2 unprocessed non-cluster events, and the above events are arranged in chronological order in the corresponding queues. Then, in the next polling, the target controller processes the remaining unprocessed cluster events (i.e., 3 cluster events) in the cluster queue in chronological order within the preset cluster time slice. Assume that 3 cluster events are processed within the preset cluster time slice, and then the cluster links corresponding to the above 3 cluster events are restored; then the target controller processes the remaining unprocessed non-cluster events (i.e., 2 non-cluster events) in the non-cluster queue in chronological order within the preset non-cluster time slice. Assume that 2 non-cluster events are processed within the preset cluster time slice, and then the host links corresponding to the above 2 non-cluster events are restored. If the cluster events are not processed completely within the preset cluster time slice or the non-cluster events are not processed completely within the preset non-cluster time slice, continue polling until all events are processed.

[0139] Method 2: In response to the first polling result indicating that there are unprocessed non-cluster events, enter the next polling. Process the unprocessed non-cluster events in sequence within the preset non-cluster time slice according to the order in the non-cluster queue, so as to restore the host links corresponding to the non-cluster events processed within this polling. Continue polling until all non-cluster events are processed, so as to restore the remaining host links of the target controller.

[0140] Exemplarily, the first polling result indicates that there are unprocessed non-cluster events (assuming 2 unprocessed non-cluster events), that is, the cluster events have been processed in the first polling. Then enter the next polling. In this polling, only the non-cluster events in the non-cluster queue can be processed. Specifically: Process the unprocessed non-cluster events (i.e., the above 2 non-cluster events) in sequence within the preset non-cluster time slice. Assume that the processing of the above 2 non-cluster events is completed within the preset non-cluster time slice, then restore the host links corresponding to the above 2 non-cluster events; Assume that the above 2 non-cluster events are not processed within the preset non-cluster time slice, and only one non-cluster event with a prior chronological order is processed. Then continue to enter the next polling and continue to process the 1 non-cluster event with a later chronological order until the polling is completed and the host link corresponding to the latter 1 non-cluster event is restored. Therefore, after the first polling, continue polling to restore the remaining host links.

[0141] Method 3: In response to the first polling result indicating that there are unprocessed cluster events, enter the next polling. Continue to process the unprocessed cluster events in sequence within the preset cluster time slice according to the order in the cluster queue. Continue polling until all cluster events are processed, so as to restore the remaining cluster links of the target controller.

[0142] Exemplarily, the first polling result indicates that there are unprocessed cluster events (assuming 3 unprocessed cluster events), that is, the non-cluster events have been processed in the first polling. Then enter the next polling. In this polling, only the cluster events in the cluster queue can be processed. Specifically: Process the unprocessed cluster events (i.e., the above 3 cluster events) in sequence within the preset cluster time slice. Assume that the processing of the above 3 cluster events is completed within the preset cluster time slice, then restore the host links corresponding to the above 3 cluster events; Assume that the above 3 cluster events are not processed within the preset cluster time slice, and only 2 cluster events with a prior chronological order are processed. Then continue to enter the next polling and continue to process the 1 cluster event with a later chronological order until the polling is completed and the cluster link corresponding to the latter 1 cluster event is restored. Therefore, after the first polling, continue polling to restore the remaining cluster links.

[0143] This embodiment provides a method for restoring an optical fiber link. In this embodiment, when the first polling result indicates that there are unprocessed events, the system enters the next polling round and continues to process the unprocessed cluster events in the order of time according to the preset cluster time slice to restore the corresponding cluster link. Then, in this polling round, the unprocessed non-cluster events are processed in the order of time according to the preset non-cluster time slice, thus realizing the processing of events in an orderly manner. Moreover, in this embodiment, in each polling round, both cluster events and non-cluster events are processed, so both are taken into account; in this embodiment, the events are processed in the order of time, so it is orderly; in this embodiment, according to the processing priority, cluster events are processed first and then non-cluster events, so the importance and orderliness of the events are reflected; in this embodiment, the preset cluster time slice and the preset non-cluster time slice are set to implement polling, so that the target controller can complete the number of events that it can process within the specified time slice.

[0144] Embodiment Six

[0145] This embodiment is a further refinement of any of the above embodiments. In this embodiment, the storage cluster further includes a plurality of storage disks.

[0146] This embodiment includes:

[0147] In response to the first polling result indicating that event processing is completed, it is determined that the cluster link and the host link of the target controller are restored.

[0148] This embodiment further includes:

[0149] When the target controller has not determined that the cluster link and the host link are restored, it does not process any access services sent by the host end.

[0150] Among them, the access service includes a data storage service and a data extraction service.

[0151] Among them, the first polling result indicating that event processing is completed means that all events are processed in the first polling. Therefore, it is determined that both the cluster link and the host link of the target controller are restored. At this time, the target controller can determine that it is ready for data transmission.

[0152] This embodiment provides a method for restoring an optical fiber link. In this embodiment, determining that the cluster link and the host link of the target controller are restored means that the target controller is ready for data forwarding and can be used in the access service. In this embodiment, when the target controller has not determined that the cluster link and the host link are restored, even if any host end sends data to be stored to the target controller, the target controller does not process the access service, so the target controller in this embodiment will not cause service congestion.

[0153] This embodiment is an optional method after the cluster link and host link of the target controller are determined to be restored.

[0154] Step 1: Receive the data to be stored sent by any host end; the data to be stored includes the target storage disk identifier.

[0155] Among them, the data to be stored refers to the data to be stored.

[0156] Among them, the target storage disk identifier can be the volume number of the disk.

[0157] Among them, the data to be stored may also include the storage capacity position corresponding to the target storage disk, and the mapping relationship between the host end and the disk.

[0158] Among them, the storage capacity position refers to the position where the data to be stored will be stored in the target storage disk. For example, if the storage capacity position is 100 - 105T, the target controller can send the data to be stored to the 100 - 105T position of the target storage disk for storage.

[0159] Among them, the mapping relationship between the host end and the disk refers to the relationship that the host end can store its own data to be stored in the corresponding disk. If the host end has a mapping relationship with a disk, the host end can store the data to be stored in the disk with the mapping relationship.

[0160] It should be noted that when a host end triggers a storage service and sends a storage request to the control and management device, the control and management device determines the position where the host end will store the data and generates storage configuration information, which includes the data forwarding controller identifier, the target disk identifier, the storage capacity position, and the mapping relationship between the host end and the disk.

[0161] Among them, if the data forwarding controller identifier is the identifier of the target controller in this application, the target controller receives the data to be stored sent by the above host end, and the target controller forwards the data to be stored.

[0162] It should be noted that when the target controller receives the data to be stored, it reads the target storage disk identifier and the mapping relationship between the host end and the disk from the data to be stored, determines whether the host end can store the data to be stored in the target storage disk. If it can, it reads the storage capacity position and stores the data to be stored at the corresponding storage capacity position.

[0163] Step 2: Based on the target storage disk identifier, send the data to be stored to the target storage disk corresponding to the target storage disk identifier for storage; the storage configuration information includes the target storage disk identifier.

[0164] Embodiment Seven

[0165] This embodiment includes an optional method for processing events to restore the corresponding link, specifically:

[0166] Step 1: Obtain the target fiber optic identifiers corresponding to the target controller from the backplane; the backplane is located behind the target controller; there are at least two target fiber optic identifiers.

[0167] Among them, the backplane includes the fiber optic identifiers of the two communicating controllers connected thereto. Among them, the fiber optic identifier includes the slot number and port number of the optical fiber. Under one slot number, there can be multiple port numbers. One port is docked with one fiber channel port, and one fiber channel port can form a fiber optic link with one fiber channel port of another controller.

[0168] It should be noted that in this application, the backplane can store the fiber optic identifiers of each communicating device to ensure that the fiber optic identifiers are permanently saved and not lost.

[0169] Step 2: When processing the current event within a preset time slice, restore the fiber optic link between the fiber channel port corresponding to the target fiber optic identifier and the fiber channel port corresponding to the link fiber optic identifier based on the link fiber optic identifier and the target fiber optic identifier; the link fiber optic identifier is obtained from the current event.

[0170] Specifically: An optional method for restoring the fiber optic link between the fiber channel port corresponding to the target fiber optic identifier and the fiber channel port corresponding to the link fiber optic identifier based on the link fiber optic identifier and the target fiber optic identifier includes:

[0171] Step 1: Perform a fiber optic protocol handshake based on the target fiber optic identifier and the link fiber optic identifier;

[0172] Step 2: If the handshake is successful, the processing is completed, and the fiber optic link between the fiber channel port corresponding to the target fiber optic identifier with a successful handshake and the fiber channel port corresponding to the link fiber optic identifier is restored.

[0173] Among them, the link fiber optic identifier includes the host fiber optic identifier and the working fiber optic identifier.

[0174] Among them, the host fiber optic identifier refers to the identifier corresponding to the fiber channel port on the host side.

[0175] Among them, the fiber optic protocol handshake is a kind of verification, that is, to verify whether the fiber channel port corresponding to the target fiber optic identifier forms a fiber optic link with the fiber channel port corresponding to the link fiber optic identifier.

[0176] Exemplarily, multiple link fiber optic identifiers that communicate with it are stored in the storage space of the target controller. After the target controller obtains its own target fiber optic identifier from the backplane, combined with the multiple link fiber optic identifiers that communicate with it stored in itself, the target controller determines that a fiber optic link is established between the target fiber optic identifier and the above-mentioned multiple link fiber optic identifiers that communicate. Suppose a fiber optic link is established between target fiber optic identifier 1 and link fiber optic identifier 1, then target fiber optic identifier 1 and link fiber optic identifier 1 form a group of fiber optic groups; suppose there are a total of three groups of fiber optic groups, namely target fiber optic identifier 1 and link fiber optic identifier 1, target fiber optic identifier 2 and link fiber optic identifier 2, and target fiber optic identifier 3 and link fiber optic identifier 3.

[0177] Furthermore, the target controller determines the receiving fiber optic identifier corresponding to the cluster event it receives, as well as the link fiber optic identifier in the cluster event, and then performs verification from the above-mentioned multiple groups of fiber optic groups to determine whether there is a fiber optic group in the multiple groups of fiber optic groups that contains the receiving fiber optic identifier corresponding to the link fiber optic identifier in the cluster event. If it contains, the verification is successful, that is, the protocol handshake is successful, and the fiber optic link between the fiber optic channel port corresponding to the target fiber optic identifier and the fiber optic channel port corresponding to the link fiber optic identifier can be restored.

[0178] This embodiment is a further refinement of any of the above embodiments. This embodiment is an optional method of sequentially processing each cluster event within a preset cluster time slice according to the order in the cluster queue to restore the cluster link corresponding to the processed cluster event.

[0179] Figure 7 It is a schematic flowchart of a fiber optic link restoration method provided for Embodiment 7. As Figure 7 shown, it specifically includes:

[0180] S701, obtain the target fiber optic identifier corresponding to the target controller from the backplane; the backplane is located on the back of the target controller.

[0181] S702, when processing the current cluster event within a preset cluster time slice, restore the cluster link between the fiber optic channel port corresponding to the target fiber optic identifier and the fiber optic channel port corresponding to the working fiber optic identifier based on the working fiber optic identifier and the target fiber optic identifier; the working fiber optic identifier is obtained from the current cluster event.

[0182] Among them, the working fiber optic identifier refers to the identifier corresponding to the fiber optic channel port through which the working controller sends the cluster event.

[0183] Specifically, after receiving the cluster event, the target controller reads the included working fiber optic identifier from the cluster event.

[0184] S703 processes the next cluster event in sequence within a preset cluster time slice according to the order in the cluster queue to restore the cluster link corresponding to the processed cluster event.

[0185] This embodiment further includes:

[0186] An optional way to restore the cluster link between the fiber channel ports corresponding to the target fiber identifier and the fiber channel ports corresponding to the working fiber identifier based on the working fiber identifier and the target fiber identifier.

[0187] Step 1: Perform a fiber protocol handshake based on the target fiber identifier and the working fiber identifier.

[0188] Step 2: If the handshake is successful, the process is completed, and the cluster link between the fiber channel ports corresponding to the target fiber identifier with a successful handshake and the fiber channel ports corresponding to the working fiber identifier is restored.

[0189] This embodiment provides a fiber link restoration method. In this embodiment, a fiber protocol handshake is performed according to the target fiber identifier and the working fiber identifier, and then the cluster event can be processed. If the handshake is successful, the corresponding cluster link can be restored, thus ensuring security.

[0190] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases, the former is a better implementation method.

[0191] Figure 8 It is a schematic structural diagram of the fiber link restoration device provided by the embodiment of the present application. As Figure 8 shown, the fiber link restoration device 800 is located in the target controller after failure recovery. The target controller is located in the storage cluster, and the storage cluster further includes at least two working controllers. The fiber link restoration device 800 includes the following modules:

[0192] The receiving module 801 is configured to receive cluster events for restoring the cluster link sent by at least two working controllers;

[0193] The receiving module 801 is further configured to receive non-cluster events for restoring the host link sent by at least one host end;

[0194] The generating module 802 is configured to classify each cluster event and each non-cluster event and arrange them in the order of the receiving time to generate an event queue; the processing priority of each cluster event is higher than that of each non-cluster event;

[0195] A recovery module 803, configured to poll and process each cluster event and each non-cluster event in the event queue to recover the cluster link and the host link of the target controller; the cluster link and the host link are fiber optic links. Optionally, when the receiving module 801 receives cluster events for recovering the cluster link sent by at least two working controllers, it is specifically configured to:

[0196] Receive cluster events for recovering the cluster link sent by at least two working controllers through a fiber channel port; the cluster events are fiber protocol handshake messages sent by the fiber channel ports of the corresponding working controllers;

[0197] When the receiving module 801 receives non-cluster events for recovering the host link sent by at least one host end, it is specifically configured to:

[0198] Receive non-cluster events for recovering the host link sent by at least one host end through a fiber channel port; the non-cluster events are fiber protocol handshake messages sent by the fiber channel ports of the corresponding host ends.

[0199] Optionally, when the generating module 802 classifies each cluster event and each non-cluster event and arranges them in the order of the receiving time to generate an event queue, it is specifically configured to:

[0200] For each cluster event, arrange the cluster events in the order of the receiving times to generate a cluster event queue; the receiving time is the time when the event is received;

[0201] For each non-cluster event, arrange the non-cluster events in the order of the receiving times to generate a non-cluster event queue;

[0202] Arrange the cluster event queue before the non-cluster event queue to generate an event queue.

[0203] Optionally, when the recovery module 803 polls and processes each cluster event and each non-cluster event in the event queue to recover the cluster link and the host link of the target controller, it is specifically configured to:

[0204] In the first poll, process each cluster event in sequence within a preset cluster time slice according to the order in the cluster queue to recover the cluster link corresponding to the processed cluster event;

[0205] After recovering the cluster link corresponding to the processed cluster event, process each non-cluster event in sequence within a preset non-cluster time slice according to the order in the non-cluster queue to recover the host link corresponding to the non-cluster event processed in the first poll;

[0206] In response to the first polling result indicating that there are unprocessed events, enter the next polling to continue processing the events, so as to restore the remaining cluster links and host links of the target controller.

[0207] Optionally, when the recovery module 803 enters the next polling to continue processing the events in response to the first polling result indicating that there are unprocessed events, so as to restore the remaining cluster links and host links of the target controller, it is specifically used for:

[0208] In the next polling, continue to process the unprocessed cluster events in sequence within the preset cluster time slice, and then continue to poll in the steps of processing the unprocessed non-cluster events in sequence within the preset non-cluster time slice until all events are processed, so as to restore the remaining cluster links and host links of the target controller.

[0209] Optionally, in this embodiment, the storage cluster further includes a plurality of storage disks. This embodiment provides an optical fiber link recovery device, further including: a determination module, configured to: in response to the first polling result indicating that the event processing is completed, determine that the cluster link and the host link of the target controller are restored;

[0210] After determining that the cluster link and the host link of the target controller are restored, this embodiment provides an optical fiber link recovery device, further including: a storage module;

[0211] The receiving module 801 is further configured to: receive the data to be stored sent by any host end; the data to be stored includes the target storage disk identifier;

[0212] Wherein, the storage module is configured to send the data to be stored to the target storage disk corresponding to the target storage disk identifier for storage based on the target storage disk identifier; the storage configuration information includes the target storage disk identifier.

[0213] Optionally, when the recovery module 803 processes each cluster event in sequence within the preset cluster time slice according to the order in the cluster queue to restore the cluster link corresponding to the processed cluster event, it is specifically used for:

[0214] Obtain the target optical fiber identifier corresponding to the target controller from the backplane; the backplane is located on the back of the target controller;

[0215] When processing the current cluster event within the preset cluster time slice, restore the cluster link between the optical fiber channel port corresponding to the target optical fiber identifier and the optical fiber channel port corresponding to the working optical fiber identifier based on the working optical fiber identifier and the target optical fiber identifier; the working optical fiber identifier is obtained from the current cluster event;

[0216] Process the next cluster event in sequence according to the order in the cluster queue within a preset cluster time slice to restore the cluster link corresponding to the processed cluster event;

[0217] When the restoration module 803 restores the cluster link between the fiber channel port corresponding to the target fiber identifier and the fiber channel port corresponding to the working fiber identifier based on the working fiber identifier and the target fiber identifier, it is specifically used for:

[0218] Perform a fiber protocol handshake based on the target fiber identifier and the working fiber identifier;

[0219] If the handshake is successful, complete the processing and restore the cluster link between the fiber channel port corresponding to the target fiber identifier and the fiber channel port corresponding to the working fiber identifier.

[0220] For the description of the features in the corresponding embodiment, reference can be made to the relevant description of the corresponding embodiment of the fiber link restoration method, which will not be elaborated here one by one.

[0221] Figure 9 It is a schematic structural diagram of the electronic device provided by the present application. As Figure 9 shown, the electronic device 900 provided in this embodiment includes: at least one processor 901 and a memory 902. Optionally, the electronic device 900 further includes a communication component 903. Among them, the processor 901, the memory 902, and the communication component 903 are connected through a bus 904.

[0222] In the specific implementation process, at least one processor 901 executes the computer execution instructions stored in the memory 902, so that at least one processor 901 executes the above-mentioned fiber link restoration method embodiment.

[0223] For the specific implementation process of the processor 901, reference can be made to the above method embodiment, and its implementation principle and technical effect are similar, which will not be elaborated here in this embodiment.

[0224] In the above embodiment, it should be understood that the processor may be a central processing unit (Central Processing Unit, abbreviated as: CPU), or other general-purpose processors, digital signal processors (Digital Signal Processor, abbreviated as: DSP), application specific integrated circuits (Application Specific Integrated Circuit, abbreviated as: ASIC), etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in combination with the application can be directly implemented by the execution of the hardware processor, or implemented by the combination of the hardware and software modules in the processor.

[0225] The memory may include a Random Access Memory (RAM), and may also include a Non-volatile Memory (NVM), such as at least one disk memory.

[0226] The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the buses in the drawings of this application are not limited to only one bus or one type of bus.

[0227] An embodiment of this application also provides a computer-readable storage medium, in which a computer program is stored. Wherein, the computer program is configured to execute the steps in any of the above embodiments of the optical fiber link recovery method when running.

[0228] In an exemplary embodiment, the above computer-readable storage medium may include, but is not limited to: various media such as a USB flash drive, a Read-Only Memory (ROM), a Random Access Memory (RAM), a mobile hard disk, a magnetic disk, or an optical disc, etc., that can store a computer program.

[0229] An embodiment of this application also provides a computer program product. The above computer program product includes a computer program, and when the computer program is executed by a processor, it implements the steps in any of the above embodiments of the optical fiber link recovery method.

[0230] An embodiment of this application also provides another computer program product, including a non-volatile computer-readable storage medium. The non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it implements the steps in any of the above embodiments of the optical fiber link recovery method.

[0231] Those skilled in the art may further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered as exceeding the scope of this application.

[0232] The above has introduced in detail a fiber optic link recovery method provided by this application. Specific examples are used herein to elaborate on the principle and implementation manner of this application. The description of the above embodiments is only used to help understand the method and its core idea of this application. It should be noted that for those of ordinary skill in the art in this technical field, without departing from the principle of this application, several improvements and modifications can be made to this application, and these improvements and modifications also fall within the protection scope of the claims of this application.

Claims

1. A method for restoring an optical fiber link, characterized in that: The method is applied to a target controller after failure recovery, the target controller is located in a storage cluster, and the storage cluster also includes at least two working controllers, including: receiving a cluster event for restoring a cluster link sent by at least two working controllers; receiving a non-cluster event for restoring a host link sent by at least one host end; Classifying the cluster events and the non-cluster events and arranging them in order of reception time to generate an event queue; the processing priority of the cluster events is greater than the processing priority of the non-cluster events; Each cluster event and each non-cluster event is processed according to the event queue polling to restore the cluster link and the host link of the target controller; the cluster link and the host link are optical fiber links.

2. The method according to claim 1, characterized in that The receiving a cluster event for restoring a cluster link sent by at least two working controllers includes: The fiber channel port is used to receive the cluster event for restoring the cluster link sent by the at least two working controllers; the cluster event is a fiber optic protocol handshake message sent by the fiber channel port of the corresponding working controller; The receiving a non-cluster event for restoring a host link sent by at least one host end includes: The non-cluster event for restoring the host link sent by the at least one host end is received by using a fiber channel port; the non-cluster event is a fiber optic protocol handshake message sent by the fiber channel port corresponding to the host end.

3. The method according to claim 1, characterized in that: The classifying the cluster events and the non-cluster events and arranging them in the order of receiving time to generate an event queue includes: For each of the cluster events, the cluster events are arranged in the order of their reception times to generate a cluster event queue; the reception time is the time when the event is received; For each of the non-cluster events, the non-cluster events are arranged in the order of their reception time to generate a non-cluster event queue; The cluster event queue is arranged before the non-cluster event queue to generate the event queue.

4. The method according to claim 1, characterized in that: The polling and processing of each cluster event and each non-cluster event according to the event queue to restore the cluster link and the host link of the target controller includes: In the first polling, each of the cluster events is processed in sequence within a preset cluster time slice according to the order in the cluster queue, so as to restore the cluster link corresponding to the processed cluster event; After the cluster link corresponding to the processed cluster event is restored, each of the non-cluster events is processed in sequence within a preset non-cluster time slice according to the order in the non-cluster queue to restore the host link corresponding to the non-cluster event processed within the first polling; In response to the first polling result indicating that there are unprocessed events, the next polling is performed to continue processing the events, so as to restore the remaining cluster links and host links of the target controller.

5. The method according to claim 4, characterized in that In response to the first polling result indicating that there is an unprocessed event, entering into the next polling to continue processing the event to restore the remaining cluster links and host links of the target controller includes: In the next polling, the unprocessed cluster events are processed in sequence within the preset cluster time slice, and then the unprocessed non-cluster events are processed in sequence within the preset non-cluster time slice. Polling is continued until all events are processed to restore the remaining cluster links and host links of the target controller.

6. The method according to claim 4, characterized in that The storage cluster also includes a plurality of storage disks, and the method further includes: In response to the first polling result being that event processing is completed, determining that recovery of the cluster link and the host link of the target controller is complete; After determining that the cluster link and host link of the target controller have been restored, the method further includes: Receiving data to be stored sent by any host end; the data to be stored includes a target storage disk identifier; Based on the target storage disk identifier, the data to be stored is sent to the target storage disk corresponding to the target storage disk identifier for storage; the storage configuration information includes the target storage disk identifier.

7. The method according to claim 4, characterized in that The processing of each cluster event in sequence within a preset cluster time slice according to the order in the cluster queue to restore the cluster link corresponding to the processed cluster event includes: Obtaining a target optical fiber identifier corresponding to the target controller from a backplane; the backplane is located at the back of the target controller; When processing the current cluster event within a preset cluster time slice, based on the working fiber identifier and the target fiber identifier, the cluster link between the fiber channel port corresponding to the target fiber identifier and the fiber channel port corresponding to the working fiber identifier is restored; the working fiber identifier is obtained from the current cluster event; Process the next cluster event in sequence within the preset cluster time slice according to the order in the cluster queue to restore the cluster link corresponding to the processed cluster event; The method of restoring the cluster link between the fiber channel port corresponding to the target fiber identifier and the fiber channel port corresponding to the working fiber identifier based on the working fiber identifier and the target fiber identifier includes: Performing a fiber optic protocol handshake based on the target fiber optic identifier and the working fiber optic identifier; If the handshake is successful, the process is completed, and the cluster link between the Fibre Channel port corresponding to the target fiber identifier and the Fibre Channel port corresponding to the working fiber identifier is restored.

8. An optical fiber link recovery device, characterized in that: The device is located in a target controller after failure recovery, and the target controller is located in a storage cluster, and the storage cluster also includes at least two working controllers, including: A receiving module, used for receiving cluster events for restoring cluster links sent by at least two working controllers; The receiving module is further used to receive a non-cluster event for restoring a host link sent by at least one host end; A generating module, used for classifying the cluster events and the non-cluster events and arranging them in order of receiving time to generate an event queue; the processing priority of the cluster events is greater than the processing priority of the non-cluster events; The recovery module is used to process each of the cluster events and each of the non-cluster events according to the event queue polling, so as to recover the cluster link and the host link of the target controller; the cluster link and the host link are optical fiber links.

9. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the optical fiber link recovery method according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the optical fiber link restoration method according to any one of claims 1 to 7.