Business execution method and management controller
By introducing business execution methods into OpenBMC and utilizing status flags and cache queue mechanisms, the signal storm problem caused by frequent IPMB access was solved, enabling the orderly serial execution of business processes and improving the system's stability and responsiveness.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- INSPUR SUZHOU INTELLIGENT TECH CO LTD
- Filing Date
- 2026-01-22
- Publication Date
- 2026-04-24
AI Technical Summary
When frequent IPMB access causes a surge in the number of signals, the OpenBMC service unit remains in the "receive signal → wake up → prepare to process" state, unable to enter the actual business logic execution stage, resulting in service "freezing" or response delay.
A business execution method is introduced. By identifying the business execution status flag, newly arrived business trigger signals are temporarily stored in a preset cache queue. The preset cache queue is accessed according to the target round-robin cycle to achieve orderly serial execution of events and avoid the impact of signal storms on business execution.
It effectively mitigated the impact of signal storms on business execution, reduced CPU utilization and context switching overhead, and improved the timeliness of task execution and system stability.
Smart Images

Figure CN121579244B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of event handling technology, and more particularly to business execution methods and management controllers. Background Technology
[0002] OpenBMC (Open Baseboard Management Controller) is an open-source baseboard management controller firmware widely used for remote server monitoring and management. Its internal components communicate via the DBus message bus, supporting mechanisms such as service discovery and interface addition / removal notifications.
[0003] In related technologies, when an external manager accesses OpenBMC via IPMB (Intelligent Platform Management Bus / Bridge), OpenBMC creates and destroys a session for each access, thereby triggering the InterfaceAdded and InterfaceRemoved signals on DBus. Service units within OpenBMC listen for the InterfaceAdded signal to execute subsequent business actions. However, when frequent IPMB access causes a surge in the number of signals, the service unit will remain in a state of "receiving signals → waking up → preparing to process," unable to enter the actual business logic execution stage, resulting in service "freezing" or response delays. Summary of the Invention
[0004] This application provides a business execution method and management controller to at least solve the problem in related technologies where, when frequent IPMB access leads to a surge in the number of signals, the service unit remains in the state of "receiving signals → waking up → preparing to process," unable to enter the actual business logic execution stage, resulting in service "freezing" or response delay.
[0005] This application provides a business execution method applied to a service unit in a management controller. The management controller also includes a message bus, and the service unit is connected to the message bus. The method includes: in response to a business trigger signal transmitted by the message bus, identifying a business execution status flag; when the business execution status flag is a first identifier, adding the business trigger signal to a preset cache queue, accessing the preset cache queue based on a target round-robin period, and sequentially executing the business processes corresponding to the business trigger signals in the preset cache queue; when the business execution status flag is a second identifier, executing the business processes corresponding to the business trigger signals according to the cache status of the preset cache queue, or adding the business trigger signal to the preset cache queue, accessing the preset cache queue based on a target round-robin period, and sequentially executing the business processes corresponding to the business trigger signals in the preset cache queue.
[0006] This application also provides a management controller, including: a message bus; at least one service unit, wherein the at least one service unit is respectively connected to the message bus and configured to implement the steps of any of the above-described business execution methods.
[0007] This application addresses the issue that upon receiving a service trigger signal from the message bus, the service unit is determined to be executing a service when the service execution status flag is identified as the first identifier. At this point, newly arriving service trigger signals are temporarily stored in a preset cache queue, and the preset cache queue is accessed according to a target round-robin cycle. When the service execution status flag is the second identifier, the service process corresponding to the service trigger signal is executed based on the cache status of the preset cache queue, or the service trigger signal is added to the preset cache queue. The preset cache queue is accessed based on the target round-robin cycle, and the service processes corresponding to the service trigger signals in the preset cache queue are executed sequentially. That is, after the current task is completed, the next service trigger signal is automatically retrieved from the preset cache queue for further processing. This achieves ordered serial execution of events, ensuring the integrity of the service process. Therefore, it solves the technical problem in related technologies where frequent IPMB access leads to a surge in the number of signals, causing the service unit to remain in a state of "receiving signals → waking up → preparing to process," unable to enter the actual business logic execution stage, resulting in service "freezing" or response delays. This achieves the technical effect of effectively mitigating the impact of signal storms on service execution without changing the DBus communication model. Attached Figure Description
[0008] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0009] Figure 1 A connection diagram of a management controller provided in one embodiment of this application;
[0010] Figure 2 A flowchart of a business execution method provided in an embodiment of this application;
[0011] Figure 3 A flowchart illustrating a business execution method provided in one embodiment of this application;
[0012] Figure 4 This is a schematic diagram illustrating the implementation of a service execution process based on a service trigger signal, as provided in one embodiment of this application. Detailed Implementation
[0013] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.
[0014] It should be noted that, in the description of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.
[0015] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0016] In practical applications, OpenBMC communicates with external devices (such as server systems and external monitoring devices) through the IPMB channel. OpenBMC's internal components communicate via the DBus message bus, supporting mechanisms such as service discovery and interface addition / removal notifications.
[0017] In other words, the OpenBMC management system uses an event-driven mechanism based on DBus signals to achieve communication and state synchronization between components. For example, when accessing devices on the BMC (such as FRUs (Field Replaceable Units), sensors, etc.) through the IPMB channel, the BMC creates and destroys a session for each access. This process triggers the broadcast of the InterfaceAdded and InterfaceRemoved signals on the DBus bus.
[0018] In related technologies, a key service unit in OpenBMC (such as the device status synchronization service) listens for the InterfaceAdded signal to detect new device connections and immediately executes subsequent business logic, such as reading device information, updating the status database, or reporting alarms. This service typically listens for the DBus signal using a periodic polling method, with the polling period generally set to 5 seconds, meaning it checks for new signals every 5 seconds.
[0019] However, the above technology has the following drawbacks:
[0020] 1. High response latency, unable to adapt to high-frequency events.
[0021] Because the listening period is as long as 5 seconds, when the IPMB channel is accessed frequently (e.g., once per second), a large number of InterfaceAdded signals will be generated in a short period of time. The service may miss multiple events between two polls, resulting in event backlog and a significant increase in response latency.
[0022] 2. It can easily trigger a "signal storm" that can cause service congestion.
[0023] Frequent session creation / destruction leads to a surge in the number of DBus signals. The listening service is repeatedly woken up in a short period of time, continuously in the state of "receiving signals → waking up → preparing to process", unable to enter the actual business logic execution stage, causing the service to "freeze" or waste resources.
[0024] 3. Lack of execution state control can easily lead to concurrent conflicts.
[0025] The existing solution does not determine whether a business action is currently being performed. Even if the previous action has not been completed, a new process will still be attempted to be started upon the arrival of a new signal, which may lead to resource contention, data inconsistency, or system anomalies.
[0026] 4. Low resource utilization and abnormally high CPU (Central Processing Unit) load.
[0027] The service unit spends a long time receiving signals and switching contexts instead of performing effective business, which leads to increased CPU utilization and affects the overall stability and energy efficiency of the system.
[0028] Based on the above analysis, it is evident that with the aforementioned technical solution, when frequent IPMB access leads to a surge in signal count, the service unit will remain in a state of "receiving signals → waking up → preparing to process," unable to enter the actual business logic execution phase. This results in: service "freezing" or response delays, wasted CPU resources on signal transmission and reception, and the inability to execute critical business logic in a timely manner. Therefore, a mechanism is urgently needed to effectively mitigate the impact of signal storms on the service without altering the DBus communication model.
[0029] Therefore, embodiments of this application provide a business execution method, which will be described in detail below in conjunction with the execution flow of the business execution method.
[0030] In one embodiment of this application, the service execution method is applied to a service unit in a management controller, the management controller further including a message bus, and the service unit is connected to the message bus.
[0031] Specifically, in combination Figure 1As shown, the management controller 100 may include at least one service unit 110, each service unit 110 being connected to a message bus for signal transmission and reception. Taking the management controller 100 as a baseboard management controller as an example, the service units 110 within the baseboard management controller may be device status synchronization service units, monitoring service units, etc. The message bus is a DBus bus. When an external device accesses a device (such as an FRU, sensor, etc.) on the baseboard management controller through the IPMB channel, the baseboard management controller creates and destroys a session for each access. This process triggers broadcast service trigger signals such as the InterfaceAdded signal and InterfaceRemoved signal on the DBus bus. The service unit 110 connected to the DBus bus listens to the signals transmitted on the DBus bus and identifies the service trigger signal corresponding to the service function of the service unit.
[0032] Figure 2 This is a flowchart of a business execution method provided in an embodiment of this application.
[0033] Combination Figure 2 As shown, the business execution method of this application embodiment may include the following steps:
[0034] S1, responding to the service trigger signal transmitted by the message bus, identifies the service execution status flag bit.
[0035] In other words, the service unit connected to the message bus listens to the transmitted signals on the message bus, and when it hears a service trigger signal corresponding to the service unit's business function, it responds to the service trigger signal and identifies its own business execution status flag, and introduces an execution status lock mechanism through the business execution status flag.
[0036] Taking a service unit as a listening service as an example, a business execution status flag (such as is_processing) is set in the listening service to indicate whether the current service unit is executing a certain business action. When the business execution status flag is true (first flag), it is determined that the service unit is in the process of business execution; when the business execution status flag is false (second flag), it is determined that the service unit is in an idle state machine and is not executing business.
[0037] S2, when the business execution status flag is the first identifier, add the business trigger signal to the preset cache queue, access the preset cache queue based on the target round-robin cycle, and execute the business process corresponding to the business trigger signal in the preset cache queue in sequence.
[0038] For example, when the listening service unit receives the InterfaceAdded signal, which is the service trigger signal, it determines the current flag of the service execution status, is_processing. If is_processing == false, the service action is started immediately, and the service execution status flag is_processing == true is set. If is_processing == true, the service trigger signal is temporarily stored in the preset cache unit, and the new action is not started immediately.
[0039] A pre-defined buffer queue is used as a signal buffer queue to temporarily store unprocessed business trigger signals and prevent signal loss. For example, a FIFO (First In, First Out) queue (such as GQueue (Glib Queue)) can be used as the pre-defined buffer queue. Thus, mutual exclusion control for task execution is implemented, i.e., an "in-process state lock" is introduced to determine if any task is currently executing. If so, new signals are not immediately responded to; the next event is processed only after the current task is completed, preventing task backlog and contention.
[0040] The target polling period is the time interval for reading signals from the preset cache queue. It must meet the unit time requirement for the execution of any service in this service unit. The specific time interval can be set according to the actual situation, such as 5 seconds or 500ms. When the target polling period is 500ms, a service trigger signal to be processed is retrieved from the preset cache queue every time the 500ms timer is triggered.
[0041] In other words, when a new service trigger signal is received from the message bus, the service execution status flag is_processing is identified. If the service execution status flag is_processing == true, it means that the current service unit is executing a service. The newly received service trigger signal is then added to the preset buffer queue for subsequent processing.
[0042] After the current business action is completed, the business execution status flag is cleared (is_processing == false). Simultaneously, a pending business trigger signal is read from the preset cache queue according to the target round-robin cycle. The business process corresponding to the temporarily stored business trigger signal is executed, and this process is repeated sequentially. This serializes the processing of high-frequency DBus signals, preventing the service unit from falling into an infinite loop of "receiving signals but not performing any work."
[0043] S3, when the business execution status flag is the second identifier, execute the business process corresponding to the business trigger signal according to the cache status of the preset cache queue, or add the business trigger signal to the preset cache queue, so as to access the preset cache queue based on the target round-robin period and sequentially execute the business process corresponding to the business trigger signal in the preset cache queue.
[0044] Specifically, continuing with the example of the business execution status flag being is_processing, is_processing == true when the service unit is executing a business (i.e., the business execution status flag is the first flag), and is_processing == false when the service unit is not executing a business (i.e., the business execution status flag is the second flag).
[0045] When a service unit receives a new service trigger signal from the message bus, it identifies the service execution status flag is_processing. If the service execution status flag is_processing == true, it means that the current service unit is executing a service. The newly received service trigger signal is then added to a preset buffer queue for further processing.
[0046] If the service execution status flag is_processing == false, it means that the current service unit is not executing any service. Since the service execution status flag is_processing represents the real-time service execution status of the service unit, during service execution, the service execution status flag is_processing == true. After the current service execution is completed, the service execution status flag will switch to the second flag, i.e., is_processing == false.
[0047] Based on the above requirements for setting the target polling cycle, it is known that the target polling cycle time satisfies the time requirement for the execution of any business within the service unit. Therefore, the business execution status flag `is_processing == false` corresponds to the following two cases:
[0048] One scenario involves a service unit waiting for a new business trigger signal to trigger the business process when there is no temporary business trigger signal in the preset cache queue.
[0049] Another approach involves storing temporary business trigger signals in a pre-defined cache queue. After completing the previous business process, the service unit waits for the timer to reach the target polling cycle. When the timer reaches the target polling cycle, it retrieves a temporary business trigger signal from the pre-defined cache queue to trigger the corresponding business process.
[0050] Therefore, to avoid business process conflicts, when the business execution status flag is_processing==false, it is necessary to identify the cache status of the preset cache queue. Then, the cache status of the preset cache queue determines whether to directly execute the business process corresponding to the business trigger signal, or to add the business trigger signal to the preset cache queue. This is done by accessing the preset cache queue based on the target round-robin cycle and sequentially executing the business processes corresponding to the business trigger signals in the preset cache queue. For example, the signal priority of signals stored in the preset cache queue and the signal priority of the newly received business trigger signal can be combined to determine whether to execute directly or temporarily store the signal.
[0051] This embodiment introduces an execution status judgment mechanism. An execution status flag is set in the service unit to indicate whether business logic is currently being executed. Upon receiving a new signal, this status is checked first to ensure that only one task is processed at a time, preventing concurrent execution from causing system resource contention or anomalies. On the other hand, signal caching and serialization processing are added. When the service unit is in the execution state, newly arriving business trigger signals are temporarily stored in a preset cache queue. After the current task is completed, the next signal is automatically retrieved from the queue for further processing, achieving ordered serialized execution of events and ensuring the integrity of the business process.
[0052] In some embodiments of this application, executing the business process corresponding to the business trigger signal according to the cache status of the preset cache queue, or adding the business trigger signal to the preset cache queue to access the preset cache queue based on the target round-robin period, includes: obtaining the cache status of the preset cache queue; when the preset cache queue is determined to be an empty queue according to the cache status, executing the business process corresponding to the business trigger signal, and switching the business execution status flag from the second flag to the first flag; when the preset cache queue is determined to be a non-empty queue according to the cache status, adding the business trigger signal to the preset cache queue.
[0053] Specifically, to avoid business process conflicts, when the business execution status flag is_processing==false, the cache status of the preset cache queue needs to be identified. If the preset cache queue is identified as empty based on the cache status, and there are no pending business trigger signals, then the business trigger signal is directly added to the pending business queue, and the corresponding business process is executed in response to the business request of the business trigger signal. If the preset cache queue is identified as non-empty based on the cache status, that is, there are pending business trigger signals in the preset cache queue, then the newly received business trigger signals need to be added to the preset cache queue for queuing and temporary storage, and the business is waited for to be executed in response to the method of accessing the preset cache queue according to the target round-robin cycle, thus realizing a "serialized" business execution control strategy.
[0054] In this embodiment, when the service unit is not executing a service when the service execution status flag indicates that the service unit is not executing a service, the newly received service trigger signal is processed according to the cache status of the preset cache queue to ensure that the service unit only processes one task at a time, thereby preventing concurrent execution from causing system resource contention or abnormalities.
[0055] In some embodiments of this application, a preset cache queue is accessed based on a target polling period to sequentially execute the business processes corresponding to the business trigger signals in the preset cache queue, including: obtaining the actual polling interval duration; when the actual polling interval duration reaches the target polling period, accessing the preset cache queue, adding the first business trigger signal in the preset cache queue to the business processing list to execute the business process corresponding to the first business trigger signal, and resetting the actual polling interval duration to zero, wherein the target polling period is greater than the single business execution requirement cycle corresponding to the service unit.
[0056] Specifically, a high-precision timer (such as libev or sd-event) is used to time the actual polling interval to drive the event loop and ensure response to business trigger signals.
[0057] When a service unit executes a business process corresponding to a business trigger signal, it adds the business trigger signal to the business processing list to trigger the corresponding business process. Therefore, the actual polling interval can start timing after the service unit adds a business trigger signal to the business processing list. When the timing reaches the target polling cycle, it checks whether the preset cache queue is empty. If it is not empty, it adds the first business trigger signal in the preset cache queue to the business processing list, executes the business process corresponding to the first business trigger signal, and resets the actual polling interval to zero.
[0058] If the preset cache queue is empty, meaning all temporary business trigger signals have been completed, the actual polling interval will be cleared and the timing will restart, and this cycle will continue.
[0059] This embodiment accesses the preset cache queue sequentially according to the actual polling interval, realizing the orderly serial execution of events, improving the efficiency of business execution, and ensuring the integrity of business processes.
[0060] In some embodiments of this application, before adding the service trigger signal to the preset cache queue, the service execution method further includes: obtaining the service priority of the service trigger signal, determining the target cache position in the preset cache queue based on the service priority, and adding the service trigger signal to the target cache position. Therefore, high-priority service processes can be processed first during service execution.
[0061] Specifically, the service priority of the service trigger signal can be compared with the service priority of the service trigger signals in the preset cache queue, and the target cache bit in the preset cache queue can be determined based on the comparison result.
[0062] In some embodiments of this application, when the service execution status flag is a first identifier, the service execution method further includes: identifying the service priority of the service trigger signal; marking the service trigger signal as a retry when the service priority is higher than or equal to the target priority, and executing the service process corresponding to the service trigger signal based on the retry mark when the service execution status flag is switched from the first identifier to the second identifier; and adding the service trigger signal to a preset cache queue when the service priority is not the target priority.
[0063] Specifically, service priorities can be set based on parameters such as the triggering external device, event type, and urgency level of the service trigger signal. The service trigger signal includes flag bits used to identify service priorities, for example, using 1, 2, 3, and 4 to represent service priorities. When a service unit detects a service trigger signal from the message bus, it identifies the priority flag bits of the service trigger signal to obtain the corresponding service priority.
[0064] The target priority can be set according to the actual situation. For example, if the business priority is divided into 1, 2, 3, 4 in order from high to low, then the target priority can be the first priority, the second priority, etc.
[0065] Continuing with the business execution status flag as is_processing, when the service unit is executing a business, is_processing == true (i.e., the business execution status flag is the first flag), and when the service unit is not executing a business, is_processing == false (i.e., the business execution status flag is the second flag), taking the target priority as the first priority as an example.
[0066] When a service unit receives a new service trigger signal from the message bus, it identifies the service execution status flag is_processing. If the service execution status flag is_processing == true, it indicates that the service unit is currently executing a service, and at this time, the service priority of the service trigger signal is identified.
[0067] Taking a target business priority of 1 as an example, if the business priority of the business trigger signal is also at level 1, and this priority equals the target business priority, then the business execution priority is considered high and needs to be executed as soon as possible. In this case, the business trigger signal is marked for retry. Specifically, the business execution status flag `is_processing` is identified according to a preset duration. When the `is_processing` flag changes from the first flag to the second flag (i.e., `is_processing == false`), the business trigger signal is directly added to the business processing list, and the corresponding business process is executed first. Furthermore, to avoid business conflicts, when the `is_processing` flag changes from the first flag to the second flag, it can be checked whether a business trigger signal with a retry flag exists. If it does, the business trigger signal with the retry flag is added to the business processing list first, and the corresponding business process is executed. If it does not exist, the preset cache queue is accessed when the polling interval reaches the target polling cycle, or if the preset cache queue is empty, a new business trigger signal is awaited. If the service priority of the service trigger signal is not level 1, that is, the service priority is lower than the target service priority, the service trigger signal will be added to the preset cache queue and await further processing.
[0068] Upon receiving a new service trigger signal, if the service unit is currently executing a service, this embodiment further identifies the service priority of the service trigger signal and performs different waiting processes based on the service priority. Specifically, if the service priority of the service trigger signal has not reached the target priority, it is temporarily stored in a preset cache queue and processed sequentially based on the target round-robin cycle. If the service priority of the service trigger signal reaches the target priority, a retry flag is set. After the current service is completed, the retry flagged service trigger signal is executed first to optimize the time management of service execution, improve service execution efficiency, and ensure the priority completion of critical tasks.
[0069] In some embodiments of this application, the service process corresponding to the service trigger signal based on the retry flag includes: identifying the existence of retry flags and determining the number of retry flag signals based on the existence of retry flags; when there are multiple retry flag signals, obtaining the flag timestamp of the service trigger signal with the retry flag; determining one of the multiple service trigger signals with the retry flag as the target service trigger signal according to the flag timestamp, adding the service trigger signal to the service processing list, and resetting the actual polling interval duration; when there is only one retry flag signal, adding the service trigger signal with the retry flag to the service processing list, and resetting the actual polling interval duration.
[0070] In other words, when a service unit receives a new service trigger signal from the message bus, the service execution status flag is set to the first identifier, and the service priority of the service trigger signal is the target priority, the service trigger signal is marked for retry.
[0071] After the current service is completed, the service execution status flag is switched from the first flag to the second flag. At this time, the number of service trigger signals that are marked for retry is identified by the service unit, that is, the retry flag status is identified.
[0072] If multiple service trigger signals with retry flags exist, the timestamp of the retry flag for each signal is identified. The service trigger signal that completes its retry flag earliest is added to the service processing list to execute the corresponding business process, thereby avoiding business execution conflicts. If only one service trigger signal with a retry flag exists, then that service trigger signal is directly added to the service processing list.
[0073] In the presence of multiple service trigger signals with retry flags, this embodiment determines the next service process to be executed based on the timestamps of the flags corresponding to the multiple service trigger signals, thereby avoiding service execution conflicts.
[0074] In some embodiments of this application, the service execution method further includes: when the service execution status flag is switched from the first identifier to the second identifier, accessing a preset cache queue, adding the first service trigger signal in the preset cache queue to the service processing list, executing the service process corresponding to the first service trigger signal, and resetting the actual polling interval duration to zero.
[0075] In other words, after the current business process is completed, the business execution status flag is switched from the first flag to the second flag, indicating that the service unit has entered an idle state. At this time, even if the actual polling interval has not yet reached the target polling cycle, the first business trigger signal in the preset cache queue can be directly added to the business processing list, and the actual polling interval can be reset to zero to improve business execution efficiency.
[0076] In some embodiments of this application, the service execution method further includes: collecting historical signal transmission data of the message bus before the current time based on a preset time window; identifying the service trigger frequency corresponding to the service unit based on the historical signal transmission data; and determining the target polling cycle based on the service trigger frequency, wherein the target polling cycle is negatively correlated with the service trigger frequency.
[0077] Specifically, the preset time window can be set according to the actual situation, such as setting the preset time window to 1 minute, 5 minutes, etc., to obtain historical signal transmission data before the current moment.
[0078] Assuming a preset time window of 5 minutes, the service trigger frequency is calculated based on historical signal transmission data collected in the previous 5 minutes. The target polling cycle is then determined in real time based on the service trigger frequency to meet the service processing needs in different scenarios. Specifically, when the service trigger frequency is high, the target polling cycle can be shortened to ensure a rapid response to service trigger signals, avoid a large backlog of events, and improve the real-time response of events. When the service trigger frequency is low, the target polling cycle can be extended to release resources and improve the rationality of resource allocation.
[0079] In some embodiments of this application, determining the target polling cycle based on the service triggering frequency includes: determining the target polling cycle as the first polling cycle when the service triggering frequency is less than a preset frequency; and determining the target polling cycle as the second polling cycle when the service triggering frequency is greater than or equal to the preset frequency, wherein the second polling cycle is less than the first polling cycle.
[0080] Specifically, the preset frequency can be set according to the actual situation to distinguish whether it is triggered by high-frequency business, that is, whether it is a high-frequency access scenario.
[0081] Taking a first polling cycle of 5 seconds and a second polling cycle of 500ms as an example, when the service trigger frequency is less than the preset frequency, it is determined to be a low-frequency access scenario, and the target polling cycle is 5 seconds. When the service trigger frequency is greater than or equal to the preset frequency, it is determined to be a high-frequency access scenario, and the target polling cycle is adjusted to 500ms. Specifically, a high-precision timer can be used to drive the event loop to ensure a fast response to the DBus signal and avoid event backlog.
[0082] This embodiment uses a preset frequency as the evaluation standard to select either the first or second round of polling as the target polling cycle. When the frequency of business triggering is detected to reach the preset frequency, the first round of polling is adjusted to the second round of polling, which shortens the polling cycle. This improves the timeliness of response to events such as InterfaceAdded, avoids event backlog or delayed processing due to excessively long cycles, improves the reaction speed of cycle adjustment, and reduces resource requirements.
[0083] In some embodiments of this application, determining the target polling cycle based on the service triggering frequency includes: determining a preset relationship based on the service execution parameters of the service unit; and determining the target polling cycle based on the service triggering frequency and the preset relationship, wherein the preset relationship is used to characterize the mapping relationship between the target polling cycle and the service triggering frequency.
[0084] Specifically, the service unit's business execution parameters may include parameters such as the maximum demand cycle for a single business execution, business type, and business level. The mapping between the service unit's business execution parameters and preset relationships can be pre-set, assigning corresponding preset relationships to different service units to improve the accuracy of cycle adjustments. Preset relationships can be in the form of tables, calculation formulas, etc., with no specific restrictions.
[0085] For example, when the preset relationship is in tabular form, the mapping between different business trigger frequency ranges and target round-robin periods can be defined. During application, the business trigger frequency range in which the actual calculated business trigger frequency falls is obtained, and the corresponding target round-robin period is obtained through table retrieval. When the preset relationship is in formula form, the preset relationship needs to define the upper and lower limits of the target round-robin period. Then, the actual calculated business trigger frequency is substituted into the formula to calculate the corresponding round-robin period. It can be understood that the lower limit of the target round-robin period should be greater than the maximum demand period for a single business execution in this service unit.
[0086] This embodiment determines the target polling cycle in real time based on the preset relationship corresponding to the service unit, so as to improve the accuracy of the polling cycle setting.
[0087] As a specific embodiment of this application, taking the management controller as the baseboard management controller and the message bus as the DBus bus as an example, such as... Figure 3 As shown, the business execution method may include the following steps:
[0088] S101 receives the service trigger signal transmitted by the message bus, identifies the service execution status flag, and determines the target polling cycle based on the service trigger frequency corresponding to the current time.
[0089] In other words, the service unit connected to the message bus listens to the transmitted signals on the message bus, and when it hears a service trigger signal corresponding to the service unit's business function, it responds to the service trigger signal, identifies its own business execution status flag, calculates the service trigger frequency based on the historical signal transmission data acquired before the current moment, and adjusts the polling cycle in real time according to the service trigger frequency.
[0090] For example, when the service trigger frequency is less than the preset frequency, it is determined to be a low-frequency access scenario, and the target polling period is set to 5 seconds. When the service trigger frequency is greater than or equal to the preset frequency, it is determined to be a high-frequency access scenario, and the target polling period is adjusted to 500ms. Specifically, a high-precision timer can be used to drive the event loop to ensure a fast response to the DBus signal and avoid event backlog. Thus, when the service trigger frequency is high, shortening the target polling period ensures a fast response to the service trigger signal, avoids event backlog, and improves the real-time response of events; when the service trigger frequency is low, extending the target polling period can release resources and improve the rationality of resource allocation.
[0091] S102, determine whether the business execution status flag is the first flag. If yes, proceed to step S103; otherwise, proceed to step S107.
[0092] For example, the business execution status flag is 'is_processing', which is used to indicate whether the current service unit is executing a certain business action. When the business execution status flag is_processing == true (first flag), it is determined that the service unit is in the process of business execution; when the business execution status flag is_processing == false (second flag), it is determined that the service unit is in an idle state machine and is not executing any business.
[0093] S103, Obtain the service execution priority of the service trigger signal.
[0094] S104. Determine whether the business execution priority is higher than or equal to the target priority. If yes, proceed to step S105; otherwise, proceed to step S106.
[0095] In other words, if the service priority of the service trigger signal is higher than or equal to the target priority, the service execution priority is considered high and needs to be executed as soon as possible. Therefore, step S105 is executed, and the service trigger signal is marked for retry. When the service execution status flag changes from the first flag to the second flag, the service trigger signal is directly added to the service processing list, and the corresponding service process is executed first. If the service priority of the service trigger signal is lower than the target priority, the service trigger signal is added to the preset cache queue, and step S106 is executed. This optimizes the time management of service execution, improves service execution efficiency, and ensures the priority completion of critical tasks. S105: The service trigger signal is marked for retry, and when the service execution status flag changes from the first flag to the second flag, the service process corresponding to the service trigger signal is executed based on the retry mark.
[0096] S106, add the business trigger signal to the preset cache queue, access the preset cache queue based on the target round-robin period, and execute the business process corresponding to the business trigger signal in the preset cache queue in sequence.
[0097] In other words, by sequentially accessing the preset cache queue according to the target polling cycle, the orderly serial execution of events is achieved, which improves the stability of business execution and ensures the integrity of the business process.
[0098] S107. Determine if the preset cache queue is empty. If yes, proceed to step S108; otherwise, proceed to step S106.
[0099] In other words, to avoid business process conflicts, when the business execution status flag is_processing==false, it is necessary to identify the cache status of the preset cache queue. If the preset cache queue is identified as an empty queue based on the cache status, and there is no business trigger signal to be executed temporarily, then the business trigger signal is directly added to the pending business queue. In response to the business request of the business trigger signal, the corresponding business process is executed, that is, step S108 is executed.
[0100] If the preset cache queue is identified as a non-empty queue based on the cache status, that is, there are service trigger signals to be executed in the preset cache queue, then the newly received service trigger signals need to be added to the preset cache queue for queuing and temporary storage. In response to the method of accessing the preset cache queue according to the target round-robin cycle, wait for the service to be executed, and realize the "serialized" service execution control strategy, that is, execute step S106.
[0101] S108, execute the business process corresponding to the business trigger signal, and switch the business execution status flag from the second flag to the first flag. Additionally, a single business execution method based on a business trigger signal can be as follows: Figure 4 As shown.
[0102] This embodiment proposes a two-layer protection mechanism for the business execution of service units, as detailed below:
[0103] 1. Signal reception throttling: The frequency at which the service unit processes service trigger signals is actively reduced from the default high frequency (e.g., once every 5 seconds) to a controllable period (e.g., 500ms).
[0104] 2. Task execution mutual exclusion control: Introduce an "in-process state lock" to determine if there is a task currently being executed; if so, new signals will not be responded to immediately, and the next event will be processed only after the current task is completed, to prevent task backlog and contention.
[0105] Therefore, this embodiment can have the following technical effects:
[0106] 1. Effectively alleviates the DBus signal storm problem caused by frequent IPMB access;
[0107] 2. Significantly reduces service CPU utilization and context switching overhead;
[0108] 3. Prevent service units from being unable to start business execution due to being busy sending and receiving signals, thereby improving the timeliness and reliability of task execution;
[0109] 4. Improve the stability and responsiveness of the OpenBMC system under high-load management scenarios.
[0110] Understandably, the above solution, in addition to resolving the DBus signal storm issue caused by frequent IPMB access in OpenBMC scenarios, can also be applied to the following technical scenarios:
[0111] 1. High-frequency request scenarios in Redfish or WebUI.
[0112] Redfish is an open industry standard specification developed under the leadership of the Distributed Management Task Force; its official name is "Redfish Scalable Platforms Management API". WebUI stands for Web-based User Interface.
[0113] When multiple management terminals frequently query device status via the Redfish API (Application Programming Interface), it may trigger a large number of background operations. The business execution method in this application embodiment can prevent the status update service from being blocked due to excessive requests.
[0114] 2. Device hot-swappable or FRU scanning scenarios.
[0115] Frequent plugging and unplugging of modules such as fans and power supplies in the chassis will continuously generate InterfaceAdded / Removed signals. The service execution method described in this application can avoid repeated restarts of the device management service, ensuring system stability.
[0116] 3. KVM (Keyboard, Video and Mouse) switching or concurrent access by multiple users.
[0117] When multiple users rapidly switch KVM sessions, the BMC needs to frequently create and destroy sessions, potentially causing signal storms. The service execution method described in this application can be used to control the response rhythm of the session management service.
[0118] 4. Log reporting or alarm notification service.
[0119] When a system generates a large number of alarms in a short period of time, the notification service may be unable to process new alarms due to being busy sending them. By introducing the state lock and cache queue in this embodiment of the application, the orderly reporting of alarms can be achieved.
[0120] 5. Edge computing or IoT gateway devices.
[0121] In resource-constrained edge nodes, frequent data reporting by sensors can lead to event backlog. This lightweight throttling mechanism can effectively improve system responsiveness.
[0122] In summary, the service execution method of this application embodiment, upon receiving a service trigger signal transmitted by the message bus, identifies the service execution status flag. When the service execution status flag is the first identifier, it determines that the service unit is executing a service. At this time, the newly arrived service trigger signal is temporarily stored in a preset cache queue, and the preset cache queue is accessed according to the target round-robin cycle. That is, after the current task is completed, the next service trigger signal is automatically retrieved from the preset cache queue for further processing, thereby realizing the orderly serial execution of events and ensuring the integrity of the business process. Therefore, it can solve the technical problem in related technologies where, under the condition of frequent IPMB access leading to a surge in the number of signals, the service unit is continuously in the state of "receiving signal → waking up → preparing to process", unable to enter the actual business logic execution stage, causing the service to "freeze" or experience response delays. It achieves the technical effect of effectively mitigating the impact of signal storms on service execution without changing the bus communication model.
[0123] This application also proposes a management controller.
[0124] Combination Figure 1 As shown, the management controller 100 of this application includes: a message bus; at least one service unit 110, which is connected to the message bus and configured to implement the steps in any of the above-described business execution method embodiments.
[0125] 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.
[0126] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0127] The above provides a detailed description of the business execution method and management controller provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only intended to help understand the method and core ideas of this application. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from its principles, and these improvements and modifications also fall within the protection scope of the claims of this application.
Claims
1. A business execution method, characterized in that, A service unit applied in a management controller, the management controller further including a message bus, the service unit being connected to the message bus, the method comprising: In response to the service trigger signal transmitted by the message bus, the service execution status flag is identified. The service trigger signal is generated based on external devices accessing the service unit through the management bus. When the business execution status flag is the first identifier, the business trigger signal is added to the preset cache queue, and the preset cache queue is accessed based on the target round-robin period to sequentially execute the business processes corresponding to the business trigger signals in the preset cache queue. The first identifier indicates that the service unit is in the business execution state. When the business execution status flag is the second identifier, the business process corresponding to the business trigger signal is executed according to the cache status of the preset cache queue, or the business trigger signal is added to the preset cache queue to access the preset cache queue based on the target round-robin period and sequentially execute the business processes corresponding to the business trigger signals in the preset cache queue. The second identifier indicates that the service unit is in an idle state. The step of executing the business process corresponding to the business trigger signal according to the cache state of the preset cache queue, or adding the business trigger signal to the preset cache queue, includes: Obtain the cache status of the preset cache queue; When the preset cache queue is determined to be an empty queue based on the cache status, the business process corresponding to the business trigger signal is executed, and the business execution status flag is switched from the second flag to the first flag. When the preset cache queue is determined to be a non-empty queue based on the cache status, the service trigger signal is added to the preset cache queue.
2. The business execution method according to claim 1, characterized in that, Access the preset cache queue based on the target polling cycle to sequentially execute the business processes corresponding to the business trigger signals in the preset cache queue, including: Obtain the actual patrol interval duration; When the actual polling interval reaches the target polling cycle, the preset cache queue is accessed, the first service trigger signal in the preset cache queue is added to the service processing list to execute the service process corresponding to the first service trigger signal, and the actual polling interval is reset to zero and the timer is restarted. The target polling cycle is greater than the single service execution requirement cycle corresponding to the service unit.
3. The business execution method according to claim 2, characterized in that, When the business execution status flag is the first identifier, the method further includes: Identify the service priority of the service trigger signal; When the service priority is higher than or equal to the target priority, the service trigger signal is marked for retry, and when the service execution status flag is switched from the first flag to the second flag, the service process corresponding to the service trigger signal is executed based on the retry flag. When the service priority is not the target priority, the service trigger signal is added to the preset cache queue.
4. The business execution method according to claim 3, characterized in that, Based on the retry flag, the business process corresponding to the business trigger signal is executed, including: Identify the presence of retry flags and determine the number of retry flag signals based on the presence of retry flags; When there are multiple retry flag signals, obtain the flag timestamp of the service trigger signal with the retry flag; According to the timestamp, one of the multiple service trigger signals with retry flags is determined as the target service trigger signal, the service trigger signal is added to the service processing list, and the actual polling interval duration is cleared and re-timed. When the number of retry flag signals is one, the service trigger signal with the retry flag is added to the service processing list, and the actual polling interval duration is reset and the timer is restarted.
5. The business execution method according to claim 2, characterized in that, The method further includes: When the business execution status flag is switched from the first identifier to the second identifier, the preset cache queue is accessed, the first business trigger signal in the preset cache queue is added to the business processing list to execute the business process corresponding to the first business trigger signal, and the actual polling interval duration is reset to zero and the timer is restarted.
6. The business execution method according to claim 1, characterized in that, The method further includes: Historical signal transmission data of the message bus up to the current moment are collected based on a preset time window. The service trigger frequency corresponding to the service unit is identified based on the historical signal transmission data. The target polling cycle is determined based on the service triggering frequency, wherein the target polling cycle is negatively correlated with the service triggering frequency.
7. The business execution method according to claim 6, characterized in that, Determining the target polling cycle based on the service trigger frequency includes: If the triggering frequency is less than the preset frequency, the target cycle period is determined to be the first cycle period. When the trigger frequency is greater than or equal to the preset frequency, the target cycle period is determined to be the second cycle period, and the second cycle period is less than the first cycle period.
8. The business execution method according to claim 7, characterized in that, Determining the target polling cycle based on the service trigger frequency includes: Determine the preset relationship based on the business execution parameters of the service unit; The target polling cycle is determined based on the service triggering frequency and the preset relationship, wherein the preset relationship is used to characterize the mapping relationship between the target polling cycle and the service triggering frequency.
9. A management controller, characterized in that, include: Message bus; At least one service unit, each of which is connected to the message bus, is configured to implement the steps of the service execution method as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Business process management method and business process management device
CN104361435A
Thread management method and device, equipment and storage medium
CN119645657A