Method, device and server system for managing internal integrated circuit bus
Patent Information
- Application Number
- CN202211659419.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-22
- Publication Date
- 2026-08-18
- Estimated Expiration
- 2042-12-22
AI Technical Summary
[0004]本发明提供一种内部集成电路总线的管理方法、装置及服务器系统,用以解决现有技术中I2C总线发生挂死时仍以原来的频次继续访问,所导致管理效率和稳定性较差的缺陷
[0036] The internal integrated circuit bus management method, device, and server system provided by this invention, during each polling, utilizes the update flag bit of the monitored device to determine if the monitored device has access conditions when the first access cycle is less than a first preset threshold. During device access, the attribute table is updated using collected sensor data. When the data acquisition cycle consumed in updating the attribute table is greater than or equal to a second preset threshold, the identification information of the monitored device is recorded. Furthermore, by extending the first access cycle, the number of accesses to the device per unit time is gradually reduced. In the event of an I2C hangup, multiple variables defined at the software level gradually reduce the number of accesses by the BMC to devices on the hanged I2C bus, avoiding unnecessary waste of CPU and memory resources. Although it cannot restore the hardware I2C bus to normal, it greatly mitigates the adverse effects of I2C bus hangups.
Smart Images

Figure CN116303197B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of server technology, and in particular to a method, apparatus and server system for managing an internal integrated circuit bus. Background Technology
[0002] The Baseboard Management Controller (BMC) connects to multiple Inter-Integrated Circuit (I2C) buses, and each I2C bus connects to several monitored devices or sensors. Device monitoring is typically handled by two threads. The first thread is an attribute reading thread, which sequentially traverses the devices connected to the I2C bus once per second and stores the read values in an attribute table. The second thread is a sensor monitoring thread, which reads the real-time values of the devices from the attribute table, processes them, and stores them in a Sensor Data Record (SDR).
[0003] However, the I2C bus connecting devices has a certain probability of crashing. This can cause code accessing the device via the I2C bus to not return for an extended period, while the device connected to that I2C bus continues to be accessed, wasting CPU and memory resources. Furthermore, other devices may also experience delayed access due to a crashed I2C bus, resulting in poor management efficiency and stability. Summary of the Invention
[0004] This invention provides a management method, apparatus, and server system for an internal integrated circuit bus, which solves the problem of poor management efficiency and stability caused by the I2C bus continuing to access the same frequency even when it is suspended in the prior art.
[0005] This invention provides a method for managing an internal integrated circuit bus, comprising:
[0006] If the update flag of the device to be monitored is determined to be 0, the first access cycle is obtained;
[0007] If the first access cycle is determined to be less than the first preset threshold, the sensor data collected by the device to be monitored will be updated to the attribute table, and the data collection cycle will be recorded.
[0008] If the data collection period is determined to be greater than or equal to the second preset threshold, the identification information of the device to be monitored is recorded and the first access period is updated so that the device to be monitored can start the next access with the updated first access period.
[0009] The update flag is used to determine whether the information recorded in the attribute table of the monitored device is being updated; the first access period is the time interval between the last access and the current access when the monitored device is in a normal access state; and the data collection period is the time required to update the attribute table.
[0010] According to a management method for an internal integrated circuit bus provided by the present invention, the updating of the first access cycle includes:
[0011] If the first access period is not 0 and is less than the third preset threshold, then 1 is added cumulatively to the first access period to obtain the updated first access period;
[0012] If the first access period is not 0 and is not less than the third preset threshold, the first access period is increased by a factor of 9 to obtain the updated first access period.
[0013] According to a management method for an internal integrated circuit bus provided by the present invention, the updating of the first access cycle further includes:
[0014] If the first access period is determined to be 0, the updated first access period is set to 1.
[0015] According to a management method for an internal integrated circuit bus provided by the present invention, after the recorded data acquisition cycle, the method further includes:
[0016] If the data collection period is determined to be less than the second preset threshold, the first access period is set to 0 so that the monitored device can start the next access in a normal access state.
[0017] According to a management method for an internal integrated circuit bus provided by the present invention, after acquiring the first access cycle, the method further includes:
[0018] If the first access period is determined to be greater than or equal to the first preset threshold, the second access period is obtained;
[0019] If the second access period is greater than or equal to the first access period, the sensor data collected by the monitored device will be updated in the attribute table, and the data collection period will be recorded.
[0020] If the second access period is less than the first access period, the number of access periods will be incremented by 1 based on the second access period, so as to update the attribute table in the next access according to the updated second access period;
[0021] The second access period is the actual time interval between the last access to the device under monitoring and the current access.
[0022] According to a management method for an internal integrated circuit bus provided by the present invention, after updating the first access cycle, the method further includes:
[0023] Set the second access cycle and the update flag to 0, and after the sleep duration reaches the fourth preset threshold, use the updated first access cycle to access the monitored device again.
[0024] According to a management method for an internal integrated circuit bus provided by the present invention, before determining the update flag bit of the device to be monitored, the method further includes:
[0025] Traverse all internal integrated circuit buses and identify the hardware devices connected to each internal integrated circuit bus.
[0026] n management threads are allocated for each of the n hardware devices.
[0027] After determining the identification information of the device to be monitored, the management thread corresponding to the device to be monitored is activated.
[0028] The present invention also provides a management device for an internal integrated circuit bus, comprising:
[0029] The first access cycle acquisition module is used to acquire the first access cycle when it is determined that the update flag bit of the device to be monitored is 0.
[0030] The data acquisition cycle acquisition module is used to update the sensor data collected from the monitored device to the attribute table and record the data acquisition cycle when it is determined that the first access cycle is less than the first preset threshold.
[0031] The management module is used to record the identification information of the device to be monitored and update the first access period when the data collection period is determined to be greater than or equal to the second preset threshold, so that the device to be monitored can start the next access with the updated first access period.
[0032] The update flag is used to determine whether the information recorded in the attribute table of the monitored device is being updated; the first access period is the time interval between the last access and the current access when the monitored device is in a normal access state; and the data collection period is the time required to update the attribute table.
[0033] The present invention also provides a server system, including a baseboard management controller and a plurality of hardware devices connected on at least one internal integrated circuit bus, wherein the baseboard management controller is used to execute the management method of the internal integrated circuit bus as described above.
[0034] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, implements the management method of the internal integrated circuit bus as described above.
[0035] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the management method of the internal integrated circuit bus as described above.
[0036] The internal integrated circuit bus management method, device, and server system provided by this invention, during each polling, utilizes the update flag bit of the monitored device to determine if the monitored device has access conditions when the first access cycle is less than a first preset threshold. During device access, the attribute table is updated using collected sensor data. When the data acquisition cycle consumed in updating the attribute table is greater than or equal to a second preset threshold, the identification information of the monitored device is recorded. Furthermore, by extending the first access cycle, the number of accesses to the device per unit time is gradually reduced. In the event of an I2C hangup, multiple variables defined at the software level gradually reduce the number of accesses by the BMC to devices on the hanged I2C bus, avoiding unnecessary waste of CPU and memory resources. Although it cannot restore the hardware I2C bus to normal, it greatly mitigates the adverse effects of I2C bus hangups. Attached Figure Description
[0037] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0038] Figure 1 This is one of the flowcharts illustrating the internal integrated circuit bus management method provided by the present invention;
[0039] Figure 2 This is the second flowchart illustrating the internal integrated circuit bus management method provided by the present invention;
[0040] Figure 3 This is a schematic diagram of the structure of the internal integrated circuit bus management device provided by the present invention;
[0041] Figure 4 This is a schematic diagram of the server system provided by the present invention;
[0042] Figure 5 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation
[0043] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0044] The terms "first," "second," etc., used in this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more.
[0045] It should be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used herein, unless the context clearly indicates otherwise, the singular forms “a,” “an,” and “the” are intended to include the plural forms.
[0046] The terms “comprising” and “including” indicate the presence of the described feature, whole, step, operation, element and / or component, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or collections thereof.
[0047] Figure 1 This is one of the flowcharts illustrating the internal integrated circuit bus management method provided by this invention. For example... Figure 1 As shown, the management method of the internal integrated circuit bus provided in this embodiment of the invention includes: step 101, obtaining the first access cycle when it is determined that the update flag bit of the device to be monitored is 0.
[0048] The update flag is used to determine whether the information recorded in the attribute table of the monitored device is being updated. The first access period is the time interval between the last access and the current access when the monitored device is in a normal access state.
[0049] It should be noted that the execution subject of the internal integrated circuit bus management method provided in the embodiments of the present invention is an internal integrated circuit bus management device. This device can be a processor integrated into the server body in the form of electronic chips, central processing units (CPU), microcontroller units (MCU), field programmable gate arrays (FPGA), etc.
[0050] Each device to be monitored is connected to an I2C bus. The monitoring process can be divided into two threads. The first thread is the attribute reading thread, which sequentially traverses the hardware devices connected to the I2C bus once per second and stores the read values in the attribute table. The second thread is the sensor monitoring thread, which reads the real-time values of the device from the attribute table, processes them, and then stores them in the SDR (Sensor Data Recorder).
[0051] Specifically, in step 101, the management device of the internal integrated circuit bus determines whether the attribute is being updated based on the update flag bit defined by whether the real-time data obtained by the monitored device when it accesses the monitored device through the I2C bus is stored in the attribute table.
[0052] The update flag (i.e., the update value) is a flag defined when the device is accessed via I2C and its attribute table is updated. Its default value is 0, indicating that the monitored device is not currently in an access state. Before starting this round of access, the time span between the last access to the I2C device and the next access to the I2C device, based on normal access (i.e., accessing once per second), needs to be recorded as the first access cycle (i.e., the needtime value).
[0053] If the first access period is 0, it means that, based on normal access, there is no time gap between the last access to the I2C device and the next access, i.e., one access per second. Similarly, if the first access period is k, it means that, based on normal access, there is a time gap of k seconds between the last access to the I2C device and the next access, i.e., one access every k+1 seconds.
[0054] If the update flag (i.e., the update value) is 1, it means that the current attribute is still being updated. Under normal access conditions, the device will be accessed once per second. If the attribute is being updated, it means that the current access has not ended, that is, the I2C bus may be stuck. In this case, the access to the device will be stopped to avoid blocking at this point every time.
[0055] Step 102: If the first access period is less than the first preset threshold, update the sensor data collected from the device to be monitored to the attribute table and record the data collection period.
[0056] The data collection period is the time required to update the attribute table.
[0057] It should be noted that the first preset threshold is a threshold set based on whether the monitored device has experienced a hangup during continuous access. The first preset threshold indicates that the monitored device will only be considered hangup if it experiences continuous read failures.
[0058] The value of the first preset threshold can be determined by different I2C devices, and this embodiment of the invention does not impose specific limitations on it.
[0059] For example, for an over-temperature alarm, the temperature must exceed the high threshold for 60 consecutive readings before it can be recorded. Therefore, the first preset threshold can be set to 80, which means that the monitored device needs to fail to read 80 times in a row to ensure that all over-temperature alarm logs can be recorded in the failure alarm log.
[0060] Specifically, in step 102, the management device of the internal integrated circuit bus compares the first access cycle with the first preset threshold:
[0061] If the first access period is less than the first preset threshold, it means that the monitored device has been accessing the device once per second in the first 80 accesses in a normal access state. In the absence of a hangup, the update flag will be set from 0 to 1, the sensor data collected from the monitored device will be updated to the attribute table as the attribute sampling value, and the actual time spent accessing the device this time will be recorded as the data collection period (i.e., the spendtime value).
[0062] If the first access cycle is greater than or equal to the first preset threshold, it means that the first 80 accesses have failed. In this case, access can only be performed after the first access cycle has elapsed. This is to avoid excessive CPU, memory and other resource usage caused by the high frequency of the next access corresponding to the normal access state.
[0063] Step 103: If the data acquisition period is greater than or equal to the second preset threshold, record the identification information of the device to be monitored and update the first access period so that the device to be monitored can start the next access with the updated first access period.
[0064] It should be noted that the second preset threshold is a threshold set based on the data collection cycle spent by the monitored device in updating its attribute table. The second preset threshold is used to characterize whether the monitored device experiences a hang due to excessively long access times.
[0065] The value of the second preset threshold can be determined by different I2C devices, and this embodiment of the invention does not impose specific limitations on it.
[0066] For example, the second preset threshold can be set to 3 seconds to indicate that the time limit for the monitored device to update the attribute table with new sensor data is 3 seconds. If the limit is exceeded, it will be determined that the device is stuck.
[0067] Specifically, in step 103, the management device of the internal integrated circuit bus compares the data acquisition cycle with the second preset threshold:
[0068] If the data acquisition cycle is greater than or equal to the second preset threshold, it indicates that an I2C hang has occurred during device access. First, record the identification information of the monitored device (e.g., device ID) so that it can be used later to determine which I2C bus is connected to the device. Simultaneously, the first access cycle should be increased to varying degrees to utilize the extended first access cycle for device access in the next polling cycle, avoiding high-frequency access under normal access conditions during a hang.
[0069] In each polling iteration, this invention utilizes the update flag of the monitored device being 0 to determine if the monitored device meets the access conditions when the first access cycle is less than a first preset threshold. During device access, the attribute table is updated using collected sensor data. When the data acquisition cycle for updating the attribute table is greater than or equal to a second preset threshold, the identification information of the monitored device is recorded. Furthermore, by extending the first access cycle, the number of accesses to the device per unit time is gradually reduced. This allows for the gradual reduction of BMC accesses to devices on the suspended I2C bus through multiple variables defined at the software level when an I2C hangup is detected, avoiding unnecessary waste of CPU and memory resources. While it cannot restore the hardware I2C bus to normal operation, it significantly mitigates the adverse effects of an I2C bus hangup.
[0070] Based on any of the above embodiments, updating the first access period includes: if the first access period is not 0 and is less than a third preset threshold, incrementing the first access period by 1 to obtain the updated first access period.
[0071] If the first access period is not 0 and is not less than the third preset threshold, the first access period is increased by a factor of 9 to obtain the updated first access period.
[0072] It should be noted that the third preset threshold is a threshold set based on the first access cycle of the device under monitoring. The third preset threshold indicates that the device under monitoring will only be considered to be in a state of suspension if it fails to read continuously.
[0073] The value of the third preset threshold can be equal to the first preset threshold, and this embodiment of the invention does not specifically limit this. For example, the third preset threshold is 80.
[0074] Specifically, in step 103, if the first access cycle collected by the management device of the internal integrated circuit bus is not 0, it indicates that this access is not the first device access after the device is hung up. Then, it is determined whether the first access cycle is less than the third preset threshold.
[0075] If the first access cycle is less than 80, it means that the monitored device has just crashed not long ago. Therefore, the update strategy for the first access cycle is to increment the original needtime value by 1 each time, and use needtime+1 as the new first access cycle, and perform the next access with an interval of needtime+1.
[0076] If the first access cycle is greater than or equal to 80, it indicates that the monitored device has been down for a long time. Therefore, the update strategy for the first access cycle is to increment the original needtime value by 9 times, that is, multiply the needtime value by 10 each time. The new first access cycle is then set to needtime*10, and the next access is performed at intervals of needtime*10.
[0077] This invention, based on a comparison of a non-zero first access period with a third preset threshold, determines the time point at which a hangup occurs. Cases where the first access period is less than the third preset threshold are mapped to a recent hangup, and a decision is made to increase the first access period by 1 second to slightly reduce subsequent accesses. Conversely, cases where the first access period is not less than the third preset threshold are mapped to a hangup that has been ongoing for some time, and a decision is made to increase the first access period to 10 times its original length to significantly reduce subsequent accesses. This allows for an adaptive update strategy based on the actual duration of the hangup, effectively reducing the access frequency of devices on the hanguped I2C connection to avoid unnecessary waste of CPU and memory resources.
[0078] Based on any of the above embodiments, updating the first access period further includes: setting the updated first access period to 1 when the first access period is determined to be 0.
[0079] Specifically, in step 103, the first access cycle collected by the management device of the internal integrated circuit bus is 0, which indicates that it was normal before. This access is the first time that the I2C hangs. Then the first access cycle is reassigned from the original 0 to 1. Based on the normal access, it takes 1 second from the last access to the I2C device to the next access to the I2C device, that is, one access every two seconds.
[0080] This invention maps a first access cycle of 0 to the initial occurrence of a hangup, and resets the first access cycle to 1 to reduce the number of subsequent accesses to a minimum, accessing the device once every two seconds. It can implement an appropriate update strategy based on the actual hangup situation, thereby reducing the access frequency of the device on the hangup I2C connection to a corresponding degree, thus avoiding unnecessary waste of CPU and memory resources.
[0081] Based on any of the above embodiments, after the recorded data acquisition cycle, the method further includes: if it is determined that the data acquisition cycle is less than a second preset threshold, setting the first access cycle to 0 so that the monitored device can start the next access in a normal access state.
[0082] Specifically, after step 102, the management device of the internal integrated circuit bus determines that the data acquisition cycle is less than the second preset threshold, which means that the device under monitoring has not been suspended, or although it was suspended before, it has recovered. Therefore, the device can access the device in the next polling in a normal access state. Then, the first access cycle is reassigned to 0 so that the device under monitoring can still access the device normally once per second.
[0083] In this embodiment of the invention, the case where the data acquisition cycle consumed in updating the attribute table is less than a second preset threshold is mapped to the case where no I2C hangup has occurred. In this case, the first access cycle is reset to 0, ensuring that subsequent accesses to the device maintain a normal frequency within a unit of time. Even when no I2C hangup is detected, multiple variables defined at the software level maintain the number of times the BMC accesses devices on the normal I2C bus, achieving accurate monitoring of I2C hangups.
[0084] Based on any of the above embodiments, after obtaining the first access period, the method further includes: obtaining a second access period if it is determined that the first access period is greater than or equal to a first preset threshold.
[0085] The second access period is the actual time interval between the last access to the device under monitoring and the current access.
[0086] Specifically, after step 101, if the management device of the internal integrated circuit bus is greater than or equal to the first preset threshold in the first access cycle, that is, if the first 80 accesses have failed, then it is necessary to wait for another first access cycle before access can be performed. The actual time elapsed from the last access to the I2C device to the next access to the I2C device is recorded as the second access cycle (i.e., realtime value).
[0087] If the second access period is greater than or equal to the first access period, the sensor data collected by the monitored device will be updated in the attribute table, and the data collection period will be recorded.
[0088] If the second access period is less than the first access period, the number of access periods will be incremented by 1 based on the second access period, so that the attribute table can be updated in the next access according to the updated second access period.
[0089] Specifically, the management device of the internal integrated circuit bus continues to compare the second access cycle with the first access cycle:
[0090] If the second access period is greater than or equal to the first access period, meaning the required time has elapsed during the actual access, the normal device data read / write process will be executed. The read value will be updated in the attribute table, and the actual time spent accessing the device, i.e., the spendtime value, will be recorded.
[0091] If the second access period is less than the first access period, it means that the time to access the device has not yet been reached. In this case, the second access period is incremented by 1 to allow sufficient time to update the attribute table in the next device access by increasing the device access time.
[0092] This invention, based on the premise that when the first access period is greater than or equal to a first preset threshold, further determines the second access period actually spent accessing the device by combining the first access period with the second access period, deciding whether the current access has reached the required time. If not, the device is not accessed this time. This allows for comparison between the actual and theoretical values of the time required to access the device, defined at the software level, to decide whether to perform the device access, thus avoiding unnecessary waste of CPU and memory resources.
[0093] Based on any of the above embodiments, after updating the first access cycle, the method further includes: setting the second access cycle and the update flag to 0, and after the sleep duration reaches a fourth preset threshold, using the updated first access cycle to access the monitored device for the next time.
[0094] It should be noted that the fourth preset threshold is a threshold set based on the sleep time required by the monitored device after each polling cycle. The fourth preset threshold is used to characterize the sleep time required by the monitored device after each access to the device.
[0095] The value of the fourth preset threshold can be determined by different I2C devices, and this embodiment of the invention does not impose specific limitations on it.
[0096] For example, the fourth preset threshold can be set to 1 second, to indicate that the monitored device will sleep for one second after each access before starting a new polling.
[0097] Specifically, after step 103, the management device of the internal integrated circuit bus reassigns the second access cycle and the update flag to 0, monitors the sleep duration of the device to be monitored, and when it detects that the sleep duration of the device to be monitored has reached the fourth preset threshold, it initiates the next access to the device to be monitored after the updated first access cycle.
[0098] In this embodiment of the invention, after determining the adjustment strategy for the first access cycle, the second access cycle and the update flag are reset to their respective default values of 0. When the sleep duration after the current access reaches a fourth preset threshold, a decision is made to execute a new round of polling access using the updated first access cycle. During the polling process, multiple variables defined at the software level can gradually reduce the number of times the BMC accesses devices on a suspended I2C bus, avoiding unnecessary waste of CPU and memory resources. Although it cannot restore the hardware I2C bus to normal, it greatly mitigates the adverse effects of a suspended I2C bus.
[0099] Based on any of the above embodiments, before determining the update flag of the device to be monitored, the method further includes: traversing all internal integrated circuit buses to determine the hardware device connected to each internal integrated circuit bus.
[0100] Specifically, prior to step 101, the management device of the internal integrated circuit bus traverses all I2C buses and records the hardware devices connected to each I2C bus and their number.
[0101] n management threads are allocated for each of the n hardware devices.
[0102] Specifically, the management device for the internal integrated circuit bus allocates n independent management threads based on the number of hardware devices (n), meaning each hardware device corresponds to its own management thread. In this way, if the I2C port of a certain device hangs, it will only affect devices on that bus and will not affect devices on other buses, thus avoiding issues such as delays in alarm logging and fan speed control.
[0103] After determining the identification information of the device to be monitored, the management thread corresponding to the device to be monitored is activated.
[0104] Specifically, after determining the management task based on the actual task requirements, the management device of the internal integrated circuit bus uses the identification information of one or more devices to be monitored involved in the management task to start the management thread corresponding to the identification information of each device to be monitored, so as to execute the independent management method of the internal integrated circuit bus in the corresponding thread.
[0105] In this embodiment of the invention, the implementation process of the management method for the internal integrated circuit bus is not specifically limited.
[0106] For example, Figure 2 This is the second flowchart illustrating the internal integrated circuit bus management method provided by this invention. Figure 2 As shown in the embodiment of the present invention, a complete implementation process of an internal integrated circuit bus management method is provided:
[0107] (1) Traverse all I2C devices and record the number of I2C devices.
[0108] (2) Create a separate management thread for each I2C device based on the number of I2C devices. In this way, if the I2C of a certain device hangs, it will only affect the devices on that bus and will not affect the devices on other buses, thus avoiding the problems of alarm log delay and fan speed control delay.
[0109] (3) In any management thread, determine whether the update flag bit update of the I2C device corresponding to the management thread is 1. If the update value is 1, it means that the current attribute is still being updated, that is, the I2C bus may have been stuck. Then stop the access to the device and jump to step (12) to avoid blocking here every time.
[0110] If the update value is 0, it indicates that the previous access has been completed, and step (4) will continue.
[0111] (4) Determine if the needtime of the first access cycle is greater than 80. If it is less than 80, that is, the first 80 I2C device accesses are performed once per second to ensure that the device connected to the suspended I2C bus can record the read failure alarm log. Then, proceed to step (6) for specific operations. Otherwise, continue to step (5).
[0112] (5) If needtime is greater than 80, it means that the first 80 accesses have failed. In this case, it is necessary to access the device again after an interval of needtime to avoid excessive CPU, memory and other resource usage. Continue to judge whether realtime of the second access period is less than needtime. If it is less, it means that the time to access the device has not yet been reached. Increment the value of realtime by 1 and jump to step (12). If it is not less, it means that the time to access the device has been reached. Jump to step (6).
[0113] (6) First, set the update attribute to 1. Then, each management thread accesses its own I2C device, updates the value read to the attribute table, and records the actual time spent accessing the device, i.e., the data acquisition period spendtime.
[0114] (7) Determine if spendtime is greater than 3 seconds. If it is not greater, it means that the I2C is not stuck, or although it was stuck before, it has recovered and the device can be accessed normally. Set needtime to 0, that is, the device can be accessed normally once per second. Jump to step (10).
[0115] (8) If the spendtime is greater than 3 seconds, it means that an I2C hang has occurred. First, record the device ID so that it can be analyzed later to determine which I2C was hung.
[0116] (9) Check if needtime is 0. If it is 0, it means that it was normal before. This is the first time that I2C hangs. Set needtime to 1.
[0117] If needtime is not 0, it means that this is not the first time the device has been accessed after the I2C hangs. Continue to check if needtime is less than 80. If it is less than 80, increment needtime by 1; otherwise, multiply needtime by 10.
[0118] (10) Reassign the value of realtime to 0.
[0119] (11) Reassign update to 0.
[0120] (12) Sleep for one second, then jump to (3) with the updated needtime to start a new round of access.
[0121] This invention, based on the principle of traversing the hardware devices connected to each internal integrated circuit bus and creating a corresponding independent management thread for each, allows for the management and monitoring of devices by using their identification information after identifying the device to be monitored. This transforms single-threaded access into multi-threaded access. By defining multiple variables at the software level, the number of times the BMC accesses devices on a suspended I2C bus is gradually reduced, avoiding unnecessary waste of CPU and memory resources. Once I2C resumes normal operation, access to the devices is promptly restored, and the device numbers are recorded for subsequent problem analysis.
[0122] Figure 3 This is a schematic diagram of the structure of the internal integrated circuit bus management device provided by the present invention. Based on any of the above embodiments, such as... Figure 3 As shown, the internal integrated circuit bus management device provided in this embodiment of the invention includes a first access cycle acquisition module 310, a data acquisition cycle acquisition module 320, and a management module 330, wherein:
[0123] The first access cycle acquisition module 310 is used to acquire the first access cycle when it is determined that the update flag bit of the device to be monitored is 0.
[0124] The data acquisition cycle acquisition module 320 is used to update the sensor data collected from the device to be monitored to the attribute table and record the data acquisition cycle when it is determined that the first access cycle is less than the first preset threshold.
[0125] The management module 330 is used to record the identification information of the device to be monitored and update the first access period when the data collection period is determined to be greater than or equal to the second preset threshold, so that the device to be monitored can start the next access with the updated first access period.
[0126] The update flag is used to determine whether the information recorded in the attribute table of the monitored device is being updated. The first access period is the time interval between the last access and the current access when the monitored device is in a normal access state. The data collection period is the time required to update the attribute table.
[0127] Specifically, the first access cycle acquisition module 310, the data acquisition cycle acquisition module 320, and the management module 330 are electrically connected in sequence.
[0128] The first access cycle acquisition module 310 determines whether the attribute is being updated based on the update flag defined by whether the real-time data obtained by the monitored device when it accesses the monitored device through the I2C bus is stored in the attribute table.
[0129] The data acquisition cycle acquisition module 320 compares the first access cycle with the first preset threshold:
[0130] If the first access period is less than the first preset threshold, it means that the monitored device has been accessing the device once per second in the first 80 accesses in a normal access state. In the absence of a hangup, the update flag will be set from 0 to 1, the sensor data collected from the monitored device will be updated to the attribute table as the attribute sampling value, and the actual time spent accessing the device this time will be recorded as the data collection period (i.e., the spendtime value).
[0131] Management module 330 compares the data acquisition period with the second preset threshold:
[0132] If the data acquisition cycle is greater than or equal to the second preset threshold, it indicates that an I2C hang has occurred during device access. First, record the identification information of the monitored device (e.g., device ID) so that it can be used later to determine which I2C bus is connected to the device. Simultaneously, the first access cycle should be increased to varying degrees to utilize the extended first access cycle for device access in the next polling cycle, avoiding high-frequency access under normal access conditions during a hang.
[0133] Optionally, the management module 330 is specifically used to increment the first access period by 1 based on the first access period if the first access period is not 0 and is less than the third preset threshold, so as to obtain the updated first access period.
[0134] The management module 330 is also specifically used to increase the first access period by a factor of 9 based on the first access period if the first access period is not 0 and is not less than a third preset threshold, so as to obtain the updated first access period.
[0135] Optionally, the management module 330 is further configured to set the updated first access period to 1 when it is determined that the first access period is 0.
[0136] Optionally, the device further includes a normal access module, wherein:
[0137] The normal access module is used to set the first access period to 0 when it is determined that the data collection period is less than the second preset threshold, so that the monitored device can start the next access in a normal access state.
[0138] Optionally, the device further includes a second access cycle acquisition module and a decision module, wherein:
[0139] The second access period acquisition module is used to acquire the second access period when it is determined that the first access period is greater than or equal to the first preset threshold.
[0140] The decision module is used to update the sensor data collected by the monitored device to the attribute table and record the data collection period if the second access period is greater than or equal to the first access period.
[0141] The decision module is also used to increment the second access period by 1 if the second access period is less than the first access period, so as to update the attribute table in the next access according to the updated second access period.
[0142] The second access period is the actual time interval between the last access to the device under monitoring and the current access.
[0143] Optionally, the device further includes access to the hibernation module, wherein:
[0144] The access sleep module is used to set the second access cycle and the update flag to 0, and after the sleep duration reaches the fourth preset threshold, to use the updated first access cycle to access the monitored device again.
[0145] Optionally, the device further includes a bus traversal module, a management thread creation module, and a management thread activation module, wherein:
[0146] The bus traversal module is used to traverse all internal integrated circuit buses and determine the hardware devices connected to each internal integrated circuit bus.
[0147] The management thread creation module is used to create n management threads for each of the n hardware devices.
[0148] The management thread activation module is used to activate the management thread corresponding to the device under monitoring after determining the identification information of the device under monitoring.
[0149] The internal integrated circuit bus management device provided in this embodiment of the invention is used to execute the internal integrated circuit bus management method of the present invention. Its implementation method is consistent with the implementation method of the internal integrated circuit bus management method provided by the present invention, and can achieve the same beneficial effects, which will not be repeated here.
[0150] In each polling iteration, this invention utilizes the update flag of the monitored device being 0 to determine if the monitored device meets the access conditions when the first access cycle is less than a first preset threshold. During device access, the attribute table is updated using collected sensor data. When the data acquisition cycle for updating the attribute table is greater than or equal to a second preset threshold, the identification information of the monitored device is recorded. Furthermore, by extending the first access cycle, the number of accesses to the device per unit time is gradually reduced. This allows for the gradual reduction of BMC accesses to devices on the suspended I2C bus through multiple variables defined at the software level when an I2C hangup is detected, avoiding unnecessary waste of CPU and memory resources. While it cannot restore the hardware I2C bus to normal operation, it significantly mitigates the adverse effects of an I2C bus hangup.
[0151] Figure 4 This is a schematic diagram of the server system provided by the present invention. Based on any of the above embodiments, such as... Figure 4 As shown, the server system provided in this embodiment of the invention includes a baseboard management controller 410 and a plurality of hardware devices 421 connected to at least one internal integrated circuit bus 420. The baseboard management controller 410 is used to execute the above-described management method of the internal integrated circuit bus.
[0152] Specifically, the main controller of the baseboard management controller 410 in the server system is connected to multiple internal integrated circuit (I2C) buses 420, and each I2C bus is connected to several monitored hardware devices 421.
[0153] Among them, hardware device 421 can be physical hardware, such as a GPU, PCIe network card or Retimer card, and will be connected to these devices through I2C bus 420 to monitor their status.
[0154] Hardware device 421 can be a sensor. For example, if it is necessary to monitor the ambient temperature, a temperature sensor can be directly connected to the I2C bus 420 for monitoring.
[0155] Device monitoring is typically handled by two threads. The first thread, PropertyTask, iterates through the devices connected via I2C once per second, storing the read values in a property table. The second thread, SensorMonitor, reads the real-time values from the property table, processes them (e.g., averages, rounding, etc.), and stores them in the SDR (Static Data Repository). Afterward, the cooling thread uses the values in the property table and an algorithm to adjust fan speed, and the alarm logging thread uses the values in the SDR to determine whether and how to log alarms.
[0156] In each polling iteration, this invention utilizes the update flag of the monitored device being 0 to determine if the monitored device meets the access conditions when the first access cycle is less than a first preset threshold. During device access, the attribute table is updated using collected sensor data. When the data acquisition cycle for updating the attribute table is greater than or equal to a second preset threshold, the identification information of the monitored device is recorded. Furthermore, by extending the first access cycle, the number of accesses to the device per unit time is gradually reduced. This allows for the gradual reduction of BMC accesses to devices on the suspended I2C bus through multiple variables defined at the software level when an I2C hangup is detected, avoiding unnecessary waste of CPU and memory resources. While it cannot restore the hardware I2C bus to normal operation, it significantly mitigates the adverse effects of an I2C bus hangup.
[0157] Figure 5 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 5As shown, the electronic device may include: a processor 510, a communication interface 520, a memory 530, and a communication bus 540, wherein the processor 510, the communication interface 520, and the memory 530 communicate with each other through the communication bus 540. The processor 510 can call logic instructions in the memory 530 to execute a management method for the internal integrated circuit bus. This method includes: when the update flag of the monitored device is determined to be 0, acquiring a first access cycle; when the first access cycle is determined to be less than a first preset threshold, updating the sensor data collected from the monitored device to the attribute table and recording the data acquisition cycle; when the data acquisition cycle is determined to be greater than or equal to a second preset threshold, recording the identification information of the monitored device and updating the first access cycle, so that the monitored device can initiate the next access with the updated first access cycle; wherein the update flag is used to determine whether the information recorded in the attribute table of the monitored device is in the process of being updated; the first access cycle is the time interval between the last access and the current access when the monitored device is in a normal access state; and the data acquisition cycle is the time required to update the attribute table.
[0158] Furthermore, the logical instructions in the aforementioned memory 530 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0159] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the internal integrated circuit bus management method provided by the above methods. The method includes: when it is determined that the update flag bit of the device to be monitored is 0, obtaining a first access cycle; when it is determined that the first access cycle is less than a first preset threshold, updating the sensor data collected from the device to be monitored to an attribute table and recording the data acquisition cycle; when it is determined that the data acquisition cycle is greater than or equal to a second preset threshold, recording the identification information of the device to be monitored and updating the first access cycle so that the device to be monitored can start the next access with the updated first access cycle; wherein, the update flag bit is used to determine whether the information recorded in the attribute table of the device to be monitored is in the process of being updated; the first access cycle is the time interval between the last access and the current access when the device to be monitored is in a normal access state; the data acquisition cycle is the time required to update the attribute table.
[0160] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program implements a management method for an internal integrated circuit bus provided by the methods described above. This method includes: when the update flag of the device to be monitored is determined to be 0, acquiring a first access period; when the first access period is determined to be less than a first preset threshold, updating sensor data collected from the device to be monitored to an attribute table and recording the data acquisition period; when the data acquisition period is determined to be greater than or equal to a second preset threshold, recording the identification information of the device to be monitored and updating the first access period, so that the device to be monitored can initiate the next access with the updated first access period; wherein the update flag is used to determine whether the information recorded in the attribute table by the device to be monitored is in the process of being updated; the first access period is the time interval between the last access and the current access when the device to be monitored is in a normal access state; and the data acquisition period is the time required to update the attribute table.
[0161] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0162] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0163] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for managing an internal integrated circuit bus, characterized in that, include: If the update flag of the device to be monitored is determined to be 0, the first access cycle is obtained; If the first access cycle is determined to be less than the first preset threshold, the sensor data collected by the device to be monitored will be updated to the attribute table, and the data collection cycle will be recorded. If the data collection period is determined to be greater than or equal to the second preset threshold, the identification information of the device to be monitored is recorded and the first access period is updated so that the device to be monitored can start the next access with the updated first access period. The update flag is used to determine whether the information recorded in the attribute table of the monitored device is being updated; the first access period is the time interval between the last access and the current access when the monitored device is in a normal access state; the data collection period is the time required to update the attribute table. The update of the first access cycle includes: If the first access period is not 0 and is less than the third preset threshold, then 1 is added cumulatively to the first access period to obtain the updated first access period; If the first access period is not 0 and is not less than the third preset threshold, the first access period is increased by a factor of 9 to obtain the updated first access period.
2. The management method for the internal integrated circuit bus according to claim 1, characterized in that, The update of the first access cycle also includes: If the first access period is determined to be 0, the updated first access period is set to 1.
3. The method for managing an internal integrated circuit bus according to claim 1, characterized in that, Following the recorded data acquisition cycle, the following is also included: If the data collection period is determined to be less than the second preset threshold, the first access period is set to 0 so that the monitored device can start the next access in a normal access state.
4. The method for managing an internal integrated circuit bus according to claim 1, characterized in that, After obtaining the first access period, the following is also included: If the first access period is determined to be greater than or equal to the first preset threshold, the second access period is obtained; If the second access period is greater than or equal to the first access period, the sensor data collected by the monitored device will be updated in the attribute table, and the data collection period will be recorded. If the second access period is less than the first access period, the number of access periods will be incremented by 1 based on the second access period, so as to update the attribute table in the next access according to the updated second access period; The second access period is the actual time interval between the last access to the device under monitoring and the current access.
5. The method for managing an internal integrated circuit bus according to claim 4, characterized in that, Following the update of the first access cycle, the following is also included: Set the second access cycle and the update flag to 0, and after the sleep duration reaches the fourth preset threshold, use the updated first access cycle to access the monitored device again.
6. The method for managing an internal integrated circuit bus according to any one of claims 1-5, characterized in that, Before determining the update flag of the monitored device, the process also includes: Traverse all internal integrated circuit buses and identify the hardware devices connected to each internal integrated circuit bus. n management threads are allocated for each of the n hardware devices. After determining the identification information of the device to be monitored, the management thread corresponding to the device to be monitored is activated.
7. A management device for an internal integrated circuit bus, characterized in that, include: The first access cycle acquisition module is used to acquire the first access cycle when it is determined that the update flag bit of the device to be monitored is 0. The data acquisition cycle acquisition module is used to update the sensor data collected from the monitored device to the attribute table and record the data acquisition cycle when it is determined that the first access cycle is less than the first preset threshold. The management module is used to record the identification information of the device to be monitored and update the first access period when the data collection period is determined to be greater than or equal to the second preset threshold, so that the device to be monitored can start the next access with the updated first access period. The update flag is used to determine whether the information recorded in the attribute table of the monitored device is being updated; the first access period is the time interval between the last access and the current access when the monitored device is in a normal access state; the data collection period is the time required to update the attribute table. The update of the first access cycle includes: If the first access period is not 0 and is less than the third preset threshold, then 1 is added cumulatively to the first access period to obtain the updated first access period; If the first access period is not 0 and is not less than the third preset threshold, the first access period is increased by a factor of 9 to obtain the updated first access period.
8. A server system, comprising a baseboard management controller and a plurality of hardware devices connected to at least one internal integrated circuit bus, characterized in that, The substrate management controller is used to execute the management method of the internal integrated circuit bus as described in any one of claims 1-6.
9. 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 program, it implements the management method of the internal integrated circuit bus as described in any one of claims 1 to 6.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the management method of the internal integrated circuit bus as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Optimization method and equipment for accessing PCIe equipment
CN110928827A
Management system and method for server I2C equipment
CN111124981A