Task processing method and device, electronic equipment and storage medium
By sending BMC tasks to coprocessors of other heterogeneous systems, the interconnection of multiple heterogeneous systems solves the problem of shortage of main processor resources when BMC processes time-consuming and resource-consuming tasks, and improves system stability and reliability.
Patent Information
- Application Number
- CN202411342135.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-25
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2044-09-25
AI Technical Summary
When BMC processes time-consuming and resource-consuming tasks, the main processor resources are scarce, resulting in untimely responses or response errors.
By sending the tasks of the main processor to the coprocessors of other heterogeneous systems for processing, the interconnection of multiple heterogeneous systems can alleviate the problem of shortage of main processor resources.
Improve system stability, avoid untimely response or response errors when the main processor resources are scarce, and enhance system reliability.
Smart Images

Figure CN119512734A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a task processing method, device, electronic equipment and storage medium. Background Art
[0002] The BMC (Baseboard Management Controller) is used to perform operations such as firmware upgrades, device information viewing, and sensor information acquisition on the server when the server is not powered on. The BMC plays a very important role in monitoring and remote management of server components. From the moment the server is powered on, all server components are managed by the BMC, so ensuring the reliability of the BMC is critical.
[0003] When the BMC is upgraded or processing time-consuming and resource-consuming tasks, it will occupy more resources. At this time, it is very important to ensure that other services can respond normally. In the prior art, the system resources occupied by the BMC when processing time-consuming and resource-consuming tasks are usually optimized, for example, increasing the device read and write speed, using DMA, increasing hardware resources, etc., to improve the system response speed and enhance system reliability. However, when the current system hardware is limited or the business function is not supported, the above technical means are powerless, resulting in problems such as no response or abnormal response when the user accesses the system when the BMC processes time-consuming tasks or other resource-consuming tasks. Summary of the invention
[0004] The present invention provides a task processing method, device, electronic device and storage medium, which alleviate the situation of untimely or erroneous response when the main processor resources are scarce.
[0005] The present invention provides a task processing method, which is applied to a coprocessor of a first heterogeneous system, wherein the first heterogeneous system also includes a main processor, and the main processor and the coprocessor are in communication connection. The method comprises: receiving a task request from the main processor; selecting in a processor list according to the type of the task request to obtain a communication list, wherein the processor list includes multiple second heterogeneous systems, wherein the second heterogeneous systems are heterogeneous systems that are network-connected to the first heterogeneous system; sending the task request to a coprocessor in a target heterogeneous system, wherein the target heterogeneous system is a plurality of 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 also includes: obtaining multiple communication addresses from the link data within 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, selecting in the processor list according to the type of the task request to obtain a communication list includes: Acquire a corresponding policy model according to the type of the task request, the type including: processor resource type, memory resource type, flash memory resource type, the policy model is used to evaluate the heterogeneous system according to the device information; Heterogeneous system selection is performed based on the device information of each heterogeneous system in the processor list and the policy model to obtain the communication list.
[0008] According to a task processing method provided by the present invention, heterogeneous systems are selected based on the device information of each heterogeneous system in the processor list and the strategy model to obtain a communication list, including: using the strategy model to calculate the weight index of the device information; 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 based on the weights to obtain the communication list.
[0009] According to a task processing method provided by the present invention, the method further includes: calculating the survival time of each of the communication addresses; and storing the survival time of each of the communication addresses in the processor list.
[0010] The present invention also provides a task processing method, which is applied to a coprocessor of a first heterogeneous system, wherein the first heterogeneous system also includes a main processor, and a communication connection exists between the main processor and the coprocessor, and the method includes: receiving a collaboration request, wherein the collaboration request is sent by the coprocessor of a second heterogeneous system based on a task issued by the main processor in the second heterogeneous system; filtering and preliminarily verifying the collaboration request to generate a data packet; processing the data in the data packet to generate processed data; encapsulating the processed data based on the data type of the processed data to generate a return message; and sending the return message to the coprocessor of the second heterogeneous system.
[0011] The present invention also provides a heterogeneous system, which is a first heterogeneous system, and the first heterogeneous system includes a main processor and a coprocessor, and the main processor and the coprocessor are in communication connection; the main processor is used to issue a task request to the coprocessor; the coprocessor is used to receive the task request of the main processor; according to the type of the task request, a processor list is selected to obtain a communication list, and the processor list includes multiple second heterogeneous systems, and the second heterogeneous systems are heterogeneous systems that have a network connection with the first heterogeneous system; the collaboration request is sent to the coprocessor in the target heterogeneous system, and the target heterogeneous system is a plurality of heterogeneous systems in the communication list; the return data of the coprocessor in the target heterogeneous system is received, and the return data is sent to the main processor.
[0012] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements any of the above-mentioned task processing methods when executing the computer program.
[0013] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the task processing method described in any one of the above is implemented.
[0014] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements any of the above-mentioned task processing methods.
[0015] The task processing method, device, electronic device and storage medium provided by the present invention send 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, the situation of untimely or erroneous response when the main processor resources are scarce is alleviated, thereby improving system stability. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are 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.
[0017] Figure 1 It is a flowchart of a task processing method provided by the present invention.
[0018] Figure 2 It is a flow chart of a customized strategy algorithm provided by the present invention.
[0019] Figure 3 It is a flowchart diagram of a task processing method provided by the present invention.
[0020] Figure 4 It is a schematic diagram of the overall flow of a task processing method provided by the present invention.
[0021] Figure 5 The present invention provides a method for generating a device list.
[0022] Figure 6 It is a structural schematic diagram of a heterogeneous system provided by the present invention.
[0023] Figure 7 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0024] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are 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.
[0025] In the prior art, when the BMC processes time-consuming and resource-consuming tasks, it optimizes the system resources occupied by the system, such as increasing the device read and write speed, using DMA (Direct Memory Access), increasing hardware resources, etc., to improve the system response speed and enhance the system reliability.
[0026] However, the existing methods have high requirements on product hardware, requiring the device to support DMA, increase memory, flash, increase CPU frequency, etc., resulting in increased product hardware costs. In scenarios with different business functions and different resource requirements, since the hardware has been determined, it is impossible to further optimize based on the existing hardware conditions. In addition, there are many ways to implement the optimization, and the compatibility is poor.
[0027] Additionally, when resources are tight, adding solutions and processing tasks to the main system may cause system resources to be further strained.
[0028] In view of this, an embodiment of the present invention provides a task processing method, which 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, the situation of untimely or erroneous response when the main processor resources are scarce is alleviated, thereby improving system stability.
[0029] The technical solutions in the embodiments of the present invention will be described below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0030] Figure 1 This is one of the flow charts of the task processing method provided by the present invention. The task processing method can be applied to electronic devices including heterogeneous systems. The electronic devices can be various types of devices with information processing capabilities during implementation. For example, the electronic devices can include personal computers, laptops, PDAs or servers, etc.; the electronic devices can also be mobile terminals, such as mobile phones, car computers, tablet computers or projectors, etc.
[0031] 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, that is, they may come from different manufacturers or use different operating systems, programming languages or protocols, etc.
[0032] The heterogeneous system in the present invention refers to an electronic system including 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).
[0033] In the present invention, these two processors are respectively referred to as the main processor and the coprocessor, and there is a communication connection between the main processor and the coprocessor. The main processor is used to input data of the main processor for calculation, which is usually to realize the functions of the electronic system, and the coprocessor is used to assist the main processor to complete the processing work that it cannot perform, or to improve the execution efficiency and the effect. For example, the heterogeneous system is a BMC, the main processor is the central processing unit (CPU) of the BMC, and the coprocessor is other processors on the central processor of the BMC, such as digital signal processors (DSPs), application processors (APU), etc.
[0034] There is a communication connection between the heterogeneous system of the execution method of the present invention and other heterogeneous systems. Assuming that the method of the present invention is applicable to the first heterogeneous system, there are heterogeneous system A and heterogeneous system B in the implementation environment in addition to the first heterogeneous system, and there is a communication connection between every two heterogeneous systems. For example, multiple BMCs are set up on the server: the first BMC, the second BMC, and the third BMC. There is a communication connection between every two BMCs, and 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.
[0035] like Figure 1As shown, the method can be applied to the coprocessor of the first heterogeneous system, and the method can include the following steps 110 to 140: Step 110: Receive a task request from the main processor.
[0036] The coprocessor of the first heterogeneous system receives a task request sent by the main processor of the system. The task request is generated by the main processor of the first heterogeneous system by packaging the tasks that the processor needs to execute.
[0037] For example, when the main processor of the BMC is executing a time-consuming or resource-consuming task, it will also receive other tasks, such as checking the sensor information of the server. At this time, in order to ensure the response speed of these other tasks, the main processor can package the relevant information of other tasks and send it to the coprocessor of the BMC.
[0038] Step 120: Select from a processor list according to the type of the task request to obtain a communication list, wherein the processor list includes a plurality of second heterogeneous systems, where the second heterogeneous systems are heterogeneous systems that have a network connection with the first heterogeneous system.
[0039] The coprocessor of the first heterogeneous system obtains a pre-stored processor list, which includes relevant information of 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 the above-mentioned heterogeneous system A and heterogeneous system B.
[0040] The coprocessor of the first heterogeneous system selects a heterogeneous system from the processor list according to the type of the task request, selects a plurality of heterogeneous systems, stores relevant information of the selected heterogeneous systems, and generates a communication list.
[0041] In one embodiment of the present invention, a selection is made in the processor list according to the type of the task request to obtain a communication list, including: obtaining a corresponding policy model according to the type of the task request, the types including: processor resource type, memory resource type, flash memory resource type, the policy model is used to evaluate heterogeneous systems based on device information; heterogeneous systems are selected based on the device information of each heterogeneous system in the processor list and the policy model to obtain the communication list.
[0042] In this embodiment, task requests are divided into different types according to the demand scenarios of task processing. For example, the present invention pre-sets the task processing scenarios as: requiring CPU resources, requiring memory resources, requiring flash resources, etc., and then the pre-set task request types are: processor resource type, memory resource type, flash resource type. Moreover, for each type, a policy model is correspondingly set, and the policy model can be obtained through training. The policy model is used to evaluate the heterogeneous system based on the heterogeneous system information.
[0043] The coprocessor of the first heterogeneous system determines the type of the task request according to the data of the task request, and obtains the policy model corresponding to the type according to the determined type.
[0044] Then, the policy model is used to evaluate each heterogeneous system according to the device information of the heterogeneous system recorded in the processor list to obtain an evaluation result. According to the evaluation result, a heterogeneous system is selected from the processor list to obtain a communication list.
[0045] For example, the present invention refers to the relevant information of a heterogeneous system stored in the processor list as the resource of the heterogeneous system. When the heterogeneous system is a BMC, the resource includes BMC-related resource definitions, such as CPU occupancy, memory occupancy, flash space, TTL path length, etc., which are defined according to different requirements. Among them, TTL (Time to Live) in the network refers to the time or number of hops that a data packet can exist during the transmission process.
[0046] The policy model combines resource information such as TTL and other heterogeneous system related resource conditions to sort the heterogeneous systems in the processor list. According to the order output by the policy model, multiple heterogeneous systems are selected, and the relevant information of the selected heterogeneous systems such as communication addresses is saved to generate a communication list.
[0047] In the above embodiment, different strategy models are set according to different types of task processing, so that the satisfaction of the heterogeneous systems required in different task demand scenarios is calculated through the strategy model, and multiple heterogeneous systems suitable for execution under each task are obtained.
[0048] In one embodiment of the present invention, heterogeneous system selection is performed based on the device information of each heterogeneous system in the processor list and the policy model to obtain a communication list, including: using the policy model to calculate the weight index of the device information; 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 based on the weights to obtain the communication list.
[0049] For example, a policy implementation module is provided 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 serve_device[SCENE] list.
[0050] The implementation of the policy in the policy implementation module is defined as an input-output system, whose input is the processor list and SCENE. Among them, SCENE is an enumeration value, which refers to the type of task request, including: CPU_RESOURCE (processor resource type), MEMORY_RESOURCE (memory resource type), FLASH_RESOURCE (flash resource type), TTL_RESOURCE (lifetime resource type) or other resource demand scenarios, and the output is the serve_device list of the corresponding SCENE. When updating, the policy algorithm configured in the system is used, or the policy algorithm can be customized.
[0051] The strategy implementation module obtains the configured strategy algorithm according to the type of input task request. The strategy algorithm is mainly used to generate the weights of different device information under the specified SCENE. The strategy algorithms include: entropy method, factor analysis method, hierarchical analysis method, principal component analysis method, etc., and customized strategy algorithms can also be implemented according to project requirements.
[0052] The policy implementation module obtains the algorithm parameters configured by the corresponding user according to the policy algorithm, and calculates the weight index of each heterogeneous system in the processor list according to different policy weight calculation methods.
[0053] After the weight index calculation is completed, the device information and weights of all heterogeneous systems in the processor list are calculated 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 a communication list, or the serve_device list is directly used as the final output communication list.
[0054] In one embodiment of the present invention, using Figure 2 The process implements customized strategy algorithms, such as Figure 2 As shown, Figure 2 It is a flow chart of a customized strategy algorithm shown in the present invention. Figure 2In the process of pre-collecting raw data, the raw data includes variables and sample data. Data pre-processing is performed on the collected raw data, such as processing missing values and outliers. For the processed raw data, a suitable basic model is selected according to the data characteristics of the data, and the basic model is trained using the data. For the trained model, the test data is input into the model to calculate the weight of the test data, and then the weighted value of the test data is calculated using the weight. The algorithm is evaluated based on the weighted value. The trained model is optimized based on the evaluation results, and the optimized model is used as the strategy algorithm.
[0055] Step 130: Send the task request to a coprocessor in a target heterogeneous system, where the target heterogeneous system is a plurality of heterogeneous systems in the communication list.
[0056] The coprocessor of the first heterogeneous system selects a plurality of heterogeneous systems from the communication list as target heterogeneous systems.
[0057] The coprocessor of the first heterogeneous system sends the task request to the coprocessor in the target heterogeneous system. For example, the coprocessor of the first heterogeneous system divides the task request into multiple subtasks and sends the subtasks to different target heterogeneous systems, so that the different target heterogeneous systems cooperate with each other to process the tasks.
[0058] Step 140: Receive return data from the coprocessor in the target heterogeneous system, and send the return data to the main processor.
[0059] After receiving the collaboration request, the coprocessor in the target heterogeneous system processes the task data carried in the collaboration request to generate return data, and sends the return data to the coprocessor in the first heterogeneous system.
[0060] After receiving the return data from all target heterogeneous systems, the coprocessor of the first heterogeneous system sends the data to the main processor to process the task.
[0061] The above-mentioned 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, the situation of untimely or erroneous response when the main processor resources are scarce is alleviated, thereby improving system stability.
[0062] In one embodiment of the present invention, the method further includes: acquiring multiple communication addresses from link data within 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.
[0063] For example, the coprocessor of the first heterogeneous system is also provided with a device list update module. The device list update module is used to periodically discover surrounding BMC devices that can communicate with it. The device list update module can also be triggered by demand, which is suitable for the case where the update time has not yet arrived but the service list is unavailable or other extreme scenarios. The specific process is as follows: The coprocessor periodically finds the communication addresses of other devices connected to the current heterogeneous system, such as IP (Internet Protocol Address), and communicates with other devices to obtain relevant device information. After discovering other devices connected to this heterogeneous system, all devices are saved in the device IP field of the processor list. If the communication with other devices fails more than the specified number of times, the heterogeneous system is removed from the processor list. When the number of devices in the processor list is less than a certain number, the list update process is re-initiated to update the processor list. Among them, the processor list is a device list, and its definition is as follows.
[0064] struct bmc_info bmc_list[DEVICE_NUM_MAX]; The specific device bmc_info in the processor list is defined as follows: struct bmc_info{
[0065] string ip; struct resource_info resource; }; Struct resource_info mainly contains BMC-related resource definitions, such as CPU usage, memory usage, and flash space.
[0066] Circulate the processor list and communicate with each IP in the list using the specified message communication format (defined in the coprocessor task processing module) to obtain and fill in the required device information in struct resource_info, and at the same time determine which devices do not support this function and remove them from the list.
[0067] In one embodiment of the present invention, the survival time of each of the communication addresses is calculated; and the survival time of each of the communication addresses is stored in the processor list.
[0068] Get the TTL value of each IP in the list, and assign the TTL in the resource field according to the calculated value.
[0069] In the above embodiment, the survival time of other heterogeneous systems is calculated to facilitate subsequent screening of heterogeneous systems by survival time, thereby selecting the heterogeneous system with the shortest communication path.
[0070] In addition to sending tasks of the main processor in the first heterogeneous system to the coprocessors of other heterogeneous systems, the coprocessor of the first heterogeneous system can also receive cooperation requests from the coprocessors of other heterogeneous systems, thereby helping the main processors in other heterogeneous systems to complete tasks.
[0071] Figure 3 The present invention also provides a flowchart of a task processing method, such as Figure 3 As shown, the method can be applied to the coprocessor of the first heterogeneous system, the first heterogeneous system also includes a main processor, the main processor and the coprocessor are in communication connection, and the method can include the following steps 310 to 350: Step 310: receiving a collaboration request, where the collaboration request is sent by a coprocessor of the second heterogeneous system according to a task issued by a main processor in the second heterogeneous system.
[0072] The coprocessor of the first heterogeneous system receives the cooperation request. The cooperation request is generated by the coprocessor of the second heterogeneous system. After receiving the task request sent by the main processor of the second heterogeneous system, the coprocessor packages the generated cooperation request according to the task request.
[0073] Step 320: Filter and preliminarily verify the collaboration request to generate a data packet.
[0074] The coprocessor of the first heterogeneous system filters and preliminarily checks the cooperation request, generates a data packet, and then puts the data packet into a data queue.
[0075] Step 330, processing the data in the data packet to generate processed data.
[0076] The coprocessor of the first heterogeneous system obtains the data packet from the data queue, unpacks it for processing, and then assembles the data and sends it to different data queues.
[0077] Step 340: encapsulate the processed data according to the data type of the processed data and generate a return message.
[0078] Step 350: Send the return message to the coprocessor of the second heterogeneous system.
[0079] The coprocessor of the first heterogeneous system takes out the data to be sent from the data queue of the sent data, assembles the data according to different message types, and sends the data to the main CPU or other BMC devices.
[0080] The following describes an exemplary application of an embodiment of the present invention in a practical application scenario. Figure 4 A schematic diagram of the overall flow of a task processing method provided by an embodiment of the present invention.
[0081] like Figure 4 As shown, the coprocessor receives the request from the main processor and puts the request into the main CPU message request queue of the coprocessor, waiting for processing. The coprocessor sequentially obtains message data from the request queue for processing, and the coprocessor also determines whether the obtained message data is a valid request. If it is an invalid request, the message is obtained from the request queue again.
[0082] If it is a valid request, the request message is further assembled according to the type of the request message. The assembled message is sent to the high-priority device in the device list. While the coprocessor waits for the high-priority device to reply, it will loop to get the message from the request queue and send it. For the message replied by the high-priority device, the coprocessor processes it and returns it to the main processor.
[0083] For example, the heterogeneous system is a BMC, and a task processing module is set on the coprocessor. The task processing module is mainly responsible for receiving messages from the main processor, and then assembling different message requests according to the message type of the main processor, finding the device with the highest priority according to the service device list obtained by the service discovery module and the timing update module, and sending the assembled message request to the device; then wait for the device's reply, and cyclically process the message data in the message queue.
[0084] The assembled message header format is defined as follows: struct message_header {
[0085] uint32_t source_ip; / / Message source BMC IP address
[0086] uint32_t destination_ip; / / BMC IP address of the message destination
[0087] uint8_t process_flag[4]; / / Fixed 4 bytes, identifies this process
[0088] uint8_t message_type; / / Message type
[0089] uint8_t reserve[3]; / / reserved
[0090] uint32_t data_length; / / data length
[0091] }; A message consists of two parts: a message header and data. The format of the data part may vary depending on the message type in the message header and can be defined according to specific needs.
[0092] In the task processing module, it can be divided into three specific subtasks: a. Receive data task, which needs to receive network data packets, perform relevant filtering and preliminary verification, and then put the data packets into different receive data queues. The data queues can include: main CPU data queue and other device data queues.
[0093] b. Data processing subtasks: This task is divided into two types: one is to process the data in the main CPU data queue; the other is to process the data in other device data queues. The main processes and functions of these two tasks are similar. They receive data, unpack it, and distribute it to the processing interfaces of different messages inside the module for processing. After the processing of the message processing interface inside the module is completed, the data is assembled and sent to different data queues.
[0094] c. Data sending task: This task is mainly responsible for taking out the data to be sent 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 sent is divided into two, one is the data queue sent to the main CPU, and the other is the data queue sent to other BMCs.
[0095] The device list can be generated by Figure 5 The method shown, Figure 5 A method for generating a device list is shown in the present invention. Figure 2 The coprocessor of the BMC obtains the devices connected to the BMC in the current network, and saves the IP addresses of other devices connected to the BMC to the bmc_list. The coprocessor then loops through the access process to access the IP in the bmc_list, and calculates the TTL from the BMC to the IP. The TTL is filled into the TTL field in the resource of the device in the bmc_list, and a request message is sent to the device.
[0096] After receiving the request message, other BMC devices package the device information of the device into resource information and return it to the coprocessor.
[0097] The coprocessor fills the received resource information into the resource field in bmc_list. If a device does not respond to the request message, it is considered that the device does not support collaboration and is deleted from bmc_list.
[0098] After obtaining the device data of all IPs in bmc_list, use the policy implementation module to calculate the weighted coefficients of other BMCs to complete the BMC task based on the resources in different scenarios, and save the weighted coefficients in the list.
[0099] 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 that the coprocessor of this BMC periodically discovers the surrounding BMC devices that can communicate with it, and obtains the most suitable service BMC according to the different demand scenarios of this BMC. The device list update module can also be triggered by demand, which is suitable for the situation that the update time has not yet arrived, but the service list is unavailable or other extreme scenarios. The specific process is as follows: The coprocessor periodically finds out the IP addresses of other devices connected to the current BMC, communicates with other BMCs, obtains relevant resource information, and saves all devices in the device IP field of bmc_list after discovering other devices connected to this BMC. If the communication with other BMCs fails for more than the specified number of times, the BMC is removed from the bmc_list. When the number of devices in bmc_list is less than a certain number, the device list update process is re-initiated to update bmc_list. bmc_list is a device list, and its definition is as follows.
[0100] struct bmc_info bmc_list[DEVICE_NUM_MAX]; The specific device bmc_info in the device list is defined as follows: struct bmc_info{
[0101] string ip; struct resource_info resource; }; Struct resource_info mainly contains BMC-related resource definitions, such as CPU usage, memory usage, flash space, TTL path length, etc., which are defined according to different requirements.
[0102] Loop through the bmc_list list, get the TTL value of each IP in the list, and assign 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), gets the required information in struct resource_info and fills it in, and determines which devices do not support this function and removes them from the list.
[0103] After obtaining all the IPs and resources in bmc_list, combined with the TTL in the resource and the relevant resource information of the target BMC, bmc_list and the corresponding SCENE are passed to the policy implementation module to calculate the device satisfaction required by the current BMC in different demand scenarios (such as scenarios requiring CPU resources, memory resources, flash resources, etc.), and generate a serve_device service list for each scenario by sorting them from the most suitable to the least suitable.
[0104] The final serve_device may be as follows: serve_device[CPU_RESOURCE] = {bmc_list[2], bmc_list[1], bmc_list[3]…}; serve_device[MEMORY_RESOURCE] = {bmc_list[0], bmc_list[1], bmc_list[2]…}; serve_device[FLASH_RESOURCE] = {bmc_list[3], bmc_list[1], bmc_list[4]…}; After the process of the service discovery module is executed, the best service list of all other BMCs supporting the function of the present invention is saved on the BMC, and the list will be used by the coprocessor task processing module.
[0105] The policy implementation module is mainly used to implement the policy configuration and policy algorithm for updating the serve_device[resource] list.
[0106] The policy implementation in this module is defined as an input-output system, whose input is bmc_list and SCENE, where SCENE is an enumeration value, i.e., CPU_RESOURCE, MEMORY_RESOURCE, FLASH_RESOURCE, TTL_RESOURCE or other resource demand scenarios, and the output is the serve_device list of the corresponding SCENE. When updating, the policy algorithm configured in the system is used, or the policy algorithm can be customized by oneself, which is very flexible.
[0107] The main process of the strategy implementation module is to obtain the configured strategy algorithm. The strategy algorithm is mainly used to generate the weights of different resources under the specified SCENE. The supported strategies include entropy method, factor analysis method, hierarchical analysis method, principal component analysis method, etc., and can also be used according to the project requirements and the attached Figure 3The process implements a customized policy algorithm. The policy algorithm is configurable and customizable.
[0108] According to the policy algorithm, the algorithm parameters configured by the corresponding user are obtained, and the weight index of each BMC in the input list is calculated according to different policy weight calculation methods.
[0109] After the weight index calculation is completed, the weighted value is calculated for the resources and weights in all bmcs in bmc_list according to the set rules.
[0110] The calculated weighted values are sorted to obtain the serve_device list that is finally output.
[0111] The above embodiment provides a method and device for improving the BMC response speed in a heterogeneous dual system, and realizes the interconnection of multiple BMCs on the coprocessor of the heterogeneous dual system, further alleviating the pressure of the main processor. The interconnection of multiple BMCs solves the problem of untimely response or wrong response when BMC resources are scarce. A certain strategy is used to regularly update the service list, and different strategy configurations can be replaced to meet different resource-intensive scenarios.
[0112] The above embodiment can reduce the problems of slow system response or no response when the BMC processes time-consuming and resource-consuming tasks, thereby improving the reliability of the system. At the same time, the coprocessor system based on the heterogeneous dual system can further relieve the pressure on the main processor and ensure the stability and reliability of the system. Different weight calculation algorithms can be flexibly adopted to meet the needs of different scenarios.
[0113] Based on the foregoing embodiments, an embodiment of the present invention provides a heterogeneous system, and each module included in the heterogeneous system and each unit included in each module can be implemented by a processor; of course, it can also be implemented by a specific logic circuit; 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.
[0114] The heterogeneous system provided by the present invention is described below. The heterogeneous system described below and the task processing method described above can be referenced to each other.
[0115] Figure 6 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: The main processor 610 is used to send a task request to the coprocessor; The coprocessor 620 is used to receive the task request of the main processor; select in the processor list according to the type of the task request to obtain a communication list, wherein the processor list includes multiple second heterogeneous systems, and the second heterogeneous system is a heterogeneous system that has a network connection with the first heterogeneous system; send the collaboration request to the coprocessor in the target heterogeneous system, and the target heterogeneous system is a plurality of heterogeneous systems in the communication list; receive return data from the coprocessor in the target heterogeneous system, and send the return data to the main processor.
[0116] Figure 7 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 communication interface 720, a memory 730 and a communication bus 740, wherein the processor 710, the communication interface 720 and the memory 730 communicate with each other through the communication bus 740. The processor 710 may call the logic instructions in the memory 730 to execute the above-mentioned task processing method.
[0117] In addition, the logic instructions in the above-mentioned memory 730 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform 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, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0118] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the task processing methods provided by the above methods.
[0119] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. 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 computer-readable storage medium. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wired (e.g., coaxial cable, optical fiber, 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 includes one or more available media integrated therein. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive Solid State Disk (SSD)), etc.
[0120] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the computer program is executed by a processor to perform the task processing methods provided by the above methods.
[0121] The above-mentioned computer-readable storage medium can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, - but not limited to - an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM) or flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.
[0122] Computer-readable signal media may include a data signal propagated in baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0123] The program code embodied on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wire, optical cable, radio frequency (RF), etc., or any suitable combination of the foregoing.
[0124] Computer program code for performing the operations of the present specification may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0125] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0126] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0127] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A task processing method, characterized in that: The method is applied to a coprocessor of a first heterogeneous system, the first heterogeneous system further comprising a main processor, the main processor and the coprocessor being in 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, wherein the processor list includes a plurality of second heterogeneous systems, where the second heterogeneous systems are heterogeneous systems that have a network connection with the first heterogeneous system; Sending the task request to a coprocessor in a target heterogeneous system, where the target heterogeneous system is a plurality of heterogeneous systems in the communication list; Receive return data from a coprocessor in a target heterogeneous system, and send the return data to the main processor.
2. The method according to claim 1, characterized in that The method further comprises: Acquire multiple communication addresses from the link data within the first heterogeneous system; Sending a device information acquisition request to each of the communication addresses; The processor list is established according to the device information returned by each of the communication addresses.
3. The method according to claim 1, characterized in that Selecting from the processor list according to the type of the task request to obtain a communication list includes: Acquire a corresponding policy model according to the type of the task request, the type including: processor resource type, memory resource type, flash memory resource type, the policy model is used to evaluate the heterogeneous system according to the device information; Heterogeneous system selection is performed based on the device information of each heterogeneous system in the processor list and the policy model to obtain the communication list.
4. The method according to claim 3, characterized in that A heterogeneous system is selected based on the device information of each heterogeneous system in the processor list and the policy model to obtain a communication list, including: Calculate the weight index of the device information using the policy model; Calculating the weight of each heterogeneous system in the processor list according to the device information of each heterogeneous system in the processor list and the weight index; A plurality of heterogeneous systems are selected from the processor list according to weights to obtain the communication list.
5. The method according to claim 2, characterized in that: The method further comprises: Calculating the lifetime of each of the communication addresses; The lifetime of each of the communication addresses is stored in the processor list.
6. A task processing method, characterized in that: The method is applied to a coprocessor of a first heterogeneous system, the first heterogeneous system further comprising a main processor, the main processor and the coprocessor being in communication connection, the method comprising: receiving a collaboration request, where the collaboration request is sent by a coprocessor of the second heterogeneous system according to a task issued by a main processor in the second heterogeneous system; Filtering and preliminarily verifying the collaboration 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 of the processed data and generating a return message; The return message is sent to the coprocessor of the second heterogeneous system.
7. A heterogeneous system, characterized in that: The heterogeneous system is a first heterogeneous system, the first heterogeneous system includes a main processor and a coprocessor, and the main processor and the coprocessor are in communication connection; The main processor is used to send a task request to the coprocessor; The coprocessor is used to receive the task request of the main processor; Selecting in a processor list according to the type of the task request to obtain a communication list, wherein the processor list includes a plurality of second heterogeneous systems, where the second heterogeneous system is a heterogeneous system having a network connection with the first heterogeneous system; sending the collaboration request to a coprocessor in a target heterogeneous system, where the target heterogeneous system is a plurality of heterogeneous systems in the communication list; Receive return data from a coprocessor in a target heterogeneous system, and send the return data to the main processor.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the task processing method according to any one of claims 1 to 6 is implemented.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the task processing method according to any one of claims 1 to 6 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the task processing method according to any one of claims 1 to 6 is implemented.
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
Heterogeneous multi-core remote embedded memory system and method
CN105302489A
Compression method and system for Alpha channel data and related component
CN110062241A
Inter-core communication method and device of heterogeneous multi-core chip and medium
CN114564435A
Cited By
Request processing method, baseboard management controller, electronic equipment and storage medium
CN120256369A
Request processing method, baseboard management controller, electronic device and storage medium
CN120256369B