Storage data access method, device and equipment and readable storage medium
By introducing slave ports and read and write buffers into independent disk redundant arrays, judging the heartbeat information of the master port and switching to the slave port, the problem of storage data access interruption is solved, and the continuity of data access and high system availability is achieved.
Patent Information
- Application Number
- CN202510376544.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-27
- Publication Date
- 2025-06-20
AI Technical Summary
In the prior art, interruptions are prone to occur when storing data access, especially in case of server failure or port problems, continuity cannot be guaranteed.
By introducing slave ports and read and write buffers into independent disk redundant arrays, the acquisition and judgment of the heartbeat information of the master port is realized. If the master port does not work normally, switch to the slave port for storage data access.
Ensures the continuity of stored data access, prevents interruption of data access, and improves the reliability and flexibility of the system.
Smart Images

Figure CN120179180A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data storage, and particularly to a method, apparatus, device and readable storage medium for accessing stored data. Background Art
[0002] When a host system needs to read or write data, it sends a request to the RAID card. After receiving the request, the RAID card processes the data according to the configuration of the RAID array, such as striping data in RAID 0 and mirroring data in RAID 1. The host system and the RAID card are connected through a port. If the server fails or the port has problems, the disk system connected to the RAID card will be unavailable, resulting in the interruption of accessing the stored data on the disk system.
[0003] Therefore, how to improve the continuity of accessing stored data is a technical problem that those skilled in the art urgently need to solve. Summary of the Invention
[0004] In view of this, the purpose of the present invention is to provide a method, apparatus, device and readable storage medium for accessing stored data, which solves the technical problem of interruption when accessing stored data in the prior art.
[0005] To solve the above technical problem, the present invention provides a method for accessing stored data, which is applied to a redundant array of independent disks. The redundant array of independent disks includes a main port, a slave port and a read / write buffer area. Both the main port and the slave port are connected to the read / write buffer area. The method includes:
[0006] The slave port of the redundant array of independent disks obtains the main port heartbeat information of the redundant array of independent disks from the read / write buffer area;
[0007] The slave port determines whether the main port is working properly based on the main port heartbeat information;
[0008] When it is determined that the main port is not working properly, the redundant array of independent disks enables the access path from the slave port to the storage device to perform access to stored data.
[0009] In some embodiments, before the slave port of the redundant array of independent disks obtains the main port heartbeat information of the redundant array of independent disks from the read / write buffer area, it further includes:
[0010] The redundant array of independent disks simultaneously starts the heartbeat programs of the main port and the slave port;
[0011] The main port and the slave port determine the main port heartbeat information and the slave port heartbeat information based on the corresponding heartbeat programs;
[0012] The master port and the slave port write the master port heartbeat information and the slave port heartbeat information into the read-write buffer based on the buffer location and buffer size of the read-write buffer.
[0013] In some embodiments, the slave port determines whether the master port is working properly based on the master port heartbeat information, including:
[0014] The master port writes the master port heartbeat information into a target location in the read-write buffer at preset intervals; wherein, the master port heartbeat information includes a heartbeat information timestamp, a master port status, and corresponding identifiers of the master port and the slave port; the heartbeat information timestamp is the timestamp corresponding to the master port sending the heartbeat information; the master port status includes a fault status and a normal status;
[0015] The slave port reads the master port heartbeat information from the target location at intervals of the preset time.
[0016] When the identifier of the corresponding master port read by the slave port is correct, and the master port status is the normal status, and the time difference determined based on the heartbeat information timestamp is less than a preset time threshold, then the slave port determines that the master port is in a normal working state;
[0017] When the identifier of the corresponding master port read is incorrect, and the master port status is the normal status, and the time difference determined based on the heartbeat information timestamp is less than the preset time threshold, and it is determined that the status of the master port is normal for sending heartbeats but the master port is unavailable, it is determined that the master port cannot work properly;
[0018] When the identifier of the corresponding master port read is correct, and the master port status is an abnormal status, and the time difference determined based on the heartbeat information timestamp is less than the preset time threshold, and it is determined that the status of the master port is normal for sending heartbeats but the master port is unavailable, it is determined that the master port cannot work properly, and at the same time, the independent disk redundant array is notified to stop the master port heartbeat;
[0019] When the identifier of the corresponding master port read is correct, and the master port status is the normal status, and the time difference determined based on the heartbeat information timestamp is greater than the preset time threshold, it is determined that the master port cannot work properly.
[0020] In some embodiments, when it is determined that the master port is not working properly, the independent disk redundant array enables the access path from the slave port to the storage device for storing data access, including:
[0021] When it is determined that the main port is not working properly, the redundant array of independent disks enables the slave server to transition from a data access prohibited state to a data access state. The slave port receives the storage data access request of the slave server and performs storage data access. The redundant array of independent disks enables the main port to stop storage data access and enables the main server to transition from a data access state to a data access prohibited state.
[0022] In some embodiments, before when it is determined that the main port is not working properly, the redundant array of independent disks enables the slave server to transition from a data access prohibited state to a data access state. The slave port receives the storage data access request of the slave server and performs storage data access. The redundant array of independent disks enables the main port to stop storage data access and enables the main server to transition from a data access state to a data access prohibited state, further including:
[0023] The redundant array of independent disks interconnects the main port with the main server and interconnects the slave port with the slave server.
[0024] In some embodiments, after when it is determined that the main port is not working properly, the redundant array of independent disks enables the access path from the slave port to the storage device and performs storage data access, further including:
[0025] The external detection device obtains the corresponding main port log based on the timestamp in the heartbeat information of the main port; the external detection device is interconnected with the redundant array of independent disks;
[0026] The external detection device determines the cause of the failure of the main port and the corresponding fault solution based on the main port log;
[0027] The external detection device restores the main port based on the fault solution to obtain the restored main port;
[0028] The redundant array of independent disks enables the heartbeat of the main port and sends the information that the main port has been restored to the slave port.
[0029] In some embodiments, the above storage data access method further includes:
[0030] The redundant array of independent disks serves as the main redundant array of independent disks;
[0031] During the storage data reading process, the main redundant array of independent disks synchronizes the configuration and cache data to the slave redundant array of independent disks in real time, so that when the main port and the slave port both have irreparable failures, storage data access is performed based on the slave redundant array of independent disks, as well as the server and port connected to the slave redundant array of independent disks.
[0032] An embodiment of the present invention further provides a storage data access device for a redundant array of independent disks (RAID). The RAID includes a main port, a slave port, and a read / write buffer. Both the main port and the slave port are connected to the read / write buffer. The device includes:
[0033] A main port heartbeat information determination module for the slave port of the RAID to obtain the main port heartbeat information of the RAID from the read / write buffer;
[0034] A judgment module for the slave port to determine whether the main port is working properly based on the main port heartbeat information;
[0035] A continuous access module for when it is determined that the main port is not working properly, the RAID enables the access path from the slave port to the storage device to perform storage data access.
[0036] An embodiment of the present invention further provides a storage data access device, including:
[0037] A memory for storing a computer program;
[0038] A processor for executing the computer program to implement the steps of the above storage data access method.
[0039] An embodiment of the present invention further provides a readable storage medium with a computer program stored thereon. When the computer program is executed by a processor, it implements the steps of the above storage data access method.
[0040] The present invention also provides a computer program product, including a computer program / instructions. When the computer program / instructions are executed by a processor, they implement the steps of the above storage data access method.
[0041] To solve the above technical problems, an embodiment of the present invention provides a storage data access method applied to a RAID. The RAID includes a main port, a slave port, and a read / write buffer. Both the main port and the slave port are connected to the read / write buffer. The above method may include: the slave port of the RAID obtains the main port heartbeat information of the RAID from the read / write buffer; the slave port determines whether the main port is working properly based on the main port heartbeat information; when it is determined that the main port is not working properly, the RAID enables the access path from the slave port to the storage device to perform storage data access.
[0042] As can be seen from the above technical solutions, the beneficial effects of the present invention are as follows: When the main port of the redundant array of independent disks and the main server cannot access the stored data, compared with the situation where data access cannot be performed when the current server fails or the port has problems, the main port of the redundant array of independent disks can be switched to the slave port, ensuring that the slave port can take over the main port to access the stored data, thereby preventing the interruption of stored data access and improving the continuity of stored data access. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the embodiments of the present invention, the following will briefly introduce the drawings required for use in the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0044] Figure 1 It is a flowchart of a method for accessing stored data provided by an embodiment of the present invention;
[0045] Figure 2 It is a flow example diagram of a method for accessing stored data provided by an embodiment of the present invention;
[0046] Figure 3 It is a schematic structural framework diagram of a system for accessing stored data provided by an embodiment of the present invention;
[0047] Figure 4 It is a schematic structural framework diagram of a device for accessing stored data provided by an embodiment of the present invention;
[0048] Figure 5 It is a schematic structural framework diagram of a device for accessing stored data provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0049] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, rather than all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the protection scope of the present invention.
[0050] The terms "including" and "having" in the specification of the present invention and any variations related to "including" and "having" are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but may include steps or units that are not listed.
[0051] In the process of describing the embodiments of the present invention, some nouns or terms are applicable to the following explanations:
[0052] RAID: Redundant Array of Independent Disks, also known as disk array for short. It combines multiple hard disks using virtualized storage technology to form one or more hard disk array groups, aiming to improve performance or data redundancy, or both simultaneously. Simply put, RAID combines multiple hard disks into a logical hard disk. Therefore, the operating system only treats it as a physical hard disk.
[0053] NVMe CMB: Controller Memory Buffer is a dedicated memory area inside the NVMe storage controller, used to optimize data processing and transfer efficiency. It reduces I / O latency, lightens the burden on the host CPU, and improves overall performance by caching frequently accessed data and the status information of storage devices. In addition, CMB also supports advanced functions such as multi-path I / O and error recovery, enhancing the reliability and flexibility of the storage system.
[0054] RC (Root Complex) is a core component in the PCI Express (PCIe) architecture, responsible for connecting the host system to PCIe devices. It acts as a bridge between the host and downstream devices, managing data transfer, device initialization, and resource allocation. RC is also responsible for handling interrupts and requests from devices to ensure efficient communication and system performance.
[0055] EP (Endpoint) is a type of device in the PCI Express (PCIe) architecture, usually referring to external devices connected to the PCIe Root Complex, such as graphics cards, network adapters, or storage controllers. EP is responsible for receiving and sending data, communicating with the host system, and performing specific functions. Each PCIe EP has a unique address and resources, enabling independent data transfer and processing.
[0056] To enable those skilled in the art to better understand the solution of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0057] Next, a storage data access method provided by the embodiments of the present invention will be introduced in detail. Figure 1 The flowchart of a storage data access method provided by the embodiments of the present invention is applied to a redundant array of independent disks. The redundant array of independent disks includes a main port, a slave port, and a read / write buffer area. Both the main port and the slave port are connected to the read / write buffer area. The method may include:
[0058] S101, a slave port of a redundant array of independent disks, obtains the heartbeat information of the master port of the redundant array of independent disks from the read-write buffer.
[0059] The execution subject of this step is the slave port of the redundant array of independent disks. The number of slave ports in this embodiment is not limited. For example, the number of slave ports in this embodiment can be 1; or the number of slave ports in this embodiment can be 2. The CMB (Controller Memory Buffer, read-write buffer) in this embodiment refers to the read-write buffer inside the RAID controller, which is exposed to the host memory space through the PCIe MMIO (Memory-Mapped Input / Output) and BAR (Base Address Register) methods and can be directly read and written by the host. There are two registers on the RAID card side. Among them, CMB LOC (Controller Memory Buffer Location) represents the location of the CMB, and CMB SZ (Controller Memory Buffer Size) represents the size of the CMB. Set bit3 in CMBSZ to 1 to allow data to be read from the device to the host. The specific master port heartbeat information in this embodiment is not limited, as long as it can be determined whether the master port is working properly based on this master port heartbeat information. For example, the master port heartbeat information is a heartbeat timestamp, and the slave port obtains a specific data packet (such as an ICMP Echo Request) containing the timestamp sent by the master port to the read-write buffer regularly (such as every second). Detection logic: If the standby port does not receive a heartbeat packet within a preset time window (such as 3 seconds), it is determined that the master port fails. Or, the master port heartbeat information is the running status code of the master port. Detection logic: If the running status code of abnormal operation (such as 503 Service Unavailable) is obtained continuously N times (such as 5 times), the master port switch is triggered.
[0060] It should be further noted that, based on any of the above embodiments, in order to improve the accuracy of obtaining the heartbeat information of the main port, before obtaining the heartbeat information of the main port of the redundant array of independent disks from the read-write buffer at the slave port of the redundant array of independent disks, it may further include: the main port and the slave port determine the heartbeat information of the main port and the heartbeat information of the slave port based on the corresponding heartbeat program; the main port and the slave port write the heartbeat information of the main port and the heartbeat information of the slave port into the read-write buffer based on the cache location and cache size of the read-write buffer. Whether writing the heartbeat information of the main port or the heartbeat information of the slave port in this embodiment, it will be based on the cache location and cache size of the read-write buffer. Based on the cache location, the storage location of the heartbeat information can be accurately determined, and the cache size can ensure that the current size of the read-write buffer can write the heartbeat information normally. In this embodiment, through the device cache location and cache size, subsequent acquisition can be performed based on the cache location and cache size, thereby improving the accuracy of obtaining the heartbeat information of the main port.
[0061] S102. The slave port determines whether the main port is working properly based on the heartbeat information of the main port.
[0062] This embodiment can determine whether the main port is working properly based on the heartbeat information of the main port.
[0063] It should be further noted that, based on any of the above embodiments, in order to improve the accuracy of determining whether the main port is working properly, the above-mentioned slave port determining whether the main port is working properly based on the heartbeat information of the main port may include:
[0064] Step 1: The main port writes the heartbeat information of the main port into the target location in the read-write buffer at every preset time; wherein, the heartbeat information of the main port includes the heartbeat information timestamp, the status of the main port, and the corresponding identifiers of the main port and the slave port; the heartbeat information timestamp is the timestamp corresponding to the main port sending the heartbeat information; the status of the main port includes a fault status and a normal status.
[0065] Step 2: The slave port reads the heartbeat information of the main port from the target location at every preset time interval.
[0066] Step 3: When the identifier of the corresponding main port read by the slave port is correct, the status of the main port is normal, and the time difference determined based on the heartbeat information timestamp is less than the preset time threshold, the slave port determines that the main port is in a normal working state.
[0067] Step 4: When the identifier of the corresponding main port read is incorrect, the status of the main port is normal, and the time difference determined based on the heartbeat information timestamp is less than the preset time threshold, it is determined that the status of the main port is normal for sending the heartbeat and the main port is unavailable, and it is determined that the main port cannot work properly.
[0068] Step 5: When the identifier of the corresponding master port is correct, the status of the master port is an abnormal state, and the time difference determined based on the heartbeat information timestamp is less than the preset time threshold, it is determined that the status of the master port is normal heartbeat sending and the master port is unavailable. It is determined that the master port cannot work properly, and at the same time, the independent disk redundant array is notified to stop the master port heartbeat;
[0069] Step 6: When the identifier of the corresponding master port is correct, the status of the master port is a normal state, and the time difference determined based on the heartbeat information timestamp is greater than the preset time threshold, it is determined that the master port cannot work properly.
[0070] It can be understood that the master port and the slave port complete the work of confirming whether the heartbeat is normal by regularly reading and writing the CMB area. At the beginning of the work, the RAID card controller simultaneously starts the heartbeat program and the heartbeat check program of the master port and the slave port, and the time is the timestamp starting from 0. The data structure of the heartbeat information of the master port and the slave port is as follows. timestamp is the timestamp corresponding to the sent heartbeat information, accurate to s (seconds), status is the status of the device (master port), the normal status is 0, and the faulty status is 1. device_id is the identifier corresponding to the two agreed ports. When the master port writes the heartbeat information into a specific position 1 in the CMB every 1 s (the interval time can be set according to requirements), the slave port will read from the specific position 1 in the CMB every 1 s. If the read device_id is correct, the status is 0, and the time difference between the timestamp and the current time is less than 3 s, it is considered that the path of the master port is normal and available; when the read device_id is correct, but the status is 1, it is considered that although the master port can send the heartbeat normally, the master port is already unavailable, and it will switch from the master port to the slave port, and at the same time, the RAID card controller is notified to stop the master port heartbeat; when the read device_id is correct, the status is also 0, but the time difference between the timestamp and the current time is greater than or equal to 3 s, it is considered that the master port heartbeat is abnormal, and it will switch from the master port to the slave port. If the read device_id is incorrect, it is considered that the master port is abnormal, and it will switch from the master port to the slave port. The entire data structure only needs to occupy 4 + 1 + 4 = 9 Byte. Considering that both the master and slave ports need to occupy space, the total occupied space is 9 * 2 = 18 Byte. Therefore, adopting the structure of the master port heartbeat information provided by the embodiments of the present invention can reduce the occupied space, and since the heartbeat information includes the heartbeat information timestamp, the status of the master port, and the corresponding identifiers of the master port and the slave port, the accuracy of judging whether the master port works properly can be improved. The structure of the master port heartbeat information is as follows:
[0071] typedef struct { / / Defined data structure
[0072] uint32_t timestamp; / / Timestamp of heartbeat information
[0073] uint8_t status; / / Status of the main port
[0074] uint32_t device_id; / / Corresponding identifier for the main port and slave port
[0075] } HeartbeatMessage
[0076] S103. When it is determined that the main port is not working properly, the redundant array of independent disks enables the access path from the slave port to the storage device for accessing stored data
[0077] In this embodiment, when it is determined that the main port cannot work properly, the controller of the redundant array of independent disks enables the access path from the slave port to the storage device for accessing stored data. That is, the access path from the slave port to the storage device can be the storage access path from the main server, the slave port to the storage device; or it can be the storage access path from the slave server, the slave port to the storage device
[0078] It should be further noted that based on any of the above embodiments, in order to further improve the continuity of storage access, when it is determined that the main port is not working properly, the redundant array of independent disks enables the access path from the slave port to the storage device for accessing stored data, which may include: when it is determined that the main port is not working properly, the redundant array of independent disks enables the slave server to convert from the data access prohibited state to the data access state. The slave port receives the storage data access request from the slave server for accessing stored data. The redundant array of independent disks enables the main port to stop accessing stored data and enables the main server to convert from the data access state to the data access prohibited state. In this embodiment, when the main port cannot work properly, it is considered that the data can no longer be sent from the main port to the RAID array, so it switches to the slave port and the slave server. The original main port link is closed, and the data is sent to the RAID array using the slave server and the slave port. This embodiment takes into account that when the main port cannot work properly, it is very likely that the main server cannot work either. Therefore, the present invention interconnects the slave port and the slave server to ensure that when there is a problem with the line between the main port and the main server, it can be switched to the line of the slave port and the slave server that can be used normally. Therefore, in this embodiment, the redundant array of independent disks interconnects the main port and the main server, and interconnects the slave port and the slave server. Thus, when the link between one port or server and the port fails, the system can still continue to run through the other port, ensuring the continuity of the service and the security of the data. This design significantly improves the reliability and flexibility of the storage system
[0079] It should be further noted that, based on any of the above embodiments, in order to improve the efficiency of the main port recovery, when it is determined that the main port is not working properly, the redundant array of independent disks enables the access path from the slave port to the storage device. After accessing the stored data, it may further include: the external detection device obtains the corresponding main port log based on the timestamp in the main port heartbeat information; the external detection device and the redundant array of independent disks are interconnected; the external detection device determines the cause of the main port failure and the corresponding fault solution based on the main port log; the external detection device restores the main port based on the fault solution to obtain the restored main port; the redundant array of independent disks enables the heartbeat of the main port and sends the information that the main port has been restored to the slave port. The external detection device in this embodiment is used to obtain the main port log (including the heartbeat information associated with the timestamp), analyze the cause of the fault, and generate a repair plan. The external detection device in this embodiment is physically isolated from the RAID system (such as an independent server or an out-of-band management module) to avoid the detection function failure caused by the main port failure. The external detection device can map the log features (such as error codes, stack traces) in the main port log to the preset fault modes, determine the cause of the fault corresponding to the fault model and the corresponding fault solution, so as to repair the fault of the main port based on the solution, realize the automatic repair of the main port fault, and improve the efficiency of the main port repair.
[0080] It should be further noted that, to prevent data loss, the above method for accessing stored data may further include: the redundant array of independent disks serves as the main redundant array of independent disks; during the process of reading stored data, the main redundant array of independent disks synchronizes the configuration and cached data to the slave redundant array of independent disks in real time, so that when both the main port and the slave port have irreparable faults, the stored data can be accessed based on the slave redundant array of independent disks, and the server and ports connected to the slave redundant array of independent disks. In this embodiment, the slave RAID adjusts its own metadata (such as LUN ID, file system mount point) to be consistent with the main RAID to ensure that the server can seamlessly identify the storage resources. This embodiment takes into account the situation where both the main and slave ports of the main RAID fail, so that based on the real-time synchronization configuration and cached data, it is possible to quickly (usually within seconds) switch to the slave RAID, ensure business continuity, and at the same time, through strong consistency protocols and automated operation and maintenance tools, minimize the risk of data loss and manual operations.
[0081] It should be further noted that, in order to improve the efficiency of accessing stored data, the above-mentioned method for accessing stored data may further include: the monitoring device monitors in real time the queue depth, latency, and load status of the data in the main port, and based on the queue depth, latency, and load status, uses a dynamic adjustment request allocation strategy to automatically direct new stored data access requests to the slave port path. This embodiment does not limit the specific redundant array of independent disks (RAID) device. For example, the monitoring device in this embodiment may be a device on the RAID; or the monitoring device in this embodiment may be an external device. At this time, when it is determined that the request of the current main port needs to be directed based on the queue depth, latency, and load status, a message for accessing stored data on the slave port is sent to the slave port. The queue depth in this embodiment refers to the number of I / O requests to be processed by the main port (such as the SCSI command queue length). The latency in this embodiment refers to the average time taken from the start to the completion of the stored data access request (such as the read operation latency > 10 ms).
[0082] The load status in this embodiment refers to the port bandwidth occupancy rate (such as 80%) and the CPU / memory usage rate (such as the main RAID controller CPU > 70%). By monitoring the main port performance metrics in real time and dynamically adjusting the I / O request allocation strategy, this embodiment can actively direct new requests to the slave port path when the main port is not faulty but has a high load, thereby improving the overall storage access efficiency.
[0083] A method for accessing stored data provided by an embodiment of the present invention may include: S101, the slave port of the redundant array of independent disks obtains the heartbeat information of the main port of the redundant array of independent disks from the read / write buffer. S102, the slave port determines whether the main port is working properly based on the main port heartbeat information. S103, when it is determined that the main port is not working properly, the redundant array of independent disks enables the access path from the slave port to the storage device to perform stored data access. Compared with the situation where storage data access cannot be performed when the current server fails or the port has problems, in the present invention, when the main port of the redundant array of independent disks and the main server cannot access the stored data, the main port of the redundant array of independent disks can be switched to the slave port to ensure that the slave port can take over the main port to perform stored data access, thereby preventing the interruption of stored data access and improving the continuity of stored data access.
[0084] For the convenience of understanding the present invention, please specifically refer to Figure 2 , Figure 2 which is a flow example diagram of a method for accessing stored data provided by an embodiment of the present invention, and specifically may include:
[0085] S201, the redundant array of independent disks simultaneously starts the heartbeat program and the program for checking the heartbeat of the main port and the slave port, and the time is the time stamp starting from 0.
[0086] For ease of understanding, please refer to Figure 3 , Figure 3 which is a schematic structural framework diagram of a storage data access system provided by an embodiment of the present invention. As can be seen from Figure 3 , the present invention proposes a method for implementing a dual-port RAID card. On the basis of the implementation of the original method, a slave server and a slave port (the PCIe interface connecting the server and the RAID card) are added. The slave server is connected to the slave port and is used as an alternative solution when the primary server crashes or there is a problem with the link between the primary server and the RAID, ensuring high availability of the system. Among them, NVMe Switch represents a switch for the non-volatile memory host controller interface, SSD represents a solid-state drive, and CMB represents a read-write buffer. Server M represents the primary server, server S represents the slave server, EP M represents the primary port, and EP S represents the slave port.
[0087] S202, the primary port of the redundant array of independent disks writes heartbeat information to a set position in the read-write buffer at each set time period.
[0088] The set time period in this embodiment can be 1 second.
[0089] S203, the slave port of the redundant array of independent disks reads the heartbeat information of the primary port from the set position in the read-write buffer at each set time period; among them, the heartbeat information includes the corresponding identifiers of the primary port and the slave port, the status of the primary port, and the timestamp of the heartbeat information.
[0090] The corresponding identifier of the primary port and the slave port in this embodiment can be represented as device_id, the status of the primary port in this embodiment can be represented as status, and the timestamp of the heartbeat information in this embodiment can be represented as timestamp.
[0091] S204, when any one of the indicators in the heartbeat information is abnormal, it is determined that the primary port is not working properly.
[0092] In this embodiment, when at least one of the indicators in the heartbeat information is abnormal, it will be determined that the primary port is not working properly. Only when all the indicators in the heartbeat information are normal, will it be considered that the primary port is working properly and in an available state.
[0093] S205, the redundant array of independent disks enables the slave server to convert from the data access prohibited state to the data access state, enables the primary port to stop storing data access, and enables the primary server to convert from the data access state to the data access prohibited state.
[0094] S206, the slave port receives the storage data access request from the slave server and performs storage data access.
[0095] An implementation method for accessing stored data in a dual - port independent disk redundant array is proposed in an embodiment of the present invention. The innovation of dual - port RAID cards lies in that they provide higher data availability and system redundancy. Such RAID cards are connected to the server and storage devices through two independent ports, so that when one of the ports or the link between the server and the port fails, the system can still continue to run through the other port, ensuring business continuity and data security. This design significantly improves the reliability and flexibility of the storage system.
[0096] The storage data access device provided in the embodiment of the present invention will be introduced below. The storage data access device described below can be correspondingly referred to the storage data access method described above.
[0097] Figure 4 A schematic structural framework diagram of a storage data access device provided in an embodiment of the present invention may include:
[0098] The master - port heartbeat information determination module 100 is used for the slave port of the independent disk redundant array to obtain the master - port heartbeat information of the independent disk redundant array from the read - write buffer.
[0099] The judgment module 200 is used for the slave port to determine whether the master port is working properly based on the master - port heartbeat information.
[0100] The continuous access module 300 is used for when it is determined that the master port is not working properly, the independent disk redundant array enables the access path from the slave port to the storage device to perform storage data access.
[0101] Furthermore, based on any of the above - mentioned embodiments, the above - mentioned storage data access device may further include:
[0102] The heartbeat start module is used for the independent disk redundant array to start the heartbeat programs of both the master port and the slave port simultaneously.
[0103] The heartbeat information determination module is used for the master port and the slave port to determine the master - port heartbeat information and the slave - port heartbeat information based on the corresponding heartbeat programs.
[0104] The heartbeat information writing module is used for the master port and the slave port to write the master - port heartbeat information and the slave - port heartbeat information into the read - write buffer based on the buffer position and buffer size of the read - write buffer.
[0105] Furthermore, based on any of the above - mentioned embodiments, the above - mentioned judgment module 200 may include:
[0106] A heartbeat information writing unit, configured to write the master port heartbeat information to a target position in the read-write buffer at preset intervals by the master port; wherein, the master port heartbeat information includes a heartbeat information timestamp, a master port status, and corresponding identifiers of the master port and the slave port; the heartbeat information timestamp is the timestamp corresponding to the master port sending the heartbeat information; the master port status includes a fault status and a normal status;
[0107] A heartbeat information reading unit, configured to read the master port heartbeat information from the target position at preset intervals by the slave port;
[0108] A normal working state determination unit, configured to determine that the master port is in a normal working state when the identifier of the corresponding master port read by the slave port is correct, the master port status is in a normal state, and the time difference determined based on the heartbeat information timestamp is less than a preset time threshold;
[0109] A first non-normal working determination unit, configured to determine that the master port cannot work properly when the identifier of the corresponding master port read is incorrect, the master port status is in a normal state, and the time difference determined based on the heartbeat information timestamp is less than a preset time threshold, and determine that the master port is sending heartbeats normally but the master port is unavailable;
[0110] A second non-normal working determination unit, configured to determine that the master port cannot work properly when the identifier of the corresponding master port read is correct, the master port status is in an abnormal state, and the time difference determined based on the heartbeat information timestamp is less than a preset time threshold, and determine that the master port is sending heartbeats normally but the master port is unavailable, and simultaneously notify the redundant array of independent disks to stop the master port heartbeat;
[0111] A third non-normal working determination unit, configured to determine that the master port cannot work properly when the identifier of the corresponding master port read is correct, the master port status is in a normal state, and the time difference determined based on the heartbeat information timestamp is greater than the preset time threshold.
[0112] A heartbeat information acquisition unit, configured to acquire the heartbeat information timestamp, the master port status, and the corresponding identifiers of the master port and the slave port in the master port heartbeat information by the slave port; wherein, the heartbeat information timestamp is the timestamp corresponding to the master port sending the heartbeat information; the master port status includes a fault status and a normal status;
[0113] The master port writes the heartbeat information to a target position in the read-write buffer at preset intervals;
[0114] The slave port reads the master port heartbeat information from the target position at every interval of the preset time.
[0115] When the identifier of the master port read by the slave port is correct, the status of the master port is normal, and the time difference determined based on the timestamp of the heartbeat information is less than the preset time threshold, the slave port determines that the master port is in a normal working state.
[0116] When the identifier of the master port read is correct and the status of the master port is abnormal, and it is determined that the status of the master port is normal for sending heartbeats and the master port is unavailable, it is determined that the master port cannot work properly, and at the same time, the independent disk redundant array is notified to stop the master port heartbeat.
[0117] When the identifier of the master port read is correct, the status of the master port is normal, and the time difference determined based on the timestamp of the heartbeat information is greater than the preset time threshold, it is determined that the master port cannot work properly.
[0118] Further, based on any of the above embodiments, the continuous access module 300 may include:
[0119] A high-availability unit, which is used for when it is determined that the master port is not working properly, the independent disk redundant array enables the slave server to convert from the data access prohibited state to the data access state, the slave port receives the storage data access request of the slave server, performs storage data access, the independent disk redundant array enables the master port to stop storage data access, and enables the master server to convert from the data access state to the data access prohibited state.
[0120] Further, based on any of the above embodiments, the above storage data access device may further include:
[0121] An interconnection module, which is used for the independent disk redundant array to interconnect the master port with the master server and interconnect the slave port with the slave server.
[0122] Further, based on any of the above embodiments, the above storage data access device may further include:
[0123] A master port log determination module, which is used for an external detection device to obtain a corresponding master port log based on the timestamp in the master port heartbeat information; the external detection device is interconnected with the independent disk redundant array.
[0124] A fault solution determination module, which is used for the external detection device to determine the fault cause of the master port and the corresponding fault solution based on the master port log.
[0125] A main port recovery module, configured to enable the external detection device to recover the main port based on the fault solution to obtain a recovered main port;
[0126] A main port heartbeat information recovery module, configured to enable the independent disk redundant array to start the heartbeat of the main port and send the information that the main port has been recovered to the slave port.
[0127] Further, based on any of the above embodiments, the above storage data access device may further include:
[0128] A main independent disk redundant array determination module, configured to use the independent disk redundant array as the main independent disk redundant array;
[0129] A main - slave independent disk redundant array switching module, configured to enable the main independent disk redundant array to synchronize the configuration and cached data to the slave independent disk redundant array in real - time during the storage data reading process, so that when the main port and the slave port both have irreparable faults, storage data access can be performed based on the slave independent disk redundant array, as well as the server and ports connected to the slave independent disk redundant array.
[0130] It should be noted that, without affecting the logic, the order of the modules and units in the above storage data access device can be changed before and after.
[0131] Figure 4 The description of the features in the corresponding embodiments can be referred to Figure 4 the relevant descriptions of the corresponding embodiments, which will not be elaborated here one by one.
[0132] A storage data access device provided by an embodiment of the present invention is applied to an independent disk redundant array. The independent disk redundant array includes a main port, a slave port, and a read - write buffer area. Both the main port and the slave port are connected to the read - write buffer area. The above device may include: a main port heartbeat information determination module 100, configured to enable the slave port of the independent disk redundant array to obtain the main port heartbeat information of the independent disk redundant array from the read - write buffer area; a judgment module 200, configured to enable the slave port to determine whether the main port is working properly based on the main port heartbeat information; a continuous access module 300, configured to enable the independent disk redundant array to enable the access path from the slave port to the storage device for storage data access when it is determined that the main port is not working properly. Compared with the situation where storage data access cannot be performed when the current server fails or the port has problems, when the main port of the independent disk redundant array and the main server cannot access storage data, the present invention can switch the main port of the independent disk redundant array to the slave port to ensure that the slave port can replace the main port for storage data access, thereby preventing the interruption of storage data access and improving the continuity of storage data access.
[0133] The following introduces a storage data access device provided by an embodiment of the present invention. The storage data access device described below can be correspondingly referred to the storage data access method described above.
[0134] Figure 5 It is a schematic structural framework diagram of a storage data access device provided by an embodiment of the present invention. As Figure 5 shown, the storage data access device may include: a memory 60 for storing computer programs;
[0135] a processor 61 for implementing the steps of the storage data access method in the above embodiment when executing the computer program.
[0136] The storage data access device provided in this embodiment may include, but is not limited to, a smart phone, a tablet computer, a notebook computer, a desktop computer, etc.
[0137] Among them, the processor 61 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 61 may be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 61 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the wake state, also known as the central processing unit (CPU); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 61 may be integrated with a graphics processing unit (GPU), and the GPU is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 61 may further include an artificial intelligence (AI) processor, and the AI processor is used to process computational operations related to machine learning.
[0138] The memory 60 may include one or more computer-readable storage media, which may be non-transitory. The memory 60 may also include high-speed random access memory and non-volatile memory, such as one or more magnetic disk storage devices and flash storage devices. In this embodiment, the memory 60 is at least used to store the following computer program 601. After the computer program is loaded and executed by the processor 61, the relevant steps of the storage data access method disclosed in any of the foregoing embodiments can be implemented. In addition, the resources stored in the memory 60 may also include an operating system 602, data 603, etc., and the storage method may be transient storage or permanent storage. Among them, the operating system 602 may include Windows, Unix, Linux, etc. The data 603 may include, but is not limited to, the data required for the storage data access method.
[0139] In some embodiments, the storage data access device may further include a display screen 62, an input / output interface 63, a communication interface 64, a power supply 65, and a communication bus 66.
[0140] Those skilled in the art can understand that Figure 5 the structure shown in
[0141] does not constitute a limitation on the storage data access device, and may include more or fewer components than shown in the figure.
[0142] Based on this, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the storage data access method as described above are implemented.
[0143] The above has introduced in detail a method for accessing stored data provided by the embodiments of the present invention. The various embodiments in the specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. For the same or similar parts among the various embodiments, reference can be made to each other. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple. For the relevant parts, reference can be made to the description in the method part.
[0144] Those skilled in the art can 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 the two. To clearly illustrate the interchangeability of hardware and software, the composition 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. Skilled professionals 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 the present invention.
[0145] The above has introduced in detail a method, device, equipment, and readable storage medium for accessing stored data provided by the present invention. Specific examples are used herein to elaborate on the principles and implementation manners of the present invention. The description of the above embodiments is only used to help understand the method and its core idea of the present invention. It should be noted that for those of ordinary skill in the art in the technical field, without departing from the principle of the present invention, several improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the protection scope of the claims of the present invention.
Claims
1. A method for accessing stored data, characterized in that: Applied to a redundant array of independent disks, the redundant array of independent disks includes a master port, a slave port and a read-write cache area, the master port and the slave port are both connected to the read-write cache area, the method includes: The slave port of the redundant array of independent disks obtains the heartbeat information of the master port of the redundant array of independent disks from the read-write cache area; The slave port determines whether the master port is operating normally based on the heartbeat information of the master port; When it is determined that the primary port is not operating normally, the redundant array of independent disks enables an access path from the port to the storage device to access the storage data.
2. The storage data access method according to claim 1, characterized in that: Before the slave port of the redundant array of independent disks obtains the heartbeat information of the master port of the redundant array of independent disks from the read-write cache area, the method further includes: The independent redundant array of disks simultaneously starts the heartbeat programs of the master port and the slave port; The master port and the slave port determine the master port heartbeat information and the slave port heartbeat information based on the corresponding heartbeat program; The master port and the slave port write the master port heartbeat information and the slave port heartbeat information into the read-write cache area based on the cache position and cache size of the read-write cache area.
3. The storage data access method according to claim 1, characterized in that: The slave port determines whether the master port operates normally based on the heartbeat information of the master port, including: The master port writes the master port heartbeat information to the target location in the read-write buffer area at preset intervals; wherein the master port heartbeat information includes a heartbeat information timestamp, a master port state, and corresponding identifiers of the master port and the slave port; the heartbeat information timestamp is a timestamp corresponding to the heartbeat information sent by the master port; the master port state includes a fault state and a normal state; The slave port reads the heartbeat information of the master port from the target location at intervals of the preset time; When the identifier of the corresponding master port read by the slave port is correct, and the master port state is normal, and the time difference determined based on the heartbeat information timestamp is less than a preset time threshold, the slave port determines that the master port is in a normal working state; When the corresponding master port identifier read is wrong, and the master port state is normal, and the time difference determined based on the heartbeat information timestamp is less than the preset time threshold, it is determined that the state of the master port is normal sending of heartbeats and the master port is unavailable, and it is determined that the master port cannot work normally; When the identifier of the corresponding master port read is correct, and the state of the master port is abnormal, and the time difference determined based on the heartbeat information timestamp is less than a preset time threshold, it is determined that the state of the master port is sending heartbeats normally and the master port is unavailable, it is determined that the master port cannot work normally, and at the same time, the independent disk redundant array is notified to stop the master port heartbeat; When the read identifier of the corresponding primary port is correct, the primary port state is normal, and the time difference determined based on the heartbeat information timestamp is greater than the preset time threshold, it is determined that the primary port cannot work normally.
4. The storage data access method according to claim 1, characterized in that: When it is determined that the primary port is not working properly, the independent redundant array of disks enables an access path from the port to the storage device to access storage data, including: When it is determined that the master port is not working properly, the independent disk redundant array enables the slave server to switch from a data access prohibited state to a data access state, the slave port receives a storage data access request from the slave server and performs storage data access, the independent disk redundant array enables the master port to stop storage data access, and enables the master server to switch from a data access state to a data access prohibited state.
5. The storage data access method according to claim 4, characterized in that: When it is determined that the master port is not working properly, the independent redundant array of disks enables the slave server to switch from the data access prohibited state to the data access state, the slave port receives the storage data access request of the slave server and performs storage data access, the independent redundant array of disks enables the master port to stop storage data access, and before enabling the master server to switch from the data access state to the data access prohibited state, the method further includes: The independent redundant array of disks interconnects the master port with the master server, and interconnects the slave port with the slave server.
6. The storage data access method according to any one of claims 1 to 5, characterized in that: When it is determined that the primary port is not working properly, the independent redundant array of disks enables an access path from the port to the storage device to access the storage data, and further includes: The external detection device obtains the corresponding master port log based on the timestamp in the master port heartbeat information; the external detection device is interconnected with the independent disk redundant array; The external detection device determines the fault cause of the primary port and the corresponding fault solution based on the primary port log; The external detection device restores the primary port based on the fault solution to obtain a restored primary port; The independent redundant array of disks starts the heartbeat of the master port and sends the information that the master port has recovered to the slave port.
7. The storage data access method according to claim 1, characterized in that: Also includes: The redundant array of independent disks serves as a primary redundant array of independent disks; During the storage data reading process, the master independent disk redundant array synchronizes the configuration and caches the data to the slave independent disk redundant array in real time, so that when the master port and the slave port both have irreparable failures, the storage data can be accessed based on the slave independent disk redundant array and the server and port connected to the slave independent disk redundant array.
8. A storage data access device, characterized in that: Applied to a redundant array of independent disks, the redundant array of independent disks includes a master port, a slave port and a read-write cache area, the master port and the slave port are both connected to the read-write cache area, and the device includes: A master port heartbeat information determination module, used for the slave port of the redundant array of independent disks, to obtain the master port heartbeat information of the redundant array of independent disks from the read-write buffer area; A judgment module, used for the slave port to determine whether the master port is operating normally based on the heartbeat information of the master port; The continuous access module is used for enabling the access path from the port to the storage device to access the storage data when it is determined that the primary port is not working properly.
9. A storage data access device, characterized in that: include: Memory for storing computer programs; A processor, configured to execute the computer program to implement the steps of the storage data access method as claimed in any one of claims 1 to 7.
10. A readable storage medium, characterized in that: The readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the storage data access method according to any one of claims 1 to 7 are implemented.