An RTOS-based Adaptive Photovoltaic and Energy Storage Integrated Machine Task Scheduling System and Method
By building a task instruction matrix and rule link list, combining RTOS real-time data acquisition, multiple task conflicts in the adaptive optical storage all-in-one machine are identified and handled, the problems of unstable task scheduling and insufficient real-time performance in the existing technology are solved, and efficient and reliable task scheduling is achieved.
Patent Information
- Application Number
- CN202510615678.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-14
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2045-05-14
AI Technical Summary
The prior art has failed to effectively solve problems such as multi-type task conflicts, task conflicts caused by changes in user demand, memory resource competition, priority reversal, etc. in the task scheduling of adaptive optical storage all-in-one machines, resulting in insufficient system stability and real-time.
By building a task instruction matrix, identifying composite conflict instructions and performing two-dimensional matrix positioning, establishing a rule link, combining device status parameters and user operations, analyzing potential conflicts using a decision tree model, formulating dynamic scheduling strategies, and using RTOS to collect data in real time for quick response.
It improves the efficiency of task scheduling and the stability of the system, can timely identify and handle multiple conflict types, ensure the normal execution of high-priority tasks, avoid system crashes, and enhances the reliability and real-timeness of the system.
Smart Images

Figure CN120144261B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of task scheduling, and particularly relates to an adaptive integrated photovoltaic and energy storage machine task scheduling system and method based on RTOS. Background Art
[0002] With the development of new energy technologies, the efficiency and reliability of task scheduling for adaptive integrated photovoltaic and energy storage machines are crucial; the real-time operating system (RTOS), due to its strong real-time performance and multi-task scheduling capabilities, has become the mainstream platform for the control of integrated photovoltaic and energy storage machines. However, there are many deficiencies in the task scheduling of existing technologies for integrated photovoltaic and energy storage machines.
[0003] A Chinese patent application with the publication number CN112148475A discloses a task scheduling method and system for Loongson big data integrated machines considering comprehensive load and power consumption, including: constructing a relationship model between CPU power consumption and temperature, solving the problem of difficult real-time acquisition of CPU power consumption, and further, calculating the priorities of CPUs of each computing node according to the relationship model between CPU power consumption and temperature, CPU utilization rate, and temperature, and performing task scheduling on the task queue of the management node according to the priorities, which not only improves the parallel efficiency of Loongson big data integrated machines.
[0004] Existing technologies do not classify and locate multi-type task conflicts in adaptive integrated photovoltaic and energy storage machines. If the construction of a task instruction matrix and the combination of two-dimensional matrix to locate compound conflict instructions can alleviate the problem of scheduling policy failure caused by fuzzy conflict type recognition and improve system stability.
[0005] Existing technologies do not establish a rule chain by associating user operations with device status parameters, resulting in the inability to predict task conflicts caused by changes in user requirements, and the scheduling policy lacks adaptability at the user interaction level; if a rule chain is constructed by combining user operations with device status parameters, the problem of sudden conflicts caused by changes in user requirements can be alleviated.
[0006] Existing technologies do not design dynamic scheduling strategies for multiple conflict types according to the real-time requirements of integrated photovoltaic and energy storage machines, resulting in the inability to timely adjust the task execution order and resource allocation in scenarios such as memory resource competition and priority inversion.
[0007] Existing technologies do not design special strategies for specific conflicts in integrated photovoltaic and energy storage machines such as memory peak overrun, peripheral resource preemption, and safety task blocking. If a dynamic scheduling strategy based on a rule chain is adopted, the problem of system response delay or task blocking caused by a single scheduling policy can be alleviated, and the real-time scheduling efficiency can be improved.
[0008] Therefore, the present invention provides an adaptive integrated photovoltaic and energy storage machine task scheduling system and method based on RTOS. Summary of the Invention
[0009] The object of the present invention is to provide an RTOS-based adaptive integrated photovoltaic and energy storage unit task scheduling system and method to solve at least one of the above-mentioned prior art problems.
[0010] An RTOS-based adaptive integrated photovoltaic and energy storage unit task scheduling method includes the following steps:
[0011] Obtain the task instructions of the adaptive integrated photovoltaic and energy storage unit and construct a task instruction matrix;
[0012] Identify and analyze the task instruction matrix, determine the composite conflict instructions and perform two-dimensional matrix positioning analysis, and form a conflict instruction analysis group for the composite conflict instructions in the first quadrant;
[0013] Extract the user conflict instructions in the conflict instruction analysis group, obtain the device status parameters and perform regularization analysis on the user conflict instructions to determine the rule chain generated by the device status parameters and the user conflict instructions;
[0014] Establish a rule screening model, perform support degree and confidence analysis and screening on the rule chain, and construct a rule linked list;
[0015] Real-time collect the device status parameters and user conflict instructions, establish an instruction scheduling prediction model based on the conditional rules of the rule linked list, predict potential instruction conflicts and formulate a scheduling strategy.
[0016] As a further technical solution of the present invention: The method for performing two-dimensional matrix positioning analysis is as follows:
[0017] Obtain the historical task conflict instructions during the working cycle from the device log of the adaptive integrated photovoltaic and energy storage device RTOS, and identify the conflict types of the task instructions through the task instruction matrix;
[0018] If the task conflict instruction belongs to multiple conflict types at the same time, mark the task instruction conflict as a composite conflict instruction;
[0019] Calculate the average blocking cycle ratio of the task conflict instructions and the occurrence frequency of the task conflict instructions during the working cycle, and perform dimensionless processing on the average blocking cycle ratio and the occurrence frequency;
[0020] Construct a two-dimensional matrix with the average blocking cycle ratio as the vertical axis and the occurrence frequency as the horizontal axis, and locate the conflict instructions in the two-dimensional matrix according to the quadrant boundaries of the two-dimensional matrix.
[0021] As a further technical solution of the present invention: The method for determining the quadrant boundary is as follows:
[0022] Calculate the occurrence frequency boundaries F high 、F low ;
[0023] Calculate the mean and variance of the average blocking cycle ratio of task conflict instructions within the duty cycle, and calculate the boundary Rt of the average blocking cycle ratio high 、Rt low ;
[0024] Where F is the occurrence frequency and Rt is the average blocking cycle ratio.
[0025] As a further technical solution of the present invention: The method of positioning by coordinates is as follows:
[0026] First quadrant: ;
[0027] Second quadrant: ;
[0028] Third quadrant: ;
[0029] Fourth quadrant: ;
[0030] Where AND means that both the conditions of the average blocking cycle ratio and the occurrence frequency need to be satisfied.
[0031] As a further technical solution of the present invention: The method of determining the device state parameters and the rule chain generated by the user conflict instructions is as follows:
[0032] Obtain the task conflict instructions generated by actively controlling the adaptive optical storage integrated machine due to changes in user requirements in the conflict instruction analysis group;
[0033] Mark the task conflict instructions generated due to changes in user requirements as user conflict instructions;
[0034] Obtain the device state parameters of the adaptive optical storage integrated machine corresponding to the user conflict instructions, and analyze the rule chain generated by the device state parameters and the user conflict instructions through a decision tree model;
[0035] Where the rule chain includes preconditions and judgment results.
[0036] As a further technical solution of the present invention: The method of constructing the rule linked list is as follows:
[0037] Obtain all the rule chains generated by the decision tree, establish a rule screening model to screen the rule chains, and obtain effective rule chains;
[0038] Based on the effective rule chains, establish a rule linked list.
[0039] As a further technical solution of the present invention: The steps of establishing the rule screening model are as follows:
[0040] S401. Filter invalid rule chains through support and confidence;
[0041] S402. Redundant rule detection and merging;
[0042] S403. Contradictory rule detection and correction.
[0043] As a further technical solution of the present invention: The method for obtaining the support and confidence is as follows:
[0044] Obtain all rule chains, and perform a ratio process on the number of rule chains that simultaneously meet the preconditions and judgment results and all rule chains to obtain the support;
[0045] Perform a ratio process on the number of rule chains that simultaneously meet the preconditions and judgment results and the number of all rule chains that meet the preconditions to obtain the confidence.
[0046] As a further technical solution of the present invention: The method for predicting potential instruction conflicts and formulating a scheduling strategy is as follows:
[0047] Real-time collect device status parameters through RTOS, and capture user conflict instructions through the human-computer interaction interface of the adaptive energy storage integrated machine;
[0048] Use the conditional rules of the rule linked list as the training set and test set of the instruction scheduling prediction model, and construct an instruction scheduling prediction model through the neural network algorithm;
[0049] Convert the real-time collected device status parameters and user conflict instructions into the preconditions of the rule chain, and input the preconditions into the instruction scheduling prediction model to predict whether the judgment results corresponding to the rule chain will be generated;
[0050] If the judgment results corresponding to the rule chain will be generated, formulate a scheduling strategy.
[0051] An RTOS-based task scheduling system for an adaptive energy storage integrated machine includes the following modules:
[0052] Matrix construction module: used to obtain the task instructions of the adaptive energy storage integrated machine and construct a task instruction matrix;
[0053] Conflict analysis module: used to identify and analyze the task instruction matrix, determine compound conflict instructions and perform two-dimensional matrix positioning analysis, and form a conflict instruction analysis group for the compound conflict instructions in the first quadrant;
[0054] Rule construction module: used to extract the user conflict instructions in the conflict instruction analysis group, obtain the device status parameters and perform rule-based analysis on the user conflict instructions to determine the rule chain generated by the device status parameters and the user conflict instructions;
[0055] Rule screening module: used to establish a rule screening model, analyze and screen the support and confidence of the rule chain, and construct a rule linked list;
[0056] Policy construction module: used to collect device status parameters and user conflict instructions in real time, establish an instruction scheduling prediction model based on the conditional rules of the rule linked list, predict potential instruction conflicts and formulate a scheduling policy.
[0057] Advantages of the present invention:
[0058] 1. The efficient real-time scheduling mechanism of the RTOS kernel is the basic guarantee for the real-time performance of the present invention; by creating a task listening thread in the RTOS to listen to the underlying device data information, it can quickly identify the instruction execution parameters, obtain task instructions in real time, reflecting the RTOS's fast response ability to the underlying data; when processing task conflict instructions, the system can timely obtain historical conflict instructions from the device log, quickly identify the conflict type, perform two-dimensional matrix positioning analysis on the compound conflict instructions, and screen out the conflict instruction analysis group; in the stage of formulating the scheduling policy, the RTOS collects device status parameters and user conflict instructions in real time, quickly predicts potential conflicts based on the rule linked list and makes scheduling decisions. For example, when detecting a memory resource competition conflict, it timely pauses or delays low-priority management tasks to release memory, ensuring the operation of high-priority security tasks, and making timely responses to task conflict instructions and user operations, greatly improving the scheduling efficiency;
[0059] 2. By identifying conflict types such as memory resource competition, priority inversion, and timing synchronization, the system can take timely measures to prevent the expansion of errors; for memory resource competition conflicts, the system can timely adjust task execution to avoid system crashes caused by memory overflows; for priority inversion conflicts, the priority inheritance protocol is adopted to ensure the smooth execution of high-priority tasks; at the same time, in the process of rule chain screening, through support and confidence analysis, redundant and contradictory rule processing, the accuracy and stability of the rule linked list are guaranteed, improving the overall reliability of the system. Description of the drawings
[0060] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0061] Figure 1 is the flowchart of a task scheduling method for an adaptive optical storage integrated machine based on RTOS provided by the present invention;
[0062] Figure 2 is the flowchart of the construction method of the rule screening model provided by the present invention;
[0063] Figure 3 It is a module diagram of a task scheduling system for an adaptive optical storage integrated machine based on RTOS provided by the present invention. Specific embodiments
[0064] In order to enable those skilled in the art to better understand the solution of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0065] Embodiment 1: As Figure 1 shown, a task scheduling method for an adaptive optical storage integrated machine based on RTOS provided by an embodiment of the present invention includes the following steps:
[0066] S1. Obtain a task instruction of the adaptive optical storage integrated machine, extract the operation characteristics of the task instruction, and construct a task instruction matrix;
[0067] The construction method of the task instruction matrix is as follows:
[0068] In some embodiments, a task listening thread is created in a real-time operating system (RTOS) to listen to the data information of the underlying device and identify the instruction execution parameters of the adaptive optical storage integrated machine;
[0069] Preferably, the instruction execution parameters include: the number of the instruction, the execution period of the instruction, the memory peak value of the instruction execution, and the peripheral dependency bit mask of the instruction execution;
[0070] According to the operation characteristics of the adaptive optical storage integrated machine, the task instructions are divided into security tasks, communication tasks, and management tasks;
[0071] Preferably, the security tasks include: the energy storage charge and discharge control instruction, the insulation detection instruction, and the photovoltaic power generation control instruction of the adaptive optical storage integrated machine;
[0072] The communication tasks include: the Modbus protocol parsing instruction and the BMS data reporting instruction;
[0073] The management tasks include: the energy measurement of the adaptive optical storage integrated machine and the storage of fault logs;
[0074] Based on different task instruction classifications, different task priorities are set;
[0075] Preferably, the priority of the security task is 1, the priority of the communication task is 2, and the priority of the management task is 3;
[0076] Obtain the instruction execution parameters and task priorities of a single instruction task, and establish a task instruction matrix;
[0077] S2. Obtain task conflict instructions, identify and analyze them with the task instruction matrix to determine compound conflict instructions, perform two-dimensional matrix positioning analysis on the compound conflict instructions, and form a conflict instruction analysis group for the compound conflict instructions in the first quadrant;
[0078] Obtain historical task conflict instructions during the working cycle through the device log of the adaptive optical storage integrated device RTOS, and identify the conflict types of task instructions through the task instruction matrix;
[0079] Those skilled in the art can understand that a task conflict instruction refers to a task instruction that causes the system to run incorrectly or abnormally due to problems such as resource competition and priority inversion among multiple tasks during the operation of the adaptive optical storage integrated machine;
[0080] Exemplarily, the conflict types are divided into resource competition conflict identification, priority inversion conflict identification, and timing synchronization conflict identification;
[0081] Among them, resource competition conflicts include memory resource competition and peripheral resource competition;
[0082] S201. The identification method for resource competition conflicts is as follows:
[0083] For memory resource competition conflicts, by checking the memory peak values of each task execution in the task instruction matrix, if the total memory required by multiple historical conflict task instructions exceeds the available memory of the system when their execution times overlap, there is a memory resource competition conflict;
[0084] S202. The identification method for peripheral resource competition conflicts is as follows:
[0085] For peripheral resource competition conflicts: According to the peripheral dependency bit mask in the task instruction matrix, if multiple historical conflict task instructions depend on the same peripheral and their execution times overlap, there is a peripheral resource competition conflict;
[0086] S203. The identification method for priority inversion conflicts is as follows:
[0087] For priority inversion conflicts: By comparing the priorities and actual execution orders of historical conflict task instructions, if a low-priority task holds the resources required by a high-priority task, causing the high-priority task to be blocked and the low-priority task to continue execution, it is a priority inversion conflict;
[0088] S^{204}. The identification method for timing synchronization conflicts is as follows:
[0089] Timing synchronization conflict: Analyze the execution cycle and time of historical conflict task instructions. If the task execution order or time interval does not meet the system design requirements, resulting in incorrect or abnormal execution results, it belongs to the timing synchronization conflict;
[0090] If the task conflict instruction belongs to multiple conflict types at the same time, mark the task instruction conflict as a composite conflict instruction;
[0091] Obtain the composite conflict instructions among all task conflict instructions, calculate the average blocking cycle ratio of the composite conflict instructions, as well as the occurrence frequency of task conflict instructions within the working cycle, and perform dimensionless processing on the average blocking cycle ratio and the occurrence frequency;
[0092] It should be noted that the occurrence frequency is obtained by calculating the ratio of the number of occurrences of the conflict instruction within the system working cycle; the average blocking cycle ratio is the proportion of the time that the same task conflict instruction causes task blocking on average to the instruction execution cycle;
[0093] Among them, the same task conflict instruction means that the instruction numbers in the instruction execution fingerprint are the same;
[0094] Construct a two-dimensional matrix with the average blocking cycle ratio as the vertical axis and the occurrence frequency as the horizontal axis, and locate the conflict instructions in the two-dimensional matrix according to the quadrant boundaries of the two-dimensional matrix;
[0095] Among them, for the two-dimensional matrix, the first quadrant is high average blocking cycle ratio and high occurrence frequency; the second quadrant is high average blocking cycle ratio and low occurrence frequency; the third quadrant is low average blocking cycle ratio and low occurrence frequency; the fourth quadrant is low average blocking cycle ratio and high occurrence frequency;
[0096] The determination method of the quadrant boundary is:
[0097] Through the formula: Obtain the occurrence frequency boundary F high 、F[[ID=2
[29] ] low ;
[0098] Among them, F is the occurrence frequency, are respectively the mean and variance of the occurrence frequency of task conflict instructions within the working cycle;
[0099] Through the formula: Obtain the boundary Rt of the average blocking cycle ratio high 、Rt low ;
[0100] Among them, Rt is the average blocking cycle ratio, are respectively the mean and variance of the average blocking cycle ratio of task conflict instructions within the working cycle;
[0101] The method of coordinate positioning is:
[0102] The first quadrant: ;
[0103] The second quadrant: ;
[0104] The third quadrant: ;
[0105] The fourth quadrant: ;
[0106] Those skilled in the art can understand that AND means that both the conditions of the average blocking cycle ratio and the occurrence frequency need to be satisfied simultaneously. For example, for the and of the task conflict instruction can it be classified into the first quadrant;
[0107] Obtain the composite conflict instructions in the first quadrant and form a conflict instruction analysis group;
[0108] It should be further noted that the role of forming the conflict instruction analysis group is as follows:
[0109] Function 1: Focus on the core conflict instructions with high impact and high frequency. Through multi-dimensional analysis of historical task conflict instructions (such as conflict type identification, average blocking cycle ratio calculation, occurrence frequency statistics), combined with two-dimensional matrix positioning, screen out the composite conflict instructions located in the first quadrant (that is, the conflict instructions with both high average blocking cycle ratio and high occurrence frequency); such instructions have the most significant impact on system operation (such as frequently causing task blocking and occupying key resources), and have a high occurrence probability, which are the main factors leading to system efficiency decline or failure. Forming an analysis group can concentrate resources on such core conflicts and avoid being distracted by low-impact and low-frequency marginal problems;
[0110] Function 2: Provide a precise target object for rule-based analysis. The conflict instruction analysis group serves as the core data basis for establishing the rule chain of "device status + user operation to conflict type" later, ensuring that the construction of the rule chain focuses on the actual high-frequency and significant conflict scenarios. For example, through the composite conflict instructions in the analysis group (such as the user charging operation involving both memory competition and priority inversion), key features (such as high SOC and low load power) can be extracted, and then a targeted rule chain (such as "when SOC > 90% and the user is charging, trigger the memory resource competition conflict") can be generated through models such as decision trees, making the rule chain more in line with the actual working conditions and avoiding the interference of invalid or redundant rules.
[0111] The technical solution of this embodiment is as follows: Obtain the task instructions of the adaptive optical storage integrated machine, extract the operation characteristics of the task instructions, and construct a task instruction matrix; Obtain the task conflict instructions, identify and analyze them with the task instruction matrix, determine the composite conflict instructions, perform two-dimensional matrix positioning analysis on the composite conflict instructions, and form a conflict instruction analysis group for the composite conflict instructions in the first quadrant, which focuses on high-risk and high-frequency task conflict instructions and provides the core target object for subsequent conflict analysis and scheduling strategy formulation.
[0112] Embodiment 2: As Figure 1 shown, a task scheduling method for an adaptive optical storage integrated machine based on RTOS further includes the following steps:
[0113] S3. Extract the user conflict instructions within the conflict instruction analysis group and the corresponding device status parameters, and perform rule-based analysis on the user conflict instructions in combination with the device status parameters to determine the rule chain generated by the device status parameters and the user conflict instructions;
[0114] Obtain the task conflict instructions generated by actively controlling the adaptive optical storage integrated machine due to changes in user requirements in the conflict instruction analysis group;
[0115] It should be noted that the user can control the adaptive optical storage integrated machine through the man-machine interface of the adaptive optical storage integrated machine, control photovoltaic power generation and energy storage charging and discharging. RTOS converts the user's control requirements into instructions and compares them with the instructions being executed in the current system to identify task conflict instructions;
[0116] Mark the task conflict instructions generated due to changes in user requirements as user conflict instructions;
[0117] Obtain the device status parameters of the adaptive optical storage integrated machine corresponding to the user conflict instructions;
[0118] Among them, the device status parameters include: the state of charge of the energy storage battery, load power, device temperature, task instruction matrix, conflict type;
[0119] Analyze the rule chain generated by the device status parameters and the user conflict instructions through a decision tree model;
[0120] Among them, the rule chain includes preconditions and judgment results;
[0121] Exemplarily, for rule chain 1, when the state of charge (SOC) of the energy storage battery is higher than 90%, and the load power is less than 2kW, and at the same time the user initiates an energy storage charging operation, a memory resource competition conflict occurs;
[0122] Then the precondition is: when the state of charge (SOC) of the energy storage battery is higher than 90%, and the load power is less than 2kW, and at the same time the user initiates an energy storage charging operation;
[0123] The judgment result is: a memory resource competition conflict occurs;
[0124] For rule chain 2, if the photovoltaic output power is higher than 10 kW and the system is performing the Modbus protocol parsing task, when the user performs the photovoltaic power generation power adjustment operation, a peripheral resource competition conflict occurs;
[0125] For rule chain 3, when the temperature of the energy storage battery is higher than 40 °C and the system is executing the energy storage charge and discharge control instruction (safety task), when the user initiates the fault log storage operation (management task), a priority inversion conflict occurs;
[0126] Those skilled in the art can understand that by establishing a rule chain of "device status + user operation to conflict type" through a decision tree model, by collecting historical data including device status parameters (such as energy storage battery SOC, load power, task instruction matrix), user operations (such as charge control, mode switching) and corresponding conflict types, after data cleaning, feature encoding (such as numericalizing the operation type) and normalization preprocessing, using the CART or C4.5 algorithm to train the model, recursively partitioning the features (device status, user operation) based on the information gain criterion to generate a tree structure, and finally extracting intuitive conditional rules from the nodes and branches of the tree;
[0127] For example, when the SOC > 90% and the user triggers the charging operation, the result is a memory resource competition conflict, forming a rule chain reflecting the combination of device status and user operation leading to a specific conflict type.
[0128] It should be noted that the function of establishing the rule chain is as follows:
[0129] Function 1. Identify potential conflicts. The rule chain can associate device status parameters (such as the state of charge of the energy storage battery, load power, etc.) with user conflict instructions, and identify potential task conflicts by analyzing the logical relationship between the two;
[0130] Function 2. Implement predictive scheduling of conflicts. With the help of the rule chain, the system can predict possible task conflicts in the future. After real-time collecting the device status and user instructions and matching them with the rule chain, if the preconditions of the rule chain are met, the corresponding conflict type can be predicted.
[0131] Function 3: Enhance the maintainability and scalability of the system. The rule chain stores the relationships among device states, user operations, and conflict types in a structured manner, making it more convenient to maintain and expand the system. When the system needs to add new functions or adapt to new device states, only the corresponding rules need to be added to the rule chain, without the need for large-scale modification of the entire scheduling system. At the same time, the existence of the rule chain also makes it easier to debug and optimize the system. Developers can analyze the rule chain to identify problems in the system and make improvements.
[0132] S4. Establish a rule screening model, analyze and screen the rule chain for support and confidence, and construct a rule linked list;
[0133] Obtain all the rule chains generated by the decision tree, establish a rule screening model to screen the rule chain, and obtain the effective rule chains;
[0134] As Figure 2 shown, the construction method of the rule screening model is:
[0135] S401. Filter out invalid rule chains through support and confidence;
[0136] Calculate all the rule chains generated by the decision tree, calculate the support of all the rule chains and the confidence of all the rule chains;
[0137] Among them, to obtain all the rule chains, the ratio of the number of rule chains that simultaneously meet the preconditions and judgment results to all the rule chains is processed to obtain the support;
[0138] Exemplarily, among 100 samples, the number of rule chains that simultaneously meet SOC>90%, charging operation, and conflict type of memory conflict is 10, and the total number of all rule chains is 100;
[0139] The ratio of the 10 samples that simultaneously meet SOC>90%, charging operation, and conflict type of memory conflict to the total 100 samples is processed to obtain a support of 10%;
[0140] The ratio of the number of rule chains that simultaneously meet the preconditions and judgment results to the number of all rule chains that meet the preconditions is processed to obtain the confidence;
[0141] Exemplarily, the total number of rule chains that meet the preconditions of SOC>80% and the user initiates a charging operation is 30. Among the 30 rule chains that meet the preconditions, the number of rule chains that simultaneously meet the judgment result of memory resource competition conflict is 25;
[0142] The ratio of the 25 rule chains that simultaneously meet the preconditions and judgment results to the 30 rule chains that meet the preconditions is processed to obtain a confidence of 83.3%;
[0143] Compare the support and confidence of the rule chain with the preset support threshold and confidence threshold respectively;
[0144] If both the support and confidence of the rule chain are greater than or equal to the preset support threshold and confidence threshold, the rule is considered valid; otherwise, it is considered invalid;
[0145] Preferably, rule chain A: SOC > 90% + charging operation causes memory conflict, support 10%, confidence 90%, where the support threshold and confidence threshold are 5% and 80% respectively;
[0146] Since both the support and confidence of the rule chain of rule chain A are greater than the preset support threshold and confidence threshold, rule chain A is valid;
[0147] Rule chain B: temperature > 45°C + discharging operation causes timing conflict, support 2%, confidence 60%;
[0148] Since both the support and confidence of the rule chain of rule chain B are lower than the preset support threshold and confidence threshold, rule chain B is invalid;
[0149] S402, redundant rule detection and merging;
[0150] If multiple rule chains have a conditional inclusion relationship and the results of the rule chains are the same, merge the multiple rule chains to reduce the duplication of rule chains;
[0151] Preferably, rule chain 1: SOC > 95% + charging operation, causes memory conflict, support 5%, confidence 95%;
[0152] Rule chain 2: SOC > 90% + charging operation, causes memory conflict, support 8%, confidence 92%;
[0153] Since the condition of rule chain 1 is a subset of rule chain 2 (95% > 90%) and the results are the same, they can be merged into "SOC > 90% + charging operation, causes memory conflict", and the condition range with higher support is retained;
[0154] S403, contradictory rule detection and correction;
[0155] Since the same condition combination corresponds to different conflict types, correct the rule chain through confidence and domain logic;
[0156] Preferably, rule chain 3: load > 8kW + mode switching, causes peripheral conflict, support 6%, confidence 85%;
[0157] Rule chain 4: Load > 8kW + mode switching, resulting in priority inversion, support degree 3%, confidence level 70%;
[0158] Since the confidence level of rule chain 3 is higher and it conforms to the domain logic where peripheral competition is more common under high load, rule chain 3 is retained and rule chain 4 is deleted;
[0159] Through the rule screening model, filter out the effective rule chains that conform to the rule screening model to obtain a rule link list;
[0160] It should be noted that the function of filtering out the effective rule chains that conform to the rule screening model is as follows:
[0161] Function 1. Improve the accuracy of the scheduling strategy and remove low-reliability rules: The rule screening model can eliminate those rule chains that occur accidentally and have weak relevance through indicators such as support degree and confidence level;
[0162] Function 2. Enhance the stability and reliability of the system: The rule screening process can identify and handle redundant and contradictory rules in the rule chains. Redundant rules will increase the complexity of the system, while contradictory rules will lead to chaotic scheduling decisions. By merging similar rules and correcting contradictory results, the rule chains become clearer and more consistent, reducing system failures caused by rule conflicts and enhancing the stability of the system.
[0163] Function 3. Facilitate the maintenance and expansion of the system. After screening out the effective rule chains, the rule system is more concise and clear, facilitating developers to maintain and manage; developers can more easily understand and modify the rule chains, and timely discover and solve potential problems.
[0164] S5. Real-time collect device status parameters and user conflict instructions through RTOS, and based on the conditional rules of the rule link list, establish an instruction scheduling prediction model to predict potential instruction conflicts and formulate a scheduling strategy;
[0165] Real-time collect device status parameters through RTOS, and capture user conflict instructions through the human-machine interface of the adaptive integrated energy storage and photovoltaic system;
[0166] Use the conditional rules of the rule link list as the training set and test set of the instruction scheduling prediction model, and build an instruction scheduling prediction model through the neural network algorithm;
[0167] Those skilled in the art can understand that firstly, the device state parameters (such as the SOC of the energy storage battery, the load power, the device temperature, etc.) and the user conflict instructions are collected in real time through the RTOS, converted into the preconditions of the rule chain, and subjected to feature encoding (such as numericalizing the user operation type) and normalization preprocessing; then, the conditional rules in the rule linked list are used as the training set and the test set, input into the neural network for training, and the model parameters are adjusted through the optimization algorithm, enabling the optimization algorithm to learn the mapping relationship from the device state + user operation to the conflict type; after the training is completed, the device state and user instructions collected in real time are converted into input features recognizable by the model, and input into the neural network model to predict whether the conflict judgment result corresponding to the rule chain is generated; if a potential conflict is predicted, the corresponding scheduling strategy (such as pausing low-priority tasks, adjusting resource allocation, optimizing task timing) is called according to the conflict type (such as memory resource competition, priority inversion, etc.) to achieve dynamic prediction and active scheduling of the task conflicts of the adaptive optical storage integrated machine;
[0168] Convert the device state parameters and user conflict instructions collected in real time into the preconditions of the rule chain, and input the preconditions into the instruction scheduling prediction model to predict whether the judgment result corresponding to the rule chain is generated;
[0169] If the judgment result corresponding to the rule chain will be generated, formulate the corresponding scheduling strategy;
[0170] Preferably, the resource competition conflict scheduling strategy:
[0171] If it is a memory resource competition: If a memory resource competition conflict is predicted, low-priority management tasks (such as fault log storage, energy measurement) can be paused or delayed to release the memory resources; memory optimization is performed on high-priority security tasks (such as energy storage charge and discharge control, photovoltaic power generation control) to ensure their normal operation;
[0172] Peripheral resource competition: For peripheral resource competition conflicts, the synchronization mechanism of the RTOS (such as semaphores, mutexes) can be used to coordinate the use of the same peripheral by different tasks. The peripheral resources are preferentially allocated to high-priority tasks to avoid multiple tasks accessing the same peripheral simultaneously;
[0173] Priority inversion conflict scheduling strategy: When a priority inversion conflict is predicted, the priority inheritance protocol can be adopted; that is, temporarily raise the priority of the low-priority task holding the resources required by the high-priority task to enable it to complete the task and release the resources as soon as possible, thus avoiding the high-priority task being blocked for a long time;
[0174] Timing synchronization conflict scheduling strategy; If a timing synchronization conflict is predicted, the execution time and order of the tasks can be adjusted; for example, reschedule the start time of the tasks to ensure that the tasks are executed according to the timing requirements designed by the system; or introduce a synchronization mechanism (such as event flags, timers) to ensure the synchronization between tasks.
[0175] The technical solution of this embodiment is as follows: Extract the user conflict instructions within the conflict instruction analysis group and the corresponding device status parameters, perform a regularization analysis on the user conflict instructions in combination with the device status parameters, and determine the rule chain generated by the device status parameters and the user conflict instructions; establish a rule screening model, perform support degree and confidence analysis and screening on the rule chain, and construct a rule linked list; collect the device status parameters and user conflict instructions in real time through RTOS, and based on the conditional rules of the rule linked list, establish an instruction scheduling prediction model to predict potential instruction conflicts and formulate a scheduling strategy.
[0176] Embodiment 3: As Figure 3 shown, an adaptive photovoltaic and energy storage integrated machine task scheduling system based on RTOS includes the following modules:
[0177] Matrix construction module: used to obtain the task instructions of the adaptive photovoltaic and energy storage integrated machine, extract the operation characteristics of the task instructions and construct a task instruction matrix;
[0178] Conflict analysis module: used to obtain task conflict instructions and identify and analyze them with the task instruction matrix, determine compound conflict instructions, perform two-dimensional matrix positioning analysis on the compound conflict instructions, and form a conflict instruction analysis group for the compound conflict instructions in the first quadrant;
[0179] Rule construction module: used to extract the user conflict instructions within the conflict instruction analysis group and the corresponding device status parameters, perform a regularization analysis on the user conflict instructions in combination with the device status parameters, and determine the rule chain generated by the device status parameters and the user conflict instructions;
[0180] Rule screening module: used to establish a rule screening model, perform support degree and confidence analysis and screening on the rule chain, and construct a rule linked list;
[0181] Policy construction module: used to collect the device status parameters and user conflict instructions in real time through RTOS, and based on the conditional rules of the rule linked list, establish an instruction scheduling prediction model to predict potential instruction conflicts and formulate a scheduling strategy.
[0182] The above has described an embodiment of the present invention in detail, but the content described is only a preferred embodiment of the present invention and cannot be considered as limiting the scope of implementation of the present invention. All equivalent changes and improvements made according to the scope of the present invention application should still fall within the scope covered by the patent of the present invention.
Claims
1. An RTOS-based task scheduling method for an adaptive integrated energy storage and photovoltaic system, characterized in that, It includes the following steps: Obtain the task instructions of the adaptive integrated energy storage system, and construct a task instruction matrix; Identify and analyze the task instruction matrix, determine the compound conflict instructions and perform two-dimensional matrix positioning analysis, and form a conflict instruction analysis group for the compound conflict instructions in the first quadrant; The method for performing two-dimensional matrix positioning analysis is as follows: Obtain the historical task conflict instructions during the working cycle from the device logs of the adaptive integrated energy storage device RTOS, and identify the conflict types of the task instructions through the task instruction matrix; If the task conflict instructions belong to multiple conflict types at the same time, mark the task instruction conflict as a compound conflict instruction; Calculate the average blocking cycle ratio of the task conflict instructions and the occurrence frequency of the task conflict instructions during the working cycle; Construct a two-dimensional matrix with the average blocking cycle ratio as the vertical axis and the occurrence frequency as the horizontal axis, and locate the conflict instructions in the two-dimensional matrix according to the quadrant boundaries of the two-dimensional matrix; The method for determining the quadrant boundaries is as follows: Calculate the frequency boundary F by the mean and variance of the occurrence frequency of task conflict instructions within the working cycle high and F low ; Calculate the boundary \(R_t\) of the average blocking cycle ratio by calculating the mean and variance of the average blocking cycle ratio of task conflict instructions within the duty cycle high , \(R_t\) low ; Where F is the occurrence frequency and Rt is the average blocking cycle ratio; The coordinate-based positioning method is as follows: First quadrant: ; Second quadrant: ; Third quadrant: ; Fourth quadrant: ; Among them, AND means that both conditions of the average blocking cycle ratio and the occurrence frequency need to be satisfied at the same time; Obtain the compound conflict instructions in the first quadrant and form a conflict instruction analysis group; Extract the user conflict instructions in the conflict instruction analysis group, obtain the device state parameters and perform regularization analysis on the user conflict instructions to determine the rule chain generated by the device state parameters and the user conflict instructions; The method for determining the rule chain generated by the device state parameters and the user conflict instructions is as follows: Obtain the task conflict instructions generated by actively controlling the adaptive integrated energy storage system due to changes in user requirements in the conflict instruction analysis group; Mark the task conflict instructions generated due to changes in user requirements as user conflict instructions; Obtain the device state parameters of the adaptive integrated energy storage system corresponding to the user conflict instructions, and analyze the rule chain generated by the device state parameters and the user conflict instructions through a decision tree model; Among them, the rule chain includes preconditions and judgment results; Establish a rule screening model, perform support and confidence analysis and screening on the rule chain, and construct a rule linked list; Real-time collect the device state parameters and user conflict instructions, establish an instruction scheduling prediction model based on the conditional rules of the rule linked list, predict potential instruction conflicts and formulate a scheduling strategy.
2. The task scheduling method of an adaptive optical storage integrated machine based on RTOS according to claim 1, wherein The method for constructing the rule linked list is as follows: Obtain all the rule chains generated by the decision tree, establish a rule screening model to screen the rule chains, and obtain the effective rule chains; Establish a rule linked list based on the effective rule chains.
3. The task scheduling method of an adaptive optical storage integrated machine based on RTOS according to claim 2, characterized in that, The steps for establishing the rule screening model are as follows: S4**01**: Filter out invalid rule chains through support and confidence; S4**02**: Redundant rule detection and merging; S4**03**: Contradictory rule detection and correction.
4. The task scheduling method of an adaptive optical storage integrated machine based on RTOS according to claim 3, wherein The method for obtaining the support and confidence is as follows: Obtain all the rule chains, perform ratio processing on the number of rule chains that simultaneously meet the preconditions and judgment results and all the rule chains to obtain the support; Perform ratio processing on the number of rule chains that simultaneously meet the preconditions and judgment results and the number of all rule chains that meet the preconditions to obtain the confidence.
5. The task scheduling method of an adaptive optical storage integrated machine based on RTOS according to claim 1, characterized in that The method for predicting potential instruction conflicts and formulating a scheduling strategy is as follows: Real-time collect device status parameters through RTOS, and capture user conflict instructions through the human-machine interface of the adaptive optical storage integrated machine; Use the conditional rules in the rule linked list as the training set and test set of the instruction scheduling prediction model, and build an instruction scheduling prediction model through neural network algorithms; Convert the real-time collected device status parameters and user conflict instructions into the preconditions of the rule chain, and input the preconditions into the instruction scheduling prediction model to predict whether the judgment results corresponding to the rule chain will be generated; If the judgment results corresponding to the rule chain will be generated, formulate a scheduling strategy.
6. An RTOS-based adaptive integrated photovoltaic and energy storage task scheduling system is used to implement an RTOS-based adaptive integrated photovoltaic and energy storage task scheduling method according to any one of claims 1-5, characterized in that, It includes the following modules: Matrix construction module: used to obtain the task instructions of the adaptive optical storage integrated machine and construct a task instruction matrix; Conflict analysis module: used to identify and analyze the task instruction matrix, determine compound conflict instructions and perform two-dimensional matrix positioning analysis, and form a conflict instruction analysis group for the compound conflict instructions in the first quadrant; The method for performing two-dimensional matrix positioning analysis is as follows: Obtain historical task conflict instructions during the working cycle from the device logs of the adaptive optical storage integrated device RTOS, and identify the conflict types of task instructions through the task instruction matrix; If the task conflict instructions belong to multiple conflict types at the same time, mark the task instruction conflicts as compound conflict instructions; Calculate the average blocking cycle ratio of task conflict instructions and the occurrence frequency of task conflict instructions during the working cycle; Construct a two-dimensional matrix with the average blocking cycle ratio as the vertical axis and the occurrence frequency as the horizontal axis, and locate the conflict instructions in the two-dimensional matrix according to the quadrant boundaries of the two-dimensional matrix; The method for determining the quadrant boundaries is as follows: Calculate the frequency boundaries F high and F low through the mean and variance of the occurrence frequency of task conflict instructions within the working cycle; high 、F low ; Calculate the boundary Rt of the average blocking cycle ratio by calculating the mean and variance of the average blocking cycle ratio of task conflict instructions within the duty cycle high 、Rt low ; Where F is the occurrence frequency and Rt is the average blocking cycle ratio; The method for positioning by coordinates is as follows: First quadrant: ; Second quadrant: ; Third quadrant: ; Fourth quadrant: ; Among them, AND means that the conditions of the average blocking cycle ratio and the occurrence frequency need to be satisfied simultaneously; Obtain the compound conflict instructions in the first quadrant and form a conflict instruction analysis group; Rule construction module: used to extract the user conflict instructions in the conflict instruction analysis group, obtain device status parameters and perform rule-based analysis on the user conflict instructions to determine the rule chain generated by the device status parameters and user conflict instructions; The method for determining the rule chain generated by the device status parameters and user conflict instructions is as follows: Obtain the task conflict instructions generated by actively controlling the adaptive optical storage integrated machine due to changes in user requirements in the conflict instruction analysis group; Mark the task conflict instructions generated due to changes in user requirements as user conflict instructions; Obtain the device status parameters of the adaptive optical storage integrated machine corresponding to the user conflict instructions, and analyze the rule chain generated by the device status parameters and user conflict instructions through a decision tree model; Among them, the rule chain includes preconditions and judgment results; Rule screening module: used to establish a rule screening model, perform support and confidence analysis and screening on the rule chain, and construct a rule linked list; Strategy construction module: used to collect device status parameters and user conflict instructions in real time, establish an instruction scheduling prediction model based on the conditional rules of the rule linked list, predict potential instruction conflicts and formulate a scheduling strategy.
Citation Information
Patent Citations
Loongson big data all-in-one machine task scheduling method and system integrating load and power consumption
CN112148475A
METHOD AND APPARATUS FOR PRIORITY AND COLLISION Rules FOR COLLISION LOCATION STATE INFORMATION (PSI) REPORTING
CN115088323A
Rule generation method and device, storage medium and equipment
CN116702756A