Data reading method and computing device

By setting back up memory in the computing device, the inefficiency of business processing caused by memory errors is solved, and efficient data reading without pausing the process and reloading data during errors is achieved.

CN120386671APending Publication Date: 2025-07-29XFUSION DIGITAL TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510229162.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-27
Publication Date
2025-07-29

AI Technical Summary

Technical Problem

In the prior art, when an irrepairable error occurs in the memory device, the processor needs to pause the process and recreate the memory object, load data from the external storage device, resulting in inefficient business processing.

Method used

Set up backup memory in the computing device, and the memory objects are loaded to both the main memory and the backup memory. When an error occurs, switch to the backup memory to read the copy to avoid pausing the process and reloading the data.

Benefits of technology

By reading a copy of the memory object from the backup memory when an uncorrectable error occurs in the main memory, the failure recovery time is reduced and business processing efficiency is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120386671A_ABST
    Figure CN120386671A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a data reading method and computing equipment, and the method comprises the steps: under the condition that a process reads a first memory object through a target memory virtual address, if it is recognized that an uncorrectable error fault exists in a first memory, replacing a current page table with a target page table; a first memory object is stored in the first memory; the first memory is located in a physical memory in a main memory of the computing device; the main memory is a local memory; the current page table is used for indicating a mapping relation between the target memory virtual address and the first memory; the target page table is used for indicating a mapping relation between the target memory virtual address and a second memory; the second memory is located in a backup memory; the backup memory is physically isolated from the main memory; reading a second memory object from the second memory based on the target page table; wherein the second memory object is a copy of the first memory object, and according to the embodiment of the invention, the effect of improving the business processing efficiency can be realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present application relate to the technical field of servers, and in particular, to a data reading method and a computing device. Background Art

[0002] A memory object refers to a data structure stored in the memory of a computing device for data storage and management. Based on the memory object, fast data reading and data sharing can be achieved.

[0003] In the related art, a processor can create a memory object based on a process and load data from an external storage device into the physical address space of the memory device corresponding to the memory object. When reading data based on the memory object, if an uncorrectable error (UCE) occurs in the memory device, the processor needs to suspend the operation of the process, recreate the memory object based on the process, and reload the data from the external storage device into the physical address space of the memory device corresponding to the memory object, resulting in a long time consumption and low efficiency of business processing. Summary of the Invention

[0004] Embodiments of the present application provide a data reading method and a computing device, which can improve the efficiency of business processing.

[0005] In a first aspect, embodiments of the present application provide a data reading method, which is applied to a computing device and includes:

[0006] When a process reads a first memory object through a target memory virtual address, if it is recognized that an uncorrectable error fault exists in the first memory, replace the current page table with the target page table;

[0007] Wherein, the first memory object is stored in the first memory; the first memory is a physical memory in the main memory of the computing device; the main memory is a local memory;

[0008] The current page table is used to indicate the mapping relationship between the target memory virtual address and the first memory;

[0009] The target page table is used to indicate the mapping relationship between the target memory virtual address and a second memory; the second memory is located in a backup memory; the backup memory is physically isolated from the main memory;

[0010] Based on the target page table, read a second memory object from the second memory; wherein, the second memory object is a copy of the first memory object.

[0011] Advantageous effects of this embodiment: When the processor reads the first memory object through the target memory virtual address, if it identifies that the first memory has an uncorrectable error fault, it replaces the current page table with the target page table associated with the current page table, and based on the target page table, reads the second memory object from the second memory. In this way, when an uncorrectable error fault occurs in reading the main memory, the current page table can be replaced with the target page table, and a copy of the first memory object, that is, the second memory object, can be read from the backup memory, without the need for the processor to pause the process or reload the memory object, reducing the time-consuming of fault recovery and improving the business processing efficiency.

[0012] In a possible implementation manner, the replacing the current page table with the target page table includes:

[0013] Determine the target page table corresponding to the current page table according to the page table association relationship; wherein, the page table association relationship is used to indicate the current page table and the associated backup page table.

[0014] Advantageous effects of this embodiment: Based on the page table association relationship, the target page table associated with the current page table can be determined quickly and accurately, avoiding the business suspension caused by the failure of memory object access and improving the efficiency of business processing.

[0015] In a possible implementation manner, the determining the target page table corresponding to the current page table according to the page table association relationship includes:

[0016] Determine one or more candidate page tables according to the page table association relationship;

[0017] Determine the target page table from the candidate page tables based on a preset rule.

[0018] Advantageous effects of this embodiment: Selecting the target page table based on the preset rule can effectively manage the backup memory of the computing device and balance the memory load.

[0019] In a possible implementation manner, after determining the target page table corresponding to the current page table, the method further includes:

[0020] Update the status of the current page table to an unavailable status and update the status of the target page table to an available status for easy page table management.

[0021] In a possible implementation manner, before the process reads the first memory object through the target memory virtual address, the method further includes:

[0022] Create a target memory object;

[0023] Based on the current page table and the target page table respectively, load the target memory object from the external storage device of the computing device into the first memory and the second memory in parallel; wherein, the target memory object is stored in the first memory as the first memory object; the target memory object is stored in the second memory as the second memory object.

[0024] Advantageous effects of this embodiment: By storing copies of multiple memory objects in the first memory and the second memory, the fault tolerance and reliability of data can be improved.

[0025] In a possible implementation manner, before loading the target memory object from the external storage device of the computing device into the first memory and the second memory in parallel, the method further includes:

[0026] Create the current page table based on the target memory virtual address and the physical address of the first memory; and create the target page table based on the target memory virtual address and the physical address of the second memory.

[0027] Advantageous effects of this embodiment: Through this method, the processor can accurately obtain the current page table and the target page table associated with the current page table based on the target memory virtual address, the physical address of the first memory, and the physical address of the second memory, which is convenient for subsequent page table switching.

[0028] In a possible implementation manner, creating the target memory object includes:

[0029] In response to a request to read a data set in the form of a memory object, create the target memory object.

[0030] Advantageous effects of this embodiment: Through this method, the processor can accurately create the target memory object indicated by the request to read a data set in the form of a memory object based on the request to read a data set in the form of a memory object, ensuring the integrity of the data.

[0031] In a possible implementation manner, the device type of the backup memory includes: Compute Express Link (CXL) memory device.

[0032] Advantageous effects of this embodiment: By using a CXL memory device as the backup memory, when the processor reads the backup memory data, the access rate is faster, improving the data access efficiency and processing efficiency, and improving the scalability of the backup memory.

[0033] In a possible implementation manner, identifying an uncorrectable error fault in the first memory includes:

[0034] Determine whether there is an uncorrectable fault interruption in the first memory;

[0035] In the case of an uncorrectable fault interruption in the first memory, identify that there is an uncorrectable fault in the first memory.

[0036] Advantageous effects of this embodiment: In this way, when the processor determines that there is an uncorrectable fault interruption, it can determine that there is an uncorrectable error fault in the first memory, and then immediately switch the current page table, avoiding the time-consuming of further accessing the faulty first memory, and improving the access efficiency of memory objects.

[0037] In a second aspect, an embodiment of the present application further provides a computing device, including a processor and a memory communicatively connected to the processor;

[0038] The memory is used to store computer execution instructions;

[0039] The processor is used to execute the computer execution instructions stored in the memory and is used to implement the data reading method according to any one of the first aspects.

[0040] Advantageous effects of this embodiment: The processor of the computing device can execute the computer execution instructions, so that when the processor reads the first memory object through the target memory virtual address, if it is identified that there is an uncorrectable error fault in the first memory, the current page table is replaced with the target page table associated with the current page table, and based on the target page table, the second memory object is read from the second memory. In this way, when an uncorrectable error fault occurs in reading the main memory, the current page table can be replaced with the target page table, and the copy of the first memory object, that is, the second memory object, can be read from the backup memory, without the need for the processor to pause the process or reload the memory object, reducing the time-consuming of fault recovery and improving the business processing efficiency.

[0041] In a third aspect, an embodiment of the present application provides a computer program product, including a computer program, which when executed by a processor implements the data reading method according to the first aspect.

[0042] Advantageous effects of this embodiment: The processor of the computing device can execute the computer program, so that when the processor reads the first memory object through the target memory virtual address, if it is identified that there is an uncorrectable error fault in the first memory, the current page table is replaced with the target page table associated with the current page table, and based on the target page table, the second memory object is read from the second memory. In this way, when an uncorrectable error fault occurs in reading the main memory, the current page table can be replaced with the target page table, and the copy of the first memory object, that is, the second memory object, can be read from the backup memory, without the need for the processor to pause the process or reload the memory object, reducing the time-consuming of fault recovery and improving the business processing efficiency. Description of the Drawings

[0043] Figure 1 A structural schematic diagram of a computing device provided by an embodiment of the present application;

[0044] Figure 2 A schematic diagram of an application scenario provided by an embodiment of the present application;

[0045] Figure 3 A structural schematic diagram of another computing device provided by an embodiment of the present application;

[0046] Figure 4 A structural schematic diagram of yet another computing device provided by an embodiment of the present application;

[0047] Figure 5 A structural schematic diagram of yet another computing device provided by an embodiment of the present application;

[0048] Figure 6 A structural schematic diagram of a main memory provided by an embodiment of the present application;

[0049] Figure 7 A flowchart of a data reading method provided by an embodiment of the present application;

[0050] Figure 8 A schematic diagram of the association relationship of a page table provided by an embodiment of the present application;

[0051] Figure 9 A flowchart of a data reading method provided by an embodiment of the present application;

[0052] Figure 10 A schematic diagram of an application scenario provided by an embodiment of the present application;

[0053] Figure 11 A structural schematic diagram of a data reading device provided by an embodiment of the present application;

[0054] Figure 12 A structural schematic diagram of a computing device provided by an embodiment of the present application. Detailed implementation manners

[0055] To make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Apparently, the described embodiments are some, but not all, of the embodiments of the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application under the inspiration of this embodiment belong to the scope of protection of the present application.

[0056] In the description and claims of this application and the above-mentioned drawings, terms such as "first", "second", "third", "fourth", etc. (if any) are used to distinguish similar objects and do not necessarily describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the application described here can be implemented in an order other than those illustrated or described here. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units does not have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products, or devices.

[0057] First, the nouns involved in the embodiments of this application are explained:

[0058] Memory object: A data structure used for data storage and management that can be loaded into memory for programs to access quickly.

[0059] Irreparable error: Usually refers to an error in memory that cannot be repaired by an error correction code.

[0060] Page table: Refers to the mapping relationship from virtual address to physical address maintained by the operating system.

[0061] Persistent memory (PMEM): A storage medium that can provide both high-speed access and data persistence characteristics and can keep data from being lost after a power outage.

[0062] Non-uniform memory access (NUMA) architecture: A memory architecture of a multi-processor computer system. In the NUMA architecture, multiple processors are divided into multiple nodes, and each node has its own local memory, cache, and processor.

[0063] Figure 1 The following is a schematic structural diagram of a computing device provided by the embodiments of this application. Refer to Figure 1 As shown, the computing device includes a processor, a main memory, and an external storage device.

[0064] The external storage device is used to store information such as programs, data, and files in the computer system for a long time. The external storage device can be, for example, a hard-disk drive (HDD), a solid state drive (SSD), an optical disc drive, a flash device, etc., and the embodiments of this application do not make limitations here.

[0065] A processor for executing instructions in a computer program to perform various data processing and arithmetic operations, such as arithmetic operations, logical operations, data transmission, etc. The processor can be a central processing unit (CPU) or a graphics processing unit (GPU), and the embodiments of the present application do not limit this here.

[0066] The main memory is a component for temporarily storing running application programs and data. The processor can quickly read and write to the main memory, enabling the computer to efficiently run various application programs. The main memory can be a random access memory (RAM), such as a static random-access memory (SRAM) or a dynamic random access memory (DRAM); it can also be a read-only memory (ROM), or other types of memories, and the embodiments of the present application do not limit this here.

[0067] Figure 2 This is a schematic diagram of an application scenario provided by the embodiments of the present application. In a computing device, when an application program reads data based on a process, multiple memory objects can be created, and a data set stored in an external device can be loaded into the physical address space of the main memory corresponding to the memory object in the form of the memory object, realizing fast data sharing between processes of different application programs. Refer to Figure 2 As shown, the processor can load a data set stored in an external storage device into the form of three memory objects. When Process 1 and Process 0 need to access the data corresponding to Memory Object 0, they can directly access the physical address space in the main memory corresponding to Memory Object 0 without reading data from the external storage device each time, improving the data reading efficiency. It should be noted that the embodiments of the present application do not limit the number of processes and memory objects, Figure 2 only a schematic is provided.

[0068] However, in the above method, if a read error occurs in Memory Object 1 during the process of the processor reading data based on a process, as shown in Figure 2 As shown, the processor needs to pause the execution of the business logic of the process (application program), causing the process to reload the memory object 1 with the UCE error from the external storage device again. This method requires pausing the business operation when a read error occurs in the memory object, and the time-consuming reloading of data from the external storage device is relatively long, affecting the operation efficiency of the business.

[0069] In view of this, the embodiment of the present application provides a data reading method. A backup memory is set in a computing device. The data corresponding to a memory object is not only loaded into the main memory of the computing device, but also loaded into the backup memory. When a UCE error occurs in the memory object, a copy of the memory object in the backup memory can be read without pausing the service or reloading the memory object, which reduces the time consumption and improves the service processing efficiency.

[0070] Figure 3 This is a schematic structural diagram of another computing device provided by the embodiment of the present application. Refer to Figure 3 As shown, the computing device further includes a backup memory, and the processor is respectively connected to the main memory and the backup memory. The backup memory is used to store a copy of the memory object. It should be noted that the embodiment of the present application does not limit the number of backup memories.

[0071] In some possible implementation manners, the backup memory is an independent memory device. In other words, the backup memory is physically isolated from the main memory. The backup memory can be, for example, the aforementioned RAM or ROM type, or can be a compute express link (CXL) memory device, a persistent memory device, a node in a non-uniform memory access (NUMA) architecture, etc.

[0072] Exemplarily, when the backup memory is a CXL memory device, refer to Figure 4 As shown, Figure 4 This is a schematic structural diagram of yet another computing device provided by the embodiment of the present application. The processor can be communicatively connected to multiple CXL memory devices. For example, refer to the CXL memory device 1 in Figure 4 ; or the processor can be communicatively connected to multiple CXL memory devices through a CXL switch. For example, refer to the CXL memory device 2 and the CXL memory device 3 in Figure 4 . And, in this implementation manner, the CXL memory devices can be arranged inside the computing device or outside the computing device. Figure 4 Taking the example of being inside the computing device for illustration, the embodiment of the present application does not limit this here. By using the CXL memory device as the backup memory, when the processor reads the data of the backup memory, the access rate is faster, which improves the data access efficiency and processing efficiency, and improves the scalability of the backup memory.

[0073] When the backup memory is a node in the NUMA architecture, refer to Figure 5 As shown, Figure 5A schematic structural diagram of another computing device provided by an embodiment of the present application. The computing device may include multiple processors, such as processor and processor 1. Each processor is connected to its own memory device. The processor can be used as a node in an independent NUMA architecture. In this implementation, the backup memory can be the memory device connected to processor 1. It should be noted that the present application does not limit the number and type of memory devices included in processor 1.

[0074] It should be noted that the backup memory provided by the embodiment of the present application and the processor can adopt a read / write method of memory semantics. In other words, the processor can access the data in the backup memory according to the operation logic defined by the memory semantics, rather than the read / write method of the operation logic defined by the I / O semantics, which improves the read / write efficiency of the data.

[0075] In some possible implementation manners, referring to Figure 6 as shown, Figure 6 A schematic structural diagram of a main memory provided by an embodiment of the present application. The main memory can be divided into a kernel space and a user space based on the address space. In other words, the processor can allocate different address ranges for the kernel space and the user space respectively to form independent address spaces.

[0076] The processor can execute all privileged instructions based on the kernel, directly access hardware devices, and be responsible for the resource management and scheduling of the entire computing device, including process management, memory management, device management, etc.

[0077] The processor can execute non-privileged instructions based on the user space, cannot directly access hardware resources, and needs to request the services of the kernel through the processor to complete relevant operations, and run various application programs written by users.

[0078] In some possible implementation manners, referring to Figure 6 as shown, the processor can provide a kernel memory management service based on the kernel and a memory object management service based on the user space. Among them, the processor can create multiple copies of memory objects based on the memory object management service, load the memory objects from external storage devices into the user space and the backup memory of the main memory, and manage the life cycle of the memory objects. The processor can allocate address spaces for the memory objects and the copies of the memory objects respectively on the user space and the backup memory based on the kernel memory management service, generate respective page tables, and switch the page tables when a UCE error occurs in the memory object to read the copies of the memory objects.

[0079] The data reading method provided by the embodiment of the present application can be applied to fields such as big data, cloud computing, high-performance computing, machine learning, and trading systems. The embodiment of the present application does not limit the application fields.

[0080] Next, the technical solutions of the embodiments of the present application will be described in detail through specific embodiments. It should be noted that the following specific embodiments can be combined with each other, and the same or similar concepts or processes will not be repeated in some embodiments.

[0081] Figure 7 It is a schematic flowchart of a data reading method provided by an embodiment of the present application. Refer to Figure 3 and Figure 7 As shown, the executable file of the application program is stored in the user space of the main memory. Therefore, after the application program is started, the processor can implement the data reading method provided by the embodiment of the present application based on the configured memory object management service and kernel memory management service. The method includes:

[0082] S101. The processor creates a target memory object in response to a request to read a data set in the form of a memory object.

[0083] Exemplarily, the data set represents a collection of data, and the data can be of types such as numerical values, strings, images, etc., which are not limited in the embodiments of the present application. During the running of the process, a request to read a data set in the form of a memory object can be triggered, and this request is used to indicate the creation of a memory object. The request to read a data set in the form of a memory object may include the data set to be read, such as the location of the data set to be read in an external storage device; it may also include various parameters for the memory object to be created, such as the size of the memory object, access permissions (read-only, read-write, etc.). The target memory object represents the memory object indicated by the request to read a data set in the form of a memory object.

[0084] In one example, when a process needs to read a data set in the form of a memory object during its operation, it sends a request to the operating system to read the data set in the form of a memory object. The request to read the data set in the form of a memory object can be triggered by the processor when starting the process. For example, when starting the process, the executable file needs to be loaded into the user space of the main memory. At this time, a target memory object is created to load the data set (executable file) required by the process stored in the external storage device into the memory device. The request to read the data set in the form of a memory object can also be triggered by the processor during the operation of the process. Exemplarily, during the operation of the process, if it is necessary to dynamically allocate memory to store data, such as when using the malloc function or the new function to apply for dynamic memory allocation, the process will trigger a request to read the data set in the form of a memory object to create the corresponding target memory object. Further, the processor can, based on the aforementioned memory object management service, in response to the request to read the data set in the form of a memory object, allocate an entry in the kernel for the new target memory object, and this entry is used to record the relevant metadata of the target memory object, such as the identifier, size, virtual address, access permission, creation time, etc. of the target memory object. In this way, the processor can accurately create the target memory object indicated by the request to read the data set in the form of a memory object based on the request, ensuring the integrity of the data.

[0085] Optionally, the processor can, based on the kernel memory management service, allocate a continuous virtual address in the virtual address space of the operating system for the target memory object according to the memory object size of the request to read the data set in the form of a memory object, that is, the target memory virtual address, and this target memory virtual address will be used as the identifier of the target memory object in the process address space, and subsequent accesses by the process to the target memory object are all carried out through the target memory virtual address.

[0086] S102. The processor creates a current page table based on the target memory virtual address and the physical address of the first memory; and creates a target page table based on the target memory virtual address and the physical address of the second memory.

[0087] Exemplarily, the target memory virtual address represents the virtual address of the target memory object. As mentioned in the previous step S101, when the processor creates the target memory object, it will allocate a section of virtual address for the target memory object. The first memory is the physical memory in the main memory of the computing device, and the second memory is the physical memory in the backup memory of the computing device. The current page table is used to represent the correspondence between the target memory virtual address and the physical address of the target memory object in the first memory; the target page table is used to represent the correspondence between the target memory virtual address and the physical address of the target memory object in the second memory.

[0088] In one example, after the processor creates the target memory object, the processor can, based on the kernel memory management service, allocate physical address spaces for the target memory object in the first memory and the second memory respectively, for storing the data set corresponding to the target memory object, to obtain the physical address of the first memory and the physical address of the second memory. Further, a current page table can be generated based on the target memory virtual address and the physical address of the first memory, and a target page table can be generated based on the target memory virtual address and the physical address of the second memory. Among them, the processor can allocate a physical address for the target memory object based on a preset physical address allocation policy in the first memory, and this application does not limit how to determine the physical address of the target memory object in the memory. In this way, the processor can accurately obtain the current page table and the target page table associated with the current page table based on the target memory virtual address, the physical address of the first memory, and the physical address of the second memory, facilitating subsequent page table switching.

[0089] In some possible implementation manners, the processor can allocate physical addresses for the target memory object in each backup memory included in the computing device, to obtain physical addresses of multiple second memories, and generate multiple target page tables according to the physical addresses of the target memory object in each second memory and the target memory virtual address. The number of the target page tables is consistent with the number of backup memories included in the computing device. Among them, for each second memory, the processor can allocate a physical address for the target memory object based on a preset memory allocation algorithm, and this application does not make any limitation here.

[0090] In some possible implementations, the processor may first determine the backup memory used by the target memory object, and in the backup memory used by the target memory object, allocate a physical address for the target memory object to obtain the physical addresses of the second memory used by multiple target memory objects. Then, based on the physical addresses of the second memory used by the target memory object and the target memory virtual address, multiple target page tables are generated. For example, the processor may first determine the number of backup memories used by the target memory object according to the type or life cycle of the target memory object, and then determine the backup memory used by the target memory object that meets the quantity requirement according to the storage space utilization rate of each backup memory included in the computing device. Specifically, the corresponding relationship between the life cycle and the quantity may be preset in the kernel. The longer the life cycle, it indicates that the data corresponding to the target memory object has a longer usage cycle, and thus more backup memories can be used; the shorter the life cycle, the fewer backup memories can be used. Or, the corresponding relationship between different types of memory objects and the quantity of backup memories is set in the kernel. For example, the quantity of code type is a, and the quantity of data type is b. Then, the quantity of the backup memory used can be determined according to the type of the target memory object. After determining the quantity, the backup memory whose storage space utilization rate meets the size requirement of the target memory object can be selected as the backup memory used by the target memory object. In this way, the processor can accurately determine a more suitable backup memory for the target memory object according to the target memory object, so as to ensure the accuracy and integrity of the data.

[0091] Optionally, in this way, an association relationship of page tables is formed among the target memory object (target memory virtual address), the current page table, and the target page table. Refer to Figure 8 as shown Figure 8 is a schematic diagram of an association relationship of page tables provided by an embodiment of the present application. After creating the target memory object, the processor may generate the association relationship of page tables based on the current page table and the target page table to associate the target memory object, the first memory, and the second memory.

[0092] S103. The processor respectively loads the target memory object from the external storage device of the computing device into the first memory and the second memory in parallel based on the current page table and the target page table.

[0093] Exemplarily, as described above, in a request to read a data set in the form of a memory object, the location of the data set to be read in the external storage device can be indicated. After the processor creates the target memory object, based on the kernel memory management service, according to the location of the data set to be read in the external storage device indicated in the request to read the data set in the form of a memory object, the data set to be read, or rather, the target memory object, can be loaded into the first memory and the second memory in parallel from the external storage device. Among them, the target memory object is stored in the first memory as the first memory object and stored in the second memory as the second memory object, and the second memory object can be used as a copy of the first memory object.

[0094] In this embodiment, the processor of the computing device can respond to a request to read a data set in the form of a memory object, create a target memory object, generate a current page table based on the target memory virtual address of the target memory object and the physical address allocated for the target memory object in the first memory, and generate a target page table based on the target memory virtual address of the target memory object and the physical address allocated for the target memory object in the second memory; and then the target memory object can be loaded into the first memory and the second memory in parallel from the external storage device of the computing device based on the current page table and the target page table respectively. In this way, when the processor loads the data of the target memory object, by storing multiple copies of the memory object in the first memory and the second memory, the fault tolerance and reliability of the data can be improved, so that when reading the target memory object, if the main memory fails, the current page table can be switched to the target page table to read the copy of the target memory object from the backup memory, without pausing the service processing and reloading the data from the external storage device, thus improving the service processing efficiency.

[0095] Figure 9 It is a schematic flowchart of a data reading method provided by an embodiment of the present application. Figure 10 It is a schematic diagram of an application scenario provided by an embodiment of the present application. Refer to Figure 9 and Figure 10 As shown, the method includes:

[0096] S201. When the processor reads the first memory object through the target memory virtual address in a process, if it identifies that there is an uncorrectable error fault in the first memory, replace the current page table with the target page table.

[0097] Exemplarily, the target memory virtual address is the virtual address of the memory object, and this target memory virtual address may correspond to a first memory object in the main memory and, in addition, a second memory object that is a plurality of copies in the backup memory. Among them, the data of the first memory object is consistent with the data of the second memory object that is a copy. The first memory object is stored in the first memory; the first memory is the physical memory in the main memory of the computing device; the main memory is the local memory; the current page table is used to indicate the mapping relationship between the target memory virtual address and the first memory; the target page table is used to indicate the mapping relationship between the target memory virtual address and the second memory; the second memory is located in the backup memory. The uncorrectable error fault indicates that there is an irreparable error UCE in the memory.

[0098] In one example, during the running of the process, the first memory object can be accessed through the target memory virtual address, and based on the current page table of the first memory object by the kernel, the physical address in the first memory corresponding to the target memory virtual address can be determined. Furthermore, the first memory object can be read from the physical address space in the first memory and returned to the process for use. However, during this process, if the processor recognizes that there is an uncorrectable error fault in the first memory, it means that the first memory object cannot be read from the first memory, and the copy of the first memory object can be read instead. Therefore, the processor can replace the current page table with the target page table based on the kernel memory management service.

[0099] Specifically, when the processor reads the first memory object through the target memory virtual address by the process, it can determine whether there is an uncorrectable fault interrupt in the first memory. For example, it can be based on whether an uncorrectable fault interrupt signal triggered by the first memory is received. If so, it means that there is an uncorrectable fault interrupt in the first memory, and then it can be determined that there is an uncorrectable error fault in the first memory. Furthermore, the processor can, based on the kernel memory management service, determine the target page table corresponding to the current page table according to the page table association relationship of the first memory object, and replace the current page table with the target page table. Among them, the page table association relationship is used to indicate the current page table and the associated alternative page tables. As mentioned above, when creating a memory object, the current page table and the target page table can be generated, and then the mapping relationship between the two can be established, that is, this page table association relationship. For example, as Figure 10 shown, when there is an uncorrectable error fault in the first memory where the memory object 2 is located, the target page table associated with the current page table can be determined based on the page table association relationship.

[0100] In this way, when the processor determines that there is an uncorrectable fault interrupt, it can determine that there is an uncorrectable error fault in the first memory, and then immediately switch the current page table, avoiding the time-consuming of further accessing the faulty first memory, and improving the access efficiency of memory objects; moreover, based on the page table association relationship, the target page table associated with the current page table can be quickly and accurately determined, avoiding the service suspension caused by the failure of memory object access, and improving the service processing efficiency.

[0101] Optionally, when creating the first memory object, the processor can create multiple copies of the second memory object, and each second memory object is located in different backup memories of the computing device. Furthermore, the page table association relationship can represent multiple page tables associated with the current page table. In this implementation manner, the processor can determine one or more candidate page tables associated with the current page table according to the page table association relationship; and determine the target page table from the candidate page tables based on a preset rule.

[0102] Exemplarily, the preset rule represents the screening method of the target page table, and the content of the preset rule is not limited in the embodiments of the present application. For example, each page table has an attribute of usage rate, and the preset rule can be that the candidate page table with the lowest usage rate is used as the target page table. Furthermore, after the processor determines one or more candidate page tables according to the page table association relationship, the candidate page table with the lowest usage rate can be used as the target page table. The page table can also be configured with a status attribute, including an available status, an idle status, and an unavailable status. The available status represents the page table currently being used by the memory object, the idle status represents the page table that has not been used and has not had an error, and the unavailable status represents that the page table has had a read error. The preset rule can be to select the candidate page table in the idle status as the target page table. Furthermore, after the processor determines one or more candidate page tables according to the page table association relationship, the candidate page table in the idle status can be used as the target page table.

[0103] By creating multiple copies of the memory object, the fault tolerance and reliability of data can be improved, and based on the preset rule to select the target page table, the backup memory of the computing device can be effectively managed and the memory load can be balanced.

[0104] Optionally, the processor can update the status of the current page table to the unavailable status and update the status of the target page table to the available status.

[0105] Exemplarily, the page table has a status attribute. Since the current page table has an uncorrectable error fault, to avoid subsequent use of this page table, the processor can update the status of the current page table to the unavailable status based on the kernel memory management service and update the status of the target page table to the available status for the convenience of page table management.

[0106] S202. The processor reads the second memory object from the second memory based on the target page table.

[0107] Exemplarily, the second memory object is a copy of the first memory object. As mentioned above, the second memory object is pre-stored in the physical address space of the second memory corresponding to the target page table. Therefore, the processor can, based on the kernel memory management service, read the second memory object from the second memory according to the physical address in the target page table. It can be understood that the physical address ranges of different memories are different, so the memory corresponding to the physical address can be determined according to different physical addresses.

[0108] In this embodiment, when the processor of the computing device reads the first memory object through the target memory virtual address, if it identifies that there is an uncorrectable error fault in the first memory, it replaces the current page table with the target page table associated with the current page table, and based on the target page table, reads the second memory object from the second memory. In this way, when an uncorrectable error fault occurs in reading the main memory, the current page table can be replaced with the target page table, and the copy of the first memory object, that is, the second memory object, can be read from the backup memory, without the need for the processor to pause the process or reload the memory object, reducing the time-consuming of fault recovery and improving the business processing efficiency.

[0109] Figure 11 It is a schematic structural diagram of a data reading device provided by an embodiment of the present application. As Figure 11 shown, the data reading device 300 includes:

[0110] A replacement module 301, configured to replace the current page table with the target page table if it identifies that there is an uncorrectable error fault in the first memory when the process reads the first memory object through the target memory virtual address;

[0111] Wherein, the first memory object is stored in the first memory; the first memory is the physical memory in the main memory of the computing device; the main memory is the local memory;

[0112] The current page table is used to indicate the mapping relationship between the target memory virtual address and the first memory;

[0113] The target page table is used to indicate the mapping relationship between the target memory virtual address and the second memory; the second memory is located in the backup memory; the backup memory is physically isolated from the main memory;

[0114] A reading module 302, configured to read the second memory object from the second memory based on the target page table; wherein, the second memory object is a copy of the first memory object.

[0115] In a possible implementation manner, the replacement module 301 is specifically configured to:

[0116] Determine the target page table corresponding to the current page table according to the page table association relationship; wherein, the page table association relationship is used to indicate the current page table and the associated backup page tables.

[0117] In a possible implementation manner, the replacement module 301 is specifically configured to:

[0118] Determine one or more candidate page tables according to the page table association relationship;

[0119] Determine the target page table from the candidate page tables based on a preset rule.

[0120] In a possible implementation manner, the device further includes an update module, configured to:

[0121] Update the status of the current page table to an unavailable status, and update the status of the target page table to an available status.

[0122] In a possible implementation manner, the device further includes a creation module, configured to:

[0123] Create a target memory object;

[0124] Based on the current page table and the target page table respectively, load the target memory object from the external storage device of the computing device to the first memory and the second memory in parallel; wherein, the target memory object is stored in the first memory as the first memory object; the target memory object is stored in the second memory as the second memory object.

[0125] In a possible implementation manner, the creation module is specifically configured to:

[0126] Create the current page table based on the target memory virtual address and the physical address of the first memory; and create the target page table based on the target memory virtual address and the physical address of the second memory.

[0127] In a possible implementation manner, the creation module is specifically configured to:

[0128] In response to a request to read a data set in the form of a memory object, create the target memory object.

[0129] In a possible implementation manner, the device type of the backup memory includes: a Compute Express Link (CXL) memory device.

[0130] In a possible implementation manner, the replacement module 301 is specifically configured to:

[0131] Determine whether there is an uncorrectable fault interruption in the first memory;

[0132] In the case of an uncorrectable fault interruption in the first memory, identify that there is an uncorrectable fault in the first memory.

[0133] The data reading device provided in this embodiment can execute the data reading method in the above method embodiment, and its beneficial effects are similar, so details are not described herein again.

[0134] Figure 12 This is a schematic structural diagram of a computing device provided by an embodiment of the present application. As Figure 8 shown, the computing device 400 includes a processor 401 and a memory 402 communicatively connected to the processor. Optionally, the computing device 400 further includes a communication component 403. Among them, the processor 401, the memory 402, and the communication component 403 are connected by a bus.

[0135] In a specific implementation process, at least one processor 401 executes computer-executable instructions stored in the memory 402, so that at least one processor 401 executes the above method.

[0136] For the specific implementation process of the processor 401, reference can be made to the above method embodiment. Its implementation principle and technical effects are similar, so details are not described herein again.

[0137] In the above embodiment, it should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in combination with the embodiments of the present application can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules in the processor.

[0138] The memory may include a high-speed random access memory (RAM), and may also include non-volatile memory (NVM), such as at least one disk memory.

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

[0140] The embodiments of this application also provide a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the technical solutions provided in any of the foregoing method embodiments.

[0141] The embodiments of this application also provide a computer program product, including a computer program. When the computer program is executed by a processor, it is used to implement the technical solutions provided in the foregoing method embodiments.

[0142] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the embodiments of this application, and not to limit them; although the embodiments of this application have been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of this application.

Claims

1. A data reading method, characterized in that, The method is applied to a computing device; the method includes: When a process reads a first memory object through a target memory virtual address, if it is identified that the first memory has an uncorrectable error fault, replace the current page table with a target page table; Wherein, the first memory object is stored in the first memory; the first memory is a physical memory in the main memory of the computing device; the main memory is a local memory; The current page table is used to indicate the mapping relationship between the target memory virtual address and the first memory; The target page table is used to indicate the mapping relationship between the target memory virtual address and a second memory; the second memory is located in a backup memory; the backup memory is physically isolated from the main memory; Based on the target page table, read a second memory object from the second memory; wherein, the second memory object is a copy of the first memory object.

2. The method according to claim 1, wherein The replacing the current page table with the target page table includes: Determine the target page table corresponding to the current page table according to the page table association relationship; wherein, the page table association relationship is used to indicate the current page table and the associated alternate page tables.

3. The method according to claim 2, wherein The determining the target page table corresponding to the current page table according to the page table association relationship includes: Determine one or more candidate page tables according to the page table association relationship; Based on a preset rule, determine the target page table from the candidate page tables.

4. The method according to claim 3, characterized in that After determining the target page table corresponding to the current page table, the method further includes: Update the status of the current page table to an unavailable status, and update the status of the target page table to an available status.

5. The method according to any one of claims 1-4, characterized in that, Before a process reads a first memory object through a target memory virtual address, the method further includes: Create a target memory object; Based on the current page table and the target page table respectively, load the target memory object from an external storage device of the computing device into the first memory and the second memory in parallel; wherein, the target memory object is stored in the first memory as the first memory object; the target memory object is stored in the second memory as the second memory object.

6. The method according to claim 5, wherein Before loading the target memory object from an external storage device of the computing device into the first memory and the second memory in parallel, the method further includes: Create the current page table based on the target memory virtual address and the physical address of the first memory; and create the target page table based on the target memory virtual address and the physical address of the second memory.

7. The method according to claim 5, characterized in that The creating the target memory object includes: In response to a request to read a data set in the form of a memory object, create the target memory object.

8. The method according to any one of claims 1 to 7, characterized in that The device type of the backup memory includes: a Compute Express Link (CXL) memory device.

9. The method according to any one of claims 1-8, characterized in that, The identifying that the first memory has an uncorrectable error fault includes: Determine whether the first memory has an uncorrectable fault interrupt; In the case that the first memory has an uncorrectable fault interrupt, identify that the first memory has an uncorrectable fault.

10. A computing device, characterized in that, The computing device includes a processor and a memory; Wherein, the memory is used to store computer execution instructions; The processor is used to execute the computer-executable instructions to implement the data reading method according to any one of claims 1-9.

Citation Information

Cited By

  • Host data reading method, electronic equipment, medium and program product

    CN121143733A

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

    CN121143733B