IP Library › Granted Patent US 12,093,712
Granted Patent B2
US 12,093,712 · App. 17/211,272 · Granted Sep 17, 2024

Method and apparatus for handling memory failure, electronic device and storage medium

Inventor: Xiaowei Hu (Beijing, CN)
Assignee: BEIJING BAIDU NETCOM SCIENCE AND TECHNOLOGY CO., LTD.
G06F9/45558G06N7/01G06F2009/4557G06F2009/45583
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,093,712
App. No.
17/211,272
Granted
Sep 17, 2024
Kind
B2
Abstract

A method and an apparatus for handling a memory failure is provided. The method includes: in response to detecting a failure occurring in memory of a host machine, acquiring a failure parameter of the memory, determining a crash probability of the host machine based on the failure parameter, and transferring all virtual machines on the host machine to a target host machine when the crash probability is greater than or equal to a first predetermined threshold. A crash probability of the target host machine is less than a second predetermined threshold. The second predetermined threshold is less than the first predetermined threshold. Further, an electronic device and storage medium are provided.

Claims (83)

1. A method for handling a memory failure, comprising:

in response to detecting a failure occurring in memory of a host machine, acquiring a failure parameter of the memory;

determining a crash probability of the host machine based on the failure parameter; and

transferring all virtual machines on the host machine to a target host machine when the crash probability is greater than or equal to a first predetermined threshold, wherein a crash probability of the target host machine is less than a second predetermined threshold, the second predetermined threshold is less than the first predetermined threshold;

wherein the method further comprises:

acquiring a first control instruction sent by a kernel system;

writing information into a target position of a target memory page of the host machine based on the first control instruction;

generating a first code corresponding to the target position of the target memory page based on the written information;

acquiring a second control instruction sent by a kernel system;

reading information out from the target position of the target memory page of the host machine based on the second control instruction;

generating a second code corresponding to the target position of the target memory page based on the read-out information; and

determining that the failure occurs in the target memory page when the first code is different from the second code;

wherein the acquiring the failure parameter of the memory comprises:

parsing the first code and the second code based on a predetermined algorithm;

acquiring difference codes between the first code and the second code after the parsing;

determining one or more incorrect bits corresponding to the target position of the target memory page based on the difference codes; and

determining a number of the one or more incorrect bits and position features of the one or more incorrect bits based on the one or more incorrect bits;

the method further comprising:

marking the memory when the crash probability of the host machine is less than the first predetermined threshold and greater than or equal to the second predetermined threshold; and

determining target virtual machines based on the crash probability of the host machine and a number of all the virtual machines on the host machine and transferring the target virtual machines, wherein a number of the target virtual machines is less than the number of all the virtual machines.

2. The method according to claim 1 , further comprising:

closing a virtual machine process when the virtual machine process is running on the memory.

3. The method according to claim 1 , wherein the determining the crash probability of the host machine based on the failure parameter comprises:

acquiring a pre-trained probability analysis model; and

inputting the failure parameter into the pre-trained probability analysis model for process to acquire the crash probability of the host machine.

4. The method according to claim 1 , further comprising:

marking the memory when the crash probability of the host machine is less than the second predetermined threshold.

5. An electronic device, comprising:

at least one processor; and

memory communicatively coupled to the at least one processor;

the memory is configured to store instructions executable by the at least one processor;

wherein, when the instructions are executed by the at least one processor, the at least one processor is caused to implement the method for handling a memory failure, comprising:

in response to detecting a failure occurring in memory of a host machine, acquiring a failure parameter of the memory;

determining a crash probability of the host machine based on the failure parameter; and

transferring all virtual machines on the host machine to a target host machine when the crash probability is greater than or equal to a first predetermined threshold, wherein a crash probability of the target host machine is less than a second predetermined threshold, the second predetermined threshold is less than the first predetermined threshold;

wherein the at least one processor is caused to further implement operations of:

acquiring a first control instruction sent by a kernel system;

writing information into a target position of a target memory page of the host machine based on the first control instruction;

generating a first code corresponding to the target position of the target memory page based on the written information;

acquiring a second control instruction sent by a kernel system;

reading information out from the target position of the target memory page of the host machine based on the second control instruction;

generating a second code corresponding to the target position of the target memory page based on the read-out information; and

determining that the failure occurs in the target memory page when the first code is different from the second code;

wherein acquiring the failure parameter of the memory comprises:

parsing the first code and the second code based on a predetermined algorithm;

acquiring difference codes between the first code and the second code after the parsing;

determining one or more incorrect bits corresponding to the target position of the target memory page based on the difference codes; and

determining a number of the one or more incorrect bits and position features of the one or more incorrect bits based on the one or more incorrect bits;

wherein the at least one processor is caused to further implement operations of:

marking the memory when the crash probability of the host machine is less than the first predetermined threshold and greater than or equal to the second predetermined threshold; and

determining target virtual machines based on the crash probability of the host machine and a number of all the virtual machines on the host machine and transferring the target virtual machines, wherein a number of the target virtual machines is less than the number of all the virtual machines.

6. The electronic device according to claim 5 , wherein the at least one processor is caused to further implement an operation of:

closing a virtual machine process when the virtual machine process is running on the memory.

7. The electronic device according to claim 5 , wherein determining the crash probability of the host machine based on the failure parameter comprises:

acquiring a pre-trained probability analysis model; and

inputting the failure parameter into the pre-trained probability analysis model for process to acquire the crash probability of the host machine.

8. The electronic device according to claim 5 , wherein the at least one processor is caused to further implement an operation of:

marking the memory when the crash probability of the host machine is less than the second predetermined threshold.

9. A non-transitory computer-readable storage medium having computer instructions stored thereon, wherein the computer instructions are configured to cause a computer to perform the method for handling a memory failure, comprising:

in response to detecting a failure occurring in memory of a host machine, acquiring a failure parameter of the memory;

determining a crash probability of the host machine based on the failure parameter; and

transferring all virtual machines on the host machine to a target host machine when the crash probability is greater than or equal to a first predetermined threshold, wherein a crash probability of the target host machine is less than a second predetermined threshold, the second predetermined threshold is less than the first predetermined threshold;

wherein the method further comprises:

acquiring a first control instruction sent by a kernel system;

writing information into a target position of a target memory page of the host machine based on the first control instruction;

generating a first code corresponding to the target position of the target memory page based on the written information;

acquiring a second control instruction sent by a kernel system;

reading information out from the target position of the target memory page of the host machine based on the second control instruction;

generating a second code corresponding to the target position of the target memory page based on the read-out information; and

determining that the failure occurs in the target memory page when the first code is different from the second code;

wherein acquiring the failure parameter of the memory comprises:

parsing the first code and the second code based on a predetermined algorithm;

acquiring difference codes between the first code and the second code after the parsing;

determining one or more incorrect bits corresponding to the target position of the target memory page based on the difference codes; and

determining a number of the one or more incorrect bits and position features of the one or more incorrect bits based on the one or more incorrect bits;

wherein the method further comprises:

marking the memory when the crash probability of the host machine is less than the first predetermined threshold and greater than or equal to the second predetermined threshold; and

determining target virtual machines based on the crash probability of the host machine and a number of all the virtual machines on the host machine and transferring the target virtual machines, wherein a number of the target virtual machines is less than the number of all the virtual machines.

10. The non-transitory computer-readable storage medium according to claim 9 , wherein the method further comprises:

closing a virtual machine process when the virtual machine process is running on the memory.

11. The non-transitory computer-readable storage medium according to claim 9 , wherein determining the crash probability of the host machine based on the failure parameter comprises:

acquiring a pre-trained probability analysis model; and

inputting the failure parameter into the pre-trained probability analysis model for process to acquire the crash probability of the host machine.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Mar 25, 2021
From: HU, XIAOWEI
To: BEIJING BAIDU NETCOM SCIENCE AND TECHNOLOGY CO., LTD.
Reel/Frame 055721/0594 →
Priority Claims (1)
CN 202010477094.7 · May 29, 2020 · national
Continuity (1)
Related Publication 20210208923A1 · Jul 8, 2021