RTOS-based adaptive optical storage all-in-one machine task scheduling system and method
By building a task instruction matrix and rule chain, combining device status and user operation, a task scheduling strategy for adaptive optical storage all-in-one machines is formulated, which solves the problems of low task scheduling efficiency and poor system stability in the existing technology, and achieves efficient and stable task scheduling.
Patent Information
- Application Number
- CN202510615678.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-14
- Publication Date
- 2025-06-13
- Estimated Expiration
- 2045-05-14
AI Technical Summary
The prior art has failed to effectively solve the classification and positioning of multi-type task conflicts, task conflicts caused by changes in user demand, real-time requirements and memory resource competition in the task scheduling of adaptive optical storage all-in-one machines, resulting in low system stability and real-time scheduling efficiency.
By building a task instruction matrix, identifying and analyzing compound conflict instructions, using two-dimensional matrix positioning analysis technology, a conflict instruction analysis group is formed, and a rule chain is built based on device status parameters and user operations, a rule screening model and instruction scheduling prediction model are established, and device status and user instructions are collected in real time to formulate scheduling strategies.
It improves the efficiency of task scheduling and the stability of the system, can timely identify and handle task conflicts, improves the real-time and reliability of the system, and avoids system response delays or task blocking problems caused by the single scheduling strategy.
Smart Images

Figure CN120144261A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of task scheduling, and particularly 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; real-time operating systems (RTOS) have become the mainstream platform for controlling integrated photovoltaic and energy storage machines due to their strong real-time performance and multi-task scheduling capabilities. However, there are many deficiencies in the task scheduling of existing integrated photovoltaic and energy storage machines.
[0003] A Chinese patent application with the publication number CN112148475A discloses a task scheduling method and system for a Loongson big data integrated machine that combines 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. Further, according to the relationship model between CPU power consumption and temperature, CPU utilization rate and temperature, calculate the priority of each computing node's CPU, and perform task scheduling on the management node task queue according to the priority, which not only improves the parallel efficiency of the Loongson big data integrated machine.
[0004] Existing technologies do not classify and locate multi-type task conflicts in adaptive integrated photovoltaic and energy storage machines. If a task instruction matrix is constructed and combined with a two-dimensional matrix to locate compound conflict instructions, it 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 state parameters, resulting in the inability to predict task conflicts caused by changes in user needs, and the scheduling policy lacks adaptability at the user interaction level; if a rule chain is constructed by combining user operations with device state parameters, it can alleviate the problem of sudden conflicts caused by changes in user needs.
[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 security task blocking. If a dynamic scheduling strategy based on a rule chain is adopted, it can alleviate the problems of system response delay or task blocking caused by a single scheduling strategy and improve the real-time scheduling efficiency.
[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 optical storage integrated machine task scheduling system and method to solve at least one of the above-mentioned prior art problems.
[0010] An RTOS-based adaptive optical storage integrated machine task scheduling method includes the following steps: Obtain the task instructions of the adaptive optical storage integrated machine and construct a task instruction matrix; 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; 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; Establish a rule screening model, perform support degree and confidence analysis and screening on the rule chain, and construct a rule linked list; 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.
[0011] As a further technical solution of the present invention: 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 log of the adaptive optical storage integrated 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 composite 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, and perform dimensionless processing on the average blocking cycle ratio and the occurrence frequency; 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.
[0012] As a further technical solution of the present invention: the method for determining the quadrant boundaries is as follows: Calculate the occurrence frequency boundaries F high 、F low ; Calculate the average blocking cycle ratio boundaries Rt high 、Rt low ; Where F is the occurrence frequency and Rt is the average blocking cycle ratio.
[0013] As a further technical solution of the present invention: The method of positioning by coordinates is as follows: First quadrant: ; Second quadrant: ; Third quadrant: ; Fourth quadrant: ; Among them, AND means that both the conditions of the average blocking period ratio and the occurrence frequency need to be met.
[0014] As a further technical solution of the present invention: The method of determining the rule chain generated by the device status parameter and the user conflict instruction is as follows: Obtain the task conflict instructions generated by actively controlling the adaptive optical storage integrated machine due to the change of user requirements in the conflict instruction analysis group; Mark the task conflict instructions generated due to the change of 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 the user conflict instructions through a decision tree model; Among them, the rule chain includes preconditions and judgment results.
[0015] As a further technical solution of the present invention: The method of constructing a 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 effective rule chains; Based on the effective rule chains, establish a rule linked list.
[0016] As a further technical solution of the present invention: The steps of establishing a rule screening model are as follows: S401. Filter invalid rule chains through support and confidence; S402. Redundant rule detection and merging; S403. Contradictory rule detection and correction.
[0017] As a further technical solution of the present invention: The method of obtaining support and confidence is as follows: Obtain all the rule chains, and perform a ratio process on the number of rule chains that simultaneously meet the preconditions and judgment results and all the rule chains to obtain the support; 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.
[0018] As a further technical solution of the present invention: The method of predicting potential instruction conflicts and formulating a scheduling strategy is as follows: Collect device status parameters in real time through RTOS, and capture user conflict instructions through the human-computer interaction interface of the adaptive energy storage and integration machine; Use the conditional rules of the rule linked list as the training set and test set of the instruction scheduling prediction model, and construct the instruction scheduling prediction model through the neural network algorithm; 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 are generated; If the judgment results corresponding to the rule chain will be generated, formulate a scheduling strategy.
[0019] An RTOS-based task scheduling system for an adaptive energy storage and integration machine, including the following modules: Matrix construction module: used to obtain the task instructions of the adaptive energy storage and integration machine and construct a task instruction matrix; Conflict analysis module: used to 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; 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; 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.
[0020] The beneficial effects of the present invention: 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 and obtain the task instructions in real time, reflecting the fast response ability of the RTOS 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 composite conflict instructions, and screen out the conflict instruction analysis group; in the stage of formulating the scheduling strategy, 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 a scheduling decision. For example, when detecting a memory resource competition conflict, it timely pauses or delays low-priority management tasks to release memory to ensure the operation of high-priority security tasks, responds promptly to task conflict instructions and user operations, and greatly improves the scheduling efficiency; 2. By identifying conflict types such as memory resource competition, priority inversion, and timing synchronization, the system can take timely measures to prevent errors from escalating. For memory resource competition conflicts, the system can adjust task execution in a timely manner to avoid system crashes caused by memory overflow. For priority inversion conflicts, the priority inheritance protocol is adopted to ensure the smooth execution of high-priority tasks. At the same time, during the rule chain screening process, through support and confidence analysis, as well as redundant and contradictory rule handling, the accuracy and stability of the rule linked list are guaranteed, improving the overall reliability of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] To more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the accompanying drawings required for the description of the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0022] Figure 1 is a flowchart of a task scheduling method for an adaptive optical storage integrated machine based on RTOS provided by the present invention; Figure 2 is a flowchart of the construction method of the rule screening model provided by the present invention; Figure 3 is a module diagram of a task scheduling system for an adaptive optical storage integrated machine based on RTOS provided by the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0023] To enable those skilled in the art to better understand the solutions of the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some of the embodiments of the present invention, rather than all of them. 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 scope of protection of the present invention.
[0024] 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: S1. 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; The construction method of the task instruction matrix is as follows: In some embodiments, a task listening thread is created within a real-time operating system (RTOS) to listen to the data information of the underlying devices and identify the instruction execution parameters of the adaptive optical storage integrated machine; Preferably, the instruction execution parameters include: the instruction number, the instruction execution cycle, the memory peak value during instruction execution, and the peripheral dependency bitmask of the instruction; According to the operating characteristics of the adaptive integrated energy storage and photovoltaic device, the task instructions are classified into safety tasks, communication tasks, and management tasks; Preferably, the safety tasks include: the energy storage charge and discharge control instruction, the insulation detection instruction, and the photovoltaic power generation control instruction of the adaptive integrated energy storage and photovoltaic device; The communication tasks include: the Modbus protocol parsing instruction and the BMS data reporting instruction; The management tasks include: the energy measurement and the fault log storage of the adaptive integrated energy storage and photovoltaic device; Based on different classifications of task instructions, different task priorities are set; Preferably, the priority of the safety task is 1, the priority of the communication task is 2, and the priority of the management task is 3; Obtain the instruction execution parameters and task priorities of a single instruction task, and establish a task instruction matrix; S2. Obtain task conflict instructions, 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; Obtain historical task conflict instructions within the working cycle through the device log of the adaptive integrated energy storage and photovoltaic device RTOS, and identify the conflict types of task instructions through the task instruction matrix; Those skilled in the art can understand that task conflict instructions refer to task instructions that cause system operation errors or abnormalities due to resource competition, priority inversion, etc. among multiple tasks during the operation of the adaptive integrated energy storage and photovoltaic device; Exemplarily, the conflict types are divided into resource competition conflict identification, priority inversion conflict identification, and timing synchronization conflict identification; Among them, resource competition conflicts include memory resource competition and peripheral resource competition; S201. The identification method for resource competition conflicts is as follows: 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; S202. The identification method for peripheral resource competition conflicts is as follows: For peripheral resource competition conflicts: According to the peripheral dependency bitmask 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; S203. The identification method for priority inversion conflicts is as follows: Priority inversion conflict: By comparing the priorities of historical conflicting task instructions with the actual execution order, if a low-priority task holds a resource 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; S204. The way to identify timing synchronization conflicts is as follows: Timing synchronization conflict: Analyze the execution cycles and times of historical conflicting 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 a timing synchronization conflict; If a task conflict instruction belongs to multiple conflict types at the same time, the task instruction conflict is marked as a composite conflict instruction; Obtain the composite conflict instructions among all task conflict instructions, calculate the average blocking cycle ratio of the composite conflict instructions and 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; It should be noted that the occurrence frequency is calculated by taking the ratio of the number of occurrences of the conflict instruction within the system working cycle; the average blocking cycle ratio is the ratio of the average time that the same task conflict instruction causes task blocking to the instruction execution cycle; Among them, the same task conflict instruction means that the instruction numbers in the instruction execution fingerprint are the same; 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; 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; The way to determine the quadrant boundaries is as follows: Through the formula: Obtain the occurrence frequency boundaries F high 、F low ; 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; Through the formula: Obtain the boundary Rt of the average blocking cycle ratio high 、Rt low ; 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; The way of coordinate positioning is as follows: The first quadrant: ; Second quadrant: ; Third quadrant: ; Fourth quadrant: ; 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; Obtain the composite conflict instructions in the first quadrant and form a conflict instruction analysis group; It should be further noted that the role of forming the conflict instruction analysis group is as follows: 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, filter 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 the system operation (such as frequently causing task blocking and occupying key resources), and the occurrence probability is high, 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; 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" subsequently, 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.
[0025] The technical solution of this embodiment is: 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 and identify and analyze them with the task instruction matrix to 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 a core target object for subsequent conflict analysis and scheduling strategy formulation.
[0026] 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: S3. Extract the user conflict instructions within the conflict instruction analysis group and the corresponding device status parameters, and conduct a regularization analysis of 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; Obtain the task conflict instructions generated by actively controlling the adaptive photovoltaic and energy storage integrated machine due to changes in user requirements in the conflict instruction analysis group; It should be noted that the user can control the adaptive photovoltaic and energy storage integrated machine through the human-machine interface of the adaptive photovoltaic and energy storage integrated machine to control photovoltaic power generation, 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; Mark the task conflict instructions generated due to changes in user requirements as user conflict instructions; Obtain the device status parameters of the adaptive photovoltaic and energy storage integrated machine corresponding to the user conflict instructions; Among them, the device status parameters include: state of charge of the energy storage battery, load power, device temperature, task instruction matrix, conflict type; Analyze the rule chain generated by the device status parameters and the user conflict instructions through a decision tree model; Among them, the rule chain includes preconditions and judgment results; 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 the user initiates an energy storage charging operation at the same time, a memory resource competition conflict occurs; 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 the user initiates an energy storage charging operation at the same time; The judgment result is: a memory resource competition conflict occurs; For rule chain 2, if the photovoltaic output power is higher than 10kW, and the system is performing a Modbus protocol parsing task, when the user performs a photovoltaic power generation power adjustment operation, a peripheral resource competition conflict occurs; For rule chain 3, when the temperature of the energy storage battery is higher than 40°C, and the system is executing an energy storage charging and discharging control instruction (safety task), and the user initiates a fault log storage operation (management task), a priority inversion conflict occurs; 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 the state of charge of the energy storage battery, load power, task instruction matrix), user operations (such as charging control, mode switching) and corresponding conflict types, after data cleaning, feature encoding (such as numericalizing the operation type) and normalization preprocessing, the model is trained using the CART or C4.5 algorithm, and the features (device status, user operation) are recursively partitioned based on the information gain criterion to generate a tree structure, and finally intuitive conditional rules are extracted from the nodes and branches of the tree; For example, when the SOC > 90% and the user triggers a charging operation, the result is a memory resource competition conflict, forming a rule chain that reflects the combination of device status and user operation leading to a specific conflict type.
[0027] It should be noted that the role of establishing the rule chain is as follows: Role 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; Role 2: Achieve 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 device status and user instructions, match them with the rule chain. If the preconditions of the rule chain are met, the corresponding conflict type can be predicted.
[0028] Role 3: Enhance the maintainability and scalability of the system. The rule chain stores the relationship between device status, user operation and conflict type in a structured way, making the maintenance and expansion of the system more convenient. When the system needs to add new functions or adapt to new device status, only the corresponding rules need to be added to the rule chain, rather than making large-scale modifications to the entire scheduling system. At the same time, the existence of the rule chain also makes the debugging and optimization of the system easier. Developers can find problems in the system and make improvements by analyzing the rule chain.
[0029] S4. Establish a rule screening model, analyze and screen the rule chain for support and confidence, and construct a rule linked list; Obtain all the rule chains generated by the decision tree, establish a rule screening model to screen the rule chain, and obtain effective rule chains; Such as Figure 2 shown, the construction method of the rule screening model is as follows: S401. Filter out invalid rule chains through support and confidence; 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; Among them, all rule chains are obtained, and the ratio of the number of rule chains that simultaneously meet the preconditions and the judgment results to all rule chains is processed to obtain the support degree; Exemplarily, among 100 samples, the number of rule chains that simultaneously meet the conditions of SOC > 90%, charging operation, and conflict type being memory conflict is 10, and the total number of rule chains is 100; The ratio of the number of 10 samples that simultaneously meet the conditions of SOC > 90%, charging operation, and conflict type being memory conflict to the total number of 100 samples is processed to obtain a support degree of 10%; The ratio of the number of rule chains that simultaneously meet the preconditions and the judgment results to the number of all rule chains that meet the preconditions is processed to obtain the confidence degree; Exemplarily, there are a total of 30 rule chains that meet the preconditions of SOC > 80% and the user initiates a charging operation. 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; The ratio of the number of 25 rule chains that simultaneously meet the preconditions and the judgment results to the number of 30 rule chains that meet the preconditions is processed to obtain a confidence degree of 83.3%; The support degree and confidence degree of the rule chain are respectively compared with the preset support degree threshold and confidence degree threshold; If the support degree and confidence degree of the rule chain are both greater than or equal to the preset support degree threshold and confidence degree threshold, the rule is considered valid; otherwise, it is considered invalid; Preferably, rule chain A: SOC > 90% + charging operation causes memory conflict, support degree 10%, confidence degree 90%, where the support degree threshold and confidence degree threshold are 5% and 80% respectively; Since the support degree and confidence degree of rule chain A are both greater than the preset support degree threshold and confidence degree threshold, rule chain A is valid; Rule chain B: temperature > 45°C + discharging operation causes timing conflict, support degree 2%, confidence degree 60%; Since the support degree and confidence degree of rule chain B are both lower than the preset support degree threshold and confidence degree threshold, rule chain B is invalid; S402, redundant rule detection and merging; If multiple rule chains have a conditional inclusion relationship and the results of the rule chains are the same, then the multiple rule chains are merged to reduce the duplication of rule chains; Preferably, rule chain 1: SOC > 95% + charging operation, resulting in memory conflict, support degree 5%, confidence degree 95%; Rule chain 2: SOC > 90% + charging operation, resulting in memory conflict, support degree 8%, confidence degree 92%; Since the conditions of rule chain 1 are a subset of those of rule chain 2 (95% > 90%) and the results are the same, they can be merged into "SOC > 90% + charging operation, resulting in memory conflict", and the condition range with higher support is retained; S403. Detection and correction of conflicting rules; Since the same combination of conditions corresponds to different types of conflicts, the rule chains are corrected through confidence and domain logic; Preferably, rule chain 3: load > 8kW + mode switching, resulting in peripheral conflict, support 6%, confidence 85%; Rule chain 4: load > 8kW + mode switching, resulting in priority inversion, support 3%, confidence 70%; Since the confidence of rule chain 3 is higher and it conforms to the domain logic that peripheral competition is more common under high load, rule chain 3 is retained and rule chain 4 is deleted; Through the rule screening model, the effective rule chains that conform to the rule screening model are screened to obtain a rule list; It should be noted that the function of screening the effective rule chains that conform to the rule screening model is as follows: 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 and confidence; Function 2. Enhance the stability and reliability of the system: The rule screening process can identify and handle redundant and conflicting rules in the rule chains. Redundant rules will increase the complexity of the system, while conflicting rules will lead to chaotic scheduling decisions. By merging similar rules and correcting conflicting results, the rule chains become clearer and more consistent, reducing system failures caused by rule conflicts and enhancing the stability of the system.
[0030] Function 3. Facilitate the maintenance and expansion of the system. After screening the effective rule chains, the rule system becomes 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.
[0031] S5. Real-time collect device status parameters and user conflict instructions through RTOS, and based on the conditional rules of the rule list, establish an instruction scheduling prediction model to predict potential instruction conflicts and formulate a scheduling strategy; Real-time collect device status parameters through RTOS, and capture user conflict instructions through the human-machine interface of the adaptive integrated energy storage machine; Use the conditional rules of the rule 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; Those skilled in the art can understand that first, the device status parameters (such as the SOC of the energy storage battery, load power, device temperature, etc.) and 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 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 status + user operation to the conflict type; after the training is completed, the device status 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 conflict of the adaptive optical storage integrated machine; Convert the device status 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; If the judgment result corresponding to the rule chain will be generated, formulate the corresponding scheduling strategy; Preferably, the resource competition conflict scheduling strategy: 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 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; Peripheral device resource competition: For peripheral device resource competition conflicts, the synchronization mechanism (such as semaphore, mutex) of the RTOS can be used to coordinate the use of the same peripheral device by different tasks. The peripheral device resources are preferentially allocated to high-priority tasks to avoid multiple tasks accessing the same peripheral device simultaneously; 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, thereby avoiding the high-priority task being blocked for a long time; 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 flag, timer) to ensure the synchronization between tasks.
[0032] 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 rule-based 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 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.
[0033] Embodiment 3: As Figure 3 shown, an adaptive optical storage integrated machine task scheduling system based on RTOS includes the following modules: Matrix construction module: used to 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; 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; Rule construction module: used to extract the user conflict instructions within the conflict instruction analysis group and the corresponding device status parameters, perform rule-based 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; 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 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.
[0034] 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 application of the present invention should still fall within the scope covered by the patent of the present invention.
Claims
1. An adaptive optical storage integrated machine task scheduling method based on RTOS, characterized in that: The following steps are involved: Obtain the task instructions of the adaptive optical storage integrated machine and construct a task instruction matrix; Identify and analyze the task instruction matrix, determine the composite conflict instructions and conduct two-dimensional matrix positioning analysis, and form a conflict instruction analysis group for the composite conflict instructions in the first quadrant; Extract the user conflicting instructions in the conflicting instruction analysis group, obtain the device state parameters and perform regular analysis on the user conflicting instructions, and determine the rule chain generated by the device state parameters and the user conflicting instructions; Establish a rule screening model, perform support and confidence analysis and screening on the rule chain, and construct a rule chain table; Collect device status parameters and user conflicting instructions in real time, establish an instruction scheduling prediction model based on the conditional rules of the rule list, predict potential instruction conflicts and formulate scheduling strategies.
2. The method for task scheduling of an adaptive optical storage integrated machine based on RTOS according to claim 1, characterized in that: The method of performing two-dimensional matrix positioning analysis is: Through the device log of the adaptive optical storage integrated device RTOS, the historical task conflict instructions in the working cycle are obtained, and the conflict type of task instructions is identified through the task instruction matrix; If the task conflict instruction belongs to multiple conflict types at the same time, the task instruction conflict is marked as a composite conflict instruction; By calculating the average blocking cycle ratio of the composite conflicting instructions and the occurrence frequency of the task conflicting instructions in the working cycle; A two-dimensional matrix is constructed with the average blocking cycle ratio as the vertical axis and the occurrence frequency as the horizontal axis. According to the quadrant boundaries of the two-dimensional matrix, the conflicting instructions are located in the two-dimensional matrix by coordinates.
3. The method for task scheduling of an adaptive optical storage integrated machine based on RTOS according to claim 2, characterized in that: The quadrant boundaries are determined as follows: The frequency boundary F is calculated by the mean and variance of the frequency of task conflict instructions in the working cycle. high 、F low ; By calculating the mean and variance of the average blocking cycle ratio of task conflict instructions within the working cycle, the boundary Rt of the average blocking cycle ratio is calculated high , Rt low ; Where F is the occurrence frequency and Rt is the average blocking period ratio.
4. The method for task scheduling of an adaptive optical storage integrated machine based on RTOS according to claim 2, characterized in that: The method of positioning by coordinates is: Quadrant 1: ; Quadrant II: ; Quadrant III: ; Quadrant 4: ; Here, AND represents that the conditions of the average blocking period ratio and the occurrence frequency must be met at the same time.
5. The method for task scheduling of an adaptive optical storage integrated machine based on RTOS according to claim 1, characterized in that: The method of determining the rule chain generated by the device state parameters and the user conflicting instructions is as follows: Obtaining task conflicting instructions generated by active control of the adaptive optical storage integrated machine due to changes in user requirements in the conflicting instruction analysis group; Marking the task conflict instructions generated due to changes in user requirements as user conflict instructions; Obtain device status parameters of the adaptive optical storage integrated machine corresponding to the user conflicting instructions, and analyze the rule chain generated by the device status parameters and the user conflicting instructions through a decision tree model; The rule chain includes preconditions and judgment results.
6. The method for adaptive optical storage integrated machine task scheduling based on RTOS according to claim 1, characterized in that: The method of constructing the rule chain list is: Obtain all rule chains generated by the decision tree, establish a rule screening model to screen the rule chains, and obtain valid rule chains; Create a rule chain based on the valid rule chain.
7. The method for task scheduling of an adaptive optical storage integrated machine based on RTOS according to claim 6, characterized in that: The steps of establishing the rule screening model are: S401, filtering invalid rule chains by support and confidence; S402, redundant rule detection and merging; S403: Detection and correction of contradictory rules.
8. The method for task scheduling of an adaptive optical storage integrated machine based on RTOS according to claim 7, characterized in that: The support and confidence are obtained as follows: Get all the rule chains, and compare the number of rule chains that meet both the preconditions and the judgment results with all the rule chains to get the support. The confidence level is obtained by comparing the number of rule chains that satisfy both the precondition and the judgment result with the number of all rule chains that satisfy the precondition.
9. The method for task scheduling of an adaptive optical storage integrated machine based on RTOS according to claim 1, characterized in that: The method of predicting potential instruction conflicts and formulating scheduling strategies is as follows: The device status parameters are collected in real time through RTOS, and the user conflicting instructions are captured through the human-computer interaction interface of the adaptive optical storage integrated machine; The conditional rules of the rule list are used as the training set and test set of the instruction scheduling prediction model, and the instruction scheduling prediction model is constructed through the neural network algorithm; The real-time acquisition device status parameters and user conflicting instructions are converted into the preconditions of the rule chain, and the preconditions are input into the instruction scheduling prediction model to predict whether the judgment result corresponding to the rule chain is generated; If a judgment result corresponding to the rule chain is generated, a scheduling strategy is formulated.
10. An RTOS-based adaptive optical storage integrated machine task scheduling system is used to implement any one of the RTOS-based adaptive optical storage integrated machine task scheduling methods described in claims 1-9, characterized in that: Includes the following modules: Matrix construction module: used to obtain the task instructions of the adaptive optical storage integrated machine and construct the task instruction matrix; Conflict analysis module: used to 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; Rule building module: used to extract user conflicting instructions in the conflicting instruction analysis group, obtain device status parameters and perform rule-based analysis on user conflicting instructions, and determine the rule chain generated by device status parameters and user conflicting instructions; Rule screening module: used to establish a rule screening model, perform support and confidence analysis and screening on the rule chain, and build a rule chain table; Strategy building module: used to collect device status parameters and user conflicting instructions in real time, establish an instruction scheduling prediction model based on the conditional rules of the rule list, predict potential instruction conflicts and formulate scheduling strategies.
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
Data processing method based on industrial internet data platform
CN118863530A
Manufacturing micro-service discovery and dynamic screening method based on LDA and rule chain
CN118984332A