Battery management system task execution duration allocation method, system, medium and product
Patent Information
- Application Number
- CN202510435601.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-08
- Publication Date
- 2026-10-16
AI Technical Summary
但是,由于任务在实际执行过程中,BMS中经常会出现各种异常情况,这些异常情况会影响到任务的执行时长,因此,相关技术中无法准确的为电池管理系统的任务分配合理的执行时长,进而导致任务执行时间超过预期
[0026] The task duration prediction model can delve into the complex relationship between battery management system load information, task attribute information and the first execution duration of the task, thereby improving the accuracy and reliability of determining the first execution duration of the target task.
Smart Images

Figure CN122924976A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of system management, and in particular to a method, system, medium, and product for allocating task execution time in a battery management system. Background Technology
[0002] In practical applications, a Battery Management System (BMS) has various tasks that need to be executed by the processor. To better schedule and allocate resources for these tasks within the BMS, the system typically allocates execution time for each task before execution, ensuring completion within the allocated time. However, during actual task execution, various anomalies frequently occur within the BMS, affecting task execution time. Therefore, current technologies often fail to accurately allocate reasonable execution times for tasks within the battery management system, leading to task execution times exceeding expectations. Summary of the Invention
[0003] This application provides a method, system, medium, and product for allocating task execution time in a battery management system, which can reasonably allocate a second execution time for a target task and prevent the target task from exceeding the expected execution time.
[0004] In a first aspect, this application provides a method for allocating task execution time, comprising: obtaining task attribute information and battery management system load information corresponding to a target task; determining a first execution time of the target task based on the battery management system load information and the task attribute information; and allocating a second execution time to the target task based on the first execution time and the reserved time of the target task.
[0005] In the technical solution of this application embodiment, when determining the first execution duration of the target task, the task attribute information corresponding to the target task and the battery management system load information are considered simultaneously, improving the accuracy of the first execution duration. This first execution duration provides sufficient execution time for the target task without considering the influence of other external factors. In addition, the reserved duration of the target task sets a buffer time for various uncertainties that may occur during the actual operation of the target task, so that the target task can still be completed within the second execution duration even if an anomaly occurs. This reasonably allocates the second execution duration to the target task and effectively avoids the actual execution time of the target task exceeding expectations.
[0006] In some embodiments, before allocating a second execution time to the target task based on the first execution time and the reserved time for the target task, the above task execution time allocation method further includes:
[0007] The reserved time for the target task is determined based on the first execution time.
[0008] By determining the initial execution time for each task, different reserve times can be set for different tasks, which can better ensure that all tasks can be accurately allocated execution leeway and that all tasks can be completed within the expected time.
[0009] In some embodiments, determining the reserved time for the target task based on the first execution duration includes:
[0010] Determine the reservation ratio corresponding to the reservation duration based on the battery management system load information;
[0011] The reserved duration is determined based on the reserved ratio and the first execution duration.
[0012] By using the load information of the battery management system, the probability of anomalies during task execution can be reflected, thereby accurately determining the reservation ratio corresponding to the reserved time. This allows for a reasonable determination of the reserved time, avoiding resource waste caused by excessively long reserved time and preventing the task from being completed within the expected timeframe due to excessively short reserved time.
[0013] In some embodiments, determining the reservation ratio corresponding to the reservation duration based on the battery management system load information includes:
[0014] If the target task has dependent related tasks, obtain the second execution duration of the related tasks;
[0015] Based on the second execution duration of the associated task and the load information of the battery management system, the reservation ratio corresponding to the reserved duration is determined.
[0016] By further considering the uncertainties that related tasks on which the target task depends may affect the execution of the target task, the accuracy of determining the reservation ratio corresponding to the reserved time is further improved, thus avoiding the situation where the task cannot be completed within the expected time.
[0017] In some embodiments, determining the reservation ratio corresponding to the reservation duration based on the second execution duration of the associated task and the battery management system load information includes:
[0018] Based on the battery management system load information, determine the first number of abnormal situations that occur during the execution of the target task;
[0019] The second number of abnormal situations that occur during the execution of the associated task is determined based on the second execution duration of the associated task.
[0020] The reservation ratio corresponding to the reservation duration is determined based on the first quantity and the second quantity.
[0021] By jointly determining the reservation ratio corresponding to the reserved time by the first number of abnormal situations that occur during the execution of the target task and the second number of abnormal situations that occur during the execution of related tasks, sufficient execution margin can be provided for multiple abnormal situations that may occur during the execution of the target task.
[0022] In some embodiments, determining a second number of abnormal situations occurring during the execution of an associated task based on a second execution duration of the associated task includes:
[0023] Determine the target ratio between the second execution duration of the associated task and the second execution duration of the target task; based on the target ratio and the first quantity, determine the second quantity. This allows for full utilization of the information contained in the first quantity to determine the second quantity, providing a more accurate and reliable basis for determining the second quantity in case of abnormal situations during the execution of the associated task.
[0024] In some embodiments, the first execution duration of the target task is determined based on battery management system load information and task attribute information, including:
[0025] The battery management system load information and task attribute information are input into the trained task duration prediction model to obtain the first execution duration of the target task.
[0026] The task duration prediction model can delve into the complex relationship between battery management system load information, task attribute information and the first execution duration of the task, thereby improving the accuracy and reliability of determining the first execution duration of the target task.
[0027] In some embodiments, the process of training a task duration prediction model includes:
[0028] Obtain the historical actual execution time of the sample task;
[0029] Determine the abnormal time occupied due to anomalies from the historical actual execution time;
[0030] The third execution duration of the sample task is determined based on the abnormal duration and the historical actual execution duration;
[0031] Based on the sample tasks and their corresponding third execution duration, the model is trained to obtain the task duration prediction model.
[0032] When training the task duration prediction model, by excluding the abnormal time occupied due to abnormalities in the historical actual execution time of sample tasks, it can be further ensured that the first execution time of the task output by the task duration prediction model does not include the impact of abnormal situations, so as to avoid conflict with the reserved time and thus avoid allocating an excessively long second execution time to the target task, resulting in a waste of task resources.
[0033] In some embodiments, a model is trained based on a sample task and its corresponding third execution duration to obtain a task duration prediction model, including:
[0034] Input the task attribute information and battery management system load information of the sample task into the baseline model corresponding to the task duration prediction model to obtain the first predicted execution duration;
[0035] The loss function value is determined based on the first prediction execution time and the third execution time;
[0036] The model parameters of the baseline model are adjusted based on the loss function value, and the baseline model is determined as the task duration prediction model when the baseline model converges.
[0037] By calculating the loss function value using the third execution time (which excludes abnormal durations in sample tasks) and the first predicted execution time output by the baseline model, and adjusting the model parameters using this loss function value, the accuracy of the adjusted base station model output can be improved, thereby increasing the accuracy of the final task duration prediction model output.
[0038] In some embodiments, the actual historical execution time is determined based on the number of times the timer overflows and the timer's recording duration;
[0039] The timer starts timing when the sample task begins execution and stops timing when the sample task is completed. The timer includes an overflow statistics unit, which records the number of times the timer overflows.
[0040] By setting an overflow statistics unit in the timer to record the number of times the timer overflows, detection errors caused by timer overflows are avoided when obtaining the historical actual execution time of sample tasks through the timer, thereby ensuring the quality of the data corresponding to the sample tasks.
[0041] In some embodiments, the timer masks interrupts in the target system where the sample task resides while recording the historical actual execution time of the sample task. This further reduces the impact of abnormal situations on the historical actual execution time of the sample task, ensuring that the influence of abnormal situations on the prediction time is minimized when training the task duration prediction model.
[0042] In some embodiments, after allocating a second execution duration to the target task, the task execution duration allocation method further includes:
[0043] In response to a change in the battery management system load information exceeding a preset threshold, the changed battery management system load information is obtained.
[0044] The second execution duration is reallocated to the target task based on the changed battery management system load information.
[0045] By setting a preset threshold, it is possible to detect whether there has been a significant change in the load information of the battery management system. When the load information of the battery management system changes significantly, the execution time of the target task can be reallocated in a timely manner based on the changed load information of the battery management system. This enables dynamic adjustment of the allocated execution time of the target task, thereby ensuring that the target task can be executed reasonably and efficiently within its allocated time to the greatest extent.
[0046] Secondly, this application provides a battery management system, including:
[0047] The information acquisition unit acquires the task attribute information and battery management system load information corresponding to the target task.
[0048] The controller is configured to determine a first execution duration for the target task based on the load information of the battery management system and the task attribute information, and to allocate a second execution duration for the target task based on the first execution duration and the reserved duration of the target task.
[0049] Thirdly, this application provides an electrical device that includes a battery management system as shown in the second aspect.
[0050] Fourthly, this application provides a computer-readable storage medium storing computer program instructions, which, when executed by a processor, implement the task execution time allocation method as shown in any embodiment of the first aspect.
[0051] Fifthly, embodiments of this application provide a computer program product in which instructions, when executed by a processor of an electrical device, cause the electrical device to perform the task execution time allocation method shown in any embodiment of the first aspect. Attached Figure Description
[0052] The features, advantages, and technical effects of exemplary embodiments of this application will now be described with reference to the accompanying drawings.
[0053] Figure 1 This is one of the flowcharts illustrating a battery management system task execution time allocation method according to some embodiments of this application;
[0054] Figure 2 This is a schematic diagram of a process for determining the first execution duration of a target task using a task duration prediction model, according to some embodiments of this application.
[0055] Figure 3 This is a flowchart illustrating the training process of a task duration prediction model according to some embodiments of this application;
[0056] Figure 4 This is a second flowchart illustrating a battery management system task execution time allocation method according to some embodiments of this application;
[0057] Figure 5 This is a schematic diagram of a process for determining the reservation duration according to some embodiments of this application;
[0058] Figure 6 This is one of the flowcharts illustrating the process of determining the reservation ratio in some embodiments of this application;
[0059] Figure 7 This is a second schematic diagram of a process for determining the reservation ratio according to some embodiments of this application;
[0060] Figure 8 This is a schematic diagram of a process for determining a second number of associated tasks according to some embodiments of this application;
[0061] Figure 9 This is a third flowchart illustrating a battery management system task execution time allocation method according to some embodiments of this application;
[0062] Figure 10 This is a schematic diagram of the structure of a battery management system according to some embodiments of this application;
[0063] Figure 11 This is a schematic diagram of the structure of an electrical device according to some embodiments of this application.
[0064] The accompanying drawings are not necessarily drawn to scale. Detailed Implementation
[0065] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the embodiments of the technical solutions of this application will be described in detail below with reference to the accompanying drawings. The following embodiments are only used to illustrate the technical solutions of this application more clearly, and are therefore only examples, and should not be used to limit the scope of protection of this application.
[0066] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the application; the terms “comprising” and “having”, and any variations thereof, in the specification, claims, and foregoing description of the drawings are intended to cover non-exclusive inclusion.
[0067] In the description of the embodiments of this application, technical terms such as "first" and "second" are used only to distinguish different objects and should not be construed as indicating or implying relative importance or implicitly specifying the number, specific order, or primary and secondary relationship of the indicated technical features. In the description of the embodiments of this application, "multiple" means two or more, unless otherwise explicitly defined.
[0068] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0069] In the description of the embodiments in this application, the term "and / or" is merely a description of the association relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this document generally indicates that the preceding and following related objects have an "or" relationship. The term "multiple" refers to two or more (including two).
[0070] The Battery Management System (BMS) of this application is used to perform at least one of the following functions for individual battery cells: state monitoring, state analysis, charge / discharge control, safety protection, information management, thermal management, and high-voltage power distribution. In addition, the BMS of this application can also implement the functions of a controller in an electrical device, such as a vehicle control unit (VCU) or a motor control unit (MCU), etc., and this application does not impose any limitations on this. It should be noted that the BMS of this application can be integrated as a controller into a battery device, such as into a battery pack or energy storage box; the BMS of this application can also be integrated as a controller into an electrical device, such as into a vehicle or vehicle chassis; the BMS of this application can also be integrated as a controller into a charging device, such as into a charging device or battery swapping device; the BMS of this application can also be deployed as control software on a server. A server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms, such as vehicle networking cloud, APP backend, etc.
[0071] In practical applications, a variety of tasks in a Battery Management System (BMS) need to be executed by the processor. These tasks may include battery overcharge protection, battery over-discharge protection, battery thermal runaway warning and handling, battery temperature detection, and software upgrades. To better schedule and allocate resources for these tasks within the BMS, the BMS typically allocates execution time for each task before execution, ensuring completion within the allocated time. However, various anomalies frequently occur during task execution. For example, frequent interruptions may preempt task execution time, leading to extended execution times; hardware devices (such as batteries) may suddenly malfunction, causing data transmission interruptions or a significant decrease in processing speed; or the task's internal logic may malfunction in complex computational scenarios, causing the program to enter an infinite loop or error state. These anomalies affect task execution time, making it difficult to accurately allocate reasonable execution times for tasks in current technologies, thus resulting in task execution times exceeding expectations.
[0072] In a battery management system (BMS), a task refers to a specific functional module or operational process executed by the system to achieve its core objectives. These tasks are accomplished collaboratively through hardware (such as sensors and controllers) and software (such as algorithms and strategies) to ensure the safe and efficient operation of the battery system.
[0073] Battery management system load mainly refers to the number of tasks that the battery management system is processing and waiting to be processed within a given time. It reflects the busyness and workload of the battery management system and covers aspects such as CPU utilization, memory load, disk I / O load, and network load.
[0074] In a battery management system (BMS), task execution time refers to the time required to complete a specific functional module or operational process. It is a key indicator for measuring system real-time performance, response speed, and resource allocation efficiency.
[0075] One of the factors contributing to anomalies is abnormal battery management system (BMS) load. Therefore, considering the BMS load when determining the execution duration improves accuracy. Accordingly, this application provides a task execution duration allocation method, system, device, storage medium, and program product. When determining the first execution duration of a target task, both the task attribute information and the BMS load information are considered, improving the accuracy of the first execution duration. This first execution duration provides sufficient execution time for the target task without considering other external factors. Furthermore, a reserved duration for the target task provides a buffer time for various uncertainties that may occur during its actual operation. This ensures that the target task can still be completed within the second execution duration even in the event of anomalies, thus reasonably allocating the second execution duration and effectively preventing the actual execution time from exceeding expectations. By considering the reserved duration, reasonably determining the allocated execution duration ensures that the task has sufficient time to complete while avoiding resource waste and efficiency reduction due to excessive allocation time.
[0076] The task execution time allocation method provided in this application embodiment will be described in detail below with reference to the accompanying drawings and specific embodiments.
[0077] Figure 1 This is one of the flowcharts illustrating a battery management system task execution time allocation method provided in some embodiments of this application. This battery management system task execution time allocation method can be applied to host computers, various task execution systems developed for automotive open system architectures, battery management systems (BMS), or other electrical devices with data processing functions such as mobile phones, laptops, tablets, and desktop computers.
[0078] like Figure 1 As shown, the task execution time allocation method may include the following S101-S103.
[0079] S101, Obtain the task attribute information and battery management system load information corresponding to the target task.
[0080] S102, based on the battery management system load information and task attribute information, determine the first execution duration of the target task.
[0081] S103, based on the first execution duration and the reserved duration of the target task, allocate a second execution duration to the target task.
[0082] In the technical solution of this application embodiment, when determining the first execution duration of the target task, the task attribute information corresponding to the target task and the battery management system load information are considered simultaneously, improving the accuracy of the first execution duration. This first execution duration provides sufficient execution time for the target task without considering the influence of other external factors. In addition, the reserved duration of the target task sets a buffer time for various uncertainties that may occur during the actual operation of the target task, so that the target task can still be completed within the second execution duration even if an anomaly occurs. This reasonably allocates the second execution duration to the target task and effectively avoids the actual execution time of the target task exceeding expectations.
[0083] The above steps are explained in detail below:
[0084] In S101, the target task is the task about to be assigned the target duration. It should be noted that, theoretically, the target task in this embodiment can be any task in the system; it is referred to as a target task here for convenience and does not imply a specific limitation on the task. Task attribute information describes various characteristics and properties of the task. In one example, task attribute information includes task priority, the size of the data corresponding to the task, the execution cycle of the task, and the complexity of the task. The task attribute information corresponding to the target task and the battery management system load information can be directly obtained from the system where the target task resides.
[0085] In S102, to accurately determine the first execution time of the target task, not only is the task attribute information corresponding to the target task fully considered, but also the battery management system load information corresponding to the target task. The task attribute information covers many key elements, such as the complexity of the task itself, its priority, the amount of data processing involved, and the complexity of the required operation steps. This information is crucial for accurately assessing the time required for task execution. The battery management system load information includes the current resource usage of the system, such as CPU utilization, memory usage, disk I / O status, and network bandwidth usage. These aspects play an indispensable role in determining the task execution speed. Therefore, only by comprehensively considering both the task attribute information and the battery management system load information can the first execution time of the target task be determined more comprehensively and accurately. It should be noted that the aforementioned first execution time is the expected execution time corresponding to the target task. This first execution time is a prediction of the possible execution time of the target task based on the battery management system load information and the task attribute information. In one example, the predicted possible execution time of the target task may include the maximum execution time, minimum execution time, and average execution time.
[0086] In some embodiments, the first execution time of the target task can be the maximum time spent during the execution of the task. The execution time of the target task includes the minimum execution time, the average execution time, and the first execution time. In order to ensure that the task can be completed within the expected time as much as possible when determining the allocated time of the target task, the maximum execution time can be selected as a reference for determining the allocated time of the target task in this embodiment.
[0087] In some embodiments, the first execution duration of the target task may also be a certain execution duration that is greater than a preset threshold during the execution of the target task, and there is no limitation on this.
[0088] In some embodiments, when determining the first execution duration of a target task, the correspondence between the battery management system load information, task attribute information and the first execution duration of the task can be determined based on the historical data of task execution in the system, and the first execution duration of the target task can be determined based on the correspondence.
[0089] In some embodiments, in order to accurately determine the first execution duration of the target task, in some embodiments, step S102 above, based on the battery management system load information and task attribute information, determines the first execution duration of the target task, including:
[0090] The battery management system load information and task attribute information are input into the trained task duration prediction model to obtain the first execution duration of the target task.
[0091] refer to Figure 2 In this embodiment, after obtaining the task attribute information and battery management system load information corresponding to the target task, the battery management system load information and task attribute information are input into the trained task duration prediction model 02, and then the task duration prediction model 02 outputs the first execution duration of the target task. It should be noted that the model type of the task duration prediction model can be selected as needed and is not limited thereto. When the task duration prediction model is a semantic large model, the obtained battery management system load information and task attribute information can be directly input into the semantic large model for recognition and output. When the task duration prediction model is a traditional neural network model, such as a convolutional network model, when inputting the battery management system load information and task attribute information into the task duration prediction model, the battery management system load information and task attribute information can be quantized first so that the neural network model can better identify the task attribute information and battery management system load information corresponding to the target task. For example, in one example, different battery management system load information or task attribute information can be encoded first, and then the encoded results can be normalized to complete the quantization of the battery management system load information or task attribute information.
[0092] In some embodiments, the task duration prediction model can be a convolutional network model, which includes convolutional layers, pooling layers, and fully connected layers. After obtaining the battery management system load information and task attribute information of the target task, the battery management system load information and task attribute information are first encoded to obtain encoded battery management system load information and encoded task attribute information. Then, normalization processing is performed to obtain normalized battery management system load information and normalized task attribute information. After the normalized battery management system load information and normalized task attribute information are input into the task duration prediction model, the convolutional layers in the task duration prediction model perform feature extraction to obtain initial features corresponding to the first execution duration of the target task. Then, the pooling layers included in the task duration prediction model perform max pooling on the initial features, thereby reducing the dimensionality of the initial features while retaining key features. Finally, the fully connected layers included in the task duration prediction model map the pooled feature vectors to the prediction result to obtain the first execution duration of the target task.
[0093] In some embodiments, the specific training process of the task duration prediction model can be referred to in the related technologies for the training process of network models, and will not be repeated here.
[0094] The task duration prediction model can delve into the complex relationship between battery management system load information, task attribute information and the first execution duration of the task, thereby improving the accuracy and reliability of determining the first execution duration of the target task.
[0095] To minimize the impact of abnormal situations on the output of the task duration prediction model, in some embodiments, reference is made to... Figure 3 The process of training the task duration prediction model includes the following steps S301-S304.
[0096] S301, obtain the historical actual execution time of the sample task.
[0097] S302, determine the abnormal time occupied due to anomalies from the historical actual execution time.
[0098] S303, determine the third execution duration of the sample task based on the abnormal duration and the historical actual execution duration.
[0099] S304. Based on the sample task and its corresponding third execution duration, the model is trained to obtain the task duration prediction model.
[0100] In some embodiments, considering that sample tasks are inevitably affected by abnormal situations during system execution, the historical execution time of the acquired sample tasks includes the abnormal time occupied by anomalies, further making it impossible to accurately obtain the true execution time of the sample tasks in scenarios unaffected by abnormal situations. Moreover, in this embodiment, the time occupied by abnormal situations is uniformly determined by reserved time. Therefore, to avoid conflicts with the subsequently determined reserved time, this embodiment mainly considers the execution time of each sample task under conditions unaffected by abnormal situations when training the task duration prediction model. In addition, since abnormal situations during task execution are generally uncontrollable, the actual historical execution time data of the collected sample tasks fluctuates greatly, which is not conducive to data convergence during model training and thus affects the accuracy of model prediction. Therefore, after obtaining the historical actual execution time of the sample tasks, the abnormal time is excluded from the historical actual execution time to obtain the third execution time of the sample tasks. Finally, the model is trained using the sample tasks and their corresponding third execution times to obtain the task duration prediction model.
[0101] In some embodiments, a model is trained based on a sample task and its corresponding third execution duration to obtain a task duration prediction model, including:
[0102] Input the task attribute information and battery management system load information of the sample task into the baseline model corresponding to the task duration prediction model to obtain the first predicted execution duration;
[0103] The loss function value is determined based on the first prediction execution time and the third execution time;
[0104] The model parameters of the baseline model are adjusted based on the loss function value, and the baseline model is determined as the task duration prediction model when the baseline model converges.
[0105] By calculating the loss function value using the third execution time (which excludes abnormal durations in sample tasks) and the first predicted execution time output by the baseline model, and adjusting the model parameters using this loss function value, the accuracy of the adjusted base station model output can be improved, thereby increasing the accuracy of the final task duration prediction model output.
[0106] In some embodiments, when training the model using the third execution duration of the sample task, the task attribute information and battery management system load information of the sample task can be input into the selected benchmark model first. Then, the benchmark model outputs the predicted first execution duration, and the loss function is calculated using the third execution duration corresponding to the sample task and the predicted first execution duration. Finally, the parameters of the benchmark model are adjusted according to the result of the loss function.
[0107] In some embodiments, in order to ensure that the task duration prediction model outputs the first execution duration of the task, when obtaining the historical actual execution duration of the sample task, multiple historical execution durations corresponding to the same sample task are generally obtained, and the largest historical actual execution duration is determined from them.
[0108] When training the task duration prediction model, by excluding the abnormal time occupied due to abnormalities in the historical actual execution time of sample tasks, it can be further ensured that the first execution time of the task output by the task duration prediction model does not include the impact of abnormal situations, so as to avoid conflict with the reserved time and thus avoid allocating an excessively long second execution time to the target task, resulting in a waste of task resources.
[0109] To avoid timer overflow affecting the detection of task execution duration, in some embodiments, the historical actual execution duration is determined based on the number of timer overflows and the timer's recorded duration. The timer starts timing when the sample task begins execution and ends timing when the sample task completes execution. The timer includes an overflow statistics unit, which records the number of timer overflows.
[0110] In some embodiments, the timer starts timing when the sample task begins execution. That is, once the target task starts, the timer begins working, ensuring that time is recorded from the moment the task begins. Then, during the execution of the sample task, the timer continuously times the target task until the sample task is completed, at which point the timer stops. Thus, the execution duration of the sample task at any given time point can be accurately obtained through this timer. Furthermore, since the timer is a standalone program, its operation is not affected by the sample task, further ensuring the accuracy and reliability of the real-time execution duration acquisition of the sample task.
[0111] In some embodiments, timer overflow refers to the phenomenon where a timer automatically resets to zero after reaching its maximum count value. When determining the historical actual execution time of a sample task based on the number of timer overflows and the timer's recording duration, the overflow duration can be determined first based on the number of timer overflows and the timer's corresponding maximum recording duration. Then, the overflow duration is summed with the timer's recording duration to obtain the historical actual execution time of the sample task. For example, if a timer's maximum recording duration is 100 seconds, the overflow statistics unit records 2 timer overflows, and the timer's recording duration is 30 seconds, then the final determined historical actual execution time is 230 seconds.
[0112] By setting an overflow statistics unit in the timer to record the number of times the timer overflows, detection errors caused by timer overflows are avoided when obtaining the historical actual execution time of sample tasks through the timer, thereby ensuring the quality of the data corresponding to the sample tasks.
[0113] In some embodiments, the timer masks interrupts in the target system where the sample task resides while recording the historical actual execution time of the sample task. By masking interrupts in the system during the execution of the sample task, the impact of abnormal situations on the historical actual execution time of the sample task can be further reduced, ensuring that the impact of abnormal situations on the prediction time is minimized when training the task duration prediction model.
[0114] In step S103, the reserved time is a buffer period set to account for various uncertainties that may occur during actual operation, such as the time for repairing sudden system failures or handling data anomalies. In one example, the reserved time can be set in advance as needed. For example, a fixed reserved time can be set for each task, and then the sum of this reserved time and the first execution time is used to determine the target time allocated to the target task. In another example, the same reserved time can also be set for all tasks in the system, thus limiting the scope of the task.
[0115] By defining the reserved time and the first execution time for the target task, a reasonable second execution time can be determined, effectively preventing the target task from exceeding the expected execution time and ensuring the efficient and stable operation of the entire workflow. Furthermore, by considering the reserved time, reasonably determining the allocated execution time ensures that the task has sufficient time to complete while avoiding resource waste and efficiency reduction due to excessive allocation time. It should be noted that the aforementioned second execution time is the final time allocated to the target task using the method of this application embodiment.
[0116] Considering that the longer the task execution time, the higher the probability of abnormal situations occurring, in order to more accurately determine the reserved time for each task, in some embodiments, before allocating a second execution time to the target task based on the first execution time and the reserved time of the target task, the above task execution time allocation method further includes:
[0117] The reserved time for the target task is determined based on the first execution time.
[0118] In some embodiments, the reserved time for the target task can be directly proportional to the first execution time, that is, the reserved time for the target task increases as the first execution time increases. In other embodiments, a range of values for the first execution time corresponding to different reserved times can be set, and the corresponding reserved time can be determined according to the target value range in which different first execution times fall.
[0119] By determining the initial execution time for each task, different reserve times can be set for different tasks, which can better ensure that all tasks can be accurately allocated execution leeway and that all tasks can be completed within the expected time.
[0120] In some embodiments, reference Figure 5 The task execution time allocation method of this application includes the following steps S401-S404.
[0121] S401, Obtain the task attribute information and battery management system load information corresponding to the target task.
[0122] S402, based on the battery management system load information and task attribute information, and through the trained task duration prediction model, obtains the first execution duration of the target task.
[0123] S403, determine the reserved time for the target task based on the first execution time.
[0124] S404, based on the first execution duration and the reserved duration of the target task, allocate a second execution duration to the target task.
[0125] It should be noted that, Figure 4The corresponding embodiments are the same as those described above. Figure 1 The main difference between the corresponding embodiments is that, Figure 4 In a corresponding embodiment, an additional step is added between determining the first execution duration of the target task and allocating a second execution duration to the target task: determining the reserved duration of the target task based on the first execution duration. This step can accurately determine the corresponding reserved duration based on the magnitude of the first execution duration, thereby ensuring that the reserved duration is determined based on the probability of the task being affected by anomalies, and further ensuring that the task has a reasonable execution buffer duration.
[0126] To more accurately determine the reservation duration, in some embodiments, reference is made to... Figure 5 The reserved time for the target task is determined based on the first execution time, including the following steps S501-S502.
[0127] S501 determines the reservation ratio corresponding to the reservation duration based on the battery management system load information.
[0128] S502, determine the reserved duration based on the reserved ratio and the first execution duration.
[0129] In some embodiments, considering that a higher system load increases the probability of anomalies during task execution, the battery management system load information can more accurately reflect the required reservation duration. In one example, the system load can be directly proportional to the reservation ratio corresponding to the reservation duration, meaning the reservation ratio increases with increasing system load. In another example, different system load ranges can be set for different reservation ratios, and then the reservation ratio corresponding to the reservation duration can be determined based on the target system load range corresponding to the battery management system load information. After determining the reservation ratio corresponding to the reservation duration using the battery management system load information, the reservation duration can be determined by multiplying the reservation ratio by the first execution duration.
[0130] By using the load information of the battery management system, the probability of anomalies during task execution can be reflected, thereby accurately determining the reservation ratio corresponding to the reserved time. This allows for a reasonable determination of the reserved time, avoiding resource waste caused by excessively long reserved time and preventing tasks from failing to complete within the expected timeframe due to excessively short reserved time.
[0131] In some embodiments, reference Figure 6 The reservation ratio corresponding to the reservation duration is determined based on the load information of the battery management system, including the following steps S601-S602.
[0132] S601, if the target task has dependent related tasks, obtain the second execution duration of the related tasks.
[0133] S602, based on the second execution duration of the associated task and the load information of the battery management system, determine the reservation ratio corresponding to the reservation duration.
[0134] In some embodiments, considering that many tasks in the system have dependencies, meaning that the execution of some tasks depends on the execution results of other tasks, those dependent tasks can be considered as associated tasks of other tasks that depend on them. For example, if the execution of task A requires the execution result of task B, then task B is an associated task that task A depends on. When an associated task of a certain task is affected by abnormal conditions during execution, the execution time of that task will also be affected. Therefore, in this embodiment, to more accurately determine the reserved time of the target task, it is first determined whether the target task has any dependent associated tasks. If so, the second execution time of the associated tasks is further obtained, and the reserved ratio corresponding to the reserved time is determined based on the second execution time of the associated tasks and the battery management system load information.
[0135] It should be noted that the second execution duration of the associated task is the execution duration allocated to the associated task using the task execution duration allocation method described above. The specific method for determining the second execution duration of the associated task can be referenced from the process for determining the second execution duration of the target task, and will not be repeated here. The longer the second execution duration of the associated task, the greater the probability of anomalies occurring during its execution. Therefore, when determining the reservation ratio, a reservation coefficient corresponding to the reservation ratio can be determined based on the second execution duration of the associated task, and an initial reservation ratio can be determined based on the battery management system load information. Finally, the product of the reservation coefficient and the initial reservation ratio is taken as the reservation ratio corresponding to the reserved duration. In one example, the second execution duration of the associated task can be made directly proportional to the reservation coefficient corresponding to the reservation ratio.
[0136] By further considering the uncertainties that related tasks on which the target task depends may affect the execution of the target task, the accuracy of determining the reservation ratio corresponding to the reserved time is further improved, thus avoiding the situation where the task cannot be completed within the expected time.
[0137] To more accurately determine the reservation ratio by simultaneously utilizing the battery management system load information and the second execution duration of associated tasks, in some embodiments, reference is made to... Figure 7 Based on the second execution duration of the associated task and the load information of the battery management system, the reservation ratio corresponding to the reservation duration is determined, including the following steps S701-S703.
[0138] S701 determines the first number of abnormal situations that occur during the execution of the target task based on the battery management system load information.
[0139] S702, determine the second number of abnormal situations that occur during the execution of the associated task based on the second execution duration of the associated task.
[0140] S703, determine the reservation ratio corresponding to the reservation duration based on the first quantity and the second quantity.
[0141] In some embodiments, considering that both the target task execution process and the associated task execution process will be affected by abnormal situations, thus affecting the final execution time of the target task, in order to more accurately quantify the reservation ratio, a first number of abnormal situations occurring during the target task execution process and a second number of abnormal situations occurring during the associated task execution process can be determined separately. In one example, the first number can be made directly proportional to the battery management system load information, or a first fitting function can be obtained based on historical data, and the first number can be determined based on the first fitting function. Similarly, the second number can be made directly proportional to the second execution time of the associated task, or a second fitting function can be obtained based on historical data, and the second number can be determined based on the second fitting function. After determining the first and second numbers, a target sum of the first and second numbers can be calculated, and the reservation ratio corresponding to the reservation time can be determined based on the target sum and the occupied time corresponding to a single abnormality.
[0142] By jointly determining the reservation ratio corresponding to the reserved time by the first number of abnormal situations that occur during the execution of the target task and the second number of abnormal situations that occur during the execution of related tasks, sufficient execution margin can be provided for multiple abnormal situations that may occur during the execution of the target task, further ensuring the accuracy of the reserved time.
[0143] In some embodiments, reference Figure 8 The second number of abnormal situations that occur during the execution of the associated task is determined based on the second execution duration of the associated task, including the following steps S801-S802.
[0144] S801, determine the target ratio between the second execution duration of the associated task and the second execution duration of the target task.
[0145] S802, based on the target ratio and the first quantity, determine the second quantity.
[0146] In some embodiments, considering that the associated task and the target task run in the same system, their execution environments are similar. However, in the above embodiments, determining the number of abnormal situations based on the battery management system load information and the second execution duration of the associated task would undoubtedly increase the computational load, especially during function fitting, which requires collecting a large amount of historical data and consuming significant computational resources. Furthermore, during calculations, insufficient function fitting could lead to low accuracy in the final derivation result. Therefore, to improve the accuracy and efficiency of data processing, this embodiment fully utilizes limited resources to focus on fitting the functional relationship between the battery management system load information and the first quantity, thus improving efficiency while ensuring data accuracy. After determining the first number of abnormal situations during the execution of the target task based on the battery management system load information, the second number of abnormal situations during the execution of the associated task can be determined based on the target ratio between the second execution duration of the associated task and the second execution duration of the target task, as well as the aforementioned first number.
[0147] This allows for full utilization of the information contained in the first quantity to determine the second quantity, providing a more accurate and reliable basis for determining the second quantity in the event of anomalies during the execution of related tasks, and improving the efficiency of determining the second quantity.
[0148] Considering that the system load may change significantly after the second execution duration allocation for the target task, determining the second execution duration of the target task based on the previous system load would undoubtedly result in a huge error. To avoid this situation, in some embodiments, after allocating the second execution duration for the target task, the task execution duration allocation method further includes:
[0149] In response to a change in the battery management system load information exceeding a preset threshold, the changed battery management system load information is obtained.
[0150] The second execution duration is reallocated to the target task based on the changed battery management system load information.
[0151] In some embodiments, after allocating a second execution duration to the target task, if the change in the battery management system load information exceeds a preset threshold, the changed battery management system load information is reacquired, and the second execution duration is reallocated to the target task based on the changed battery management system load information. When reallocating the second execution duration to the target task, the first execution duration of the target task can be determined first based on the changed battery management system load information and the task attribute information of the target task. Then, the second execution duration is reallocated to the target task based on the newly determined first execution duration and the reserved duration of the target task.
[0152] By setting a preset threshold, it is possible to detect whether there has been a significant change in the load information of the battery management system. When the load information of the battery management system changes significantly, the execution time of the target task can be reallocated in a timely manner based on the changed load information of the battery management system. This enables dynamic adjustment of the allocated execution time of the target task, thereby ensuring that the target task can be executed reasonably and efficiently within its allocated time to the greatest extent.
[0153] In some embodiments, reference Figure 9 The task execution time allocation method in this application includes the following steps S901-S905.
[0154] S901, obtain the task attribute information and battery management system load information corresponding to the target task.
[0155] S902 determines the first execution duration of the target task based on the battery management system load information and task attribute information.
[0156] S903, based on the first execution duration and the reserved duration of the target task, allocate a second execution duration to the target task.
[0157] S904, in response to a change in the battery management system load information exceeding a preset threshold, obtains the changed battery management system load information.
[0158] S905 reallocates a second execution duration to the target task based on the changed battery management system load information.
[0159] It should be noted that steps S901-S903 are similar to steps S101-S103, and the specific implementation process can be referred to in the above embodiments. The detailed description of steps S101-S103 will not be repeated here. Steps S904-S905 are performed after allocating a second execution duration to the target task. If the change in the battery management system load information is greater than a preset threshold, the second execution duration is reallocated to the target task according to the changed battery management system load information to ensure dynamic adjustment of the second execution duration allocated to the target task.
[0160] Based on the same inventive concept, this application also provides a battery management system. The following, in conjunction with... Figure 10 The battery management system provided in the embodiments of this application will be described in detail.
[0161] Figure 10 A schematic diagram of a battery management system provided in one embodiment of this application is shown.
[0162] like Figure 10As shown, the battery management system includes:
[0163] The information acquisition unit 1001 is used to acquire the task attribute information and battery management system load information corresponding to the target task.
[0164] The controller 1002 is used to determine the first execution duration of the target task based on the load information and task attribute information of the battery management system, and to allocate a second execution duration to the target task based on the first execution duration and the reserved duration of the target task.
[0165] The battery management system in this application, when determining the first execution duration of the target task, simultaneously considers the task attribute information corresponding to the target task and the load information of the battery management system, thereby improving the accuracy of the first execution duration. This first execution duration provides sufficient execution time for the target task without considering the influence of other external factors. Furthermore, by reserving time for the target task, a buffer period is set for various uncertainties that may occur during the actual operation of the target task. This ensures that the target task can still be completed within the second execution duration even if an anomaly occurs, thus reasonably allocating the second execution duration for the target task and effectively preventing the actual execution time of the target task from exceeding expectations.
[0166] In some embodiments, the battery management system further includes a reservation duration determination module, which is used to:
[0167] The reserved time for the target task is determined based on the first execution time.
[0168] By determining the initial execution time for each task, different reserve times can be set for different tasks, which can better ensure that all tasks can be accurately allocated execution leeway and that all tasks can be completed within the expected time.
[0169] In some embodiments, the above-mentioned reservation duration determination module includes:
[0170] The first determining unit determines the reservation ratio corresponding to the reservation duration based on the battery management system load information;
[0171] The second determining unit determines the reserved duration based on the reserved ratio and the first execution duration.
[0172] By using the load information of the battery management system, the probability of anomalies during task execution can be reflected, thereby accurately determining the reservation ratio corresponding to the reserved time. This allows for a reasonable determination of the reserved time, avoiding resource waste caused by excessively long reserved time and preventing the task from being completed within the expected timeframe due to excessively short reserved time.
[0173] In some embodiments, the first determining unit includes:
[0174] Retrieve components; if the target task has dependent related tasks, retrieve the second execution duration of the related tasks.
[0175] The components are identified, and the reservation ratio corresponding to the reserved time is determined based on the second execution duration of the associated task and the load information of the battery management system.
[0176] By further considering the uncertainties that related tasks on which the target task depends may affect the execution of the target task, the accuracy of determining the reservation ratio corresponding to the reserved time is further improved, thus avoiding the situation where the task cannot be completed within the expected time.
[0177] In some embodiments, a component is determined, specifically for:
[0178] Based on the battery management system load information, determine the first number of abnormal situations that occur during the execution of the target task;
[0179] The second number of abnormal situations that occur during the execution of the associated task is determined based on the second execution duration of the associated task.
[0180] The reservation ratio corresponding to the reservation duration is determined based on the first quantity and the second quantity.
[0181] By jointly determining the reservation ratio corresponding to the reserved time by the first number of abnormal situations that occur during the execution of the target task and the second number of abnormal situations that occur during the execution of related tasks, sufficient execution margin can be provided for multiple abnormal situations that may occur during the execution of the target task.
[0182] In some embodiments, a component is determined, specifically for:
[0183] Determine the target ratio between the second execution duration of the associated task and the second execution duration of the target task; based on the target ratio and the first quantity, determine the second quantity. This allows for full utilization of the information contained in the first quantity to determine the second quantity, providing a more accurate and reliable basis for determining the second quantity in case of abnormal situations during the execution of the associated task.
[0184] In some embodiments, the controller 1002 is specifically used for:
[0185] The battery management system load information and task attribute information are input into the trained task duration prediction model to obtain the first execution duration of the target task.
[0186] The task duration prediction model can delve into the complex relationship between battery management system load information, task attribute information and the first execution duration of the task, thereby improving the accuracy and reliability of determining the first execution duration of the target task.
[0187] In some embodiments, the battery management system further includes a model training module, which is used for:
[0188] Obtain the historical actual execution time of the sample task;
[0189] Determine the abnormal time occupied due to anomalies from the historical actual execution time;
[0190] The third execution duration of the sample task is determined based on the abnormal duration and the historical actual execution duration;
[0191] Based on the sample tasks and their corresponding third execution duration, the model is trained to obtain the task duration prediction model.
[0192] When training the task duration prediction model, by excluding the abnormal time occupied due to abnormalities in the historical actual execution time of sample tasks, it can be further ensured that the first execution time of the task output by the task duration prediction model does not include the impact of abnormal situations, so as to avoid conflict with the reserved time and thus avoid allocating an excessively long second execution time to the target task, resulting in a waste of task resources.
[0193] In some embodiments, the model training module is specifically used for:
[0194] Input the task attribute information and battery management system load information of the sample task into the baseline model corresponding to the task duration prediction model to obtain the first predicted execution duration;
[0195] The loss function value is determined based on the first prediction execution time and the third execution time;
[0196] The model parameters of the baseline model are adjusted based on the loss function value, and the baseline model is determined as the task duration prediction model when the baseline model converges.
[0197] By calculating the loss function value using the third execution time (which excludes abnormal durations in sample tasks) and the first predicted execution time output by the baseline model, and adjusting the model parameters using this loss function value, the accuracy of the adjusted base station model output can be improved, thereby increasing the accuracy of the final task duration prediction model output.
[0198] In some embodiments, the actual historical execution time is determined based on the number of times the timer overflows and the timer's recording duration; wherein, the timer starts timing when the sample task begins execution and ends timing when the sample task is completed; the timer includes an overflow statistics unit, which is used to record the number of times the timer overflows.
[0199] By setting an overflow statistics unit in the timer to record the number of times the timer overflows, detection errors caused by timer overflows are avoided when obtaining the historical actual execution time of sample tasks through the timer, thereby ensuring the quality of the data corresponding to the sample tasks.
[0200] In some embodiments, the timer masks interrupts in the target system where the sample task resides while recording the historical actual execution time of the sample task. This further reduces the impact of abnormal situations on the historical actual execution time of the sample task, ensuring that the influence of abnormal situations on the prediction time is minimized when training the task duration prediction model.
[0201] In some embodiments, the battery management system further includes a re-determination module, which is used to:
[0202] In response to a change in the battery management system load information exceeding a preset threshold, the changed battery management system load information is obtained.
[0203] The second execution duration is reallocated to the target task based on the changed battery management system load information.
[0204] By setting a preset threshold, it is possible to detect whether there has been a significant change in the load information of the battery management system. When the load information of the battery management system changes significantly, the execution time of the target task can be reallocated in a timely manner based on the changed load information of the battery management system. This enables dynamic adjustment of the allocated execution time of the target task, thereby ensuring that the target task can be executed reasonably and efficiently within its allocated time to the greatest extent.
[0205] Based on the same inventive concept, this application also provides an electrical device, which includes: a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, it implements the task execution time allocation method as shown in any of the above embodiments.
[0206] like Figure 11 A schematic diagram of an electrical device according to an embodiment of this application is shown. This electrical device can be integrated into an electric vehicle and includes a processor and an operating system mounted on the processor.
[0207] like Figure 11 As shown, the electrical device 1100 includes a battery management system as described in any of the above embodiments, thereby enabling the task execution time allocation method according to the embodiments of this application. The electrical device may refer to a structural diagram of an exemplary hardware architecture of the electrical device in the embodiments of this application.
[0208] The electrical device 1100 may include a processor 1101 and a memory 1102 storing computer program instructions.
[0209] Specifically, the processor 1101 may include a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.
[0210] Memory 1102 may include mass storage for data or instructions. For example, and not limitingly, memory 1102 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 1102 may include removable or non-removable (or fixed) media. Where appropriate, memory 1102 may be internal or external to the integrated gateway disaster recovery device. In a particular embodiment, memory 1102 is non-volatile solid-state memory. In a particular embodiment, memory 1102 may include read-only memory (ROM), random access memory (RAM), disk storage media device, optical storage media device, flash memory device, electrical, optical, or other physical / tangible memory storage device. Therefore, typically, memory 1102 includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to one aspect of this application.
[0211] The processor 1101 reads and executes computer program instructions stored in the memory 1102 to implement any of the task execution time allocation methods in the above embodiments.
[0212] In one example, the electrical device may also include a communication interface 1103 and a bus 1104. For example, Figure 11 As shown, the processor 1101, memory 1102, and communication interface 1103 are connected through bus 1104 and complete communication with each other.
[0213] The communication interface 1103 is mainly used to realize communication between various modules, devices and / or equipment in the embodiments of this application.
[0214] Bus 1104 includes hardware, software, or both, that couples components of an electrically powered device together. For example, and not limitingly, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Low Pin Count (LPC) bus, a memory bus, a Microchannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or other suitable buses, or combinations of two or more of these. Where appropriate, bus 1104 may include one or more buses. Although specific buses are described and illustrated in embodiments of this application, any suitable bus or interconnect is contemplated herein.
[0215] The electrical device can execute the task execution time allocation method of any embodiment in this application and has the beneficial effects of the above-described task execution time allocation method embodiments, which will not be elaborated further.
[0216] Furthermore, in conjunction with the task execution time allocation method in the above embodiments, this application embodiment can provide a computer storage medium for implementation. This computer storage medium stores computer program instructions; when these computer program instructions are executed by a processor, they implement any of the task execution time allocation methods in the above embodiments.
[0217] This application also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the various processes of the above method embodiments and achieve the same technical effect. To avoid repetition, it will not be described again here.
[0218] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.
[0219] This application provides a computer program product stored in a readable storage medium. When executed by at least one processor, the program product can implement the various processes of the above-described task execution time allocation method embodiment and achieve the same technical effect. To avoid repetition, it will not be described again here.
[0220] It should be clarified that this application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of this application is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this application.
[0221] The functional blocks shown in the above-described structural diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. Programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried on a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio frequency (RF) links, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.
[0222] It should also be noted that the exemplary embodiments mentioned in this application describe methods or systems based on a series of steps or apparatus. However, this application is not limited to the order of the above steps; that is, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.
[0223] The aspects of this application have been described above with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It should be understood that each block in the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that these instructions, executable via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions / actions specified in one or more blocks of the flowchart illustrations and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It is also understood that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can also be implemented by dedicated hardware performing the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.
[0224] Although this application has been described with reference to preferred embodiments, various modifications can be made thereto and components can be replaced with equivalents without departing from the scope of this application. In particular, the technical features mentioned in the various embodiments can be combined in any manner, provided there is no structural conflict. This application is not limited to the specific embodiments disclosed herein, but includes all technical solutions falling within the scope of the claims.
Claims
1. A method for allocating task execution time in a battery management system, characterized in that, include: Obtain the task attribute information and battery management system load information corresponding to the target task; Based on the battery management system load information and the task attribute information, the first execution duration of the target task is determined; Based on the first execution duration and the reserved duration of the target task, a second execution duration is allocated to the target task.
2. The method according to claim 1, characterized in that, Before allocating a second execution duration to the target task based on the first execution duration and the reserved duration of the target task, the method further includes: The reserved time for the target task is determined based on the first execution time.
3. The method according to claim 2, characterized in that, Determining the reserved time for the target task based on the first execution time includes: The reservation ratio corresponding to the reserved duration is determined based on the battery management system load information. The reserved duration is determined based on the reserved ratio and the first execution duration.
4. The method according to claim 3, characterized in that, Determining the reservation ratio corresponding to the reservation duration based on the battery management system load information includes: If the target task has dependent related tasks, obtain the second execution duration of the related tasks; Based on the second execution duration of the associated task and the load information of the battery management system, the reservation ratio corresponding to the reserved duration is determined.
5. The method according to claim 4, characterized in that, Based on the second execution duration of the associated task and the load information of the battery management system, the reservation ratio corresponding to the reserved duration is determined, including: Based on the battery management system load information, determine the first number of abnormal situations that occur during the execution of the target task; The second number of abnormal situations that occur during the execution of the associated task is determined based on the second execution duration of the associated task; The reservation ratio corresponding to the reservation duration is determined based on the first quantity and the second quantity.
6. The method according to claim 5, characterized in that, Based on the second execution duration of the associated task, a second number of abnormal situations occurring during the execution of the associated task is determined, including: Determine the target ratio between the second execution duration of the associated task and the second execution duration of the target task; The second quantity is determined based on the target ratio and the first quantity.
7. The method according to any one of claims 1 to 6, characterized in that, Based on the battery management system load information and the task attribute information, the first execution duration of the target task is determined, including: The battery management system load information and the task attribute information are input into the trained task duration prediction model to obtain the first execution duration of the target task.
8. The method according to any one of claims 1 to 7, characterized in that, The process of training the task duration prediction model includes: Obtain the historical actual execution time of the sample task; Determine the abnormal execution time from the historical actual execution time; The third execution duration of the sample task is determined based on the abnormal duration and the historical actual execution duration; Based on the sample task and its corresponding third execution duration, the model is trained to obtain the task duration prediction model.
9. The method according to claim 8, characterized in that, Based on the sample task and its corresponding third execution duration, the model is trained to obtain the task duration prediction model, including: The task attribute information and battery management system load information of the sample task are input into the baseline model corresponding to the task duration prediction model to obtain the first predicted execution duration. The loss function value is determined based on the first prediction execution time and the third execution time; The model parameters of the baseline model are adjusted based on the loss function value, and the base station model is determined as the task duration prediction model when the baseline model converges.
10. The method according to claim 8, characterized in that, The actual historical execution time is determined based on the number of times the timer overflows and the recording duration of the timer; wherein, the timer starts timing when the sample task begins execution and ends timing when the sample task is completed; the timer includes an overflow statistics unit, which is used to record the number of times the timer overflows.
11. The method according to claim 9, characterized in that, While recording the historical actual execution time of the sample task, the timer disables interrupts in the target system where the sample task is located.
12. The method according to any one of claims 1 to 11, characterized in that, After allocating a second execution duration to the target task, the method further includes: In response to a change in the battery management system load information exceeding a preset threshold, the changed battery management system load information is obtained. Based on the changed battery management system load information, a second execution duration is reassigned to the target task.
13. A battery management system, characterized in that, include: The information acquisition unit is used to acquire task attribute information and battery management system load information corresponding to the target task. The controller is configured to determine a first execution duration for the target task based on the load information of the battery management system and the task attribute information, and to allocate a second execution duration for the target task based on the first execution duration and the reserved duration of the target task.
14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer program instructions, which, when executed by a processor, implement the task execution time allocation method as described in any one of claims 1-12.
15. A computer program product, characterized in that, When the instructions in the computer program product are executed by the processor of the electrical device, the electrical device performs the task execution time allocation method as described in any one of claims 1-12.