Controller access method and device, equipment and medium
By selecting the forwarding thread and the target thread in the multi-threaded access of the management controller and using the request source flag in the data transmission, the problem of data cross-receiving in multi-threaded data access is solved, and communication accuracy and stability are improved.
Patent Information
- Application Number
- CN202411748857.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-30
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2044-11-30
AI Technical Summary
Multithreaded data access between different management controllers has data cross-reception or data confusion, which affects communication accuracy and stability.
By selecting the forwarding thread and the target thread from multiple threads, the forwarding thread sends the request data with the request source flag to the management controller, and after receiving the response data, it forwards it to the corresponding target thread.
Ensure orderly transmission of requested data, improve data transmission efficiency, avoid cross-receiving of response data, and thus improve communication accuracy and stability.
Smart Images

Figure CN119597700A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of servers, and in particular to a controller access method, device, equipment and medium. Background Art
[0002] In server management, there are many management controllers, such as Baseboard Management Controller (BMC), Smart Management Controller (SMC) and Integrated Lights-Out (iLO), which can provide remote management, system monitoring, firmware update, virtual media service and other functions for the server to ensure the reliability, availability and manageability of the server. They usually support the Intelligent Platform Management Interface (IPMI) protocol and can be remotely accessed and managed through the network.
[0003] Currently, in order to achieve server management, server managers usually need to access the management controller directly or indirectly. For example, directly access the BMC, or indirectly access the SMC on the carrier board through the BMC. However, when accessing another management controller indirectly through one management controller and using a high-pressure parallel access method, although multi-threading can improve access efficiency, multiple threads of the management controller are waiting to receive response data from another management controller at the same time, which can easily lead to cross-reception or confusion of data, affecting communication accuracy and stability.
[0004] In view of the above problems, how to solve the problem of cross-reception of data or data confusion in multi-threaded data access between different management controllers, which affects the accuracy and stability of communication, is an urgent problem to be solved by technicians in this field. Summary of the invention
[0005] The purpose of the present invention is to provide a controller access method, device, equipment and medium to solve the problem that multi-threaded data access between different management controllers currently has data cross-reception or data confusion, which affects communication accuracy and stability.
[0006] In order to solve the above technical problems, the present invention provides a controller access method, comprising:
[0007] Selecting at least one thread from a plurality of threads involved in the multi-threaded access with the management controller as a forwarding thread, and selecting the remaining threads as target threads;
[0008] The request data with the request source flag added thereto is sent to the management controller through the forwarding thread; wherein the request source flag is used to indicate the thread to which the corresponding request data belongs;
[0009] After the forwarding thread receives the response data returned by the management controller, the target thread corresponding to the response data is determined according to the request source flag in the response data, and the response data is sent to the corresponding target thread.
[0010] On the one hand, the method for generating the request data includes:
[0011] Determine the request data corresponding to the target thread and the request data corresponding to the forwarding thread;
[0012] Control the target thread and the forwarding thread to add data headers to the corresponding request data respectively;
[0013] The data header includes the request source flag of the request data, a command prompt, a network function code and an address of a slave device to be accessed.
[0014] On the other hand, it also includes:
[0015] Determine all threads between the management controller;
[0016] Set corresponding controller access commands for all threads respectively;
[0017] The controller access command is used to start a corresponding thread when accessing the management controller.
[0018] On the other hand, it also includes:
[0019] When there is a demand for access to the management controller, determining a designated thread corresponding to the access demand;
[0020] Determining the controller access command corresponding to the specified thread;
[0021] Writing the controller access command into an electrically erasable programmable read-only memory;
[0022] The designated thread is started according to the controller access command and the management controller is accessed.
[0023] On the other hand, starting the designated thread and accessing the management controller according to the controller access command includes:
[0024] Determining whether there is a pre-written controller access command in the electrically erasable programmable read-only memory;
[0025] If it is confirmed that the controller access command does not exist, the access process is terminated, and an alarm message indicating that the controller access command setting has failed is output;
[0026] If it is confirmed that the controller access command exists, determining whether there is a channel connected to the management controller among the channels of the preset bus;
[0027] If it is confirmed that none of the channels of the preset bus is connected to the management controller, the access process is terminated, and an alarm message indicating that the management controller is not connected is output;
[0028] If it is confirmed that the channel of the preset bus is connected to the management controller, then the hardware attribute information of the preset bus is obtained; wherein the hardware attribute information at least includes the preset bus information and the slave device address;
[0029] Starting the corresponding designated thread in all threads according to the controller access command;
[0030] Setting the hardware attribute information in the designated thread;
[0031] The designated thread is controlled to access the management controller according to the hardware attribute information.
[0032] On the other hand, sending the request data with the request source flag added to the management controller through the forwarding thread includes:
[0033] Monitoring the processor occupancy rate and memory occupancy rate of the forwarding thread;
[0034] Determine whether the processor occupancy is greater than a first threshold, and the memory occupancy is greater than a second threshold;
[0035] If it is confirmed that the processor occupancy rate is greater than the first threshold, and the memory occupancy rate is greater than the second threshold, the amount of data transmission requested by the forwarding thread to the management controller is reduced.
[0036] On the other hand, reducing the amount of data requested by the forwarding thread to the management controller includes:
[0037] The access frequency of the request data corresponding to each of the target threads is reduced, or the forwarding thread is suspended from forwarding the request data of each of the target threads.
[0038] In order to solve the above technical problems, the present invention also provides a controller access device, comprising:
[0039] A selection module, used to select at least one thread from a plurality of threads involved in the multi-threaded access with the management controller as a forwarding thread, and select the remaining threads as target threads;
[0040] A first sending module, configured to send the request data with the request source flag added thereto to the management controller through the forwarding thread; wherein the request source flag is used to indicate the thread to which the corresponding request data belongs;
[0041] The second sending module is used to determine the target thread corresponding to the response data according to the request source flag in the response data after the forwarding thread receives the response data returned by the management controller, and send the response data to the corresponding target thread.
[0042] In order to solve the above technical problems, the present invention further provides a controller access device, comprising:
[0043] Memory for storing computer programs;
[0044] A processor is used to implement the steps of the above-mentioned controller access method when executing the computer program.
[0045] In order to solve the above technical problem, the present invention also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above controller access method are implemented.
[0046] The controller access method provided by the present invention specifically selects at least one thread as a forwarding thread from multiple threads involved in multi-threaded access with a management controller, and uses the remaining threads as target threads; sends request data with a request source flag added to the management controller through the forwarding thread; wherein the request source flag is used to characterize the thread to which the corresponding request data belongs; after the forwarding thread receives the response data returned by the management controller, the target thread corresponding to the response data is determined according to the request source flag in the response data, and the response data is sent to the corresponding target thread.
[0047] The beneficial effect of the present invention is that when there is a need for multi-threaded parallel access between different management controllers, a target thread and a forwarding thread are selected from multiple threads involved in the multi-threaded parallel access; the request data with a request source flag added is sent to the management controller through the forwarding thread; since the request source flag is used to characterize the thread to which the corresponding request data belongs, after the forwarding thread receives the response data returned by the management controller, it can determine the target thread corresponding to the response data according to the request source flag in the response data, and send the response data to the corresponding target thread. In summary, by adding a request source flag to the request data and using the forwarding thread to forward the request data and the response data, the orderly sending of the request data is guaranteed, the data transmission efficiency is improved, and the cross-reception of the response data is avoided, thereby improving the communication accuracy and stability.
[0048] On the other hand, the present invention specifically determines the request data corresponding to the target thread and the request data corresponding to the forwarding thread; controls the target thread and the forwarding thread to add data headers to the corresponding request data; wherein the data header contains the request source flag of the request data, the command prompt, the network function code and the slave device address to be accessed, thereby realizing the setting of the request source flag and ensuring the accurate forwarding of the response data. By determining all threads between the management controller and setting corresponding controller access commands for all threads respectively, the user can independently set the management controller access mode according to the needs, thereby improving the flexibility of access. When there is a need to access the management controller, determine the designated thread corresponding to the access need; determine the controller access command corresponding to the designated thread; write the controller access command into the electrically erasable programmable read-only memory; start the designated thread and access the management controller according to the controller access command, thereby realizing flexible access to the management controller.
[0049] In addition, the present invention also provides a controller access device, equipment and medium, with the same effects as above. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0051] Figure 1 A flowchart of a controller access method provided by an embodiment of the present invention;
[0052] Figure 2 A schematic diagram of a controller access device provided by an embodiment of the present invention;
[0053] Figure 3 A schematic diagram of a controller access device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0054] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0055] The core of the present invention is to provide a controller access method, device, equipment and medium to solve the problem that multi-threaded data access between different management controllers currently has data cross-reception or data confusion, which affects communication accuracy and stability.
[0056] In order to enable those skilled in the art to better understand the solution of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0057] At present, in order to achieve server management, server managers usually need to access the management controller directly or indirectly. For example, directly access the BMC, or indirectly access the SMC on the carrier board through the BMC. Among them, when indirectly accessing the SMC on the carrier board through the BMC, the main methods are external IPMI transparent transmission and internal polling data interaction. Among them, in the external IPMI transparent transmission, the administrator sends a command to the motherboard BMC, which is sent to the SMC for processing via the Intelligent Platform Management Bus (IPMB) and then returned; this method is processed in the IPMB bridge thread of the BMC; internal polling is that the BMC actively sends IPMI commands in the real-time interaction thread to access and control the SMC; this method is implemented by the BMC's IPMB real-time interaction thread.
[0058] However, when high-pressure parallel access is performed, although multi-threading is used to improve efficiency, multiple threads are waiting to receive response data from the same management controller at the same time, which can easily lead to cross-reception or confusion of data, affecting communication accuracy and stability. Therefore, in order to solve the above problems, the present invention provides a controller access method. It should be noted that the present invention does not limit the specific types of management controllers involved in the controller access method; in the following embodiments, the solution is mainly explained by taking indirect access to SMC through BMC as an example, which does not limit the application scenarios of the present invention and depends on the specific implementation situation.
[0059] Figure 1 A flowchart of a controller access method provided by an embodiment of the present invention. Figure 1 As shown, the method includes:
[0060] S10: Select at least one thread from multiple threads involved in the multi-threaded access with the management controller as a forwarding thread, and select the remaining threads as target threads.
[0061] It is understandable that the BMC and SMC are connected through IPMB, which is an Inter-Integrated Circuit (I2C) bus that contains multiple transmission channels. The BMC can access the SMC through multiple threads, including the IPMB Bridge thread, the IPMB real-time interaction thread, and other threads.
[0062] In this embodiment, when the BMC needs to access the SMC in parallel through multiple threads, it first needs to select at least one thread from the multiple threads involved as a forwarding thread, and use the remaining threads as target threads. Both the target thread and the forwarding thread have corresponding request data, and each request data needs to be sent to the SMC to implement multi-threaded access of the BMC to the SMC.
[0063] In this embodiment, there is no restriction on the specific type and number of threads involved in multi-threaded access, and there is no restriction on the specific types of forwarding threads and target threads, which depends on the specific implementation situation.
[0064] S11: Sending the request data with the request source flag added to the management controller through the forwarding thread.
[0065] The request source flag is used to indicate the thread to which the corresponding request data belongs.
[0066] It should be noted that although both the target thread and the forwarding thread have corresponding request data, the functions of the target thread and the forwarding thread are not exactly the same. Specifically, the forwarding thread needs to send the request data to the SMC. The request data here includes the request data of the target thread and the request data of the forwarding thread. In other words, in order to enable BMC to access SMC, the target thread needs to send the request data to the forwarding thread, and the forwarding thread sends its own request data and the request data of the target thread to the SMC.
[0067] It should be noted that a request source flag is added to the request data to indicate the thread to which the corresponding request data belongs. In this embodiment, there is no limitation on the specific way of adding the request source flag, which depends on the specific implementation situation.
[0068] S12: After the forwarding thread receives the response data returned by the management controller, it determines the target thread corresponding to the response data according to the request source flag in the response data, and sends the response data to the corresponding target thread.
[0069] Furthermore, after receiving each request data, the SMC generates corresponding response data according to each request data, and sends each response data to the forwarding thread. It should be noted that since the response data corresponds to the request data, the response data also includes the request source flag in the request data.
[0070] After the forwarding thread receives the response data returned by the SMC, the target thread corresponding to the response data is determined according to the request source flag in the response data, and the response data is sent to the corresponding target thread. It can be understood that all response data also include the response data corresponding to the forwarding thread, so the forwarding thread can also directly determine its own response data according to the request source flag. In this way, by selecting the forwarding thread in the multi-thread, it can not only support the parallel operation of multiple threads, but also avoid interference and data confusion between threads, effectively ensuring the stability and accuracy of IPMB.
[0071] In this embodiment, when there is a need for multi-threaded parallel access between different management controllers, a target thread and a forwarding thread are selected from multiple threads involved in the multi-threaded parallel access; the request data with a request source flag added is sent to the management controller through the forwarding thread; since the request source flag is used to characterize the thread to which the corresponding request data belongs, after the forwarding thread receives the response data returned by the management controller, it can determine the target thread corresponding to the response data according to the request source flag in the response data, and send the response data to the corresponding target thread. In summary, by adding a request source flag to the request data and using the forwarding thread to forward the request data and response data, the orderly sending of the request data is guaranteed, the data transmission efficiency is improved, and the cross-reception of the response data is avoided, thereby improving the communication accuracy and stability.
[0072] Based on the above embodiments, in some embodiments, the method for generating request data includes:
[0073] S111: Determine request data corresponding to the target thread and request data corresponding to the forwarding thread;
[0074] S112: Control the target thread and the forwarding thread to add data headers to the corresponding request data respectively;
[0075] The data header includes a request source flag for requesting data, a command prompt, a network function code, and an address of a slave device to be accessed.
[0076] In order to add the corresponding request source mark to the request data, in the specific implementation, it is necessary to first determine the request data corresponding to the target thread and the request data corresponding to the forwarding thread. Further control the target thread and the forwarding thread to add a data header to the corresponding request data respectively.
[0077] It should be noted that the data header contains the request source flag of the request data, the command prompt, the network function code and the address of the slave device to be accessed. The address of the slave device to be accessed is the address of the SMC. In this way, the setting of the request source flag of the request data is realized, and the accurate forwarding of the response data is guaranteed.
[0078] At present, the method for starting each thread of the BMC to access the SMC is to read the IPMB configuration file, and then decide to start the specific thread corresponding to the channel where the SMC is located according to the IPMB configuration file. However, the IPMB configuration file is not easy to modify, so when the user has a choice of a specific thread, the access adaptation to the SMC is not flexible. Therefore, in order to solve this problem, based on the above embodiment, in some embodiments, the method also includes:
[0079] S13: Determine all threads between the management controller;
[0080] S14: setting corresponding controller access commands for all threads respectively;
[0081] The controller access command is used to start a corresponding thread when accessing the management controller.
[0082] Specifically, firstly, all available threads between the BMC and the SMC are determined, and then corresponding controller access commands are set for all threads respectively. It should be noted that the controller access command is used to start the corresponding thread when accessing the management controller.
[0083] For example, the controller access command 0x01 is set to start the corresponding IPMB Bridge thread when accessing the SMC; the controller access command 0x02 is set to start the corresponding IPMB real-time interactive thread when accessing the SMC. On this basis, some controller access commands can also be set to start the corresponding multiple threads when accessing the management controller. For example, the controller access command 0x03 is set to start the corresponding IPMB Bridge thread and IPMB real-time interactive thread when accessing the SMC. In this embodiment, there is no restriction on the specific method and specific number of controller access commands, which depends on the specific implementation situation.
[0084] In this embodiment, by determining all threads between the management controller and the management controller, corresponding controller access commands are set for all threads respectively, so that the user can independently set the SMC access mode according to needs, thereby improving the access flexibility.
[0085] In order to enable the user to achieve flexible SMC access, based on the above embodiments, in some embodiments, the method further includes:
[0086] S15: When there is a need to access the management controller, determine a designated thread corresponding to the need to access;
[0087] S16: Determine a controller access command corresponding to the specified thread;
[0088] S17: writing the controller access command into the electrically erasable programmable read-only memory;
[0089] S18: Start a specified thread according to the controller access command and access the management controller.
[0090] Specifically, when there is a BMC access requirement to the SMC, a designated thread corresponding to the access requirement is determined. For example, if the user's access requirement is to access the SMC through external transparent transmission, the corresponding designated thread should be the IPMB Bridge thread.
[0091] The controller access command corresponding to the designated thread is further determined. Assuming that the controller access command 0x01 is used to start the corresponding IPMB Bridge thread when accessing the SMC, when it is determined that the designated thread is the IPMB Bridge thread, the corresponding controller access command is determined to be 0x01.
[0092] The controller access command is then written into an Electrically Erasable Programmable Read-Only Memory (EEPROM). EEPROM is a semiconductor storage device that can be electronically rewritten multiple times and has the characteristic that data will not be lost after power failure. Therefore, writing the controller access command into the EEPROM can ensure data reliability and persistence, and the controller access command can be frequently erased and updated, which has high storage efficiency.
[0093] Finally, the specified thread is started according to the controller access command and the SMC is accessed. For example, the IPMB Bridge thread is started according to the controller access command 0x01, and the SMC is accessed through the IPMB Bridge thread.
[0094] It should be noted that, in this embodiment, the specific process of starting a designated thread and accessing the management controller according to the controller access command is not limited and depends on the specific implementation situation.
[0095] In this embodiment, when there is a need to access the management controller, the designated thread corresponding to the access need is determined; the controller access command corresponding to the designated thread is determined; the controller access command is written to the electrically erasable programmable read-only memory; the designated thread is started and the management controller is accessed according to the controller access command, thereby realizing flexible access to the SMC.
[0096] Based on the above embodiments, in some embodiments, starting a specified thread and accessing a management controller according to a controller access command includes:
[0097] S181: Determine whether there is a pre-written controller access command in the EEPROM; if not, proceed to step S182; if yes, proceed to step S183;
[0098] S182: terminating the access process and outputting an alarm message indicating that the controller access command setting fails;
[0099] S183: Determine whether there is a channel connection management controller in each channel of the preset bus; if not, proceed to step S184; if yes, proceed to step S185;
[0100] S184: terminating the access process and outputting an alarm message indicating that the management controller is not connected;
[0101] S185: Acquire hardware attribute information of a preset bus; wherein the hardware attribute information at least includes preset bus information and a slave device address;
[0102] S186: starting a corresponding designated thread in all threads according to the controller access command;
[0103] S187: Setting the hardware attribute information in the specified thread;
[0104] S188: Control the designated thread to access the management controller according to the hardware attribute information.
[0105] Specifically, when executing access to the SMC, first determine whether there is a pre-written controller access command in the EEPROM. If it is confirmed that there is no controller access command, it means that the controller access command has not been set or the setting has failed, and it is impossible to determine which specific thread is used to access the SMC; at this time, the access process is terminated, and an alarm message indicating that the controller access command setting has failed is output to prompt the user to check the setting of the controller access command in time. If it is confirmed that there is a controller access command, it is determined whether there is a channel connecting the SMC in each channel of the preset bus. It should be noted that the preset bus is a bus used for communication between the BMC and the SMC, which contains multiple communication channels. In this embodiment, there is no restriction on the specific type of the preset bus, for example, it can be an I2C bus, or it can be other buses, depending on the specific implementation situation.
[0106] If it is confirmed that all channels of the preset bus are not connected to the SMC, it means that the preset bus is not connected to the SMC at present, and access to the SMC cannot be performed; at this time, the access process is terminated, and an alarm message indicating that the SMC is not connected is output to prompt the user to check the connection status of the SMC in time. If it is confirmed that the channel of the preset bus is connected to the SMC, the hardware attribute information of the preset bus is obtained. It should be noted that the hardware attribute information at least includes the preset bus information and the slave device address, and the slave device address is the device address of the SMC.
[0107] Further, the corresponding designated thread is started in all threads according to the controller access command. For example, when the controller access command is 0x01, the corresponding IPMB Bridge thread is started. Then, the hardware attribute information is set in the designated thread, and finally the designated thread is controlled to access the SMC according to the hardware attribute information.
[0108] In summary, since threads can be selected according to controller access commands, there is no need to start all threads to waste resources. At the same time, there is no need to start threads by reading hardware attribute information in the configuration file, which has higher flexibility.
[0109] Based on the above embodiments, in some embodiments, sending the request data with the request source flag added to the management controller through the forwarding thread includes:
[0110] S113: monitoring the processor occupancy rate and memory occupancy rate of the forwarding thread;
[0111] S114: Determine whether the processor occupancy rate is greater than a first threshold, and the memory occupancy rate is greater than a second threshold; if so, proceed to step S115;
[0112] S115: Reduce the amount of data transmission requested by the forwarding thread to the management controller.
[0113] In a specific implementation, since the forwarding thread is responsible for sending all request data to the SMC in a unified manner, it has a large data transmission pressure. Therefore, in order to ensure the data transmission stability of the forwarding thread, in the process of sending all request data to the SMC in a unified manner through the forwarding thread, the processor occupancy and memory occupancy of the forwarding thread are monitored in real time, and it is determined whether the processor occupancy is greater than the first threshold and the memory occupancy is greater than the second threshold. It should be noted that in this embodiment, there is no restriction on the first threshold and the second threshold, which depends on the specific implementation situation.
[0114] If it is confirmed that the processor occupancy rate is not greater than the first threshold, and / or the memory occupancy rate is not greater than the second threshold, it is considered that the data transmission pressure of the current forwarding thread is within an acceptable range, and the processor occupancy rate and memory occupancy rate of the forwarding thread can be continued to be monitored. If it is confirmed that the processor occupancy rate is greater than the first threshold, and the memory occupancy rate is greater than the second threshold, it is considered that the data transmission pressure of the current forwarding thread exceeds the limit, and it is necessary to reduce its data transmission pressure to ensure the stability of data transmission. Therefore, it is necessary to reduce the amount of data transmission requested by the forwarding thread to the SMC.
[0115] This embodiment does not limit the specific method of reducing the amount of data transmission requested by the forwarding thread to the SMC. For example, in some embodiments, the access frequency of the request data corresponding to each target thread can be specifically reduced, thereby reducing the total amount of request data; the forwarding thread can also be suspended from forwarding the request data of each target thread, so that the forwarding thread only sends its own request data.
[0116] In addition, in the specific implementation, a forwarding cycle can be set. When the forwarding cycle is not reached, the forwarding thread only sends its own request data to the SMC, and does not forward the request data of each target thread to the SMC; when the forwarding cycle is reached, the forwarding thread does not send its own request data to the SMC, but only forwards the request data of each target thread to the SMC, thereby effectively reducing the request data transmission volume of the forwarding thread to the SMC and ensuring the stability of the forwarding thread.
[0117] In the above embodiments, the controller access method is described in detail. The present invention also provides a corresponding embodiment of the controller access device.
[0118] Figure 2 A schematic diagram of a controller access device provided by an embodiment of the present invention. Figure 2 As shown, the device includes
[0119] The selection module 10 is used to select at least one thread from multiple threads involved in the multi-thread access with the management controller as a forwarding thread, and select the remaining threads as target threads.
[0120] The first sending module 11 is used to send the request data with the request source flag added to the management controller through the forwarding thread; wherein the request source flag is used to indicate the thread to which the corresponding request data belongs.
[0121] The second sending module 12 is used to determine the target thread corresponding to the response data according to the request source flag in the response data after the forwarding thread receives the response data returned by the management controller, and send the response data to the corresponding target thread.
[0122] In some embodiments, the method for generating request data specifically includes determining the request data corresponding to the target thread and the request data corresponding to the forwarding thread; controlling the target thread and the forwarding thread to add data headers to the corresponding request data respectively; wherein the data header includes a request source flag of the request data, a command prompt, a network function code and an address of a slave device to be accessed.
[0123] In some embodiments, it also includes:
[0124] A first determination module, used to determine all threads between the management controller;
[0125] A first setting module, used to set corresponding controller access commands for all threads respectively;
[0126] The controller access command is used to start a corresponding thread when accessing the management controller.
[0127] In some embodiments, it also includes:
[0128] A second determination module is used to determine a designated thread corresponding to the access requirement when there is an access requirement to the management controller;
[0129] A third determination module, used to determine a controller access command corresponding to a specified thread;
[0130] A writing module, used for writing the controller access command into the electrically erasable programmable read-only memory;
[0131] The start access module is used to start a specified thread and access the management controller according to the controller access command.
[0132] In some embodiments, starting the access module includes:
[0133] The first judgment module is used to judge whether there is a pre-written controller access command in the electrically erasable programmable read-only memory; if it is confirmed that there is no controller access command, the access process is terminated and an alarm message indicating that the controller access command setting fails is output; if it is confirmed that there is a controller access command, the second judgment module is triggered;
[0134] The second judgment module is used to judge whether there is a channel connected to the management controller in each channel of the preset bus; if it is confirmed that each channel of the preset bus is not connected to the management controller, the access process is terminated and an alarm message indicating that the management controller is not connected is output; if it is confirmed that the channel of the preset bus is connected to the management controller, the acquisition module is triggered;
[0135] An acquisition module, used to acquire hardware attribute information of a preset bus; wherein the hardware attribute information at least includes preset bus information and a slave device address;
[0136] A startup submodule, used to start a corresponding designated thread in all threads according to a controller access command;
[0137] A second setting module is used to set the hardware attribute information in a specified thread;
[0138] The access control module is used to control the designated thread to access the management controller according to the hardware attribute information.
[0139] In some embodiments, the first sending module 11 includes:
[0140] A monitoring module is used to monitor the processor occupancy and memory occupancy of the forwarding thread;
[0141] A third judgment module is used to judge whether the processor occupancy rate is greater than a first threshold value, and the memory occupancy rate is greater than a second threshold value; if it is confirmed that the processor occupancy rate is greater than the first threshold value, and the memory occupancy rate is greater than the second threshold value, the adjustment module is triggered;
[0142] The adjustment module is used to reduce the amount of data transmission requested by the forwarding thread to the management controller.
[0143] In some embodiments, the adjustment module is specifically used to reduce the access frequency of the request data corresponding to each target thread, or to suspend the forwarding thread from forwarding the request data of each target thread.
[0144] Since the embodiments of the apparatus part correspond to the embodiments of the method part, please refer to the description of the embodiments of the method part for the embodiments of the apparatus part, which will not be repeated here.
[0145] In addition, the present invention also provides a computer program product, including a computer program / instruction, which implements the steps of the above controller access method when executed by a processor.
[0146] Figure 3 A schematic diagram of a controller access device provided by an embodiment of the present invention. Figure 3 As shown, the controller access device includes:
[0147] A memory 20, used for storing computer programs;
[0148] The processor 21 is used to implement the steps of the controller access method mentioned in the above embodiment when executing the computer program.
[0149] The controller access device provided in this embodiment may include but is not limited to a smart phone, a tablet computer, a laptop computer, or a desktop computer.
[0150] Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 can be implemented in at least one hardware form of a digital signal processor (DSP), a field programmable gate array (FPGA), and a programmable logic array (PLA). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor for processing data in an awake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 21 may be integrated with a graphics processing unit (GPU), and the GPU is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 may also include an artificial intelligence (AI) processor, which is used to process computing operations related to machine learning.
[0151] The memory 20 may include one or more computer-readable storage media, which may be non-transitory. The memory 20 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 20 is at least used to store the following computer program 201, wherein, after the computer program is loaded and executed by the processor 21, it can implement the relevant steps of the controller access method disclosed in any of the aforementioned embodiments. In addition, the resources stored in the memory 20 may also include an operating system 202 and data 203, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 202 may include Windows, Unix, Linux, etc. Data 203 may include but is not limited to data involved in the controller access method.
[0152] In some embodiments, the controller access device may further include a display screen 22 , an input / output interface 23 , a communication interface 24 , a power supply 25 , and a communication bus 26 .
[0153] Those skilled in the art will understand that Figure 3 The structure shown in the figure does not constitute a limitation on the controller access device, and may include more or fewer components than shown in the figure.
[0154] Finally, the present invention also provides an embodiment corresponding to a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps recorded in the above method embodiment are implemented.
[0155] It is understandable that if the method in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc. Various media that can store program codes.
[0156] The controller access method, device, equipment and medium provided by the present invention are introduced in detail above. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the embodiments can be referenced to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description. It should be pointed out that for ordinary technicians in this technical field, without departing from the principle of the present invention, several improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the scope of protection of the present invention.
[0157] It should also be noted that, in this specification, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.
Claims
1. A controller access method, characterized in that: include: Selecting at least one thread from a plurality of threads involved in the multi-threaded access with the management controller as a forwarding thread, and selecting the remaining threads as target threads; The request data with the request source flag added thereto is sent to the management controller through the forwarding thread; wherein the request source flag is used to indicate the thread to which the corresponding request data belongs; After the forwarding thread receives the response data returned by the management controller, the target thread corresponding to the response data is determined according to the request source flag in the response data, and the response data is sent to the corresponding target thread.
2. The controller access method according to claim 1, characterized in that: The method for generating the request data includes: Determine the request data corresponding to the target thread and the request data corresponding to the forwarding thread; Control the target thread and the forwarding thread to add data headers to the corresponding request data respectively; The data header includes the request source flag of the request data, a command prompt, a network function code and an address of a slave device to be accessed.
3. The controller access method according to claim 1, characterized in that: Also includes: Determine all threads between the management controller; Set corresponding controller access commands for all threads respectively; The controller access command is used to start a corresponding thread when accessing the management controller.
4. The controller access method according to claim 3, characterized in that: Also includes: When there is a demand for access to the management controller, determining a designated thread corresponding to the access demand; Determining the controller access command corresponding to the specified thread; Writing the controller access command into an electrically erasable programmable read-only memory; The designated thread is started according to the controller access command and the management controller is accessed.
5. The controller access method according to claim 4, characterized in that: Starting the designated thread and accessing the management controller according to the controller access command includes: Determining whether there is a pre-written controller access command in the electrically erasable programmable read-only memory; If it is confirmed that the controller access command does not exist, the access process is terminated, and an alarm message indicating that the controller access command setting has failed is output; If it is confirmed that the controller access command exists, determining whether there is a channel connected to the management controller among the channels of the preset bus; If it is confirmed that none of the channels of the preset bus is connected to the management controller, the access process is terminated, and an alarm message indicating that the management controller is not connected is output; If it is confirmed that the channel of the preset bus is connected to the management controller, then the hardware attribute information of the preset bus is obtained; wherein the hardware attribute information at least includes the preset bus information and the slave device address; Starting the corresponding designated thread in all threads according to the controller access command; Setting the hardware attribute information in the designated thread; The designated thread is controlled to access the management controller according to the hardware attribute information.
6. The controller access method according to any one of claims 1 to 5, characterized in that: Sending the request data with the request source flag added to the management controller through the forwarding thread includes: Monitoring the processor occupancy rate and memory occupancy rate of the forwarding thread; Determine whether the processor occupancy is greater than a first threshold, and the memory occupancy is greater than a second threshold; If it is confirmed that the processor occupancy rate is greater than the first threshold, and the memory occupancy rate is greater than the second threshold, the amount of data transmission requested by the forwarding thread to the management controller is reduced.
7. The controller access method according to claim 6, characterized in that: Reducing the amount of data requested by the forwarding thread to the management controller, including: The access frequency of the request data corresponding to each of the target threads is reduced, or the forwarding thread is suspended from forwarding the request data of each of the target threads.
8. A controller access device, characterized in that: include A selection module, used to select at least one thread from a plurality of threads involved in the multi-threaded access with the management controller as a forwarding thread, and select the remaining threads as target threads; A first sending module, configured to send the request data with the request source flag added thereto to the management controller through the forwarding thread; wherein the request source flag is used to indicate the thread to which the corresponding request data belongs; The second sending module is used to determine the target thread corresponding to the response data according to the request source flag in the response data after the forwarding thread receives the response data returned by the management controller, and send the response data to the corresponding target thread.
9. A controller access device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the controller access method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the controller access method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Multithread processing method and device
CN101826003A
Method for supporting realization of sensor information collection by increasing custom command
CN106850814A
Multithreaded concurrent processing method and multithreaded concurrent processing system
CN107193539A
Request processing method, device, equipment and readable storage medium
CN110515706A
Data reading method and device, equipment and storage medium
CN116974743A