Sensor scanning method and computer device
By optimizing the sensor scanning sequence and utilizing depth-first search and path information, the problem of excessively long scanning time caused by the increase in the number of sensors was solved, thereby improving the operational stability and response speed of the computer equipment.
Patent Information
- Application Number
- CN202211603818.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-13
- Publication Date
- 2025-12-12
- Estimated Expiration
- 2042-12-13
AI Technical Summary
As the number of sensors on computer devices increases, the scanning time for each execution cycle becomes longer, causing the management controller to be unable to quickly obtain the latest monitoring information from the sensors, thus affecting operational stability.
By determining the target scanning order and optimizing the sensor scanning path, the number of target commands sent to the channel switch is reduced. The optimal scanning order is determined by using a depth-first algorithm and scanning path information, thereby improving scanning efficiency.
It shortens the scanning time of each execution cycle, improves the response speed to abnormal sensor conditions, and enhances the operational stability of computer equipment.
Smart Images

Figure CN116225827B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, and particularly relates to a sensor scanning method and a computer device. BACKGROUND
[0002] With the increasing importance of the running stability of the computer device, more and more sensors for monitoring the running state information are arranged on the computer device. In order to better ensure the running stability of the computer device, the management controller on the computer device usually randomly scans each sensor according to a preset period to obtain the monitoring information stored in each sensor.
[0003] However, with the increasing number of sensors, the scanning time required by each execution period is longer and longer, which results in that the management controller cannot quickly enter the next execution period. In this case, the management controller cannot quickly obtain the latest monitoring information of each sensor, and thus cannot respond to the abnormal state in the running process in time, which seriously affects the running stability. SUMMARY
[0004] The embodiments of the present application provide a sensor scanning method and a computer device, which can shorten the scanning time of each execution period, help to improve the response speed, and thus improve the running stability of the computer device.
[0005] To achieve the above object, the embodiments of the present application adopt the following technical solutions:
[0006] In a first aspect, a sensor scanning method is provided, which is used for a computer device, the computer device comprising a management controller and a plurality of sensors, at least part of the plurality of sensors being connected to the management controller through the same channel switch, the channel switch being used for controlling the connection or disconnection between the corresponding sensor and the management controller; the method comprises: determining a target scanning sequence of the plurality of sensors; wherein, when the plurality of sensors are scanned based on at least part of different scanning sequences, the total number of target commands sent to the channel switch is different, the scanning sequence satisfying a preset condition in the total number is the target scanning sequence, and the target command is used for instructing the switching state of one channel switch; and the plurality of sensors are scanned based on the target scanning sequence to obtain the monitoring information of the plurality of sensors.
[0007] In the scheme, when scanning the plurality of sensors each time, the plurality of sensors are scanned in turn based on a predetermined target scanning order. Since the scanning order of at least part of the plurality of sensors in different scanning orders is different, when the plurality of sensors are scanned based on at least part of different scanning orders, the total number of target commands sent to the channel switch is different, and the less the total number of target commands sent to the plurality of switch channels, the less the time required to scan the plurality of sensors. Therefore, by setting the scanning order with a total number meeting a preset condition as the target scanning order, that is, setting the scanning order with a small total number as the target scanning order, the total number of target commands sent when the plurality of sensors are scanned based on the target scanning order is small, which helps to reduce the scanning time when the plurality of sensors are scanned, thereby realizing shortening the time required to scan the plurality of sensors in each execution cycle, and further realizing fast acquisition of the latest monitoring information of each sensor, which helps to improve the response speed to the abnormal state monitored by the sensor, and further helps to improve the running stability of the computer device.
[0008] In a possible implementation, the target scanning order of the plurality of sensors is determined, including: obtaining a plurality of scanning path information of the plurality of sensors; the plurality of sensors include a target sensor, and the scanning path information of the target sensor is used to indicate a target channel switch between the management controller and the target sensor; and the target scanning order is determined based on a depth-first algorithm and the plurality of scanning path information.
[0009] In the implementation, after the scanning path and the scanning depth of each sensor are determined based on the depth-first algorithm and the plurality of scanning path information of the plurality of sensors, for at least two sensors belonging to the same parent node (channel switch), the scanning order of each of the at least two child nodes is determined in the order from deep to shallow of the depth of the child node, and the target scanning order corresponding to the minimum total number of target commands can be directly obtained, which helps to quickly determine the target scanning order relative to determining a plurality of candidate scanning orders and selecting the target scanning order from the plurality of candidate scanning orders.
[0010] In another possible implementation, the target scanning order is determined based on a depth-first algorithm and a plurality of scanning path information, including: based on the depth-first algorithm and the plurality of scanning path information, the sensor identifier corresponding to each ranking position in the target scanning order is determined in turn to obtain the target scanning order.
[0011] In the implementation, a specific implementation of determining the target scanning sequence based on the depth-first algorithm is provided. In the implementation, the sensor identifier corresponding to each ranking position in the target scanning sequence is determined in sequence based on the depth-first algorithm and the plurality of scanning path information, so that the target scanning sequence is directly obtained, and the accuracy of the sensor corresponding to each ranking position in the target scanning sequence is improved.
[0012] In another possible implementation, the method further includes: obtaining a plurality of scanning path information of the plurality of sensors; the plurality of sensors include a target sensor, and the scanning path information of the target sensor is used to indicate a target channel switch between the management controller and the target sensor; determining a plurality of candidate scanning sequences of the plurality of sensors based on the scanning path information of the plurality of sensors; and determining the target scanning sequence from the plurality of candidate scanning sequences based on a plurality of total quantities corresponding to the plurality of candidate scanning sequences; wherein a total quantity corresponding to one candidate scanning sequence is a total quantity of target commands sent to the plurality of channel switches when the plurality of sensors are scanned based on the one candidate scanning sequence.
[0013] In the implementation, the plurality of candidate scanning sequences are determined based on the plurality of scanning path information of the plurality of sensors, and then the target scanning sequence is determined from the plurality of candidate scanning sequences based on the total quantity of target commands corresponding to each candidate scanning sequence in the plurality of candidate scanning sequences. Because the total quantity of target commands corresponding to different candidate scanning sequences is determined in the implementation, not only the candidate scanning sequence with the least total quantity of corresponding target commands can be determined as the target scanning sequence, but also other candidate scanning sequences satisfying a preset condition, such as the candidate scanning sequence with a total quantity of corresponding target commands less than or equal to a first preset threshold, can be determined as the target scanning sequence, so that the diversity of the target scanning sequence is improved.
[0014] In another possible implementation, the method further includes: determining a quantity of target commands required when the target sensor is scanned based on the quantity of target channel switches and the scanning ranking of the target sensor in one candidate scanning sequence; and determining the total quantity of target commands sent to the plurality of channel switches when the plurality of sensors are scanned based on the one scanning sequence based on the quantity of target commands required when the target sensor is scanned.
[0015] In the implementation, a specific implementation of determining the total quantity of target commands corresponding to the candidate scanning sequence is provided. In the implementation, the total quantity of target commands corresponding to the candidate scanning sequence is obtained by determining the quantity of target commands required for each sensor in the plurality of sensors when the plurality of sensors are scanned based on the candidate scanning sequence, which is simple and convenient, and helps to improve the accuracy and speed of determining the total quantity of target commands corresponding to the candidate scanning sequence.
[0016] In a possible implementation, the preset condition is met by that: the total number of the target commands corresponding to the target scanning sequence is less than or equal to a first preset threshold.
[0017] In this implementation, by setting the total number of the target commands corresponding to the target scanning sequence to be less than or equal to the first preset threshold, the total number of the target commands corresponding to the determined target scanning sequence can be effectively controlled by setting a reasonable first preset threshold, which helps to reduce the time for scanning the plurality of sensors and further helps to shorten the response time.
[0018] In addition, when the target scanning sequence is determined based on this manner, on the one hand, since one scanning sequence of the plurality of sensors is determined, whether the one scanning sequence can be used as the target scanning sequence can be determined according to the relationship between the total number of the target commands corresponding to the one scanning sequence and the first preset threshold, that is, it is not necessary to compare the total number of the target commands corresponding to the one scanning sequence with the total number of the target commands corresponding to other scanning sequences, and thus it is not necessary to determine the total number of the target commands corresponding to other scanning sequences, which helps to improve the speed of determining the target scanning sequence. On the other hand, since the scanning sequence corresponding to the total number of the target commands is less than or equal to the first preset threshold, the scanning sequence can be used as the target scanning sequence, and thus the diversity of the target scanning sequence is improved.
[0019] In a possible implementation, the preset condition is met by that: the total number of the target commands corresponding to the target scanning sequence is the smallest in a plurality of total numbers corresponding to a plurality of candidate scanning sequences; and the total number corresponding to one candidate scanning sequence is the total number of the target commands sent to the plurality of channel switches when the plurality of sensors are scanned based on the one candidate scanning sequence.
[0020] In this implementation, by setting the total number of the target commands corresponding to the target scanning sequence to be the smallest in the plurality of total numbers corresponding to the plurality of candidate scanning sequences, the time for scanning the plurality of sensors can be maximally reduced, and further the response time can be maximally shortened.
[0021] In a possible implementation, the management controller includes a main processor and a coprocessor; and the method is specifically executed by the main processor.
[0022] In this implementation, the method is executed by the main processor, and since the processing capability of the main processor is higher than that of the coprocessor, the method executed by the main processor helps to further shorten the time for scanning the plurality of sensors and further helps to shorten the response time.
[0023] In a possible implementation, the management controller includes a main processor and a coprocessor; and the method is specifically executed by the coprocessor.
[0024] In the implementation, the method is executed by the coprocessor, and since the host processor needs to process most of the tasks required by the processor management controller, the scheme of the application is executed by the coprocessor, so that when the number of sensors is large and the scanning task is heavy, the occupation rate of the host processor can be prevented from being too high, for example, the time when the occupation rate is 100% is normal, and thus the response time of other tasks processed by the host processor can be prevented from being affected.
[0025] In another possible implementation, the plurality of sensors include a target sensor, and when the method is executed by the coprocessor, the method further includes: if the current monitoring information of the target sensor meets an alarm condition, the coprocessor sends the current monitoring information of the target sensor to the host processor; and the current monitoring information of the target sensor is used to instruct the host processor to perform an alarm operation.
[0026] In the implementation, when the plurality of sensors are scanned by the coprocessor, if the current monitoring information of the target sensor meets an alarm condition, the coprocessor sends the current monitoring information of the target sensor to the host processor to instruct the host processor to perform an alarm operation. In this way, the scanning operation and the alarm operation are respectively executed by the two processors, which not only helps to ensure the execution efficiency of the scanning operation and the alarm operation, but also helps to reduce the task amount of the two processors and prevent the occupation rate of a single processor from being too high.
[0027] In another possible implementation, the current monitoring information of the target sensor meets an alarm condition, including: the current monitoring information of the target sensor is different from historical monitoring information of the target sensor; or a difference between the current monitoring information of the target sensor and a second preset threshold is greater than or equal to a preset value; or a difference between the current monitoring information of the target sensor and the historical monitoring information of the target sensor is greater than or equal to a preset value.
[0028] In another possible implementation, the management controller includes a processor, and the processor includes a plurality of cores; and the method is specifically executed by a specified core in the plurality of cores.
[0029] In the implementation, the method is executed by a specified core in the plurality of cores, so that when the number of sensors is large and the scanning task is heavy, the occupation rate of the management controller can be prevented from being too high, for example, the time when the occupation rate is 100% is normal, and thus the response time of other tasks processed by the management controller can be prevented from being affected.
[0030] In a second aspect, a sensor scanning apparatus is provided, which comprises functional units for performing any of the methods provided in the first aspect, and each functional unit performs an action by hardware or by hardware executing corresponding software. For example, the sensor scanning apparatus can comprise a processing unit and a scanning unit; the processing unit is configured to determine a target scanning order of a plurality of sensors; wherein a total number of target commands sent to the channel switch is different when the plurality of sensors are scanned based on at least partially different scanning orders, and a scanning order satisfying a preset condition in the total number is the target scanning order, and the target commands are used to instruct the channel switch to switch states; and the scanning unit is configured to scan the plurality of sensors based on the target scanning order to obtain monitoring information of the plurality of sensors.
[0031] In a third aspect, a computer device is provided, which comprises a management controller and a plurality of sensors, at least part of the plurality of sensors are connected to the management controller through a same channel switch, and the channel switch is used to control connection or disconnection between a corresponding sensor and the management controller; the management controller is configured to determine a target scanning order of the plurality of sensors; wherein a total number of target commands sent to the channel switch is different when the plurality of sensors are scanned based on at least partially different scanning orders, and a scanning order satisfying a preset condition in the total number is the target scanning order, and the target commands are used to instruct the channel switch to switch states; and the management controller is further configured to scan the plurality of sensors based on the target scanning order to obtain monitoring information of the plurality of sensors.
[0032] It should be noted that, in the third aspect, the management controller can also perform any of the possible implementation manners of the first aspect, which will not be described herein.
[0033] In a fourth aspect, a computer device is provided, which comprises a management controller and a plurality of sensors, at least part of the plurality of sensors are connected to the management controller through a same channel switch, and the channel switch is used to control connection or disconnection between a corresponding sensor and the management controller; the management controller comprises a main processor and a coprocessor; the coprocessor is configured to determine a target scanning order of the plurality of sensors; wherein a total number of target commands sent to the channel switch is different when the plurality of sensors are scanned based on at least partially different scanning orders, and a scanning order satisfying a preset condition in the total number is the target scanning order, and the target commands are used to instruct the channel switch to switch states; and the coprocessor is further configured to scan the plurality of sensors based on the target scanning order to obtain monitoring information of the plurality of sensors.
[0034] Optionally, the coprocessor is specifically configured to: acquire a plurality of scanning path information of a plurality of sensors; the plurality of sensors comprises a target sensor, and the scanning path information of the target sensor is used to indicate a target channel switch between the coprocessor and the target sensor; and determine the target scanning order based on the depth-first algorithm and the plurality of scanning path information.
[0035] Optionally, the coprocessor is specifically configured to: sequentially determine a sensor identifier corresponding to each ranking position in the target scanning order based on the depth-first algorithm and the plurality of scanning path information, to obtain the target scanning order.
[0036] Optionally, the coprocessor is specifically configured to: acquire a plurality of scanning path information of a plurality of sensors; the plurality of sensors comprises a target sensor, and the scanning path information of the target sensor is used to indicate a target channel switch between the coprocessor and the target sensor; determine a plurality of candidate scanning orders of the plurality of sensors based on the scanning path information of the plurality of sensors; and determine the target scanning order from the plurality of candidate scanning orders based on a plurality of total quantities corresponding to the plurality of candidate scanning orders; wherein a total quantity corresponding to one candidate scanning order is a total quantity of target commands sent to a plurality of channel switches when the plurality of sensors are scanned based on the one candidate scanning order.
[0037] Optionally, the coprocessor is further configured to: determine a quantity of target commands required when the target sensor is scanned based on the one candidate scanning order based on a quantity of the target channel switches and a scanning ranking of the target sensor in the one candidate scanning order; and determine a total quantity of target commands sent to the plurality of channel switches when the plurality of sensors are scanned based on the one candidate scanning order based on the quantity of target commands required when the target sensor is scanned.
[0038] Optionally, the preset condition is satisfied, including: the total quantity of target commands corresponding to the target scanning order is less than or equal to a first preset threshold; or the total quantity of target commands corresponding to the target scanning order is the smallest in a plurality of total quantities corresponding to a plurality of candidate scanning orders; wherein a total quantity corresponding to one candidate scanning order is a total quantity of target commands sent to a plurality of channel switches when the plurality of sensors are scanned based on the one candidate scanning order.
[0039] Optionally, the plurality of sensors comprises a target sensor; and the coprocessor is further configured to: if current monitoring information of the target sensor satisfies an alarm condition, send the current monitoring information of the target sensor to the host processor; wherein the current monitoring information of the target sensor is used to instruct the host processor to perform an alarm operation.
[0040] Optionally, the current monitoring information of the target sensor satisfies an alarm condition, including: the current monitoring information of the target sensor is different from historical monitoring information of the target sensor; or a difference between the current monitoring information of the target sensor and a second preset threshold is greater than or equal to a preset value; or a difference between the current monitoring information of the target sensor and the historical monitoring information of the target sensor is greater than or equal to the preset value.
[0041] In a fifth aspect, a computer device is provided, including: a management controller and a plurality of sensors, at least part of the plurality of sensors being connected to the management controller through a same channel switch, the channel switch being used to control connection or disconnection between a corresponding sensor and the management controller; the management controller including a main processor and a coprocessor; the main processor being used to determine a target scanning order of the plurality of sensors; wherein when the plurality of sensors are scanned based on at least part of different scanning orders, a total number of target commands sent to the channel switch is different, and a scanning order in which the total number satisfies a preset condition is the target scanning order, the target command being used to instruct the channel switch to switch a state; the main processor is further used to scan the plurality of sensors based on the target scanning order to obtain monitoring information of the plurality of sensors.
[0042] Optionally, the main processor is specifically used to: obtain a plurality of scanning path information of the plurality of sensors; the plurality of sensors include a target sensor, and the scanning path information of the target sensor is used to indicate a target channel switch between the main processor and the target sensor; and determine the target scanning order based on a depth-first algorithm and the plurality of scanning path information.
[0043] Optionally, the main processor is specifically used to: determine, based on the depth-first algorithm and the plurality of scanning path information, a sensor identifier corresponding to each ranking position in the target scanning order in sequence to obtain the target scanning order.
[0044] Optionally, the main processor is specifically used to: obtain a plurality of scanning path information of the plurality of sensors; the plurality of sensors include a target sensor, and the scanning path information of the target sensor is used to indicate a target channel switch between the main processor and the target sensor; determine a plurality of candidate scanning orders of the plurality of sensors based on the scanning path information of the plurality of sensors; and determine the target scanning order from the plurality of candidate scanning orders based on a plurality of total numbers corresponding to the plurality of candidate scanning orders; wherein a total number corresponding to one candidate scanning order is a total number of target commands sent to a plurality of channel switches when the plurality of sensors are scanned based on the one candidate scanning order.
[0045] Optionally, the main processor is further configured to: determine a number of target commands required for scanning the target sensors based on the number of target channel switches and a scanning order of the target sensors in one candidate scanning sequence; and determine a total number of target commands sent to the plurality of channel switches based on the number of target commands required for scanning the target sensors in the one scanning sequence.
[0046] Optionally, the preset condition is satisfied when: a total number of target commands corresponding to the target scanning sequence is less than or equal to a first preset threshold; or the total number of target commands corresponding to the target scanning sequence is the smallest among a plurality of total numbers corresponding to a plurality of candidate scanning sequences, wherein the total number corresponding to one candidate scanning sequence is a total number of target commands sent to the plurality of channel switches based on scanning the plurality of sensors in the one candidate scanning sequence.
[0047] In a sixth aspect, a computer device is provided, including: a management controller and a plurality of sensors, at least part of the plurality of sensors being connected to the management controller through a same channel switch, the channel switch being configured to control connection or disconnection between a corresponding sensor and the management controller; the management controller including a processor, the processor including a plurality of cores; one designated core of the plurality of cores being configured to determine a target scanning sequence of the plurality of sensors; wherein a total number of target commands sent to the channel switch is different when the plurality of sensors are scanned based on at least partially different scanning sequences, the scanning sequence satisfying a preset condition is the target scanning sequence, and the target commands are configured to instruct the channel switch to switch states; and the one designated core is further configured to scan the plurality of sensors based on the target scanning sequence to obtain monitoring information of the plurality of sensors.
[0048] Optionally, the one designated core is specifically configured to: obtain a plurality of scanning path information of the plurality of sensors; the plurality of sensors including a target sensor, the scanning path information of the target sensor being configured to indicate a target channel switch between the processor and the target sensor; and determine the target scanning sequence based on a depth-first algorithm and the plurality of scanning path information.
[0049] Optionally, the one designated core is specifically configured to: determine, based on the depth-first algorithm and the plurality of scanning path information, a sensor identifier corresponding to each ordered position in the target scanning sequence in sequence to obtain the target scanning sequence.
[0050] Optionally, the one designated kernel is further configured to: obtain scan path information of the plurality of sensors; the scan path information of the target sensor is used to indicate a target channel switch between the processor and the target sensor; determine a plurality of candidate scan sequences of the plurality of sensors based on the scan path information of the plurality of sensors; determine a target scan sequence from the plurality of candidate scan sequences based on a total number of target commands corresponding to the plurality of candidate scan sequences; and the total number of target commands corresponding to one candidate scan sequence is based on a total number of target commands sent to the plurality of channel switches when the plurality of sensors are scanned according to the one candidate scan sequence.
[0051] Optionally, the one designated kernel is further configured to: determine a number of target commands required when the target sensor is scanned according to the one candidate scan sequence based on the number of target channel switches and the scan order of the target sensor in the one candidate scan sequence; and determine a total number of target commands sent to the plurality of channel switches when the plurality of sensors are scanned according to the one scan sequence based on the number of target commands required when the target sensor is scanned.
[0052] Optionally, the preset condition is met, including: the total number of target commands corresponding to the target scan sequence is less than or equal to a first preset threshold; or the total number of target commands corresponding to the target scan sequence is the smallest in the plurality of total numbers corresponding to the plurality of candidate scan sequences; and the total number corresponding to one candidate scan sequence is based on a total number of target commands sent to the plurality of channel switches when the plurality of sensors are scanned according to the one candidate scan sequence.
[0053] In a seventh aspect, a computer device is provided, including: a processor and a memory, the processor being connected to the memory. The memory is configured to store computer execution instructions, and the processor is configured to execute the computer execution instructions stored in the memory, thereby realizing any one of the methods provided in the first aspect.
[0054] In an eighth aspect, a chip is provided, including: a processor and an interface circuit; the interface circuit is configured to receive code instructions and transmit the code instructions to the processor; and the processor is configured to run the code instructions to execute any one of the methods provided in the first aspect.
[0055] In a ninth aspect, a computer readable storage medium is provided, which stores computer execution instructions, and when the computer execution instructions are run on a computer, the computer is caused to execute any one of the methods provided in the first aspect.
[0056] In a tenth aspect, a computer program product is provided, which includes computer execution instructions, and when the computer execution instructions are run on a computer, the computer is caused to execute any one of the methods provided in the first aspect.
[0057] The technical effects brought by the implementation manners of the second aspect to the tenth aspect can refer to the technical effects brought by the implementation manners of the first aspect, which will not be described here. BRIEF DESCRIPTION OF DRAWINGS
[0058] Figure 1 An architecture diagram of a computer device provided by an embodiment of the present application is shown in FIG. 1.
[0059] Figure 2 A distribution diagram of a sensor provided by an embodiment of the present application is shown in FIG. 2.
[0060] Figure 3 A structure diagram of a management controller provided by an embodiment of the present application is shown in FIG. 3.
[0061] Figure 4 A flowchart of a sensor scanning method provided by an embodiment of the present application is shown in FIG. 4.
[0062] Figure 5 A flowchart of another sensor scanning method provided by an embodiment of the present application is shown in FIG. 5.
[0063] Figure 6 A flowchart of another sensor scanning method provided by an embodiment of the present application is shown in FIG. 6.
[0064] Figure 7 A flowchart of another sensor scanning method provided by an embodiment of the present application is shown in FIG. 7.
[0065] Figure 8 A schematic diagram of a sensor scanning device provided by an embodiment of the present application is shown in FIG. 8. DETAILED DESCRIPTION
[0066] The technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings.
[0067] In the description of the present application, unless otherwise specified, " / " represents a "or" relationship between the objects before and after the " / ", for example, A / B can represent A or B; "and / or" in the present application is only a description of the association relationship between the associated objects, which means that there can be three relationships, for example, A and / or B, which can represent three cases: A exists alone, A and B exist together, and B exists alone, where A and B can be singular or plural.
[0068] Also, in the description of the present application, unless otherwise specified, "multiple" refers to two or more than two. "At least one of the following" or the like refers to any combination of the items, including any combination of single or multiple items. For example, at least one of a, b, or c can mean a, b, c, a-b, a-c, b-c, or a-b-c, where a, b, and c can be single or multiple.
[0069] In addition, in order to facilitate the clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, "first", "second" and the like are used to distinguish the same items or similar items with basically the same function and effect. Those skilled in the art can understand that "first", "second" and the like do not limit the quantity and execution order, and "first", "second" and the like do not necessarily mean different. At the same time, in the embodiments of the present application, "exemplary" or "for example" is used to represent as an example, illustration or description. Any embodiment or design scheme described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as more preferred or more advantageous than other embodiments or design schemes. Rather, "exemplary" or "for example" is used to present the relevant concept in a specific manner, for understanding.
[0070] First, the application scenario of the embodiments of the present application is exemplarily introduced.
[0071] With the increasing importance of the running stability of computer equipment, there are more and more sensors on the computer equipment for monitoring the running state information. In order to better ensure the running stability of the computer equipment, the management controller on the computer equipment usually randomly scans each sensor according to a preset period to obtain the monitoring information stored in each sensor. In this way, according to the monitoring information in each sensor, it can be judged whether the running state is normal, so that when the running state is abnormal, it can be processed in time.
[0072] However, since the scanning of each sensor takes time, with the increase of the number of sensors, the scanning time required for each execution period becomes longer and longer, for example, a sensor needs to spend 100 milliseconds (ms), and the number of sensors configured by the computer equipment is usually 50-100, so the scanning time required for each execution period will be up to 5s-10s, which causes the management controller to be unable to quickly enter the next execution period. In this case, the management controller cannot quickly obtain the latest monitoring information of each sensor, which further causes the inability to respond to abnormal states in the running process in time, seriously affecting the running stability.
[0073] For example, when the business pressure of the computer device increases suddenly, the temperature of part components increases, and the heat dissipation needs to be performed quickly, if the temperature increase of the part components cannot be found in time through the monitoring information stored in the sensor, that is, the heat dissipation of the part components cannot be performed in time, this will cause the service life of the components to be shortened due to the high temperature, and even the components are damaged.
[0074] Therefore, the embodiments of the present application provide a sensor scanning method, when scanning a plurality of sensors each time, a plurality of sensors are scanned in turn based on a predetermined target scanning order. Since the scanning orders of at least part of the plurality of sensors in different scanning orders are different, when the plurality of sensors are scanned based on at least part of the different scanning orders, the total number of target commands sent to the channel switch is different, and the less the total number of target commands sent to the plurality of switch channels, the less the time required to scan the plurality of sensors. Therefore, by setting the scanning order with the total number meeting the preset condition as the target scanning order, that is, setting the scanning order with the total number being less as the target scanning order, the total number of target commands sent when the plurality of sensors are scanned based on the target scanning order is less, which helps to reduce the scanning time used when the plurality of sensors are scanned, so as to shorten the time required when the plurality of sensors are scanned in each execution period, and further to quickly obtain the latest monitoring information of each sensor, which helps to improve the response speed to the abnormal state monitored by the sensor, and further to improve the running stability of the computer device.
[0075] Secondly, the system architecture of the embodiments of the present application is exemplarily introduced.
[0076] As shown in Figure 1 , it is an architecture diagram of a computer device. The computer device can include a mainboard, a management controller, and a plurality of sensors.
[0077] Next, the above computer device, management controller, and plurality of sensors are exemplarily introduced respectively.
[0078] The computer device can be a terminal device or a network device. The terminal device can be referred to as a terminal, a user equipment (UE), a terminal device, an access terminal, a subscriber unit, a subscriber station, a mobile station, a remote station, a remote terminal, a mobile device, a user terminal, a wireless communication device, a user agent, or a user device, etc. The terminal device can be an augmented reality (AR) device, a virtual reality (VR) device, a tablet computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), etc. The network device can be a server, etc. The server can be one physical or logical server, or two or more physical or logical servers sharing different responsibilities, or cooperating with each other to implement the functions of the server.
[0079] It should be noted that the specific form of the computer device is not limited in the embodiments of the present application, and the above is only an exemplary description. In the following embodiments, only the computer device as a server is taken as an example for description.
[0080] The management controller is completely independent of the central processor of the computer device, can communicate with the central processor through the out-of-band management interface of the computer device, and can perform remote maintenance and management on the computer device through a dedicated data channel.
[0081] In some embodiments, the management controller is connected to the mainboard through a slot on the mainboard. In other embodiments, the management controller is integrated on the mainboard.
[0082] In the embodiments of the present application, the management controller is mainly used to determine a target scanning sequence, scan a plurality of sensors based on the target scanning sequence, and perform an alarm operation when the current monitoring information of the target sensor meets an alarm condition.
[0083] For example, the management controller can be a monitoring management unit outside the computer device, a management system in a management chip outside the processor, a baseboard management controller (BMC), or a system management module (SMM). It should be noted that the specific form of the management controller is not limited in the embodiments of the present application, and the above is only an exemplary description. In the following embodiments, only the management controller as a BMC is taken as an example for description.
[0084] It should be noted that different computer devices have different names for the BMC, for example, some computer devices are called BMC, some computer devices are called iLO, and another computer device is called iDRAC. Whether it is called BMC, iLO or iDRAC can be understood as BMC in the embodiments of the application.
[0085] A plurality of sensors are used to monitor a plurality of state information during the operation of the computer device, such as whether the power is in place, whether the fan is on, the inlet temperature, the hard disk temperature, the central processing unit temperature, etc. Specifically, the state information is collected and the collected state information is stored.
[0086] Among them, different sensors are used to monitor different state information, that is, the sensor corresponds to the state information one by one.
[0087] In some embodiments, a part of the plurality of sensors can be arranged on the mainboard, and another part of the plurality of sensors can be arranged on the components connected to the mainboard, such as backplane, network card, hard disk, graphics card, etc.
[0088] As shown in FIG. 1, it is a distribution diagram of a plurality of sensors on the computer device shown in FIG. 1. Figure 2 Figure 1 As shown in FIG. 1, it is a distribution diagram of a plurality of sensors on the computer device shown in FIG. 1.
[0089] Optionally, the computer device comprises a plurality of channel switches.
[0090] The management controller is connected with the plurality of sensors through the plurality of channel switches, and each channel switch in the plurality of channel switches is used to control the connection or disconnection between the corresponding sensor and the management controller. For example, channel switch 1, channel switch 2, and channel switch 3 are used to control the connection or disconnection between the corresponding sensor and the management controller.
[0091] Among them, channel switch 1 is used to control the connection or disconnection between the management controller and sensor 1, sensor 2, sensor 3, sensor 4, and sensor 5. Channel switch 2 is used to control the connection or disconnection between the management controller and sensor 1 and sensor 2. Channel switch 3 is used to control the connection or disconnection between the management controller and sensor 4 and sensor 5.
[0092] Based on the above, the corresponding sensor can be considered as the sensor corresponding to the channel switch. Among them, the sensor corresponding to the channel switch can be considered as the sensor directly connected to the channel switch (such as sensor 3) and the sensor indirectly connected to the channel switch (such as sensor 1, sensor 2, sensor 4, and sensor 5).
[0093] Optionally, at least part of the plurality of sensors is connected with the management controller through the same channel switch.
[0094] In some embodiments, at least some of the sensors are connected to the management controller via multiple identical channel switches.
[0095] like Figure 2 As shown, the management controller shares channel switches 0 and 1 with sensors 1, 2, 3, 4, and 5. That is, sensors 1, 2, 3, 4, and 5 are all connected to the management controller via channel switches 0 and 1. The management controller also shares channel switches 0, 1, and 2 with sensors 1 and 2. Finally, the management controller shares channel switches 0, 1, and 3 with sensors 4 and 5.
[0096] In other embodiments, at least some of the sensors are connected to the management controller via a common channel switch.
[0097] Optionally, different sensors and the management controller can be connected via different channel switches. Optionally, any two components can be connected via a bus. This component includes the management controller, channel switches, and sensors.
[0098] The bus can be an inter-integrated circuit (I2C) bus or a serial general purpose input output (SGPIO) bus. This application does not limit the type of bus.
[0099] The channel switch can be any component capable of controlling the connection or disconnection of the bus between the channel switch and the corresponding component, such as a bus controller; this embodiment does not impose any limitations on this. Furthermore, the corresponding component refers to the component connected to the output terminal of the channel switch.
[0100] The following example illustrates the connection relationship between the management controller, the channel switches, and the sensors, using multiple sensors including sensor 1, sensor 2, sensor 3, sensor 4, and sensor 5, and multiple channel switches including channel switch 0, channel switch 1, channel switch 2, and channel switch 3.
[0101] The pass switch 0, the pass switch 1 and the pass switch 2 are arranged between the management controller and the sensor 1. The pass switch 0, the pass switch 1 and the pass switch 2 are arranged between the management controller and the sensor 2. The pass switch 0 and the pass switch 1 are arranged between the management controller and the sensor 3. The pass switch 0, the pass switch 1 and the pass switch 3 are arranged between the management controller and the sensor 4. The pass switch 0, the pass switch 1 and the pass switch 3 are arranged between the management controller and the sensor 5.
[0102] As can be seen from the above, the same pass switches between the management controller and the sensor 1, the sensor 2, the sensor 3, the sensor 4 and the sensor 5 include the pass switch 0 and the pass switch 1. The same pass switches between the management controller and the sensor 1 and the sensor 2 include the pass switch 0, the pass switch 1 and the pass switch 2. The same pass switches between the management controller and the sensor 4 and the sensor 6 include the pass switch 0, the pass switch 1 and the pass switch 3.
[0103] The pass switch 0 is used to control the connection or disconnection between the management controller and the sensor 1, the sensor 2, the sensor 3, the sensor 4 and the sensor 5. The pass switch 1 is used to control the connection or disconnection between the management controller and the sensor 1, the sensor 2, the sensor 3, the sensor 4 and the sensor 5. The pass switch 2 is used to control the connection or disconnection between the management controller and the sensor 1 and the sensor 2. The pass switch 3 is used to control the connection or disconnection between the management controller and the sensor 4 and the sensor 5.
[0104] Specifically, the pass switch 0 can control the connection or disconnection between the components connected to any one of the bus 00, the bus 01, …, the bus 0n and the pass switch 0. For example, the pass switch 0 can control the connection or disconnection between the pass switch 1 connected to the bus 00 and the pass switch 0.
[0105] It should be noted that for a plurality of buses connected to one pass switch, the one pass switch can only control the connection or disconnection between the components connected to one bus and the one pass switch.
[0106] For example, at present, the pass switch 2 and the sensor 1 connected to the bus 20 are in the connected state, and the pass switch 2 and the sensor 2 connected to the bus 21 are in the disconnected state. If it is needed to switch the pass switch 2 and the sensor 2 connected to the bus 21 to the connected state, it is needed to first send a target command 1 to the pass switch 2 to switch the pass switch 2 and the sensor 1 connected to the bus 20 to the disconnected state, and then send a target command 2 to the pass switch 2 to switch the pass switch 2 and the sensor 2 connected to the bus 21 to the connected state.
[0107] It is to be noted that if the communication between the channel switch 0 and the channel switch 1 is connected, it can be considered that the bus 00 connecting the channel switch 0 and the channel switch 1 is also connected. If the communication between the channel switch 0 and the channel switch 1 is disconnected, it can be considered that the bus 00 connecting the channel switch 0 and the channel switch 1 is also disconnected.
[0108] The channel switch 1 can control the communication or disconnection between the components connected to any one of the bus 10, the bus 11, the bus 12, …, the bus 1n and the channel switch 1. For example, the channel switch 1 can control the communication or disconnection between the channel switch 2 connected to the bus 10 and the channel switch 1, control the communication or disconnection between the sensor 3 connected to the bus 11 and the channel switch 1, and control the communication or disconnection between the channel switch 3 connected to the bus 12 and the channel switch 1.
[0109] The channel switch 2 can control the communication or disconnection between the components connected to any one of the bus 20, the bus 21 and the channel switch 2. For example, the channel switch 2 can control the communication or disconnection between the sensor 1 connected to the bus 20 and the channel switch 2, and control the communication or disconnection between the sensor 2 connected to the bus 21 and the channel switch 2.
[0110] The channel switch 3 can control the communication or disconnection between the components connected to any one of the bus 30, the bus 31 and the channel switch 3. For example, the channel switch 3 can control the communication or disconnection between the sensor 4 connected to the bus 30 and the channel switch 3, and control the communication or disconnection between the sensor 5 connected to the bus 31 and the channel switch 3.
[0111] It can be understood that if the communication between two components is connected, the communication between the two components can be carried out. For example, if the communication between the management controller and the sensor 1 is connected, the communication between the management controller and the sensor can be carried out, such as transmitting a target command, transmitting a command, etc.
[0112] It can be understood that if the communication between two components is connected, the communication between the two components can be carried out. For example, if the communication between the management controller and the sensor 1 is connected, the communication between the management controller and the sensor can be carried out, such as transmitting a target command, transmitting a command, etc.
[0113] As shown in FIG. 1, the management controller is connected to the sensor 1 through the channel switch 0 and the channel switch 1, and the sensor 1 is connected to the sensor 2 through the channel switch 2. The management controller is connected to the sensor 4 through the channel switch 1 and the channel switch 3, and the sensor 4 is connected to the sensor 5 through the channel switch 3. Figure 3 As shown in FIG. 1, the management controller is connected to the sensor 1 through the channel switch 0 and the channel switch 1, and the sensor 1 is connected to the sensor 2 through the channel switch 2. The management controller is connected to the sensor 4 through the channel switch 1 and the channel switch 3, and the sensor 4 is connected to the sensor 5 through the channel switch 3. Figure 1 As shown in FIG. 1, the management controller is connected to the sensor 1 through the channel switch 0 and the channel switch 1, and the sensor 1 is connected to the sensor 2 through the channel switch 2. The management controller is connected to the sensor 4 through the channel switch 1 and the channel switch 3, and the sensor 4 is connected to the sensor 5 through the channel switch 3.
[0114] Optionally, the management controller comprises a main processor, a coprocessor, a memory and a connection port. The main processor is connected with the coprocessor, and the main processor and the coprocessor are respectively connected with the memory and the connection port, and the main processor and the coprocessor are also connected in communication.
[0115] It should be noted that the memory is a non-volatile storage medium. In addition, the embodiments of the present application do not limit the type of non-volatile storage medium, for example, it can be a non-volatile storage medium such as a flash memory.
[0116] The main processor is mainly used to execute most of the tasks required by the management controller.
[0117] The coprocessor is mainly used to execute a small part of the tasks required by the management controller.
[0118] The memory is mainly used to store the firmware program of the management controller, the monitoring information obtained by the scanning sensor, etc.
[0119] The connection port is mainly used to connect with the bus, so that the main processor and the coprocessor can use the bus to send commands such as target commands and scanning commands, and obtain monitoring information in the sensor.
[0120] Optionally, the coprocessor comprises a scanning arrangement module and a message notification module. The main processor comprises an alarm processing module. The firmware programs of the scanning arrangement module, the message notification module and the alarm processing module are stored in the memory.
[0121] The scanning arrangement module can be used to determine the target scanning sequence, and specific reference can be made to the first part of the following embodiments. In addition, it can also be used to scan the plurality of sensors in turn based on the target scanning sequence, and specific reference can be made to the third part of the following embodiments.
[0122] The message notification module can be used to send the current monitoring information of the target sensor to the alarm processing module when the current monitoring information of the target sensor meets the alarm condition, so as to instruct the alarm processing module to execute the alarm operation, and specific reference can be made to the third part of the following embodiments.
[0123] The alarm processing module can be used to execute the target alarm operation corresponding to the target sensor when receiving the current monitoring information of the target sensor sent by the notification module, and specific reference can be made to the third part of the following embodiments.
[0124] Optionally, the management controller can comprise a processor comprising a plurality of cores.
[0125] In some embodiments, the management controller can comprise a main processor and a coprocessor, and the plurality of cores refer to the plurality of cores included in the main processor.
[0126] In some embodiments, the management controller includes a plurality of processors, and the plurality of cores refer to cores included in the plurality of processors.
[0127] It should be noted that the system architecture and application scenarios described in the embodiments of the present application are for more clearly illustrating the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application. Those skilled in the art can know that, with the evolution of system architecture and the appearance of new business scenarios, the technical solutions provided by the embodiments of the present application are also applicable to similar technical problems.
[0128] For ease of understanding, the sensor scanning method provided by the present application is exemplarily introduced below in combination with the drawings. The method is applicable to Figures 1 to 3 the computer device shown.
[0129] The following embodiments of the present application will be divided into three parts to exemplarily introduce the scheme of the sensor scanning method.
[0130] The first part introduces the process of determining the target scanning order of the plurality of sensors in combination with Figure 4 . Among them, this part can be executed by the main processor, the coprocessor or a specified core in the plurality of cores.
[0131] The second part introduces the process of the main processor scanning the plurality of sensors based on the target scanning order in the first part in combination with Figure 5 .
[0132] The third part introduces the process of the coprocessor scanning the plurality of sensors based on the target scanning order in the first part in combination with Figure 6 .
[0133] The fourth part introduces the process of a specified core in the plurality of cores scanning the plurality of sensors based on the target scanning order in the first part in combination with Figure 7 .
[0134] Figure 4 is a flowchart of a sensor scanning method according to an exemplary embodiment. Exemplarily, the method includes S401-S403.
[0135] As shown above, the computer device includes a management controller and a plurality of sensors, at least part of the plurality of sensors is connected with the management controller through the same channel switch, and the channel switch is used to control the connection or disconnection between the corresponding sensor and the management controller.
[0136] Optionally, S401-S403 can be executed by the main processor, the coprocessor or a specified core in the plurality of cores.
[0137] The following describes S401-S403 by taking the example of the execution of S401-S403 by the coprocessor.
[0138] For example, the coprocessor can be considered to call the execution of the scheduling scanning module in the memory when the coprocessor executes the following S401-S403.
[0139] It should be noted that the execution principle of S401-S403 executed by the main processor or the specified one of the plurality of cores is the same as the principle of the execution of the following S401-S403 by the coprocessor, and therefore, the process of the execution of S401-S403 by the main processor or the specified one of the plurality of cores can be referred to the following embodiments, and subsequent details will not be described.
[0140] S401: The coprocessor obtains a plurality of scanning path information of a plurality of sensors.
[0141] The plurality of sensors include a target sensor, and the scanning path information of the target sensor is used to indicate a target channel switch between the management controller and the target sensor.
[0142] It should be noted that the target sensor can be any one of the plurality of sensors.
[0143] In some embodiments, the scanning path information of each sensor of the plurality of sensors is pre-stored in the memory of the management controller, and the coprocessor obtains the plurality of scanning path information of the plurality of sensors from the memory.
[0144] For example, the plurality of sensors shown in FIG. 1 are taken as an example to exemplarily describe the scanning path information of the target sensor. Figure 2
[0145] If sensor 1 is the target sensor, the scanning path information of the target sensor can include channel switch 0, channel switch 1, and channel switch 2.
[0146] Based on this, if sensor 1 is to be scanned, the coprocessor needs to send a target command to channel switch 0 to control the channel switch 0 and the channel switch 1 to be in a connected state, send a target command to channel switch 1 to control the channel switch 1 and the channel switch 2 to be in a connected state, and send a target command to channel switch 2 to control the channel switch 2 and sensor 1 to be in a connected state.
[0147] It should be noted that when sensor 2, sensor 3, sensor 4, or sensor 5 is the target sensor, the scanning path information of the target sensor can refer to the description of the above-mentioned sensor 1 as the target sensor, and details will not be described here.
[0148] S402: The coprocessor determines the target scanning order based on multiple scanning path information from multiple sensors.
[0149] Among them, the target scanning order is the scanning order in which the total number of target commands corresponding to the target scanning order meets the preset conditions. The target commands are used to indicate the channel switch switching status.
[0150] The total number of target commands corresponding to the target scanning sequence refers to the total number of target commands sent to the channel switch when scanning multiple sensors based on the target scanning sequence.
[0151] In particular, for different scanning sequences of multiple sensors, since at least some of the sensors in the different scanning sequences have different scanning order, the bus between the management controller and the sensor is in a connected state or a disconnected state when scanning the same sorted position of the sensor in different scanning sequences. Therefore, when scanning multiple sensors based on at least some different scanning sequences, the total number of target commands sent to the channel switch is different.
[0152] Here, "at least partially different scanning orders" means that among multiple different scanning orders, at least two different scanning orders correspond to different total numbers of target commands. The total number of target commands corresponding to a single scanning order refers to the total number of target commands sent to the channel switch when scanning multiple sensors based on that single scanning order.
[0153] For example, such as Figure 2 As shown, different scanning sequences include Scanning Sequence 1 and Scanning Sequence 2. Scanning Sequence 1 consists of Sensor 1, Sensor 5, Sensor 2, Sensor 3, and Sensor 4, while Scanning Sequence 2 consists of Sensor 1, Sensor 2, Sensor 3, Sensor 4, and Sensor 5. It can be seen that the second, third, fourth, and fifth sensors are different in Scanning Sequence 1 and Scanning Sequence 2; therefore, Scanning Sequence 1 and Scanning Sequence 2 are different scanning sequences.
[0154] When scanning sensors 1, 5, 2, 3, and 4 sequentially based on scan order 1, the total number of target commands to be sent is 17. When scanning sensors 1, 2, 3, 4, and 5 sequentially based on scan order 2, the total number of target commands to be sent is 13. It can be seen that the total number of target commands sent to the channel switch differs depending on whether multiple sensors are scanned using scan order 1 or scan order 2.
[0155] It should be noted that how to calculate the total number of target commands corresponding to the scanning order 1 and the scanning order 2 respectively will be described in subsequent embodiments. For details, refer to the related description of the candidate scanning order 1 and the candidate scanning order 2 in the following mode 2, which will not be described here.
[0156] It can be understood that the more the total number of target commands is, the longer the time required for scanning multiple sensors is, which will inevitably lead to slower response speed and further lead to failure to respond to abnormal states in time.
[0157] Therefore, if the total number of target commands sent to the multiple channel switches when scanning multiple sensors based on the target scanning order meets the preset condition, the total number of target commands corresponding to the target scanning order can be limited through the preset condition, so as to reduce the total number of target commands sent when scanning multiple sensors based on the target scanning order, and further shorten the time required for scanning multiple sensors and improve the response speed.
[0158] The target command is used to instruct the channel switch to switch the state. That is, to switch the state between the channel switch and the connected component. For example, to switch from the connected state to the disconnected state, or to switch from the disconnected state to the connected state.
[0159] In other words, the target command is used to instruct the channel switch to switch the connected state or the disconnected state between the channel switch and the connected component.
[0160] For example, the state between the channel switch 2 and the sensor 1 is connected, and the state between the channel switch 2 and the sensor 2 is disconnected. If the management controller can send the target command 3 to the channel switch 1 to control the state between the channel switch 2 and the sensor 1 to be disconnected, the channel switch 2 will switch the state between the channel switch 2 and the sensor 1 from the connected state to the disconnected state. Then, the management controller sends the target command 4 to the channel switch 2 to control the state between the channel switch 2 and the sensor 2 to be connected, and the channel switch 2 will switch the state between the channel switch 2 and the sensor 2 from the disconnected state to the connected state. The target scanning order indicates the order of each sensor in the scanning process.
[0161] Optionally, the target command includes an open command and a close command. The open command is used to instruct the channel switch to switch to the connected state, and the close command is used to instruct the channel switch to switch to the disconnected state.
[0162] Optionally, the target command includes an identification of a component to be connected or an identification of a component to be disconnected.
[0163] The open command includes the identification of the component to be connected. The close command includes the identification of the component to be disconnected.
[0164] The channel switch receives the target command of the management controller, and if the target command is an opening command, the channel switch controls the component to be in a connected state with the component indicated by the identification of the component carried by the target command.
[0165] In some embodiments, based on the scanning path information of the target sensor described above, the number of target commands required to be sent when scanning the target sensor can be determined. On this basis, based on the plurality of scanning path information of the plurality of sensors, the total number of target commands required to be sent when scanning the plurality of sensors can be determined.
[0166] Optionally, the preset condition is met, including: the total number of target commands corresponding to the target scanning sequence is less than or equal to a first preset threshold.
[0167] In some embodiments, the first preset threshold can be set according to the time required for one target command, the total number of the plurality of sensors, and the predicted use time of scanning the plurality of sensors. For example, the time required for one target command is 0.2 seconds, the total number of the plurality of sensors is 10, the scanning time of one sensor is 0.2 seconds, and the predicted use time is 5 seconds. The first preset threshold can be set to 10, 15, etc.
[0168] Wherein, the time required for one target command refers to the time between the sending time of the one target command and the end time of the execution of the one target command.
[0169] It should be noted that when the total number of target commands corresponding to a plurality of scanning sequences is less than or equal to the first preset threshold, for example, the total number of target commands corresponding to scanning sequence 1 is less than the first preset threshold, and the total number of target commands corresponding to scanning sequence 2 is equal to the first preset threshold, any one of the plurality of scanning sequences can be determined as the target scanning sequence, for example, scanning sequence 1 or scanning sequence 2 can be determined as the target scanning sequence.
[0170] In the above embodiments, by setting the total number of target commands corresponding to the target scanning sequence to be less than or equal to the first preset threshold, by setting a reasonable first preset threshold, the total number of target commands corresponding to the determined target scanning sequence can be effectively controlled, which helps to effectively reduce the time required to scan the plurality of sensors, and further helps to effectively shorten the response time and improve the response speed.
[0171] In addition, when the target scanning sequence is determined based on the manner, on one hand, since one scanning sequence of the plurality of sensors is determined, whether the one scanning sequence can be used as the target scanning sequence can be determined according to the relationship between the total number of target commands corresponding to the one scanning sequence and the first preset threshold, that is, the total number of target commands corresponding to the one scanning sequence does not need to be compared with the total number of target commands corresponding to other scanning sequences, and thus, the total number of target commands corresponding to other scanning sequences does not need to be determined, which helps to improve the speed of determining the target scanning sequence. On the other hand, since any one scanning sequence corresponding to the total number of target commands less than or equal to the first preset threshold can be used as the target scanning sequence, the diversity of the target scanning sequence is improved.
[0172] It should be noted that the specific value of the first preset threshold in the embodiments of the present application is not limited and can be dynamically determined according to actual conditions.
[0173] Optionally, the preset condition is satisfied, including that the total number of target commands corresponding to the target scanning sequence is the smallest in the plurality of total numbers corresponding to the plurality of candidate scanning sequences.
[0174] The total number corresponding to one candidate scanning sequence is the total number of target commands sent to the plurality of channel switches when the plurality of sensors are scanned based on the one candidate scanning sequence.
[0175] In some embodiments, after the plurality of total numbers corresponding to the plurality of candidate scanning sequences are determined, the plurality of candidate scanning sequences are sorted in the order of the total number from small to large to obtain a sequence, and then, the candidate scanning sequence sorted first in the sequence is determined as the target scanning sequence. Of course, the plurality of candidate scanning sequences can also be sorted in the order of the total number from large to small, and the candidate scanning sequence sorted last in the sequence is determined as the target scanning sequence.
[0176] In some other embodiments, after the plurality of total numbers corresponding to the plurality of candidate scanning sequences are determined, the smallest total number is determined by comparing different total numbers, and the candidate scanning sequence corresponding to the smallest total number is determined as the target scanning sequence.
[0177] In the above embodiments, by setting the total number of target commands corresponding to the target scanning sequence to be the smallest in the plurality of total numbers corresponding to the plurality of candidate scanning sequences, the time required for scanning the plurality of sensors is reduced to the greatest extent, and thus, the response time is shortened to the greatest extent.
[0178] Optionally, S402 includes a plurality of implementation manners, which are exemplarily described below by way of example 1 to example 2.
[0179] The method 1 includes: determining the target scanning order based on the plurality of scanning path information and a depth-first algorithm.
[0180] In some embodiments, the plurality of sensors are scanned in the target scanning order. Figure 2 The plurality of sensors shown in FIG. 1 are taken as an example to illustrate the process of S402. The nodes traversed by the depth-first algorithm include the channel switches and the sensors.
[0181] First, the channel switch 0 is selected as the root node A, and the root node A is put into the stack. The root node A is taken out from the stack, and the child nodes of the root node A are addressed to obtain the node B1 (the channel switch 1), …, the node Bn (the channel switch or the sensor connected by the bus 0n), which are put into the stack. The node B1 is taken out from the stack, and the child nodes of the node B1 are addressed to obtain the node C1 (the channel switch 2), the node C2 (the sensor 3), the node C3 (the channel switch 3), …, the node Cn (the channel switch or the sensor connected by the bus 1n), which are put into the stack. The node C1 is taken out from the stack, and the child nodes of the node C1 are addressed to obtain the node D1 (the sensor 1), the node D2 (the sensor 2), which are put into the stack. Since the node D1 and the node D2 have no child nodes, the process returns to the node B1 to address the next unvisited child node. The node C2 is taken out from the stack, and the child nodes of the node C2 are addressed. Since the node C2 has no child nodes, the process returns to the node B1 again. The node C3 is taken out from the stack, and the child nodes of the node C3 are addressed to obtain the node E1 (the sensor 4), the node E2 (the sensor 5), which are put into the stack. At this time, the scanning path of each sensor in the plurality of sensors is traversed.
[0182] As shown above, after obtaining the scanning path of each sensor based on the depth-first algorithm and the plurality of scanning path information, the scanning order is determined based on the depth-first algorithm. The scanning order is the target scanning order. Specifically, for at least two sensors belonging to the same parent node (channel switch), the scanning order of each sensor is determined according to the scanning depth of each sensor from deep to shallow. Based on this, the scanning order 1: the scanning order of the sensor 1, the sensor 2, the sensor 3, the sensor 4, and the sensor 5, and the scanning order 2: the scanning order of the sensor 2, the sensor 1, the sensor 3, the sensor 5, and the sensor 4 can be determined. The scanning order 1 or the scanning order 2 can be taken as the target scanning order.
[0183] It should be noted that in the manner 1, the plurality of candidate scanning sequences in the "the total number of target commands corresponding to the target scanning sequence is the smallest in the plurality of total numbers corresponding to the plurality of candidate scanning sequences" refers to other scanning sequences in addition to the scanning sequences (i.e., scanning sequence 1, scanning sequence 2) determined based on the depth-first algorithm.
[0184] Optionally, the manner 1 specifically includes: based on the depth-first algorithm and the plurality of scanning path information of the plurality of sensors, determining the sensor identifier corresponding to each ranking position in the target scanning sequence in turn to obtain the target scanning sequence.
[0185] In some embodiments, after determining the scanning path of each sensor based on the depth-first algorithm and the plurality of scanning path information of the plurality of sensors, the sensor identifier corresponding to each ranking position in the target scanning sequence can be determined in turn, such as determining that the sensor identifier ranked first in the target scanning sequence is sensor 1, the sensor identifier ranked second is sensor 2, the sensor identifier ranked third is sensor 3, the sensor identifier ranked fourth is sensor 4, and the sensor identifier ranked fifth is sensor 5, thereby obtaining the target scanning sequence.
[0186] In the above-mentioned manner 1, after determining the scanning path and scanning depth of each sensor based on the depth-first algorithm and the plurality of scanning path information of the plurality of sensors, for at least two sensors belonging to the same parent node (channel switch), the scanning sequence of each child node in the at least two child nodes is determined in the order from deep to shallow according to the depth of the child node, and the target scanning sequence with the smallest total number of corresponding target commands can be directly obtained. Relative to determining a plurality of candidate scanning sequences and selecting a target scanning sequence from the plurality of candidate scanning sequences, it is helpful to quickly determine the target scanning sequence.
[0187] Manner 2: S402 includes S402a-S402b.
[0188] S402a: based on the plurality of scanning path information, determining a plurality of candidate scanning sequences of the plurality of sensors.
[0189] In some embodiments, based on the plurality of scanning path information, the plurality of candidate scanning sequences of the plurality of sensors are determined. Figure 2 Taking the plurality of sensors shown in the above-mentioned manner 1 as an example, it can be determined that the candidate scanning sequence 1 is sensor 1, sensor 5, sensor 2, sensor 3, and sensor 4. The candidate scanning sequence 2 is sensor 1, sensor 2, sensor 3, sensor 4, and sensor 5.
[0190] S402b: based on the plurality of total numbers corresponding to the plurality of candidate scanning sequences, determining the target scanning sequence from the plurality of candidate scanning sequences.
[0191] The total number of target commands corresponding to one candidate scanning sequence is based on the target commands sent to the plurality of channel switches when the plurality of sensors are scanned based on the one candidate scanning sequence.
[0192] In some embodiments, the candidate scanning sequence with the smallest total number of target commands among the plurality of candidate scanning sequences can be determined as the target scanning sequence, which helps to reduce the time required for scanning the plurality of sensors to the greatest extent, and in turn helps to shorten the response time to the greatest extent.
[0193] It should be noted that, when there are at least two candidate scanning sequences with the smallest total number of target commands, any one of the at least two candidate scanning sequences can be determined as the target scanning sequence.
[0194] In other embodiments, the candidate scanning sequence with the total number of target commands less than or equal to the first preset threshold among the plurality of candidate scanning sequences can be determined as the target scanning sequence, which helps to improve the speed of determining the target scanning sequence according to the relationship between the total number of target commands corresponding to one scanning sequence and the first preset threshold.
[0195] It should be noted that, when there are at least two candidate scanning sequences with the total number of target commands less than or equal to the first preset threshold, any one of the at least two candidate scanning sequences can be determined as the target scanning sequence.
[0196] There are various implementation manners for determining the total number corresponding to one candidate scanning sequence.
[0197] In one possible implementation manner, the total number corresponding to one candidate scanning sequence can be determined by determining the number of target commands required for each sensor in the plurality of sensors when the plurality of sensors are scanned based on the one candidate scanning sequence. The following exemplary describes this possible implementation manner through steps 1 to 2.
[0198] Step 1: Based on the number of target channel switches and the scanning order of target sensors in one candidate scanning sequence, determine the number of target commands required for scanning the target sensors based on the one candidate scanning sequence.
[0199] As shown above, the target channel switch refers to the channel switch between the coprocessor and the target sensor.
[0200] It should be noted that the target sensor can be any one of the plurality of sensors.
[0201] The following, respectively, in the candidate scanning order 1, sensor 1, sensor 5, sensor 2, sensor 3, sensor 4 as an example, respectively, for the target sensor for example, step one is described.
[0202] When scanning sensor 1, the target commands required to be sent include: sending an open command to channel switch 0 to control the communication between channel open 0 and channel switch 1; sending an open command to channel switch 1 to control the communication between channel switch 1 and channel switch 2; sending an open command to channel switch 2 to control the communication between channel switch 2 and sensor 1. Therefore, when scanning sensor 1 based on the candidate scanning order 1, the number of target commands required is 3.
[0203] When scanning sensor 5, the target commands required to be sent include: sending a closed off command to channel switch 2 to control the disconnection between channel switch 2 and sensor 1; sending a closed command to channel switch 1 to control the disconnection between channel switch 1 and channel switch 2; sending an open command to channel switch 1 to control the communication between channel switch 1 and channel switch 3; sending an open command to channel switch 3 to control the communication between channel switch 3 and sensor 5. Therefore, when scanning sensor 5 based on the candidate scanning order 1, the number of target commands required is 4.
[0204] When scanning sensor 2, the target commands required to be sent include: sending a closed command to channel switch 3 to control the disconnection between channel switch 3 and sensor 5; sending a closed command to channel switch 1 to control the disconnection between channel switch 1 and channel switch 3; sending an open command to channel switch 1 to control the communication between channel switch 1 and channel switch 2; sending an open command to channel switch 2 to control the communication between channel switch 2 and sensor 2. Therefore, when scanning sensor 2 based on the candidate scanning order 1, the number of target commands required is 4.
[0205] When scanning sensor 3, the target commands required to be sent include: sending a closed command to channel switch 2 to control the disconnection between channel switch 2 and sensor 2; sending a closed command to channel switch 1 to control the disconnection between channel switch 1 and channel switch 2; sending an open command to channel switch 1 to control the communication between channel switch 1 and sensor 3. Therefore, when scanning sensor 3 based on the candidate scanning order 1, the number of target commands required is 3.
[0206] When scanning sensor 4, the target commands required to be sent include: sending a closed command to channel switch 1 to control the disconnection between channel switch 1 and sensor 3; sending an open command to channel switch 1 to control the communication between channel switch 1 and channel switch 3; sending an open command to channel switch 3 to control the communication between channel switch 3 and sensor 4. Therefore, when scanning sensor 4 based on the candidate scanning order 1, the number of target commands required is 3.
[0207] Based on the same principle as above, for the candidate scan order 2:
[0208] When scanning sensor 1, the target commands required to be sent include: an open command to control the communication between channel switch 0 and channel switch 1, an open command to control the communication between channel switch 1 and channel switch 2, and an open command to control the communication between channel switch 2 and sensor 1. Therefore, when scanning sensor 1 based on the candidate scan order 2, the number of target commands is 3.
[0209] When scanning sensor 2, the target commands required to be sent include: a close command to control the disconnection between channel switch 2 and sensor 1, and an open command to control the communication between channel switch 2 and sensor 1. Therefore, when scanning sensor 2 based on the candidate scan order 2, the number of target commands is 2.
[0210] When scanning sensor 3, the target commands required to be sent include: a close command to control the disconnection between channel switch 2 and sensor 2, a close command to control the disconnection between channel switch 1 and channel switch 2, and an open command to control the communication between channel switch 1 and sensor 3. Therefore, when scanning sensor 3 based on the candidate scan order 2, the number of target commands is 3.
[0211] When scanning sensor 4, the target commands required to be sent include: a close command to control the disconnection between channel switch 1 and channel switch 3, an open command to control the communication between channel switch 1 and channel switch 3, and an open command to control the communication between channel switch 3 and sensor 4. Therefore, when scanning sensor 4 based on the candidate scan order 2, the number of target commands is 3.
[0212] When scanning sensor 5, the target commands required to be sent include: a close command to control the disconnection between channel switch 3 and sensor 4, and an open command to control the communication between channel switch 1 and sensor 5. Therefore, when scanning sensor 5 based on the candidate scan order 2, the number of target commands is 2.
[0213] Step two: based on the number of target commands required when scanning a target sensor, determine the total number of target commands sent to the plurality of channel switches when scanning the plurality of sensors based on the one scan order.
[0214] Wherein the total number of target commands is equal to the sum of the number of target commands required for each sensor in the plurality of sensors.
[0215] Based on the above steps one to two, when scanning the plurality of sensors based on the candidate scan order 1, the total number of target commands sent to the plurality of channel switches is 17. When scanning the plurality of sensors based on the candidate scan order 2, the total number of target commands sent to the plurality of channel switches is 13.
[0216] In some embodiments, if the total number of target commands corresponding to the target scanning order is less than or equal to a first preset threshold, and the first preset threshold is 14, then candidate scanning order 2 is the target scanning order.
[0217] In other embodiments, if the total number of target commands corresponding to the target scanning order is the smallest among the total numbers corresponding to multiple candidate scanning orders, then candidate scanning order 2 is the target scanning order.
[0218] In method 2 above, multiple candidate scanning sequences are determined using multiple scanning path information from multiple sensors. Then, the total number of target commands corresponding to each candidate scanning sequence is used to determine the target scanning sequence from among the multiple candidate scanning sequences. Since this method determines the total number of target commands corresponding to different candidate scanning sequences, it can not only determine the candidate scanning sequence with the fewest total number of target commands as the target scanning sequence, but also select candidate scanning sequences that meet preset conditions, such as selecting candidate scanning sequences with a total number of target commands less than or equal to a first preset threshold. This helps to improve the diversity of target scanning sequences.
[0219] S403: The coprocessor stores the target scan sequence in memory.
[0220] In some embodiments, after determining the target scanning order, the coprocessor writes the target scanning order into the memory for storage. In this way, when multiple sensors need to be scanned, the target scanning order to be used can be determined from the memory, without having to re-execute S401-S402 each time. This helps to reduce the time required for each execution cycle, thereby helping to improve the scanning frequency of the sensors.
[0221] It should be noted that the computer device also includes non-volatile storage media, such as hard drives and memory chips, which are communicatively connected to the management controller. Based on this, the coprocessor can also store the target scan sequence on this non-volatile storage media.
[0222] The above is the first part of the embodiments of this application. The following, in conjunction with... Figure 5 The second part of the embodiments of this application is introduced.
[0223] Figure 5 This is a flowchart illustrating a sensor scanning method according to an exemplary embodiment. Exemplarily, the method includes steps S501-S503.
[0224] S501: The main processor determines the target scanning order of multiple sensors.
[0225] The total number of target commands corresponding to the target scanning sequence satisfies a preset condition.
[0226] The total number of target commands corresponding to the target scanning sequence refers to the total number of target commands sent to the channel switch when the plurality of sensors are scanned based on the target scanning sequence.
[0227] In some embodiments, the target scanning sequence is stored in the management controller, for example, the target scanning sequence can be stored in the memory of the management controller. The main processor executes the scanning task of the plurality of sensors at a preset period, at the beginning of each execution period, the main processor determines the target scanning sequence from the memory and reads the target scanning sequence.
[0228] In other embodiments, the main processor can also execute the scanning task of the plurality of sensors at a preset period, at the beginning of the first execution period, the target scanning sequence is determined based on the scheme in the first part.
[0229] It should be noted that the specific duration of the preset period is not limited in the embodiments of the present application, and can be determined according to actual conditions, for example, can be determined according to the time required to scan all sensors.
[0230] S502: The main processor scans the plurality of sensors based on the target scanning sequence to obtain monitoring information of the plurality of sensors.
[0231] In some embodiments, the plurality of sensors are scanned in the order of the target scanning sequence. Figure 2 The scanning process of S502 is exemplarily described with reference to the plurality of sensors shown in the table.
[0232] As shown above, the target scanning sequence is sensor 1, sensor 2, sensor 3, sensor 4 and sensor 5. Based on this, the main processor scans sensor 1, sensor 2, sensor 3, sensor 4 and sensor 5 in turn.
[0233] Hereinafter, the plurality of buses between the main processor and the plurality of sensors are in a disconnected state at the beginning of the execution period.
[0234] It should be noted that if part of the buses between the main processor and the plurality of sensors are in a connected state at the beginning of the execution period, and the part of the buses need to be in a disconnected state when scanning the sensor ranked first, the buses in a connected state need to be switched to a disconnected state first, and then the sensor ranked first can be scanned.
[0235] For example, in the above-mentioned target scanning sequence, the sensor ranked first is sensor 1, if bus 00, bus 12 and bus 31 are in the connected state, before scanning sensor 1, bus 12 and bus 31 need to be switched to the disconnected state, that is, the channel switch 3 and sensor 5 are switched to the disconnected state, and the channel switch 1 and the channel switch 3 are switched to the disconnected state.
[0236] When scanning sensor 1, the main processor sends the following commands in sequence: send an open command to the channel switch 0 to control the channel switch 0 and the channel switch 1 to be connected; send an open command to the channel switch 1 to control the channel switch 1 and the channel switch to be connected; send an open command to the channel switch 2 to control the channel switch 2 and the sensor 1 to be connected; send a scanning command to the sensor 1. The scanning command is used to request to obtain the monitoring information stored in the sensor. It should be noted that the monitoring information stored in the sensor is the latest monitoring information obtained by the sensor.
[0237] When scanning sensor 2, since the channel switch 2 and the sensor 1 are in the connected state, the main processor sends the following commands in sequence: send a close command to the channel switch 2 to control the channel switch 2 and the sensor 1 to be disconnected; send an open command to the channel switch 2 to control the channel switch 2 and the sensor 2 to be connected; send a scanning command to the sensor 2.
[0238] When scanning sensor 3, the main processor sends the following commands in sequence: send a close command to the channel switch 2 to control the channel switch 2 and the sensor 2 to be disconnected; send a close command to the channel switch 1 to control the channel switch 1 and the channel switch 2 to be disconnected; send an open command to the channel switch 1 to control the channel switch 1 and the sensor 3 to be connected; send a scanning command to the sensor 3.
[0239] When scanning sensor 4, the main processor sends the following commands in sequence: send a close command to the channel switch 1 to control the channel switch 1 and the sensor 3 to be disconnected; send an open command to the channel switch 1 to control the channel switch 1 and the channel switch 3 to be connected; send an open command to the channel switch 3 to control the channel switch 3 and the sensor 4 to be connected; send a scanning command to the sensor 4.
[0240] When scanning sensor 5, the main processor sends the following commands in sequence: send a close command to the channel switch 3 to control the channel switch 3 and the sensor 4 to be disconnected; send an open command to the channel switch 3 to control the channel switch 3 and the sensor 5 to be connected; send a scanning command to the sensor 5.
[0241] Optionally, after the scanning task of the plurality of sensors is executed, the master processor updates each bus between the management controller and the plurality of sensors to the disconnected state. In this way, in the next execution cycle, the master processor does not have to send a close command to control the bus that is not disconnected in the last execution cycle again, but can directly send an open command to control the bus connection between the master processor and the sensor ranked first.
[0242] Based on this, after scanning the sensor 5, the master processor can also send the following commands: send a close command to the channel switch 3 to control the disconnection between the channel switch 3 and the sensor 5, that is, control the bus 31 to be in the disconnected state; send a close command to the channel switch 1 to control the disconnection between the channel switch 1 and the channel switch 3, that is, control the bus 12 to be in the disconnected state; and send a close command to the channel switch 0 to control the disconnection between the channel switch 0 and the channel switch 1, that is, control the bus 00 to be in the disconnected state.
[0243] S503: If the current monitoring information of the target sensor meets the alarm condition, the master processor performs a target alarm operation corresponding to the target sensor.
[0244] It should be noted that the target sensor can be any one of the plurality of sensors.
[0245] In some embodiments, the historical monitoring information of each sensor in the plurality of sensors is pre-stored in the management controller, for example, the historical monitoring information can be stored in the storage of the management controller. After obtaining the current monitoring information of the target sensor, the master processor determines whether the current monitoring information of the target sensor meets the alarm condition by comparing the current monitoring information of the target sensor with the historical monitoring information, or comparing the current monitoring information with a second preset threshold. If the current monitoring information of the target sensor meets the alarm condition, the master processor performs a target alarm operation corresponding to the target sensor.
[0246] It should be noted that the comparison between the current monitoring information of the target sensor and the historical monitoring information, or the comparison between the current monitoring information and the second preset threshold, can be implemented in the manner a to c in S603 below, which will not be described in detail here.
[0247] In some embodiments, the storage of the management controller pre-stores a correspondence between the plurality of sensors and a plurality of alarm operations. The alarm operation corresponding to one sensor is an operation to be performed when the monitoring information of the one sensor meets an alarm condition.
[0248] It should be noted that the alarm operations corresponding to different sensors can be the same or different, and the embodiments of the present application do not limit this. In addition, the present application does not limit the number of alarm operations corresponding to each sensor in the plurality of sensors.
[0249] For example, the alarm operation includes recording the alarm event, lighting the alarm lamp, reporting the current monitoring information, etc.
[0250] In the above embodiment, when scanning the plurality of sensors each time, the plurality of sensors are scanned in turn based on a predetermined target scanning order. Since the scanning order of at least part of the plurality of sensors in different scanning orders is different, when the plurality of sensors are scanned based on at least part of the different scanning orders, the total number of target commands sent to the channel switch is different, and the less the total number of target commands sent to the plurality of switch channels, the less the time required to scan the plurality of sensors. Therefore, by setting the scanning order whose total number meets the preset condition as the target scanning order, i.e., setting the scanning order whose total number is less as the target scanning order, such as the total number meeting the preset condition can be that the total number is less than or equal to a first preset threshold, and the total number is the smallest among the total numbers corresponding to the plurality of candidate scanning orders, it can make the total number of target commands sent when scanning the plurality of sensors based on the target scanning order less, which helps to reduce the scanning time when scanning the plurality of sensors, thereby achieving to shorten the time required to scan the plurality of sensors in each execution period, and further achieving to quickly obtain the latest monitoring information of each sensor, which helps to improve the response speed to the abnormal state monitored by the sensor, and further helps to improve the running stability of the computer device.
[0251] In addition, the processing capability of the main processor is higher than that of the coprocessor, so that the embodiment of the application is executed by the main processor, which helps to further shorten the time required to scan the plurality of sensors, and further helps to further shorten the response time and improve the response speed.
[0252] The above is the second part of the embodiment of the application. In the following, the third part of the embodiment of the application will be introduced in combination with Figure 6 .
[0253] Figure 6 is a flowchart of a sensor scanning method according to an exemplary embodiment. For example, the method includes S601-S604.
[0254] S601: The coprocessor determines a target scanning order of a plurality of sensors.
[0255] S602: The coprocessor scans the plurality of sensors based on the target scanning order to obtain monitoring information of the plurality of sensors.
[0256] It should be noted that the implementation principle of S601-S602 is the same as that of S501-S502, therefore, the implementation process and related description of S601-S602 can refer to the implementation process and related description of S501-S502, which will not be described in detail here.
[0257] Optionally, S603: If the current monitoring information of the target sensor satisfies the alarm condition, the coprocessor sends the current monitoring information of the target sensor to the host processor.
[0258] The current monitoring information of the target sensor is used to instruct the host processor to perform an alarm operation.
[0259] As to how to determine whether the current monitoring information of the target sensor satisfies the alarm condition, there are various implementation manners, which are exemplarily illustrated below by way of a to c.
[0260] a: If the current monitoring information of the target sensor is different from the historical monitoring information of the target sensor, the current monitoring information of the target sensor satisfies the alarm condition.
[0261] The historical monitoring information of the target sensor can be the last monitoring information of the current monitoring information, or can be any monitoring information before the current monitoring information.
[0262] In some embodiments, the memory of the management controller pre-stores the historical monitoring information of each sensor in the plurality of sensors. After obtaining the current monitoring information of the target sensor, the coprocessor compares whether the current monitoring information of the target sensor and the historical monitoring information are the same. If the current monitoring information of the target sensor is different from the historical monitoring information of the target sensor, the current monitoring information of the target sensor satisfies the alarm condition, and the coprocessor sends the current monitoring information of the target sensor to the host processor.
[0263] In one example, the target sensor is used to monitor whether the hard disk is in place. If the monitoring information is 0, it indicates that the hard disk is in place, and if the monitoring information is 1, it indicates that the hard disk is not in place. Based on this, if the historical monitoring information of the target sensor is 0 and the current monitoring information is 1, the current monitoring information of the target sensor is different from the historical monitoring information of the target sensor. At this time, the current monitoring information of the target sensor satisfies the alarm condition, and the coprocessor sends the current monitoring information of the target sensor to the host processor.
[0264] In another example, the target sensor is used to monitor the temperature of the CPU. If the historical monitoring information indicates that the temperature of the CPU is 35 degrees, and the current monitoring information indicates that the temperature of the CPU is 38 degrees, the current monitoring information of the target sensor is different from the historical monitoring information of the target sensor. At this time, the current monitoring information of the target sensor satisfies the alarm condition, and the coprocessor sends the current monitoring information of the target sensor to the host processor.
[0265] In the above manner a, whether the current monitoring information of the target sensor satisfies the alarm condition is determined by whether the current monitoring information of the target sensor is same as the historical monitoring information, so that the alarm operation can be performed immediately when the state of the monitored component changes, which helps to improve the safety of the component.
[0266] Manner b: if the difference between the current monitoring information of the target sensor and the second preset threshold is greater than or equal to a preset value, the current monitoring information of the target sensor satisfies the alarm condition.
[0267] Optionally, the sensors and the second preset thresholds are in one-to-one correspondence, that is, different sensors correspond to different second preset thresholds. The sensors and the preset values are in one-to-one correspondence, that is, different sensors correspond to different preset values.
[0268] In some embodiments, the management controller has stored in the memory in advance a first correspondence between the sensors and the second preset thresholds, and a second correspondence between the sensors and the preset values. After obtaining the current monitoring information of the target sensor, the second preset threshold corresponding to the target sensor is determined based on the first target correspondence (i.e., the correspondence between the target sensor and the target second preset threshold), and the preset value corresponding to the target sensor is determined based on the second target correspondence (i.e., the correspondence between the target sensor and the target preset value), and whether the current monitoring information of the target sensor satisfies the alarm condition is determined by the current monitoring information of the target sensor, the second preset threshold corresponding to the target sensor, and the preset value corresponding to the target sensor.
[0269] If the difference between the current monitoring information of the target sensor and the second preset threshold corresponding to the target sensor is greater than or equal to the preset value corresponding to the target sensor, the current monitoring information of the target sensor satisfies the alarm condition, and based on this, the coprocessor sends the current monitoring information of the target sensor to the main processor.
[0270] In one example, if the target sensor is a sensor for monitoring whether a hard disk is in place, the second preset threshold corresponding to the target sensor is 0 (representing that the hard disk is in place), and the preset value corresponding to the target sensor is 1. Based on this, if the current monitoring information of the target sensor is 1, the difference between the current monitoring information of the target sensor and the second preset threshold is greater than the preset value, and the current monitoring information of the target sensor satisfies the alarm condition.
[0271] In another example, the target sensor is used to monitor the temperature of the CPU, the second preset threshold corresponding to the target sensor is 38 degrees, and the preset value corresponding to the target sensor is 5. If the current monitoring information indicates that the temperature of the CPU is 45 degrees, the difference between 45 degrees and 38 degrees is 7 degrees (greater than the preset value 5), at this time, the current monitoring information of the target sensor satisfies the alarm condition, and the coprocessor sends the current monitoring information of the target sensor to the host processor.
[0272] In the above manner b, whether the current monitoring information of the target sensor satisfies the preset condition is determined by the difference between the current monitoring information of the target sensor and the second preset threshold, so that the alarm operation is performed only when the state of the monitored component changes greatly, that is, the difference is greater than or equal to the preset value, which helps to avoid frequent alarms and reduce the task amount of the host processor.
[0273] Manner c: If the difference between the current monitoring information of the target sensor and the historical monitoring information of the target sensor is greater than or equal to the preset value, the current monitoring information of the target sensor satisfies the alarm condition.
[0274] The historical monitoring information of the target sensor can be the last monitoring information of the current monitoring information. Alternatively, it can be any monitoring information before the current monitoring information.
[0275] Optionally, the sensors and the preset values correspond to each other one by one, that is, different sensors correspond to different preset values.
[0276] In some embodiments, the memory of the management controller pre-stores the historical monitoring information of each sensor in the plurality of sensors and the second correspondence relationship between the sensors and the preset values. After obtaining the current monitoring information of the target sensor, the preset value corresponding to the target sensor is determined based on the target correspondence relationship (that is, the correspondence relationship between the target sensor and the target preset value), and whether the current monitoring information of the target sensor satisfies the alarm condition is determined by the current monitoring information of the target sensor, the historical monitoring information of the target sensor, and the preset value corresponding to the target sensor.
[0277] If the difference between the current monitoring information of the target sensor and the historical monitoring information of the target sensor is greater than or equal to the preset value corresponding to the target sensor, the current monitoring information of the target sensor satisfies the alarm condition, and based on this, the coprocessor sends the current monitoring information of the target sensor to the host processor.
[0278] In one example, if the target sensor is a sensor for monitoring whether a hard disk is in place, the preset value corresponding to the target sensor is 1. Based on this, if the current monitoring information of the target sensor is 1 and the historical monitoring information of the target sensor is 0 (indicating that the hard disk is in place), the difference between the current monitoring information and the historical monitoring information of the target sensor is greater than the preset value, and the current monitoring information of the target sensor satisfies the alarm condition. If the current monitoring information of the target sensor is 0, the difference between the current monitoring information and the historical monitoring information of the target sensor is less than the preset threshold, and the current monitoring information of the target sensor does not satisfy the alarm condition.
[0279] In another example, the target sensor is used to monitor the temperature of the CPU, the preset value is 4, and the historical monitoring information indicates that the temperature of the CPU is 32 degrees. If the current monitoring information indicates that the temperature of the CPU is 38 degrees, the difference between 38 degrees and 32 degrees is 6 degrees (greater than the preset value 4), at this time, the current monitoring information of the target sensor satisfies the alarm condition.
[0280] In the above manner c, whether the current monitoring information of the target sensor satisfies the preset condition is determined by the difference between the current monitoring information and the historical monitoring information of the target sensor. In this way, when the state of the monitored component changes greatly, that is, the difference is greater than or equal to the preset value, the alarm operation is performed, which helps to avoid frequent alarms and further helps to reduce the task amount of the alarm operation of the main processor.
[0281] Optionally, S604: The main processor performs a target alarm operation corresponding to the target sensor based on receiving the current monitoring information of the target sensor.
[0282] In some embodiments, the main processor performs a target alarm operation corresponding to the target sensor after receiving the current monitoring information of the target sensor.
[0283] For example, the current monitoring information of the target sensor includes the identification of the target sensor and the monitoring information currently stored by the target sensor. The main processor can determine the target alarm operation corresponding to the target sensor based on the identification of the target sensor.
[0284] In other embodiments, the main processor determines whether the current monitoring information of the target sensor satisfies the alarm condition again after receiving the current monitoring information of the target sensor, and if the alarm condition is satisfied, the target alarm operation is performed, and if the alarm condition is not satisfied, the process is ended.
[0285] It should be noted that how the main processor determines whether the current monitoring information of the target sensor satisfies the alarm condition can refer to the above description of how the coprocessor determines whether the current monitoring information of the target sensor satisfies the alarm condition. The principles are the same, and will not be repeated here.
[0286] It should be noted that the related description of S604 about executing the target alarm operation corresponding to the target sensor can refer to the above S503, and will not be described here.
[0287] In the above embodiment, when scanning the plurality of sensors each time, the plurality of sensors are scanned in turn based on the target scanning order determined in advance. Since the scanning order of at least part of the plurality of sensors is different in different scanning orders, when the plurality of sensors are scanned based on at least part of the different scanning orders, the total number of target commands sent to the channel switch is different, and the less the total number of target commands sent to the plurality of switch channels, the less the time required to scan the plurality of sensors. Therefore, by setting the scanning order with the total number meeting the preset condition as the target scanning order, that is, setting the scanning order with the total number as the target scanning order, such as the total number meeting the preset condition can be that the total number is less than or equal to the first preset threshold, and the total number is the smallest among the total numbers corresponding to the plurality of candidate scanning orders, it can make the total number of target commands sent when the plurality of sensors are scanned based on the target scanning order be less, which helps to reduce the scanning time when the plurality of sensors are scanned, so as to shorten the time required when the plurality of sensors are scanned in each execution period, and further to quickly obtain the latest monitoring information of each sensor, which helps to improve the response speed to the abnormal state monitored by the sensor, and further helps to improve the running stability of the computer device.
[0288] In addition, since the main processor needs to process most of the tasks undertaken by the management controller, in the embodiment, the scanning task of the plurality of sensors is executed by the coprocessor, which can avoid the high occupancy rate of the main processor when the number of sensors is large and the scanning task is heavy, for example, avoid the time with 100% occupancy rate as normal, and further help to avoid affecting the response time of other tasks processed by the main processor.
[0289] The above is the third part of the embodiments of the present application. In the following, the fourth part of the embodiments of the present application will be introduced in combination with Figure 7 .
[0290] Figure 7 is a flowchart of a sensor scanning method according to an example embodiment. The example method includes S701-S704.
[0291] In the following, taking an example that the management controller only includes one processor including a plurality of cores, the embodiment shown in Figure 7 will be described.
[0292] S701: One of the plurality of cores of the processor determines a target scanning order of a plurality of sensors.
[0293] S702: One designated core of the processor scans the plurality of sensors based on the target scanning order to obtain monitoring information of the plurality of sensors.
[0294] It should be noted that the implementation principle of S701-S702 is the same as that of S501-S502, and therefore, the implementation process and related description of S701-S702 can refer to the implementation process and related description of S501-S502 described above, which will not be described in detail here.
[0295] S703: If the current monitoring information of the target sensor meets the alarm condition, one designated core of the processor sends the current monitoring information to the target process of the processor.
[0296] Among them, the target process is a process in the processor for executing an alarm operation.
[0297] It should be noted that for how a designated core determines whether the current monitoring information of the target sensor meets the alarm condition, the related description of the above-mentioned coprocessor determining whether the current monitoring information of the target sensor meets the alarm condition can be referred to, and the principles are the same, which will not be described in detail here.
[0298] S704: The target process of the processor executes the alarm operation corresponding to the target sensor.
[0299] It should be noted that the related description of executing the target alarm operation corresponding to the target sensor in S704 can refer to the above-mentioned S503, which will not be described in detail here.
[0300] In the above embodiment, each time the plurality of sensors are scanned, the plurality of sensors are scanned in turn based on the target scanning order determined in advance. Since the scanning order of at least part of the plurality of sensors in different scanning orders is different, the total number of target commands sent to the channel switch is different when the plurality of sensors are scanned based on at least part of the different scanning orders, and the total number of target commands sent to the plurality of switch channels is less, the time required to scan the plurality of sensors is also less. Therefore, by setting the scanning order whose total number meets the preset condition as the target scanning order, that is, setting the scanning order whose total number is less as the target scanning order, such as the total number meeting the preset condition can be that the total number is less than or equal to the first preset threshold, the total number is the smallest among the total numbers corresponding to the plurality of candidate scanning orders, which can make the total number of target commands sent when the plurality of sensors are scanned based on the target scanning order less, which helps to reduce the scanning time when the plurality of sensors are scanned, thereby realizing the shortening of the time required to scan the plurality of sensors in each execution period, and further realizing the fast acquisition of the latest monitoring information of each sensor, which helps to improve the response speed to the abnormal state monitored by the sensor, and further helps to improve the running stability of the computer device.
[0301] In addition, the embodiments of the present application are executed by one of the plurality of kernels, and when the number of sensors is large, the scanning task is heavy, and the occupation rate of the management controller is high, for example, the time of the occupation rate being 100% is normal, thereby helping to avoid affecting the response time of other tasks processed by the management controller.
[0302] The above mainly introduces the scheme provided by the embodiments of the present application from the perspective of the method. In order to realize the above functions, the sensor scanning device includes the hardware structure and / or software module corresponding to each function. Those skilled in the art should easily realize that the units and algorithm steps of each example described in combination with the embodiments disclosed in the present application can be realized in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed in the form of hardware or computer software driven hardware depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0303] The embodiments of the present application can divide the functional modules of the sensor scanning device according to the above method, for example, the sensor scanning device can include various functional modules corresponding to each functional division, or two or more functions can be integrated in one processing module. The above integrated module can be realized in the form of hardware or software functional module. It should be noted that the division of modules in the embodiments of the present application is illustrative, and is only a logical functional division. Actual implementation can have another division method.
[0304] For example, Figure 8 A possible structure diagram of the sensor scanning device (denoted as sensor scanning device 800) involved in the above embodiments is shown. The sensor scanning device 800 includes a processing unit 801 and a scanning unit 802. The processing unit 801 is configured to determine a target scanning order of a plurality of sensors; wherein when the plurality of sensors are scanned based on at least partially different scanning orders, the total number of target commands sent to the channel switch is different, the scanning order in which the total number meets a preset condition is the target scanning order, and the target command is used to instruct the channel switch to switch state. For example, Figure 5 S501 shown, Figure 6 S601 shown, and Figure 7 S701 shown. The scanning unit 802 is configured to scan the plurality of sensors based on the target scanning order to obtain monitoring information of the plurality of sensors. For example, Figure 5 S502 shown, Figure 6 S602 shown, and Figure 7S702 is shown.
[0305] Optionally, the processing unit 801 is specifically configured to: acquire a plurality of scanning path information of a plurality of sensors; the plurality of sensors comprise a target sensor, and the scanning path information of the target sensor is used to indicate a target channel switch between the management controller and the target sensor; and determine the target scanning sequence based on the depth-first algorithm and the plurality of scanning path information.
[0306] Optionally, the processing unit 801 is specifically configured to: sequentially determine a sensor identifier corresponding to each ranking position in the target scanning sequence based on the depth-first algorithm and the plurality of scanning path information, to obtain the target scanning sequence.
[0307] Optionally, the processing unit 801 is specifically configured to: acquire a plurality of scanning path information of a plurality of sensors; the plurality of sensors comprise a target sensor, and the scanning path information of the target sensor is used to indicate a target channel switch between the management controller and the target sensor; determine a plurality of candidate scanning sequences of the plurality of sensors based on the scanning path information of the plurality of sensors; and determine the target scanning sequence from the plurality of candidate scanning sequences based on a plurality of total quantities corresponding to the plurality of candidate scanning sequences; wherein a total quantity corresponding to one candidate scanning sequence is a total quantity of target commands sent to the plurality of channel switches when the plurality of sensors are scanned based on the one candidate scanning sequence.
[0308] Optionally, the processing unit 801 is specifically configured to: determine a quantity of target commands required when the target sensor is scanned according to one candidate scanning sequence based on a quantity of the target channel switches and a scanning ranking of the target sensor in the one candidate scanning sequence; and determine a total quantity of target commands sent to the plurality of channel switches when the plurality of sensors are scanned based on the one scanning sequence based on the quantity of target commands required when the target sensor is scanned.
[0309] Optionally, the preset condition is satisfied, including: the total quantity of target commands corresponding to the target scanning sequence is less than or equal to a first preset threshold; or the total quantity of target commands corresponding to the target scanning sequence is the smallest in a plurality of total quantities corresponding to a plurality of candidate scanning sequences; wherein a total quantity corresponding to one candidate scanning sequence is a total quantity of target commands sent to the plurality of channel switches when the plurality of sensors are scanned based on the one candidate scanning sequence.
[0310] Optionally, the plurality of sensors comprise a target sensor; and the sensor scanning device further comprises a notification unit 803, configured to: if current monitoring information of the target sensor satisfies an alarm condition, send the current monitoring information of the target sensor to the host processor; wherein the current monitoring information of the target sensor is used to instruct the host processor to perform an alarm operation.
[0311] Optionally, the current monitoring information of the target sensor satisfies an alarm condition, including: the current monitoring information of the target sensor is different from historical monitoring information of the target sensor; or a difference between the current monitoring information of the target sensor and a second preset threshold is greater than or equal to a preset value; or a difference between the current monitoring information of the target sensor and the historical monitoring information of the target sensor is greater than or equal to the preset value.
[0312] For specific description of the optional manners, refer to the foregoing method embodiments, which will not be repeated here. In addition, the explanation and beneficial effect of any one of the sensor scanning apparatuses 800 provided above can refer to the corresponding method embodiments described above, which will not be repeated here.
[0313] The embodiment of the present application further provides a computer device, including: a management controller and a plurality of sensors, the management controller is connected with at least part of the sensors in the plurality of sensors through the same channel switch, the channel switch is used for controlling the connection or disconnection between the management controller and the corresponding sensor; the management controller is used for determining a target scanning sequence of the plurality of sensors; wherein when the plurality of sensors are scanned based on at least part of different scanning sequences, the total number of target commands sent to the channel switch is different, the scanning sequence of which the total number meets a preset condition is the target scanning sequence, and the target command is used for instructing the channel switch to switch the state; the management controller is further used for scanning the plurality of sensors based on the target scanning sequence to obtain monitoring information of the plurality of sensors.
[0314] The embodiment of the present application further provides a computer device, including: a management controller and a plurality of sensors, the management controller is connected with at least part of the sensors in the plurality of sensors through the same channel switch, the channel switch is used for controlling the connection or disconnection between the management controller and the corresponding sensor; the management controller includes a main processor and a coprocessor; the coprocessor is used for determining a target scanning sequence of the plurality of sensors; wherein when the plurality of sensors are scanned based on at least part of different scanning sequences, the total number of target commands sent to the channel switch is different, the scanning sequence of which the total number meets a preset condition is the target scanning sequence, and the target command is used for instructing the channel switch to switch the state; the coprocessor is further used for scanning the plurality of sensors based on the target scanning sequence to obtain monitoring information of the plurality of sensors.
[0315] The embodiment of the present application further provides a computer device, comprising: a management controller and a plurality of sensors, the management controller is connected with at least part of the plurality of sensors through a same channel switch, the channel switch is used for controlling the connection or disconnection between the management controller and the corresponding sensor; the management controller comprises a main processor and a coprocessor; the main processor is used for determining a target scanning sequence of the plurality of sensors; wherein when the plurality of sensors are scanned based on at least part of different scanning sequences, the total number of target commands sent to the channel switch is different, the scanning sequence meeting a preset condition of the total number is the target scanning sequence, and the target command is used for instructing the channel switch to switch the state; and the main processor is further used for scanning the plurality of sensors based on the target scanning sequence to obtain monitoring information of the plurality of sensors.
[0316] The embodiment of the present application further provides a computer device, comprising: a management controller and a plurality of sensors, the management controller is connected with at least part of the plurality of sensors through a same channel switch, the channel switch is used for controlling the connection or disconnection between the management controller and the corresponding sensor; the management controller comprises a processor, and the processor comprises a plurality of cores; one specified core in the plurality of cores is used for determining a target scanning sequence of the plurality of sensors; wherein when the plurality of sensors are scanned based on at least part of different scanning sequences, the total number of target commands sent to the channel switch is different, the scanning sequence meeting a preset condition of the total number is the target scanning sequence, and the target command is used for instructing the channel switch to switch the state; and the one specified core is further used for scanning the plurality of sensors based on the target scanning sequence to obtain monitoring information of the plurality of sensors.
[0317] The embodiments of the present application further provide a computer device, which comprises a processor and a memory. The processor is connected with the memory. The memory stores computer execution instructions. The processor implements the data processing method in the above embodiments when executing the computer execution instructions. The embodiments of the present application do not make any limitation on the specific form of the computer device. For example, the computer device can be a terminal device or a network device. The terminal device can be referred to as a terminal, a user equipment (UE), a terminal device, an access terminal, a subscriber unit, a subscriber station, a mobile station, a remote station, a remote terminal, a mobile device, a user terminal, a wireless communication device, a user agent or a user equipment, etc. The terminal device can be a mobile phone, an augmented reality (AR) device, a virtual reality (VR) device, a tablet computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), etc. The network device can be a server, etc. The server can be one physical or logical server, or two or more physical or logical servers sharing different responsibilities, or cooperating with each other to implement the functions of the server.
[0318] The embodiments of the present application further provide a computer readable storage medium, which stores a computer program. When the computer program runs on a computer, the computer is caused to execute the method implemented by any of the computer devices provided above.
[0319] The explanations and beneficial effects of the related content in any of the computer readable storage media provided above can be referred to the corresponding embodiments described above, which will not be repeated here.
[0320] The embodiments of the present application further provide a chip. The chip integrates a control circuit and one or more ports for implementing the functions of the computer device. Optionally, the functions supported by the chip can refer to the above, and will not be described here. Those skilled in the art can understand that all or part of the steps of the above-mentioned embodiments can be instructed by programs to relevant hardware to complete. The programs can be stored in a computer readable storage medium. The storage medium mentioned above can be a read-only memory, a random access memory, etc. The above-mentioned processing unit or processor can be a central processing unit, a general-purpose processor, an application specific integrated circuit (ASIC), a digital signal processor (DSP), a field programmable gate array (FPGA) or other programmable logic device, a transistor logic device, a hardware component or any combination thereof.
[0321] The embodiments of the present application further provide a computer program product containing instructions, which, when executed on a computer, cause the computer to perform any of the methods in the above embodiments. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, all or part of the processes or functions according to the embodiments of the present application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer readable storage medium or transferred from one computer readable storage medium to another, for example, the computer instructions can be transferred from one website, computer, server or data center to another website, computer, server or data center through wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) mode. The computer readable storage medium can be any available medium that can be accessed by a computer or data storage device including one or more servers, data centers, etc. integrated with the medium. The available medium can be a magnetic medium (such as a floppy disk, a hard disk, a magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as an SSD), etc.
[0322] It should be noted that the above-mentioned devices for storing computer instructions or computer programs provided by the embodiments of the present application, such as but not limited to the above-mentioned memory, computer readable storage medium and communication chip, etc., all have non-volatility (non-transitory).
[0323] In the above embodiments, all or part of the embodiments can be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions according to the embodiments of the present application are generated. The computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions can be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions can be transmitted from one website site, computer, server or data center to another website site, computer, server or data center through wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) mode. The computer readable storage medium can be any available medium that can be accessed by a computer or data storage device including one or more servers, data centers, etc. integrated with the medium. The available medium can be a magnetic medium (such as a floppy disk, a hard disk, a magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk (SSD)), etc.
[0324] Although the present application is described herein in conjunction with various embodiments, it is understood that other variations of the disclosed embodiments can be understood and effected by those skilled in the art in practicing the claimed application, from an inspection of the drawings, the disclosure, and the appended claims. The word "comprising" does not exclude other components or steps not listed in the claims, "a" or "an" does not exclude a plurality, and a single processor or other unit can fulfill the functions of several means recited in the claims. Means-plus-function or step-plus-function clauses are used where for procedural or logical operations, the recitation of means or steps does not imply a limitation to a specific order of operations.
[0325] Although the present application is described herein in conjunction with various embodiments, it is understood that other variations of the disclosed embodiments can be understood and effected by those skilled in the art in practicing the claimed application, from an inspection of the drawings, the disclosure, and the appended claims. The word "comprising" does not exclude other components or steps not listed in the claims, "a" or "an" does not exclude a plurality, and a single processor or other unit can fulfill the functions of several means recited in the claims. Means-plus-function or step-plus-function clauses are used where for procedural or logical operations, the recitation of means or steps does not imply a limitation to a specific order of operations.
[0325] Although the present application is described herein in conjunction with various embodiments, it is understood that other variations of the disclosed embodiments can be understood and effected by those skilled in the art in practicing the claimed application, from an inspection of the drawings, the disclosure, and the appended claims. The word "comprising" does not exclude other components or steps not listed in the claims, "a" or "an" does not exclude a plurality, and a single processor or other unit can fulfill the functions of several means recited in the claims. Means-plus-function or step-plus-function clauses are used where for procedural or logical operations, the recitation of means or steps does not imply a limitation to a specific order of operations.
Claims
1. A sensor scanning method, characterized by, The method for a computer device comprising a plurality of sensors and a management controller, at least part of the plurality of sensors being connected to the management controller through the same channel switch, the channel switch being used to control the connection or disconnection between the corresponding sensor and the management controller; the method comprising: determining a target scanning order of the plurality of sensors; wherein, when scanning the plurality of sensors based on at least part of different scanning orders, the total number of target commands sent to the channel switch is different, the scanning order meeting a preset condition is the target scanning order, and the target command is used to indicate the switching state of one channel switch; scanning the plurality of sensors based on the target scanning order to obtain monitoring information of the plurality of sensors.
2. The method of claim 1, wherein, The determination of the target scanning order of the plurality of sensors comprises: obtaining a plurality of scanning path information of the plurality of sensors; the plurality of sensors comprising a target sensor, and the scanning path information of the target sensor being used to indicate a target channel switch between the management controller and the target sensor; determining the target scanning order based on a depth-first algorithm and the plurality of scanning path information.
3. The method of claim 2, wherein, The determination of the target scanning order based on the depth-first algorithm and the plurality of scanning path information comprises: determining the sensor identifier corresponding to each ranking position in the target scanning order in sequence based on the depth-first algorithm and the plurality of scanning path information to obtain the target scanning order.
4. The method of claim 1, wherein, The determination of the target scanning order of the plurality of sensors comprises: obtaining a plurality of scanning path information of the plurality of sensors; the plurality of sensors comprising a target sensor, and the scanning path information of the target sensor being used to indicate a target channel switch between the management controller and the target sensor; determining a plurality of candidate scanning orders of the plurality of sensors based on the scanning path information of the plurality of sensors; determining the target scanning order from the plurality of candidate scanning orders based on a plurality of total numbers corresponding to the plurality of candidate scanning orders; wherein, the total number corresponding to one candidate scanning order is the total number of target commands sent to a plurality of channel switches when scanning the plurality of sensors based on the one candidate scanning order.
5. The method of claim 4, wherein, The method further comprises: determining the number of target commands required when scanning the target sensor based on the one candidate scanning order based on the number of target channel switches and the scanning ranking of the target sensor in the one candidate scanning order; determining the total number of target commands sent to the plurality of channel switches when scanning the plurality of sensors based on the one scanning order based on the number of target commands required when scanning the target sensor.
6. The method according to any one of claims 1-5, characterized in that, The total number meeting the preset condition comprises: the total number is less than or equal to a first preset threshold; or, the total number is the smallest among a plurality of total numbers corresponding to a plurality of candidate scanning orders; wherein, the total number corresponding to one candidate scanning order is the total number of target commands sent to a plurality of channel switches when scanning the plurality of sensors based on the one candidate scanning order.
7. The method of any one of claims 1-5, wherein: the management controller comprises a main processor and a coprocessor; and the method is performed by the main processor or the coprocessor.
8. The method of claim 7, wherein, the plurality of sensors comprises a target sensor; and when the method is performed by the coprocessor, the method further comprises: if current monitoring information of the target sensor satisfies an alarm condition, the coprocessor sends the current monitoring information of the target sensor to the main processor; and the current monitoring information of the target sensor is used to instruct the main processor to perform an alarm operation.
9. The method of claim 8, wherein, the current monitoring information of the target sensor satisfies the alarm condition, comprising: the current monitoring information of the target sensor is different from historical monitoring information of the target sensor; or the difference between the current monitoring information of the target sensor and a second preset threshold is greater than or equal to a preset value; or the difference between the current monitoring information of the target sensor and the historical monitoring information of the target sensor is greater than or equal to a preset value.
10. The method of any one of claims 1-5, wherein: the management controller comprises a processor comprising a plurality of cores; and the method is performed by a designated core of the plurality of cores.
11. A computer device, comprising: comprising: a plurality of sensors and a management controller, at least part of the plurality of sensors being connected to the management controller through a same channel switch, the channel switch being used to control the connection or disconnection between a corresponding sensor and the management controller; the management controller is used to determine a target scanning order of the plurality of sensors; wherein when the plurality of sensors are scanned based on at least part of different scanning orders, the total number of target commands sent to the channel switch is different, the scanning order satisfying a preset condition in terms of the total number is the target scanning order, and the target command is used to instruct a channel switch to switch states; the management controller is further used to scan the plurality of sensors based on the target scanning order to obtain monitoring information of the plurality of sensors.
Citation Information
Patent Citations
Control method of programmable multi-channel data acquisition device
CN103176411A
Method and device for reporting sensor data
CN106815025A