Methods, apparatus, electronic devices and storage media for optimizing the operating time of electrical equipment
Patent Information
- Application Number
- CN202311871883.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-29
- Publication Date
- 2026-09-01
- Estimated Expiration
- 2043-12-29
AI Technical Summary
[0002]随着现代化水平的不断推进,各类智能电器设备陆续步入家庭,但多种电器无指导的随心使用会极大加重用户的电费支出,同时也会增加电厂于某段时间的发电设施投入
[0053]上述电器设备运行时间寻优方法方法、装置、计算机设备和存储介质,通过将所述习惯运行区间作为初代群体输入至改进的遗传算法中,基于改进的遗传算法确定种群最优个体适应度;检测所述种群最优个体适应度是否满足终止判定规则;当所述种群最优个体适应度满足终止判定规则时,将所述种群最优个体适应度对应的个体作为最优解输出;控制所述电器设备根据输出的所述最优解所对应的时间段工作。本申请利用改进的遗传算法,对电器设备的最佳运行时间进行寻优,在满足用户日常使用需求同时,实现了降低电器设备的低支出使用。且,本申请对遗传算法进行改进,通过分析电器设备的历史使用信息,确定各电器设备的习惯运行区间,将其作为初始群体输入遗传算法中,使得初代群体的设置更加合理和符合实际,以提高算法收敛到有效解的速度,即提高算法最优控制策略搜索速度。
Smart Images

Figure CN118052275B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power technology, and in particular to a method, apparatus, electronic device, and storage medium for optimizing the operating time of electrical equipment. Background Technology
[0002] With the continuous advancement of modernization, various smart electrical appliances are gradually entering homes. However, the unguided and arbitrary use of these appliances can significantly increase users' electricity bills and also increase the investment in power generation facilities at power plants during certain periods. To alleviate energy pressure, it is necessary to address both increasing supply and reducing demand. Therefore, based on the guidance of current electricity pricing policies, effectively guiding users to use appliances during off-peak hours in accordance with their habits has become an effective means of saving costs and energy. Summary of the Invention
[0003] Therefore, it is necessary to provide a method, apparatus, electronic device, and storage medium for optimizing the operating time of electrical equipment in response to the above-mentioned technical problems.
[0004] A method for optimizing the operating time of electrical equipment includes:
[0005] Obtain historical usage information for at least one electrical appliance;
[0006] The habitual operating range of the electrical equipment is determined based on the historical usage information.
[0007] The habitual operating range is used as the initial population input into the improved genetic algorithm for iterative calculation, and the fitness of the optimal individual in the population is determined by the fitness function;
[0008] Detect whether the fitness of the optimal individual in the population satisfies the termination decision rule;
[0009] When the fitness of the best individual in the population satisfies the termination decision rule, the individual corresponding to the fitness of the best individual in the population is output as the optimal solution.
[0010] The electrical equipment is controlled to operate according to the time period corresponding to the output optimal solution.
[0011] In one embodiment, the step of detecting whether the fitness of the optimal individual in the population satisfies the termination rule includes:
[0012] Detect whether the difference between the fitness of the best individual in the population and the fitness of the best individual in the previous generation is within a first preset range;
[0013] When the fitness of the optimal individual in the population satisfies the termination criterion, the step of outputting the individual corresponding to the fitness of the optimal individual in the population as the optimal solution includes:
[0014] When the difference between the fitness of the optimal individual in the population and the fitness of the optimal individual in the previous generation is within a first preset range, the individual corresponding to the fitness of the optimal individual in the population is output as the optimal solution.
[0015] In one embodiment, the first preset range is within ±0.5% of the fitness of the best individual in the previous generation population.
[0016] In one embodiment, the method further includes:
[0017] When the fitness of the optimal individual in the population does not meet the termination criterion, obtain the continuous time running details of the improved genetic algorithm;
[0018] Based on the continuous-time execution details of the improved genetic algorithm, the optimization direction of the algorithm is determined;
[0019] The next generation population is generated based on the optimization direction found by the algorithm.
[0020] The next generation population is then fed into the improved genetic algorithm for a new round of iterative computation.
[0021] In one embodiment, the step of obtaining the continuous-time runtime details of the improved genetic algorithm includes:
[0022] Obtain the population generated by the improved genetic algorithm within a continuous time period and the fitness of the individuals in the population accordingly;
[0023] Evaluate the fitness and generate fitness evaluation results;
[0024] The trend of fitness as the number of iterations increases is analyzed;
[0025] The step of determining the optimization direction of the algorithm based on the continuous-time running details of the improved genetic algorithm includes:
[0026] Based on the trend of fitness as the number of iterations increases and the fitness evaluation results, the optimization direction of the algorithm is determined.
[0027] In one embodiment, the step of obtaining historical usage information of at least one electrical device includes:
[0028] Acquire historical on / off time points, duration information, and user operation information of at least one electrical device.
[0029] In one embodiment, the method further includes:
[0030] Obtain information on electricity costs, user satisfaction, energy efficiency, and the lifespan of electrical equipment;
[0031] Based on the information on electricity costs, user satisfaction, energy efficiency, and the lifespan of electrical equipment, a fitness function is constructed.
[0032] An electrical equipment operating time optimization device, comprising:
[0033] The acquisition module is used to acquire historical usage information of at least one electrical device;
[0034] A habitual operating range determination module is used to determine the habitual operating range of the electrical equipment based on the historical usage information.
[0035] The fitness determination module is used to input the habitual operating range as the initial population into the improved genetic algorithm for iterative calculation, and determine the fitness of the optimal individual in the population through the fitness function;
[0036] The detection module is used to detect whether the fitness of the optimal individual in the population satisfies the termination judgment rule;
[0037] The optimal solution output module outputs the individual corresponding to the optimal individual fitness as the optimal solution when the fitness of the best individual in the population satisfies the termination judgment rule.
[0038] The operation control module is used to control the electrical equipment to operate according to the optimal solution within a specific time period.
[0039] A computer device includes a memory and a processor, the memory storing a computer program, characterized in that the processor executes the computer program to perform the following steps:
[0040] Obtain historical usage information for at least one electrical appliance;
[0041] The habitual operating range of the electrical equipment is determined based on the historical usage information.
[0042] The habitual operating range is used as the initial population input into the improved genetic algorithm for iterative calculation, and the fitness of the optimal individual in the population is determined by the fitness function;
[0043] Detect whether the fitness of the optimal individual in the population satisfies the termination decision rule;
[0044] When the fitness of the best individual in the population satisfies the termination decision rule, the individual corresponding to the fitness of the best individual in the population is output as the optimal solution.
[0045] The electrical equipment is controlled to operate according to the time period corresponding to the output optimal solution.
[0046] A computer-readable storage medium having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0047] Obtain historical usage information for at least one electrical appliance;
[0048] The habitual operating range of the electrical equipment is determined based on the historical usage information.
[0049] The habitual operating range is used as the initial population input into the improved genetic algorithm for iterative calculation, and the fitness of the optimal individual in the population is determined by the fitness function;
[0050] Detect whether the fitness of the optimal individual in the population satisfies the termination decision rule;
[0051] When the fitness of the best individual in the population satisfies the termination decision rule, the individual corresponding to the fitness of the best individual in the population is output as the optimal solution.
[0052] The electrical equipment is controlled to operate according to the time period corresponding to the output optimal solution.
[0053] The aforementioned method, apparatus, computer equipment, and storage medium for optimizing the operating time of electrical equipment involve inputting the habitual operating interval as the initial population into an improved genetic algorithm. Based on the improved genetic algorithm, the fitness of the optimal individual in the population is determined. The algorithm then checks whether the fitness of the optimal individual satisfies a termination rule. When the fitness of the optimal individual satisfies the termination rule, the individual corresponding to the optimal fitness is output as the optimal solution. The electrical equipment is then controlled to operate according to the time period corresponding to the output optimal solution. This application utilizes an improved genetic algorithm to optimize the optimal operating time of electrical equipment, meeting users' daily usage needs while reducing the cost of using electrical equipment. Furthermore, this application improves the genetic algorithm by analyzing historical usage information of electrical equipment to determine the habitual operating interval of each device, using this interval as the initial population input into the genetic algorithm. This makes the initial population setting more reasonable and realistic, thereby increasing the speed at which the algorithm converges to an effective solution, i.e., improving the search speed for the optimal control strategy. Attached Figure Description
[0054] Figure 1 This is a flowchart illustrating a method for optimizing the running time of electrical equipment in one embodiment;
[0055] Figure 2 This is a structural block diagram of an electrical equipment running time optimization device in one embodiment;
[0056] Figure 3 This is an internal structural diagram of a computer device in one embodiment;
[0057] Figure 4 This is a schematic diagram illustrating the connection between an electrical device and a smart socket in one embodiment.
[0058] Figure 5 This is a schematic diagram illustrating the implementation process of an electrical equipment runtime optimization method in one embodiment. Detailed Implementation
[0059] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0060] Example 1
[0061] In this embodiment, as Figure 1 As shown, a method for optimizing the operating time of electrical equipment is provided, which includes:
[0062] Step 110: Obtain historical usage information for at least one electrical appliance.
[0063] In this embodiment, see Figure 4 As shown, the electrical appliances are everyday smart home appliances, including but not limited to dishwashers, washing machines, rice cookers, air source water heaters, and air conditioners. In this embodiment, historical usage information of the electrical appliances is collected through smart sockets connected to each appliance. This historical usage information includes the on / off data of each appliance under changing status, specifically including the exact time points and durations of each appliance's on / off states during its operating cycle, as well as user operation information.
[0064] Step 120: Determine the habitual operating range of the electrical equipment based on the historical usage information.
[0065] In this embodiment, the usage patterns and habits of the equipment are analyzed based on historical usage information to determine the habitual operating range of the electrical equipment.
[0066] In one embodiment, by collecting historical usage information of electrical appliances, the habitual operating range of the appliance's on and off periods throughout the day or week can be determined. In this embodiment, an air conditioner is used as an example. If the air conditioner is turned on at 10 pm and turned off at 7 am every day, lasting for 9 hours, then the operating range from 10 pm to 7 am is the habitual operating range of the appliance.
[0067] Step 130: The habitual operating interval is used as the initial population input into the improved genetic algorithm for iterative calculation, and the fitness of the optimal individual in the population is determined by the fitness function.
[0068] In this embodiment, the habitual operating range of the electrical equipment is used as the initial population input into the improved genetic algorithm for iterative calculation. The fitness function is used to evaluate each individual in the current population, that is, to calculate the fitness of the individual in the current population. The fitness of the individual in the population is the electricity cost expenditure for a specific operating period, and the optimal fitness of the individual in the current population is determined.
[0069] In this process, selection, crossover, and mutation operators are applied to the current population to generate the next generation population. The individual evaluation and iterative process described above are repeated to obtain the optimal individual fitness of multiple populations.
[0070] In this embodiment, the habitual operating range of the electrical equipment is used as the initial population input into the improved genetic algorithm for iterative calculation. The fitness function determines the optimal individual fitness of the population, which ensures that the genetic algorithm is based on the user's usage habits. On this basis, it is optimized to find an electrical equipment operating time plan that both meets the user's usage habits and is cost-effective.
[0071] Step 140: Detect whether the fitness of the optimal individual in the population satisfies the termination judgment rule.
[0072] In this embodiment, the termination rule is used to determine when to stop the iterative process of the improved genetic algorithm, i.e., finding the optimal solution that meets the problem requirements or reaching a satisfactory approximate solution. The termination rule is checked to determine whether the iterative process should be terminated.
[0073] In one embodiment, common ways to set the termination judgment rule include: (1) setting the maximum number of iterations of the algorithm, and stopping the algorithm when the number of iterations is reached; (2) setting a threshold for fitness value, and stopping the algorithm when the fitness value of the best individual in the population exceeds or equals the threshold; (3) judging by observing the changing trend of the fitness value of the best individual in the population, and setting a convergence condition, such as stopping the algorithm when the fitness value of the best individual in the population changes very little or no longer improves after several consecutive generations; (4) setting the maximum time for the algorithm to execute, and stopping the algorithm when the time limit is reached.
[0074] In this embodiment, the termination judgment rule is set to the form of convergence judgment, taking into account the actual situation. By setting a convergence condition, the algorithm stops when the convergence condition is met.
[0075] Step 150: When the fitness of the optimal individual in the population satisfies the termination judgment rule, the individual corresponding to the fitness of the optimal individual in the population is output as the optimal solution.
[0076] In this embodiment, if the fitness of the optimal individual in the population satisfies the termination judgment rule, it indicates that a sufficiently good solution has been found. Therefore, the algorithm terminates and outputs the individual corresponding to the fitness of the optimal individual in the population as the optimal solution, that is, outputs the current optimal electrical equipment running time plan.
[0077] Step 160: Control the electrical equipment to work according to the time period corresponding to the output optimal solution.
[0078] In this embodiment, the optimal solution output, i.e. the current optimal operating time of the electrical equipment, is used to control the electrical equipment to work during a specific time period, thereby achieving the optimization of the optimal operating time of the electrical equipment.
[0079] In the above embodiments, this application utilizes an improved genetic algorithm to optimize the operating time of electrical appliances, thereby meeting users' daily usage needs while reducing the cost of using these appliances. Furthermore, this application improves the genetic algorithm by analyzing historical usage information of the electrical appliances to determine their habitual operating ranges. This range is then used as the initial population input into the genetic algorithm, making the initial population setting more reasonable and realistic. This improves the speed at which the algorithm converges to a valid solution, i.e., it increases the search speed for the optimal control strategy.
[0080] In one embodiment, the step of detecting whether the fitness of the optimal individual in the population satisfies the termination judgment rule includes: detecting whether the difference between the fitness of the optimal individual in the population and the fitness of the optimal individual in the previous generation is within a first preset range; when the fitness of the optimal individual in the population satisfies the termination judgment rule, the step of outputting the individual corresponding to the fitness of the optimal individual in the population as the optimal solution includes: when the difference between the fitness of the optimal individual in the population and the fitness of the optimal individual in the previous generation is within the first preset range, outputting the individual corresponding to the fitness of the optimal individual in the population as the optimal solution.
[0081] In this embodiment, the termination rule is set to detect whether the difference between the fitness of the best individual in the current population and the fitness of the best individual in the previous generation is within a first preset range. When the difference between the fitness of the best individual in the current population and the fitness of the best individual in the previous generation is within the first preset range, it indicates that the improvement of the new generation population is no longer significant, or a sufficiently good solution has been found. Therefore, the algorithm terminates, and the individual corresponding to the fitness of the best individual in the current population is output as the optimal solution, that is, the current optimal running time plan for the electrical equipment is output.
[0082] In one embodiment, the first preset range is within ±0.5% of the fitness of the best individual in the previous generation population.
[0083] In this embodiment, to ensure the iterative efficiency of the improved genetic algorithm, the first preset range is set to within ±0.5% of the fitness of the best individual in the previous generation population.
[0084] In this embodiment, an improved genetic algorithm is used to search for the global optimum within the habitual usage range of the electrical equipment. Because this improved genetic algorithm can directly operate on structural objects, it is not limited by differentiation or function continuity, possesses inherent parallelism and better global optimization capabilities, and therefore can well meet the problem of various electrical devices operating freely in complex real-world environments.
[0085] In one embodiment, the method further includes: when the fitness of the optimal individual in the population does not meet the termination judgment rule, obtaining the continuous-time running details of the improved genetic algorithm; determining the algorithm optimization direction based on the continuous-time running details of the improved genetic algorithm; generating the next generation population based on the algorithm optimization direction; and inputting the next generation population into the improved genetic algorithm to continue a new round of iterative computation.
[0086] In improved genetic algorithms, the optimization direction is typically determined through an iterative process. This iterative process involves evaluating, selecting, crossovering, and mutating individuals (solutions) within the genetic algorithm. The process involves obtaining continuous-time runtime details of the improved genetic algorithm, i.e., understanding its iterative process; determining the optimization direction based on this process; adjusting the algorithm parameters according to the optimization direction to generate a new next-generation population; and inputting this next-generation population into the improved genetic algorithm to continue a new round of iterative computation, aiming to enable the algorithm to search for the optimal solution more effectively.
[0087] In one embodiment, the step of obtaining the continuous-time running details of the improved genetic algorithm includes: obtaining the population generated by the improved genetic algorithm within the continuous time and the fitness of the individuals in the corresponding population; analyzing the changing trend of the individual fitness with the increase of the number of iterations; evaluating the fitness and generating a fitness evaluation result; the step of determining the algorithm optimization direction based on the continuous-time running details of the improved genetic algorithm includes: determining the algorithm optimization direction based on the changing trend of the fitness with the increase of the number of iterations and the fitness evaluation result.
[0088] In this embodiment, the electrical equipment is a device with multiple operating modes or variable operating frequency, specifically, such as an adjustable frequency compressor. The historical usage information obtained includes not only the specific time points and durations of the compressor's on and off states during the operating cycle, but also the behavior information of the compressor switching from one operating mode to another.
[0089] The improved genetic algorithm's connection time execution details are obtained through log printing. This log printing method refers to a mechanism for recording detailed information during the algorithm's execution. This log printing can be viewed via a mobile terminal, where the continuous execution details of the improved genetic algorithm are presented to the user through the mobile terminal's user interface (UI) in the form of log information. Furthermore, the mobile terminal can display the log information to the user in real-time updates through a dedicated application (APP) or web interface. This allows users to conveniently view and monitor the optimization process of smart home appliances using their mobile phones.
[0090] In this embodiment, the example of determining the optimization direction by viewing the compressor frequency set through a terminal is used for illustration:
[0091] S11, Monitor the current solution: Use a mobile device to view the compressor frequency set generated by the current improved genetic algorithm;
[0092] These frequency sets represent the current generation of solutions, i.e., the operating frequency of the compressor at different times of the day.
[0093] S12, Evaluate fitness: Evaluate the fitness of each solution (frequency set);
[0094] In compressor applications, fitness metrics can include factors such as energy consumption, cost, performance, and user satisfaction. Mobile devices can display these fitness scores or other evaluation metrics.
[0095] S13, Analyze evolutionary trends: Use a mobile device to observe the trend of fitness as the number of iterations increases;
[0096] This helps identify whether the algorithm is moving towards a better solution.
[0097] S14: Determine the optimization direction: Based on the trend of the fitness as the number of iterations increases and the fitness evaluation results, determine the optimization direction of the algorithm;
[0098] S15, Adjust algorithm parameters: Adjust the algorithm parameters via mobile terminal according to the optimization direction so that the algorithm can search for the optimal solution more effectively.
[0099] S16, Log recording: The mobile terminal records and displays detailed log information for each iteration, including the fitness of individuals, the occurrence of mutations, and the results after crossover;
[0100] This information helps to gain a deeper understanding of the algorithm's operational status and optimization direction.
[0101] S17, Feedback Loop: The adjusted parameters are fed back into the algorithm to continue the next iteration until the stopping rule is met.
[0102] Existing genetic algorithms suffer from slow convergence speed and a tendency to get trapped in local minima. This embodiment improves the genetic algorithm by incorporating a direction optimization metric, thus avoiding the problem of getting trapped in local optima during global search, improving the search speed for the optimal control strategy, and facilitating the finding of the global optimum.
[0103] In one embodiment, the step of obtaining historical usage information of at least one electrical device includes: obtaining historical on and off time information, duration information, and user operation information of at least one electrical device.
[0104] In this embodiment, the historical usage information of the electrical equipment includes the on / off data of each electrical device under state changes. Specifically, it includes the specific time points and durations of the on / off states of the electrical equipment during its operating cycle, as well as user operation information. This historical usage information is used to analyze the usage patterns and habits of the electrical equipment, thereby providing a basis for optimizing the equipment's operating time.
[0105] Among them, state changes include the behavior of electrical equipment switching from a closed state to a closed state, or from a closed state to a closed state, as well as changes in operating state.
[0106] Specifically, the change of switch state: the time information of when the device switches from the off state to the on state (i.e., the device is started or powered on), or from the on state to the off state (i.e., the device is turned off or powered off);
[0107] Changes in operating status, for equipment with multiple operating modes or variable operating frequencies (such as adjustable frequency compressors), also include the behavior of switching the equipment from one operating mode to another.
[0108] In some embodiments, see Figure 4 As shown, the historical usage information includes:
[0109] Point-in-time data: The specific time points at which electrical appliances switch from an off state to an on state, and from an on state to an off state. This data is used to analyze which times of day the appliances are more likely to be used.
[0110] Duration data: The duration of each time an electrical appliance is turned on, i.e., the time span from turning it on to turning it off. This helps to understand the average duration of appliance use, as well as the frequency and duration of appliance use in different time periods.
[0111] User operation data: Device usage may be related to other factors, such as ambient temperature, humidity, lighting conditions, or other environmental variables. This data is used to more accurately predict the usage patterns of electrical appliances.
[0112] Historical data information: By analyzing the switching records of electrical appliances over a period of time, usage patterns and trends can be established, which is crucial for predicting future usage patterns and optimizing operating time.
[0113] In one embodiment, the step of determining the habitual operating range of each electrical appliance based on the historical usage information includes: constructing a usage model of the electrical appliances based on the historical usage information; and determining the habitual operating range of each electrical appliance based on the usage model.
[0114] In this embodiment, by collecting and analyzing historical usage information of electrical appliances, a usage model of the appliances can be constructed. This model determines the appliances' habitual operating range, which is then used as input to an improved genetic algorithm to effectively search for the optimal operating time within the user's habitual usage time period. This data-driven approach can significantly improve the accuracy and efficiency of the equipment operating time optimization strategy.
[0115] In one embodiment, the method further includes: acquiring information on electricity costs, user satisfaction, energy efficiency, and the lifespan of electrical equipment; and constructing a fitness function based on the information on electricity costs, user satisfaction, energy efficiency, and the lifespan of electrical equipment.
[0116] In this embodiment, each individual in the current population is evaluated using a fitness function. The fitness function is a criterion for evaluating the quality of an individual (solution), determining the probability that an individual will be selected to reproduce during the evolutionary process. The fitness function typically depends on the specific needs and objectives of the problem. In this embodiment, the fitness function is used to evaluate the operating time plan of electrical equipment, and key indicators include, but are not limited to:
[0117] Electricity costs: Calculate the electricity expenses for a specific operating period. This is usually related to the power company's pricing (such as peak and off-peak electricity prices) and the power consumption of the equipment.
[0118] User satisfaction: The device's uptime should align with users' lifestyles and comfort requirements. User satisfaction can be assessed through user-defined preferences, historical usage patterns, or direct user feedback.
[0119] Energy efficiency: The energy efficiency of equipment may vary at different times, which may be related to external factors such as temperature. Energy efficiency is taken into account in the fitness function to encourage equipment to operate during more energy-efficient periods.
[0120] Equipment lifespan: Frequent switching on and off will shorten the equipment's lifespan. The fitness function should consider reducing the number of switching operations to extend the equipment's lifespan.
[0121] There may be other key metrics for the fitness function, which are not listed in this embodiment.
[0122] In one embodiment, the fitness function can be:
[0123] Adaptability = α * (1 / electricity cost) + β * user satisfaction + γ * energy efficiency - δ * number of switching cycles.
[0124] It should be understood that, although Figure 1 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 1 At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.
[0125] Example 2
[0126] In this embodiment, as Figure 5 As shown, a method for optimizing the running time of electrical equipment is provided, including:
[0127] S1, Determine the parameter set for the actual problem.
[0128] In this embodiment, the actual problem parameter set is determined, namely, the historical usage information of at least one electrical device is obtained. This historical usage information includes the on / off data of each electrical device under state changes. Specifically, it includes the specific time points and durations of the on / off states of the electrical devices during their operating cycles, as well as user operation information.
[0129] S2 encodes the parameter set.
[0130] In this embodiment, the parameter set is encoded, that is, the habitual operating range of the electrical equipment is determined based on the historical usage information.
[0131] In this embodiment, by collecting and analyzing historical usage information of electrical equipment, a usage model of the electrical equipment can be constructed, and the habitual operating range of the electrical equipment can be determined through this usage model.
[0132] S3, Initialize the population.
[0133] In this embodiment, the initial population means that the habitual operating range of the electrical equipment is used as the initial population input into the improved genetic algorithm.
[0134] S4, Evaluation Group.
[0135] In this embodiment, the evaluation group refers to individual evaluation. The fitness of individuals in the current group is calculated using a fitness function, which is the electricity cost expenditure during a specific operating period. The optimal individual fitness of the current group is then determined.
[0136] In this embodiment, the habitual operating range of the electrical equipment is used as the initial population input into the improved genetic algorithm for iterative calculation. The fitness function is used to evaluate each individual in the current population, that is, to calculate the fitness of the individual in the current population. The fitness of the individual in the population is the electricity cost expenditure for a specific operating period, and the optimal fitness of the individual in the current population is determined.
[0137] S5 checks whether the fitness of the best individual in the population meets the termination criteria.
[0138] In this embodiment, the termination determination rule is set to detect whether the difference between the fitness of the best individual in the population and the fitness of the best individual in the previous generation is within a first preset range.
[0139] The first preset range is within ±0.5% of the fitness of the best individual in the previous generation population.
[0140] S6. When the termination decision rule is met, the individual corresponding to the fitness of the best individual in the population is output as the optimal solution.
[0141] When the difference between the fitness of the best individual in the population and the fitness of the best individual in the previous generation is within a first preset range, it indicates that the improvement of the new generation population is no longer significant, or that a sufficiently good solution has been found. Therefore, the algorithm is terminated, and the individual corresponding to the fitness of the best individual in the population is output as the optimal solution, that is, the current optimal operating time plan of the electrical equipment is output.
[0142] S7. If the termination decision rule is not met, execute S8 or S9.
[0143] S8, Selection, Crossover, and Mutation Operations: Apply the selection, crossover, and mutation operators to the current population to generate the next generation population; repeat S4 to S5 above.
[0144] In this process, selection, crossover, and mutation operators are applied to the current population to generate the next generation population. The individual evaluation and iterative process described above are repeated to obtain the optimal individual fitness of multiple populations.
[0145] S9, determine the optimization direction and obtain the continuous-time running details of the improved genetic algorithm; determine the algorithm optimization direction based on the continuous-time running details of the improved genetic algorithm; generate the next generation population based on the algorithm optimization direction; repeat S4 to S5 above.
[0146] In improved genetic algorithms, the optimization direction is typically determined through an iterative process. This iterative process involves evaluating, selecting, crossovering, and mutating individuals (solutions) within the genetic algorithm. The process involves obtaining the continuous-time execution details of the improved genetic algorithm, i.e., obtaining the iterative process over time; determining the optimization direction based on this process; adjusting the algorithm parameters according to the optimization direction to generate a new next-generation population; and inputting this next-generation population into the improved genetic algorithm to continue a new round of computation, enabling the algorithm to search for the optimal solution more effectively.
[0147] In this embodiment, optimization is performed based on an improved genetic algorithm and the optimal operating time of the electrical equipment. The improved genetic algorithm mainly includes the following:
[0148] Historical usage information-driven initial population setting: Based on the historical usage information of electrical equipment, the habitual operating range of electrical equipment is determined, and this range is used as the initial population input into the improved genetic algorithm for iterative calculation. This makes the initial population setting more reasonable and realistic, thereby improving the speed at which the algorithm converges to an effective solution, i.e., improving the search speed of the optimal control strategy.
[0149] Dynamic fitness function: Traditional genetic algorithms use static fitness functions, while genetic algorithms based on historical usage information can dynamically adjust the fitness function to reflect the actual usage and constraints of electrical equipment.
[0150] Environmental feedback involves real-time monitoring of environmental changes (such as electricity price fluctuations and changes in user behavior) and incorporating this feedback into the algorithm, enabling the solution to adapt to dynamically changing environments.
[0151] Example 3
[0152] In this embodiment, as Figure 2 As shown, an electrical equipment running time optimization device is provided, comprising:
[0153] The acquisition module 210 is used to acquire historical usage information of at least one electrical device;
[0154] The habitual operating range determination module 220 is used to determine the habitual operating range of the electrical equipment based on the historical usage information.
[0155] The fitness determination module 230 is used to input the habitual operating range as the initial population into the improved genetic algorithm for iterative calculation, and determine the fitness of the optimal individual in the population through the fitness function;
[0156] Detection module 240 is used to detect whether the fitness of the optimal individual in the population satisfies the termination judgment rule;
[0157] The optimal solution output module 250 outputs the individual corresponding to the optimal individual fitness as the optimal solution when the fitness of the optimal individual in the population satisfies the termination judgment rule.
[0158] The operation control module 260 is used to control the electrical equipment to work according to the optimal solution during a specific time period.
[0159] In one embodiment, the detection module includes: detecting whether the difference between the fitness of the optimal individual in the population and the fitness of the optimal individual in the previous generation is within a first preset range; when the fitness of the optimal individual in the population satisfies the termination determination rule, the step of outputting the individual corresponding to the fitness of the optimal individual in the population as the optimal solution includes: when the difference between the fitness of the optimal individual in the population and the fitness of the optimal individual in the previous generation is within the first preset range, outputting the individual corresponding to the fitness of the optimal individual in the population as the optimal solution.
[0160] In one embodiment, the first preset range is within ±0.5% of the fitness of the best individual in the previous generation population.
[0161] In one embodiment, the device for optimizing the running time of electrical equipment further includes: when the fitness of the optimal individual in the population does not meet the termination judgment rule, obtaining the running details of the continuous time of the improved genetic algorithm; determining the optimization direction of the algorithm based on the running details of the continuous time of the improved genetic algorithm; generating the next generation population based on the optimization direction of the algorithm; and inputting the next generation population into the improved genetic algorithm to continue a new round of calculation.
[0162] In one embodiment, the device for optimizing the running time of electrical equipment further includes: acquiring the population generated by the improved genetic algorithm over a continuous time period and the fitness of the individuals in the population; evaluating the fitness and generating a fitness evaluation result; analyzing the trend of the fitness as the number of iterations increases; and determining the optimization direction of the algorithm based on the trend of the fitness as the number of iterations increases and the fitness evaluation result.
[0163] In one embodiment, the acquisition module includes acquiring historical on / off time information, duration information, and user operation information of at least one electrical device.
[0164] In one embodiment, the fitness determination module further includes acquiring information on electricity costs, user satisfaction, energy efficiency, and the lifespan of electrical equipment; and constructing a fitness function based on the information on electricity costs, user satisfaction, energy efficiency, and the lifespan of electrical equipment.
[0165] Specific limitations regarding the device for optimizing the operating time of electrical equipment can be found in the limitations of the method for optimizing the operating time of electrical equipment mentioned above, and will not be repeated here. Each unit in the aforementioned device for optimizing the operating time of electrical equipment can be implemented entirely or partially through software, hardware, or a combination thereof. These units can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each unit.
[0166] Example 4
[0167] In this embodiment, a computer device is provided. Its internal structure diagram can be shown as follows: Figure 3 As shown, the computer device includes a processor, memory, network interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used to communicate with other computer devices that have application software deployed. When the computer program is executed by the processor, it implements a method for optimizing the operating time of electrical equipment. The display screen can be an LCD screen or an e-ink display screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the computer device casing, or an external keyboard, touchpad, or mouse.
[0168] Those skilled in the art will understand that Figure 3 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0169] In one embodiment, a computer device is provided, including a memory and a processor, the memory storing a computer program, the processor executing the computer program to perform the following steps:
[0170] Obtain historical usage information for at least one electrical appliance;
[0171] The habitual operating range of the electrical equipment is determined based on the historical usage information.
[0172] The habitual operating range is used as the initial population input into the improved genetic algorithm for iterative calculation, and the fitness of the optimal individual in the population is determined by the fitness function;
[0173] Detect whether the fitness of the optimal individual in the population satisfies the termination decision rule;
[0174] When the fitness of the best individual in the population satisfies the termination decision rule, the individual corresponding to the fitness of the best individual in the population is output as the optimal solution.
[0175] The electrical equipment is controlled to operate according to the time period corresponding to the output optimal solution.
[0176] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0177] Detect whether the difference between the fitness of the best individual in the population and the fitness of the best individual in the previous generation is within a first preset range;
[0178] When the difference between the fitness of the optimal individual in the population and the fitness of the optimal individual in the previous generation is within a first preset range, the individual corresponding to the fitness of the optimal individual in the population is output as the optimal solution.
[0179] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0180] The first preset range is within ±0.5% of the fitness of the best individual in the previous generation population.
[0181] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0182] When the fitness of the optimal individual in the population does not meet the termination criterion, obtain the continuous time running details of the improved genetic algorithm;
[0183] Based on the continuous-time execution details of the improved genetic algorithm, the optimization direction of the algorithm is determined;
[0184] The next generation population is generated based on the optimization direction found by the algorithm.
[0185] The next generation of the population is then fed into the improved genetic algorithm for a new round of computation.
[0186] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0187] Obtain the population generated by the improved genetic algorithm within a continuous time period and the fitness of the individuals in the population accordingly;
[0188] The trend of fitness as the number of iterations increases is analyzed;
[0189] Evaluate the fitness and generate fitness evaluation results;
[0190] Based on the trend of fitness as the number of iterations increases and the fitness evaluation results, the optimization direction of the algorithm is determined.
[0191] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0192] Acquire historical on / off time points, duration information, and user operation information of at least one electrical device.
[0193] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0194] Obtain information on electricity costs, user satisfaction, energy efficiency, and the lifespan of electrical equipment;
[0195] Based on the information on electricity costs, user satisfaction, energy efficiency, and the lifespan of electrical equipment, a fitness function is constructed.
[0196] Example 5
[0197] In this embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, it performs the following steps:
[0198] Obtain historical usage information for at least one electrical appliance;
[0199] The habitual operating range of the electrical equipment is determined based on the historical usage information.
[0200] The habitual operating range is used as the initial population input into the improved genetic algorithm for iterative calculation, and the fitness of the optimal individual in the population is determined by the fitness function;
[0201] Detect whether the fitness of the optimal individual in the population satisfies the termination decision rule;
[0202] When the fitness of the best individual in the population satisfies the termination decision rule, the individual corresponding to the fitness of the best individual in the population is output as the optimal solution.
[0203] The electrical equipment is controlled to operate according to the time period corresponding to the output optimal solution.
[0204] In one embodiment, when the computer program is executed by a processor, it further performs the following steps:
[0205] Detect whether the difference between the fitness of the best individual in the population and the fitness of the best individual in the previous generation is within a first preset range;
[0206] When the difference between the fitness of the optimal individual in the population and the fitness of the optimal individual in the previous generation is within a first preset range, the individual corresponding to the fitness of the optimal individual in the population is output as the optimal solution.
[0207] In one embodiment, when the computer program is executed by a processor, it further performs the following steps:
[0208] The first preset range is within ±0.5% of the fitness of the best individual in the previous generation population.
[0209] In one embodiment, when the computer program is executed by a processor, it further performs the following steps:
[0210] When the fitness of the optimal individual in the population does not meet the termination criterion, obtain the continuous time running details of the improved genetic algorithm;
[0211] Based on the continuous-time execution details of the improved genetic algorithm, the optimization direction of the algorithm is determined;
[0212] The next generation population is generated based on the optimization direction found by the algorithm.
[0213] The next generation of the population is then fed into the improved genetic algorithm for a new round of computation.
[0214] In one embodiment, when the computer program is executed by a processor, it further performs the following steps:
[0215] Obtain the population generated by the improved genetic algorithm within a continuous time period and the fitness of the individuals in the population accordingly;
[0216] The trend of fitness as the number of iterations increases is analyzed;
[0217] Evaluate the fitness and generate fitness evaluation results;
[0218] Based on the trend of fitness as the number of iterations increases and the fitness evaluation results, the optimization direction of the algorithm is determined.
[0219] In one embodiment, when the computer program is executed by a processor, it further performs the following steps:
[0220] Acquire historical on / off time points, duration information, and user operation information of at least one electrical device.
[0221] In one embodiment, when the computer program is executed by a processor, it further performs the following steps:
[0222] Obtain information on electricity costs, user satisfaction, energy efficiency, and the lifespan of electrical equipment;
[0223] Based on the information on electricity costs, user satisfaction, energy efficiency, and the lifespan of electrical equipment, a fitness function is constructed.
[0224] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0225] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0226] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A method for optimizing the operating time of electrical equipment, characterized in that, include: Obtain historical usage information for at least one electrical appliance; The habitual operating range of the electrical equipment is determined based on the historical usage information. The habitual operating range is used as the initial population input into the improved genetic algorithm for iterative calculation, and the fitness of the optimal individual in the population is determined by the fitness function; Detect whether the fitness of the optimal individual in the population satisfies the termination decision rule; When the fitness of the best individual in the population satisfies the termination decision rule, the individual corresponding to the fitness of the best individual in the population is output as the optimal solution. The electrical equipment is controlled to operate according to the time period corresponding to the output optimal solution; The step of detecting whether the fitness of the optimal individual in the population satisfies the termination rule includes: Detect whether the difference between the fitness of the best individual in the population and the fitness of the best individual in the previous generation is within a first preset range; When the fitness of the optimal individual in the population satisfies the termination criterion, the step of outputting the individual corresponding to the fitness of the optimal individual in the population as the optimal solution includes: When the difference between the fitness of the best individual in the population and the fitness of the best individual in the previous generation is within a first preset range, the individual corresponding to the fitness of the best individual in the population is output as the optimal solution. The method further includes: When the fitness of the optimal individual in the population does not meet the termination criterion, obtain the continuous time running details of the improved genetic algorithm; Based on the continuous-time execution details of the improved genetic algorithm, the optimization direction of the algorithm is determined; The next generation population is generated based on the optimization direction found by the algorithm. The next generation population is then fed into an improved genetic algorithm to continue a new round of iterative computation.
2. The method for optimizing the operating time of electrical equipment according to claim 1, characterized in that, The first preset range is ±0.5% of the fitness of the best individual in the previous generation population.
3. The method for optimizing the operating time of electrical equipment according to claim 2, characterized in that, The step of obtaining the continuous-time runtime details of the improved genetic algorithm includes: Obtain the population generated by the improved genetic algorithm within a continuous time period and the fitness of the individuals in the population accordingly; Evaluate the fitness and generate fitness evaluation results; The trend of fitness as the number of iterations increases is analyzed; The step of determining the optimization direction of the algorithm based on the continuous-time running details of the improved genetic algorithm includes: Based on the trend of fitness as the number of iterations increases and the fitness evaluation results, the optimization direction of the algorithm is determined.
4. The method for optimizing the operating time of electrical equipment according to claim 1, characterized in that, The step of obtaining historical usage information of at least one electrical device includes: Acquire historical on / off time points, duration information, and user operation information of at least one electrical device.
5. The method for optimizing the operating time of electrical equipment according to claim 1, characterized in that, The method also includes: Obtain information on electricity costs, user satisfaction, energy efficiency, and the lifespan of electrical equipment; Based on the information on electricity costs, user satisfaction, energy efficiency, and the lifespan of electrical equipment, a fitness function is constructed.
6. An electrical equipment running time optimization device, characterized in that, include: The acquisition module is used to acquire historical usage information of at least one electrical device; A habitual operating range determination module is used to determine the habitual operating range of the electrical equipment based on the historical usage information. The fitness determination module is used to input the habitual operating range as the initial population into the improved genetic algorithm for iterative calculation, and determine the fitness of the optimal individual in the population through the fitness function; The detection module is used to detect whether the fitness of the optimal individual in the population satisfies the termination judgment rule; The optimal solution output module outputs the individual corresponding to the optimal individual fitness as the optimal solution when the fitness of the best individual in the population satisfies the termination judgment rule. The operation control module is used to control the electrical equipment to work according to the optimal solution during a specific time period; The detection module is also used to detect whether the difference between the fitness of the best individual in the population and the fitness of the best individual in the previous generation is within a first preset range. The optimal solution output module is also used to output the individual corresponding to the optimal individual fitness of the population as the optimal solution when the difference between the fitness of the optimal individual in the population and the fitness of the optimal individual in the previous generation is within a first preset range. When the fitness of the optimal individual in the population does not meet the termination criterion, obtain the continuous time running details of the improved genetic algorithm; Based on the continuous-time execution details of the improved genetic algorithm, the optimization direction of the algorithm is determined; The next generation population is generated based on the optimization direction found by the algorithm. The next generation population is then fed into an improved genetic algorithm to continue a new round of iterative computation.
7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Warehouse logistics AGV path planning algorithm based on ant colony algorithm and improved genetic algorithm
CN112734324A
Household intelligent electric equipment operation optimization method and system and equipment,
CN113256118A