Task processing method and device, electronic equipment and storage medium
By distributing BMC tasks to coprocessors in heterogeneous systems and interconnecting multiple heterogeneous systems, the resource shortage problem when BMC processes time-consuming and resource-intensive tasks is solved, thereby improving system stability and response speed.
Patent Information
- Application Number
- CN202411342135.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-25
- Publication Date
- 2025-11-21
- Estimated Expiration
- 2044-09-25
AI Technical Summary
When BMC processes time-consuming and resource-intensive tasks, existing technologies cannot effectively solve the problem of untimely or incorrect responses caused by the scarcity of main processor resources, especially when hardware is limited or business functions are not supported, resulting in abnormal system responses.
By sending tasks from the main processor to coprocessors in heterogeneous systems, and by interconnecting multiple heterogeneous systems and selecting appropriate heterogeneous systems for task allocation, the shortage of main processor resources can be alleviated and system stability can be improved.
By allocating tasks through heterogeneous system coprocessors, the system mitigates untimely or erroneous responses when main processor resources are scarce, thereby improving system stability and response speed.
Smart Images

Figure CN119512734B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a task processing method, apparatus, electronic device, and storage medium. Background Technology
[0002] The Baseboard Management Controller (BMC) is used to perform operations such as firmware upgrades, view device information, and acquire sensor data on the server when it is offline. The BMC plays a crucial role in server component monitoring and remote management. From the moment the server powers on, all server components are under the responsibility and management of the BMC; therefore, ensuring the reliability of the BMC is paramount.
[0003] When the BMC is upgrading or handling time-consuming and resource-intensive tasks, it consumes a significant amount of resources. Therefore, ensuring that other services can respond normally is crucial. Existing technologies typically optimize the system resources used by the BMC when handling these tasks, such as increasing device read / write speeds, using DMA, and adding hardware resources, to improve system response speed and enhance system reliability. However, when the current system hardware is limited or the business functions do not support it, these techniques become ineffective. This can lead to problems such as no response or abnormal response when users access the system while the BMC is handling time-consuming or other resource-intensive tasks. Summary of the Invention
[0004] This invention provides a task processing method, apparatus, electronic device, and storage medium, which alleviates the situation of untimely or erroneous response when main processor resources are scarce.
[0005] This invention provides a task processing method applied to a coprocessor of a first heterogeneous system, the first heterogeneous system further including a main processor, the main processor and the coprocessor having a communication connection, the method comprising: receiving a task request from the main processor; selecting from a processor list according to the type of the task request to obtain a communication list, the processor list including multiple second heterogeneous systems, the second heterogeneous systems being heterogeneous systems having a network connection with the first heterogeneous system; sending the task request to a coprocessor in a target heterogeneous system, the target heterogeneous system being the multiple heterogeneous systems in the communication list; receiving return data from the coprocessor in the target heterogeneous system, and sending the return data to the main processor.
[0006] According to a task processing method provided by the present invention, the method further includes: obtaining multiple communication addresses from the intra-system link data of the first heterogeneous system; sending a device information acquisition request to each of the communication addresses; and establishing the processor list based on the device information returned by each of the communication addresses.
[0007] According to a task processing method provided by the present invention, a communication list is obtained by selecting from the processor list based on the type of the task request, including:
[0008] The corresponding strategy model is obtained based on the type of the task request, including: processor resource type, memory resource type, and flash memory resource type. The strategy model is used to evaluate heterogeneous systems based on device information.
[0009] The communication list is obtained by selecting heterogeneous systems based on the device information of each heterogeneous system in the processor list and the strategy model.
[0010] According to a task processing method provided by the present invention, heterogeneous system selection is performed based on device information of each heterogeneous system in the processor list and the strategy model to obtain a communication list, including: calculating a weight index of device information using the strategy model; calculating the weight of each heterogeneous system in the processor list based on the device information of each heterogeneous system in the processor list and the weight index; and selecting multiple heterogeneous systems from the processor list according to the weights to obtain the communication list.
[0011] According to a task processing method provided by the present invention, the method further includes: calculating the time to life (TTL) of each of the communication addresses; and storing the TTL of each of the communication addresses in the processor list.
[0012] This invention also provides a task processing method applied to a coprocessor of a first heterogeneous system, the first heterogeneous system further including a main processor, the main processor and the coprocessor having a communication connection, the method comprising: receiving a cooperation request, the cooperation request being sent by the coprocessor of a second heterogeneous system according to a task issued by the main processor in the second heterogeneous system; filtering and preliminarily verifying the cooperation request to generate a data packet; processing the data in the data packet to generate processed data; encapsulating the processed data according to the data type to generate a return message; and sending the return message to the coprocessor of the second heterogeneous system.
[0013] This invention also provides a heterogeneous system, which is a first heterogeneous system. The first heterogeneous system includes a main processor and a coprocessor, and the main processor and the coprocessor are connected in communication. The main processor is used to issue task requests to the coprocessors. The coprocessors are used to receive the task requests from the main processor. A communication list is obtained by selecting from a processor list according to the type of the task request. The processor list includes multiple second heterogeneous systems, which are heterogeneous systems connected to the first heterogeneous system via a network. The collaboration request is sent to the coprocessors in the target heterogeneous system, which are the multiple heterogeneous systems in the communication list. Return data is received from the coprocessors in the target heterogeneous system, and the return data is sent to the main processor.
[0014] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the task processing method described above.
[0015] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the task processing method as described above.
[0016] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the task processing method as described above.
[0017] The task processing method, apparatus, electronic device, and storage medium provided by this invention send the tasks of the main processor in a first heterogeneous system to the coprocessors of other heterogeneous systems for processing. By interconnecting multiple heterogeneous systems, the system alleviates the situation of untimely or erroneous response when the main processor resources are scarce, thereby improving system stability. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0019] Figure 1 This is a flowchart illustrating a task processing method provided by the present invention.
[0020] Figure 2 This is a flowchart illustrating a customized strategy algorithm provided by the present invention.
[0021] Figure 3 This is a flowchart illustrating a task processing method provided by the present invention.
[0022] Figure 4 This is a schematic diagram of the overall process of a task processing method provided by the present invention.
[0023] Figure 5 This invention provides a method for generating a device list.
[0024] Figure 6 This is a schematic diagram of the structure of a heterogeneous system provided by the present invention.
[0025] Figure 7 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation
[0026] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0027] In existing technologies, when BMC processes time-consuming and resource-intensive tasks, it optimizes the system resources used by the system, such as increasing device read and write speed, using DMA (Direct Memory Access), and increasing hardware resources, in order to improve system response speed and enhance system reliability.
[0028] However, existing technologies place high demands on product hardware, requiring devices to support DMA, increase memory and flash storage, and improve CPU frequency, thus increasing hardware costs. In scenarios with different business functions and resource requirements, since the hardware is already fixed, further optimization based on existing hardware conditions is not possible. Furthermore, the various optimization methods available suffer from poor compatibility.
[0029] Furthermore, when resources are scarce, adding solutions and processing tasks to the main system may further strain system resources.
[0030] In view of this, embodiments of the present invention provide a task processing method that sends the tasks of the main processor in a first heterogeneous system to the coprocessors of other heterogeneous systems for processing. By interconnecting multiple heterogeneous systems, the method alleviates the situation of untimely or incorrect response when the main processor resources are scarce, thereby improving system stability.
[0031] The technical solutions of the present invention will now be described with reference to the accompanying drawings in the embodiments of the present invention.
[0032] Figure 1 This is one of the flowcharts illustrating the task processing method provided by the present invention. The task processing method can be applied to electronic devices, including heterogeneous systems. These electronic devices can be various types of devices with information processing capabilities during implementation. For example, the electronic device may include a personal computer, laptop computer, PDA, or server; the electronic device may also be a mobile terminal, such as a mobile phone, in-vehicle computer, tablet computer, or projector.
[0033] In a broad sense, a heterogeneous system refers to a computing system composed of different types of computer hardware or software. These components can be heterogeneous, meaning they may come from different manufacturers or use different operating systems, programming languages, or protocols.
[0034] The heterogeneous system in this invention refers to an electronic system that includes two processors. In computer science, a processor is an electronic component that performs operations on an external data source (such as memory data or other data streams).
[0035] In this invention, the two processors are referred to as the main processor and the coprocessor, respectively, and they are connected in communication. The main processor is used to process the data input to it, and it is typically used to implement the functions of an electronic system. The coprocessor is an auxiliary processor developed and applied to assist the main processor in performing processing tasks that it cannot perform, or to improve execution efficiency and performance. For example, in a heterogeneous system, there is a BMC (Body Control Unit), where the main processor is the BMC's Central Processing Unit (CPU), and the coprocessor is other processors on the BMC's CPU, such as digital signal processors (DSPs) or application processors (APUs).
[0036] The heterogeneous system implementing the method of the present invention has communication connections with other heterogeneous systems. Assuming the method of the present invention is applicable to a first heterogeneous system, then in the implementation environment, in addition to the first heterogeneous system, there are also heterogeneous systems A and B, and communication connections exist between each pair of heterogeneous systems. For example, the server is equipped with multiple BMCs: a first BMC, a second BMC, and a third BMC, with communication connections between each pair of BMCs. The coprocessor on the first BMC will execute the task processing method of the present invention and interact with the second BMC and / or the third BMC.
[0037] like Figure 1As shown, this method can be applied to the coprocessor of the first heterogeneous system described above, and the method may include the following steps 110 to 140:
[0038] Step 110: Receive the task request from the main processor.
[0039] The coprocessor of the first heterogeneous system receives task requests from the main processor of that system. The task request is generated by the main processor of the first heterogeneous system by packaging the tasks that the coprocessor needs to execute.
[0040] For example, when the BMC's main processor is executing a time-consuming or resource-intensive task, it will also receive other tasks, such as checking sensor information on the server. In this case, to ensure the response speed of these other tasks, the main processor can package the relevant information of these other tasks and send it to the BMC's coprocessor.
[0041] Step 120: Select from the processor list according to the type of the task request to obtain a communication list. The processor list includes multiple second heterogeneous systems, which are heterogeneous systems that have a network connection with the first heterogeneous system.
[0042] The coprocessor of the first heterogeneous system obtains a pre-stored list of processors, which includes information about multiple second heterogeneous systems. The second heterogeneous system refers to a heterogeneous system that has a network link with the first heterogeneous system, such as heterogeneous system A and heterogeneous system B mentioned above.
[0043] The coprocessor of the first heterogeneous system selects a heterogeneous system from the processor list based on the type of task request, selecting multiple heterogeneous systems. The relevant information of the selected heterogeneous systems is stored to generate a communication list.
[0044] In one embodiment of the present invention, a communication list is obtained by selecting from the processor list according to the type of the task request, including: obtaining a corresponding strategy model according to the type of the task request, wherein the type includes: processor resource type, memory resource type, and flash memory resource type, and the strategy model is used to evaluate heterogeneous systems based on device information; and selecting heterogeneous systems based on the device information of each heterogeneous system in the processor list and the strategy model to obtain the communication list.
[0045] In this embodiment, task requests are categorized into different types based on the needs of task processing. For example, the present invention pre-sets the task processing scenarios as requiring CPU resources, memory resources, flash resources, etc., and thus pre-sets the task request types as processor resource type, memory resource type, and flash resource type. Furthermore, for each type, a corresponding strategy model is provided. The strategy model can be trained and is used to evaluate heterogeneous systems based on heterogeneous system information.
[0046] The coprocessor of the first heterogeneous system determines the type of the task request based on the data in the request. Then, based on the determined type, it obtains the corresponding policy model.
[0047] Subsequently, a strategy model is used to evaluate each heterogeneous system based on the device information of the heterogeneous systems recorded in the processor list, and the evaluation results are obtained. Based on the evaluation results, heterogeneous systems are selected from the processor list to obtain a communication list.
[0048] For example, this invention refers to the information about a heterogeneous system stored in the processor list as the resource of that heterogeneous system. When the heterogeneous system is a BMC (Body Control Center), the resource contains BMC-related resource definitions, such as CPU utilization, memory utilization, flash memory space, TTL path length, etc., defined according to different requirements. Here, TTL (Time to Live) refers to the time or number of hops a data packet can exist during transmission in a network.
[0049] The strategy model combines resource information, such as TTL and other relevant resource information for heterogeneous systems, to sort the heterogeneous systems in the processor list. Based on the order output by the strategy model, multiple heterogeneous systems are selected, and relevant information such as communication addresses of the selected heterogeneous systems is saved to generate a communication list.
[0050] In the above embodiments, different strategy models are set according to different types of task processing, so as to calculate the satisfaction of heterogeneous systems required under different task demand scenarios through the strategy models, and obtain multiple heterogeneous systems suitable for execution under each task.
[0051] In one embodiment of the present invention, heterogeneous system selection based on device information of each heterogeneous system in the processor list and the strategy model to obtain a communication list includes: calculating a weight index of device information using the strategy model; calculating the weight of each heterogeneous system in the processor list based on device information of each heterogeneous system in the processor list and the weight index; and selecting multiple heterogeneous systems from the processor list based on the weights to obtain the communication list.
[0052] For example, a policy implementation module is set up on the coprocessor of the first heterogeneous system. The policy implementation module is mainly used to implement the policy configuration and policy algorithm for updating the service_device[SCENE] list.
[0053] The strategy implementation module defines the strategy implementation as an input-output system. Its inputs are a list of processors and SCENEs. SCENEs are enumerated values representing the type of task request, including: CPU_RESOURCE (processor resource type), MEMORY_RESOURCE (memory resource type), FLASH_RESOURCE (flash memory resource type), TTL_RESOURCE (time-to-live resource type), or other resource requirement scenarios. The output is a list of `serve_device` for the corresponding SCENE. Updates use the strategy algorithm configured in the system, or a custom strategy algorithm can be used.
[0054] The strategy implementation module retrieves the configured strategy algorithm based on the type of the input task request. The strategy algorithm is primarily used to generate weights for different device information under a specified SCENE. Strategy algorithms include: entropy method, factor analysis, analytic hierarchy process (AHP), principal component analysis, etc., and customized strategy algorithms can also be implemented according to project requirements.
[0055] The strategy implementation module obtains the corresponding user-configured algorithm parameters based on the strategy algorithm, and calculates the weight index of each heterogeneous system in the processor list according to different strategy weight calculation methods.
[0056] After the weight index is calculated, a weighted value is calculated for the device information and weights of all heterogeneous systems in the processor list according to the set rules. The calculated weighted values are sorted to generate a `serve_device` list. Heterogeneous systems are selected based on the `serve_device` list to obtain a communication list. For example, the top ten heterogeneous systems in the `serve_device` list are selected to generate the communication list, or the `serve_device` list can be directly used as the final output communication list.
[0057] In one embodiment of the present invention, the following is adopted: Figure 2 The process implements customized strategy algorithms, such as Figure 2 As shown, Figure 2 This is a flowchart illustrating a customized strategy algorithm of the present invention. Figure 2In this process, raw data, including variables and sample data, is collected beforehand. Data preprocessing is performed on the collected raw data, such as handling missing values and outliers. For the processed raw data, a suitable base model is selected based on its characteristics, and this base model is trained using the data. For the trained model, test data is input to calculate the weights of the test data, and then a weighted average is calculated using these weights. The algorithm is evaluated based on the weighted average. Based on the evaluation results, the trained model is optimized, and the optimized model is used as the policy algorithm.
[0058] Step 130: Send the task request to the coprocessor in the target heterogeneous system, wherein the target heterogeneous system is one of the multiple heterogeneous systems in the communication list.
[0059] The coprocessor of the first heterogeneous system selects multiple heterogeneous systems from the communication list as target heterogeneous systems.
[0060] The coprocessor of the first heterogeneous system sends the task request to the coprocessor within the target heterogeneous system. For example, the coprocessor of the first heterogeneous system divides the task request into multiple subtasks and sends these subtasks to different target heterogeneous systems, allowing them to cooperate in processing the task.
[0061] Step 140: Receive return data from the coprocessor in the target heterogeneous system and send the return data to the main processor.
[0062] Upon receiving a cooperation request, the coprocessor within the target heterogeneous system processes the task data carried in the request and generates return data. This return data is then sent to the coprocessor of the first heterogeneous system.
[0063] After receiving the return data from all target heterogeneous systems, the coprocessor of the first heterogeneous system sends this data to the main processor to process the task.
[0064] The above task processing method sends the tasks of the main processor in the first heterogeneous system to the coprocessors of other heterogeneous systems for processing. By interconnecting multiple heterogeneous systems, it alleviates the situation of untimely response or incorrect response when the main processor resources are scarce, and improves system stability.
[0065] In one embodiment of the present invention, the method further includes: obtaining multiple communication addresses from the intra-system link data of the first heterogeneous system; sending a device information acquisition request to each of the communication addresses; and establishing the processor list based on the device information returned by each of the communication addresses.
[0066] For example, the coprocessor of the first heterogeneous system also includes a device list update module. This module periodically discovers nearby BMC devices that can communicate with it. The device list update module can also be triggered by demand, suitable for situations where the update time has not yet arrived, but the service list is unavailable, or other extreme scenarios. The specific process is as follows:
[0067] The coprocessor periodically identifies the communication addresses (such as IP addresses) of other devices interconnected with the current heterogeneous system, communicates with these devices to obtain relevant device information, and saves all devices in the device IP field of the processor list after discovery. If communication failures with other devices exceed a specified number, the heterogeneous system is removed from the processor list. When the number of devices in the processor list falls below a certain threshold, a list update process is initiated again to update the processor list. The processor list is a list of devices, defined as follows.
[0068] struct bmc_info bmc_list[DEVICE_NUM_MAX];
[0069] The specific device bmc_info definition in the processor list is as follows:
[0070] struct bmc_info{
[0071] string ip;
[0072] struct resource_info resource;
[0073] };
[0074] The `struct resource_info` mainly contains BMC-related resource definitions, such as CPU utilization, memory utilization, and flash space.
[0075] The loop processor list communicates with each IP in the list using a specified message communication format (defined in the coprocessor task processing module) to obtain and populate the required device information in struct resource_info, while determining which devices do not support this function and removing them from the list.
[0076] In one embodiment of the present invention, the time to life (TTL) of each of the communication addresses is calculated; and the TTL of each of the communication addresses is stored in the processor list.
[0077] Get the TTL value for each IP in the list, and assign the TTL value in the resource field according to the calculated value.
[0078] In the above embodiments, the lifetime of other heterogeneous systems is calculated to facilitate subsequent screening of heterogeneous systems based on their lifetime, thereby identifying the heterogeneous system with the shortest communication path.
[0079] In addition to sending tasks from the main processor in the first heterogeneous system to coprocessors in other heterogeneous systems, the coprocessor of the first heterogeneous system can also receive cooperation requests from coprocessors in other heterogeneous systems, thereby helping the main processors in other heterogeneous systems complete their tasks.
[0080] Figure 3 A flowchart of a task processing method also provided by the present invention is shown below. Figure 3 As shown, this method can be applied to the coprocessor of the first heterogeneous system described above. The first heterogeneous system also includes a main processor, and the main processor and the coprocessor are connected in communication. The method may include the following steps 310 to 350:
[0081] Step 310: Receive a collaboration request, which is sent by the coprocessor of the second heterogeneous system based on the task issued by the main processor in the second heterogeneous system.
[0082] The coprocessor of the first heterogeneous system receives the cooperation request. The cooperation request is generated by the coprocessor of the second heterogeneous system, which generates the cooperation request based on the task request after receiving the task request issued by the main processor of the second heterogeneous system.
[0083] Step 320: Filter and perform preliminary verification on the collaboration requests to generate data packets.
[0084] The coprocessor of the first heterogeneous system filters and performs preliminary verification on the cooperation requests, generating data packets. These data packets are then placed in a data queue.
[0085] Step 330: Process the data in the data packet to generate processed data.
[0086] The coprocessor of the first heterogeneous system retrieves data packets from the data queue, unpacks and processes them, then reassembles the data and sends it to different data queues.
[0087] Step 340: Based on the data type of the processed data, encapsulate the processed data and generate a return message.
[0088] Step 350: Send the returned message to the coprocessor of the second heterogeneous system.
[0089] The coprocessor of the first heterogeneous system retrieves the data to be sent from the data queue, assembles the data according to different message types, and sends it to the main CPU or other BMC devices.
[0090] The following describes an exemplary application of the embodiments of the present invention in a practical application scenario. Figure 4 This is a schematic diagram of the overall flow of a task processing method provided in an embodiment of the present invention.
[0091] like Figure 4 As shown, the coprocessor receives a request from the main processor and places it in the main CPU message request queue of the coprocessor, awaiting processing. The coprocessor sequentially retrieves message data from the request queue for processing, and also determines whether the retrieved message data is a valid request. If it is an invalid request, it retrieves the message from the request queue again.
[0092] If the request is valid, it is further assembled according to the request message type. The assembled message is then sent to a high-priority device in the device list. While waiting for a reply from the high-priority device, the coprocessor continuously retrieves messages from the request queue and sends them. For replies from high-priority devices, the coprocessor processes them before returning them to the main processor.
[0093] For example, the heterogeneous system is a BMC. The coprocessor has a task processing module. The task processing module is mainly responsible for receiving messages from the main processor, assembling different message requests according to the message type of the main processor, finding the highest priority device based on the service device list obtained by the service discovery module and the timed update module, and sending the assembled message request to that device; then it waits for the device's reply and processes the message data in the message queue in a loop.
[0094] The format definition of the assembled message header is as follows:
[0095] struct message_header {
[0096] uint32_t source_ip; / / IP address of the message source BMC
[0097] uint32_t destination_ip; / / IP address of the destination BMC for the message
[0098] uint8_t process_flag[4]; / / Fixed 4 bytes, identifies the current process
[0099] uint8_t message_type; / / Message type
[0100] uint8_t reserve[3]; / / Reserved
[0101] uint32_t data_length; / / Data length
[0102] };
[0103] A message consists of two parts: a message header and data. The format of the data part can vary depending on the message type in the message header, and can be defined according to specific needs.
[0104] The task processing module can be divided into three specific sub-tasks: a. Data receiving task, which requires receiving network data packets, performing relevant filtering and preliminary verification, and then placing the data packets into different data receiving queues, which may include: the main CPU data queue and other device data queues.
[0105] b. Data processing subtasks, which are divided into two types: one processes data in the main CPU data queue; the other processes data in the data queues of other devices. The main processes and functions of these two tasks are similar: receiving data, unpacking it, and distributing it to different message processing interfaces within the module for processing. After the internal message processing interfaces complete their processing, the data is reassembled and sent to different data queues.
[0106] c. Data transmission task: This task is mainly responsible for retrieving the data to be transmitted from the data queue, assembling the data according to different message types, and sending it to the main CPU or other BMC devices. The data queue to be transmitted is divided into two: one is the data queue to be sent to the main CPU, and the other is the data queue to be sent to other BMCs.
[0107] The method for generating the device list can be as follows: Figure 5 The method shown, Figure 5 This invention illustrates a method for generating a device list. Figure 2 The coprocessor of the local BMC obtains the devices connected to it on the current network and saves the IP addresses of other interconnected devices in the `bmc_list`. The coprocessor then repeatedly executes the access process to access the IPs in `bmc_list` and calculates the Time-To-Live (TTL) from the local BMC to each IP. The TTL is then filled into the TTL field of the device's `resource` field in `bmc_list`, and a request message is sent to that device.
[0108] Upon receiving the request message, other BMC devices package their device information into resource information and return it to the coprocessor.
[0109] The coprocessor populates the resource field of bmc_list with the received resource information. If a device does not respond to the request message, it is considered that the device does not support cooperation and is removed from bmc_list.
[0110] After obtaining the device data for all IPs in bmc_list, the strategy implementation module calculates the weighting coefficients for other BMCs to complete the task of this BMC based on the resources of different scenarios, and saves the weighting coefficients to the list.
[0111] For example, the device list in the task processing module is generated by the device list update module. The main function of the device list update module is for the coprocessor of this BMC to periodically discover surrounding BMC devices that can communicate with it, and to select the most suitable service BMC based on different needs of this BMC. The device list update module can also be triggered by demand, which is suitable for situations where the update time has not yet arrived, but the service list is unavailable, or other extreme scenarios. The specific process is as follows:
[0112] The coprocessor periodically identifies the IPs of other devices interconnected with the current BMC and communicates with these BMCs to obtain relevant resource information. After discovering other devices interconnected with this BMC, it saves all devices in the device IP field of `bmc_list`. If communication with other BMCs fails more than a predetermined number of times, that BMC is removed from the `bmc_list`. When the number of devices in `bmc_list` falls below a certain threshold, the device list update process is re-initiated to update `bmc_list`. `bmc_list` is a list of devices, defined as follows.
[0113] struct bmc_info bmc_list[DEVICE_NUM_MAX];
[0114] The specific device bmc_info definition in the device list is as follows:
[0115] struct bmc_info{
[0116] string ip;
[0117] struct resource_info resource;
[0118] };
[0119] The `struct resource_info` mainly defines BMC-related resources, such as CPU utilization, memory utilization, flash space, and TTL path length, which are defined according to different requirements.
[0120] Loop through the bmc_list list, retrieve the TTL value for each IP in the list, and assign it to the TTL value in the resource field. The current BMC communicates with all devices in the list using the specified message communication format (defined in the coprocessor task processing module), retrieves the required information from the struct resource_info and populates it, and determines which devices do not support this function and removes them from the list.
[0121] After obtaining all IPs and resources in bmc_list, and combining the TTL in the resources with the relevant resource information of the target BMC, the bmc_list and the corresponding SCENE are passed to the policy implementation module to calculate the device requirements of the current BMC in different demand scenarios (such as scenarios requiring CPU resources, memory resources, flash resources, etc.). The module then sorts the devices from most suitable to least suitable to generate a service_device list for each scenario.
[0122] The final serve_device might look like this:
[0123] serve_device[CPU_RESOURCE] = {bmc_list[2], bmc_list[1], bmc_list[3]…};
[0124] serve_device[MEMORY_RESOURCE] = {bmc_list[0], bmc_list[1], bmc_list[2]…};
[0125] serve_device[FLASH_RESOURCE] = {bmc_list[3], bmc_list[1], bmc_list[4]…};
[0126] After the service discovery module completes its process, this BMC saves a list of the best services to all other BMCs that support the functionality of this invention. This list will be used by the coprocessor task processing module.
[0127] The strategy implementation module is mainly used to implement the strategy configuration and strategy algorithm for updating the serve_device[resource] list.
[0128] The strategy implementation in this module is defined as an input-output system. Its inputs are bmc_list and SCENE, where SCENE is an enumerated value, namely CPU_RESOURCE, MEMORY_RESOURCE, FLASH_RESOURCE, TTL_RESOURCE, or other resource requirement scenarios. The output is a list of service_devices for the corresponding SCENE. When updating, the strategy algorithm configured in the system is used, or you can customize the strategy algorithm yourself, which is very flexible.
[0129] The main process of the strategy implementation module is as follows: Obtain the configured strategy algorithm. The strategy algorithm is mainly used to generate weights for different resources under a specified SCENE. Supported strategies include entropy analysis, factor analysis, analytic hierarchy process (AHP), principal component analysis, etc., and can also be customized according to project requirements. Figure 3 The process implements customized strategy algorithms. These algorithms are configurable and customizable.
[0130] Based on the strategy algorithm, obtain the corresponding user-configured algorithm parameters, and calculate the weight index of each BMC in the input list according to different strategy weight calculation methods.
[0131] After the weight index is calculated, the weighted values of the resources and weights in all bmc in bmc_list are calculated according to the set rules.
[0132] Sort the calculated weighted values to get the final list of serve_devices.
[0133] The above embodiments provide a method and apparatus for improving the response speed of BMCs in a heterogeneous dual-system environment. Multiple BMCs are interconnected on the coprocessor of the heterogeneous dual-system, further alleviating the pressure on the main processor. The interconnection of multiple BMCs addresses the issue of untimely or erroneous responses when BMC resources are scarce. A defined strategy is used to periodically update the service list, and different strategy configurations can be changed to meet the needs of different resource-constrained scenarios.
[0134] The above embodiments can reduce problems such as slow system response or no response when the BMC processes time-consuming and resource-intensive tasks, thereby improving system reliability. Meanwhile, the coprocessor system implementation based on a heterogeneous dual-system architecture further alleviates the pressure on the main processor, ensuring system stability and reliability. Furthermore, different weight calculation algorithms can be flexibly adopted to adapt to different scenario requirements.
[0135] Based on the foregoing embodiments, this invention provides a heterogeneous system. The modules and units included in the heterogeneous system can be implemented by a processor; of course, they can also be implemented by specific logic circuits. In the implementation process, the processor can be a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP), or a field-programmable gate array (FPGA), etc.
[0136] The heterogeneous system provided by the present invention is described below. The heterogeneous system described below can be referred to in correspondence with the task processing method described above.
[0137] Figure 6 This is a schematic diagram of the structure of a heterogeneous system provided in an embodiment of the present invention. Figure 6 As shown, the heterogeneous system 600 includes a main processor 610 and a coprocessor 620, wherein:
[0138] The main processor 610 is used to send task requests to the coprocessor;
[0139] The coprocessor 620 is configured to receive task requests from the main processor; select from a processor list based on the type of the task request to obtain a communication list, the processor list including multiple second heterogeneous systems, the second heterogeneous systems being heterogeneous systems that have a network connection with the first heterogeneous system; send the cooperation request to a coprocessor within a target heterogeneous system, the target heterogeneous system being one of the multiple heterogeneous systems in the communication list; receive return data from the coprocessor within the target heterogeneous system, and send the return data to the main processor.
[0140] Figure 7 This is a schematic diagram of the physical structure of the electronic device provided by the present invention, such as... Figure 7 As shown, the electronic device may include a processor 710, a communications interface 720, a memory 730, and a communication bus 740, wherein the processor 710, the communications interface 720, and the memory 730 communicate with each other through the communication bus 740. The processor 710 can call logical instructions stored in the memory 730 to execute the aforementioned task processing method.
[0141] Furthermore, the logical instructions in the aforementioned memory 730 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0142] On the other hand, the present invention also provides a computer program product, the computer program product including a computer program, the computer program being stored on a non-transitory computer-readable storage medium, and when the computer program is executed by a processor, the computer is able to perform the task processing methods provided by the above methods.
[0143] 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 described in the embodiments of the present invention are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a server or data center that integrates one or more available media. The available medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., a solid-state disk (SSD)).
[0144] In another aspect, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to perform the task processing methods provided by the methods described above.
[0145] The aforementioned computer-readable storage medium may be any combination of one or more computer-readable media. A computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium may be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM) or flash memory, optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this document, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in connection with an instruction execution system, apparatus, or device.
[0146] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including—but not limited to—electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, capable of transmitting, propagating, or transmitting programs for use by or in connection with an instruction execution system, apparatus, or device.
[0147] Program code contained on a computer-readable medium may be transmitted using any suitable medium, including—but not limited to—wireless, wire, optical fiber, radio frequency (RF), etc., or any suitable combination thereof.
[0148] Computer program code for performing the operations described herein can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as "C" or similar languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0149] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0150] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0151] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A task processing method characterized by, The method is applied to a coprocessor of a first heterogeneous system, the first heterogeneous system further comprising a host processor, the host processor and the coprocessor being in communication connection, the method comprising: receiving a task request of the host processor; selecting in a processor list according to a type of the task request to obtain a communication list, the processor list comprising a plurality of second heterogeneous systems, the second heterogeneous systems being heterogeneous systems in network connection with the first heterogeneous system; sending the task request to a coprocessor in a target heterogeneous system, the target heterogeneous system being a plurality of heterogeneous systems in the communication list; receiving return data of the coprocessor in the target heterogeneous system and sending the return data to the host processor; obtaining a plurality of communication addresses from link data in the first heterogeneous system; sending a device information obtaining request to each of the communication addresses; establishing the processor list according to device information returned by each of the communication addresses; the selecting in the processor list according to the type of the task request to obtain the communication list comprising: obtaining a corresponding strategy model according to the type of the task request, the type comprising a processor resource type, a memory resource type and a flash memory resource type, the strategy model being used for evaluating heterogeneous systems according to device information; selecting heterogeneous systems based on device information of each of the heterogeneous systems in the processor list and the strategy model to obtain the communication list.
2. The method of claim 1, wherein, the selecting heterogeneous systems based on device information of each of the heterogeneous systems in the processor list and the strategy model to obtain the communication list comprising: calculating a weight index of device information using the strategy model; calculating a weight of each of the heterogeneous systems in the processor list according to device information of each of the heterogeneous systems in the processor list and the weight index; selecting a plurality of heterogeneous systems from the processor list according to the weight to obtain the communication list.
3. The method of claim 1, wherein, The method further comprises: calculating a survival time of each of the communication addresses; storing the survival time of each of the communication addresses in the processor list.
4. A heterogeneous system, characterized by The heterogeneous system is a first heterogeneous system, the first heterogeneous system comprising a host processor and a coprocessor, the host processor and the coprocessor being in communication connection; the host processor, configured to issue a task request to the coprocessor; the coprocessor, configured to receive the task request of the host processor; selecting in a processor list according to a type of the task request to obtain a communication list, the processor list comprising a plurality of second heterogeneous systems, the second heterogeneous systems being heterogeneous systems in network connection with the first heterogeneous system; sending a task request to a coprocessor in a target heterogeneous system, the target heterogeneous system being a plurality of heterogeneous systems in the communication list; receiving return data of the coprocessor in the target heterogeneous system and sending the return data to the host processor, obtaining a plurality of communication addresses from link data in the first heterogeneous system; sending a device information obtaining request to each of the communication addresses; establishing the processor list according to device information returned by each of the communication addresses; The selecting from the processor list according to the type of the task request to obtain a communication list comprises: obtaining a corresponding strategy model according to the type of the task request, the type comprising: a processor resource type, a memory resource type, and a flash memory resource type, the strategy model being used for evaluating a heterogeneous system according to device information; and selecting a heterogeneous system based on the device information of each heterogeneous system in the processor list and the strategy model to obtain the communication list.
5. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the computer program to implement the task processing method according to any one of claims 1 to 3. 6.A non-transitory computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the task processing method according to any one of claims 1 to 3.
7. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the task processing method according to any one of claims 1 to 3. The computer program is executed by the processor to implement the task processing method according to any one of claims 1 to 3.
Citation Information
Patent Citations
Multiprocessor co-processing method in computation equipment
CN102999385A
Heterogeneous multi-core processor based on ARM, DSP and FPGA and task scheduling method
CN104021042A