Host data reading method, electronic device, medium and program product

By retrieving data from the backup storage space during kernel-mode detection of UCE, the system crash problem caused by UCE was resolved, achieving efficient reading of host data and system stability.

CN121143733BActive Publication Date: 2026-02-17INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511689826.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-18
Publication Date
2026-02-17
Estimated Expiration
2045-11-18

AI Technical Summary

Technical Problem

In computer systems, Uncorrectable Errors (UCEs) cause system crashes and affect the efficiency of reading host data. Existing technologies avoid crashes by terminating the operation of user-mode objects, but this also affects reading efficiency.

Method used

When a UCE is detected in kernel mode, data is retrieved from the spare storage space and transmitted to the target object, instead of terminating the object's operation, ensuring normal reading without the user's awareness.

Benefits of technology

This improves the efficiency of host data reading, avoids system crashes and data loss, and ensures the stability and reliability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121143733B_ABST
    Figure CN121143733B_ABST
Patent Text Reader

Abstract

The application discloses a host data reading method, an electronic device, a medium and a program product, and relates to the technical field of computers. The method comprises the following steps: detecting a target reading request in a data reading request initiated by a target object in a user state of a host, wherein the data reading request is used for reading data in a target storage space in a kernel state, the target reading request is used for reading data in a reference storage space, and the reference storage space is a storage space in which an uncorrectable error occurs in the target storage space; controlling the kernel state not to terminate running of the target object, and obtaining target data from data read by the target reading request in a backup storage space of the host; and transmitting the target data to the target object. Through the application, the technical problem of low reading efficiency of host data is solved, and the technical effect of improving the reading efficiency of host data is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a method for reading host data, electronic devices, media, and program products. Background Technology

[0002] In computer systems, storage space is a critical component for processing large amounts of data. With the increase in storage space, the number of transistors, and the expansion of computer system clusters, the storage error rate also rises. Among these, Uncorrected Correctable Errors (UCEs), as storage errors that cannot be corrected by hardware, can easily lead to system crashes and unnecessary downtime during data interaction between user space and kernel space, severely impacting system reliability and availability. To handle UCEs, related technologies generally terminate the execution of affected user-space objects to avoid system crashes. However, this approach can easily affect the efficiency of host data retrieval, resulting in low host data reading efficiency. Summary of the Invention

[0003] This application provides a method, electronic device, medium, and program product for reading host data, to at least solve the problem of low efficiency in reading host data in related technologies.

[0004] This application provides a method for reading host data, comprising: detecting that the kernel mode of the host receives a target read request from a target object in the user mode of the host, wherein the data read request is used to read data in the target storage space in the kernel mode, the target read request is used to read data in the reference storage space, the reference storage space is the storage space in the target storage space where an uncorrectable error has occurred, and the target storage space is used to cache data for the host; controlling the kernel mode not to terminate the operation of the target object, and obtaining the target data from the backup storage space of the host by retrieving the data read by the target read request, wherein the backup storage space is used to store data for the host; and transferring the target data to the target object.

[0005] This application also provides an electronic device, including: a memory for storing a computer program; and a processor for executing the computer program to implement the steps of any of the above-described host data reading methods.

[0006] This application also provides a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, it implements the steps of any of the above-described host data reading methods.

[0007] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of any of the above-described host data reading methods.

[0008] This application detects that the kernel mode of the detection host receives a target read request from a target object in the user mode of the host. The data read request is used to read data from the target storage space used for caching data for the host in the kernel mode. The target read request is used to read data from the reference storage space in the target storage space where an uncorrectable error has occurred. The kernel mode is controlled not to terminate the operation of the target object, and the target data is obtained from the backup storage space used for storing data for the host. The target data is then transferred to the target object. Compared with the approach of directly terminating the operation of the object that initiated the target read request, this application selects to obtain data from the backup storage space when accessing the storage space where an uncorrectable error has occurred and transfers it to the target object. This reduces the occurrence of situations where host data cannot be read normally and achieves seamless normal reading in the user mode. Therefore, it can solve the technical problem of low host data reading efficiency in related technologies and achieve the technical effect of improving host data reading efficiency. Attached Figure Description

[0009] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0010] Figure 1 This is a hardware structure block diagram of the host data reading method according to an embodiment of this application;

[0011] Figure 2 This is a flowchart of a host data reading method according to an embodiment of this application;

[0012] Figure 3 This is a flowchart of a method for handling user-mode access to storage space where an uncorrectable error has occurred, according to an embodiment of this application;

[0013] Figure 4 This is a timing diagram of a method for handling user-mode access to storage space where an uncorrectable error has occurred, according to an embodiment of this application.

[0014] Figure 5 This is a schematic diagram of a seamless recovery system according to an embodiment of this application;

[0015] Figure 6 This is a structural block diagram of a host data reading device according to an embodiment of this application. Detailed Implementation

[0016] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.

[0017] It should be noted that, in the description of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.

[0018] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0019] The specific application environment architecture or specific hardware architecture on which the execution of the host data reading method depends is described here.

[0020] The methods and embodiments provided in this application can be executed on a server device or a similar computing device. Taking running on a server device as an example, Figure 1 This is a hardware structure block diagram of a host data reading method according to an embodiment of this application. Figure 1 As shown, the server device may include one or more ( Figure 1 Only one is shown in the image. A processor 102 (which may include, but is not limited to, a central processing unit (CPU), microprocessor (MCU), or programmable logic device (FPGA), etc.) and a memory 104 for storing data are also shown. The server device may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the server equipment described above. For example, the server equipment may also include components that are more... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.

[0021] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the host data reading method in this embodiment. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, thus implementing the above-described method. The memory 104 may include high-speed random access memory and non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to server devices via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0022] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider for the server device. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module used for wireless communication with the Internet.

[0023] The embodiments of this application provide a method for reading host data, and the method is described in detail in conjunction with the execution flow of the host data reading method.

[0024] The following explains the technical terms used in this application:

[0025] Kernel mode is an execution mode in a computer operating system that provides full access to all system resources, including hardware devices, memory management, and CPU (Central Processing Unit) control. Kernel mode is the environment in which the operating system kernel runs, possessing the highest privilege level and the ability to execute any instruction, including those restricted in user mode. The primary tasks of kernel mode are managing and scheduling system resources, handling hardware interrupts, and executing system calls.

[0026] User mode is an alternative execution mode in a computer operating system, primarily used for running applications and user-level processes. In user mode, processes can only access limited system resources; the operating system kernel and other protected system areas are invisible to user-mode processes. This isolation is to protect system stability and security. User-mode processes can request system calls, communicating with kernel mode through these calls to access a wider range of system resources.

[0027] Uncorrectable Error (UCE) refers to errors that occur when a hardware device performs data read or write operations. These errors cannot be automatically corrected by the hardware's own error correction mechanisms. UCE can be caused by a variety of factors, including hardware aging, electromagnetic interference, or design flaws.

[0028] This embodiment provides a method for reading host data. Figure 2 This is a flowchart of a host data reading method according to an embodiment of this application, such as... Figure 2 As shown, the method includes the following steps:

[0029] Step S202: The kernel mode of the detection host receives a target read request from the target object in the user mode of the host. The data read request is used to read data in the target storage space in the kernel mode, and the target read request is used to read data in the reference storage space. The reference storage space is the storage space in the target storage space where an uncorrectable error has occurred. The target storage space is used to cache data for the host.

[0030] Step S204: Control the kernel mode to not terminate the execution of the target object, and obtain the target data from the host's spare storage space to read the data requested by the target. The spare storage space is used to store data for the host.

[0031] Step S206: Transfer the target data to the target object.

[0032] Through the above steps, the kernel mode of the detection host receives a target read request from the target object in the user mode of the host. The data read request is used to read data in the target storage space used for caching data for the host in the kernel mode. The target read request is used to read data in the reference storage space in the target storage space where an uncorrectable error has occurred. The kernel mode is controlled not to terminate the operation of the target object, and the target data is obtained from the backup storage space used for storing data for the host. The target data is then transferred to the target object. Compared with the approach of directly terminating the operation of the object that initiated the target read request, this application selects to obtain data from the backup storage space when accessing the storage space where an uncorrectable error has occurred and transfers it to the target object. This reduces the occurrence of situations where host data cannot be read normally and realizes seamless normal reading in the user mode. Therefore, it can solve the technical problem of low host data reading efficiency in related technologies and achieve the technical effect of improving host data reading efficiency.

[0033] In the embodiment provided in step S202, the host's kernel mode may, but is not limited to, receive data read requests initiated by the host's user mode in order to enable the user mode to access the cached data in the kernel mode.

[0034] Optionally, in this embodiment, the data read request may be, but is not limited to, used by the target object in user mode to convey its need to read data from the target storage space to the kernel mode. The data read request may be, but is not limited to, a data read command, a data read instruction, a data read system call, etc.

[0035] Optionally, in this embodiment, the data read request may, but is not limited to, carry a file identifier for the data to be read and a user-space virtual address for storing the read data. The kernel may, but is not limited to, upon receiving the data read request, search for the metadata of the data to be read in the metadata database of the target storage space based on the file descriptor carried in the data read request, and find the read location of the data to be read from the metadata. After reading the data from the read location, the kernel may, but is not limited to, write the data to the user-space storage space indicated by the user-space virtual address.

[0036] Optionally, in this embodiment, the target storage space may be, but is not limited to, the space in kernel mode for caching host data. Optionally, the target storage space may be, but is not limited to, kernel-mode memory space, etc.

[0037] Optionally, in this embodiment, the target object may be, but is not limited to, any computer program implemented in user mode that has the need or function to interact with kernel mode. The implementation form of the target object in user mode may include, but is not limited to, applications, processes, threads, etc. For example, the target object may be, but is not limited to, a user-mode application that needs to read data from kernel mode, or a process or thread in the user-mode application that implements the function of reading data from kernel mode, etc.

[0038] As an optional implementation, a target read request can be detected in the kernel mode of the host from a target object in the user mode of the host: The initiating object of the data read request is detected from the data read requests initiated from the user mode to the kernel mode to obtain a reference object; a reference object identifier is searched in a critical object library, where the reference object identifier is used to identify the function of the reference object, and the critical object library stores object identifiers of objects whose importance in the host is greater than an importance threshold; if no reference object identifier is found, it is determined that a data read request initiated by the target object has been detected, and a first space state of the storage space read by the data read request initiated by the target object is detected, the first space state indicating whether an uncorrectable error has occurred in the storage space read by the data read request; if the first space state indicates that an uncorrectable error has occurred in the storage space read by the data read request, it is determined that a target read request has been detected.

[0039] Optionally, in this embodiment, the reference object can be, but is not limited to, all objects that initiate data read requests from user space to kernel space. The implementation of the reference object in user space can, but is not limited to, applications, processes, threads, etc. The target object can be, but is not limited to, objects selected from the reference objects whose importance is less than or equal to an importance threshold, based on the object's importance to the host.

[0040] Optionally, in this embodiment, the critical object library may, but is not limited to, store object identifiers of objects whose importance on the host exceeds a certain threshold, i.e., object identifiers of objects that are critical to the operation of the host system. For these critical objects, to ensure the normal operation of the computer system, if these critical objects initiate a data read request to access data in the reference memory space where an uncorrectable error has occurred, the kernel may, but is not limited to, directly control the termination of the critical object that initiated the data read request. For example, for the critical object init process (initialization process), its main task is to establish a basic operating environment after system startup and manage all subsequent processes. Since all other processes are created directly or indirectly by the init process, the init process occupies a crucial position in the entire system. Any improper operation on it may lead to system crashes or instability. Therefore, for such a critical system process as init, the focus is on ensuring its absolute stability and correct operation. A more conservative approach may, but is not limited to, handling the situation where it initiates a data read request to access the memory space where an uncorrectable error has occurred, such as directly terminating the init process.

[0041] Through the above steps, the system first focuses on the target object in user space, checking whether it is a critical operator to determine whether to continue subsequent UCE processing requests. Next, the spatial state involved in the target read request is inspected to confirm whether any uncorrectable errors have occurred. This processing logic prioritizes protecting the system's core processes from abnormal signals, ensuring the continuity of critical operations and system stability. Because it starts with object detection, it can quickly exclude critical processes and avoid unnecessary interference, which has a significant advantage in ensuring the availability of system-level services.

[0042] As an optional implementation, the target read request can also be detected in the data read request initiated by the target object in the host's user space from the host's kernel space by, but not limited to, the following method: Detecting the second space state of each storage space in the target storage space, wherein the second space state is used to indicate whether an uncorrectable error has occurred in the storage space; determining the storage space in the target storage space whose second space state indicates that an uncorrectable error has occurred as a reference storage space; detecting the data read request whose read storage space is the reference storage space from the data read requests initiated from user space to kernel space, and obtaining a reference data read request; detecting the initiating object of the reference data read request, and obtaining a candidate object; searching for the candidate object identifier in the critical object library, wherein the candidate object identifier is used to identify the function of the candidate object, and the critical object library stores the object identifiers of objects whose importance in the host is greater than an importance threshold; if no candidate object identifier is found, determining that a data read request initiated by the target object to the reference storage space has been detected, and obtaining the target read request.

[0043] Optionally, in this embodiment, it is possible, but not limited to, first detecting whether an uncorrectable error has occurred in each storage space in the target storage space, finding a reference storage space, then finding a reference data read request to read data in the reference storage space, and finally checking whether the object initiating the reference data read request is a non-critical object, thereby detecting the target read request.

[0044] The above steps first involve a status check of the target storage space to identify any potential UCEs (Unique Memory Errors) before object verification. The advantage of this mechanism is that it allows for more comprehensive monitoring of the entire storage system's health, enabling timely detection and handling of memory faults even in read requests initiated by non-critical processes. This approach of checking the space status first helps to capture errors at an earlier stage, thereby preventing fault propagation and improving the overall robustness of the system.

[0045] Optionally, in this embodiment, the target read request received by the host's kernel mode from the target object in the host's user mode can also be detected through the following steps: recording the third space state of each storage space in the target storage space during multiple historical time periods before the current time, obtaining multiple third space states of each storage space, wherein each third space state is used to indicate whether an uncorrectable error has occurred in the storage space corresponding to the third space state during each historical time period; detecting the probability parameter of each storage space based on the multiple third space states of each storage space, wherein the probability parameter is used to indicate the probability of an uncorrectable error occurring in each storage space at the current time; detecting the target number of storage spaces in each storage space whose corresponding probability parameter is greater than or equal to the probability parameter threshold, and the relationship between the target number and the number threshold; if the target number is detected to be greater than or equal to the number threshold, detecting the target read request using the aforementioned method one; if the target number is detected to be less than the number threshold, detecting the target read request using the aforementioned method two. The implementation of detecting the probability parameter of each storage space based on the multiple third space states of each storage space may include, but is not limited to: training a prediction model of the storage space based on the multiple third space states; predicting the probability parameter of each storage space using the prediction model. Through the above steps, when processing data read requests, the potential impact range of the current UCE is first determined based on the probability parameter threshold and the quantity threshold. If the number of high-risk storage spaces exceeds a certain threshold, it indicates that the system is facing significant fault pressure. In this case, method one is prioritized: first, determine whether the data read request originates from a non-critical object, and then check whether a UCE has occurred in the storage space involved in the data read request. This protects the processing logic of critical services from being affected. Conversely, if the number of high-risk storage spaces does not reach the threshold, it indicates that the overall health of the system is acceptable. Method two is adopted: first, comprehensively check the status of the second space of the storage space (whether a UCE has occurred), and then process data read requests from non-critical objects. This approach emphasizes comprehensive monitoring to ensure the overall stability of the system, while avoiding excessive intervention in non-critical objects and optimizing resource allocation.

[0046] In the embodiment provided in step S204, compared to directly terminating the operation of the target object that initiated the target read request in order to avoid system crash, other methods can be used, but are not limited to, to obtain the data that the target read request originally intended to obtain. In this process, the normal operation of the target object is guaranteed, and system crash is avoided in a way that is imperceptible to the user.

[0047] Optionally, in this embodiment, the kernel mode can be controlled to prevent the target object from terminating in various ways, but not limited to. For example, custom hook functions or exception interceptors can be inserted into the kernel's exception handling path, but not limited to. These hooks or exception interceptors can, but not limited to, capture the event before receiving the termination signal, evaluate the context of the read operation (e.g., whether it is a read cache operation, the importance of the process, etc.), and cancel the action of sending the termination signal if appropriate, and instead enter the data recovery process. Specifically, the exception type and the attributes of the reference object can be checked in the send_sig_info() function (or a similar signal sending path), and the signal sending cannot continue when specific conditions are met (e.g., non-critical process, read cache operation, etc.). Alternatively, the kernel's signal handling function can be overridden or rewritten to create a special signal handling function for UCE errors. When a UCE exception occurs and is detected, the signal that would normally cause the process to terminate is captured, and instead of calling the default signal handling function, this custom handling function is called. The logic of this function evaluates the current read operation and process state, and decides whether to prevent the process from being terminated based on the evaluation result, and starts the data reread and recovery process. The advantage of this approach is that it allows direct intervention in signal handling behavior, ensuring that UCE errors are not misinterpreted as signals that a process is about to be terminated, but rather as data access failures that require special handling.

[0048] Optionally, in this embodiment, the kernel mode can also be controlled to prevent the target object from terminating by dynamically changing the processor function pointers in the exception handling table (such as _ex_table). Specifically, when a target read request is detected, the corresponding processor function in the kernel exception handling table can be located first, but is not limited to this. In the exception handling table, each entry is associated with a piece of kernel-mode code and an exception handler, used to catch and handle exceptions when that code is executed. Then, the function pointer of the exception handler can be temporarily replaced or overwritten using a new function pointer. The new function pointer points to a custom exception handler designed to handle exceptions related to UCE, rather than the default logic to terminate the target object.

[0049] As an optional implementation, the following methods can be used to prevent the target object from terminating in the kernel mode: detect the control signals to be transmitted from the kernel mode to the user mode carried by the candidate function interfaces in the kernel mode; select the target function interface from the candidate function interfaces, wherein the target function interface carries a target termination signal, which is used to terminate the target object's operation; and prevent the kernel mode from transmitting the target termination signal to the user mode.

[0050] Optionally, in this embodiment, the alternative function interface may be used, but is not limited to, for sending control signals from kernel mode to user mode, and the alternative function interface may be obtained by calling the send_sig_info() function.

[0051] Optionally, in this embodiment, the control signals carried by the alternative function interfaces may, but are not limited to, have different control functions.

[0052] Optionally, in this embodiment, the target function interface can be selected from the candidate function interfaces in the following ways, but not limited to: based on the signal type of the control signals carried by the candidate function interfaces, select the function interfaces carrying termination signals to obtain candidate function interfaces; search for the object indicated by the information instruction in the termination signals carried by the candidate function interfaces, wherein the function instructions included in the termination signal include information instructions and termination instructions, and the information instructions are used to indicate the object terminated by the termination instructions; determine the candidate function interface whose object is the target object as the target function interface.

[0053] Optionally, in this embodiment, different signal types may be used, but are not limited to, to indicate different signal functions. The termination signal may have, but is not limited to, its corresponding signal type. The candidate function interface carrying the termination signal may be found based on the signal type of the control signal carried by the alternative function interface.

[0054] Optionally, in this embodiment, the alternative function interface may, but is not limited to, carry information instructions and termination instructions. The information instructions may, but are not limited to, attributes used to indicate that the termination instructions are effective, such as, but are not limited to, attributes used to indicate the object terminated by the termination instructions.

[0055] Optionally, in this embodiment, different signal types may, but are not limited to, have different format requirements. It may, but is not limited to, first finding the termination signal, and further being able to find the object terminated by the termination instruction indicated by the information instruction at the setting position of the object indicated by the format according to the signal format of the termination signal, thereby speeding up the filtering speed of the target function interface.

[0056] Optionally, in this embodiment, the kernel mode may control the transmission of the target termination signal to the user mode in the following ways, but not limited to: locating the termination instruction in the target function instructions included in the target function interface, wherein the target termination signal includes the target function instructions, the target function instructions include the target information instructions and the termination instructions, the target information instructions are used to indicate the target object, and the termination instructions are used to terminate the execution of the object indicated by the information instructions; adding the target instruction to the termination signal to obtain the reference function interface, wherein the target instruction is used to control the skipping of the termination instruction during the execution of the termination signal.

[0057] Optionally, in this embodiment, after finding the target function interface, the termination instruction can be located in the target function instructions included in the target function interface, but is not limited to. A target instruction for controlling the skipping of the termination instruction during the execution of the termination signal is added to the termination signal to obtain the reference function interface. This enables the control kernel mode to not transmit the target termination signal to the user mode, ensuring that the target object in the user mode will not be abnormally terminated. Under non-critical circumstances, the host data reading operation can still be performed normally without the user mode's awareness.

[0058] Optionally, in this embodiment, the target instruction may include, but is not limited to, a skip instruction, and may include, but is not limited to, adding a skip instruction at the position closest to the termination instruction in the preceding position of the termination instruction, so that the termination instruction is skipped during the execution of the termination signal.

[0059] Optionally, in this embodiment, send_signal() can be prevented from being called by setting the target instruction, but not limited to this.

[0060] Optionally, in this embodiment, the transmission of the target termination signal from kernel mode to user mode can be controlled in the following ways, but not limited to: setting a signal interceptor in kernel mode, and after filtering out the target function interface, triggering the signal interceptor to prevent the target function interface from sending. Furthermore, a data recovery process can be triggered, but not limited to this. This is equivalent to adding a filter to signal processing, which can intelligently determine whether to retain or discard a signal based on process attributes and error type.

[0061] Optionally, in this embodiment, while controlling the kernel mode not to terminate the operation of the target object, the data that the target object needs to read can also be obtained from other means, but not limited to.

[0062] Optionally, in this embodiment, in the event of an uncorrectable error in the reference storage space, the data originally stored in the reference storage space can be retrieved from the backup storage space, but is not limited to that in the backup storage space. The backup storage space here can be, but is not limited to, storage space used to store data for the host; for example, the backup storage space can be, but is not limited to, the host's disk, etc.

[0063] Optionally, in this embodiment, the read / write speed of the backup storage space is generally lower than that of the target storage space.

[0064] As an optional implementation, the target data can be obtained from the host's spare storage space by, but is not limited to, retrieving the data requested by the target read request from the host's spare storage space in the following manner: obtaining index information of the data stored in the reference storage space, wherein the index information is used to indicate the spare storage location of the data stored in the reference storage space in the spare storage space; and retrieving the target data from the spare storage space according to the index information.

[0065] Optionally, in this embodiment, metadata of the data stored in the target storage space may be stored in the host, but is not limited to. The metadata may include, but is not limited to, source data for indicating the data of each file. The source data may be, but is not limited to, the index information of the data. The metadata of the data to be read may be found in the metadata database (e.g., the file system inode) based on the file descriptor of the data to be read included in the target read request, and then the index information of the data to be read (i.e., the data stored in the reference storage space) may be obtained from it.

[0066] By following the steps above and obtaining the index information of the data stored in the reference storage space, data can be read from the backup storage location, avoiding read failures due to reference storage space anomalies. This index-based reading mechanism provides data redundancy, enhances the reliability of data reading, ensures that user space can access complete and accurate data, and avoids data loss or service interruption due to memory failures.

[0067] Optionally, in this embodiment, the target data can be obtained from the backup storage space according to the index information in the following ways, but not limited to: reading the target data from the backup storage location; storing the target data in the kernel-mode available storage space, wherein the available storage space is the storage space allocated for the target data in the target storage space other than the reference storage space.

[0068] Optionally, in this embodiment, after finding the source attribute of the data, the target data can be read from the backup storage location according to the original path indicated by the source attribute, and after reading the target data, the target data can be stored in the kernel-mode available storage space newly allocated for the target data.

[0069] Optionally, in this embodiment, after reading the target data from the backup storage location, the integrity of the acquired target data can be verified using a file system checksum, but is not limited to this. For example, btrfs (a file system) calculates a checksum for each extent (disk block group), which can be verified using the btrfs_page_checksum function. Specifically, the btrfs_page_checksum function is used to calculate and verify the data checksum in a storage space page. In btrfs, each extent can, but is not limited to, calculate its data checksum and store it in the metadata. When reading data from the backup storage location, btrfs_page_checksum can, but is not limited to, recalculate the checksum of the read data and compare it with the checksum stored in the metadata to verify the integrity of the data. If the checksum matches, the data is considered complete; otherwise, the data may have been corrupted. By using file system-based data checksums, the integrity and accuracy of the data can be effectively verified after reading the target data from the backup storage location, ensuring that no new errors are introduced during data rereading and providing users with reliable data reading services.

[0070] By following the steps above, when the target data to be read is obtained from the target read request, the target data is first stored in the available storage space in the kernel mode. The target data is preprocessed and cached in the available storage space in the kernel mode, which can reduce the frequent data movement from low-speed media to high-speed media and help improve the data hit rate and read performance.

[0071] In the embodiment provided in step S206, after obtaining the target data from the backup storage space without terminating the operation of the target object, the target data may be provided to the target object, but is not limited to this step.

[0072] Optionally, in this embodiment, transmitting the target data to the target object may include, but is not limited to, establishing a shared memory segment that allows both kernel-mode and user-mode access, placing the target data in the shared memory segment, and then notifying the target object to access the data in the shared memory segment.

[0073] As an optional implementation, the target data can be transferred to the target object in the following ways, but not limited to: extracting target address information from the target read request, wherein the target address information is used to indicate the target storage location of the data read by the user-space storage through the target read request; writing the target data to the target storage location; and sending a notification message to the target object, wherein the notification message is used to notify the target object that the data in the reference storage space has been successfully read.

[0074] Optionally, in this embodiment, the target read request may, but is not limited to, carry the user-mode storage location of the data to be read received in user mode, that is, the target storage location here. The target data may, but is not limited to, be written to the target storage location, and then the target object is notified that the data in the reference storage space has been successfully read.

[0075] By following these steps, it is ensured that in the event of cache invalidation or memory errors, data re-reading and writing operations can accurately locate the expected storage location in user space, maintaining data integrity and storage consistency. User space does not need to be aware of the underlying exception handling and data recovery, which greatly simplifies program design and avoids the risks of data access errors and program crashes.

[0076] Optionally, in this embodiment, the target data can be written to the target storage location in the following ways, but not limited to: writing the target data to the target storage location through an available function interface, wherein the available function interface is used to write kernel-mode data to a user-mode storage location.

[0077] Optionally, in this embodiment, the available function interface may be used, but is not limited to, to write or copy data from kernel mode to user mode storage space. Optionally, the available function interface may be, but is not limited to, the copy_to_user() function, etc.

[0078] Optionally, in this embodiment, after writing the target data to the target storage location, the return value stored in the target register can be adjusted to the data length of the target data, but is not limited to. The user space is used to read data from the target storage location according to the return value stored in the target register for the target object.

[0079] Optionally, in this embodiment, the target register may be used, but is not limited to, to indicate the read length of data read from the target storage location by the user space. Optionally, the target register may be, but is not limited to, a return value register.

[0080] Through the above steps, the adjustment of the return value provides the user space with accurate data read volume information, ensuring that the target object can perform subsequent processing based on the actual amount of data read, thereby avoiding data processing errors or resource waste.

[0081] As an optional implementation, after the kernel mode of the detection host receives a target read request from the target object in the user mode of the host, an error flag can be added to the reference storage space, and the reference mapping relationship can be deleted from the target mapping library. The error flag is used to indicate that the reference storage space is not allowed to be accessed. The target mapping library records the kernel virtual address of the kernel mode and the kernel physical address of the target storage space with corresponding relationships. The reference mapping relationship includes the reference virtual address and the reference physical address of the reference storage space with corresponding relationships. The kernel physical address includes the reference physical address, and the kernel virtual address includes the reference virtual address. The target read request is used to read data in the reference storage space through the reference virtual address.

[0082] Optionally, in this embodiment, an error flag may be added to the reference storage space, but not limited to, to prevent subsequent data read requests from accessing the reference storage space again.

[0083] By taking the above steps, adding an error flag to the reference storage space where a UCE occurs and removing the relevant mapping relationship from the mapping library, storage space errors are isolated, preventing other processes or threads from accessing the storage area that has been marked as unreliable, thus avoiding system-level crashes and data corruption.

[0084] As an optional implementation, after obtaining the target data from the host's spare storage space, the following steps can be taken, but are not limited to: obtaining the kernel physical address of the available storage space to obtain the target physical address, wherein the available storage space is used to store the target data obtained from the spare storage space; creating a mapping relationship between a reference virtual address and a target physical address to obtain a target mapping relationship, wherein the target mapping relationship includes a corresponding reference virtual address and a target physical address, and the target read request is used to read data from the reference storage space through the reference virtual address; replacing the reference mapping relationship in the target mapping library with the target mapping relationship, wherein the target mapping library records the corresponding kernel virtual address of the kernel mode and the kernel physical address of the target storage space, the reference mapping relationship includes the corresponding reference virtual address and the reference physical address of the reference storage space, the kernel physical address includes the reference physical address and the target physical address, and the kernel virtual address includes the reference virtual address.

[0085] Optionally, in this embodiment, a new target mapping relationship may be used to replace the old reference mapping relationship, so that subsequent accesses to the reference storage space can access the normally accessible area and obtain the required data normally.

[0086] Through the above steps, after retrieving the target data from the backup storage space, a new mapping relationship is created to redirect the user-space requested data from the healthy storage unit. This process ensures that even if the storage space where the original data resides fails, the system can still provide data through the new mapping relationship, achieving seamless data service switching. This mechanism avoids service interruption and improves the system's RAS (Reliability, Availability, Serviceability) capabilities.

[0087] As an optional implementation method, Figure 3 This is a flowchart illustrating a method for handling user-mode access to storage space where an uncorrectable error has occurred, according to an embodiment of this application. Figure 3 As shown, process A in user space can, but is not limited to, call the `read()` system call to read the cached file `file_1`. Before accessing `file_1`, it is already stored in memory pages (i.e., the aforementioned target storage space). By inserting a hook function at the kernel's `copy_to_user()` entry point, the context is checked, and `current->comm` (i.e., the name of the current process) and `file->f_path` (i.e., the access path of the file) are used to confirm whether it is a read cache operation. A flag is added: the `_ex_table` record of the instruction address is extended, and a `page_cached` flag (i.e., the page is cached) is added. When a read operation (i.e., a data read request) triggers a UCE exception, the memory error handling module process is followed to obtain the error type and location, triggering memory page isolation and marking it as `HWPOISON` (i.e., the aforementioned error identifier). Preconditions are checked: the error type is UCE, the access type is marked with `page_cached`, and the process is a non-critical process. If these conditions are met, the `SIGBUS` signal (i.e., the process termination signal) is truncated, and the sending of the process termination signal is stopped. After the error memory page is isolated and the termination signal stage is completed, the original path is obtained from the file inode (index node). Rereading data: Allocate new memory pages (i.e., the aforementioned available storage space) and reload the data from the file system; if the reread fails, fall back to the traditional mechanism (i.e., send a termination signal to terminate the process); you can, but are not limited to, use copy_to_user() (i.e., the aforementioned available function interface) to update the user-mode buffer, inject new data, adjust the system call return, simulate normal operation, and the user-mode process continues to execute without retrying.

[0088] As an optional implementation method, Figure 4 This is a timing diagram of a method for handling a user-mode access to a storage space where an uncorrectable error has occurred, according to an embodiment of this application. Figure 4As shown, user space initiates a `read()` system call (i.e., the aforementioned data read request). After the call enters the kernel, the kernel first attempts to mark the memory access. However, if a UCE (Unified Entity Entry) is unexpectedly triggered during this process (i.e., the target read request is detected), this usually indicates a serious hardware memory error. To isolate the error, the kernel can, but is not limited to, immediately initiate a memory page isolation mechanism to isolate the faulty memory page and prevent the error from spreading. Subsequently, the kernel faces a critical decision point: whether to terminate the requesting process by sending a SIGBUS signal (i.e., the aforementioned termination signal). If the current memory access is a read cache operation, the user program can continue execution without being aware of the error. Therefore, the kernel takes a more aggressive recovery measure: it attempts to reread the data, which involves reloading the data from the source address (such as disk) (i.e., the aforementioned spare storage space) to a new, healthy memory page (i.e., the aforementioned available storage space). After a successful reread, the kernel can, but is not limited to, update its internal mappings to complete the address and content update. Finally, the kernel can, but is not limited to, feed back the reread, correct content (i.e., the aforementioned target data) to the user space application that originally initiated the call. Once the application receives the requested data, it can continue to run normally, and the entire reading and error recovery process ends. The complete process, successfully resolved through the aforementioned kernel error recovery mechanisms (isolation, retry), ultimately shields user space from uncorrectable errors, ensuring service continuity and program transparency.

[0089] As an optional implementation, this application also provides a seamless recovery system for memory UCE failures in user-mode read cache scenarios. Figure 5 This is a schematic diagram of a seamless recovery system according to an embodiment of this application. Figure 5 As shown, the system may include, but is not limited to: an access marking module: used to mark memory access operations (i.e., the aforementioned data read requests) in user-mode program read cache scenarios; an error isolation module: used to mark and isolate problematic memory pages (i.e., the aforementioned reference storage space); a signal interception module: used to intercept the user-mode program termination signal (i.e., the aforementioned termination signal) based on preconditions; a data reload module: used to reload data from the file system into a new memory page; and an address feedback module: used to feed back the new address and content to the user-mode program.

[0090] Optionally, the access flag module can be, but is not limited to, the system's entry point module. Its primary responsibility is to identify and flag memory access operations performed by user-mode programs in read-cache scenarios. This module monitors system calls (such as `read()`, `pread()`, etc.) and kernel paths (such as page cache access) to determine whether the current operation belongs to a read-cache scenario (i.e., reading file data from the kernel page cache). It adds specific flags (such as custom exception table entries or context labels) to eligible memory access operations, enabling subsequent modules to quickly locate and handle UCE exceptions, improving the system's targeting and efficiency.

[0091] Optionally, the core functions of the access flag module may include, but are not limited to: detecting system call type and context (i.e., determining whether it is a data interaction between user mode and kernel mode); adding flags: for example, recording the address of the access instruction and the expected error type (such as UCE) in the kernel's exception table (_ex_table); and precondition checks: confirming that the scenario is a read cache and that the process initiating the read cache (i.e., the aforementioned reference object) is a non-critical process (i.e., the aforementioned target object).

[0092] Optionally, the error isolation module may, but is not limited to, marking and isolating problematic memory pages after detecting a UCE (Unique Memory Error) exception, preventing further access that could lead to system instability. The error isolation module may, but is not limited to, removing the erroneous page from the memory management system and logging the error. The error isolation module ensures the atomicity and efficiency of isolation operations, preventing data corruption from spreading to other processes.

[0093] Optionally, the core functions of the error isolation module may include, but are not limited to: parsing error information: extracting addresses, error types, etc., from GHES (Generic Hardware Error Specifier) ​​or MCE (Machine Check Exception). Page marking: setting the HWPOISON flag (i.e., the aforementioned error identifier) ​​to notify the memory manager (i.e., the aforementioned target mapping library) to isolate pages. Resource release: releasing associated page table entries and buffers.

[0094] Optionally, the signal interception module can, but is not limited to, intercept signals that might otherwise terminate user-mode programs based on preconditions (such as error type, memory access type, etc.). The signal interception module can, but is not limited to, intervene in the exception handling path to prevent the kernel from directly terminating process execution and instead guide the process to recovery. The signal interception module can, but is not limited to, improve system fault tolerance, especially under non-fatal UCEs, avoiding unnecessary process interruptions.

[0095] Optionally, the core functions of the signal interception module may include, but are not limited to: precondition judgment: determining whether the error is a UCE, whether the scenario is a read cache, and whether the process is non-critical. Signal interception: modifying the return path of the exception handler to prevent the sending of a termination signal. Exception jump: using the recovery mechanism to jump to the program's execution recovery mechanism.

[0096] Specifically, hooks can be inserted into the kernel interface function send_sig_info() (i.e., the aforementioned alternative function interface) to determine whether to block signal transmission based on preconditions. The function entry point checks the signal type (i.e., the signal type of the aforementioned control signals) and preconditions. If the conditions are met, the call to send_signal() (i.e., the aforementioned termination instruction) is blocked, and the exception recovery process is entered.

[0097] Optionally, the data reread module may, but is not limited to, reload the original data from the file system to a new memory page after isolating the problematic page, ensuring data integrity. The data reread module may, but is not limited to, bypass the error cache and read directly from the disk or underlying storage (i.e., the aforementioned backup storage space), employing optimization strategies to reduce overhead. The data reread module may, but is not limited to, be the core of seamless recovery, bridging the error isolation module and the address feedback module.

[0098] Optionally, the core functionality of the data reread module may include, but is not limited to: obtaining the original path from the file inode; reread operation: allocating new pages and performing the read; and consistency check: verifying whether the reread data matches the expected data.

[0099] Specifically, the data reread module, as part of the anomaly recovery process, requires the allocation of clean new memory pages. This can be achieved, but is not limited to, reading the original data from the disk (or underlying storage) into new pages via the file system's readpage interface. Kernel-level consistency checks can include, but are not limited to, verifying whether the data conforms to the file system's metadata or physical storage constraints to ensure that the reread data has not been corrupted; and can be, but are not limited to, using file system-based data checksums to verify data integrity.

[0100] Optionally, the address feedback module may, but is not limited to, be responsible for transparently feeding back the new memory address and content after rereading to the user-space program, ensuring seamless updates to the user-space buffer. The address feedback module may, but is not limited to, modify the system call return path and inject new data to avoid user-space-aware errors.

[0101] Optionally, the core functions of the address feedback module may include, but are not limited to: Address mapping: updating the user-space virtual address to the new physical page. Data copying: using copy_to_user() to inject content into the user buffer (i.e., the aforementioned target storage location). Return value adjustment: simulating a normal read operation and returning a value.

[0102] Specifically, if copy_to_user() executes successfully, the kernel can, but is not limited to, modify the return value of sys_read (the system read function) (i.e., the aforementioned target read request). For example, it can, but is not limited to, modify the value stored in regs->ax (the return value register) to count (the actual number of bytes read) (i.e., the data length of the aforementioned target data). After modifying this register, the user space will consider that the read operation has successfully read count bytes.

[0103] The above system achieves fine-grained, seamless recovery from UCE (Unique Cache Error) failures in read cache scenarios. Through signal interception and data rereading, it ensures seamless operation of user-space programs, significantly improving the availability of system applications. It is also compatible with multiple architectures and server platforms, expanding application scenarios. By isolating problematic memory and dynamically recovering, it reduces the probability of unnecessary downtime and improves RAS (Reliability, Availability, and Serviceability) capabilities. The data rereading mechanism avoids interruptions to user-space programs, making it particularly suitable for high-load, high-concurrency read cache scenarios. Compared to solutions in related technologies, the solution provided in this application effectively improves the user experience.

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

[0105] Embodiments of this application also provide a host data reading device. Figure 6 This is a structural block diagram of a host data reading device according to an embodiment of this application, such as... Figure 6 As shown, the device includes:

[0106] The detection module 602 is used to detect the target read request in the data read request initiated by the target object in the user space of the host received by the kernel space of the host. The data read request is used to read data in the target storage space in the kernel space, and the target read request is used to read data in the reference storage space. The reference storage space is the storage space in the target storage space where an uncorrectable error has occurred. The target storage space is used to cache data for the host.

[0107] The control module 604 is used to control the kernel mode to prevent the target object from terminating, and to obtain the target data by retrieving the data read by the target read request from the host's spare storage space, wherein the spare storage space is used to store data for the host.

[0108] The transmission module 606 is used to transmit the target data to the target object.

[0109] Through the above device, the kernel mode of the detection host receives a target read request from the target object in the user mode of the host. The data read request is used to read data in the target storage space used for caching data for the host in the kernel mode. The target read request is used to read data in the reference storage space in the target storage space where an uncorrectable error has occurred. The kernel mode is controlled not to terminate the operation of the target object, and the target data is obtained from the backup storage space used for storing data for the host. The target data is then transferred to the target object. Compared with the approach of directly terminating the operation of the object that initiated the target read request, this application selects to obtain data from the backup storage space and transfer it to the target object when accessing the storage space where an uncorrectable error has occurred. This reduces the occurrence of situations where host data cannot be read normally and realizes seamless normal reading in the user mode. Therefore, it can solve the technical problem of low host data reading efficiency in related technologies and achieve the technical effect of improving host data reading efficiency.

[0110] Optionally, the control module includes: a first detection unit for detecting control signals to be transmitted from kernel mode to user mode carried by candidate function interfaces in kernel mode; a filtering unit for filtering target function interfaces from candidate function interfaces, wherein the target function interface carries a target termination signal, which is used to terminate the execution of the target object; and a control unit for controlling the kernel mode not to transmit the target termination signal to user mode.

[0111] In some embodiments, the control unit is further configured to: locate a termination instruction among the target function instructions included in the target function interface, wherein the target termination signal includes target function instructions, the target function instructions include target information instructions and termination instructions, the target information instructions are used to indicate a target object, and the termination instructions are used to terminate the object indicated by the information instructions; add a target instruction to the termination signal to obtain a reference function interface, wherein the target instruction is used to control the skipping of termination instructions during the execution of the termination signal.

[0112] In some embodiments, the filtering unit is further configured to: filter out function interfaces carrying termination signals from the candidate function interfaces according to the signal type of the control signals carried by the candidate function interfaces to obtain candidate function interfaces; search for the object indicated by the information instruction in the termination signals carried by the candidate function interfaces, wherein the function instruction included in the termination signal includes an information instruction and a termination instruction, and the information instruction is used to indicate the object terminated by the termination instruction; and determine the candidate function interface whose object is the target object as the target function interface.

[0113] In some embodiments, the control module further includes: a first acquisition unit, configured to acquire index information of data stored in the reference storage space, wherein the index information is used to indicate the backup storage location of the data stored in the reference storage space in the backup storage space; and a second acquisition unit, configured to acquire target data from the backup storage space according to the index information.

[0114] In some embodiments, the second acquisition unit is further configured to: read target data from an alternate storage location;

[0115] The target data is stored in the kernel-mode available storage space, where the available storage space is the storage space allocated for the target data in the target storage space, excluding the reference storage space.

[0116] In some embodiments, the detection module includes: a second detection unit, configured to detect the initiating object of a data read request from a data read request initiated from user mode to kernel mode, and obtain a reference object; a first lookup unit, configured to look up a reference object identifier of the reference object in a critical object library, wherein the reference object identifier is used to identify the function of the reference object, and the critical object library stores object identifiers of objects whose importance in the host is greater than an importance threshold; a first determination unit, configured to determine that a data read request initiated by a target object has been detected if no reference object identifier is found, and to detect a first space state of the storage space read by the data read request initiated by the target object, wherein the first space state is used to indicate whether an uncorrectable error has occurred in the storage space read by the data read request; and a second determination unit, configured to determine that a target read request has been detected if the first space state indicates that an uncorrectable error has occurred in the storage space read by the data read request.

[0117] In some embodiments, the detection module includes: a third detection unit, configured to detect the second space state of each storage space in the target storage space, wherein the second space state is used to indicate whether an uncorrectable error has occurred in the storage space; a third determination unit, configured to determine the storage space in the target storage space whose second space state indicates that an uncorrectable error has occurred as a reference storage space; a fourth detection unit, configured to detect data read requests whose read storage space is the reference storage space from data read requests initiated from user mode to kernel mode, and obtain a reference data read request; a fifth detection unit, configured to detect the initiating object of the reference data read request, and obtain a candidate object; a second search unit, configured to search for the candidate object identifier in a critical object library, wherein the candidate object identifier is used to identify the function of the candidate object, and the critical object library stores the object identifiers of objects whose importance in the host is greater than an importance threshold; and a fourth determination unit, configured to determine that a data read request initiated by the target object to the reference storage space has been detected if no candidate object identifier is found, and obtain a target read request.

[0118] In some embodiments, the transmission module includes: an extraction unit for extracting target address information from a target read request, wherein the target address information is used to indicate the target storage location of data read by the user-space storage through the target read request; a writing unit for writing target data to the target storage location; and a sending unit for sending a notification message to a target object, wherein the notification message is used to notify the target object that data in the reference storage space has been successfully read.

[0119] In some embodiments, the writing unit is further configured to: write target data to a target storage location via an available function interface, wherein the available function interface is configured to write kernel-mode data to a user-mode storage location.

[0120] In some embodiments, the transmission module further includes: an adjustment unit, configured to adjust the return value stored in the target register to the data length of the target data after the target data is written to the target storage location, wherein the user mode is configured to read data from the target storage location according to the return value stored in the target register as the target object.

[0121] In some embodiments, the aforementioned host data reading device further includes: an adding module, configured to add an error flag to the reference storage space and delete the reference mapping relationship from the target mapping library after the kernel mode of the host receives a target read request from the target object in the user mode of the host. The error flag is used to indicate that the reference storage space is not allowed to be accessed. The target mapping library records the kernel virtual address of the kernel mode and the kernel physical address of the target storage space with corresponding relationships. The reference mapping relationship includes the reference virtual address and the reference physical address of the reference storage space with corresponding relationships. The kernel physical address includes the reference physical address, the kernel virtual address includes the reference virtual address, and the target read request is used to read data in the reference storage space through the reference virtual address.

[0122] In some embodiments, the aforementioned host data reading device further includes: an acquisition module, configured to, after obtaining target data from the host's spare storage space, acquire the kernel physical address of the available storage space to obtain the target physical address, wherein the available storage space is used to store the target data acquired from the spare storage space in the target storage space; a creation module, configured to create a mapping relationship between a reference virtual address and a target physical address to obtain a target mapping relationship, wherein the target mapping relationship includes a corresponding reference virtual address and a target physical address, and the target read request is used to read data in the reference storage space through the reference virtual address; and a replacement module, configured to replace the reference mapping relationship in the target mapping library with the target mapping relationship, wherein the target mapping library records the corresponding kernel virtual address of the kernel mode and the kernel physical address of the target storage space, the reference mapping relationship includes the corresponding reference virtual address and the reference physical address of the reference storage space, the kernel physical address includes the reference physical address and the target physical address, and the kernel virtual address includes the reference virtual address.

[0123] For a description of the features of the host data reading device in the corresponding embodiment, please refer to the relevant description of the host data reading method in the corresponding embodiment, which will not be repeated here.

[0124] Embodiments of this application also provide an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to perform the steps in any of the host data reading method embodiments described above.

[0125] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above-described host data reading method embodiments when running.

[0126] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.

[0127] Embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above-described host data reading method embodiments.

[0128] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the host data reading method embodiments described above.

[0129] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0130] The foregoing has provided a detailed description of a host data reading method, electronic device, medium, and program product provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are only intended to aid in understanding the method and core ideas of this application. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from its principles, and these improvements and modifications also fall within the protection scope of the claims of this application.

Claims

1. A host data reading method, characterized by, The method comprises the following steps: detecting a target read request in a data read request initiated by a target object in a user mode of a host, wherein the data read request is used to read data in a target storage space in a kernel mode of the host, the target read request is used to read data in a reference storage space, the reference storage space is a storage space in which an uncorrectable error occurs in the target storage space, and the target storage space is used to cache data for the host; controlling the kernel mode not to terminate running of the target object, and obtaining target data read by the target read request from a backup storage space of the host, wherein the backup storage space is used to store data for the host; transmitting the target data to the target object; wherein the detecting the target read request in the data read request initiated by the target object in the user mode of the host comprises the following steps: recording third space states of each storage space in the target storage space in a plurality of historical time periods before a current time to obtain a plurality of third space states of each storage space, wherein the third space state is used to indicate whether the corresponding storage space has the uncorrectable error in each historical time period; detecting a possibility parameter of each storage space according to the plurality of third space states of each storage space, wherein the possibility parameter of the storage space is used to indicate a possibility that the storage space has the uncorrectable error at the current time; and detecting a size relationship between a target number and a number threshold, wherein the target number is a number of storage spaces in which the corresponding possibility parameter is greater than or equal to a possibility parameter threshold in each storage space; in a case where it is detected that the target number is greater than or equal to the number threshold, detecting the target read request by a first mode, wherein the first mode comprises the following steps: detecting an initiation object of a data read request from data read requests initiated by the user mode to the kernel mode to obtain a reference object; searching for a reference object identifier of the reference object in a key object library, wherein the reference object identifier is used to identify a function of the reference object, and object identifiers of objects whose importance is greater than an importance threshold in the host are stored in the key object library; in a case where the reference object identifier is not searched, it is determined that the data read request initiated by the target object is detected, and a first space state of a storage space read by the data read request initiated by the target object is detected, wherein the first space state is used to indicate whether the storage space read by the data read request has the uncorrectable error; and in a case where it is detected that the first space state is used to indicate that the storage space read by the data read request has the uncorrectable error, it is determined that the target read request is detected. In a case where it is detected that the target quantity is less than the quantity threshold, the target read request is detected by way two, wherein the way two comprises: detecting second space states of each storage space in the target storage space, wherein the second space state is used to indicate whether the storage space has the uncorrectable error; determining, as the reference storage space, a storage space in the target storage space whose second space state indicates that the storage space has the uncorrectable error; detecting, from the data read request initiated by the user mode to the kernel mode, a data read request whose read storage space is the reference storage space, to obtain a reference data read request; detecting an initiator of the reference data read request, to obtain a candidate object; searching, in the key object library, for a candidate object identifier of the candidate object, wherein the candidate object identifier is used to identify the function of the candidate object, and the key object library stores object identifiers of objects whose importance in the host is greater than an importance threshold; in a case where the candidate object identifier is not searched, it is determined that the data read request initiated by the target object to the reference storage space is detected, to obtain the target read request.

2. The method of reading host data according to claim 1, wherein, The control of the kernel mode not to terminate the running of the target object comprises: detecting the control signal to be transmitted by the kernel mode to the user mode carried by the alternative function interface in the kernel mode; screening, from the alternative function interface, a target function interface, wherein the target function interface carries a target termination signal, and the target termination signal is used to terminate the running of the target object; controlling the kernel mode not to transmit the target termination signal to the user mode.

3. The method of reading host data according to claim 2, wherein, The control of the kernel mode not to transmit the target termination signal to the user mode comprises: locating a termination instruction in a target function instruction included in the target function interface, wherein the target termination signal includes the target function instruction, the target function instruction includes a target information instruction and the termination instruction, the target information instruction is used to indicate the target object, and the termination instruction is used to terminate the running of the object indicated by the information instruction; adding a target instruction in the termination signal to obtain a reference function interface, wherein the target instruction is used to control skipping of the termination instruction in the process of executing the termination signal.

4. The method of reading host data according to claim 3, wherein, The screening of the target function interface from the alternative function interface comprises: screening, from the alternative function interface, a candidate function interface carrying the termination signal according to the signal type of the control signal carried by the alternative function interface; searching, in the termination signal carried by the candidate function interface, for an object indicated by an information instruction, wherein the function instruction included in the termination signal includes the information instruction and the termination instruction, and the information instruction is used to indicate the object terminated by the termination instruction; determining the candidate function interface whose indicated object by the information instruction is the target object as the target function interface.

5. The method of claim 1, wherein, The target data obtained from the backup storage space of the host comprises: Obtaining index information of the data stored in the reference storage space, wherein the index information is used to indicate the backup storage location of the data stored in the reference storage space in the backup storage space; According to the index information, the target data is obtained from the backup storage space.

6. The method of reading host data according to claim 5, wherein, The target data obtained from the backup storage space according to the index information comprises: Reading the target data from the backup storage location; The target data is stored in the available storage space of the kernel mode, wherein the available storage space is the storage space allocated for the target data in the target storage space except the reference storage space.

7. The method of claim 1, wherein, The target data is transmitted to the target object, comprising: Extracting target address information from the target read request, wherein the target address information is used to indicate the target storage location of the data read by the target read request in the user mode storage; The target data is written into the target storage location; A notification message is sent to the target object, wherein the notification message is used to notify the target object that the data in the reference storage space has been successfully read.

8. The reading method of the host data according to claim 7, wherein The target data is written into the target storage location by using a usable function interface, wherein the usable function interface is used to write the data of the kernel mode into the storage location of the user mode; After the target data is written into the target storage location, the method further comprises adjusting the return value stored in the target register to the data length of the target data, wherein the user mode is used to read the data for the target object from the target storage location according to the return value stored in the target register.

9. The method of claim 1, wherein, After the target read request in the data read request initiated by the target object in the user mode of the host is received by the kernel mode of the host, the method further comprises: An error identifier is added to the reference storage space, and a reference mapping relationship is deleted from a target mapping library, wherein the error identifier is used to indicate that the reference storage space is not allowed to be accessed, the target mapping library records the kernel virtual address of the kernel mode and the kernel physical address of the target storage space having a corresponding relationship, the reference mapping relationship comprises a reference virtual address and a reference physical address of the reference storage space having a corresponding relationship, the kernel physical address comprises the reference physical address, the kernel virtual address comprises the reference virtual address, and the target read request is used to read the data in the reference storage space through the reference virtual address.

10. The method of claim 1, wherein, After the target data obtained from the backup storage space of the host, the method further comprises: Obtaining a kernel physical address of an available storage space, to obtain a target physical address, wherein the available storage space is used to store the target data obtained from the backup storage space in the target storage space; Creating a mapping relationship between a reference virtual address and the target physical address, to obtain a target mapping relationship, wherein the target mapping relationship includes the reference virtual address and the target physical address having a corresponding relationship, and the target read request is used to read data in the reference storage space through the reference virtual address; Replacing a reference mapping relationship in a target mapping library with the target mapping relationship, wherein the target mapping library records a kernel virtual address of the kernel mode and a kernel physical address of the target storage space having a corresponding relationship, the reference mapping relationship includes a reference virtual address and a reference physical address of the reference storage space having a corresponding relationship, and the kernel physical address includes the reference physical address and the target physical address, and the kernel virtual address includes the reference virtual address.

11. An electronic device, comprising: Comprise: a memory for storing a computer program; a processor for executing the computer program to implement the steps of the host data reading method according to any one of claims 1 to 10.

12. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, wherein the computer program is executed by the processor to implement the steps of the host data reading method according to any one of claims 1 to 10.

13. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the host data reading method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Data reading method and computing device

    CN120386671A

  • Data access control method and device, storage medium and electronic equipment

    CN120891991A