Methods, devices, and media for calculating the load rate of independently controllable DC control and protection devices

By calculating the load rate in real time in the DC control and protection device, the problem of not being able to obtain the load rate in real time in the existing technology is solved, ensuring stable system operation, optimizing resource allocation, and improving system performance.

CN120955596BActive Publication Date: 2026-03-13STATE GRID ECONOMIC TECH RES INST CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-11
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

Existing methods cannot obtain the operational load rate of DC control and protection devices in real time. This can lead to excessively high load rates, which may cause control and protection functions to malfunction, affect fault response capabilities, and impact the stable operation of DC transmission systems.

Method used

By determining task priorities during task switching, calculating the duration of the current running cycle and the cumulative idle time, calculating the load rate in real time, filtering out scenarios where high-priority tasks have just finished executing and low-priority tasks are about to run, and combining time parameters to calculate the load rate.

Benefits of technology

It enables real-time load rate monitoring of DC transmission systems, ensuring stable system operation, timely detection of performance problems, optimization of resource allocation, and prevention of system performance degradation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120955596B_ABST
    Figure CN120955596B_ABST
Patent Text Reader

Abstract

This invention discloses a method, apparatus, and medium for calculating the load rate of an autonomous and controllable DC control and protection device. When a task switch is triggered, the first priority of the current task and the second priority of the task about to run are determined. When the first priority is low and the second priority is high, the duration and cumulative idle time of the current operating cycle are calculated. The real-time load rate is calculated based on the duration and the cumulative idle time. This solution can obtain the system load rate in real time, ensuring the stable operation of the DC transmission system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of DC power transmission technology, and in particular to a method, device, and medium for calculating the load rate of an autonomous and controllable DC control and protection device. Background Technology

[0002] The computational load of the processor in a DC control and protection device has a crucial impact on the DC transmission system, affecting its long-term stable operation. Current methods cannot obtain the real-time load rate of the DC control and protection device. An excessively high load rate may cause control and protection functions to malfunction, affecting the ability to respond quickly to faults and leading to instability in the DC transmission system. Summary of the Invention

[0003] To address the aforementioned shortcomings, this invention provides an independent and controllable DC control and protection device load rate calculation method, device, and medium, which can obtain the system load rate in real time and ensure the stable operation of the DC transmission system.

[0004] This invention provides a method for calculating the load rate of an autonomous and controllable DC control and protection device, the method comprising:

[0005] When a task switch is triggered, the first priority of the current task and the second priority of the task about to be run are determined.

[0006] When the first priority is low and the second priority is high, calculate the duration of the current running cycle and the cumulative idle time;

[0007] The real-time load rate is calculated based on the duration and the cumulative idle time.

[0008] Preferably, determining the first priority of the current task and the second priority of the task about to be run specifically includes:

[0009] Get the first priority value preset when the current task was created and the second priority value preset when the task about to run was created;

[0010] When the first priority value is greater than the preset priority threshold, the first priority is determined as low priority; otherwise, the first priority is determined as high priority.

[0011] When the second priority value is greater than the priority threshold, the second priority is determined as low priority; otherwise, the second priority is determined as high priority.

[0012] Preferably, the method further includes:

[0013] When the first priority is high and the second priority is low, check whether the current running cycle has started;

[0014] If the current cycle has already started, record the switching time of the last task switch;

[0015] If the current cycle has not started, initialize the cycle, record the current time as the cycle start time, and update the switching time of the last task switch.

[0016] Preferably, the calculation of the duration of the current running cycle and the cumulative idle time specifically includes:

[0017] The duration of the current running cycle is calculated based on the current time and the cycle start time of the current running cycle.

[0018] Calculate the time difference between the current time and the time of the last task switch.

[0019] Calculate the idle time of each low-priority task as it loops within the time difference;

[0020] Calculate the sum of the idle times of all low-priority tasks to obtain the cumulative idle time;

[0021] When the duration is not less than the preset cycle length, the recording cycle is completed, and the duration and the cumulative idle time are output.

[0022] Preferably, calculating the idle time of each low-priority task during its cyclic execution within the time difference includes:

[0023] For each low-priority task, calculate the number of times it will be executed within the time difference based on the task's execution cycle;

[0024] The idle time for each execution is calculated based on the task's execution duration and the execution cycle.

[0025] The idle time is calculated based on the number of executions and the idle duration.

[0026] Preferably, the step of calculating the real-time load factor based on the duration and the cumulative idle time includes:

[0027] When the duration is less than the first preset value, or the cumulative idle time is not greater than the second preset value, a calculation error warning is output;

[0028] When the duration is not less than the first preset value and the cumulative idle time is greater than the second preset value, the real-time load rate is calculated based on the duration and the cumulative idle time.

[0029] Wherein, the load rate T idle T is the cumulative idle time. duration The duration is [the specified duration].

[0030] Preferably, the method further includes:

[0031] The system outputs a corresponding level of alert based on the load rate and the preset alarm level range.

[0032] This invention also provides a load factor calculation device for an autonomous and controllable DC control and protection device, the device comprising:

[0033] The trigger module is used to determine the first priority of the current task and the second priority of the task about to be run when a task switch is triggered;

[0034] The time module is used to calculate the duration of the current running cycle and the cumulative idle time when the first priority is low and the second priority is high.

[0035] The calculation module is used to calculate the real-time load rate based on the duration and the cumulative idle time.

[0036] This invention also provides a load rate calculation device for an autonomous and controllable DC control and protection device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements the load rate calculation method for the autonomous and controllable DC control and protection device as described in any of the above embodiments.

[0037] This invention also provides a computer-readable storage medium, which includes a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to execute the load rate calculation method of the autonomous and controllable DC control and protection device as described in any of the above embodiments.

[0038] The present invention provides a method, apparatus, and medium for calculating the load rate of an autonomous and controllable DC control and protection device. When a task switch is triggered, the first priority of the current task and the second priority of the task about to be run are determined. When the first priority is low and the second priority is high, the duration and cumulative idle time of the current operating cycle are calculated. The real-time load rate is calculated based on the duration and the cumulative idle time. This solution can obtain the system load rate in real time, ensuring the stable operation of the DC transmission system. Attached Figure Description

[0039] Figure 1This is a flowchart illustrating a method for calculating the load rate of an autonomous and controllable DC control and protection device according to an embodiment of the present invention.

[0040] Figure 2 This is a schematic diagram of a functional implementation scheme of a DC control and protection device provided in an embodiment of the present invention;

[0041] Figure 3 This is another flowchart illustrating the load rate calculation method for the autonomous and controllable DC control and protection device provided in this embodiment of the invention.

[0042] Figure 4 This is a schematic diagram of the load rate calculation process provided in an embodiment of the present invention;

[0043] Figure 5 This is a schematic diagram of the load rate calculation device of the autonomous and controllable DC control and protection device provided in the embodiment of the present invention;

[0044] Figure 6 This is another structural schematic diagram of a load rate calculation device for an autonomous and controllable DC control and protection device provided in an embodiment of the present invention. Detailed Implementation

[0045] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0046] See Figure 1 This is a flowchart illustrating a method for calculating the load rate of an autonomous and controllable DC control and protection device according to an embodiment of the present invention. The method includes steps S1 to S3:

[0047] Step S1: When a task switch is triggered, determine the first priority of the current task and the second priority of the task to be run.

[0048] Step S2: When the first priority is high priority and the second priority is low priority, calculate the duration of the current running cycle and the cumulative idle time.

[0049] Step S3: Calculate the real-time load rate based on the duration and the cumulative idle time.

[0050] In this specific implementation, the DC control and protection device includes station power supply for both stations, AC station control, DC station control, pole control, pole protection, converter control, and converter protection. The DC station control, i.e., the DC control and protection device, uses a dual-core processor in its main unit. The processor load rate is sent to the main and slave cores for real-time monitoring data. See also... Figure 2 This is a schematic diagram of a functional implementation scheme of a DC control and protection device provided in an embodiment of the present invention.

[0051] This application provides a method for calculating the load rate of an autonomous and controllable DC control and protection device, which can calculate the load rate in real time. Specifically:

[0052] In a real-time multitasking operating system, the task switching function is triggered when a task decides to switch to the currently running task.

[0053] Task switching is a process that is forcibly executed by a real-time multitasking operating system at certain intervals (e.g., 1 millisecond). During the task switching process, if a new task has a higher priority than the current task and is in a ready state, the task will be switched to for execution. Therefore, by default, the system always executes the highest priority task among the ready tasks in the current time period.

[0054] When a task switch is triggered, the context information of the current task is saved, including register state, program counter, etc.; the context information of the new task is loaded to restore its running state; and the run queue state in the kernel scheduler is updated.

[0055] The system determines the first priority of the current task and the second priority of the task about to be run. When a task switching event is detected, the system retrieves the first priority of the current task and the second priority of the task about to be run. This process typically relies on the operating system's task scheduling mechanism, reading pre-defined priority fields at critical nodes of task switching. Priority settings differentiate the importance of tasks; high-priority tasks usually require rapid system processing to meet their time sensitivity and critical business needs; low-priority tasks can run when system resources are relatively abundant.

[0056] By comparing these two priorities, specific scenarios where "the first priority is high and the second priority is low" are identified. In such scenarios, a high-priority task has just finished executing or been interrupted, and a low-priority task is about to run. At this time, the system resource usage status can better reflect the system load.

[0057] Calculate the duration and cumulative idle time of the current running cycle. The duration of the current running cycle refers to the length of time from the start of a task execution to the occurrence of a task switch, reflecting the system's time investment in task processing over a period of time. The cumulative idle time refers to the total time the system spends idle within this running cycle, reflecting the system's time resources not occupied by tasks. Finally, based on the duration and cumulative idle time, the real-time load rate is obtained through a specific calculation method. The load rate directly reflects the system's resource utilization level within the current running cycle.

[0058] During its runtime, the system monitors its own status in real time. When it detects that the CPU is idle (e.g., no task is executing on the CPU), it starts an idle timer. When a task begins execution, the idle timer stops, and the idle time is added to the cumulative idle time variable. In this way, the cumulative idle time is continuously updated.

[0059] The real-time load rate is calculated using a specific formula based on the calculated current operating cycle duration and cumulative idle time.

[0060] By selecting specific task priority scenarios and calculating the load rate in conjunction with time parameters, the resource utilization of the system during actual operation can be more accurately reflected. Compared to the traditional method of simply measuring load by the number of tasks or CPU usage time, this solution considers the impact of task priority on resource allocation, which is more in line with the actual operating characteristics of multi-tasking systems and provides a more accurate basis for system performance evaluation. By obtaining the real-time load rate, the system's operating status can be monitored in real time. By observing the trend of load rate changes, potential performance problems of the system can be identified in a timely manner, such as resource bottlenecks and task execution anomalies, and targeted measures can be taken for optimization and adjustment to ensure the stable and efficient operation of the system.

[0061] In another embodiment provided by the present invention, when determining the first priority and the second priority, specifically:

[0062] In a multitasking system, each task is assigned a preset priority value when it is created, which reflects its importance and the urgency of its resource requirements.

[0063] The system retrieves the first priority value preset when the current task was created and the second priority value preset when the task about to run was created. When a task switching event is triggered, the system's task management module, based on the task's unique identifier, extracts the first priority value preset when the current task was created and the second priority value preset when the task about to run was created from the Task Control Block (TCB) or the task attribute table. This process relies on the system's complete recording and efficient retrieval mechanism for task information.

[0064] The first priority and the second priority are determined based on the magnitude of the first priority value and the magnitude of the second priority value.

[0065] For example, when the first priority value is greater than the preset priority threshold, it means that the priority set when the task was created is relatively low, and it is determined to be a low priority; otherwise, it is a high priority. Similarly, the same logic is applied to the second priority value of the task about to be run to determine its actual priority.

[0066] This case also involves setting a priority threshold to perform a secondary evaluation and conversion of the preset priority value, thereby redetermining the actual priority of the task.

[0067] The system compares the acquired first priority value with a preset priority threshold. If the first priority value is greater than the priority threshold, the system marks the current task's first priority as low priority; if it is less than or equal to the priority threshold, it is marked as high priority. For example, if the preset threshold is 5, and a task's first priority value is 6, its first priority is determined to be low priority; if the value is 4, it is high priority.

[0068] Using the same logic as for the first priority, the second priority value of the task about to be executed is compared with the priority threshold. If the second priority value is greater than the threshold, the second priority is determined to be low priority; otherwise, it is determined to be high priority.

[0069] The task switching scenario of "high priority first and low priority second" was selected. In this scenario, after the high priority task is completed or interrupted, the low priority task is about to run. At this time, the load rate is calculated by combining the running cycle and idle time, which can accurately reflect the load status of the system during the resource transition phase and provide a key basis for system resource scheduling.

[0070] In yet another embodiment provided by the present invention, see Figure 3 This is another flowchart illustrating the load rate calculation method for the autonomous and controllable DC control and protection device provided in this embodiment of the invention.

[0071] After the task switching mechanism is triggered, the priorities of the old and new tasks are obtained, namely the first priority of the current task and the second priority of the task about to be run.

[0072] Determine whether the new task is of low priority and the existing task is of high priority, that is, whether the first priority is high priority and the second priority is low priority.

[0073] If not, execute other control processes;

[0074] If so, determine whether the cycle has started, i.e., check if the current running cycle has started; if so, record the switching time of the last task switch, T. last_switch If not, meaning the current period has not started, initialize the period and record the current time as the period start time T. start And update the switching time of the last task switch, T last_switch Then, the operation is suspended, waiting for the next task switching event to be triggered, which means returning to the step of obtaining task priority.

[0075] It should be noted that this involves checking if a running cycle already exists. The cycle status is typically represented by global variables or flags in the kernel scheduler.

[0076] When the first priority is high and the second priority is low, and the high-priority task has just finished executing or been interrupted, while the low-priority task is about to start, handling the execution cycle at this time can effectively capture key nodes in the system resource usage status. By checking whether the current execution cycle has started, the system can determine its own state. If the cycle has started, the switch time of the last task switch is recorded, which can accurately track the time interval of task switch, providing a data basis for calculating task execution duration, system idle time, etc. If the cycle has not started, the cycle is initialized, the current time is set as the cycle start time, and the time of the last task switch is updated, thereby establishing a new execution cycle start point and ensuring the consistency and accuracy of subsequent time parameter calculations. These operations ultimately serve to accurately calculate the system load rate, providing a reliable basis for system resource scheduling and performance optimization.

[0077] In another embodiment of the present invention, when the first priority is low priority and the second priority is high priority, the duration of the current running cycle and the cumulative idle time are calculated.

[0078] It should be noted that, Figure 3 In the process, if the new task is determined to be of low priority and the previous task is not deemed to be of high priority, then the process checks whether the old task is of low priority and the new task is of high priority. In practice, there is no specific order between these two checks; they can be performed simultaneously. If the old task is of low priority and the new task is of high priority, the process returns the priorities of both the old and new tasks.

[0079] Does the condition that the first priority is low and the second priority is high hold true in practical implementation?

[0080] The duration is calculated by the difference between the current time and the cycle start time to determine the time span of the running cycle. Next, the difference between the current time and the last task switch time is calculated to define the time range since the most recent task switch. Within this time range, the idle time generated by the cyclical execution of low-priority tasks is analyzed, and the idle time of all low-priority tasks is accumulated to obtain the cumulative idle time. When the duration reaches or exceeds the preset cycle length, the cycle is considered complete, and relevant time data is output, providing crucial information for subsequent load rate calculations and task scheduling strategy adjustments.

[0081] Get the current timestamp in real time and calculate the difference between it and the start time of the current running cycle.

[0082] Assume the current time T now The start time T of the current running cycle start The duration T of the current period duration =T now -T start .

[0083] Get the current time T now Switching time T from the last task switch last_switch Calculate the time difference between the two, ΔT = T now -T last_switch This time difference defines a time interval, which is used for subsequent analysis of the execution of low-priority tasks within this interval.

[0084] Within the time range of the time difference ΔT, the execution status of each low-priority task is monitored. The system can record the start and end times of tasks through the task scheduler. When a task is in a non-executing state (i.e., CPU idle), the idle time period is recorded, and the idle time of each low-priority task during its cyclic execution within the time difference is calculated.

[0085] Calculate the sum of the idle times of all low-priority tasks to obtain the cumulative idle time. The cumulative idle time reflects the total time that system resources are not occupied by low-priority tasks within a specific time range.

[0086] When the duration is not less than the preset cycle length, the recording cycle is completed, and the duration and the cumulative idle time are output.

[0087] By accurately calculating the duration and cumulative idle time, the system can accurately reflect the resource utilization level during its runtime. For example, in high-concurrency business scenarios, the system can use this data to determine whether the current load is too high, providing a quantitative basis for dynamically adjusting task scheduling strategies and avoiding system performance degradation caused by unreasonable resource allocation.

[0088] In another embodiment provided by the present invention, when calculating the idle time of each low-priority task, specifically:

[0089] For each low-priority task, calculate the number of times it will be executed within the time difference based on the task's execution cycle;

[0090] The idle time for each execution is calculated based on the task's execution duration and the execution cycle.

[0091] The idle time is calculated based on the number of executions and the idle duration.

[0092] For example, the system has 5 low-priority tasks, Task1 to Task5;

[0093] Task 1 executes every 1ms, with each execution taking 0.1ms, meaning the execution duration is 0.1ms and the execution cycle is 1ms; Task 2 executes every 2ms, with each execution taking 0.2ms; Task 3 executes every 4ms, with each execution taking 0.3ms; Task 4 executes every 8ms, with each execution taking 0.4ms; Task 5 executes every 16ms, with each execution taking 0.5ms.

[0094] Therefore, within a 16ms interval, Task1 will be executed a total of 16 times, with an execution time of 16 * 0.1 = 1.6ms;

[0095] Task 2 was executed a total of 8 times, with an execution time of 8 * 0.2 = 1.6 ms;

[0096] Task 3 was executed a total of 4 times, with an execution time of 4 * 0.3 = 1.2 ms;

[0097] Task 4 was executed twice, with an execution time of 2 * 0.4 = 0.8 ms.

[0098] Task 5 was executed once, with an execution time of 4 * 0.1 = 0.5 ms;

[0099] The execution time of all user tasks is 1.6 + 1.6 + 1.2 + 0.8 + 0.5 = 5.7 ms; the execution time of idle tasks is 16 - 5.7 = 10.3 ms, thus obtaining the accumulated idle time.

[0100] In another embodiment provided by the present invention, when calculating the load factor, specifically:

[0101] See Figure 4 This is a schematic diagram of the load rate calculation process provided in an embodiment of the present invention. The calculated cumulative idle time and duration data can be used for system performance analysis.

[0102] Get the cumulative idle time, i.e., the idle time and the duration of the cycle;

[0103] Determine if the idle time is greater than or equal to 0 and the period duration is greater than 0; the idle time must not be negative to ensure the reliability of the data source. A period duration greater than zero indicates that the period is valid.

[0104] When established, the real-time load rate is calculated based on the duration and the cumulative idle time;

[0105] If the condition is not met, i.e., the duration is less than 0 or the idle time is not greater than 0, a calculation error warning will be output and the error code will be displayed.

[0106] The load rate

[0107] T idle The cumulative idle time represents the accumulated time that the system spends running low-priority tasks within the current period. This value is obtained by accumulating the time difference between task switching events.

[0108] T duration The duration is the total duration from the start of the cycle to the current time, representing the overall time window of the system operation.

[0109] Time recording uses a high-precision hardware timer to avoid time drift and calculation errors.

[0110] The load factor is the proportion of non-idle time to the entire cycle:

[0111] When R load =0: The system is completely idle.

[0112] When R load =1: The system is completely occupied by high-priority tasks.

[0113] The calculated load rate is displayed in a graphical programming tool.

[0114] Data is uploaded by sending load rate data to the operators' control system via a LAN network.

[0115] By judging the duration and cumulative idle time, the accuracy of the data is ensured and the calculation accuracy is improved; by calculating the load rate in real time, the system load status is fully reflected, providing a basis for system optimization.

[0116] In another embodiment provided by the present invention, the method further includes:

[0117] The system outputs a corresponding level of alert based on the load rate and the preset alarm level range.

[0118] In the specific implementation of this embodiment, alarm level ranges are set as follows:

[0119] Normal operating range: R load ≤0.6;

[0120] Alarm status: 0.6 <R load ≤0.9;

[0121] Critical alarm status: R load >0.9;

[0122] Output corresponding prompts based on the load rate and alarm level range.

[0123] The alarm prompts are displayed graphically, highlighting the load rate status on the interface: green indicates a normal load rate, yellow indicates a load rate alarm, and red indicates a severe load rate alarm.

[0124] This application solution monitors the system load rate in real time to clearly understand the system's operating status, ensuring equipment reliability. An appropriate load rate guarantees the long-term healthy operation of the equipment, facilitating operators to monitor equipment health and provide early warnings of potential failures. Analyzing load rate data provides a basis for equipment capacity planning and upgrades, optimizing system resource allocation and avoiding over-design or resource waste.

[0125] An appropriate load factor can ensure that the device can respond quickly and reliably in the event of a failure, thereby improving the overall safety of the system operation.

[0126] This invention also provides a load factor calculation device for an autonomous and controllable DC control and protection device, see [link to relevant documentation]. Figure 5 This is a schematic diagram of the load rate calculation device of the autonomous and controllable DC control and protection device provided in an embodiment of the present invention. The device includes:

[0127] The trigger module is used to determine the first priority of the current task and the second priority of the task about to be run when a task switch is triggered;

[0128] The time module is used to calculate the duration of the current running cycle and the cumulative idle time when the first priority is low and the second priority is high.

[0129] The calculation module is used to calculate the real-time load rate based on the duration and the cumulative idle time.

[0130] It should be noted that the load rate calculation device for the autonomous and controllable DC control and protection device provided in the embodiments of the present invention can execute the load rate calculation method for the autonomous and controllable DC control and protection device described in any of the above embodiments. The specific functions of the load rate calculation device for the autonomous and controllable DC control and protection device will not be elaborated here.

[0131] See Figure 6 This is another structural schematic diagram of a load rate calculation device for an autonomous and controllable DC control and protection device provided in an embodiment of the present invention. The load rate calculation device for an autonomous and controllable DC control and protection device in this embodiment includes: a processor, a memory, and a computer program stored in the memory and executable on the processor, such as a load rate calculation program for an autonomous and controllable DC control and protection device. When the processor executes the computer program, it implements the steps in the above-described embodiments of the load rate calculation methods for autonomous and controllable DC control and protection devices, for example... Figure 1 The steps S1 to S3 are shown. Alternatively, when the processor executes the computer program, it implements the functions of each module in the above-described device embodiments.

[0132] For example, the computer program can be divided into one or more modules / units, which are stored in the memory and executed by the processor to complete the present invention. The one or more modules / units can be a series of computer program instruction segments capable of performing functions, which describe the execution process of the computer program in the load rate calculation device of the autonomous and controllable DC control and protection device. For example, the computer program can be divided into various modules, the specific functions of which will not be elaborated again.

[0133] The load rate calculation device for the autonomous and controllable DC control and protection device can be a desktop computer, laptop, handheld computer, or cloud server, etc. The load rate calculation device may include, but is not limited to, a processor and memory. Those skilled in the art will understand that the schematic diagram is merely an example of the load rate calculation device for the autonomous and controllable DC control and protection device and does not constitute a limitation on the device. It may include more or fewer components than shown in the diagram, or combine certain components, or use different components. For example, the load rate calculation device may also include input / output devices, network access devices, buses, etc.

[0134] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor. This processor is the control center of the load rate calculation device for the autonomous and controllable DC control and protection device, connecting all parts of the device via various interfaces and lines.

[0135] The memory can be used to store the computer program and / or modules. The processor realizes various functions of the load rate calculation device of the autonomous and controllable DC control and protection device by running or executing the computer program and / or modules stored in the memory and calling the data stored in the memory. The memory may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the mobile phone (such as audio data, phone book, etc.). In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.

[0136] The module / unit integrated into the load rate calculation device of the autonomous and controllable DC control and protection device, if implemented as a software functional unit and sold or used as an independent product, can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the above embodiments of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in code form, object code form, executable file, or some intermediate form. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc.

[0137] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention.

Claims

1. A method for calculating the load rate of an autonomous and controllable DC control and protection device, characterized in that, The method includes: When a task switch is triggered, the first priority of the current task and the second priority of the task about to be run are determined. When the first priority is low and the second priority is high, calculate the duration of the current running cycle and the cumulative idle time; Calculate the real-time load rate based on the duration and the cumulative idle time; The method further includes: When the first priority is high and the second priority is low, check whether the current running cycle has started; If the current cycle has already started, record the switching time of the last task switch; If the current cycle has not started, initialize the cycle, record the current time as the cycle start time, and update the switching time of the last task switch; Specifically, calculating the duration of the current running cycle and the cumulative idle time includes: The duration of the current running cycle is calculated based on the current time and the cycle start time of the current running cycle. Calculate the time difference between the current time and the time of the last task switch. Calculate the idle time of each low-priority task as it loops within the time difference; Calculate the sum of the idle times of all low-priority tasks to obtain the cumulative idle time; When the duration is not less than the preset cycle length, the recording cycle is completed, and the duration and the cumulative idle time are output.

2. The method for calculating the load rate of an autonomous and controllable DC control and protection device as described in claim 1, characterized in that, Determine the first priority of the current task and the second priority of the tasks to be run, specifically including: Get the first priority value preset when the current task was created and the second priority value preset when the task about to run was created; When the first priority value is greater than the preset priority threshold, the first priority is determined as low priority; otherwise, the first priority is determined as high priority. When the second priority value is greater than the priority threshold, the second priority is determined as low priority; otherwise, the second priority is determined as high priority.

3. The method for calculating the load rate of an autonomous and controllable DC control and protection device as described in claim 1, characterized in that, The calculation of the idle time of each low-priority task during its cyclic execution within the time difference includes: For each low-priority task, calculate the number of times it will be executed within the time difference based on the task's execution cycle; The idle time for each execution is calculated based on the task's execution duration and the execution cycle. The idle time is calculated based on the number of executions and the idle duration.

4. The method for calculating the load rate of the autonomous and controllable DC control and protection device as described in claim 1, characterized in that, The calculation of the real-time load rate based on the duration and the cumulative idle time includes: When the duration is less than the first preset value, or the cumulative idle time is not greater than the second preset value, a calculation error warning is output; When the duration is not less than the first preset value and the cumulative idle time is greater than the second preset value, the real-time load rate is calculated based on the duration and the cumulative idle time. Wherein, the load rate , T idle The cumulative idle time, T duration The duration is [the specified duration].

5. The method for calculating the load rate of an autonomous and controllable DC control and protection device as described in claim 1, characterized in that, The method further includes: The system outputs a corresponding level of alert based on the load rate and the preset alarm level range.

6. A load rate calculation device for an autonomous and controllable DC control and protection device, characterized in that, The device is used to execute the load rate calculation method for an autonomous and controllable DC control and protection device as described in any one of claims 1 to 5, the device comprising: The trigger module is used to determine the first priority of the current task and the second priority of the task about to be run when a task switch is triggered; The time module is used to calculate the duration of the current running cycle and the cumulative idle time when the first priority is low and the second priority is high. The calculation module is used to calculate the real-time load rate based on the duration and the cumulative idle time.

7. A load rate calculation device for an autonomous and controllable DC control and protection device, characterized in that, It includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor executes the computer program to implement the load rate calculation method for an autonomous and controllable DC control and protection device as described in any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to perform the load rate calculation method of the autonomous and controllable DC control and protection device as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Process CPU load monitoring method and system based on VxWorks system

    CN113282450A

  • Temperature energy consumption monitoring method based on light change and data center

    CN115585895A