A device resource management method and system, an electronic device, and a storage medium

By separating resource management, control, and business processing into three planes in chip SDK development, the problem of hardware resources not being able to be reclaimed in a timely manner is solved, and efficient and stable business processing is achieved.

CN114443286BActive Publication Date: 2026-01-27SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111645949.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-29
Publication Date
2026-01-27
Estimated Expiration
2041-12-29

AI Technical Summary

Technical Problem

In existing technologies, hardware resource management and business processing are mixed during chip SDK development, which leads to the inability to reclaim resources in a timely manner, resulting in performance degradation and system instability.

Method used

It adopts an architecture that separates the management plane, control plane, and business plane, respectively handling resource management, control, and business processing. The main resource management process automatically reclaims resources when the business process ends or encounters an error.

Benefits of technology

This decouples resource management from business processing, avoids the impact of business process status on system management, and improves system stability and performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114443286B_ABST
    Figure CN114443286B_ABST
Patent Text Reader

Abstract

The application discloses a device resource management method applied to a resource management platform, the resource management platform comprising a management plane, a business plane and a control plane, the management plane being used for resource allocation and resource recovery of a business process, the business plane being used for creating the business process, and the control plane being used for monitoring the state of the business process, the device resource management method comprising the following steps: after a target business process is created in the business plane, device resources are allocated to the target business process by using a resource management main process of the management plane; it is judged whether a business management process of the management plane receives a resource recovery prompt; if yes, the device resources allocated to the target business process are recovered by using the resource management main process of the management plane. The application can reasonably allocate device resources and avoid the influence of the state of the business process on system management. The application also discloses a device resource management system, a storage medium and an electronic device, which have the above beneficial effects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of chip development technology, and in particular to a device resource management method, system, electronic device, and storage medium. Background Technology

[0002] With the development of technology and industry, user scenarios have increasingly higher performance requirements. As a result, a large part of chip SDK development has moved from kernel-level driver development to user-level development. Now, many chip devices also provide supporting user-level libraries, or even overall solutions for certain scenarios, in order to enable customers to launch customized products faster and better.

[0003] In related technologies, hardware resource management and business processing are mixed together. When business is abnormal, the hardware circular queue resources and host big page memory occupied by the business may not be effectively released. If the business continues, the performance will eventually degrade because the hardware and software resources cannot be reclaimed and released in time, or even the business will not be able to work normally due to the inability to obtain resources.

[0004] Therefore, how to rationally allocate equipment resources and avoid the impact of business process status on system management is a technical problem that needs to be solved by those skilled in the art. Summary of the Invention

[0005] The purpose of this application is to provide a device resource management method, system, electronic device, and storage medium that can reasonably allocate device resources and avoid the impact of business process status on system management.

[0006] To address the aforementioned technical problems, this application provides a device resource management method applied to a resource management platform. The resource management platform includes a management plane, a business plane, and a control plane. The management plane is used for resource allocation and reclamation of business processes. The business plane is used for creating business processes. The control plane is used for monitoring the status of business processes. The device resource management method includes:

[0007] After the target business process is created in the business plane, the resource management master process of the management plane allocates device resources to the target business process; wherein, the device resources include host resources and chip resources;

[0008] Determine whether the business management process of the management plane has received a resource reclamation prompt; wherein, the resource reclamation prompt includes information returned by the business plane after the target business process has finished executing, or information returned by the management plane after detecting an abnormality in the state of the target business process and killing the target business process;

[0009] If so, the resource management master process of the management plane will be used to reclaim the device resources allocated to the target business process.

[0010] Optionally, the resource management master process of the management plane allocates device resources to the target business process, including:

[0011] Determine whether the resource management master process has been created in the management plane;

[0012] If so, the resource management master process of the management plane will be used to allocate device resources to the target business process;

[0013] If not, then create the resource management master process and use the resource management master process of the management plane to allocate device resources to the target business process.

[0014] Optionally, before allocating device resources to the target business process using the resource management master process of the management plane, the method further includes:

[0015] Control the management plane to perform initialization operations;

[0016] The initialization operations performed by the management plane include: determining whether the firmware heartbeat has timed out; if not, reading the SDK configuration file and configuring the host large page memory resources, chip circular queue and register resources, and chip firmware resources using the SDK configuration file.

[0017] Optionally, before allocating device resources to the target business process using the resource management master process of the management plane, the method further includes:

[0018] Control the control plane to perform initialization operations;

[0019] The initialization operations performed by the control plane include: starting the background monitoring service process, starting the chip device and loading the firmware, verifying the versions of the SDK, firmware and hardware after firmware initialization, and starting the business process status detection task, chip firmware heartbeat detection task, chip device anomaly detection task and chip device debugging and tracking task after successful verification.

[0020] Optionally, after allocating device resources to the target service process using the resource management master process of the management plane, the method further includes:

[0021] Obtain the ID of the target business process, and use the business management process to block the ID of the target business process through the waitpid() mechanism in order to receive the resource reclamation prompt.

[0022] Optionally, after allocating device resources to the target service process using the resource management master process of the management plane, the method further includes:

[0023] The device resources allocated to the target service process are locked using a locking mechanism.

[0024] Optionally, after allocating SDK resources to the target business process using the resource management master process of the management plane, the method further includes:

[0025] The target service process sends a request to the chip device so that the chip device can respond to the request.

[0026] This application also provides a device resource management system applied to a resource management platform. The resource management platform includes a management plane, a business plane, and a control plane. The management plane is used for resource allocation and reclamation of business processes. The business plane is used for creating business processes. The control plane is used for monitoring the status of business processes. The device resource management system includes:

[0027] The resource allocation module is used to allocate device resources to the target business process using the resource management main process of the management plane after the target business process is created in the business plane; wherein, the device resources include host resources and chip resources;

[0028] The judgment module is used to determine whether the business management process of the management plane has received a resource reclamation prompt; wherein, the resource reclamation prompt includes information returned by the business plane after the target business process has been executed, or information returned by the management plane after detecting an abnormality in the state of the target business process and killing the target business process;

[0029] The resource recycling module is used to reclaim the device resources allocated to the target business process using the resource management main process of the management plane if the resource recycling prompt is received.

[0030] This application also provides a storage medium storing a computer program thereon, which, when executed, implements the steps of the above-described device resource management method.

[0031] This application also provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor invokes the computer program in the memory to implement the steps of the above-described device resource management method.

[0032] This application provides a device resource management method applied to a resource management platform. The resource management platform includes a management plane, a business plane, and a control plane. The management plane is used for resource allocation and reclamation of business processes. The business plane is used for creating business processes. The control plane is used for monitoring the status of business processes. The device resource management method includes: after creating a target business process in the business plane, allocating device resources to the target business process using the resource management master process of the management plane; wherein, the device resources include host resources and chip resources; determining whether the business management process of the management plane has received a resource reclamation prompt; wherein, the resource reclamation prompt includes information returned by the business plane after the target business process has finished executing, or information returned by the management plane after detecting an abnormality in the status of the target business process and killing the target business process; if so, reclaiming the device resources allocated to the target business process using the resource management master process of the management plane.

[0033] This application implements device resource management based on a resource management platform, which includes a management plane, a business plane, and a control plane. These three planes are independent of each other and do not affect each other. After a target business process is created in the business plane, the main resource management process in the management plane allocates the required device resources to the target business process. Upon receiving a resource reclamation prompt, the main resource management process in the management plane reclaims the allocated device resources for the target business process. The resource reclamation prompt can be information returned after the target business process has completed execution, or information returned after the management plane has killed the target business process. This application can reclaim allocated device resources when the target business process completes normally or when the target business process is in an abnormal state. The management plane and control plane are decoupled from the business plane, enabling reasonable allocation of device resources and avoiding the impact of business process status on system management. This application also provides a device resource management system, a storage medium, and an electronic device, which have the above-mentioned beneficial effects, and will not be elaborated further here. Attached Figure Description

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

[0035] Figure 1 A flowchart illustrating a device resource management method provided in an embodiment of this application;

[0036] Figure 2 A schematic diagram of the framework of a resource management platform provided in an embodiment of this application;

[0037] Figure 3 This is a schematic diagram of a management plane initialization process provided in an embodiment of this application;

[0038] Figure 4 This is a sequence diagram of the interaction between management plane resource recycling provided in an embodiment of this application;

[0039] Figure 5 A flowchart illustrating firmware downloading is provided as an embodiment of this application;

[0040] Figure 6 This is a schematic diagram of the structure of a device resource management system provided in an embodiment of this application. Detailed Implementation

[0041] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0042] Please see below. Figure 1 , Figure 1 This is a flowchart illustrating a device resource management method provided in an embodiment of this application.

[0043] Specific steps may include:

[0044] S101: After creating the target business process in the business plane, the resource management master process of the management plane allocates device resources to the target business process;

[0045] This embodiment can be applied to a resource management platform, which includes a management plane, a business plane, and a control plane. The management plane is used for resource allocation and reclamation of business processes, the business plane is used for creating business processes, and the control plane is used for monitoring the status of business processes. Upon receiving a business startup request, the business plane can create a corresponding target business process based on the request. The target business process is a slave process of the resource management master process. The management plane can use the resource management master process to allocate corresponding device resources to the target business process. These device resources include host resources and chip resources. Host resources may include the host device's CPU resources, memory resources (such as hugepage resources), etc., and chip resources may be circular queue resources.

[0046] Specifically, the resource management master process in this embodiment can be reused multiple times. After the resource management master process is created, it does not need to be created again. Therefore, device resources can be allocated to the target business process in the following way: determine whether the management plane has created the resource management master process; if so, use the resource management master process of the management plane to allocate device resources to the target business process; if not, create the resource management master process and use the resource management master process of the management plane to allocate device resources to the target business process.

[0047] S102: Determine whether the business management process in the management plane has received a resource reclamation prompt; if yes, proceed to S103; otherwise, end the process.

[0048] The management plane can create a resource management main process and a business management process. The business management process is used to determine whether it is necessary to reclaim the device resources allocated to each business process. The resource reclamation prompt can be generated after the target business process has completed normal execution, or it can be generated after the target business process has become abnormal and has been killed. Specifically, the resource reclamation prompt can be the information returned by the business plane after the target business process has completed execution, or it can be the information returned by the management plane after detecting that the target business process has an abnormal state and killing the target business process. As a possible implementation, after determining that no resource reclamation prompt has been received, the judgment operation in S102 is re-entered after a preset delay.

[0049] Furthermore, after allocating device resources to the target service process in S101, the ID of the target service process can be obtained, and the service management process can block the ID of the target service process through the waitpid() mechanism in order to receive the resource reclamation prompt.

[0050] S103: The resource management master process of the management plane reclaims the device resources allocated to the target business process.

[0051] This step is based on the business management process receiving a resource reclamation prompt. At this time, the resource management main process of the management plane can be used to reclaim the device resources allocated by S101.

[0052] This embodiment implements device resource management based on a resource management platform, which includes a management plane, a business plane, and a control plane. These three planes are independent and do not affect each other. After a target business process is created in the business plane, the main resource management process in the management plane allocates the required device resources to the target business process. Upon receiving a resource reclamation prompt, the main resource management process in the management plane reclaims the allocated device resources for the target business process. The resource reclamation prompt can be information returned after the target business process has completed execution, or information returned after the management plane has killed the target business process. This embodiment can reclaim allocated device resources when the target business process completes normally or when the target business process is in an abnormal state. The management plane and control plane are decoupled from the business plane, enabling reasonable allocation of device resources and avoiding the impact of business process status on system management.

[0053] As for Figure 1 In a further description of the corresponding embodiment, after the resource management platform is started, there may be an initialization operation for the management plane and the control plane. The specific implementation process is as follows:

[0054] The management plane is controlled to perform initialization operations; wherein the initialization operations performed by the management plane include: determining whether the firmware heartbeat has timed out; if not, reading the SDK (Software Development Kit) configuration file, and using the SDK configuration file to configure the host large page memory resources, chip circular queue and register resources, and chip firmware resources respectively.

[0055] The control plane is controlled to perform initialization operations; wherein the initialization operations performed by the control plane include: starting the background monitoring service process, starting the chip device and loading the firmware, verifying the versions of the SDK, firmware and hardware after firmware initialization, and starting the business process status detection task, chip firmware heartbeat detection task, chip device anomaly detection task and chip device debugging and tracking task after successful verification.

[0056] Furthermore, after allocating device resources to the target business process using the resource management master process of the management plane, a locking mechanism can be used to lock the device resources allocated to the target business process in order to prevent the same resource from being requested by multiple businesses.

[0057] After allocating SDK resources to the target business process using the resource management master process of the management plane, the target business process can also send request information to the chip device so that the chip device can respond to the request information.

[0058] The process described in the above embodiments is illustrated below through examples in practical applications.

[0059] Generally, chip SDK development primarily focuses on kernel driver development. Because chip drivers significantly impact the stability of the operating system kernel, kernel-mode drivers are typically quite compact. Neither the chip driver nor the SDK involves user or business-related content; hardware resources or internal driver resources are naturally isolated from the user layer. However, user interaction involves extensive copying of user-level and kernel-level data, as well as switching between user-mode and kernel-mode calls, leading to a noticeable performance degradation. With technological and industry advancements, user scenarios demand increasingly higher performance. Consequently, a large portion of chip SDK development, previously done in kernel mode, has moved to user-mode development. Many chip devices now also provide accompanying user-mode libraries, and even comprehensive solutions for certain scenarios, aiming to enable customers to launch customized products more quickly and effectively. Because user-mode drivers, which are developed at the user level, have minimal impact on the operating system kernel, their development is faster and more flexible. They can be better integrated with user-mode libraries and user services. On many performance-driven chip devices, the SDK and user services are more closely integrated. Hardware and internal resources that were previously invisible to users during kernel-mode driver development are now handled in user-mode as well. User-mode development is flexible and open, making it very suitable for designing general-purpose architectures. In particular, using layered user-mode architectures can effectively solve complex resource management problems related to business logic when developing user-mode SDKs. Many accelerator chips involve internal hardware resources such as Channel and Ring related to driver development, as well as host resources such as large page memory used in big data interaction scenarios. Without a suitable framework design, when the user-mode driver is relatively complex, especially when the chip SDK needs to provide some functional interfaces related to user business in order to improve performance, many problems will arise. If the SDK mixes hardware resource management and business processing together, when the business is abnormal, the hardware Ring resources and host large page memory occupied by the business may not be effectively released. When the business continues, the performance will eventually decline because the hardware and software resources cannot be recycled and released in time, or even fail to work normally due to the inability to obtain resources. This SDK development method without resource management has the following disadvantages: (1) The system framework is unclear, the stability is poor, and the scalability is poor. There is no reasonable system framework layer management and more business coupling. When adding new functional modules or revising the original code, it is easy to introduce some problems that are not easily detected, and the scalability is poor; (2) Resource allocation and recycling are coupled with business. Business abnormalities may lead to resource management abnormalities.Hardware and system resources are acquired when the business starts and released when the business ends. If the business process is abnormal during operation, the various resources requested at the start of the business may not be released in time, eventually leading to the exhaustion of hardware and system resources; (3) Business processing is accompanied by the allocation and reclamation of resources, which seriously affects business performance. Since resource management and business processing are mixed together, in synchronous business processing mode, it is necessary to wait for the previous request to be completed before issuing the next request. The business processing flow is serial. At this time, the allocation and reclamation of resources increases the completion time of a single request, which will lead to a decrease in overall business performance. Host refers to a local computer that can access other machines.

[0060] To address the aforementioned shortcomings, this embodiment provides a scheme for separating the management plane, control plane, and business plane processing during chip SDK development. These are handled in different tasks on different planes. When the SDK's system services start, they lock the resources required by the business system through the resource management task of the management plane. Each plane is independent and does not affect the others. This multi-plane separation architecture minimizes the impact of system management and control modules on the business plane, allowing the business plane to focus more on business processing, thereby achieving high-speed and stable business processing.

[0061] This embodiment designs a suitable layered structure during chip SDK development based on the overall situation of chip hardware and software resources during business processing, ensuring a clear system structure and laying a solid foundation for flexible expansion in the future. Generally, separating the management plane and the business plane achieves basic resource and business isolation. However, in actual business scenarios, not only is stable and efficient business required, but better monitoring and control are also often needed. Therefore, a portion of elements that can be monitored by users is separated from the management plane and business plane to improve overall user-friendliness. Thus, considering all factors, the system is divided into three parts: the business plane, the control plane, and the management plane. After layering and isolating resource management, the entire system is clearly hierarchical, and the transactions in each plane are relatively independent. Therefore, business process anomalies will not affect the resource allocation and reclamation of the main resource management process. The resource management process in the management plane is responsible for resource configuration management, mainly including the allocation and reclamation of internal chip hardware resources and host system resources, completing the initialization of all public resources, and setting external public resources as shared resources. The resource management process acts as the main process, while the business processes act as slave processes that use resources. The control process can monitor the entire system in the background in real time, including monitoring the running status of business processes, automatically killing abnormal processes when they occur, updating the system status in real time, and reporting system anomalies. This embodiment uses a separation of resource management and business processing. The resources required during business processing have been pre-initialized and allocated by the resource management main process, and the business processing process only needs to obtain them through interface functions. Resource reclamation is automatically handled by the resource management main process in the management plane when the business process ends. Because it is completely decoupled from the business processes, the allocation and reclamation of resources can be done without affecting the performance of the business processes.

[0062] In summary, dividing resource management into management plane, control plane, and business plane during chip SDK development can effectively solve the problems of unclear system framework, poor stability and scalability. It can also solve the coupling between resource management and business, the problem of resource management anomalies caused by business anomalies, and the performance degradation caused by resource allocation and reclamation.

[0063] Please see Figure 2 , Figure 2 This is a schematic diagram of the framework of a resource management platform provided in an embodiment of this application. This embodiment divides the resource management platform into two phases and three main planes. The two phases are the initialization phase and the business execution phase, and the main operational content of the three main planes differs in different phases.

[0064] The initialization phase involves three main planes: the management plane completes the device initialization configuration based on user configuration and chip device resources; the control plane automatically loads the firmware in the background and then completes basic interactions with the management plane to ensure the device is in a normal and usable state. The control plane also creates multiple background tasks, which generally do not affect the tasks of the management and business planes. Once created, these tasks run continuously in the background, interacting with the management plane during initialization but having no connection with the business plane. The business plane does not need to perform any operations during initialization. Specifically, during initialization, the management plane performs the following operations: obtaining the firmware heartbeat and determining if the heartbeat acquisition was successful; if successful, it configures the host large page memory resources, chip device Ring (circular queue) resources, chip register resources, and chip firmware resources. After successful chip device initialization, the chip device is deemed to be in a normal state. The control plane performs the following operations: starting the background monitoring service process, starting the chip device, loading the firmware, and after firmware initialization, verifying the SDK, firmware, and hardware versions. It then determines if the verification was successful; if the verification fails, it proceeds to the chip device startup step. If the verification is successful, the following tasks will be initiated: business process status monitoring, chip firmware heartbeat monitoring, chip device anomaly monitoring, and chip device debugging and tracking.

[0065] The main tasks of the three planes during the business execution phase include: The resource management master process is created upon the start of the business process. This process is created only once, and subsequent business processes reuse it. Simultaneously, the management plane creates a task based on the business process to wait for its exit, used for automatic resource reclamation. The resource management master process mainly comprises two tasks: host-side resource management and chip-side resource management. The functions provided by these two tasks differ depending on the resource attributes, but both include resource allocation and reclamation. All business processes act as slave processes, creating individual business session processes. These processes focus solely on the business processing flow, sending correct request messages to the chip device, waiting for the corresponding response messages, and repeating this process until all requests for the session are completed. At this point, the business process exits automatically, and the resource management master process automatically reclaims all resources for this process. This process is completely independent of the business process and has no impact on its performance. Control plane tasks, as background tasks during business execution, normally do not interact with the management plane or business plane. Only when a business process encounters an anomaly will the control plane's business process status monitoring tasks interact with the resource management plane. Other control plane tasks are completely independent, with no interaction between the control plane, management plane, and business plane. For example... Figure 2As shown, the operations implemented in the management plane during the business execution phase include: the user starts the business process, and the resource management master process is started (created only once). After starting the Host memory resource management task, Host big page memory allocation, Host memory address translation, and Host big page memory reclamation are performed. After starting the chip Ring resource management task, hardware Ring resource allocation and hardware Ring resource reclamation are performed. The business management process waits for the business process to exit and performs hardware Ring resource reclamation and Host big page memory reclamation. The operations implemented in the business plane during the business execution phase include: starting the business processing slave process, constructing the user business process session, requesting shared memory resources through the resource management master process, requesting shared Ring resources through the resource management master process, constructing and sending the function request, waiting for the hardware device to reply with a response, and the business process session ending. It determines whether the business process has finished executing; if so, a resource reclamation prompt is sent to the business management process; otherwise, the function request continues to be constructed. The operations implemented in the control plane during the business execution phase include: executing business process status monitoring tasks, chip firmware heartbeat monitoring tasks, chip device anomaly monitoring tasks, and chip device debugging and tracing tasks. The process of performing business process status monitoring is as follows: business process registration, updating business process status, and determining whether the business process status is abnormal; if abnormal, the abnormal process is killed; otherwise, the business process status is updated. The process of performing chip firmware heartbeat monitoring is as follows: obtaining the firmware heartbeat, determining whether the firmware heartbeat was successfully obtained, and if successful, updating the hardware device status and reporting hardware device anomalies. The process of performing chip device anomaly monitoring includes: registering an exception ISR (Interrupt Service Routine), the exception ISR being triggered, updating the hardware device status, and reporting hardware device anomalies. The process of performing chip device debugging and tracing includes debugging command parsing, debugging command execution, and returning the debugging command execution result.

[0066] The main tasks of the management plane are resource management and reclamation. The SDK has a separate configuration file, represented in JSON format, which contains user-defined host memory plans, feature settings, and business process limits for the chip device. This facilitates the initialization of the resource management process according to user requirements. Figure 3 As shown, Figure 3 This is a schematic diagram of a management plane initialization process provided in an embodiment of this application. The process includes: obtaining a firmware heartbeat, determining whether the heartbeat has timed out, and if not, reading the user-configured SDK configuration file to configure HOST large page memory resources, chip Ring and register resources, and chip firmware resources. After successful chip device initialization, the chip device is determined to be in normal status.

[0067] The SDK configuration file is as follows:

[0068]

[0069] After resource initialization, the chip is ready to function normally. The primary task of the management plane is then to allocate and reclaim resources for the business processes. The resource management process and business processes are designed with a logical master-slave relationship. The resource management process, as the master process, sets public resources as shared resources. All business processes, as slave processes, acquire these shared resources through the master process. When multiple business processes acquire resources concurrently, the resource management process must provide a locking mechanism to ensure the correctness of resource acquisition. When a business process is created, the management plane process can obtain its process ID. The business management process then blocks using the `waitpid()` mechanism, waiting for the corresponding business process to exit. When the business process exits, resources are automatically reclaimed. The interaction sequence diagram between the processes is shown below. Figure 4 As shown, Figure 4 This is a sequence diagram of the resource reclamation interaction in the management plane provided in this application embodiment. The operations performed by the resource management main process include memory allocation, memory reclamation, Ring allocation, and Ring reclamation. The business management process blocks the business process through the waitpid() mechanism. The business process can obtain memory resources and Ring resources from the resource management main process, construct a request message, and send a request message to the hardware device. The hardware device responds with a response. After the business process exits, the business management process prompts the resource management main process to release memory resources and Ring resources.

[0070] The control plane primarily handles the control and monitoring of chip devices. Aside from firmware downloads, most tasks run in the background. The main task divisions are as follows: Figure 2 The control plane is shown. Please refer to [link / reference]. Figure 5 , Figure 5 The flowchart for firmware download provided in this application embodiment is as follows: After resetting the device, hardware initialization and BOOT initialization are performed. It is determined whether BOOT initialization is complete; if so, the firmware is downloaded; otherwise, it is determined whether the cumulative number of resets is greater than 5. If the cumulative number is not greater than 5, the device is reset; if the cumulative number is greater than 5, the firmware download is determined to have failed. After downloading the firmware, it is determined whether the firmware download was successful; if successful, firmware initialization is performed. After firmware initialization, it is determined whether the firmware heartbeat is normal; if the heartbeat is normal, the firmware download is determined to have succeeded. If the firmware download fails, it is determined whether the cumulative number of downloads is greater than 3; if so, the firmware download is determined to have failed; otherwise, the device is reset.

[0071] With a layered architecture, the business plane only needs to focus on the business interactions with chip devices. (See process reference.) Figure 2 The business plane is shown below. (Through...) Figure 2 and Figure 4 It can be seen that the operation of the main resource management process is not affected regardless of whether the business process is normal or abnormal.

[0072] This embodiment divides chip SDK development into a management plane, a control plane, and a business plane, thereby achieving an easily scalable and maintainable platform architecture. This embodiment manages SDK resources through the management plane, completely decoupling it from the business plane, ensuring efficient and stable business processing. This embodiment provides an architectural method for separating chip SDK development into management, control, and business planes to rationally manage SDK resources, making each plane independent and unaffected by others. This method completely decouples business processing and resource management, ensuring that system management and control have minimal impact on business operations, thus achieving an easily scalable and maintainable architecture. It allows the business plane to focus more on business processing, achieving high-speed and stable business processing. This embodiment provides an architectural method for separating chip SDK development into management, control, and business planes to rationally manage SDK resources, making each plane independent and unaffected by others. This not only achieves an easily scalable and maintainable SDK platform architecture that ensures efficient and stable business processing, but also has advantages in user-friendliness and handling of complex business exceptions. Due to the isolation of resource management and monitoring, users can easily perform secondary development without affecting business performance. Exception handling includes basic exception detection, exception notification, and exception recovery processes. In complex user business scenarios, exception handling has a significant impact on business operations. This SDK platform architecture not only provides independent management interfaces for management and control, but also helps users to automatically recover business processes after an exception without affecting the management of the entire system.

[0073] Please see Figure 6 , Figure 6 This is a schematic diagram of a device resource management system provided in an embodiment of this application. The system is applied to a resource management platform, which includes a management plane, a business plane, and a control plane. The management plane is used for resource allocation and reclamation of business processes, the business plane is used for creating business processes, and the control plane is used for monitoring the status of business processes. The device resource management system includes:

[0074] The resource allocation module 601 is used to allocate device resources to the target business process using the resource management master process of the management plane after the target business process is created in the business plane; wherein, the device resources include host resources and chip resources;

[0075] The judgment module 602 is used to determine whether the business management process of the management plane has received a resource reclamation prompt; wherein, the resource reclamation prompt includes information returned by the business plane after the target business process has been executed, or information returned by the management plane after detecting that the state of the target business process is abnormal and killing the target business process;

[0076] The resource recycling module 603 is used to reclaim the device resources allocated to the target business process using the resource management main process of the management plane if the resource recycling prompt is received.

[0077] This embodiment implements device resource management based on a resource management platform, which includes a management plane, a business plane, and a control plane. These three planes are independent and do not affect each other. After a target business process is created in the business plane, the main resource management process in the management plane allocates the required device resources to the target business process. Upon receiving a resource reclamation prompt, the main resource management process in the management plane reclaims the allocated device resources for the target business process. The resource reclamation prompt can be information returned after the target business process has completed execution, or information returned after the management plane has killed the target business process. This embodiment can reclaim allocated device resources when the target business process completes normally or when the target business process is in an abnormal state. The management plane and control plane are decoupled from the business plane, enabling reasonable allocation of device resources and avoiding the impact of business process status on system management.

[0078] Furthermore, the resource allocation module 601 is used to determine whether the management plane has created the resource management master process; if so, it uses the resource management master process of the management plane to allocate device resources to the target business process; if not, it creates the resource management master process and uses the resource management master process of the management plane to allocate device resources to the target business process.

[0079] Furthermore, it also includes:

[0080] The management plane initialization module is used to control the management plane to perform initialization operations before the resource management main process of the management plane allocates device resources to the target business process.

[0081] The initialization operations performed by the management plane include: determining whether the firmware heartbeat has timed out; if not, reading the SDK configuration file and configuring the host large page memory resources, chip circular queue and register resources, and chip firmware resources using the SDK configuration file.

[0082] Furthermore, it also includes:

[0083] The control plane initialization module is used to control the control plane to perform initialization operations before allocating device resources to the target business process using the resource management main process of the management plane;

[0084] The initialization operations performed by the control plane include: starting the background monitoring service process, starting the chip device and loading the firmware, verifying the versions of the SDK, firmware and hardware after firmware initialization, and starting the business process status detection task, chip firmware heartbeat detection task, chip device anomaly detection task and chip device debugging and tracking task after successful verification.

[0085] Furthermore, it also includes:

[0086] The process blocking module is used to obtain the ID of the target business process after the resource management main process of the management plane allocates device resources to the target business process, and use the business management process to block the ID of the target business process through the waitpid() mechanism so as to receive the resource reclamation prompt.

[0087] Furthermore, it also includes:

[0088] The resource locking module is used to lock the device resources allocated to the target business process through a locking mechanism after the resource management master process of the management plane allocates device resources to the target business process.

[0089] Furthermore, it also includes:

[0090] The information sending module is used to send request information to the chip device through the target business process after allocating SDK resources to the target business process using the resource management main process of the management plane, so that the chip device can respond to the request information.

[0091] Since the embodiments of the system part correspond to the embodiments of the method part, please refer to the description of the embodiments of the method part for the embodiments of the system part, and they will not be repeated here.

[0092] This application also provides a storage medium on which a computer program is stored, which, when executed, can perform the steps provided in the above embodiments. The storage medium may include various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0093] This application also provides an electronic device that may include a memory and a processor. The memory stores a computer program, and when the processor calls the computer program in the memory, it can implement the steps provided in the above embodiments. Of course, the electronic device may also include various network interfaces, power supplies, and other components.

[0094] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the systems disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple; relevant parts can be referred to in the method section. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from the principles of this application, and these improvements and modifications also fall within the protection scope of the claims of this application.

[0095] It should also be noted that, in this specification, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

Claims

1. A method for managing equipment resources, characterized in that, The method is applied to a resource management platform, which includes a management plane, a business plane, and a control plane. The management plane is used for resource allocation and reclamation of business processes, the business plane is used for creating business processes, and the control plane is used for monitoring the status of business processes. The device resource management method includes: After the target business process is created in the business plane, the resource management master process of the management plane allocates device resources to the target business process; wherein, the device resources include host resources and chip resources; Determine whether the business management process of the management plane has received a resource reclamation prompt; wherein, the resource reclamation prompt includes information returned by the business plane after the target business process has finished executing, or information returned by the management plane after detecting an abnormality in the state of the target business process and killing the target business process; If so, the resource management main process of the management plane will be used to reclaim the device resources allocated to the target business process; The management plane, the business plane, and the control plane are independent of each other. The resource management main process is created when the business process starts. This process is created only once, and subsequent business processes reuse this process. At the same time, the management plane will create a task based on the business process to wait for the business process to exit, which is used to automatically reclaim resources.

2. The equipment resource management method according to claim 1, characterized in that, The resource management master process of the management plane allocates device resources to the target business process, including: Determine whether the resource management master process has been created in the management plane; If so, the resource management master process of the management plane will be used to allocate device resources to the target business process; If not, then create the resource management master process and use the resource management master process of the management plane to allocate device resources to the target business process.

3. The equipment resource management method according to claim 1, characterized in that, Before allocating device resources to the target business process using the resource management master process of the management plane, the process further includes: Control the management plane to perform initialization operations; The initialization operations performed by the management plane include: determining whether the firmware heartbeat has timed out; if not, reading the SDK configuration file and configuring the host large page memory resources, chip circular queue and register resources, and chip firmware resources using the SDK configuration file.

4. The equipment resource management method according to claim 1, characterized in that, Before allocating device resources to the target business process using the resource management master process of the management plane, the process further includes: Control the control plane to perform initialization operations; The initialization operations performed by the control plane include: starting the background monitoring service process, starting the chip device and loading the firmware, verifying the versions of the SDK, firmware and hardware after firmware initialization, and starting the business process status detection task, chip firmware heartbeat detection task, chip device anomaly detection task and chip device debugging and tracking task after successful verification.

5. The equipment resource management method according to claim 1, characterized in that, After allocating device resources to the target business process using the resource management master process of the management plane, the process further includes: Obtain the ID of the target business process, and use the business management process to block the ID of the target business process through the waitpid() mechanism in order to receive the resource reclamation prompt.

6. The equipment resource management method according to claim 1, characterized in that, After allocating device resources to the target business process using the resource management master process of the management plane, the process further includes: The device resources allocated to the target service process are locked using a locking mechanism.

7. The equipment resource management method according to claim 1, characterized in that, After allocating SDK resources to the target business process using the resource management master process of the management plane, the process further includes: The target service process sends a request to the chip device so that the chip device can respond to the request.

8. A device resource management system, characterized in that, This system is applied to a resource management platform, which includes a management plane, a business plane, and a control plane. The management plane is used for resource allocation and reclamation of business processes, the business plane is used for creating business processes, and the control plane is used for monitoring the status of business processes. The device resource management system includes: The resource allocation module is used to allocate device resources to the target business process using the resource management main process of the management plane after the target business process is created in the business plane; wherein, the device resources include host resources and chip resources; The judgment module is used to determine whether the business management process of the management plane has received a resource reclamation prompt; wherein, the resource reclamation prompt includes information returned by the business plane after the target business process has been executed, or information returned by the management plane after detecting an abnormality in the state of the target business process and killing the target business process; The resource recycling module is used to reclaim the device resources allocated to the target business process using the resource management main process of the management plane if the resource recycling prompt is received. The management plane, the business plane, and the control plane are independent of each other. The resource management main process is created when the business process starts. This process is created only once, and subsequent business processes reuse this process. At the same time, the management plane will create a task based on the business process to wait for the business process to exit, which is used to automatically reclaim resources.

9. An electronic device, characterized in that, The device includes a memory and a processor, wherein the memory stores a computer program, and the processor, when calling the computer program in the memory, implements the steps of the device resource management method as described in any one of claims 1 to 7.

10. A storage medium, characterized in that, The storage medium stores computer-executable instructions, which, when loaded and executed by a processor, implement the steps of the device resource management method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Master-slave architecture server, service processing method thereof and service processing system thereof

    CN105337755A

  • Data processing method and device and storage medium

    CN109669979A