A remote link repair method, device, computer equipment and storage medium
By detecting, repairing, and rebuilding remote links, the problem of remote replication link failures was solved, link stability and data transmission reliability were achieved, and maintenance costs were reduced.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- INSPUR SUZHOU INTELLIGENT TECH CO LTD
- Filing Date
- 2023-08-18
- Publication Date
- 2026-05-29
AI Technical Summary
Existing remote replication links are prone to data I/O transmission anomalies and link failures caused by excessive changes to connection configurations during use, leading to link collapse and affecting the stability of remote replication services.
The remote link is detected by a polling program and a link anomaly detection program. Faults are responded to and repaired by disconnecting the original link, destroying threads and releasing memory resources, creating new threads and allocating new memory resources, and re-establishing the link to ensure that the new link is consistent with the original link.
It enables the stable restoration of remote links, ensuring the continuity of remote replication services and the reliability of data transmission, while reducing maintenance costs.
Smart Images

Figure CN117135115B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a remote link repair method, apparatus, computer device, and storage medium. Background Technology
[0002] The rapid growth of data and the demands for high availability and security have spurred the development of storage technology. Storage technology has become a key element of internet infrastructure, and storage networks provide an effective hardware foundation for massive data storage and sharing. Faced with massive amounts of data, data protection and disaster recovery are becoming increasingly important. However, traditional data protection methods, such as tape backup, have drawbacks such as large backup windows, long recovery times, poor real-time response, and disruption to normal business operations, making them inadequate for current needs. Online remote disk replication and data redundancy have become popular data protection technologies.
[0003] Data replication creates a usable copy of the data in real time in another location. This copy can be used immediately without data recovery. The biggest advantage of data replication is that the copied data is immediately available, with no data recovery time, resulting in excellent RTO (Recovery Time Object). Simultaneously, because it's real-time replication, RPO (Recovery Point Time) is also excellent, with virtually no data loss. RTO refers to the time required for an information system to recover from a disaster to a workable state, measuring the business recovery capability of the disaster recovery system; RPO refers to the maximum amount of data loss that a business system can tolerate during a disaster, measuring the data redundancy backup capability of the disaster recovery system. The disadvantage is that the cost is far higher than data backup. This is not only due to the higher price of the data replication system, but also the need for additional hard drive storage space, host systems, and even the establishment of additional remote data centers, along with network cabling, all of which significantly increase costs. Therefore, the construction and maintenance costs of data replication are far greater than those of data backup.
[0004] Currently, remote replication can utilize various link types, such as IP (Internet Protocol) links or FC (Fibre Channel) links. Generally, IP links are more suitable for longer distances, and with the rapid improvement in network speeds, they can meet the bandwidth and speed requirements of remote replication links. Furthermore, IP links are less expensive and easier to set up. However, during use, IP remote replication links may experience link failures such as abnormal data I / O (Input / Output) transmission, configuration remnants due to excessive connection configuration changes, and connection anomalies. If these failures are not properly handled or are difficult to resolve, they can lead to link collapse, rendering the remote replication link unusable and severely impacting remote replication services. Summary of the Invention
[0005] Therefore, it is necessary to provide a remote link repair method, apparatus, computer equipment, and storage medium that can reset the remote replication link and ensure the stability of remote replication, in order to address the above-mentioned technical problems.
[0006] Firstly, a remote link repair method is provided, the method comprising:
[0007] Remote links are detected through polling and link anomaly detection procedures.
[0008] In response to the detection of a fault in the remote link, the remote link is repaired, and a redundant remote link is found for data transmission and reception.
[0009] Disconnect the remote link to restore the connection to its initial state;
[0010] Delete the remote thread of the remote link and release the corresponding memory resources;
[0011] Create a new remote thread and allocate corresponding new memory resources to the new remote thread, wherein the new memory resources are the released memory resources;
[0012] Obtain the IP information of the remote link port, and establish a new remote link based on the IP information, so that the new remote link is consistent with the original remote link.
[0013] In one embodiment, disconnecting the remote link connection and restoring the connection state to its initial state includes:
[0014] By monitoring the remote link, the IP information of the remote link port can be obtained;
[0015] Save the IP information of the remote link port to the corresponding global variable or file. The IP information of the remote link port includes remote IP information and local IP information.
[0016] Based on the remote link, a connection identifier is obtained, and a disconnect link connection command and a disconnect network connection command are sent to the upper layer for execution based on the connection identifier, thereby disconnecting the remote link connection and the network connection; simultaneously,
[0017] Based on the connection identifier, stop data transmission and reception commands and stop listening commands are sent to the upper layer for execution, thereby stopping data transmission and reception processing on the remote link and listening to the IP information of the remote link port;
[0018] Upon completion of the upper layer's command to disconnect the link, disconnect the network, stop data transmission and reception, and stop listening, the connection state is restored to its initial state.
[0019] The connection state being restored to its initial state refers to the connection state being in an idle state.
[0020] In one embodiment, destroying the remote thread of the remote link and releasing the corresponding memory resources includes:
[0021] Obtain a custom signal and its corresponding processing function, and send the custom signal to the remote thread through the processing function;
[0022] In response to the remote thread receiving the custom signal, the remote thread of the remote link is destroyed;
[0023] Based on the memory resources, the corresponding debugging data is obtained through parsing;
[0024] The memory resources are reclaimed by releasing them.
[0025] In one embodiment, the step of creating a new remote thread and allocating corresponding new memory resources to the new remote thread includes:
[0026] The new remote thread is created by calling the thread creation interface;
[0027] Based on the new remote thread, set up custom signals and corresponding processing functions;
[0028] In response to the successful creation of the new remote thread, new memory resources are allocated to the new remote thread, and the new memory resources are consistent with the released memory resources.
[0029] In one embodiment, obtaining the IP information of the remote link port and establishing a new remote link based on the IP information includes:
[0030] Retrieve the IP information stored in the global variable or file;
[0031] Based on the IP information, establish a new remote link and monitor the new remote link;
[0032] Based on the new remote link, obtain the new connection identifier;
[0033] Based on the new connection identifier, data transmission and reception commands will be sent to the upper layer for execution, and data transmission and reception processing will be performed through the new remote link.
[0034] In one embodiment, before detecting the remote link through the polling procedure and the link anomaly detection procedure, the method further includes:
[0035] Create the remote thread and allocate corresponding memory resources to the remote thread;
[0036] The remote link is monitored by setting the listening port and IP information;
[0037] The IP information of the remote link port is obtained by listening, and the IP information of the remote link port includes remote IP information and local IP information;
[0038] The remote link is established based on the remote IP information and the local IP information;
[0039] Based on the remote link, obtain the connection identifier and send the connection identifier to the upper layer for data transmission and reception processing.
[0040] In one embodiment, the memory resources include at least a first memory, a second memory, and a third memory, wherein the first memory is used to store general-purpose data, the second memory is used to store input data and output data, and the third memory is used to store debugging data.
[0041] By parsing the third memory, the corresponding debugging data can be obtained;
[0042] Based on the debugging data, fault information of the remote link is obtained.
[0043] Secondly, a remote link repair device is provided, the device comprising:
[0044] The detection module is used to detect remote links through a polling program and a link anomaly detection program;
[0045] The repair and search module is used to repair the remote link in response to the detection of a fault in the remote link, and at the same time search for redundant remote links for data transmission and reception.
[0046] A disconnect module is used to disconnect the remote link connection and restore the connection state to its initial state.
[0047] The destruction and release module is used to destroy the remote thread of the remote link and release the corresponding memory resources.
[0048] A creation allocation module is used to create new remote threads and allocate corresponding new memory resources to the new remote threads, wherein the new memory resources are the released memory resources;
[0049] The module for obtaining and establishing a remote link is used to obtain the IP information of the remote link port and establish a new remote link based on the IP information, so that the new remote link is consistent with the original remote link.
[0050] Thirdly, a computer device is provided, the computer device including one or more processors; and a memory associated with the one or more processors, the memory for storing program instructions, which, when read and executed by the one or more processors, perform the steps of the remote link repair method as described in any one of the first aspects above.
[0051] Fourthly, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, performs the steps of the remote link repair method as described in any one of the first aspects above.
[0052] The aforementioned remote link repair method, apparatus, computer equipment, and storage medium repair the remote link by destroying remote link thread resources, releasing memory resources, recreating new threads, allocating new memory resources, and re-establishing link connections, thereby resetting the remote link. During the repair process, data transmission and reception are processed through redundant links to ensure the stability of remote replication. Attached Figure Description
[0053] Figure 1 This is a flowchart illustrating a remote link repair method in one embodiment;
[0054] Figure 2 This is a flowchart illustrating the steps for creating a remote link in one embodiment;
[0055] Figure 3 This is a structural block diagram of a remote link repair device in one embodiment;
[0056] Figure 4 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0057] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0058] Example 1
[0059] In one embodiment, such as Figure 1 As shown, a remote link repair method is provided, the method comprising:
[0060] S10. Detect remote links through polling and link anomaly detection procedures;
[0061] S11. In response to detecting a fault in the remote link, repair the remote link and simultaneously find redundant remote links for data transmission and reception.
[0062] Specifically, the remote link is used to implement remote replication. Redundant remote links replace the original remote links for data I / O sending and receiving, ensuring the stability of remote replication. At the same time, the original remote link is repaired by destroying the original remote link thread resources, releasing the original memory resources, recreating the new thread, allocating new memory resources, and re-establishing the link connection, thereby resetting the remote link.
[0063] S12. Disconnect the remote link and restore the connection state to the initial state;
[0064] Furthermore, a state generally refers to a finite number of states, also known as a finite state automaton, which is a mathematical computational model that represents a finite number of states and the transitions and actions between these states.
[0065] Furthermore, disconnecting the remote link connection to restore the connection state to its initial state includes:
[0066] By monitoring the remote link, the IP information of the remote link port can be obtained;
[0067] Specifically, it listens for and obtains the IP information of the original remote link port so that when a new remote link is established, it remains consistent with the original remote link.
[0068] Save the IP information of the remote link port to the corresponding global variable or file. The IP information of the remote link port includes remote IP information and local IP information.
[0069] Based on the remote link, a connection identifier is obtained, and a disconnect link connection command and a disconnect network connection command are sent to the upper layer for execution based on the connection identifier, thereby disconnecting the remote link connection and the network connection; simultaneously,
[0070] Based on the connection identifier, stop data transmission and reception commands and stop listening commands are sent to the upper layer for execution, thereby stopping data transmission and reception processing on the remote link and listening to the IP information of the remote link port;
[0071] Upon completion of the upper layer's command to disconnect the link, disconnect the network, stop data transmission and reception, and stop listening, the connection state is restored to its initial state.
[0072] The connection state being restored to its initial state refers to the connection state being in an idle state.
[0073] S13. Destroy the remote thread of the remote link and release the corresponding memory resources;
[0074] Furthermore, the step of destroying the remote thread of the remote link and releasing the corresponding memory resources includes:
[0075] Obtain a custom signal and its corresponding processing function, and send the custom signal to the remote thread through the processing function;
[0076] In response to the remote thread receiving the custom signal, the remote thread of the remote link is destroyed;
[0077] Based on the memory resources, the corresponding debugging data is obtained through parsing;
[0078] The memory resources are reclaimed by releasing them.
[0079] Specifically, the existing threads are destroyed, releasing the original memory resources, thus reclaiming thread and memory resources and saving them for reuse when creating new threads and allocating new memory.
[0080] Furthermore, threads can be destroyed by sending signals. When creating a remote thread, there are dedicated signal handlers for various signals. For user-defined signals, we bind corresponding handlers to these signals. These custom signal handlers primarily execute the `pthread_exit()` function. When the main process uses `pthread_kill()` to send a custom signal to a specified remote thread, the corresponding remote thread will execute the handler bound to the custom signal, and the thread will be destroyed upon exiting.
[0081] Furthermore, the memory resources include at least a first memory, a second memory, and a third memory. The first memory is used to store general-purpose data, the second memory is used to store input and output data, and the third memory is used to store debugging data.
[0082] By parsing the third memory, the corresponding debugging data can be obtained;
[0083] Based on the debugging data, fault information of the remote link is obtained.
[0084] Specifically, parsing the third memory and obtaining debugging data helps in locating and troubleshooting problems in remote links.
[0085] S14. Create a new remote thread and allocate corresponding new memory resources to the new remote thread, wherein the new memory resources are the released memory resources;
[0086] Furthermore, the step of creating a new remote thread and allocating corresponding new memory resources to the new remote thread includes:
[0087] The new remote thread is created by calling the thread creation interface;
[0088] Furthermore, the corresponding thread creation interface is called, such as pthread_attr_init(), pthread_create(), etc.
[0089] Based on the new remote thread, set up custom signals and corresponding processing functions;
[0090] In response to the successful creation of the new remote thread, new memory resources are allocated to the new remote thread, and the new memory resources are consistent with the released memory resources.
[0091] Specifically, by destroying the original remote link thread resources, releasing the original memory resources, recreating the new thread, and allocating new memory resources, the reuse of thread resources and memory resources can be achieved.
[0092] Furthermore, the reclaimed memory resources are reinitialized to prevent the generation of dirty data.
[0093] Furthermore, when a remote thread is created, there are three memory locations: a first memory (general_memory), a second memory (data_memory), and a third memory (livedump_memory). The first memory is primarily used to store general-purpose data, such as global variables, arrays, and resource lists. The second memory is mainly used to store data I / O-related memory data, such as used linked lists and timer resources. The third memory primarily stores valid debugging data. When a problem occurs in the connection, parsing the third memory can yield the corresponding debugging data, which helps in problem localization and troubleshooting. Memory resource reclamation mainly targets and reclaims these types of memory resources.
[0094] S15. Obtain the IP information of the remote link port, and establish a new remote link based on the IP information, so that the new remote link is consistent with the original remote link.
[0095] Further, obtaining the IP information of the remote link port and establishing a new remote link based on the IP information includes:
[0096] Retrieve the IP information stored in the global variable or file;
[0097] Based on the IP information, establish a new remote link and monitor the new remote link;
[0098] Furthermore, the method also includes restoring the TCP / IP (Transmission Control Protocol / Internet Protocol) connection of the remote link.
[0099] Based on the new remote link, obtain the new connection identifier;
[0100] Based on the new connection identifier, data transmission and reception commands will be sent to the upper layer for execution, and data transmission and reception processing will be performed through the new remote link.
[0101] Specifically, a new remote link is established based on the original remote link IP information, ensuring that the remote IP and local IP of the new remote link are consistent with those of the original remote link.
[0102] In one embodiment, before detecting the remote link through the polling procedure and the link anomaly detection procedure, the method further includes:
[0103] Create the remote thread and allocate corresponding memory resources to the remote thread;
[0104] The remote link is monitored by setting the listening port and IP information;
[0105] The IP information of the remote link port is obtained by listening, and the IP information of the remote link port includes remote IP information and local IP information;
[0106] The remote link is established based on the remote IP information and the local IP information;
[0107] Based on the remote link, obtain the connection identifier and send the connection identifier to the upper layer for data transmission and reception processing.
[0108] Furthermore, such as Figure 2 As shown, when performing remote IP replication, based on the TCP / IP protocol, we generally perform the following actions:
[0109] ① Initialization phase: Initialization mainly involves negotiating resources, such as allocating thread resources and memory resources. This step is the foundation for other steps, and all link resources are allocated based on the initialization process.
[0110] ② Listening phase: This means that the system enters listening mode and can receive messages from remote devices. This step requires setting the listening port and IP address.
[0111] ③ Connection Allow Phase: Allows a connection to be established between a remote IP address and the local IP address;
[0112] ④ Connection phase: The local IP attempts to establish a connection with the remote IP;
[0113] ⑤ Response Phase: After the connection is established, the connection identifier is reported to the upper layer so that the upper layer is aware that the connection has been established and can use the established connection to send and receive data.
[0114] It should be understood that, although Figure 1 and Figure 2 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 1 and Figure 2 At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but may be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but may be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.
[0115] Example 2
[0116] In one embodiment, such as Figure 3As shown, a remote link repair device is provided, the device comprising:
[0117] Detection module 30, the detection module is used to detect remote links through a polling program and a link anomaly detection program;
[0118] Repair and lookup module 31 is used to repair the remote link in response to detecting a fault in the remote link, and at the same time look up redundant remote links for data transmission and reception.
[0119] Disconnect module 32, the disconnect module is used to disconnect the remote link connection and restore the connection state to the initial state;
[0120] Furthermore, the disconnect module is specifically used for:
[0121] By monitoring the remote link, the IP information of the remote link port can be obtained;
[0122] Save the IP information of the remote link port to the corresponding global variable or file. The IP information of the remote link port includes remote IP information and local IP information.
[0123] Based on the remote link, a connection identifier is obtained, and a disconnect link connection command and a disconnect network connection command are sent to the upper layer for execution based on the connection identifier, thereby disconnecting the remote link connection and the network connection; simultaneously,
[0124] Based on the connection identifier, stop data transmission and reception commands and stop listening commands are sent to the upper layer for execution, thereby stopping data transmission and reception processing on the remote link and listening to the IP information of the remote link port;
[0125] Upon completion of the upper layer's command to disconnect the link, disconnect the network, stop data transmission and reception, and stop listening, the connection state is restored to its initial state.
[0126] The connection state being restored to its initial state refers to the connection state being in an idle state.
[0127] The destruction and release module 33 is used to destroy the remote thread of the remote link and release the corresponding memory resources.
[0128] Furthermore, the destruction and release module is specifically used for:
[0129] Obtain a custom signal and its corresponding processing function, and send the custom signal to the remote thread through the processing function;
[0130] In response to the remote thread receiving the custom signal, the remote thread of the remote link is destroyed;
[0131] Based on the memory resources, the corresponding debugging data is obtained through parsing;
[0132] The memory resources are reclaimed by releasing them.
[0133] A creation allocation module 34 is used to create a new remote thread and allocate corresponding new memory resources to the new remote thread, wherein the new memory resources are the released memory resources;
[0134] Furthermore, the creation and allocation module is specifically used for:
[0135] The new remote thread is created by calling the thread creation interface;
[0136] Based on the new remote thread, set up custom signals and corresponding processing functions;
[0137] In response to the successful creation of the new remote thread, new memory resources are allocated to the new remote thread, and the new memory resources are consistent with the released memory resources.
[0138] Furthermore, the creation and allocation module is also specifically used for:
[0139] Create the remote thread and allocate corresponding memory resources to the remote thread.
[0140] The acquisition and establishment module 35 is used to acquire the IP information of the remote link port and establish a new remote link based on the IP information, so that the new remote link is consistent with the original remote link.
[0141] Furthermore, the acquisition and establishment module is specifically used for:
[0142] Retrieve the IP information stored in the global variable or file;
[0143] Based on the IP information, establish a new remote link and monitor the new remote link;
[0144] Based on the new remote link, obtain the new connection identifier;
[0145] Based on the new connection identifier, data transmission and reception commands will be sent to the upper layer for execution, and data transmission and reception processing will be performed through the new remote link.
[0146] In one embodiment, the device further includes:
[0147] The monitoring module, wherein the setting module is used to monitor the remote link by setting the monitoring port and IP information;
[0148] The acquisition module is used to obtain the IP information of the remote link port by listening, and the IP information of the remote link port includes remote IP information and local IP information.
[0149] Furthermore, the acquisition module is also used for:
[0150] Based on the debugging data, fault information of the remote link is obtained.
[0151] A module for establishing a remote link is provided, which is used to establish the remote link based on the remote IP information and the local IP information.
[0152] The acquisition and transmission module is used to acquire a connection identifier based on the remote link and send the connection identifier to the upper layer for data transmission and reception processing.
[0153] In one embodiment, the memory resources include at least a first memory, a second memory, and a third memory, wherein the first memory is used to store general-purpose data, the second memory is used to store input data and output data, and the third memory is used to store debugging data. The device further includes:
[0154] The parsing and acquisition module is used to obtain corresponding debugging data by parsing the third memory.
[0155] Specific limitations regarding the remote link repair device can be found in the limitations of the remote link repair method described above, and will not be repeated here. Each module in the aforementioned remote link repair device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in hardware or independently of the processor in the computer device, or stored in software in the memory of the computer device, so that the processor can call and execute the corresponding operations of each module.
[0156] Example 3
[0157] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to perform the following steps:
[0158] Remote links are detected through polling and link anomaly detection procedures.
[0159] In response to the detection of a fault in the remote link, the remote link is repaired, and a redundant remote link is found for data transmission and reception.
[0160] Disconnect the remote link to restore the connection to its initial state;
[0161] Delete the remote thread of the remote link and release the corresponding memory resources;
[0162] Create a new remote thread and allocate corresponding new memory resources to the new remote thread, wherein the new memory resources are the released memory resources;
[0163] Obtain the IP information of the remote link port, and establish a new remote link based on the IP information, so that the new remote link is consistent with the original remote link.
[0164] When the program instructions are read and executed by the one or more processors, they can also perform operations corresponding to the steps in the above method embodiments, as described above, and will not be repeated here. (Reference) Figure 4 This exemplifies the architecture of a computer device, which may include a processor 410, a video display adapter 411, a disk drive 412, an input / output interface 413, a network interface 414, and a memory 420. The processor 410, video display adapter 411, disk drive 412, input / output interface 413, network interface 414, and memory 420 can communicate with each other via a communication bus 430.
[0165] The processor 410 can be implemented using a general-purpose central processing unit (CPU), microprocessor, application specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to achieve the technical solution provided in this application.
[0166] The memory 420 can be implemented as a read-only memory (ROM), random access memory (RAM), static storage device, dynamic storage device, etc. The memory 420 can store the operating system 421 for controlling the operation of the computer device 400, and the basic input / output system (BIOS) 422 for controlling the low-level operations of the computer device 400. Additionally, it can store a web browser 423, data storage management 424, and an icon / font processing system 425, etc. The icon / font processing system 425 can be the application program that specifically implements the aforementioned steps in this embodiment. In summary, when the technical solution provided in this application is implemented through software or firmware, the relevant program code is stored in the memory 420 and executed by the processor 410.
[0167] Input / output interface 413 is used to connect input / output modules to realize information input and output. Input / output modules can be configured as components in the device (not shown in the figure) or externally connected to the device to provide corresponding functions. Input devices may include keyboards, mice, touch screens, microphones, various sensors, etc., and output devices may include displays, speakers, vibrators, indicator lights, etc.
[0168] Network interface 414 is used to connect a communication module (not shown in the figure) to enable communication and interaction between this device and other devices. The communication module can communicate via wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).
[0169] Bus 430 includes a pathway for transmitting information between various components of the device, such as processor 410, video display adapter 411, disk drive 412, input / output interface 413, network interface 414, and memory 420.
[0170] In addition, the computer device 400 can also obtain information on specific acquisition conditions from the virtual resource object acquisition condition information database 441 for condition judgment, etc.
[0171] It should be noted that although the computer device 400 described above only shows a processor 410, a video display adapter 411, a disk drive 412, an input / output interface 413, a network interface 414, a memory 420, and a bus 430, in specific implementations, the computer device may also include other components necessary for normal operation. Furthermore, those skilled in the art will understand that the above device may only include the components necessary for implementing the solution of this application, and does not necessarily include all the components shown in the figures.
[0172] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, cloud server, or network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments of this application.
[0173] Example 4
[0174] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0175] Remote links are detected through polling and link anomaly detection procedures.
[0176] In response to the detection of a fault in the remote link, the remote link is repaired, and a redundant remote link is found for data transmission and reception.
[0177] Disconnect the remote link to restore the connection to its initial state;
[0178] Delete the remote thread of the remote link and release the corresponding memory resources;
[0179] Create a new remote thread and allocate corresponding new memory resources to the new remote thread, wherein the new memory resources are the released memory resources;
[0180] Obtain the IP information of the remote link port, and establish a new remote link based on the IP information, so that the new remote link is consistent with the original remote link.
[0181] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0182] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0183] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A remote link repair method, characterized in that, The method includes: Remote links are detected through polling and link anomaly detection procedures. In response to the detection of a fault in the remote link, the remote link is repaired, and a redundant remote link is found for data transmission and reception. Disconnect the remote link to restore the connection to its initial state; Delete the remote thread of the remote link and release the corresponding memory resources; Create a new remote thread and allocate corresponding new memory resources to the new remote thread, wherein the new memory resources are the released memory resources; Obtain the IP information of the remote link port, and establish a new remote link based on the IP information, so that the new remote link is consistent with the original remote link.
2. The method according to claim 1, characterized in that, Disconnecting the remote link and restoring the connection to its initial state includes: By monitoring the remote link, the IP information of the remote link port can be obtained; Save the IP information of the remote link port to the corresponding global variable or file. The IP information of the remote link port includes remote IP information and local IP information. Based on the remote link, a connection identifier is obtained, and a disconnect link connection command and a disconnect network connection command are sent to the upper layer for execution based on the connection identifier, thereby disconnecting the remote link connection and the network connection; simultaneously, Based on the connection identifier, stop data transmission and reception commands and stop listening commands are sent to the upper layer for execution, thereby stopping data transmission and reception processing on the remote link and listening to the IP information of the remote link port; Upon completion of the upper layer's command to disconnect the link, disconnect the network, stop data transmission and reception, and stop listening, the connection state is restored to its initial state. The connection state being restored to its initial state refers to the connection state being in an idle state.
3. The method according to claim 1, characterized in that, The step of destroying the remote thread of the remote link and releasing the corresponding memory resources includes: Obtain a custom signal and its corresponding processing function, and send the custom signal to the remote thread through the processing function; In response to the remote thread receiving the custom signal, the remote thread of the remote link is destroyed; Based on the memory resources, the corresponding debugging data is obtained through parsing; The memory resources are reclaimed by releasing them.
4. The method according to claim 1, characterized in that, The step of creating a new remote thread and allocating corresponding new memory resources to the new remote thread includes: The new remote thread is created by calling the thread creation interface; Based on the new remote thread, set up custom signals and corresponding processing functions; In response to the successful creation of the new remote thread, new memory resources are allocated to the new remote thread, and the new memory resources are consistent with the released memory resources.
5. The method according to claim 2, characterized in that, The step of obtaining the IP information of the remote link port and establishing a new remote link based on the IP information includes: Retrieve the IP information stored in the global variable or file; Based on the IP information, establish a new remote link and monitor the new remote link; Based on the new remote link, obtain the new connection identifier; Based on the new connection identifier, data transmission and reception commands will be sent to the upper layer for execution, and data transmission and reception processing will be performed through the new remote link.
6. The method according to claim 1, characterized in that, Before detecting the remote link through the polling procedure and the link anomaly detection procedure, the method further includes: Create the remote thread and allocate corresponding memory resources to the remote thread; The remote link is monitored by setting the listening port and IP information; The IP information of the remote link port is obtained by listening, and the IP information of the remote link port includes remote IP information and local IP information; The remote link is established based on the remote IP information and the local IP information; Based on the remote link, obtain the connection identifier and send the connection identifier to the upper layer for data transmission and reception processing.
7. The method according to claim 3, characterized in that, The memory resources include at least a first memory, a second memory, and a third memory. The first memory is used to store general-purpose data, the second memory is used to store input and output data, and the third memory is used to store debugging data. By parsing the third memory, the corresponding debugging data can be obtained; Based on the debugging data, fault information of the remote link is obtained.
8. A remote link repair device, characterized in that, The device includes: The detection module is used to detect remote links through a polling program and a link anomaly detection program; The repair and search module is used to repair the remote link in response to the detection of a fault in the remote link, and at the same time search for redundant remote links for data transmission and reception. A disconnect module is used to disconnect the remote link connection and restore the connection state to its initial state. The destruction and release module is used to destroy the remote thread of the remote link and release the corresponding memory resources. A creation allocation module is used to create new remote threads and allocate corresponding new memory resources to the new remote threads, wherein the new memory resources are the released memory resources; The module for obtaining and establishing a remote link is used to obtain the IP information of the remote link port and establish a new remote link based on the IP information, so that the new remote link is consistent with the original remote link.
9. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the remote link repair method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the remote link repair method according to any one of claims 1 to 7.