Data writing method and electronic device

By employing a dual-controller redundant storage architecture and a data backup mechanism using shared memory devices, the write vulnerability issue in RAID technology is resolved, ensuring data integrity and system stability, and improving the reliability and response performance of the RAID system.

CN120973316BActive Publication Date: 2026-01-27INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202511479334.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-16
Publication Date
2026-01-27
Estimated Expiration
2045-10-16

AI Technical Summary

Technical Problem

Existing RAID technology has write vulnerabilities during the data writing process, which reduces data integrity and system stability, especially in cases of sudden power outages or controller failures, where data blocks have been written but parity blocks have not been successfully written.

Method used

A dual-controller redundant storage architecture is adopted, which backs up the data identification number between the two storage controllers through a shared memory device and performs asynchronous persistent synchronization in non-volatile memory to ensure that data can still be written even if either controller fails.

Benefits of technology

It improves data accuracy and system stability, avoids write vulnerabilities, ensures data consistency and integrity, reduces the latency of state synchronization between controllers, and improves system response performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120973316B_ABST
    Figure CN120973316B_ABST
Patent Text Reader

Abstract

The disclosure provides a data writing method and an electronic device, and relates to the technical field of data processing. In some embodiments of the disclosure, a first storage controller receives a data writing request of target data; according to the data writing request, a data identification number corresponding to the target data is generated; the target data and the data identification number are issued to a shared memory device, so that the shared memory device saves the target data to a target memory address corresponding to the data identification number according to the data identification number; according to a data backup completion notification uploaded by the shared memory device, the data identification number is sent to a second storage controller; according to a reply message returned by the second storage controller, the data identification number is saved to a non-volatile memory of the first storage controller, and the target data is written to a disk; the disclosure guarantees the correctness of data and improves system stability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of data processing technology, and in particular to a data writing method and an electronic device. Background Technology

[0002] In modern data storage systems, RAID (Redundant Array of Independent Disks) is widely used to improve data read and write speed and data security.

[0003] Existing RAID technology effectively improves the performance and reliability of storage systems through data striping and parity checking. Specifically, during data writing, the RAID controller divides the user's data into multiple blocks and distributes these blocks across different hard drives in the RAID group. Simultaneously, it calculates corresponding parity information based on these data blocks and writes it to a designated parity block location. When a hard drive fails, the remaining data blocks and parity information can be used to reconstruct the lost data, ensuring data availability and consistency. Furthermore, to prevent data loss, hot spare drives are typically configured to automatically replace damaged hard drives in case of failure, further enhancing data protection capabilities.

[0004] Currently, RAID has a write vulnerability during the data writing process. This vulnerability occurs when a sudden power outage or controller failure causes data blocks to be written but the corresponding parity blocks to fail to be written, resulting in reduced data integrity and system stability. Summary of the Invention

[0005] This disclosure provides a data writing method and an electronic device to at least solve the problems of reduced data accuracy and reduced system stability.

[0006] According to a first aspect of this disclosure, a data writing method is provided, comprising:

[0007] Receive data write request for target data;

[0008] Based on the data write request, generate a data identifier number corresponding to the target data;

[0009] The target data and the data identifier number are sent to the shared memory device so that the shared memory device can save the target data to the target memory address corresponding to the data identifier number according to the data identifier number, and return a data backup completion notification to the first storage controller;

[0010] Upon receiving the data backup completion notification uploaded by the shared memory device, the data identifier number is sent to the second storage controller, so that the second storage controller can save the data identifier number in the non-volatile memory of the second storage controller and return a reply message to the first storage controller; wherein, the first storage controller and the second storage controller are communicatively connected to the shared memory device;

[0011] Based on the response message received from the second storage controller, the data identifier number is saved to the non-volatile memory of the first storage controller, and the target data is written to the disk.

[0012] According to a second aspect of this disclosure, a data writing method is provided, comprising:

[0013] If a fault is detected in the first storage controller, the data identifier number is searched in the non-volatile memory of the second storage controller to obtain the search result;

[0014] If the search result is successful, a backup data read request is sent to the shared memory device, so that the shared memory device can find the target memory address associated with the data identifier number according to the data identifier number in the backup data read request, and upload the target data stored in the target memory address to the second storage controller; wherein, the first storage controller and the second storage controller are communicatively connected to the shared memory device;

[0015] The system receives the target data uploaded by the shared memory device and writes the target data to the disk.

[0016] According to a third aspect of this disclosure, an electronic device is provided, comprising:

[0017] At least one processor; and

[0018] A memory communicatively connected to the at least one processor; wherein,

[0019] The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the methods described in the first and second aspects above.

[0020] In some embodiments of this disclosure, a first storage controller receives a data write request for target data; generates a data identifier number corresponding to the target data based on the data write request; sends the target data and the data identifier number to a shared memory device, so that the shared memory device can save the target data to the target memory address corresponding to the data identifier number; sends the data identifier number to a second storage controller based on a data backup completion notification received from the shared memory device, so that the second storage controller can save the data identifier number to its non-volatile memory; wherein, the first and second storage controllers are communicatively connected to the shared memory device; based on a reply message returned by the second storage controller, the data identifier number is saved to the non-volatile memory of the first storage controller, and the target data is written to the disk; in this disclosure, during the data writing process, the controller backs up the data through the shared memory device and saves the data identifier number on two redundant storage controllers. The two storage controllers can share the backup data, and in the event of a failure of one storage controller, the other storage controller can complete the data write operation, ensuring data integrity and improving system stability.

[0021] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this application, nor is it intended to limit the scope of this application. Other features of this application will become readily apparent from the following description. Attached Figure Description

[0022] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:

[0023] Figure 1 A flowchart illustrating a data writing method provided for an exemplary embodiment of this disclosure;

[0024] Figure 2 A schematic diagram of a data writing system provided for an exemplary embodiment of this disclosure;

[0025] Figure 3 A flowchart illustrating another data writing method provided for an exemplary embodiment of this disclosure;

[0026] Figure 4 A schematic diagram of the structure of a data writing device provided for an exemplary embodiment of this disclosure;

[0027] Figure 5 A schematic diagram of another data writing device provided as an exemplary embodiment of this disclosure;

[0028] Figure 6 A schematic diagram of the structure of an electronic device provided for an exemplary embodiment of this disclosure. Detailed Implementation

[0029] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0030] The data writing method, apparatus, and electronic device of this disclosure are described below with reference to the accompanying drawings.

[0031] From the perspective of the first storage controller, Figure 1 This is a flowchart illustrating a data writing method provided as an exemplary embodiment of the present disclosure.

[0032] like Figure 1 As shown, the method includes the following steps:

[0033] Step 101: Receive the data write request for the target data.

[0034] Step 102: Generate a data identifier number corresponding to the target data based on the data write request.

[0035] Step 103: Send the target data and data identifier number to the shared memory device so that the shared memory device can save the target data to the target memory address corresponding to the data identifier number and return a data backup completion notification to the first storage controller.

[0036] Step 104: Based on the received data backup completion notification uploaded by the shared memory device, send the data identification number to the second storage controller so that the second storage controller can save the data identification number in the non-volatile memory of the second storage controller and return a reply message to the first storage controller; wherein, the first storage controller and the second storage controller are communicatively connected to the shared memory device.

[0037] Step 105: Based on the response message returned by the second storage controller, save the data identifier number to the non-volatile memory of the first storage controller and write the target data to the disk.

[0038] In this embodiment, the entity executing the above method can be a server or a terminal device.

[0039] The terminal device includes, but is not limited to, mobile stations (MS), mobile terminals, mobile phones, handsets, and portable equipment. This terminal device can communicate with one or more core networks via a radio access network (RAN). For example, the terminal device can be a mobile phone (or "cellular" phone), a computer with wireless communication capabilities, a computer with wireless transceiver capabilities, a virtual reality (VR) terminal device, an AR terminal device, a wireless terminal in industrial control, a wireless terminal in self-driving, a wireless terminal in remote medical care, a wireless terminal in a smart grid, a wireless terminal in transportation safety, a wireless terminal in a smart city, a wireless terminal in a smart home, etc. The operating systems installed on the terminal device include, but are not limited to, iOS, Android, Windows, Linux, and Mac OS. In different networks, terminals may be called by different names, such as: user equipment, mobile station, user unit, station, cellular phone, personal digital assistant, wireless modem, wireless communication device, handheld device, laptop, cordless phone, wireless local loop station, television, etc. For ease of description, this embodiment will simply refer to it as terminal device.

[0040] In this embodiment, the implementation form of the server is not limited. For example, the server can be a conventional server, a cloud server, a cloud host, a virtual center, or other server devices. The server mainly consists of a processor, hard disk, memory, system bus, and other common computer architecture types.

[0041] Figure 2 This is a schematic diagram of a data writing system provided as an exemplary embodiment of the present disclosure. For example... Figure 2 As shown, the data writing system includes a first storage controller, a second storage controller, and a shared memory device. This disclosure employs a dual-controller redundant storage architecture, establishing a communication connection between the first storage controller, the second storage controller, and the shared memory device to achieve data and signal transmission.

[0042] Specifically, a high-speed communication link is established between the first and second storage controllers via fiber optic cables for transmitting control signaling and status synchronization information. Simultaneously, both controllers are connected to the same shared memory device via a high-speed interconnect bus (such as CXL or PCIe). This shared memory device can be an external DDR storage module or a persistent memory device supporting memory semantic sharing. After the physical connection is established, both controllers have read and write access to the shared memory device, enabling them to write runtime critical data, cached data, RAID metadata, incomplete IO context, or log information to the shared memory, which is then read and processed in real time by the other controller. Through mature high-speed interconnect protocols such as high-speed interconnect buses, cross-controller memory-level data sharing and low-latency access are achieved. Therefore, in the event of a failure in either controller, the other controller can immediately retrieve the operating status and unwritten data of the failed controller from the shared memory, continue data processing tasks, and ensure continuous system operation.

[0043] This disclosure improves the reliability and fault recovery capabilities of the storage system by connecting two redundant controllers to the same shared memory device and enabling cross-controller memory access using a high-speed interconnect protocol. When one controller fails, the other controller can quickly read the failed controller's cached data and I / O context from the shared memory, avoiding data loss or write vulnerabilities caused by controller failure and effectively ensuring the consistency and integrity of RAID stripe data. Simultaneously, the shared memory mechanism reduces the overhead of transmitting a large number of control messages under traditional heartbeat mechanisms, lowers the latency of inter-controller state synchronization, and improves the overall system response performance. Furthermore, utilizing existing mature hardware-level memory sharing technologies such as CXL or PCIe eliminates the need for additional customized dedicated hardware, offering good compatibility and scalability, and facilitating rapid deployment and application in existing storage architectures.

[0044] In this embodiment, the first storage controller receives a data write request for target data; generates a data identifier number corresponding to the target data based on the data write request; sends the target data and the data identifier number to the shared memory device, so that the shared memory device can save the target data to the target memory address corresponding to the data identifier number; according to the data backup completion notification received from the shared memory device, sends the data identifier number to the second storage controller, so that the second storage controller can save the data identifier number to the non-volatile memory of the second storage controller; wherein, the first storage controller and the second storage controller are communicatively connected to the shared memory device; according to the reply message returned by the second storage controller, the data identifier number is saved to the non-volatile memory of the first storage controller, and the target data is written to the disk; in this disclosure, during the data writing process, the controller backs up the data through the shared memory device and saves the data identifier number on two redundant storage controllers. The two storage controllers can share the backup data. In the event of a failure of one storage controller, the other storage controller can complete the data write operation, ensuring the correctness of the data and improving system stability.

[0045] In some embodiments of this disclosure, the first storage controller receives a data write request for the target data. In a dual-controller redundant storage architecture, the triggering of a data write request typically begins with the host initiating an I / O operation to the storage system. When an upper-layer application needs to write data, it generates a write command through the operating system or file system and sends it to the storage network. This command is ultimately received and parsed by the first storage controller. The first storage controller, as the controller responsible for the current I / O request, is responsible for processing the request, including address mapping, RAID level calculation, data striping, and verification generation.

[0046] In some embodiments of this disclosure, the first storage controller generates a data identifier number corresponding to the target data based on a data write request. One possible implementation is to extract the logical block address and write length from the target data based on the data write request; then, the logical block address, write length, and a random number are concatenated to obtain the data identifier number corresponding to the target data. Specifically, when the first storage controller receives a data write request initiated by the host side, it first parses the input / output information in the request to obtain the logical block address (LBA) and write length corresponding to the target data to be written, where the write length is represented by the number of logical blocks. Based on the LBA and write length information, the first storage controller further generates a data identifier number uniquely corresponding to this write operation. Specifically, the controller combines the obtained LBA value, write length value, and a randomly generated random number to form a unique number in the format LBA_write length_random number. For example, if the LBA is 1024, the write length is 8, and the generated random number is 789012, then the corresponding data identifier number is "1024_8_789012". This data identifier number is used to uniquely identify this write IO in subsequent processing, which facilitates recording the IO context in shared memory, enabling write operation tracking and fault recovery, and ensuring that incomplete write tasks can still be accurately identified and processed in controller switching or fault scenarios, thereby improving data consistency and system reliability.

[0047] In some embodiments of this disclosure, the first storage controller sends the target data and a data identifier number to the shared memory device, so that the shared memory device can save the target data to the target memory address corresponding to the data identifier number and return a data backup completion notification to the first storage controller. Specifically, after generating the data identifier number, the first storage controller sends the target data (i.e., the IO data content) corresponding to this write request and the data identifier number to the shared memory device, initiating a data backup request. Upon receiving the request, the shared memory device first parses the data identifier number to extract the write length information. Based on the parsed write length, the shared memory device dynamically allocates a memory space of the corresponding size and establishes a mapping relationship between the starting address of this memory space and the data identifier number, recording it in an internal address mapping table. Subsequently, the shared memory device writes the received target data to the allocated memory address associated with the data identifier number. When the data writing is complete, the shared memory device returns a data backup completion notification to the first storage controller to confirm that the IO data has been reliably saved in the shared memory. Through this mechanism, even if the first storage controller fails during subsequent processing, the second storage controller can still locate and read the original data content in the shared memory through the data identifier number, thus ensuring data continuity and consistency in failure scenarios.

[0048] In some embodiments of this disclosure, the first storage controller sends a data identifier to the second storage controller upon receiving a data backup completion notification from the shared memory device. The second storage controller then saves the data identifier to its non-volatile memory and sends a response message back to the first storage controller. Upon receiving the data backup completion notification from the shared memory device, the first storage controller confirms that the target data has been reliably stored in the shared memory device and triggers a state synchronization mechanism between the redundant controllers. Specifically, the first storage controller sends the data identifier corresponding to the write operation to the redundant second storage controller. Upon receiving the data identifier, the second storage controller stores it in its configured non-volatile memory, such as FRAM, MRAM, or DRAM with capacitor protection, to ensure that the identifier information is persistently stored even in the event of a system power failure or a failure of the first storage controller. After completing the persistent storage of the data identifier, the second storage controller sends an acknowledgment message to the first storage controller, indicating that the redundant backup of the data identifier has been completed. This mechanism achieves asynchronous persistent synchronization of critical I / O information between the two controllers.

[0049] In some embodiments of this disclosure, the first storage controller saves the data identifier number to its non-volatile memory based on the response message received from the second storage controller, and writes the target data to the disk. When the first storage controller receives an acknowledgment message from the second storage controller, it indicates that the data identifier number corresponding to the write operation has been persistently saved in the second storage controller's non-volatile memory. Subsequently, the first storage controller also saves the data identifier number itself to its locally configured non-volatile memory to ensure that the context information of the IO can still be reliably recovered in the event of an unexpected power outage or system failure. After completing the local persistent storage of the data identifier number, the first storage controller begins the subsequent data write-to-disk processing flow: based on the received target data, it calculates the corresponding P and Q parity blocks according to the RAID algorithm, and writes the target data and the newly generated parity blocks together to the corresponding physical location in the back-end disk array. Through this processing mechanism, it is ensured that the unique identifier of the IO has been redundantly recorded in the non-volatile memory of both controllers before the data is written to the disk.

[0050] In some embodiments of this disclosure, after the first storage controller writes the target data to the disk, it needs to release backup data to complete the write I / O. One possible approach is to send a numbered release request to the second storage controller, so that the second storage controller can remove the data identifier number from its non-volatile memory according to the numbered release request and return a numbered removal success message to the first storage controller; based on the numbered removal success message returned by the second storage controller, the data identifier number is removed from the non-volatile memory of the first storage controller, and a first release backup data request is sent to the shared memory device, so that the shared memory device can find the target memory address associated with the data identifier number according to the data identifier number carried in the first release backup data request and remove the target data from the target memory address. Wherein, after the first storage controller completes the disk write operation of the target data and its corresponding P and Q check blocks, it enters the I / O end processing stage. The first storage controller first sends a numbered release request to the second storage controller, which carries the data identifier number corresponding to this I / O. Upon receiving the release request, the second storage controller locates the corresponding record in its local non-volatile memory based on the data identifier number, removes it from the non-volatile memory to free up storage space, and returns a successful removal message to the first storage controller in response. Upon receiving this response, the first storage controller synchronously removes the same data identifier number stored in its own non-volatile memory. Subsequently, the first storage controller sends a first release backup data request to the shared memory device, which includes the data identifier number to be released. Upon receiving the request, the shared memory device parses and obtains the data identifier number, and based on the pre-established mapping relationship between the number and memory address, finds the target memory address associated with that number; then, it clears the backup target data stored at that memory address and releases the corresponding memory resources. This disclosure ensures that after I / O processing is completed, the relevant context information in the non-volatile memory and shared memory of both controllers is reliably cleared, avoiding resource leaks and ensuring system state consistency.

[0051] In the above embodiments, after the shared memory device removes the target data from the target memory address, a first relationship disassociation success message is received from the shared memory device. This first relationship disassociation success message is sent by the shared memory device after disassociating the data identifier number from the target memory address. Based on the relationship disassociation success message, the write operation of the target data is stopped. After the shared memory device completes the clearing operation of the target data according to the first release backup data request, it deletes the mapping relationship between the data identifier number and its associated target memory address from its internal address table to completely disassociate them. After completing this relationship disassociation operation, the shared memory device uploads the first relationship disassociation success message to the first storage controller to notify that resource cleanup is complete. Upon receiving this message, the first storage controller confirms that all redundant state information, cached data, and context records involved in this write IO have been safely released, and then stops the write operation of the target data, marking the final end of the IO process.

[0052] In some embodiments of this disclosure, in the event of a failure in the first storage controller, the RAID enters a fault recovery phase, and the redundant second storage controller writes the target data to the disk.

[0053] Figure 3 A flowchart illustrating another data writing method provided as an exemplary embodiment of this disclosure. (e.g.) Figure 3 As shown, the method includes:

[0054] S301: If a fault is detected in the first storage controller, the data identifier number is searched in the non-volatile memory of the second storage controller to obtain the search result;

[0055] S302: If the search result is successful, a backup data read request is sent to the shared memory device so that the shared memory device can find the target memory address associated with the data identifier number according to the data identifier number in the backup data read request, and upload the target data stored in the target memory address to the second storage controller; wherein, the first storage controller and the second storage controller are communicatively connected to the shared memory device;

[0056] S303: Receives target data uploaded by the shared memory device and writes the target data to the disk.

[0057] In some embodiments of this disclosure, when the second storage controller detects a fault in the first storage controller, it searches for a data identifier number in its non-volatile memory to obtain the search result. Specifically, when the second storage controller detects that the first storage controller has entered a fault state, to ensure the consistency of incomplete I / O data and system continuity, the second storage controller initiates a fault recovery process. First, the second storage controller traverses and searches its locally configured non-volatile memory for stored data identifier numbers. These data identifier numbers are I / O context identifiers synchronized from the first storage controller to the second storage controller and persistently saved during normal operation. If the search result is empty, i.e., no valid data identifier number is found, it indicates that there were no incomplete write operations that needed to be recovered before the first storage controller failed, and the second storage controller stops subsequent fault recovery operations. Conversely, if one or more data identifier numbers are found, it indicates that the corresponding data write operation was not completed when the fault occurred, and data recovery processing is required. Each found number represents an I / O operation that was not fully written to disk. The second storage controller will read the corresponding target data from the shared memory device based on the data identifier number and continue to perform subsequent operations such as RAID check calculation and data writing to disk to complete the write task that was not completed before the failure.

[0058] In some embodiments of this disclosure, if the search result is successful, a backup data read request is sent to the shared memory device. The shared memory device then locates the target memory address associated with the data identifier number in the backup data read request and uploads the target data stored at the target memory address to the second storage controller. When the second storage controller finds a valid data identifier number in the non-volatile memory, it indicates that the first storage controller had unprocessed write I / Os before the failure, requiring fault recovery. Therefore, the second storage controller sends a backup data read request to the shared memory device, carrying the found data identifier number. Since both the first and second storage controllers are connected to the shared memory device via a high-speed interconnect link, upon receiving the request, the shared memory device parses the data identifier number and, based on a pre-established mapping relationship between the number and the memory address, locates and positions the target memory address associated with that number. Subsequently, the shared memory device reads the backed-up target data from the target memory address and uploads it to the second storage controller. After receiving the data, the second storage controller obtains the original data content of the incomplete IO before the failure. Based on this, it can continue to perform RAID check calculation, P / Q block update and data write to disk, thereby completing the continuation processing of incomplete IO and ensuring consistency.

[0059] In some embodiments of this disclosure, target data uploaded by a shared memory device is received and written to a disk. The data identifier number is parsed to obtain the logical block address and write length; the target data uploaded by the shared memory device is received; a check block is calculated based on the target data; and the target data and check block are written to the disk according to the logical block address and write length. Specifically, when the second storage controller receives the target data uploaded by the shared memory device, it initiates a fault recovery write process. First, the second storage controller parses the data identifier number corresponding to the IO, extracting the logical block address and write length information contained therein to determine the write location and data range of the target data in the storage space. Simultaneously, the second storage controller receives and confirms the integrity of the target data obtained from the shared memory device. Subsequently, based on the target data, corresponding P and Q parity blocks are calculated and generated according to the RAID algorithm. After completing the check block calculation, the second storage controller writes the target data to the corresponding data disk in the disk array according to the parsed LBA and writes the newly generated P and Q check blocks to the corresponding check disk, thereby completing the full disk write operation for the incomplete IO. This disclosure discloses a second storage controller that, after taking over the tasks of a failed controller, avoids write vulnerabilities caused by controller failure, thereby improving the consistency of RAID stripe data and the reliability of user data.

[0060] In some embodiments of this disclosure, after receiving target data uploaded by the shared memory device and writing the target data to the disk, the second storage controller deletes the data identifier number from the non-volatile memory of the second storage controller.

[0061] In some embodiments of this disclosure, a second release backup data request is issued to the shared memory device. This allows the shared memory device to locate the target memory address associated with the data identifier number carried in the second release backup data request, and remove the target data from the target memory address. A second relationship disassociation success message is received from the shared memory device. This second relationship disassociation success message is sent by the shared memory device after disassociating the data identifier number from the target memory address. After the second storage controller completes the disk write operation of the target data and its corresponding P and Q checksum blocks, to clean up the intermediate resources occupied during the fault recovery process, the second storage controller issues a second release backup data request to the shared memory device. This request carries a data identifier number used to identify this I / O operation. Upon receiving this request, the shared memory device parses and obtains the data identifier number, and based on the internally maintained number-to-memory address mapping relationship, locates the associated target memory address, clears the backup target data stored at that address, and releases the corresponding memory space. Subsequently, the shared memory device removes the association between the data identifier and the target memory address from the mapping table, completing the complete decoupling of the resources, and uploads a "Second Relationship Decoupling Successful" message to the second storage controller to confirm that the backup data and related metadata have been successfully cleared. Upon receiving this message, the second storage controller confirms that the fault recovery process has been fully completed. It then continues to iterate through its non-volatile memory to check for any remaining unprocessed data identifiers. If any are found, the recovery process described above is executed sequentially. If the iteration is complete and there are no more identifiers to be recovered, it is determined that all incomplete I / O has been processed, and the entire fault recovery operation ends.

[0062] For example, Figure 4 This is a schematic diagram of the structure of a data writing device 40 provided for an exemplary embodiment of this disclosure. (See diagram below.) Figure 4 As shown, the data writing device 40 includes: a receiving module 41, a generating module 42, a sending module 43, a sending module 44, and a writing module 45.

[0063] Among them, the receiving module 41 is used to receive the data write request of the target data;

[0064] The generation module 42 is used to generate a data identifier number corresponding to the target data according to the data write request;

[0065] The distribution module 43 is used to distribute the target data and data identifier number to the shared memory device, so that the shared memory device can save the target data to the target memory address corresponding to the data identifier number according to the data identifier number, and return a data backup completion notification to the first storage controller;

[0066] The sending module 44 is used to send a data identification number to the second storage controller according to the received data backup completion notification uploaded by the shared memory device, so that the second storage controller can save the data identification number into the non-volatile memory of the second storage controller and return a reply message to the first storage controller; wherein the first storage controller and the second storage controller are communicatively connected to the shared memory device;

[0067] The write module 45 is used to save the data identifier number to the non-volatile memory of the first storage controller according to the reply message returned by the second storage controller, and write the target data to the disk.

[0068] Optionally, when generating a data identifier number corresponding to the target data according to the data write request, the generation module 42 is used for:

[0069] Based on the data write request, extract the logical block address and write length from the target data;

[0070] By concatenating the logical block address, write length, and random number, a data identifier number corresponding to the target data is obtained.

[0071] Optionally, after writing the target data to the disk, the write module 45 can also be used for:

[0072] Send a number release request to the second storage controller so that the second storage controller can remove the data identifier number from the non-volatile memory of the second storage controller according to the number release request, and return a number removal success message to the first storage controller;

[0073] Based on the number removal success message returned by the second storage controller, the data identifier number is removed from the non-volatile memory of the first storage controller, and a first release backup data request is sent to the shared memory device. The shared memory device can then locate the target memory address associated with the data identifier number based on the data identifier number carried in the first release backup data request, and remove the target data from the target memory address.

[0074] Optionally, the write module 45 can also be used for:

[0075] After the shared memory device removes the target data from the target memory address, it receives a first relationship removal success message uploaded by the shared memory device; wherein, the first relationship removal success message is a message sent by the shared memory device after removing the association between the data identifier number and the target memory address;

[0076] Based on the successful termination message, stop the write process of the target data.

[0077] For example, Figure 5A schematic diagram of another data writing device 50 provided for an exemplary embodiment of this disclosure. (See diagram below.) Figure 5 As shown, the data writing device 50 includes: a search module 51, a backup module 52, and a disk writing module 53.

[0078] Among them, the lookup module 51, when the first storage controller is detected to be in a fault state, searches for the data identifier number in the non-volatile memory of the second storage controller to obtain the lookup result;

[0079] Backup module 52, when the search result is successful, sends a backup data read request to the shared memory device, so that the shared memory device can find the target memory address associated with the data identifier number according to the data identifier number in the backup data read request, and upload the target data stored in the target memory address to the second storage controller; wherein, the first storage controller and the second storage controller are communicatively connected to the shared memory device;

[0080] The disk writing module 53 receives the target data uploaded by the shared memory device and writes the target data to the disk.

[0081] Optionally, when the disk writing module 53 receives target data uploaded from the shared memory device and writes the target data to the disk, it is used to:

[0082] The data identifier number is parsed to obtain the logical block address and write length; and

[0083] Receive target data uploaded from the shared memory device;

[0084] Calculate the verification block based on the target data;

[0085] Based on the logical block address and write length, the target data and checksum block are written to the disk.

[0086] Optionally, after receiving the target data uploaded by the shared memory device and writing the target data to the disk, the disk writing module 53 can also be used for:

[0087] Remove the data identifier number from the non-volatile memory of the second storage controller.

[0088] Optionally, the disk writing module 53 can also be used for:

[0089] A second release backup data request is sent to the shared memory device so that the shared memory device can find the target memory address associated with the data identifier number based on the data identifier number carried in the second release backup data request, and remove the target data from the target memory address;

[0090] Receive a message indicating successful removal of the second relationship uploaded by the shared memory device; wherein, the message indicating successful removal of the second relationship is sent by the shared memory device after removing the association between the data identifier number and the target memory address.

[0091] Optionally, the disk writing module 53 can also be used for:

[0092] If the search result is unsuccessful, stop the fault recovery operation.

[0093] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0094] Figure 6 A schematic block diagram of an example electronic device 600 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0095] like Figure 6 As shown, device 600 includes a computing unit 601, which can perform various appropriate actions and processes based on a computer program stored in ROM (Read-Only Memory) 602 or a computer program loaded from storage unit 608 into RAM (Random Access Memory) 603. RAM 603 may also store various programs and data required for the operation of device 600. The computing unit 601, ROM 602, and RAM 603 are interconnected via bus 604. I / O (Input / Output) interface 605 is also connected to bus 604.

[0096] Multiple components in device 600 are connected to I / O interface 605, including: input unit 606, such as keyboard, mouse, etc.; output unit 607, such as various types of monitors, speakers, etc.; storage unit 608, such as disk, optical disk, etc.; and communication unit 609, such as network card, modem, wireless transceiver, etc. Communication unit 609 allows device 600 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0097] The computing unit 601 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, CPUs (Central Processing Units), GPUs (Graphics Processing Units), various special-purpose AI (Artificial Intelligence) computing chips, various computing units running machine learning model algorithms, DSPs (Digital Signal Processors), and any suitable processor, controller, microcontroller, etc. The computing unit 601 performs the various methods and processes described above, such as data writing methods. For example, in some embodiments, the data writing method may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 608. In some embodiments, part or all of the computer program may be loaded and / or installed on device 600 via ROM 602 and / or communication unit 609. When the computer program is loaded into RAM 603 and executed by the computing unit 601, one or more steps of the methods described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to perform the aforementioned data writing method by any other suitable means (e.g., by means of firmware).

[0098] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, FPGAs (Field Programmable Gate Arrays), ASICs (Application-Specific Integrated Circuits), ASSPs (Application-Specific Standard Products), SOCs (System-on-Chips), CPLDs (Complex Programmable Logic Devices), computer hardware, firmware, software, and / or combinations thereof. These various implementations may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0099] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0100] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, RAM, ROM, EPROM (Electrically Programmable Read-Only Memory) or flash memory, optical fiber, CD-ROM (Compact Disc Read-Only Memory), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0101] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (Cathode-Ray Tube) or LCD (Liquid Crystal Display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0102] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include LANs (Local Area Networks), WANs (Wide Area Networks), the Internet, and blockchain networks.

[0103] Computer systems can include clients and servers. Clients and servers are generally geographically separated and typically interact via communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. A server can be a cloud server, also known as a cloud computing server or cloud host, a hosting product within the cloud computing service system that addresses the shortcomings of traditional physical hosts and VPS (Virtual Private Server) services, such as high management difficulty and weak business scalability. Servers can also be servers for distributed systems or servers incorporating blockchain technology.

[0104] It's important to note that artificial intelligence (AI) is the study of enabling computers to simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, and planning). It encompasses both hardware and software technologies. AI hardware technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, and big data processing. AI software technologies primarily include computer vision, speech recognition, natural language processing, machine learning / deep learning, big data processing, and knowledge graph technologies.

[0105] The various numerical designations such as "first," "second," etc., used in this disclosure are merely for ease of description and are not intended to limit the scope of the embodiments of this disclosure, nor do they indicate a sequential order.

[0106] At least one of the features described in this disclosure can also be described as one or more, and multiple features can be two, three, four or more, and this disclosure does not impose any limitations. In the embodiments of this disclosure, for a technical feature, the technical features in that technical feature are distinguished by "first", "second", "third", "A", "B", "C" and "D", etc., and there is no sequential order or size order among the technical features described by "first", "second", "third", "A", "B", "C" and "D".

[0107] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.

[0108] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.

Claims

1. A data writing method, characterized in that, include: Receive data write request for target data; Based on the data write request, generate a data identifier number corresponding to the target data; The target data and the data identifier number are sent to the shared memory device so that the shared memory device can save the target data to the target memory address corresponding to the data identifier number according to the data identifier number, and return a data backup completion notification to the first storage controller; Upon receiving the data backup completion notification uploaded by the shared memory device, the data identifier number is sent to the second storage controller, so that the second storage controller can save the data identifier number in the non-volatile memory of the second storage controller and return a reply message to the first storage controller; wherein, the first storage controller and the second storage controller are communicatively connected to the shared memory device; Based on the response message received from the second storage controller, the data identifier number is saved to the non-volatile memory of the first storage controller, and the target data is written to the disk.

2. The method according to claim 1, characterized in that, The step of generating a data identifier number corresponding to the target data according to the data write request includes: Based on the data write request, extract the logical block address and write length from the target data; The logical block address, the write length, and the random number are concatenated to obtain the data identifier number corresponding to the target data.

3. The method according to claim 1, characterized in that, After writing the target data to the disk, the method further includes: Send a number release request to the second storage controller, so that the second storage controller can remove the data identifier number from the non-volatile memory of the second storage controller according to the number release request, and return a number removal success message to the first storage controller; Based on the number removal success message returned by the second storage controller, the data identifier number is removed from the non-volatile memory of the first storage controller, and a first release backup data request is sent to the shared memory device so that the shared memory device can find the target memory address associated with the data identifier number based on the data identifier number carried in the first release backup data request, and remove the target data from the target memory address.

4. The method according to claim 3, characterized in that, The method further includes: After the shared memory device removes the target data from the target memory address, a first relationship removal success message uploaded by the shared memory device is received; wherein, the first relationship removal success message is a message sent by the shared memory device after removing the association between the data identifier number and the target memory address; Based on the successful termination message, the writing process of the target data is stopped.

5. A data writing method, characterized in that, include: If a fault is detected in the first storage controller, the data identifier number is searched in the non-volatile memory of the second storage controller to obtain the search result; If the search result is successful, a backup data read request is sent to the shared memory device, so that the shared memory device can find the target memory address associated with the data identifier number according to the data identifier number in the backup data read request, and upload the target data stored in the target memory address to the second storage controller; wherein, the first storage controller and the second storage controller are communicatively connected to the shared memory device; Receive the target data uploaded by the shared memory device and write the target data to the disk; If the search result is unsuccessful, the fault recovery operation will be stopped.

6. The method according to claim 5, characterized in that, The step of receiving the target data uploaded by the shared memory device and writing the target data to the disk includes: The data identifier number is parsed to obtain the logical block address and write length; and Receive the target data uploaded by the shared memory device; Calculate the verification block based on the target data; The target data and the check block are written to the disk according to the logical block address and the write length.

7. The method according to claim 5, characterized in that, After receiving the target data uploaded by the shared memory device and writing the target data to the disk, the method further includes: The data identifier number is deleted from the non-volatile memory of the second storage controller.

8. The method according to claim 7, characterized in that, The method further includes: A second release backup data request is sent to the shared memory device so that the shared memory device can find the target memory address associated with the data identifier number carried in the second release backup data request, and remove the target data from the target memory address; Receive a second relationship removal success message uploaded by the shared memory device; wherein the second relationship removal success message is a message sent by the shared memory device after removing the association between the data identifier number and the target memory address.

9. An electronic device, characterized in that, include: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform the method of any one of claims 1-4 or 5-8.

Citation Information

Patent Citations

  • Data writing method, device and equipment for redundant disk array

    CN118585138A