Task execution method, baseboard management controller, storage medium and electronic device

WO2026103291A1PCT designated stage Publication Date: 2026-05-21INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
INSPUR SUZHOU INTELLIGENT TECH CO LTD
Filing Date
2025-09-05
Publication Date
2026-05-21

Smart Images

  • Figure CN2025119462_21052026_PF_FP_ABST
    Figure CN2025119462_21052026_PF_FP_ABST
Patent Text Reader

Abstract

Provided in the embodiments of the present application are a task execution method, a baseboard management controller, a storage medium, an electronic device and a computer program product. The method comprises: when it is necessary to execute a target task by means of a target thread, acquiring a target execution time condition of the target task, wherein the target execution time condition comprises a pre-configured target execution time period for indicating a time period during which the execution of the target task is allowed; and on the basis of the target execution time condition, determining whether to invoke the target thread to execute the target task, wherein when it is determined that a system time is within the target execution time period, the target thread is invoked to execute the target task, and when it is determined that the system time is not within the target execution time period, a waiting operation is executed until the system time is within the target execution time period, and the target thread is then invoked to execute the target task.
Need to check novelty before this filing date? Find Prior Art

Description

Task execution method, baseboard management controller, storage medium and electronic devices

[0001] Cross-reference to related applications

[0002] This application claims priority to Chinese Patent Application No. 202411608920.1, filed on November 12, 2024, entitled “Task Execution Method, Substrate Management Controller, Storage Medium and Electronic Device”, the entire contents of which are incorporated herein by reference. Technical Field

[0003] This application relates to the field of computers, and more specifically, to a task execution method, a baseboard management controller, a storage medium, an electronic device, and a computer program product. Background Technology

[0004] With the increase in processor speed and the emergence of multi-core processors, operating systems can gradually support the simultaneous execution of multiple tasks, which significantly improves the utilization efficiency of the central processing unit (CPU) and the system response speed. However, in related technologies, when multiple tasks are executed in the system, there are problems such as multiple tasks needing to access and modify the same resource, and insufficient server resources when multiple tasks are executed simultaneously, which can lead to lower stability of the operating system. Summary of the Invention

[0005] This application provides a task execution method, a baseboard management controller, a storage medium, an electronic device, and a computer program product to at least solve the problem of low operating system stability caused by multiple tasks needing to access and modify the same resource or insufficient server resources when multiple tasks are executed simultaneously in the related art.

[0006] According to one embodiment of this application, a task execution method is provided, comprising: when it is necessary to execute a target task through a target thread, obtaining a target execution time condition for the target task, wherein the target execution time condition includes a pre-configured target execution time period for indicating that the target task is allowed to be executed; determining whether to call the target thread to execute the target task based on the target execution time condition, wherein if it is determined that the system time is within the target execution time period, the target thread is called to execute the target task; if it is determined that the system time is not within the target execution time period, performing a waiting operation until the system time is within the target execution time period, and calling the target thread to execute the target task.

[0007] In one exemplary embodiment, before obtaining the target execution time conditions for the target task, the method further includes: receiving an execution time condition setting instruction, wherein the execution time condition setting instruction includes one or more execution time conditions; and configuring the one or more execution time conditions in the baseboard management controller.

[0008] In one exemplary embodiment, at least one of the following is included: different tasks have the same execution time conditions; different tasks have different execution time conditions; different task sets have different execution time conditions, wherein a task set includes one or more tasks, and all tasks included in the same task set have the same execution time conditions.

[0009] In one exemplary embodiment, receiving an execution time condition setting instruction includes: receiving an input or time period setting instruction from another device, wherein the time period setting instruction includes a first time period that allows execution of each task and / or a second time period that disallows execution of each task; configuring one or more execution time conditions in a baseboard management controller includes: setting them in the baseboard management controller according to the time period setting instruction.

[0010] In one exemplary embodiment, the method further includes: determining whether the system time is within the target execution time period by: acquiring a target semaphore; determining that the system time is within the target execution time period if the target semaphore indicates that no target locking file exists in the baseboard management controller; and determining that the system time is not within the target execution time period if the target semaphore indicates that a target locking file exists in the baseboard management controller.

[0011] In an exemplary embodiment, before obtaining the target execution time condition of the target task, the method further includes: configuring the association between multiple maintenance locks and multiple tasks; wherein, for one or more tasks associated with a maintenance lock, whether the execution time condition of one or more tasks is currently met is determined based on the state of the maintenance lock, and the state adjustment conditions of different maintenance locks are not exactly the same.

[0012] In one exemplary embodiment, before configuring the association between multiple maintenance locks and multiple tasks, the method further includes: creating multiple maintenance locks; configuring the association between multiple maintenance locks and multiple tasks, including: configuring the association between multiple maintenance locks and multiple tasks based on received configuration instructions and / or default configuration methods.

[0013] In one exemplary embodiment, configuring the association between multiple maintenance locks and multiple tasks includes at least one of the following: configuring a unique corresponding association between the multiple maintenance locks and multiple tasks; configuring a one-to-many association between the multiple maintenance locks and multiple tasks.

[0014] In one exemplary embodiment, the method further includes: configuring a corresponding opening time period for each maintenance lock; wherein the opening time periods for different maintenance locks are not completely the same, the maintenance lock in the corresponding opening time period is in the open state, and the maintenance lock in other time periods other than the corresponding opening time period is in the closed state; for one or more tasks associated with a maintenance lock that is currently in the open state, the system time is within the execution time period of one or more tasks; for one or more tasks associated with a maintenance lock that is currently in the closed state, the system time is not within the execution time period of one or more tasks.

[0015] In one exemplary embodiment, the method further includes configuring all maintenance locks to be closed when the difference between the computer system time and the time determined by a counter configured in the baseboard management controller is greater than a predetermined threshold.

[0016] In one exemplary embodiment, the method further includes: receiving an adjustment instruction from a maintenance lock; adjusting a plurality of configured maintenance locks according to the adjustment instruction; wherein the adjustment method includes at least one of the following: deleting one or more existing maintenance locks, adding one or more new maintenance locks, or adjusting the opening time period of one or more existing maintenance locks.

[0017] In one exemplary embodiment, the target task includes at least one of the following: software upgrade task, configuration task, background task, and power operation task.

[0018] According to another embodiment of this application, a baseboard management controller is provided, comprising: an acquisition module configured to acquire target execution time conditions for a target task when it is necessary to execute a target task through a target thread, wherein the target execution time conditions include a pre-configured target execution time period for indicating that the target task is allowed to be executed; and a determination module configured to determine whether to call a target thread to execute the target task based on the target execution time conditions, wherein if it is determined that the system time is within the target execution time period, the target thread is called to execute the target task; if it is determined that the system time is not within the target execution time period, a waiting operation is performed until the system time is within the target execution time period, and the target thread is called to execute the target task.

[0019] According to yet another embodiment of this application, a non-volatile computer-readable storage medium is also provided, wherein a computer program is stored in the non-volatile computer-readable storage medium, and the computer program is configured to perform the steps in any of the above method embodiments when it is run.

[0020] According to yet another embodiment of this application, an electronic device is also provided, including a memory and a processor, wherein a computer program is stored in the memory and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.

[0021] According to yet another embodiment of this application, a computer program product is also provided, including a computer program that, when executed by a processor, implements the steps in any of the above method embodiments.

[0022] By utilizing this application, when a target task needs to be executed through a target thread, it is first determined whether the execution conditions of the target task are met, and if the execution conditions are met, the target thread is called to execute the target task. This ensures that the task is executed under appropriate conditions (e.g., sufficient system resources, no conflicting tasks with the current task, etc.). Therefore, it can solve the problem of low operating system stability caused by multiple tasks needing to access and modify the same resource or insufficient server resources when multiple tasks are executed simultaneously in the system during multi-task execution in related technologies. This achieves the effect of avoiding task execution conflicts in the system and improving resource utilization. Attached Figure Description

[0023] Figure 1 is a hardware structure block diagram of a server device for a task execution method according to an embodiment of the fundamental application;

[0024] Figure 2 is a flowchart of a task execution method according to an embodiment of this application;

[0025] Figure 3 is a flowchart of a task execution method according to an embodiment of this application;

[0026] Figure 4 is a schematic diagram of a task execution method according to an embodiment of this application;

[0027] Figure 5 is a structural block diagram of a baseboard management controller according to an embodiment of this application. Detailed Implementation

[0028] The embodiments of this application will be described in detail below with reference to the accompanying drawings and examples.

[0029] It should be noted that the terms "first," "second," etc., in the specification, claims, and drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.

[0030] The method embodiments provided in this application can be executed in a server device or similar computing device. Taking running on a server device as an example, FIG1 is a hardware structure block diagram of a server device for the task execution method of the fundamental application embodiment. As shown in FIG1, the server device may include one or more (only one is shown in FIG1) processors 102 (processor 102 may include, but is not limited to, processing devices such as microprocessors MCUs or programmable logic devices FPGAs) and a memory 104 configured to store data. The server device may also include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that the structure shown in FIG1 is only illustrative and does not limit the structure of the server device. For example, the server device may also include more or fewer components than shown in FIG1, or have a different configuration than shown in FIG1.

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

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

[0033] This embodiment provides a task execution method. Figure 2 is a flowchart of the task execution method according to an embodiment of this application. As shown in Figure 2, the process includes the following steps:

[0034] Step S202: When it is necessary to execute the target task through the target thread, obtain the target execution time condition of the target task, wherein the target execution time condition includes a pre-configured target execution time period for indicating that the target task is allowed to be executed;

[0035] Step S204: Determine whether to call the target thread to execute the target task based on the target execution time condition. If the system time is determined to be within the target execution time period, the target thread is called to execute the target task. If the system time is determined not to be within the target execution time period, a waiting operation is performed until the system time is within the target execution time period, and then the target thread is called to execute the target task.

[0036] In the above steps, the target threads include, but are not limited to: user threads, kernel threads, daemon threads, worker threads, timer threads, asynchronous I / O threads, main threads, rendering threads, network threads, database threads, etc. The target tasks include, but are not limited to: data backup tasks, system maintenance tasks, data synchronization tasks, report generation tasks, batch processing tasks, log cleanup tasks, resource monitoring tasks, database optimization tasks, etc. The system time includes, but is not limited to, being determined by the following methods: determining it by viewing the system clock through command-line tools, obtaining time information from an NTP server through the Network Time Protocol (NTP), etc.

[0037] For example, if the target task is a data backup task, the target execution time condition of the data backup task is queried. If the target execution time condition of the data backup task is 2:00 AM to 4:00 AM every day, and the current time is within the time period of 2:00 AM to 4:00 AM, the target thread is called to execute the data backup task; if the current time is not within the time period of 2:00 AM to 4:00 AM, a waiting operation is performed until 2:00 AM, at which time the target thread is called to execute the data backup task.

[0038] Through the above steps, when a target task needs to be executed through a target thread, it is first determined whether the execution conditions of the target task are met. If the execution conditions are met, the target thread is called to execute the target task. This ensures that the task is executed under appropriate conditions (e.g., sufficient system resources, no conflicting tasks with the current task, etc.). This solves the problem of low operating system stability caused by multiple tasks needing to access and modify the same resource or insufficient server resources when multiple tasks are executed simultaneously in related technologies. It also avoids task execution conflicts in the system and improves resource utilization.

[0039] The entity performing the above steps may be a baseboard management controller, other devices that can perform similar functions, or other similar devices, but is not limited to these.

[0040] In some embodiments, before obtaining the target execution time conditions for the target task, the method further includes: receiving an execution time condition setting instruction, wherein the execution time condition setting instruction includes one or more execution time conditions; and configuring one or more execution time conditions in the baseboard management controller.

[0041] In the above steps, receiving execution time condition setting instructions includes, but is not limited to: receiving execution time condition setting instructions entered by the system administrator through the management software interface or configured through the command line tool, receiving execution time condition setting instructions sent based on the Intelligent Platform Management Interface (IPMI) protocol, etc.

[0042] For example, the following describes in detail the process by which the user configures the execution time conditions in the baseboard management controller through the front-end configuration software of the baseboard management controller, in a scenario where the target task is a maintenance task:

[0043] In the front-end configuration software of the baseboard management controller, locate the "Firmware and Operating System Software" option; under this option, click "Maintenance Period" to enter the maintenance period configuration interface; on the maintenance period interface, click the "Add" button and perform the following operations: enter a name in the name box to identify this maintenance period; enter a description in the description box to describe the purpose or characteristics of this maintenance period; enter the start and end times of the maintenance period in the start and end boxes; click "Finish Add".

[0044] In some embodiments, at least one of the following is included: different tasks have the same execution time conditions; different tasks have different execution time conditions; different task sets have different execution time conditions, wherein a task set includes one or more tasks, and all tasks included in the same task set have the same execution time conditions.

[0045] In some embodiments, receiving an execution time condition setting instruction includes: receiving an input or time period setting instruction from another device, wherein the time period setting instruction includes a first time period that allows the execution of each task and / or a second time period that disallows the execution of each task; configuring one or more execution time conditions in the baseboard management controller includes: setting them in the baseboard management controller according to the time period setting instruction.

[0046] For example, in the above steps, tasks such as log cleanup and system maintenance are only allowed to be executed between 2:00 AM and 4:00 AM, and cannot be executed at other times.

[0047] In some embodiments, the method further includes: determining whether the system time is within the target execution time period by: acquiring a target semaphore; determining that the system time is within the target execution time period if the target semaphore indicates that there is no target lock file in the baseboard management controller; and determining that the system time is not within the target execution time period if the target semaphore indicates that there is a target lock file in the baseboard management controller.

[0048] In the above steps, the existence time of the target lock file can be determined according to preset settings and received setting instructions. The preset settings can be adjusted according to different device types and application scenarios. By checking whether the system time is within the target execution period through the presence of the target lock file in the baseboard management controller, unified management of target tasks can be achieved, improving system stability.

[0049] In some embodiments, before obtaining the target execution time condition of the target task, the method further includes: configuring the association between multiple maintenance locks and multiple tasks; wherein, for one or more tasks associated with a maintenance lock, whether the execution time condition of one or more tasks is currently met is determined based on the state of the maintenance lock, and the state adjustment conditions of different maintenance locks are not exactly the same.

[0050] In the above steps, multiple maintenance locks include, but are not limited to, mutex locks, read-write locks, spinlocks, semaphores, custom file locks, etc. For example, the following scenario illustrates the relationship between configuration maintenance locks and tasks: Under the maintenance window management center of the baseboard management controller, there are multiple maintenance locks, such as upgrade locks, power operation locks, etc. Upgrade tasks are registered under upgrade locks so that the registered upgrade tasks can only be executed when the execution time condition corresponding to the upgrade lock is met and the upgrade lock is open. When the upgrade lock is closed, the upgrade tasks are in a stopped or blocked state. Power operation tasks (e.g., turn on, turn off, hibernate, etc.) are registered under power locks so that the registered power operation tasks can only be executed when the execution time condition corresponding to the power lock is met and the power lock is open. For example, the correspondence between tasks and maintenance locks includes, but is not limited to, determining based on task attributes (e.g., registering power operation tasks under power locks), determining based on task execution time (e.g., registering upgrade tasks that execute during the early morning hours under power locks with execution time conditions during the early morning hours), etc.

[0051] In the above steps, by configuring the association between multiple maintenance locks and one or more tasks, and determining whether one or more tasks corresponding to the maintenance lock meet the execution time conditions based on the status of the maintenance lock, it is possible to achieve unified execution management of tasks registered under the maintenance lock through multiple maintenance locks. This enables precise control of task execution time, ensures that tasks are executed within the predetermined time, improves the accuracy and reliability of task scheduling, and ensures that tasks are executed when resources are sufficient, avoiding the execution of tasks when system resources are scarce, thereby optimizing the allocation and utilization of resources.

[0052] In some embodiments, when a target lock file and multiple maintenance locks exist simultaneously in the baseboard management controller, the target lock file manages the multiple maintenance locks in the following ways: when a target lock file exists, the tasks managed by the multiple maintenance locks are not executable; when a target lock file does not exist, the execution time conditions of the tasks managed by the multiple maintenance locks are adjusted by the corresponding maintenance locks.

[0053] In the above steps, by using a combination of target locking files and maintenance locks to manage task execution, fine-grained control over task execution can be achieved, improving system security, stability, and resource utilization efficiency, while reducing task conflicts and facilitating system monitoring and maintenance.

[0054] In some embodiments, before configuring the association between multiple maintenance locks and multiple tasks, the method further includes: creating multiple maintenance locks; configuring the association between multiple maintenance locks and multiple tasks, including: configuring the association between multiple maintenance locks and multiple tasks based on received configuration instructions and / or default configuration methods.

[0055] In the above steps, for example, each task process thread in the baseboard management controller registers the target task corresponding to the received configuration instructions and / or default configuration method under the unique maintenance lock in the maintenance window management center, and synchronizes the target task information to the corresponding maintenance lock.

[0056] In some embodiments, configuring the association between multiple maintenance locks and multiple tasks includes at least one of the following: configuring a unique corresponding association between multiple maintenance locks and multiple tasks; configuring a one-to-many association between multiple maintenance locks and multiple tasks.

[0057] In the above steps, multiple maintenance locks are associated with one or more tasks, and each task is registered to only one maintenance lock. Because each task is registered to only one maintenance lock, the problem of task management conflicts caused by the same task being within the target execution time period under one maintenance lock and within a non-target execution time period under another maintenance lock can be avoided.

[0058] In some embodiments, the method further includes: configuring a corresponding opening time period for each maintenance lock; wherein the opening time periods for different maintenance locks are not completely the same, the maintenance lock in the corresponding opening time period is in the open state, and the maintenance lock in other time periods other than the corresponding opening time period is in the closed state; for one or more tasks associated with a maintenance lock that is currently in the open state, the system time is within the execution time period of one or more tasks; for one or more tasks associated with a maintenance lock that is currently in the closed state, the system time is not within the execution time period of one or more tasks.

[0059] In some embodiments, the method further includes configuring all maintenance locks to be closed when the difference between the computer system time and the time determined by a counter configured in the baseboard management controller is greater than a predetermined threshold.

[0060] In the above steps, the predetermined thresholds include, but are not limited to, 10 minutes, 20 minutes, 1 hour, etc. The predetermined thresholds can be adjusted according to different equipment types and application scenarios. For example, the time difference between the current time and the start time of the execution time period of one or more tasks corresponding to the maintenance lock is determined based on the computer system time, and if the difference between the time difference and the remaining time before the start time of the execution time period determined by the counter configured in the baseboard management controller is greater than the predetermined threshold, the state of all maintenance locks is configured to be closed.

[0061] In the above steps, by closing all maintenance locks when the difference between the computer system time and the time determined by the counter is greater than a predetermined threshold, the problem of abnormal task execution caused by computer system time disorder is avoided, thereby improving the security and stability of the system.

[0062] In some embodiments, the method further includes: receiving an adjustment instruction from a maintenance lock; adjusting a plurality of configured maintenance locks according to the adjustment instruction; wherein the adjustment method includes at least one of the following: deleting one or more existing maintenance locks, adding one or more new maintenance locks, or adjusting the opening time period of one or more existing maintenance locks.

[0063] In the above steps, the execution time periods for one or more target tasks corresponding to multiple maintenance locks may be the same or different. For example, the execution time period for tasks under the power lock is from 8:00 to 23:00, the execution time period for tasks under the upgrade lock is from 24:00 to 7:00, and the execution time period for tasks under the read-write lock is from 1:00 to 24:00.

[0064] In the above steps, since the maintenance lock can be adjusted based on the adjustment command, it is possible to achieve precise control over the execution time of the target task, reduce the risk caused by executing the target task at an inappropriate time, and improve the stability and security of the system.

[0065] In some embodiments, the target task includes at least one of the following: software upgrade task, configuration task, background task, and power operation task.

[0066] The solution in this application will be described below with reference to the overall embodiments:

[0067] Figure 3 is a flowchart of a task execution method according to an embodiment of this application, and Figure 4 is a schematic diagram of a task execution method according to an embodiment of this application. As shown in Figure 3, the process includes the following steps:

[0068] Step S302: After the task thread / process starts, it registers the corresponding task (i.e., the aforementioned target task) to the corresponding maintenance lock according to the rules.

[0069] Step S304: The maintenance lock management center manages each maintenance lock individually. During non-set maintenance windows, the management center occupies the maintenance lock and prohibits task execution.

[0070] Step S306: During the set maintenance window, the target task is executed when the task execution time period of the corresponding target task, which is maintained by the task thread / process, arrives.

[0071] In the above steps, a maintenance window management system with multiple locks and freely assigned tasks was created by setting up maintenance lock management and a registration association mechanism between the central maintenance lock and tasks. By setting up multiple maintenance locks, maintenance personnel in different positions can set up and manage their own maintenance locks according to their responsibilities and task arrangements, thereby achieving non-interference between different positions and improving the coordination and efficiency of maintenance work.

[0072] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as read-only memory (ROM), random access memory (RAM), magnetic disk, optical disk), and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods of the various embodiments of this application.

[0073] This embodiment also provides a baseboard management controller device, which is configured to implement the above embodiments and optional implementations, and will not be repeated as already described. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0074] Figure 5 is a structural block diagram of a baseboard management controller according to an embodiment of this application. As shown in Figure 5, the baseboard management controller includes: an acquisition module 52, configured to acquire target execution time conditions of a target task when it is necessary to execute a target task through a target thread, wherein the target execution time conditions include a pre-configured target execution time period for indicating that the target task is allowed to be executed; and a determination module 54, configured to determine whether to call a target thread to execute the target task based on the target execution time conditions, wherein if it is determined that the system time is within the target execution time period, the target thread is called to execute the target task; if it is determined that the system time is not within the target execution time period, a waiting operation is performed until the system time is within the target execution time period, and the target thread is called to execute the target task.

[0075] In some embodiments, the baseboard management controller further includes: a first receiving module configured to receive an execution time condition setting instruction before acquiring the target execution time condition of the target task, wherein the execution time condition setting instruction includes one or more execution time conditions; and a first configuration module configured to configure one or more execution time conditions in the baseboard management controller.

[0076] In some embodiments, at least one of the following is included: different tasks have the same execution time conditions; different tasks have different execution time conditions; different task sets have different execution time conditions, wherein a task set includes one or more tasks, and all tasks included in the same task set have the same execution time conditions.

[0077] In some embodiments, the first receiving module includes: a receiving unit configured to receive a time period setting instruction input from another device, wherein the time period setting instruction includes a first time period that allows the execution of each task and / or a second time period that disallows the execution of each task; the first configuration module includes: a first configuration unit configured to make settings in the baseboard management controller according to the time period setting instruction.

[0078] In some embodiments, the baseboard management controller further includes a determination module configured to determine whether the system time is within the target execution time period by: acquiring a target semaphore; determining that the system time is within the target execution time period if the target semaphore indicates that no target lock file exists in the baseboard management controller; and determining that the system time is not within the target execution time period if the target semaphore indicates that a target lock file exists in the baseboard management controller.

[0079] In some embodiments, the baseboard management controller further includes: a second configuration module, configured to configure the association between multiple maintenance locks and multiple tasks before obtaining the target execution time condition of the target task; wherein, for one or more tasks associated with a maintenance lock, whether the execution time condition of one or more tasks is currently met is determined based on the state of the maintenance lock, and the state adjustment conditions of different maintenance locks are not exactly the same.

[0080] In some embodiments, the baseboard management controller further includes: a creation module configured to create multiple maintenance locks before configuring the association between multiple maintenance locks and multiple tasks; the second configuration module includes: a second configuration unit configured to configure the association between multiple maintenance locks and multiple tasks based on received configuration instructions and / or default configuration methods.

[0081] In some embodiments, the second configuration module includes at least one of the following: a third configuration unit configured to configure a unique corresponding association between the multiple maintenance locks and the multiple tasks; and a fourth configuration unit configured to configure a one-to-many association between the multiple maintenance locks and the multiple tasks.

[0082] In some embodiments, the baseboard management controller further includes: a third configuration module, configured to configure a corresponding opening time period for each maintenance lock; wherein the opening time periods for different maintenance locks are not completely the same, the maintenance locks in the corresponding opening time period are in the open state, and the maintenance locks in other time periods other than the corresponding opening time period are in the closed state; for one or more tasks associated with a maintenance lock currently in the open state, the system time is within the execution time period of one or more tasks; for one or more tasks associated with a maintenance lock currently in the closed state, the system time is not within the execution time period of one or more tasks.

[0083] In some embodiments, the baseboard management controller further includes a fourth configuration module configured to configure all maintenance locks to be closed when the difference between the computer system time and the time determined by a counter configured within the baseboard management controller is greater than a predetermined threshold.

[0084] In some embodiments, the baseboard management controller further includes: a second receiving module configured to receive adjustment instructions for maintenance locks; and an adjustment module configured to adjust the configured plurality of maintenance locks according to the adjustment instructions; wherein the adjustment method includes at least one of the following: deleting one or more existing maintenance locks, adding one or more new maintenance locks, or adjusting the opening time period of one or more existing maintenance locks.

[0085] In some embodiments, the target task includes at least one of the following: software upgrade task, configuration task, background task, and power operation task.

[0086] It should be noted that the above modules can be implemented by software or hardware. For the latter, they can be implemented in the following ways, but are not limited to: all the above modules are located in the same processor; or, the above modules are located in different processors in any combination.

[0087] Embodiments of this application also provide a non-volatile computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above method embodiments when it is run.

[0088] In one exemplary embodiment, the aforementioned non-volatile computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as USB flash drives, ROMs, RAMs, portable hard drives, magnetic disks, or optical disks.

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

[0090] In one exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.

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

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

[0093] The embodiments described herein also provide a computer program that includes computer instructions stored in a non-volatile computer-readable storage medium; a processor of a computer device reads the computer instructions from the non-volatile computer-readable storage medium and executes the computer instructions, causing the computer device to perform the steps in any of the above method embodiments.

[0094] The examples in this embodiment can be referred to the examples described in the above embodiments and exemplary implementations, and will not be repeated here.

[0095] Obviously, those skilled in the art should understand that the modules or steps of this application described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. They can be implemented using computer-executable program code, and thus can be stored in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those presented here, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, this application is not limited to any particular combination of hardware and software.

[0096] The above are merely optional embodiments of this application and are not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the principles of this application should be included within the protection scope of this application.

Claims

1. A task execution method, characterized in that, include: When it is necessary to execute a target task through a target thread, the target execution time condition of the target task is obtained, wherein the target execution time condition includes a pre-configured target execution time period for indicating that the target task is allowed to be executed; Based on the target execution time condition, it is determined whether to call the target thread to execute the target task. Specifically, if it is determined that the system time is within the target execution time period, the target thread is called to execute the target task; if it is determined that the system time is not within the target execution time period, a waiting operation is performed until the system time is within the target execution time period, and then the target thread is called to execute the target task.

2. The method according to claim 1, characterized in that, Before obtaining the target execution time conditions of the target task, the method further includes: Receive an execution time condition setting instruction, wherein the execution time condition setting instruction includes one or more execution time conditions; Configure one or more of the aforementioned execution time conditions in the baseboard management controller.

3. The method according to claim 2, characterized in that, Includes at least one of the following: The execution time conditions are the same for different tasks; Different tasks have different execution time requirements; Different task sets have different execution time conditions. A task set includes one or more tasks, and all tasks in the same task set have the same execution time conditions.

4. The method according to claim 2, characterized in that, The receiving execution time condition setting instruction includes: Receive input or time period setting instructions from other devices, wherein the time period setting instructions include a first time period that allows the execution of each task and / or a second time period that disallows the execution of each task; The step of configuring one or more of the execution time conditions in the baseboard management controller includes: The settings are configured in the baseboard management controller according to the time period setting instructions.

5. The method according to claim 1, characterized in that, The method further includes: The system time is determined to be within the target execution time period using the following method: Acquire the target semaphore; If it is determined that there is no target lock file in the baseboard management controller based on the target semaphore, it is determined that the system time is within the target execution time period; If it is determined that a target lock file exists in the baseboard management controller based on the target semaphore, it is determined that the system time is not within the target execution time period.

6. The method according to claim 1, characterized in that, Before obtaining the target execution time conditions of the target task, the method further includes: Configure the association between multiple maintenance locks and multiple tasks; Specifically, for one or more tasks associated with a maintenance lock, whether the execution time conditions of the one or more tasks are currently met is determined based on the state of the maintenance lock, and the state adjustment conditions of different maintenance locks are not exactly the same.

7. The method according to claim 6, characterized in that, Before configuring the association between multiple maintenance locks and multiple tasks, the method further includes: Create the aforementioned multiple maintenance locks; The configuration of the association between multiple maintenance locks and multiple tasks includes: Configure the association between the multiple maintenance locks and the multiple tasks based on the received configuration instructions and / or the default configuration method.

8. The method according to claim 6, characterized in that, The configuration of the association between multiple maintenance locks and multiple tasks includes at least one of the following: Configure a unique association between the plurality of maintenance locks and the plurality of tasks; Configure a one-to-many association between the multiple maintenance locks and the multiple tasks.

9. The method according to claim 6, characterized in that, The method further includes: Configure a corresponding opening time period for each maintenance lock; The opening time periods corresponding to different maintenance locks are not exactly the same. The maintenance lock is in the state of being open during the corresponding opening time period, and the maintenance lock is in the state of being closed during other time periods other than the corresponding opening time period. For one or more tasks associated with a maintenance lock that is currently open, the system time is within the execution time period of the one or more tasks; for one or more tasks associated with a maintenance lock that is currently closed, the system time is not within the execution time period of the one or more tasks.

10. The method according to claim 6, characterized in that, The method further includes: If the difference between the computer system time and the time determined by the counter configured in the baseboard management controller is greater than a predetermined threshold, all maintenance locks will be configured to be closed.

11. The method according to claim 6, characterized in that, The method further includes: Receive adjustment instructions from the maintenance lock; Adjust the configured plurality of maintenance locks according to the adjustment instructions; The adjustment methods include at least one of the following: Delete one or more existing maintenance locks, add one or more new maintenance locks, or adjust the opening time period of one or more existing maintenance locks.

12. The method according to any one of claims 1 to 11, characterized in that, The target task includes at least one of the following: Software upgrade tasks, configuration tasks, background tasks, and power operation tasks.

13. The method according to claim 2, characterized in that, Receive execution time condition setting instructions, including at least one of the following: Receive the execution time condition setting instruction input through the management software interface; Receive the execution time condition setting instruction configured via the command-line tool; Receive the execution time condition setting instruction sent based on the intelligent platform management interface protocol.

14. The method according to claim 5, characterized in that, The existence time of the target lock file is set by at least one of the following methods: The settings are based on the type of device performing the target task and the application scenario; Configure according to the received configuration instructions.

15. The method according to claim 6, characterized in that, Configure the association between multiple maintenance locks and multiple tasks, including at least one of the following: Configure the association relationship between the multiple maintenance locks and the multiple tasks according to the task attributes of each task; Configure the association between the multiple maintenance locks and the multiple tasks according to the execution time of each task.

16. The method according to claim 10, characterized in that, The method further includes: The predetermined threshold is set according to the type of device performing the target task and the application scenario.

17. A baseboard management controller, characterized in that, include: The acquisition module is configured to acquire the target execution time conditions of the target task when it is necessary to execute the target task through the target thread, wherein the target execution time conditions include a pre-configured target execution time period for indicating that the target task is allowed to be executed; The determining module is configured to determine whether to invoke the target thread to execute the target task based on the target execution time condition, wherein, if it is determined that the system time is within the target execution time period, the target thread is invoked to execute the target task; if it is determined that the system time is not within the target execution time period, a waiting operation is performed until the system time is within the target execution time period, and then the target thread is invoked to execute the target task.

18. A non-volatile computer-readable storage medium, characterized in that, The non-volatile computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the method described in any one of claims 1 to 16.

19. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method described in any one of claims 1 to 16.

20. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method described in any one of claims 1 to 16.