Conflict processing method, device, storage medium, and program product

By acquiring device resources, adjusting priorities, and adopting a multi-level exponential backoff retry strategy, the problem of resource conflicts in server hardware management was solved, improving system stability and resource utilization, and ensuring the normal operation of critical equipment.

CN120780528BActive Publication Date: 2025-12-12INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202511281232.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-09
Publication Date
2025-12-12
Estimated Expiration
2045-09-09

AI Technical Summary

Technical Problem

In server hardware management, the lack of dynamic adaptation capabilities in the allocation of storage solutions leads to resource conflicts among multiple devices, causing index errors and resource contention, which affects system stability and resource utilization.

Method used

By acquiring resources from multiple devices and adjusting their priorities, resources are allocated according to priority. A multi-level exponential backoff retry strategy is used for initialization verification, and devices that fail verification are disabled to ensure the normal operation of critical equipment.

Benefits of technology

It improved server stability and resource utilization, ensuring that core business operations were not affected, and increased the success rate of device initialization and system reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120780528B_ABST
    Figure CN120780528B_ABST
Patent Text Reader

Abstract

The application provides a conflict processing method, which can be applied to the technical field of computers. The conflict processing method comprises the following steps: in response to detecting that resource allocation of a plurality of devices of a server is in conflict, obtaining resource adjustment priorities of the plurality of devices; adjusting the resource allocation of the devices in conflict among the plurality of devices according to the resource adjustment priorities of the devices; performing multi-stage exponential backoff retries on the plurality of devices respectively to perform initialization verification on the plurality of devices; mounting the devices that pass the initialization verification, and disabling the devices that do not pass the initialization verification. The application further provides an electronic device, a storage medium and a program product.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer, more particularly, to a conflict processing method, device, storage medium and program product. BACKGROUND

[0002] In the field of server hardware management, the selection and performance of storage media are crucial to the overall stability of the system. The storage solution used to carry the running data and configuration information of core functions such as baseboard management controller and intelligent platform management interface directly affects the stable operation of key functions such as server hardware monitoring, fault diagnosis and remote management. However, when resource conflicts exist in multiple devices of the storage solution, the lack of dynamic adaptation capability of the system in resource allocation of the storage solution reduces the stability of the system. SUMMARY

[0003] In view of the above problems, the present application provides a conflict processing method, device, storage medium and program product for improving system stability.

[0004] According to a first aspect of the present application, a conflict processing method is provided, comprising: in response to detecting that resource allocation of multiple devices of a server is in conflict, obtaining resource adjustment priorities of the multiple devices; adjusting resource allocation of devices in conflict among the multiple devices according to resource adjustment priorities of the devices; initializing and verifying the multiple devices by performing multi-level exponential backoff retries on the multiple devices respectively; mounting devices that pass the initialization and verification, and disabling devices that do not pass the initialization and verification.

[0005] A second aspect of the present application provides an electronic device, comprising: one or more processors; a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the above method.

[0006] A third aspect of the present application further provides a computer-readable storage medium having a computer program or instructions stored thereon, wherein the computer program or instructions are executed by a processor to implement the steps of the above method.

[0007] A fourth aspect of the present application further provides a computer program product comprising a computer program or instructions, wherein the computer program or instructions are executed by a processor to implement the steps of the above method.

[0008] According to the embodiment of the present application, by acquiring the resource adjustment priority of the plurality of devices, the priority level of the device in the resource competition is determined, and then the resource is allocated according to the priority level, so as to ensure that the key device or service is not affected, guarantee the core service, avoid disordered competition, improve the resource utilization rate, in the device initialization verification process, the multi-level exponential backoff retry strategy is applied to cope with temporary failure, by dynamically adjusting the retry interval, the server efficiency and the initialization success rate are balanced, while guaranteeing the server stability, the device initialization success rate is improved. BRIEF DESCRIPTION OF DRAWINGS

[0009] The above and other objects, features and advantages of the present application will become more apparent from the following description when taken in conjunction with the accompanying drawings, in which:

[0010] Figure 1 An application scenario diagram of the conflict processing method, device, storage medium and program product according to the embodiment of the present application is shown.

[0011] Figure 2 A flowchart of the conflict processing method according to the embodiment of the present application is shown.

[0012] Figure 3 A flowchart of the conflict processing method according to another embodiment of the present application is shown.

[0013] Figure 4 A flowchart of the bad block repair method according to the embodiment of the present application is shown.

[0014] Figure 5 A flowchart of the hot switching method according to the embodiment of the present application is shown.

[0015] Figure 6 A structural block diagram of the conflict processing device according to the embodiment of the present application is shown.

[0016] Figure 7 A block diagram of the electronic device suitable for implementing the conflict processing method according to the embodiment of the present application is shown. DETAILED DESCRIPTION

[0017] Hereinafter, embodiments of the present application will be described with reference to the accompanying drawings. It is to be understood, however, that the description is merely exemplary and is intended to provide a thorough understanding of the present application. The following description of embodiments is intended to enable those skilled in the art to carry out the application. However, it is to be understood that one or more embodiments can be carried out without these specific details. In addition, in the following description, descriptions of well-known structures and techniques are omitted to avoid unnecessarily obscuring the concept of the present application.

[0018] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used herein, the terms "comprises", "comprising", "includes", "including" and the like are specifically intended to be open-ended and to mean that other features, steps, operations, and / or components can be added.

[0019] All terms used herein including technical and scientific terms have the meanings commonly understood by one of ordinary skill in the art unless otherwise defined. It should be noted that the terms used herein are defined as consistent with the context where used, and should not be construed as ideal or overly formal unless expressly so defined.

[0020] In the case of using expressions similar to "at least one of A, B, and C", it should generally be interpreted to include any of them, to include a combination of at least one of the items, to include all of them, and to include an opposite combination thereof, unless otherwise specified.

[0021] In the field of server hardware management, flash is often used for image and data storage. However, as the data storage capacity requirements increase, the capacity of flash is insufficient to meet the actual requirements, and gradually turns to the use of embedded multi-media card (eMMC) storage. The reliability of eMMC directly affects the core functions of baseboard management controller (BMC) / intelligent platform management interface (IPMI). The technology relying on static device tree configuration and periodic log analysis has problems such as hardware fault detection lag (minute-level response), emergency switching relying on manual intervention, and single file system repair strategy, which cannot meet the high availability requirements.

[0022] In the device tree design, multiple devices with similar functions but different hardware details are managed by a unified driver, which realizes the consolidation of driving the same type of devices, reduces the kernel code redundancy, and improves the maintainability, such as eMMC, SD (Secure Digital) card, extended memory, etc. This makes the same type of devices may exist resource conflict, index disorder, in this case, each device of the same type needs to be manually configured, and the index is determined after the feature recognition of each device of the same type is completed. In the embedded field of BMC, it is necessary to break the strong binding relationship between software and hardware, while ensuring that the system after decoupling can still run stably. Since in the default case, the system may dynamically allocate the index according to the device enumeration order (such as the order detected during startup), which may cause the index to drift, therefore, it is hoped to fix the index of each device, reasonably allocate resources, solve the "identity confusion" and "resource contention" problem in the multi-device environment, so as to not only guarantee the stability of the core function (such as the BMC management service is not preempted by resources), but also improve the overall resource utilization, and lay the foundation for the maintainability and reliability of the system. The resources can be system hardware resources, such as central processing unit (CPU), memory, disk input / output (I / O), network bandwidth, bus bandwidth, etc., and software level abstract resources, such as process identifier (ID), port number, lock resource, etc.

[0023] The present application proposes a series of technical improvements to address the deficiencies of eMMC in stability and reliability, in order to solve the following specific problems.

[0024] 1. Mount resource conflict: when eMMC devices coexist with SD card controllers such as SDHCI (Secure Digital Host Controller Interface), the same type of driver, the device index (mmcblk0 / mmcblk1) is randomly used, which causes device dependency error during startup, and cannot be used. Among them, mmcblk0 and mmcblk1 are naming formats for identifying multimedia card devices, mmc (MultiMediaCard) refers to storage devices that adopt MMC (MultiMediaCard) / SD protocol, blk (Block Device) represents block access storage devices, 0 / 1: device number, used to distinguish multiple devices of the same type.

[0025] 2. Device initialization fault tolerance: the kernel driver loading sequence or hardware initialization delay causes the device node creation to lag, which causes mounting failure and persistent unavailability.

[0026] 3. File system repair defects: Traditional fsck (File System Consistency Check) tools cannot adapt to embedded scenarios, repair strategies are single and lack fault tolerance mechanisms, and are prone to trigger system crashes.

[0027] 4. Insufficient hardware failure handling: When eMMC hardware is damaged, there is a lack of software layer rapid detection and emergency switching mechanism, resulting in system paralysis.

[0028] For ease of understanding, the terms appearing in this application are uniformly explained:

[0029] BMC is a special microcontroller used to monitor and manage key parameters of server hardware such as temperature, voltage, fan speed and power status. BMC can also provide remote management functions, allowing administrators to troubleshoot and repair problems when they occur.

[0030] Flash (flash memory), a form of electronic erasable programmable read-only memory, allows the memory to be erased or written multiple times during operation. This technology is mainly used for general data storage and data exchange between computers and other digital products, such as memory cards and USB drives. Flash memory is a special type of erasable programmable read-only memory (EPROM) that is erased in macro blocks. Early flash memory erased the entire chip of data at once, and eMMC is a standard specification for embedded memory mainly for products such as mobile phones or tablets. eMMC integrates a controller in the package, providing a standard interface and managing flash memory, allowing mobile phone manufacturers to focus on other parts of product development and shorten the time to market. It can also be written as emmc.

[0031] Device tree is a device information that exists in the system. When the machine is booted, the operating system (Operating System, OS) establishes this tree by using the information obtained by the driver and other components, and updates this tree when devices are added or deleted.

[0032] Finite state machine (FSM) is a computing model abstracted for the study of finite memory computing processes and certain language classes. Finite state automaton has a finite number of states, each state can migrate to zero or more states, and the input string determines which state to migrate. Finite state automaton can be represented as a directed graph. Finite state automaton is the research object of automata theory.

[0033] Fsck is used to check and maintain inconsistent file systems. If the system is powered off or the disk has a problem, the fsck command can be used to check the file system.

[0034] ADMA (Advanced Direct Memory Access) error code is a specific status code used in SD card / eMMC controllers to identify Direct Memory Access (DMA) transmission abnormalities, which belongs to hardware-level error indication.

[0035] Device conflict: resources are allocated by fixing device tree nodes, lacking dynamic adaptation ability, and multiple devices coexist, which can easily cause index conflict, such as random allocation of mmcblk0 / mmcblk1.

[0036] Fault recovery: the traditional fsck tool only supports basic bad block repair, cannot process according to bad block density classification, and hardware fault switching is mostly cold backup (requires restart).

[0037] Abnormal power failure: relying on hardware Error-Correcting Code (ECC) error correction, the software layer lacks data protection mechanism, and abnormal power failure can easily cause irreversible damage to eMMC data.

[0038] Embodiments of the present application provide a conflict processing method, comprising: in response to detecting that resource allocation of multiple devices of a server exists conflict, obtaining resource adjustment priorities of the multiple devices; adjusting resource allocation of devices in conflict among the multiple devices according to resource adjustment priorities of the devices; performing initialization verification on the multiple devices by performing multi-level exponential backoff retry on the multiple devices respectively; mounting devices that pass the initialization verification, and disabling devices that do not pass the initialization verification.

[0039] According to embodiments of the present application, by obtaining the priority of each device, the priority of the device in resource competition is determined, and then the resource is allocated according to the priority, so as to ensure that the key device or service is not affected, protect the core business, avoid disorderly competition, improve the resource utilization rate, in the device initialization verification process, the multi-level exponential backoff retry strategy is applied to cope with temporary failure, by dynamically adjusting the retry interval, the server efficiency and the initialization success rate are balanced, the server stability is guaranteed, and the device initialization success rate is improved.

[0040] Figure 1 An application scenario diagram of the conflict processing method, device, storage medium and program product according to embodiments of the present application is shown.

[0041] As Figure 1As shown, the application scenario according to this embodiment can include a server 110, the server 110 includes a BMC 1101 and a plurality of devices that can occur conflicts, the plurality of devices can be devices of the same type, for example, are all storage devices, and in this embodiment can include an eMMC 1102, an SD card 1103 and an SPI (Serial Peripheral Interface) 1104. The SPI 1104 is connected to a nonvolatile memory based on the SPI protocol for data transmission. The eMMC 1102, the SD card 1103 and the SPI 1104 are respectively electrically connected with the BMC 1101.

[0042] In the field of server hardware management, the BMC as a core management unit is responsible for key functions such as server hardware state monitoring, fault diagnosis, remote control and life cycle management, and its stable operation depends on reliable storage media to save image files such as BMC firmware, configuration files, and running data such as sensor logs and fault records.

[0043] The reliability of the eMMC 1102, the SD card 1103 and the SPI 1104 is directly related to the availability of the core functions of the BMC 1101 and the intelligent platform management interface, for example, if the eMMC 1102 has a hardware failure such as a flash memory block damage, a controller failure or an interface communication anomaly, it can cause the BMC 1101 firmware to fail to load, the configuration data to be lost or the log record to be interrupted, and remote monitoring, fault alarm and emergency control cannot be achieved.

[0044] It should be noted that the conflict processing method provided by the embodiment of the application can generally be executed by the BMC 1101. Correspondingly, the conflict processing method device provided by the embodiment of the application can generally be arranged in the BMC 1101.

[0045] The following will be based on Figure 1 the described scenario, through Figures 2-4 the conflict processing method of the disclosed embodiment is described in detail.

[0046] Figure 2 A flowchart of the conflict processing method according to the embodiment of the application is shown.

[0047] As Figure 2 shown, the conflict processing method of this embodiment includes operations S210-S240.

[0048] In operation S210, in response to detecting that resource allocation of a plurality of devices of a server exists conflicts, resource adjustment priorities of the plurality of devices are acquired.

[0049] According to an embodiment of the present application, the plurality of devices of the server can include a CPU, a DMA controller, I / O bandwidth, a hardware interface, a flash memory device, etc. The resource allocation conflict can be that when the CPU needs to read memory data at high speed, if the memory is occupied by the DMA controller at the same time, the memory resource allocation is in conflict.

[0050] The priority of each device can be obtained by static presetting, such as a predefined configuration file, hardware fixation, or real-time calculation based on the fault or health status of the device and resource dependency. According to the priority rule obtained by presetting or dynamic calculation, the priority of resource adjustment of each device is determined, and the priority level of the device in resource competition is determined.

[0051] The priority of resource adjustment of each device is taken as a precondition for solving the conflict, so as to determine the priority level of the device in resource competition according to the priority of resource adjustment of each device. The priority of resource adjustment of the device is an important degree index of each device in the server, such as a storage controller, a network card, a peripheral, or a service carried by the device. The resource conflict can cause performance degradation of the device, service interruption, etc. By obtaining the priority of resource adjustment of each device, the core service can be guaranteed, disorderly competition can be avoided, and the resource utilization rate can be improved.

[0052] In operation S220, the resource allocation of the conflicting devices in the plurality of devices is adjusted according to the priority of resource adjustment of the device.

[0053] According to an embodiment of the present application, when the resource allocation is adjusted, the resource can be allocated in the order from high priority to low priority according to the priority level of the device in resource competition, so as to ensure that the key device or service is not affected.

[0054] When the resource allocation is performed for each device, the high-priority device is given priority to obtain the resource, the high-priority device can interrupt the resource occupation of the low-priority device, and when the resource is insufficient, the low-priority device can be limited or degraded, for example, the unnecessary function of the low-priority device is closed, so as to ensure the normal operation of the high-priority device.

[0055] In operation S230, the initialization verification is performed for the plurality of devices by performing multi-level exponential backoff retries on the plurality of devices respectively.

[0056] According to an embodiment of the present application, the multi-level exponential backoff retry is an intelligent retry strategy, which is used to cope with temporary faults in the device initialization verification process, balances the server efficiency and the initialization success rate by dynamically adjusting the retry interval, ensures the stability of the server, and improves the device initialization success rate.

[0057] For example, when multiple devices are initialized at the same time, such as eMMC, SD card, in order to avoid bus conflict, when a device responds to timeout, the application backs off and retries. Taking the SD card as an example, when the first initialization fails, wait for m milliseconds, and then perform the second retry initialization, after the second retry initialization fails, wait for m x 2 1 milliseconds, and then perform the third retry initialization, after the third retry initialization fails, wait for m x 2 2 milliseconds, and then perform the fourth retry initialization, and so on, until the maximum number of retries is reached or timeout.

[0058] In operation S240, the devices that pass the initialization verification are mounted, and the devices that do not pass the initialization verification are disabled.

[0059] According to the embodiment of the application, the devices that pass the initialization verification are mounted, and the devices that do not pass the initialization verification are disabled, which is an important process in server startup or device management, and the purpose is to ensure that only the storage devices in a normal state, such as eMMC, SD card, hard disk, etc., participate in the operation of the server, and at the same time, the faulty devices are isolated to avoid interference.

[0060] Mounting the devices that pass the initialization verification is a process of associating the file system of the storage device to the operating system device tree, so that the operating system can access the data in the device through the directory path. The devices that do not pass the initialization verification are disabled, such as SD cards that cannot be initialized after multiple retries, eMMC with fatal errors, which need to be disabled to prevent interference with the operating system or misoperation.

[0061] According to the embodiment of the application, by obtaining the priority of resource adjustment of each device, the priority level of the device in resource competition is determined, and then the resources are allocated according to the priority, so as to ensure that the key devices or services are not affected, protect the core business, avoid disordered competition, improve the resource utilization rate, in the device initialization verification process, the multi-level exponential backoff retry strategy is applied to deal with temporary faults, the retry interval is dynamically adjusted, the server efficiency and the initialization success rate are balanced, the server stability is ensured, and the device initialization success rate is improved.

[0062] According to the embodiment of the application, the conflict processing method is realized by a finite state machine.

[0063] According to the embodiment of the application, the dynamic device tree adaptive technology is a technology for realizing dynamic adaptation of hardware configuration based on the device tree (Device Tree) in the field of embedded system and computer hardware management, and the core goal is to enable the system to automatically identify and adapt to the new hardware state when the hardware structure changes, such as device hot plug, hardware upgrade, multi-hardware version compatibility, etc., without manual modification of configuration or system restart.

[0064] The dynamic device tree adaptive technology takes a finite state machine as the core, and realizes dynamic and adaptive conflict resolution logic through a closed-loop control of state definition, event triggering and action execution, and dynamically allocates resources and indexes for each device. Among them, the state definition table shown in Table 1, the event and transition condition definition table shown in Table 2, and the action execution definition table shown in Table 3.

[0065] Table 1

[0066]

[0067] As shown in Table 1, state 1 represents an initial state, and conflict detection has not been performed, state 2 represents that multiple devices are detected to exist conflict, for example, multiple device SDHCI controllers occupy the same bus, state 3 represents that the priority of multiple devices is evaluated according to a preset rule or a dynamic priority strategy, and state 4 represents that multiple devices are re-allocated resources according to the priority of multiple devices, for example, clock sources, interrupt routing tables, DMA channels, etc. are re-allocated. State 5 represents verifying whether the conflict is resolved, and state 6 represents triggering a backup solution for the device whose conflict resolution fails, the backup solution including a degradation mode and a hardware reset.

[0068] Table 2

[0069]

[0070] As shown in Table 2, event type 1 represents that hardware scanning is completed, and the initial device tree is loaded, event type 2 represents that resource conflict with other devices is detected when each device driver is detected, for example, the registers of secure digital host controller interface 0 overlap with the registers of secure digital host controller interface 1, event type 3 represents that the devices in conflict share the same clock source, and the frequency of the clock source of the devices in conflict is incompatible, event type 4 represents that conflict resolution verification is successful, and event type 5 represents that conflict resolution verification fails.

[0071] Table 3

[0072]

[0073] As shown in Table 3, action 1 represents disabling a device tree node, for example, by setting status (state) = "disabled (disabled)" to achieve the purpose of disabling. Action 2 represents allocating an independent clock source for a device, action 3 represents updating a device priority table according to the current hardware environment, for example, when the eMMC and the SD card are in a high-temperature state, the priority of the eMMC is higher than that of the SD card, so the eMMC is retained and the SD card is disabled. Action 4 represents triggering a hardware-level reset, for example, triggering a power management integrated circuit reset signal.

[0074] According to an embodiment of the present application, the finite state machine realizes the ordering, predictability and automation of multi-device resource competition by converting the conflict processing logic into deterministic state flow, which significantly improves the reliability of the system.

[0075] Figure 3 A flow chart of a conflict processing method according to another embodiment of the present application is shown.

[0076] The conflict processing method shown in the figure comprises operations S301-S309. Figure 3 The conflict processing method shown in the figure comprises operations S301-S309.

[0077] In operation S301, an initial state.

[0078] In an embodiment of the present application, the initial state is state 1 in Table 1, waiting for a hardware scanning completion event to trigger the conflict detection process. When the hardware scanning completion event occurs and the device tree is loaded, the trigger condition corresponding to event type 1 in Table 2 is met, triggering conflict detection, and operation S302 is performed. This operation corresponds to the initial state of the finite state machine.

[0079] In operation S302, conflict detection.

[0080] According to an embodiment of the present application, the device tree is parsed to identify the allocation conflicts of hardware resources (such as addresses, interrupts, buses, etc.), ensuring the consistency and correctness of the hardware description. For example, typical conflict scenarios can be: SDHCI controller group conflict, clock domain sharing conflict or interrupt number overlap conflict. The device tree is automatically scanned for resource conflicts using a device tree compilation tool or a special verification tool. This operation corresponds to the action execution of the finite state machine.

[0081] In operation S303, whether a conflict is detected.

[0082] In the case where a conflict is detected, the trigger condition corresponding to event type 2 in Table 2 is met, and operation S304 is performed, and in the case where no conflict is detected, operation S306 is performed. This operation corresponds to the event and transition condition of the finite state machine. In the case where a conflict is detected, the state of the finite state machine is transferred from state 1 to state 2.

[0083] In operation S304, priority evaluation.

[0084] According to an embodiment of the present application, when the trigger condition of detecting a device conflict is met, action 3 in Table 3 is performed. This operation corresponds to the action execution of the finite state machine, and the state of the finite state machine is also transferred from state 2 to state 3.

[0085] The dynamic priority strategy can include production test mode special rules, priority adjustment according to temperature / voltage, and preset resource priority adjustment. For example, when multiple devices in conflict are eMMC, an SD card, and SPI, the preset resource priority adjustment can be: eMMC priority > SD card priority > SPI priority.

[0086] According to an embodiment of the present application, obtaining the resource adjustment priorities of the multiple devices includes: determining whether the multiple devices are in a test mode; in response to the multiple devices being in the test mode, assigning each device a preset resource adjustment priority; in response to the multiple devices not being in the test mode, detecting an abnormal device from the multiple devices according to at least one of temperature data and voltage data of each device, in the case of not detecting an abnormal device, assigning each device a preset resource adjustment priority, and in the case of detecting an abnormal device, adjusting the priorities of the multiple devices according to a preset priority adjustment strategy.

[0087] In an embodiment of the present application, whether the multiple devices are in a production test mode is determined. If the operating mode of the multiple devices is the production test mode, the resource adjustment priorities of the multiple devices can be preset for the production test mode. The priority level of each device is determined according to the preset resource adjustment priorities, and the resource request of a device with a high priority level is satisfied in priority in order of high to low priority. The resource allocation information of the multiple devices can also be preset, so that each device directly allocates resources according to the preset resource allocation information.

[0088] In an embodiment of the present application, if the operating mode of the multiple devices is not the production test mode, the preset resource adjustment priorities of the multiple devices are obtained. The preset resource adjustment priorities can be set according to the importance of each of the multiple devices. For example, the multiple devices include device A, device B, device C, and device D, and the preset resource adjustment priorities are: device A priority > device B priority > device C priority > device D priority. Whether the temperature and / or voltage data of each device is abnormal is determined. If there are devices with abnormal temperature and / or voltage data, for example, the abnormal devices are device B and device C, the priority level of device C is first reduced by one level, that is, the priority level of device C is reduced from the original third level to the fourth level, and the device D with the fourth level priority is adjusted to the third level. At this time, the second preset priority adjustment is: device A priority > device B priority > device D priority > device C priority. Then, the priority level of device B is reduced by one level, from the original second level to the third level, and the device D with the third level priority is adjusted to the second level. At this time, the second preset priority adjustment is: device A priority > device D priority > device B priority > device C priority.

[0089] If the devices with abnormal temperature and / or voltage data are device B and device D, since the original priority of device D is the fourth level, the priority of device D remains unchanged, and the priority of device B is lowered by one level from the original second level to the third level. The device C with the third priority is adjusted to the second level. At this time, the second priority is preset as: the priority of device A > the priority of device C > the priority of device B > the priority of device D.

[0090] According to the embodiment of the present application, by adopting the dynamic priority adjustment mechanism, the deep cooperation between resource allocation and device health is realized, the hardware risk is prevented in advance while the stable operation of the core business is ensured, and the reliability, maintainability and life cycle value of the server are greatly improved.

[0091] In operation S305, a resource reallocation operation is performed.

[0092] In the embodiment of the present application, the resource reallocation can include allocating an independent clock source, modifying an interrupt routing table, DMA channel isolation, etc. Taking the detected conflict as an example that the devices in conflict share the same clock source and the frequencies are incompatible, the trigger condition corresponding to the event type 3 in Table 2 is met (corresponding to the event and transition condition of the finite state machine), the action 2 in Table 3 is executed (corresponding to the action execution of the finite state machine), and the state of the finite state machine is transferred from state 3 to state 4, and the clock source is reallocated for the device.

[0093] According to the embodiment of the present application, the devices in conflict include a first device and a second device, the priority of the first device is higher than the priority of the second device, and adjusting the resource allocation of the devices in conflict according to the priority of the devices includes: allocating the resource in conflict between the first device and the second device to the first device, and allocating new available resource to the second device.

[0094] According to the embodiment of the present application, by the priority-based resource conflict processing mechanism, it is ensured that the first device with high priority can stably obtain the required resource, and the core function is prevented from being interrupted due to resource contention; at the same time, new available resource is allocated to the second device, the service interruption of the low-priority device is minimized on the premise of ensuring the reliability of the high-priority device, and the balance between the overall availability and the priority strategy of the system in the resource conflict scenario is realized.

[0095] In operation S306, conflict verification is performed.

[0096] According to the embodiment of the present application, when the trigger condition that the resource reallocation operation is completed is met, the action of conflict verification is performed. The verification means can include: device file existence check, physical layer signal quality analysis and CRC error rate monitoring.

[0097] In the embodiments of the present application, although the dynamic device tree adaptive technology can ensure that each device is correctly allocated resources and indexes, the devices may still fail to be mounted probabilistically when created due to kernel driver loading sequence, hardware initialization delay, power fluctuation, clock loss, etc. Therefore, multi-level exponential backoff retry needs to be applied for verification.

[0098] According to the embodiments of the present application, the initialization verification of the plurality of devices by performing multi-level exponential backoff retry on the plurality of devices respectively comprises: performing multi-level checking on the devices, in response to any one of the devices failing to pass any one of the multi-level checking, retrying the level checking and selecting one allocation strategy from a plurality of pre-stored allocation strategies to re-allocate resources to the plurality of devices; and in response to the number of retries of any one of the multi-level checking reaching a preset value, performing the next level checking.

[0099] In the embodiments of the present application, taking devices A, B, C and D as examples, if multi-level checking is performed on the devices A, B, C and D, when at least one of the devices A, B, C and D fails to pass the current level checking, the devices A, B, C and D are allocated according to the allocation strategy corresponding to the failed current level checking. For example, the failed current level checking is X, the allocation strategy corresponding to X is Y, Y includes a plurality of preset allocation manners Y1, Y2 and Y3, taking the allocation strategy Y as allocating clock sources according to preset allocation rules as an example, the preset allocation manners Y1, Y2 and Y3 correspond to different clock source allocation rules respectively, the clock sources include clock source A, clock source B, clock source C and clock source D, according to the clock source allocation rule of Y1, the device A is allocated the clock source A, the device B is allocated the clock source B, the device C is allocated the clock source C, and the device D is allocated the clock source D. The allocation strategy Y can also be modifying an interrupt routing table according to preset rules. Different levels of checking correspond to different allocation strategies, and each allocation strategy includes a plurality of preset allocation manners. When the current level checking has a device that does not pass, the corresponding allocation strategy is determined according to the current level checking, and the corresponding preset allocation manner is selected in turn according to the preset order of the plurality of preset allocation manners.

[0100] The devices A, B, C and D are checked again according to the distribution strategy corresponding to the failed current level check, for example, the failed check is X, the distribution strategy corresponding to X is Y, the preset distribution mode this time selects the rule distribution of Y2 behind Y1, the device A is distributed with the clock source B, the device B is distributed with the clock source C, the device C is distributed with the clock source A, and the device D is distributed with the clock source D. Then, the current level check is performed again, if the current level check is passed, it is considered that the devices A, B, C and D pass the initialization verification, if the current level check is not passed and the number of times of the current level check does not reach the preset value, the current level check is continuously performed, if the current level check is not passed but the number of times of the current level check reaches the preset value, the next level check is performed.

[0101] According to the embodiments of the application, through the hierarchical verification, intelligent retry and dynamic resource allocation, efficient and reliable device initialization is realized.

[0102] According to the embodiments of the application, the multi-level check includes a basic file existence check, an extended hardware state check and a physical layer deep diagnosis, and the pre-stored multiple distribution strategies are previously used distribution strategies that do not cause resource allocation conflicts, for example, a previously used resource allocation table, in the case of using the resource allocation table to distribute resources to devices, no resource conflict occurs between the devices.

[0103] According to the embodiments of the application, the basic file existence check is a basic verification operation before system initialization, program running or data processing, used to confirm whether key files such as configuration files, dependent libraries, log files and scripts exist in the specified path, and is a prerequisite for guaranteeing normal operation of the system or program.

[0104] In the embodiments of the application, the extended hardware state check is to obtain a physical layer signal quality in real time through a hardware probe interface, for example, to sample a power / clock signal to obtain the physical layer signal, and to compare the physical layer signal with normal data to determine whether a difference between the physical layer signal and the normal data is less than a failure threshold, when the difference between the physical layer signal and the normal data is less than the failure threshold, it is considered that the physical layer signal quality meets the requirement, and when the difference between the physical layer signal and the normal data is greater than or equal to the failure threshold, it is considered that the physical layer signal quality does not meet the requirement.

[0105] According to the embodiment of the present application, taking the eye diagram scanning and impedance matching test in the physical layer depth diagnosis as an example, the eye diagram scanning needs to convert the digital signal into an analog signal, cut the continuous signal into multiple unit intervals (UI) and superimpose, and finally calculate the eye height / eye width; and the impedance matching can calculate the fault point distance according to the reflection wave delay time, and inversely deduce the load impedance through the reflection coefficient formula.

[0106] The multi-level exponential backoff retry of the embodiment of the present application is described below with reference to Table 4.

[0107] Table 4

[0108]

[0109] According to the embodiment of the present application, as shown in Table 4, when multiple devices are subjected to multi-level checking, the retry level is 1 in the first time, the 1-level retry level checking is the basic file existence checking, if there is no mounting exception, it is directly considered that the mounting is successful, if there is a mounting exception, that is, the checking result is not passed, the hardware reset signal of the device is immediately triggered, and after the hardware reset, the preset allocation rule with the first ranking in the preset allocation strategy corresponding to the basic file existence checking is applied to the resource reallocation of the multiple devices, the second basic file existence checking is performed at the time interval of 0.1 seconds from the first time, if there is no mounting exception, it is directly considered that the mounting is successful, if there is a mounting exception, that is, the checking result is not passed, the hardware reset signal is immediately triggered, and after the hardware reset, the preset allocation rule with the second ranking in the preset allocation strategy corresponding to the basic file existence checking is applied to the resource reallocation of the multiple devices, the third basic file existence checking is performed at the time interval of 0.1 seconds from the second time, if there is no mounting exception, it is directly considered that the mounting is successful, if there is a mounting exception, that is, the checking result is not passed, the hardware reset signal is immediately triggered, and after the hardware reset, the preset allocation rule with the third ranking in the preset allocation strategy corresponding to the basic file existence checking is applied to the resource reallocation of the multiple devices, and the first 2-level extended hardware state checking is performed at the time interval of 0.2 seconds from the third time.

[0110] If no mounting exception occurs in the first extension hardware state check, it is considered that the mounting is successful directly, if a mounting exception occurs, that is, the check result is not passed, the standby clock source is switched immediately, and after the standby clock source is switched, the preset allocation rule with the first ranking in the preset allocation strategy corresponding to the extension hardware state check is applied to perform resource reallocation on the multiple devices, the second extension hardware state check is performed at a time interval of 0.2 seconds from the first extension hardware state check, if no mounting exception occurs, it is considered that the mounting is successful directly, if a mounting exception occurs, that is, the check result is not passed, the standby clock source is switched immediately, and after the standby clock source is switched, the preset allocation rule with the second ranking in the preset allocation strategy corresponding to the extension hardware state check is applied to perform resource reallocation on the multiple devices, and the first level-3 physical layer deep diagnosis is performed at a time interval of 0.4 seconds from the second extension hardware state check.

[0111] If no mounting exception occurs in the first level-3 physical layer deep diagnosis, it is considered that the mounting is successful directly, if a mounting exception occurs, that is, the check result is not passed, the devices with different check results are downgraded to a read-only mode and an alarm is reported.

[0112] According to the embodiments of the present application, the abnormal scene detection is performed on each device from the application layer, the hardware layer and the software layer, and the comprehensiveness of the multiple device abnormal detection is improved.

[0113] In operation S307, it is verified whether the conflict is solved.

[0114] According to the embodiments of the present application, when the trigger condition that the conflict verification operation is completed is met, the state of the finite state machine is transferred from state 4 to state 5. In the case that the conflict is solved successfully, the trigger condition corresponding to event type 4 in table 2 is met, operation S309 (corresponding to the action execution of the finite state machine) is performed, in the case that the conflict is not solved successfully, the trigger condition corresponding to event type 5 in table 2 is met, the state of the finite state machine is transferred from state 5 to state 6, and operation S308 (corresponding to the action execution of the finite state machine) is performed.

[0115] In operation S308, the standby scheme is triggered.

[0116] According to the embodiments of the present application, the standby scheme includes a downgrade mode and a hardware reset. For example, the hardware reset is performed on the device in conflict, or the hardware reset is performed on the multiple devices. For another example, the device in conflict can be disabled.

[0117] In operation S309, the hardware reset is completed, and the allocated device tree is loaded.

[0118] According to an embodiment of the present application, the plurality of devices are storage devices, and the conflict processing method further comprises: after mounting, performing bad block detection on the mounted device; determining a bad block level of the device based on a bad block density in the device; and performing bad block repair according to the bad block level of the device.

[0119] In an embodiment of the present application, since the hard disk has a high requirement for data stability, the hard disk itself has a power-off data saving mechanism, and a large area of bad block scene basically does not occur. However, the eMMC does not have such a mechanism, and when the eMMC is used in a scene with certain data requirements and easy power-off, the fsck tool cannot repair the problem directly. According to an embodiment of the present application, the bad block detection and repair process can be performed after mounting. The following will be described with reference to Figure 4 The details will be described.

[0120] Figure 4 A flowchart of a bad block repair method according to an embodiment of the present application is shown.

[0121] As Figure 4 The bad block repair method includes operations S410-S460.

[0122] In operation S410, bad block detection is started.

[0123] According to an embodiment of the present application, the bad block detection is a process of identifying, locating and marking a physical or logical damaged area (i.e. bad block) in a storage device (such as a hard disk, a USB flash disk, an SD card, a solid state disk, an eMMC, etc.). The bad block detection is to find a block in the storage medium that cannot normally read and write data, data is easy to lose or read and write error, to provide a basis for subsequent repair, shielding or data migration, to ensure the stable operation of the storage device and data security. Taking the bad block as an example of a logical damaged area, the operating system can be used to scan the file system structure to detect logical bad blocks caused by index errors, cross-linking, etc.

[0124] In operation S420, the bad block density is evaluated.

[0125] According to an embodiment of the present application, the bad block detection tool can comprehensively scan the bad blocks of the storage device, such as NAND flash memory and hard disk, and the hierarchical optimization algorithm can divide the bad blocks into different levels according to the bad block density, such as the number of bad blocks in a unit storage area, such as low-density sporadic bad blocks, medium-density aggregated bad blocks, and high-density failure areas, to realize fine management of bad blocks, and adopt differentiated repair strategies for bad blocks of different levels, which can efficiently repair local bad blocks that can be restored, and avoid invalid repair attempts on severely damaged areas, greatly improving the repair efficiency.

[0126] According to an embodiment of the present application, determining the bad block level of the device based on the density of bad blocks in the device comprises: setting the bad block level of the device to a first level if the density of bad blocks of the device is less than a first threshold; setting the bad block level of the device to a second level if the density of bad blocks of the device is between the first threshold and a second threshold; and setting the bad block level of the device to a third level if the density of bad blocks of the device is greater than the second threshold, wherein the first threshold is less than the second threshold, and the second threshold is less than the third threshold.

[0127] In an embodiment of the present application, taking a storage device with a total capacity of 1 TB as an example, the first threshold is set to 0.1%, i.e., there are less than or equal to 1 bad physical block in 1000 physical blocks, the second threshold is set to 1%, i.e., there are less than or equal to 10 bad physical blocks in 1000 physical blocks, and the first threshold is set to 5%, i.e., there are less than or equal to 50 bad physical blocks in 1000 physical blocks.

[0128] According to an embodiment of the present application, the bad block level of the device can be divided into a first level, a second level and a third level. For example, if the device has less than 3 scattered bad blocks in a unit storage area, it is considered to contain small bad blocks, and the bad block level of the device is determined to be the first level; if the device has more than or equal to 3 and less than or equal to 10 continuous bad blocks in a unit storage area, it is considered to contain medium bad blocks, and the bad block level of the device is determined to be the second level; and if the device has more than 10 continuous bad blocks in a unit storage area, it is considered to contain large bad blocks, and the bad block level of the device is determined to be the third level.

[0129] According to an embodiment of the present application, by determining the level of bad blocks in the device based on the density of bad blocks in the device, potential failures can be predicted in time when the level of bad blocks in the device is low, and sudden data loss can be avoided.

[0130] Next, bad block repair can be performed according to the bad block level of the device. According to an embodiment of the present application, performing bad block repair according to the bad block level of the device comprises operations S430-S450.

[0131] In the case where the bad block level of the device is the first level, operation S430 is performed; in the case where the bad block level of the device is the second level, operation S440 is performed; and in the case where the bad block level of the device is the third level, operation S450 is performed.

[0132] At operation S430, the device is repaired by using a file system check tool, and in case of failure, the bad block level of the device is modified from the first level to the second level, and the method proceeds to operation S440. At operation S440, the device is repaired by activating a preset bad block mapping table, and in case of failure, the bad block level of the device is modified from the second level to the third level, and the method proceeds to operation S450. At operation S450, the device is set to a read-only mode, and a hardware failure alarm of the device is generated.

[0133] The operations S430, S440 and S450 will be described below with reference to Figure 4 , respectively.

[0134] According to an embodiment of the present application, the operation S430 can include operations S431-S435.

[0135] At operation S431, an fsck automatic repair mode is adopted.

[0136] According to an embodiment of the present application, the fsck automatic repair mode skips the inquiry step by setting a preset parameter, and directly repairs all errors that can be automatically processed according to a preset logic. For example, the preset parameter is set as -a or -y, wherein -a (automatic repair) means to automatically repair all safe and repairable errors, and the safety can be understood as the repair without the risk of data loss; -y (assume yes) means to automatically answer yes to all repair prompts, including the operation of possibly deleting a damaged file.

[0137] At operation S432, a log check is skipped.

[0138] According to an embodiment of the present application, the log is a file recording the operation process of a system or an application, and is used for tracking events, recovering data or auditing. The log check is to ensure that the log content is not tampered or damaged by checking the integrity of the log file, such as the continuity of the timestamp, the data block checksum, the transaction consistency, etc. The skip of the log check means to bypass the step of checking and verifying the integrity of the log file.

[0139] At operation S433, a Superblock / Inode table is preferentially recovered.

[0140] According to the embodiment of the present application, the Superblock is used to store global information of the file system, including file system type, size, block number, free block location, total number of index nodes, etc.; the Inode table is used to store metadata of files and directories, such as permission, owner, timestamp, data block location, and each file corresponds to a unique index node. Since file system operations, such as reading a file, first rely on the Superblock to locate the Inode table, and then find the data block through the Inode table, the Superblock / Inode table needs to be restored in priority.

[0141] In operation S434, it is judged whether the repair is successful.

[0142] According to the embodiment of the present application, the repair validity is dynamically determined according to the fsck return value, if the bad block repair is successful, operation S435 is executed, if the repair is not successful, the bad block level of the device is modified from the first level to the second level, and operation S440 is executed.

[0143] In operation S435, the normal mode is returned.

[0144] According to the embodiment of the present application, operation S440 can include operations S441-S446.

[0145] In operation S441, the bad block mapping table is activated.

[0146] According to the embodiment of the present application, activating the bad block mapping table is a mechanism for managing physical defects of the disk. When a bad sector of the disk appears, such as a physical location that cannot reliably store data, the system will mark the bad block as unusable through the activated bad block mapping table, and redirect the data to the backup area, thereby guaranteeing data integrity and system stability.

[0147] In operation S442, the damaged area is dynamically shielded.

[0148] According to the embodiment of the present application, dynamically shielding the damaged area is a mechanism for real-time, automatic detection and isolation of physically damaged areas in a storage system (such as a hard disk, an SD, a USB, etc.) or a file system; the system can actively find new damaged areas during normal use, and immediately shield them and mark them as unusable without human intervention.

[0149] In operation S443, data is recovered from the redundant backup partition.

[0150] According to the embodiment of the present application, a copy of the data is saved in advance in a separate partition, when the main partition data has a problem, the copy is called from the backup partition for recovery, so as to guarantee the integrity and availability of the data.

[0151] In operation S444, it is judged whether the recovery verification passes.

[0152] According to the embodiment of the present application, the validity of the repair is dynamically determined according to the fsck return value, so as to avoid false triggering of Kernel Panic. If the recovery verification is passed, operation S445 is performed, and if the recovery verification is not passed, the bad block level of the device is modified from the second level to the third level, and operation S450 is performed.

[0153] In operation S445, the bad block mapping table is updated.

[0154] According to the embodiment of the present application, the position information of the bad blocks is recorded in the bad block mapping table inside the device, and is marked as unavailable, so as to realize the updating of the bad block mapping table.

[0155] In operation S446, the writable mode is maintained.

[0156] According to the embodiment of the present application, the user or the system can perform the write operation on the device, such as saving new files, editing old files, deleting contents, etc.

[0157] According to the embodiment of the present application, operation S450 can include operations S451-S454.

[0158] In operation S451, the emergency read-only mode is triggered.

[0159] According to the embodiment of the present application, the file system or the related data storage area is set to the read-only state.

[0160] In operation S452, the file system write operation is frozen.

[0161] According to the embodiment of the present application, all write operations on the file system are temporarily suspended, such as creating, modifying, deleting files or directories, and only read operations are allowed, so as to ensure the consistency and integrity of the file system data, and avoid data damage or state confusion caused by write behavior in the operation process.

[0162] In operation S453, a hardware failure alarm is sent.

[0163] In operation S454, manual intervention is waited for.

[0164] In operation S460, a repair report is generated.

[0165] According to the embodiment of the present application, after the repair process of the bad blocks of the device is completed, the key information of the whole process (such as failure phenomenon, troubleshooting steps, repair method, result verification, etc.) is sorted into a structured document.

[0166] According to an embodiment of the present application, the bad block level based hierarchical repair strategy realizes maximization of storage device reliability and availability through a gradually enhanced repair means and a dynamic upgrade failure response mechanism.

[0167] In some embodiments, after mounting, fault detection and processing can also be performed, which will be described below with reference to Figure 5 This will be described in detail.

[0168] Figure 5 A flowchart of a hot switching method according to an embodiment of the present application is shown.

[0169] As Figure 5 shown, the fault detection and processing includes operations S501-S505.

[0170] In operation S501, fault determination. When fault determination is performed, if the kernel module detects an unrecoverable error, a preset signal can be sent to the background service program.

[0171] As an example, a first error code can be read from a secure digital host controller interface controller of the device, and it is determined whether the device has a hardware fault according to the first error code.

[0172] In an embodiment of the present application, to avoid server paralysis, when the eMMC hardware has been damaged, the software layer should detect the exception as soon as possible and can perform certain exception handling repair to avoid problem expansion. The application kernel state depth intercepts directly monitor the ADMA error code of the block device driver layer. For example, the application SDHCI_HOST_CONTROL_ERR interrupt status register indicates various error states that occur during SD card operation. When the SDHCI detects a specific error condition, it will set the corresponding bit in the register to notify the system that an error has occurred.

[0173] According to an embodiment of the present application, by directly monitoring the ADMA error code of the device driver layer, μs (microsecond) level exception detection is realized, and the hardware fault can be correctly identified through the ADMA error code.

[0174] In some embodiments, after it is determined that the device has a hardware fault, a second error code and a third error code can be further read from the secure digital host controller interface controller of the device, and it is further determined whether the hardware fault of the device is a transient error or a permanent error according to the second error code and the third error code.

[0175] In an embodiment of the present application, different error codes of ADMA are used to distinguish between transient errors, such as CRC check failure, and permanent errors, such as NAND bad block over threshold, and a dynamic adjustment retry strategy is used.

[0176] In the case that the device has a hardware fault, when the advanced direct memory access error code represents an advanced direct memory access engine error, a hardware fault signal is generated. In the case that the device has a hardware fault, when the advanced direct memory access error code represents a cyclic redundancy check error, the number of times of occurrence of the cyclic redundancy check error is counted, and when the counting result is greater than a preset threshold, a hardware fault signal is generated.

[0177] According to the embodiment of the present application, by directly reading the second and third error codes of the SDHCI controller, the transient error and the permanent error of the device hardware can be accurately distinguished, and the over-repair or fault detection caused by misjudgment is avoided; at the same time, the hardware-level error code is relied on to realize the rapid identification of the fault type, and accurate basis is provided for the subsequent dynamic adjustment of the retry strategy or the triggering of the fault transfer, so that the response accuracy and efficiency of the system to the storage fault are greatly improved.

[0178] After it is determined in operation S501 that the device has a hardware fault, the device can be hot switched to a backup device. For example, on the basis of correctly obtaining the hardware fault, a hybrid storage architecture of a non-Flash memory (NOR Flash Memory, NOR Flash) and an eMMC can be designed, a simplified system is preloaded in the NOR Flash, and second-level switching is supported in the case of a fault. Through a user space device manager rule and a system and service manager unit, when an eMMC fault is detected, the root file system mounting point is automatically switched to a NOR Flash backup partition. Unmounting a file system of a device means disassociating a specified device, such as an eMMC or an SD card, from a mounting point. The following will continue to refer to Figure 5 This will be described in detail.

[0179] According to the embodiment of the present application, hot switching the device to a backup device can include operations S502 to S505.

[0180] In operation S502, service freezing is performed. When service freezing is performed, non-core services of the device are stopped, and a file system of the device is unmounted. Specifically, through an inter-process communication mechanism, a system and service manager that is responsible for controlling the life cycle of all background services is notified, non-core services, such as a Web User Interface (Web UI), are stopped, and an eMMC file system is unmounted.

[0181] In operation S503, mounting switching is performed. When mounting switching is performed, the root file system is switched from the device to the backup device.

[0182] In operation S504, network reconfiguration is performed. When network reconfiguration is performed, a baseboard management controller dedicated network card address of the device is reconfigured.

[0183] In operation S505, the state is synchronized. In the state synchronization, in response to a change in the configuration file of the standby device, the changed configuration file is synchronized to a random access memory disk.

[0184] According to the embodiment of the application, by giving priority to guaranteeing the running of core functions, for example, stopping non-core services, and unloading a faulty file system, fast switching of a root file system to a standby device is realized, while the BMC management channel is repaired and configuration changes are synchronized to a RAM disk, which not only ensures the basic availability of the system in the event of a failure, but also maintains functional continuity through configuration synchronization, greatly improving the fault tolerance capability and failure recovery efficiency of the system.

[0185] According to the embodiment of the application, the conflict processing method is executed by a baseboard management controller of the server.

[0186] According to the embodiment of the application, in the server emergency mode, the operation of resource management and control strictly limits resource allocation, only core services of the BMC are kept running, such as IPMI remote management and Simple Network Management Protocol (SNMP) monitoring, and resource occupation of other unnecessary processes, such as CPU, memory, I / O, etc., is forcibly terminated or limited, thereby releasing system resources and ensuring the stable running of the BMC and the reliability of management functions in the emergency scenario, such as stable running of the BMC in the event of a main system failure, and realizing service hierarchical isolation.

[0187] By setting the suspected faulty NOR Flash as read-only to prevent further damage, and temporarily accepting runtime data writing requirements by using a RAM disk, time is gained for subsequent repair or replacement of the storage device on the premise of ensuring that the system does not go down, and read-only mode degradation is realized.

[0188] Service hierarchical isolation and read-only mode degradation are stable strengthening operations after hot switching, making the dual storage more stable, and can be increased according to actual use requirements.

[0189] Based on the above conflict processing method, the application also provides a conflict processing device. The following will be described in detail Figure 6 The device is described in detail.

[0190] Figure 6 A structural block diagram of the conflict processing device according to the embodiment of the application is shown.

[0191] As Figure 6 shown, the conflict processing device 600 of this embodiment includes a priority acquisition module 610, a resource allocation adjustment module 620, an initialization verification module 630, and an execution corresponding operation module 640.

[0192] The priority obtaining module 610 is configured to obtain the resource adjustment priorities of the plurality of devices in response to detecting that there is a conflict in resource allocation of the plurality of devices of the server. In an embodiment, the priority obtaining module 610 can be configured to perform operation S210 described above, and thus repeated details are not provided herein.

[0193] The resource allocation adjustment module 620 is configured to adjust the resource allocation of the conflicting devices in the plurality of devices according to the resource adjustment priorities of the devices. In an embodiment, the resource allocation adjustment module 620 can be configured to perform operation S220 described above, and thus repeated details are not provided herein.

[0194] The initialization verification module 630 is configured to perform initialization verification on the plurality of devices by performing multi-level exponential backoff retries on the plurality of devices respectively. In an embodiment, the initialization verification module 630 can be configured to perform operation S230 described above, and thus repeated details are not provided herein.

[0195] The corresponding operation performing module 640 is configured to mount the devices that pass the initialization verification and disable the devices that fail the initialization verification. In an embodiment, the corresponding operation performing module 640 can be configured to perform operation S240 described above, and thus repeated details are not provided herein.

[0196] According to embodiments of the present application, any one or more of the priority obtaining module 610, the resource allocation adjustment module 620, the initialization verification module 630, and the corresponding operation performing module 640 can be combined in one module, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of the modules can be combined with at least part of the functions of the other modules, and implemented in one module. According to embodiments of the present application, at least one of the priority obtaining module 610, the resource allocation adjustment module 620, the initialization verification module 630, and the corresponding operation performing module 640 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on chip, a system on board, a system on package, an application specific integrated circuit (ASIC), or any other reasonable manner of integrating or packaging a circuit, etc. in hardware or firmware, or implemented in any one of software, hardware, and firmware or in a proper combination of any one or more of them. Alternatively, at least one of the priority obtaining module 610, the resource allocation adjustment module 620, the initialization verification module 630, and the corresponding operation performing module 640 can be at least partially implemented as a computer program module that can perform corresponding functions when the computer program module is run.

[0197] Figure 7 A block diagram of an electronic device suitable for implementing the conflict processing method according to embodiments of the present application is shown.

[0198] like Figure 7 As shown, an electronic device 700 according to an embodiment of the present invention includes a processor 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage portion 708 into a random access memory (RAM) 703. The processor 701 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 701 may also include onboard memory for caching purposes. The processor 701 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present invention.

[0199] RAM 703 stores various programs and data required for the operation of electronic device 700. Processor 701, ROM 702, and RAM 703 are interconnected via bus 704. Processor 701 executes various operations of the method flow according to embodiments of the present invention by executing programs in ROM 702 and / or RAM 703. It should be noted that the programs may also be stored in one or more memories other than ROM 702 and RAM 703. Processor 701 may also execute various operations of the method flow according to embodiments of the present invention by executing programs stored in said one or more memories.

[0200] According to an embodiment of the present invention, the electronic device 700 may further include an input / output (I / O) interface 705, which is also connected to a bus 704. The electronic device 700 may also include one or more of the following components connected to the input / output (I / O) interface 705: an input section 706 including a keyboard, mouse, etc.; an output section 707 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the input / output (I / O) interface 705 as needed. A removable medium 711, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 710 as needed so that computer programs read from it can be installed into the storage section 708 as needed.

[0201] The application further provides a computer readable storage medium, which can be included in the device / apparatus / system described in the above embodiments, or can exist independently without being assembled into the device / apparatus / system. The computer readable storage medium carries one or more programs, which, when executed, implement the method according to the embodiments of the application.

[0202] According to the embodiments of the application, the computer readable storage medium can be a non-volatile computer readable storage medium, which can include, but is not limited to, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any appropriate combination thereof. In the application, the computer readable storage medium can be any tangible medium that contains or stores a program, which can be used by or in connection with an instruction execution system, apparatus, or device. For example, according to the embodiments of the application, the computer readable storage medium can include the ROM 702 and / or the RAM 703 described above, and / or one or more memories other than the ROM 702 and the RAM 703.

[0203] The embodiments of the application also include a computer program product, which includes a computer program containing program codes for executing the methods shown in the flowcharts. When the computer program product is run in a computer system, the program codes are used to make the computer system implement the methods provided by the embodiments of the application.

[0204] The above functions defined in the system / apparatus of the embodiments of the application are performed when the computer program is executed by the processor 701. According to the embodiments of the application, the system, apparatus, module, unit, etc. described above can be implemented by computer program modules.

[0205] In one embodiment, the computer program can rely on a tangible storage medium such as an optical storage device, a magnetic storage device, etc. In another embodiment, the computer program can also be transmitted, distributed, and downloaded in the form of a signal on a network medium, and be downloaded and installed through the communication part 709, and / or installed from the detachable medium 711. The program codes contained in the computer program can be transmitted by any appropriate network medium, including but not limited to wireless, wired, etc., or any appropriate combination thereof.

[0206] In such embodiments, the computer program can be downloaded and installed from the network via the communication section 709, and / or installed from the removable media 711. When the computer program is executed by the processor 701, the above-described functions defined in the system of the embodiments of the present application are executed. The system, device, apparatus, module, unit, etc. described above can be realized by the computer program modules according to the embodiments of the present application.

[0207] According to the embodiments of the present application, the program code for executing the computer program provided by the embodiments of the present application can be written in any combination of one or more programming languages, and specifically, these computer programs can be implemented using high-level procedural and / or object-oriented programming language, and / or assembly / machine language. The programming language includes, but is not limited to, such as Java, C++, python, "C" language or similar programming language. The program code can be executed entirely on the user computing device, partially on the user device, partially on a remote computing device, or entirely on a remote computing device or server. In the case involving a remote computing device, the remote computing device can be connected to the user computing device through any kind of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, connected to the Internet through an Internet service provider).

[0208] The flowcharts and block diagrams in the drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present application. In this regard, each block in the flowcharts or block diagrams can represent a module, a program segment, or a portion of code that contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions noted in the blocks can occur in a different order than that shown in the figures. For example, two blocks noted in succession can actually be executed substantially concurrently or in the opposite order, depending on the functionality involved. It should also be noted that each block in the flowcharts or block diagrams, and combinations of blocks in the flowcharts or block diagrams, can be implemented by dedicated hardware-based systems that perform the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.

[0209] Those skilled in the art can understand that the features described in various embodiments of the present application can be combined and / or integrated in various combinations, even if such combinations are not explicitly described in the present application. In particular, the features described in various embodiments of the present application can be combined and / or integrated in various combinations without departing from the spirit and teachings of the present application. All such combinations and / or integrations are within the scope of the present application.

[0210] The embodiments of the application have been described. However, these embodiments are merely for illustration and are not intended to limit the scope of the application. Although each embodiment is described above separately, this does not mean that the measures in each embodiment cannot be used advantageously in combination. Various alternatives and modifications to the embodiments described herein will be apparent to those skilled in the art in view of the foregoing without departing from the scope of the application.

Claims

1. A conflict handling method, characterized by, The conflict processing method comprises: In response to detecting that resource allocation of a plurality of devices of a server is in conflict, obtaining resource adjustment priorities of the plurality of devices; Adjusting resource allocation of devices in conflict among the plurality of devices according to resource adjustment priorities of the devices; Initializing the plurality of devices by performing multi-level exponential backoff retries on the plurality of devices respectively; Mounting devices that pass the initialization verification and disabling devices that do not pass the initialization verification; The devices in conflict comprise a first device and a second device, the priority of the first device is higher than the priority of the second device, and the adjusting resource allocation of the devices in conflict according to resource adjustment priorities of the devices comprises: allocating a resource in conflict between the first device and the second device to the first device and allocating a new available resource to the second device; when allocating resources to the devices, high-priority devices are given priority to obtain resources, and high-priority devices can interrupt resource occupation of low-priority devices; The initializing the plurality of devices by performing multi-level exponential backoff retries on the plurality of devices respectively comprises: performing multi-level checks on each device, in response to a device not passing any one of the multi-level checks, retrying the level check, and selecting one of a plurality of allocation strategies pre-stored from the plurality of allocation strategies to re-allocate resources to the plurality of devices; in response to the number of retries of any one of the multi-level checks reaching a preset value, performing the next level check; the plurality of allocation strategies pre-stored are allocation strategies used previously that do not cause resource allocation conflicts; In the case where the plurality of devices are storage devices, after mounting, performing bad block detection on the mounted devices; determining a bad block level of a device based on a bad block density in the device; and performing bad block repair according to the bad block level of the device; Determining a bad block level of a device based on a bad block density in the device comprises: in the case where the bad block density of the device is less than a first threshold value, setting the bad block level of the device to a first level; in the case where the bad block density of the device is between the first threshold value and a second threshold value, setting the bad block level of the device to a second level; and in the case where the bad block density of the device is greater than the second threshold value, setting the bad block level of the device to a third level; wherein the first threshold value is less than the second threshold value, and the second threshold value is less than the third threshold value; Performing bad block repair according to the bad block level of the device comprises: In the case where the bad block level of the device is the first level, using a preset logic to repair repairable errors that do not involve data loss risk and errors for which a repair prompt is automatically replied, in the case where there are superblocks or inode tables to be repaired in the errors, preferentially repairing the superblocks or inode tables, and in the case where the repair fails, modifying the bad block level of the device from the first level to the second level. In a case where the bad block level of the device is the second level, activating a bad block mapping table, dynamically shielding a damaged area in the device, and repairing based on data saved in advance by a redundant backup partition, and in a case where the repair is successful, updating the bad block mapping table, and in a case where the repair fails, modifying the bad block level of the device from the second level to the third level; In a case where the bad block level of the device is the third level, triggering an emergency read-only mode, setting a storage area of a file system of the device to a read-only state, freezing a write operation on the file system, and sending a hardware failure alarm, and in a case where the bad block is repaired, generating a repair report.

2. The conflict processing method of claim 1, wherein, The multi-level check includes a basic file existence check, an extended hardware state check, and a physical layer deep diagnosis.

3. The conflict processing method of claim 1, wherein, The conflict processing method further includes: reading a first error code from a secure digital host controller interface controller of the device, and determining whether the device has a hardware failure according to the first error code; In a case where the device has a hardware failure, hot switching the device to a backup device.

4. The conflict processing method of claim 3, wherein, The conflict processing method further includes: In a case where the device has a hardware failure, reading a second error code and a third error code from a secure digital host controller interface controller of the device, and determining whether the hardware failure of the device is a transient error or a permanent error according to the second error code and the third error code.

5. The conflict processing method of claim 3, wherein, Hot switching the device to the backup device includes: stopping a non-core service of the device, and unloading a file system of the device; switching a root file system from the device to the backup device; reconfiguring a baseboard management controller dedicated network card address of the device; In response to a configuration file of the backup device being changed, synchronizing the changed configuration file to a random access memory disk.

6. The conflict processing method of claim 1, wherein, Obtaining the resource adjustment priority of the plurality of devices includes: determining whether the plurality of devices are in a test mode; In response to the plurality of devices being in the test mode, assigning a preset resource adjustment priority to each device; In response to the plurality of devices not being in the test mode, detecting an abnormal device from the plurality of devices according to at least one of temperature data and voltage data of each device, in a case where no abnormal device is detected, assigning a preset resource adjustment priority to each device, and in a case where an abnormal device is detected, adjusting the priority of the plurality of devices according to a preset priority adjustment strategy.

7. The conflict processing method of claim 1, wherein, The conflict processing method is implemented by a finite state machine.

8. The conflict processing method of claim 1, wherein, The conflict processing method is executed by a baseboard management controller of a server.

9. An electronic device, comprising: The electronic device includes: one or more processors; a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the processing method according to any one of claims 1-8.

10. A computer readable storage medium having stored thereon a computer program or instructions, characterized in that, The computer program or instructions, when executed by a processor, implement the steps of the processing method according to any one of claims 1-8.

11. A computer program product, characterised in that, The computer program, when executed by a processor, implements the steps of the processing method according to any one of claims 1-8.

Citation Information

Patent Citations

  • GPGPU register cache management system

    CN116820773A

  • Resource management method and device, storage medium and program product

    CN120085939A

  • Hardware detection process exception handling method and device and electronic equipment

    CN120492200A