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

By obtaining and checking the execution time conditions of the target tasks, ensuring that the tasks are executed under sufficient system resources and conflict-free conditions, the stability problems caused by resource conflicts in the multi-task execution system are solved, and resource utilization and system stability are improved.

CN119149207BActive Publication Date: 2025-03-14INSPUR SUZHOU INTELLIGENT TECH CO LTD

Patent Information

Application Number
CN202411608920.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-12
Publication Date
2025-03-14
Estimated Expiration
2044-11-12

AI Technical Summary

Technical Problem

In a multitasking execution system, the operating system is less stable because multiple tasks may need to access and modify the same resource.

Method used

By obtaining the target execution time conditions of the target task, it is determined whether the system time is within the time period when the task is allowed to be executed. If it is not within this time period, the wait operation is performed until the condition is met, and the target thread is called to execute the target task.

Benefits of technology

Ensure that tasks are executed under appropriate conditions (such as sufficient system resources and conflict-free tasks), avoid task execution conflicts, improve resource utilization, and enhance operating system stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119149207B_ABST
    Figure CN119149207B_ABST
Patent Text Reader

Abstract

An embodiment of the present application provides a task execution method, a baseboard management controller, a storage medium, an electronic device and a computer program product, wherein the method comprises: 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 comprises 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 when it is determined that the system time is within the target execution time period, calling the target thread to execute the target task; when 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.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate 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 Art

[0002] With the increase in processor speed and the emergence of multi-core processors, operating systems can gradually support the simultaneous execution of multiple tasks, significantly improving the CPU utilization efficiency and system response speed. In related technologies, when performing multiple tasks in the system, the operating system has a low stability problem because multiple tasks may need to access and modify the same resources, and server resources may be insufficient when multiple tasks are executed simultaneously. Summary of the invention

[0003] The embodiments of the present application provide 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 the following reasons when performing multiple tasks in the system in the related art: multiple tasks may need to access and modify the same resources, and server resources may be insufficient when multiple tasks are executed simultaneously.

[0004] According to one embodiment of the present application, a task execution method is provided, comprising: in a case where a target task needs to be executed by a target thread, obtaining a target execution time condition for the target task, wherein the target execution time condition includes a preconfigured 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, in a case where it is determined that the system time is within the target execution time period, calling the target thread to execute the target task; in a case where 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.

[0005] In an exemplary embodiment, before obtaining the target execution time condition of the target task, the method also 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 of the execution time conditions in the baseboard management controller.

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

[0007] In an exemplary embodiment, receiving an execution time condition setting instruction includes: receiving a time period setting instruction input or from other devices, wherein the time period setting instruction includes a first time period for allowing execution of each task and / or a second time period for not allowing execution of each task; configuring one or more of the execution time conditions in the baseboard management controller includes: setting them in the baseboard management controller according to the time period setting instruction.

[0008] In an exemplary embodiment, the method also includes: determining whether the system time is within the target execution time period by: obtaining a target semaphore; determining that the system time is within the target execution time period when it is determined based on the target semaphore that there is no target locking file in the baseboard management controller; and determining that the system time is not within the target execution time period when it is determined based on the target semaphore that there is a target locking file in the baseboard management controller.

[0009] In an exemplary embodiment, before obtaining the target execution time condition of the target task, the method also includes: configuring an association relationship between multiple maintenance locks and multiple tasks; wherein, for one or more tasks associated with a maintenance lock, whether the execution time condition of the 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.

[0010] In an exemplary embodiment, before configuring the association relationship between multiple maintenance locks and multiple tasks, the method also includes: creating the multiple maintenance locks; configuring the association relationship between the multiple maintenance locks and the multiple tasks includes: configuring the association relationship between the multiple maintenance locks and the multiple tasks based on the received configuration instructions and / or the default configuration method.

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

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

[0013] In an exemplary embodiment, the method further includes: configuring the status of all maintenance locks to be closed when detecting that 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.

[0014] In an exemplary embodiment, the method further includes: receiving an adjustment instruction for a maintenance lock; adjusting the multiple 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, and adjusting an opening time period of one or more existing maintenance locks.

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

[0016] According to another embodiment of the present application, a baseboard management controller is provided, including: an acquisition module, used to acquire a target execution time condition of the target task when it is necessary to execute the target task through a target thread, wherein the target execution time condition includes a preconfigured target execution time period for indicating that the target task is allowed to be executed; a determination module, used to determine whether to call the target thread to execute the target task based on the target execution time condition, wherein when it is determined that the system time is within the target execution time period, the target thread is called to execute the target task; when 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.

[0017] According to another embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when run.

[0018] According to another embodiment of the present application, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0019] According to another embodiment of the present application, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.

[0020] Through the present application, when it is necessary to execute the target task through the target thread, it is first determined whether the execution conditions of the target task are met, and when the execution conditions of the target task are met, the target thread is called to execute the target task, thereby ensuring that the task is executed under appropriate conditions (for example, sufficient system resources, no conflicting tasks with the current task, etc.). Therefore, it can solve the problem of low operating system stability caused by the need for multiple tasks to access and modify the same resources and insufficient server resources when multiple tasks are executed simultaneously when performing multiple tasks in the system in the related technology, thereby achieving the effect of avoiding task execution conflicts in the system and improving resource utilization. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 It is a hardware structure block diagram of a server device of a task execution method of an embodiment of the fundamental application;

[0022] Figure 2 The process of the task execution method according to the embodiment of the present application is Figure 1 ;

[0023] Figure 3 The process of the task execution method according to the embodiment of the present application is Figure 2 ;

[0024] Figure 4 is a schematic diagram of a task execution method according to an embodiment of the present application;

[0025] Figure 5 It is a structural block diagram of a baseboard management controller according to an embodiment of the present application. DETAILED DESCRIPTION

[0026] The embodiments of the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

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

[0028] The method embodiments provided in the embodiments of the present application can be executed in a server device or a similar computing device. Taking running on a server device as an example, Figure 1 1 is a hardware structure diagram of a server device of a task execution method according to an embodiment of the present invention. Figure 1 As shown, the server device may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the above-mentioned server device may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above server device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0029] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the task execution method in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the server device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0030] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the server device. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0031] In this embodiment, a task execution method is provided. Figure 2 The process of the task execution method according to the embodiment of the present application is Figure 1 ,like Figure 2As shown, the process includes the following steps:

[0032] Step S202, when it is necessary to execute the target task through the target thread, obtaining 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;

[0033] Step S204, determining whether to call the target thread to execute the target task based on the target execution time condition, wherein, when it is determined that the system time is within the target execution time period, calling the target thread to execute the target task; when 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.

[0034] 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 cleaning tasks, resource monitoring tasks, database optimization tasks, etc., and the system time includes but is not limited to being determined by the following methods: determining by checking the system clock through a command line tool, obtaining time information from an NTP server through the Network Time Protocol (NTP), etc.

[0035] Exemplarily, when the target task is a data backup task, the target execution time condition of the data backup task is queried, and it is obtained that the target execution time condition of the data backup task is to be executed from 2:00 to 4:00 a.m. every day. When the current time is within the time period from 2:00 to 4:00 a.m., the target thread is called to execute the data backup task; when the current time is not within the time period from 2:00 to 4:00 a.m., a waiting operation is performed until 2:00 a.m. is reached, and the target thread is called to execute the data backup task.

[0036] Through the above steps, when it is necessary to execute the target task through the target thread, it is first determined whether the execution conditions of the target task are met, and when the execution conditions of the target task are met, the target thread is called to execute the target task, thereby ensuring that the task is executed under appropriate conditions (for example, sufficient system resources, no conflicting tasks with the current task, etc.), solving the problem of low operating system stability caused by the need for multiple tasks to access and modify the same resources and insufficient server resources when multiple tasks are executed simultaneously in the related technology when multiple tasks are executed in the system, thereby avoiding task execution conflicts in the system and improving resource utilization.

[0037] The execution subject of the above steps may be a baseboard management controller, other devices that can achieve similar functions, etc., but is not limited thereto.

[0038] In an optional embodiment, before obtaining the target execution time condition of the target task, the method also 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 of the execution time conditions in the baseboard management controller.

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

[0040] Exemplarily, in combination with a specific example, in the scenario where the target task is a maintenance task, the process of configuring the execution time condition in the baseboard management controller by the user through the front-end configuration software of the baseboard management controller is described in detail below:

[0041] Find the "Firmware and Operating System Software" option in the front-end configuration software of the baseboard management controller; under this option, further click "Maintenance Period" to enter the configuration interface of the maintenance period; on the maintenance period interface, click the "Add" button and do the following: 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 in detail; enter the start and end time of the maintenance period in the Start and End boxes; click Finish to add.

[0042] In an optional embodiment, it includes at least one of the following: the execution time conditions corresponding to different tasks are the same; the execution time conditions corresponding to different tasks are different; the execution time conditions corresponding to different task sets are different, wherein one task set includes one or more tasks, and the execution time conditions corresponding to all tasks included in the same task set are the same.

[0043] In an optional embodiment, receiving an execution time condition setting instruction includes: receiving a time period setting instruction input or from other devices, wherein the time period setting instruction includes a first time period for allowing execution of each task and / or a second time period for not allowing execution of each task; configuring one or more of the execution time conditions in the baseboard management controller includes: setting them in the baseboard management controller according to the time period setting instruction.

[0044] In the above steps, for example, tasks such as log cleaning and system maintenance are only allowed to be executed between 2:00 and 4:00 in the morning and cannot be executed at other times.

[0045] In an optional embodiment, the method also includes: determining whether the system time is within the target execution time period by: obtaining a target semaphore; determining that the system time is within the target execution time period when it is determined based on the target semaphore 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 when it is determined based on the target semaphore that there is a target lock file in the baseboard management controller.

[0046] In the above steps, the existence time of the target lock file can be determined according to the preset setting and the received setting instruction, and the preset setting can be adjusted according to the type of equipment and application scenario. In the above steps, by judging whether the system time is within the target execution time period by whether the target lock file exists in the baseboard management controller, the target task can be managed uniformly, thereby improving the stability of the system.

[0047] In an optional embodiment, before obtaining the target execution time condition of the target task, the method also includes: configuring an association relationship between multiple maintenance locks and multiple tasks; wherein, for one or more tasks associated with a maintenance lock, whether the execution time condition of the 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.

[0048] In the above steps, multiple maintenance locks include but are not limited to: mutual exclusion locks, read-write locks, spin locks, semaphores, custom file locks, etc., and exemplary, the following exemplary description of the association between the configuration maintenance lock and the task is combined with a specific scenario: there are multiple maintenance locks under the maintenance window management center of the baseboard management controller, such as upgrade locks, power operation locks, etc., and the upgrade task is registered under the upgrade lock so that the registered upgrade task can only be executed when the execution time condition corresponding to the upgrade lock is met and the upgrade lock is opened. When the upgrade lock is closed, the upgrade task is in a stopped or blocked state, and the power operation task (for example, open, close, sleep, etc.) is registered under the power lock so that the registered power operation task can only be executed when the execution time condition corresponding to the power lock is met and the power lock is opened. Exemplarily, the corresponding relationship between the task and the maintenance lock includes but is not limited to: determined according to the task attribute (for example, registering the power operation task under the power lock), determined according to the execution time of the task (for example, registering the upgrade task executed in the early morning period to the power lock with the execution time condition of the early morning period), etc.

[0049] In the above steps, by configuring the association relationship between multiple maintenance locks and one or more tasks, and determining whether one or more tasks corresponding to the maintenance locks meet the execution time conditions based on the status of the maintenance locks, it is possible to implement unified execution management of tasks registered under the maintenance locks through multiple maintenance locks, thereby achieving precise control of the execution time of tasks, ensuring that tasks are executed within the scheduled time, improving the accuracy and reliability of task scheduling, and ensuring that tasks are executed when resources are sufficient, avoiding executing tasks when system resources are tight, thereby optimizing resource allocation and utilization effects.

[0050] In an optional embodiment, when a target lock file and multiple maintenance locks exist in the baseboard management controller at the same time, the target lock file includes but is not limited to managing multiple maintenance locks in the following manner: when a target lock file exists, tasks managed by multiple maintenance locks are not executable; when a target lock file does not exist, the execution time conditions of tasks managed by multiple maintenance locks are adjusted by the corresponding maintenance locks.

[0051] In the above steps, by managing the execution of tasks by using target lock files and maintenance lock combinations, fine 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.

[0052] In an optional embodiment, before configuring the association relationship between multiple maintenance locks and multiple tasks, the method also includes: creating the multiple maintenance locks; configuring the association relationship between the multiple maintenance locks and the multiple tasks includes: configuring the association relationship between the multiple maintenance locks and the multiple tasks based on the received configuration instructions and / or the default configuration method.

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

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

[0055] In the above steps, multiple maintenance locks are associated with one or more tasks, and each task is registered only under a unique maintenance lock. Since each task is registered only under a unique maintenance lock, it is possible to avoid the problem of task management conflicts caused by the same task being in the target execution time period under one maintenance lock and in the non-target execution time period under another maintenance lock at the same time.

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

[0057] In an optional embodiment, the method further includes: when it is detected that 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, configuring the status of all maintenance locks to be closed.

[0058] In the above steps, the predetermined threshold includes but is not limited to: 10 minutes, 20 minutes, 1 hour, etc. The predetermined threshold 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 according to the computer system time, and when the difference between the time difference and the remaining time from 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 status of all maintenance locks are configured to be closed.

[0059] 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 the confusion of the computer system time is avoided, thereby improving the security and stability of the system.

[0060] In an optional embodiment, the method further includes: receiving an adjustment instruction for a maintenance lock; adjusting the multiple 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, and adjusting an opening time period of one or more existing maintenance locks.

[0061] In the above steps, the execution time periods of 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.

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

[0063] In an optional embodiment, the target task includes at least one of the following: a software upgrade task, a configuration task, a background task, and a power operation task.

[0064] The scheme of the present invention is described below in conjunction with the overall embodiment:

[0065] Figure 3 The process of the task execution method according to the embodiment of the present application is Figure 2 , Figure 4 is a schematic diagram of a task execution method according to an embodiment of the present application, such as Figure 3 As shown, the process includes the following steps:

[0066] Step S302, after the task thread / process is started, the corresponding task (i.e., the aforementioned target task) is registered to the corresponding maintenance lock according to the rules;

[0067] Step S304: the maintenance lock management center manages each maintenance lock separately. During the non-set maintenance window period, the management center occupies the maintenance lock and prohibits task execution;

[0068] Step S306: During the set maintenance window, the task thread / process maintenance lock executes the target task when the task execution time period of the corresponding target task arrives.

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

[0070] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0071] In this embodiment, a baseboard management controller device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0072] Figure 5 is a structural block diagram of a baseboard management controller according to an embodiment of the present application, such as Figure 5As shown, the baseboard management controller includes: an acquisition module 52, which is used to acquire the target execution time condition of the target task when it is necessary to execute the target task through the target thread, 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; a determination module 54, which is used to determine whether to call the target thread to execute the target task based on the target execution time condition, wherein when it is determined that the system time is within the target execution time period, the target thread is called to execute the target task; when 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.

[0073] In an optional embodiment, the baseboard management controller also includes: a first receiving module, used to receive an execution time condition setting instruction before obtaining the target execution time condition of the target task, wherein the execution time condition setting instruction includes one or more execution time conditions; a first configuration module, used to configure one or more of the execution time conditions in the baseboard management controller.

[0074] In an optional embodiment, it includes at least one of the following: the execution time conditions corresponding to different tasks are the same; the execution time conditions corresponding to different tasks are different; the execution time conditions corresponding to different task sets are different, wherein one task set includes one or more tasks, and the execution time conditions corresponding to all tasks included in the same task set are the same.

[0075] In an optional embodiment, the first receiving module includes: a receiving unit, used to receive a time period setting instruction input or from other devices, wherein the time period setting instruction includes a first time period for allowing execution of each task and / or a second time period for not allowing execution of each task; the first configuration module includes: a first configuration unit, used to make settings in the baseboard management controller according to the time period setting instruction.

[0076] In an optional embodiment, the baseboard management controller also includes: a judgment module, used to judge whether the system time is within the target execution time period by: obtaining a target semaphore; when it is determined based on the target semaphore that there is no target locking file in the baseboard management controller, determining that the system time is within the target execution time period; when it is determined based on the target semaphore that there is a target locking file in the baseboard management controller, determining that the system time is not within the target execution time period.

[0077] In an optional embodiment, the baseboard management controller also includes: a second configuration module, used to configure the association relationship 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 the 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.

[0078] In an optional embodiment, the baseboard management controller also includes: a creation module, used to create the multiple maintenance locks before configuring the association relationship between the multiple maintenance locks and the multiple tasks; the second configuration module includes: a second configuration unit, used to configure the association relationship between the multiple maintenance locks and the multiple tasks based on the received configuration instructions and / or the default configuration method.

[0079] In an optional embodiment, the second configuration module includes at least one of the following: a third configuration unit, used to configure a unique corresponding association relationship between the multiple maintenance locks and the multiple tasks; a fourth configuration unit, used to configure a one-to-many association relationship between the multiple maintenance locks and the multiple tasks.

[0080] In an optional embodiment, the baseboard management controller also includes: a third configuration module, used to configure a corresponding open time period for each maintenance lock; wherein the open time periods corresponding to different maintenance locks are not exactly the same, the state of the maintenance lock in the corresponding open time period is open, and the state of the maintenance lock in time periods other than the corresponding open time period is closed; for one or more tasks associated with the maintenance lock that is currently in an open state, the system time is within the execution time period of the one or more tasks; for one or more tasks associated with the maintenance lock that is currently in a closed state, the system time is not within the execution time period of the one or more tasks.

[0081] In an optional embodiment, the baseboard management controller also includes: a fourth configuration module, which is used to configure the status of all maintenance locks to be closed when it is detected that 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.

[0082] In an optional embodiment, the baseboard management controller also includes: a second receiving module for receiving an adjustment instruction of the maintenance lock; an adjustment module for adjusting the multiple 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, and adjusting the opening time period of one or more existing maintenance locks.

[0083] In an optional embodiment, the target task includes at least one of the following: a software upgrade task, a configuration task, a background task, and a power operation task.

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

[0085] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.

[0086] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0087] An embodiment of the present application further provides an electronic device, 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 execute the steps in any one of the above method embodiments.

[0088] In an 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.

[0089] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any one of the above method embodiments are implemented.

[0090] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.

[0091] The embodiments of the present application also provide a computer program, which includes computer instructions stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps of any one of the above method embodiments.

[0092] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.

[0093] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.

[0094] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principles of the present application shall be included in the protection scope of the present application.

Claims

1. A task execution method, characterized in that: include: In the case where the target task needs to be executed through the target thread, obtaining a 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; 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, calling the target thread 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; Wherein, whether the system time is within the target execution time period is determined in the following manner: a target semaphore is obtained; when it is determined based on the target semaphore that there is no target locking file in the baseboard management controller, it is determined that the system time is within the target execution time period; when it is determined based on the target semaphore that there is a target locking file in the baseboard management controller, it is determined that the system time is not within the target execution time period.

2. The method according to claim 1, characterized in that Before obtaining the target execution time condition of 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; One or more of the execution time conditions are configured in a baseboard management controller.

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

4. The method according to claim 2, characterized in that: The receiving of the execution time condition setting instruction comprises: Receiving a time period setting instruction inputted or from another device, wherein the time period setting instruction includes a first time period for allowing execution of each task and / or a second time period for not allowing execution of each task; The configuring one or more of the execution time conditions in the baseboard management controller includes: The time period setting instruction is used to set the time period in the baseboard management controller.

5. The method according to claim 1, characterized in that Before obtaining the target execution time condition of the target task, the method further includes: Configure the association between multiple maintenance locks and multiple tasks; Among them, 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.

6. The method according to claim 5, characterized in that Before configuring the association relationship between the plurality of maintenance locks and the plurality of tasks, the method further includes: creating the plurality of maintenance locks; The configuration of the association relationship between the plurality of maintenance locks and the plurality of tasks includes: The association relationship between the plurality of maintenance locks and the plurality of tasks is configured based on the received configuration instruction and / or the default configuration mode.

7. The method according to claim 5, characterized in that The configuring of the association relationship between the plurality of maintenance locks and the plurality of tasks includes at least one of the following: Configuring unique corresponding association relationships between the plurality of maintenance locks and the plurality of tasks; A one-to-many association relationship is configured between the plurality of maintenance locks and the plurality of tasks.

8. The method according to claim 5, characterized in that The method further comprises: Configure the corresponding opening time period for each maintenance lock; The opening time periods corresponding to different maintenance locks are not completely the same. The state of the maintenance lock in the corresponding opening time period is open, and the state of the maintenance lock in other time periods except the corresponding opening time period is closed; For one or more tasks associated with a maintenance lock that is currently in an open state, 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 in a closed state, the system time is not within the execution time period of the one or more tasks.

9. The method according to claim 5, characterized in that The method further comprises: When it is detected that 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, the states of all maintenance locks are configured to be closed.

10. The method according to claim 5, characterized in that The method further comprises: Receive adjustment instructions for maintenance locks; Adjusting the configured multiple maintenance locks according to the adjustment instruction; The adjustment method includes at least one of the following: Delete one or more existing maintenance locks, add one or more new maintenance locks, and adjust the opening time period of one or more existing maintenance locks.

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

12. A baseboard management controller, characterized in that: include: an acquisition module, configured to acquire a target execution time condition of the target task when a target task needs to be executed through a target thread, 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; a determination module, configured to determine 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, 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; Among them, the baseboard management controller also includes a judgment module, which is used to judge whether the system time is within the target execution time period in the following manner: obtaining a target semaphore; when it is determined based on the target semaphore that there is no target locking file in the baseboard management controller, determining that the system time is within the target execution time period; when it is determined based on the target semaphore that there is a target locking file in the baseboard management controller, determining that the system time is not within the target execution time period.

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

14. 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, the steps of the method described in any one of claims 1 to 11 are implemented.

15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method described in any one of claims 1 to 11 are implemented.

Citation Information

Patent Citations

  • Task processing method and device based on threads, electronic equipment and storage medium

    CN116166435A

  • Scheduling system and method for batch task arrangement

    CN118502908A

Cited By

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

    EP4797094A1