Distributed photovoltaic theoretical power calculation method, device, equipment and medium
By using the algorithm service of Ray distributed computing framework and theoretical power model in the cloud, the problem of large-scale data scale and fast data growth in distributed photovoltaic scenarios is solved, real-time calculation of large-scale distributed photovoltaic theoretical power is realized, and computing efficiency and resource utilization are improved.
Patent Information
- Application Number
- CN202510262139.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-06
- Publication Date
- 2025-05-30
AI Technical Summary
The large scale of data and rapid growth in distributed photovoltaic scenarios have made it difficult for traditional stand-alone computing models to meet the needs. The existing distributed computing framework has shortcomings in ease of use, flexibility and scalability.
The Ray distributed computing framework is used to implement the calculation of large-scale distributed photovoltaic theoretical power in the cloud. By deploying algorithmic services of theoretical power models, including training services and computing services, the distributed server cluster is used to process monitoring data of multiple photovoltaic power stations.
Real-time calculation of the theoretical power of hundreds of thousands of photovoltaic power stations in the cloud is realized, which greatly improves the computing efficiency of stand-alone Python services, can more accurately evaluate the power generation capacity of photovoltaic power stations, and improves resource utilization.
Smart Images

Figure CN120066736A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of photovoltaic intelligent operation and maintenance, and particularly to a method, device, equipment and medium for calculating the theoretical power of distributed photovoltaic. Background Art
[0002] Distributed photovoltaics are usually installed on the user side, such as rooftops, the ground, etc. Therefore, their scale is relatively small and the number of power stations is large. Compared with centralized photovoltaic power stations, distributed photovoltaics are flexible and easier to construct and promote. Therefore, they have developed rapidly in recent years and the number has increased sharply. In order to improve the power generation efficiency of distributed photovoltaics, precise monitoring is required for each link. For example, equipment such as each string, photovoltaic module, and inverter needs to be monitored to ensure its normal operation and power generation efficiency.
[0003] The power generation power of photovoltaic has strong volatility and randomness. Accurately restoring and calculating the theoretical power of photovoltaic power generation is of great significance for aspects such as power grid dispatching, development planning, economic benefit improvement, and system optimization. With the continuous growth of the data scale, the traditional single-machine calculation mode has been difficult to meet the requirements, and distributed calculation has emerged as the times require. However, for the problems of large data scale and fast data growth in the distributed photovoltaic scenario, there are deficiencies in usability, flexibility, and scalability in some current distributed calculation frameworks. Therefore, how to provide a solution to solve the problems of large data scale and fast data growth in the current distributed photovoltaic scenario is a problem that those skilled in the art need to solve currently. Summary of the Invention
[0004] In view of this, the purpose of the present invention is to provide a method, device, equipment and medium for calculating the theoretical power of distributed photovoltaic, which can solve the problems of large data scale and fast data growth in the current distributed photovoltaic scenario, and realize the calculation of the theoretical power of large-scale distributed photovoltaic in the cloud. The specific solutions are as follows:
[0005] In a first aspect, the present application discloses a method for calculating the theoretical power of distributed photovoltaic, which is applied to a distributed server cluster in the cloud. The distributed server cluster is used to process the monitoring data collected from multiple photovoltaic power stations. Among them, the method includes:
[0006] Start the Ray distributed computing framework and deploy the code of the algorithm service of the theoretical power model; the algorithm service includes the training service and the calculation service of the theoretical power model;
[0007] Use the Ray distributed computing framework to train the theoretical power model based on the training service according to the administrative region to which the photovoltaic power station belongs and the available resources in the distributed server cluster to obtain a target theoretical model;
[0008] Performing real-time theoretical power calculation on the PV power station by using the target theoretical power model based on the computing service.
[0009] Optionally, the process of starting the Ray distributed computing framework includes:
[0010] Determining the master server and slave servers in the server-side server;
[0011] Installing the third-party dependencies required by the algorithm service in the master server and the slave servers respectively, and starting the Ray distributed computing framework;
[0012] Using the slave servers to monitor the master server.
[0013] Optionally, the process of deploying the code of the algorithm service of the theoretical power model includes:
[0014] Deploying the server-side code and client code of the algorithm service of the theoretical power model in the K8s cluster in sequence, and connecting to the master server.
[0015] Optionally, the theoretical power calculation method for the distributed PV further includes:
[0016] Presetting a timing module in the client code;
[0017] When training the theoretical power model based on the algorithm service and calculating the theoretical power by using the theoretical power model, triggering the timing module for task timing scheduling.
[0018] Optionally, when using the Ray distributed computing framework to train the theoretical power model based on the training service according to the administrative region to which the PV power station belongs and the available resource conditions in the distributed server cluster, it includes:
[0019] Obtaining the first identification information of the PV power station, obtaining the first target parameters of the PV power station from a preset cache device according to the first identification information, and obtaining the first monitoring data within a preset time period from a preset storage device according to the first identification information;
[0020] Obtaining the first available resource conditions of each node in the distributed server cluster, and performing task allocation based on the first available resource conditions, the first target parameters, and the first monitoring data;
[0021] Submitting the allocated tasks to the Actor component in the Ray distributed computing framework to train the theoretical power model and obtain the target theoretical power model;
[0022] Store the target theoretical power model in a preset object storage server according to the region code; the region code is the code corresponding to the administrative region to which the photovoltaic power station belongs after regional division of the administrative region where the photovoltaic power station is located, and is marked for the photovoltaic power station.
[0023] Optionally, based on the computing service, performing real-time theoretical power calculation on the photovoltaic power station by using the target theoretical power model, including:
[0024] Obtain the second monitoring data that the client server consumes in real time from a preset message queue based on remote procedure call;
[0025] Determine the second identification information corresponding to the photovoltaic power station according to the second monitoring data, and obtain the second target parameter of the photovoltaic power station from the preset cache device according to the second identification information;
[0026] Obtain the second available resource status of each node in the distributed server cluster, and perform task allocation based on the second available resource status, the second target parameter, and the second monitoring data;
[0027] Load the target theoretical power model according to the region code, and submit the allocated task to the Actor component in the Ray distributed computing framework, so as to perform real-time theoretical power calculation on the photovoltaic power station by using the target theoretical power model.
[0028] Optionally, after performing real-time theoretical power calculation on the photovoltaic power station by using the target theoretical power model, further include:
[0029] Send the calculation result of the theoretical power to the target topic in the preset message queue, so that the preset storage device subscribes to and consumes the target topic in real time from the preset message queue, and stores the consumed data.
[0030] In a second aspect, the present application discloses a theoretical power calculation device for distributed photovoltaics, which is applied to a distributed server cluster in the cloud. The distributed server cluster is used to process monitoring data collected by multiple photovoltaic power stations. Among them, the device includes:
[0031] A service deployment module, configured to start a Ray distributed computing framework and deploy the code of the algorithm service of the theoretical power model; the algorithm service includes the training service and the calculation service of the theoretical power model;
[0032] A model training module, which is used to utilize the Ray distributed computing framework to train the theoretical power model based on the training service according to the administrative region to which the photovoltaic power station belongs and the available resources in the distributed server cluster, so as to obtain a target theoretical model;
[0033] A model calculation module, which is used to perform real-time theoretical power calculation on the photovoltaic power station by using the target theoretical power model based on the calculation service.
[0034] In a third aspect, the present application discloses an electronic device, which includes a processor and a memory; wherein, the memory is used to store a computer program, and the computer program is loaded and executed by the processor to implement the theoretical power calculation method for distributed photovoltaics as described above.
[0035] In a fourth aspect, the present application discloses a computer-readable storage medium, which is used to store a computer program; wherein the computer program, when executed by a processor, implements the theoretical power calculation method for distributed photovoltaics as described above.
[0036] The present application provides a theoretical power calculation method for distributed photovoltaics, which is applied to a distributed server cluster in the cloud. The distributed server cluster is used to process monitoring data collected from multiple photovoltaic power stations. Wherein, the method includes: starting the Ray distributed computing framework and deploying the code of the algorithm service of the theoretical power model; the algorithm service includes the training service and the calculation service of the theoretical power model; utilizing the Ray distributed computing framework to train the theoretical power model based on the training service according to the administrative region to which the photovoltaic power station belongs and the available resources in the distributed server cluster, so as to obtain a target theoretical model; performing real-time theoretical power calculation on the photovoltaic power station by using the target theoretical power model based on the calculation service.
[0037] The beneficial effects of the present application are as follows: By using the Ray distributed computing framework, real-time calculation of the theoretical power of hundreds of thousands of photovoltaic power stations can be completed in the cloud, greatly improving the calculation efficiency of the single-machine python service; The training and real-time calculation of the theoretical power model are regionally divided based on the administrative region, and more regional photovoltaic power generation characteristics can be learned, which is convenient for more accurately evaluating the power generation capacity of the photovoltaic power station under ideal conditions; And the computing resources can be allocated in real time according to the available resources in the cluster, improving the resource utilization rate.
[0038] In addition, a theoretical power calculation device, equipment and storage medium for distributed photovoltaics provided by the present application correspond to the above-mentioned theoretical power calculation method for distributed photovoltaics, and the effects are the same. Description of the Drawings
[0039] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the accompanying drawings required for the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only the embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can also be obtained based on the provided drawings.
[0040] Figure 1 Flowchart of a theoretical power calculation method for distributed photovoltaics disclosed in this application;
[0041] Figure 2 Schematic diagram of data acquisition disclosed in this application;
[0042] Figure 3 Flowchart of a model training stage disclosed in this application;
[0043] Figure 4 Flowchart of a theoretical power calculation stage disclosed in this application;
[0044] Figure 5 Schematic diagram of a theoretical power calculation framework for distributed photovoltaics disclosed in this application;
[0045] Figure 6 Schematic diagram of the structure of a theoretical power calculation device for distributed photovoltaics disclosed in this application;
[0046] Figure 7 Schematic diagram of the structure of an electronic device disclosed in this application. Detailed implementation manners
[0047] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present invention.
[0048] First, before describing the embodiments of this application, the problems existing in the current distributed computing framework are introduced as follows.
[0049] In recent years, distributed photovoltaics has developed rapidly and the number has increased sharply. In order to improve the efficiency of distributed photovoltaic power generation, precise monitoring is required for each link. With the continuous growth of the data scale, the traditional single-machine computing mode has been difficult to meet the requirements, and distributed computing has emerged. As an easy-to-learn and powerful programming language, Python also has extensive applications in the field of distributed computing. The following are several commonly used technical means of Python distributed computing:
[0050] 1. Multiprocessing: Python's multiprocessing module allows a program to create multiple processes, each with its own independent memory space, without interference. This makes multiprocessing an ideal choice for handling CPU (Central Processing Unit) - intensive tasks because each process can fully utilize CPU resources, improving computational efficiency.
[0051] Advantages: (1) Multiprocessing can fully utilize the resources of multi - core CPUs, distributing tasks to different CPU cores for execution, improving the program's parallel processing ability; (2) Memory isolation: Each process has an independent memory space, without affecting each other, avoiding data competition and resource conflict problems, and improving the stability and reliability of the program; (3) Multiprocessing is good at handling CPU - intensive tasks, such as data processing, scientific computing, etc., which can significantly improve computational efficiency.
[0052] Disadvantages: (1) Inter - process communication overhead: Inter - process communication needs to be carried out through mechanisms such as shared memory and message queues, which will bring certain overhead and reduce the program's efficiency; (2) Overhead of creating and destroying processes: Creating and destroying processes requires consuming certain system resources. For tasks that frequently create and destroy processes, it will reduce the program's efficiency; (3) Not suitable for I / O (Input / Output) - intensive tasks: When multiprocessing is used to handle I / O - intensive tasks, since I / O operations need to wait, it will cause CPU resource waste and reduce the program's efficiency.
[0053] 2. Threading: Python's threading module allows a program to create multiple threads within a single process. These threads share the same memory space and can access the same variables and data. Threading is suitable for handling I / O - intensive tasks, such as network communication, file reading and writing, etc., because threads can switch to other threads for execution while waiting for I / O operations, improving the program's efficiency.
[0054] Advantages: (1) Lightweight: Threads are lighter than processes, and the overhead of creating and destroying threads is smaller, making them suitable for handling a large number of short - time tasks; (2) Shared memory: Threads share the same memory space, which can facilitate data exchange and sharing, improving the program's efficiency; (3) Suitable for I / O - intensive tasks: When multithreading is used to handle I / O - intensive tasks, it can fully utilize CPU resources, improving the program's efficiency.
[0055] Disadvantages: (1) GIL (Global Interpreter Lock) limitation: Python's GIL restricts the parallel execution ability of multithreading. Only one thread can execute Python code at the same time, and it is impossible to fully utilize the resources of multi-core CPUs; (2) Data race: Threads share the same memory space. If multiple threads access the same variable simultaneously, it may lead to data race problems, and a lock mechanism needs to be used for protection; (3) Not suitable for CPU-intensive tasks: When dealing with CPU-intensive tasks, due to the limitation of GIL, multi-threading cannot fully utilize the resources of multi-core CPUs and has low efficiency.
[0056] 3. Distributed task queue (Celery): Celery is a powerful distributed task queue framework that can asynchronously distribute tasks to multiple worker nodes for execution. It supports multiple message queues, such as Redis, RabbitMQ, etc., and provides rich functions, such as task scheduling, error handling, monitoring, etc.
[0057] Advantages: (1) Asynchronous execution: Celery can asynchronously distribute tasks to multiple worker nodes for execution, improving the system response speed and throughput; (2) Scalability: Celery can easily expand the number of worker nodes as needed, improving the system processing capacity; (3) Reliability: Celery provides multiple mechanisms to ensure the reliable execution of tasks, such as task retry, error handling, etc.; (4) Flexibility and customizability: Celery provides rich functions and configuration options to meet various application requirements.
[0058] Disadvantages: (1) Complexity: The configuration and use of Celery are relatively complex and require a certain learning cost; (2) Dependency: Celery depends on message queues and worker nodes, requiring additional configuration and maintenance; (3) Performance overhead: The asynchronous execution mechanism of Celery will bring certain performance overhead, such as the communication overhead of message queues.
[0059] 4. Spark: It is an open-source distributed computing framework that provides a high-performance general computing engine and supports various application scenarios such as batch processing, streaming processing, and machine learning. Python can be integrated with Spark through the PySpark library for distributed computing.
[0060] Advantages: (1) High performance: Spark uses in-memory computing, which is more performant than traditional disk-based computing frameworks; (2) Versatility: Spark supports multiple computing modes, such as batch processing, stream processing, machine learning, etc., and can meet various application requirements; (3) Scalability: Spark can be easily scaled to hundreds of nodes, providing powerful computing capabilities; (4) Rich ecosystem: Spark has a rich ecosystem, including various libraries, tools, and applications, which is convenient for users to develop and use.
[0061] Disadvantages: (1) Learning curve: The learning curve of Spark is relatively steep, and one needs to master certain distributed computing knowledge and Spark's API (Application Program Interface); (2) Resource consumption: Spark requires a large amount of computing resources, such as memory, CPU, network bandwidth, etc.; (3) Complexity: The configuration and deployment of Spark are relatively complex and require certain professional knowledge.
[0062] Considering the problems existing in the ease of use, flexibility, and scalability of some current distributed computing frameworks, this application provides a theoretical power calculation scheme for distributed photovoltaics, which can solve the problems of large data scale and fast data growth in the current distributed photovoltaic scenario and realize the calculation of the theoretical power of large-scale distributed photovoltaics in the cloud.
[0063] An embodiment of the present invention discloses a method for calculating the theoretical power of distributed photovoltaics, which is applied to a distributed server cluster in the cloud. The distributed server cluster is used to process monitoring data collected from multiple photovoltaic power stations. Refer to Figure 1 as shown, the method includes:
[0064] Step S11: Start the Ray distributed computing framework and deploy the code of the algorithm service of the theoretical power model.
[0065] Currently, data from devices such as environmental monitors, photovoltaic inverters, and smart meters in distributed photovoltaics are connected to the cloud platform through 4G or the Internet of Things gateway, as Figure 2 shown. After the data of edge devices such as environmental monitors and photovoltaic inverters are collected in the cloud, how to efficiently calculate and store large-scale data is a challenging problem. In the embodiments of this application, a distributed server cluster applied to the cloud processes the monitoring data collected from large-scale photovoltaic power stations to achieve real-time calculation of the theoretical power.
[0066] In the embodiments of the present application, the Ray, a new-generation distributed computing framework, is utilized to implement the calculation of the theoretical power of large-scale distributed photovoltaics in the cloud. Ray is a distributed computing framework invented to provide a general API (Application Programming Interface) for distributed systems. Through simple yet general abstract programming methods, the system can automatically complete all tasks.
[0067] First, perform the preliminary work of cluster and service deployment. Specifically, determine the master server and slave servers in the server-side servers; install the third-party dependencies required for the algorithm service, such as numpy, pandas, scikit-learn, etc., in the master server and the slave servers respectively, and start the Ray distributed computing framework; use the slave servers to monitor the master server. After the master server starts Ray, this node serves as the master node of the Ray cluster; the slave servers start Ray and monitor the master node of the Ray cluster, and this node serves as the slave node of the Ray cluster. It should be noted that if it is necessary to expand the cluster resources, only the slave servers need to be added, and the steps of installing the third-party dependencies required for the algorithm service on the slave servers are repeated.
[0068] Furthermore, deploy the code of the algorithm service for the theoretical power model. Specifically, deploy the server-side code and client code of the algorithm service for the theoretical power model in the K8s cluster in sequence, and connect to the master server. It should be noted that the theoretical power model is implemented based on GRPC (Google Remote Procedure Call), which can simplify the complexity of cross-platform communication and at the same time provide high-performance communication capabilities to achieve efficient inter-service communication.
[0069] In the embodiments of the present application, the algorithm service includes the training service and calculation service of the theoretical power model. Based on the training service and calculation service, Ray is used to implement the training and calculation of the later model. In a specific implementation manner, if there is a need for a timed scheduling task during the model training and calculation, a timing module can be preset in the client code. When training the theoretical power model based on the algorithm service and calculating the theoretical power using the theoretical power model, the timing module is triggered to perform task timed scheduling.
[0070] Step S12: Utilize the Ray distributed computing framework to train the theoretical power model based on the training service according to the administrative region to which the photovoltaic power station belongs and the available resources in the distributed server cluster to obtain a target theoretical model.
[0071] In the embodiments of the present application, the training stage of the theoretical power model and the stage of real-time calculation of the theoretical power using the target theoretical power model are described respectively.
[0072] In a specific implementation manner, for the training stage of the theoretical power model, it specifically includes the following steps:
[0073] Obtain the first identification information of the photovoltaic power station, and obtain the first target parameters of the photovoltaic power station from a preset cache device according to the first identification information, and obtain the first monitoring data within a preset time period from a preset storage device according to the first identification information;
[0074] Obtain the first available resource status of each node in the distributed server cluster, and perform task allocation based on the first available resource status, the first target parameters, and the first monitoring data;
[0075] Submit the allocated tasks to the Actor component in the Ray distributed computing framework to train the theoretical power model and obtain the target theoretical power model;
[0076] Store the target theoretical power model in a preset object storage server according to the regional code; the regional code is the code corresponding to the administrative region marked for the photovoltaic power station after dividing the administrative region to which the photovoltaic power station belongs.
[0077] The following will combine Figure 3 Specifically illustrate this implementation manner. Specifically, first, when using the theoretical power model training service, start the client to obtain the photovoltaic power station ID as the first identification information and send a request to the server. After the server obtains the photovoltaic power station ID, it obtains the first target parameters of the photovoltaic power station from the preset cache device. Among them, the preset cache device mainly completes the caching of the task calculation status and the caching of the first target parameters, and can be a Redis server. The first target parameters are the specific parameters of the photovoltaic power station, such as coordinates, installed capacity, available hours, provinces and cities to which it belongs, and the ranking of available hours in the prefecture-level city, etc.
[0078] At the same time, obtain the first monitoring data within a preset time period from the preset storage device according to the photovoltaic power station ID, such as obtaining information such as the 5-minute active power curve, the 5-minute granularity horizontal irradiance of the associated ring tester, the 5-minute granularity ambient temperature, and the 5-minute granularity backplane temperature. Among them, the preset storage device mainly completes the storage of data and can be a ClickHouse server.
[0079] In the embodiments of the present application, the resource situation within the cluster is obtained in real time, and computing resources are allocated in real time according to the task volume. For example, the number of available computing nodes, the number of CPU cores, and the operating memory within the cluster are obtained. Based on the previously obtained first target parameter and the first monitoring data, tasks are evenly allocated according to the available resource situation, such as the number of CPU cores, to ensure that the computing resources can be fully utilized.
[0080] It should be noted that in the embodiments of the present application, the training process of the theoretical power model is regionally divided based on the administrative region. Specifically, according to the administrative region of the photovoltaic power station, the photovoltaic power station is divided into different regions and marked according to the region code. In this way, more regional photovoltaic power generation characteristics can be learned during the model training process, which is convenient for more accurately evaluating the power generation capacity of the photovoltaic power station under ideal conditions.
[0081] After the tasks are allocated, the allocated tasks are submitted to the Ray Actor (execution unit) for training the regional theoretical power model to obtain the target theoretical power model. The trained target theoretical power model is stored in the preset object storage server MinIO according to the region code.
[0082] Step S13: Based on the computing service, use the target theoretical power model to perform real-time theoretical power calculation on the photovoltaic power station.
[0083] In another specific implementation manner, for the stage of performing real-time theoretical power calculation using the target theoretical power model, the following steps are specifically included:
[0084] Obtain the second monitoring data that the client server consumes in real time from the preset message queue based on remote procedure call;
[0085] Determine the second identification information corresponding to the photovoltaic power station according to the second monitoring data, and obtain the second target parameter of the photovoltaic power station from the preset cache device according to the second identification information;
[0086] Obtain the second available resource situation of each node in the distributed server cluster, and perform task allocation based on the second available resource situation, the second target parameter, and the second monitoring data;
[0087] Load the target theoretical power model according to the region code, and submit the allocated tasks to the Actor component in the Ray distributed computing framework, so as to perform real-time theoretical power calculation on the photovoltaic power station using the target theoretical power model.
[0088] Next, it will be combined with Figure 4A specific description of this embodiment is given. Specifically, first, when calculating the service using the theoretical power model, the client server starts to consume the streaming data of the preset message queue Kafka in real time. The client server represents the request instructions of the user or the requests triggered by the scheduled tasks. Among them, the data input in the preset message queue is the monitoring data collected by each photovoltaic power station, usually the measured data of the edge devices. Since the theoretical power model is implemented based on GRPC, after the client consumes the streaming data of Kafka in real time, the consumed data is sent to the server through GRPC.
[0089] Furthermore, the server will obtain information such as the photovoltaic power station ID, the active power with a 5-minute granularity, the horizontal irradiance of the associated environmental monitor with a 5-minute granularity, the environmental temperature with a 5-minute granularity, and the backplane temperature with a 5-minute granularity based on the second monitoring data consumed and sent by the client. According to the photovoltaic power station ID among them, the specific parameters of the photovoltaic power station, such as coordinates, installed capacity, available hours, the provinces and cities to which it belongs, and the ranking of the available hours in the provinces and cities, are obtained from Redis.
[0090] Similarly, during model calculation, the resource situation within the cluster is obtained in real time, and the computing resources are allocated in real time according to the task volume. By obtaining the number of available computing nodes, the number of CPU cores, and the running memory within the cluster, and according to the corresponding available resource situation, such as the number of CPU cores, the tasks are evenly distributed to ensure that the computing resources can be fully utilized.
[0091] Since the training of the theoretical power model is regionally divided based on administrative regions, when the theoretical power model is calculated in real time, the target theoretical power model is loaded accordingly according to the region code marked for the photovoltaic power station. The allocated tasks will be submitted to the Ray Actor for calculation to achieve the real-time theoretical power calculation of the photovoltaic power station using the target theoretical power model.
[0092] It should be noted that when using the target theoretical power model to calculate the theoretical power of the photovoltaic power station in real time, the calculation status of the task will be cached in Redis at the same time. In this way, it is convenient to monitor the tasks that have failed in calculation using Redis and release the tasks that occupy resources in a timely manner. When necessary, the running calculation tasks can be manually killed to release and recycle the computing resources and improve the resource utilization rate.
[0093] In the embodiment of the present application, after calculating the theoretical power using the trained target theoretical power model, the calculation result is sent to the Kafka execution Topic. Specifically, the calculation result of the theoretical power is sent to the target topic in the preset message queue, so that the preset storage device can subscribe to and consume the target topic from the preset message queue in real time, and store the consumed data. It can be seen that ClickHouse is set to subscribe to and consume the Kafka specified Topic in real time, and the stream data is saved to ClickHouse to realize the data import from Kafka to ClickHouse for business use.
[0094] The present application provides a method for calculating the theoretical power of distributed photovoltaic, which is applied to a distributed server cluster in the cloud. The distributed server cluster is used to process the monitoring data collected by multiple photovoltaic power stations. Among them, the method includes: starting the Ray distributed computing framework and deploying the code of the algorithm service of the theoretical power model; the algorithm service includes the training service and the calculation service of the theoretical power model; using the Ray distributed computing framework, based on the training service, training the theoretical power model according to the administrative region to which the photovoltaic power station belongs and the available resources in the distributed server cluster to obtain a target theoretical model; based on the calculation service, using the target theoretical power model to perform real-time theoretical power calculation on the photovoltaic power station.
[0095] The beneficial effects of the present application are as follows: By using the Ray distributed computing framework, the real-time calculation of the theoretical power of hundreds of thousands of photovoltaic power stations can be completed in the cloud, greatly improving the calculation efficiency of the single-machine python service; the training and real-time calculation of the theoretical power model are regionally divided based on the administrative region, and the power generation characteristics of regional photovoltaics can be learned more, which is convenient for more accurately evaluating the power generation capacity of the photovoltaic power station under ideal conditions; and the computing resources can be allocated in real time according to the available resources in the cluster, improving the resource utilization rate.
[0096] As Figure 5 shown, a whole distributed computing system framework is provided based on the foregoing embodiment, including: a scheduling module, a K8s cluster, a ClickHouse server, a Redis server, and an algorithm service. Among them, the scheduling module mainly completes the acquisition of the task list and allocates resources and schedules tasks according to the task volume and server resource conditions; the ClickHouse server mainly completes the storage of data; the Redis server mainly completes the caching of the task calculation status; the algorithm service refers to a microservice based on GRPC, which mainly completes the calculation logic of the algorithm and is deployed in the K8s cluster. Through this computing system framework, the calculation efficiency of the key indicators of distributed photovoltaic power stations can be greatly improved under the condition of the same computing resources.
[0097] Correspondingly, the embodiment of the present application also discloses a theoretical power calculation device for distributed photovoltaics, which is applied to a distributed server cluster in the cloud. The distributed server cluster is used to process monitoring data collected from multiple photovoltaic power stations. Refer to Figure 6 As shown, the device includes:
[0098] A service deployment module 11, configured to start the Ray distributed computing framework and deploy the code of the algorithm service of the theoretical power model; the algorithm service includes the training service and the calculation service of the theoretical power model;
[0099] A model training module 12, configured to use the Ray distributed computing framework to train the theoretical power model based on the training service according to the administrative region to which the photovoltaic power station belongs and the available resources in the distributed server cluster, so as to obtain a target theoretical model;
[0100] A model calculation module, configured to perform real-time theoretical power calculation on the photovoltaic power station by using the target theoretical power model based on the calculation service.
[0101] Among them, for the more specific working processes of the above-mentioned various modules, reference can be made to the corresponding content disclosed in the foregoing embodiments, and details will not be elaborated herein.
[0102] It can be seen that through the above solution of this embodiment, which is applied to a distributed server cluster in the cloud, the distributed server cluster is used to process monitoring data collected from multiple photovoltaic power stations. Among them, the method includes: starting the Ray distributed computing framework and deploying the code of the algorithm service of the theoretical power model; the algorithm service includes the training service and the calculation service of the theoretical power model; using the Ray distributed computing framework to train the theoretical power model based on the training service according to the administrative region to which the photovoltaic power station belongs and the available resources in the distributed server cluster, so as to obtain a target theoretical model; performing real-time theoretical power calculation on the photovoltaic power station by using the target theoretical power model based on the calculation service.
[0103] The beneficial effects of the present application are as follows: By using the Ray distributed computing framework, real-time calculation of the theoretical power of hundreds of thousands of photovoltaic power stations can be completed in the cloud, greatly improving the calculation efficiency of the single-machine python service; the training and real-time calculation of the theoretical power model are regionally divided based on the administrative region, and more regional photovoltaic power generation characteristics can be learned, which is convenient for more accurately evaluating the power generation capacity of the photovoltaic power station under ideal conditions; and the computing resources can be allocated in real time according to the available resources in the cluster, improving resource utilization.
[0104] Furthermore, the embodiment of the present application also discloses an electronic deviceFigure 7 It is a structural diagram of an electronic device 20 shown according to an exemplary embodiment. The content in the figure should not be considered as any limitation on the scope of use of this application.
[0105] Figure 7 It is a schematic structural diagram of an electronic device 20 provided in an embodiment of this application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. Among them, the memory 22 is used to store a computer program, and the computer program is loaded and executed by the processor 21 to implement the relevant steps in the theoretical power method of distributed photovoltaics disclosed in any of the foregoing embodiments. In addition, the electronic device 20 in this embodiment may specifically be a server.
[0106] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows is any communication protocol applicable to the technical solution of this application, and no specific limitation is imposed on it here; the input / output interface 25 is used to obtain external input data or output data to the outside, and its specific interface type can be selected according to specific application needs, and no specific limitation is made here.
[0107] In addition, as a carrier for resource storage, the memory 22 may be a read-only memory, a random access memory, a magnetic disk, or an optical disc, etc. The resources stored thereon may include an operating system 221, a computer program 222, and data 223, etc. The data 223 may include various kinds of data. The storage method may be temporary storage or permanent storage.
[0108] Among them, the operating system 221 is used to manage and control each hardware device and the computer program 222 on the electronic device 20, and it may be Windows Server, Netware, Unix, Linux, etc. In addition to the computer program that can be used to complete the theoretical power calculation method of distributed photovoltaics executed by the electronic device 20 disclosed in any of the foregoing embodiments, the computer program 222 may further include computer programs that can be used to complete other specific tasks.
[0109] Furthermore, the embodiments of the present application also disclose a computer-readable storage medium, which includes a random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disks, magnetic disks, optical disks, or any other form of storage medium known in the technical field. Among them, when the computer program is executed by a processor, it implements the aforementioned theoretical power method for distributed photovoltaics. For the specific steps of this method, reference can be made to the corresponding content disclosed in the foregoing embodiments, and details will not be repeated here.
[0110] The various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. For the same or similar parts among the various embodiments, reference can be made to each other. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple. For related parts, reference can be made to the description in the method section.
[0111] The steps of the theoretical power calculation method or algorithm for distributed photovoltaics described in combination with the embodiments disclosed in this article can be directly implemented by hardware, software modules executed by a processor, or a combination of both. The software modules can be placed in a random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disks, removable disks, CD-ROMs, or any other form of storage medium known in the technical field.
[0112] Finally, it should also be noted that in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, article or device including the element.
[0113] The above has introduced in detail a theoretical power calculation method, device, equipment and medium for a distributed photovoltaic. Specific examples are used in this article to elaborate on the principle and implementation manner of the present invention. The description of the above embodiments is only used to help understand the method and its core idea of the present invention; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present invention.
Claims
1. A method for calculating the theoretical power of distributed photovoltaics, characterized in that: A distributed server cluster applied to the cloud, the distributed server cluster is used to process monitoring data collected by multiple photovoltaic power stations, wherein the method includes: Start the Ray distributed computing framework and deploy the code of the algorithm service of the theoretical power model; the algorithm service includes the training service and the computing service of the theoretical power model; Using the Ray distributed computing framework, based on the training service, the theoretical power model is trained according to the administrative region to which the photovoltaic power station belongs and the available resources in the distributed server cluster to obtain a target theoretical model; Based on the calculation service, the target theoretical power model is used to perform real-time theoretical power calculation on the photovoltaic power station.
2. The method for calculating the theoretical power of distributed photovoltaics according to claim 1, characterized in that: The process of starting the Ray distributed computing framework includes: Determine the master server and slave server in the server-side server; Install the third-party dependencies required by the algorithm service in the master server and the slave server respectively, and start the Ray distributed computing framework; The slave server is used to monitor the master server.
3. The method for calculating the theoretical power of distributed photovoltaics according to claim 2, characterized in that: The code of the algorithm service for deploying the theoretical power model includes: The server code and client code of the algorithm service of the theoretical power model are deployed in the K8s cluster in sequence and connected to the main server.
4. The method for calculating the theoretical power of distributed photovoltaics according to claim 3, characterized in that: Also includes: Presetting a timing module in the client code; When the theoretical power model is trained based on the algorithm service and the theoretical power is calculated using the theoretical power model, the timing module is triggered to perform task timing scheduling.
5. The method for calculating the theoretical power of distributed photovoltaics according to any one of claims 1 to 4, characterized in that: The using the Ray distributed computing framework to train the theoretical power model based on the training service according to the administrative region to which the photovoltaic power station belongs and the available resources in the distributed server cluster includes: Acquire first identification information of the photovoltaic power station, and acquire first target parameters of the photovoltaic power station from a preset cache device according to the first identification information, and acquire first monitoring data within a preset time period from a preset storage device according to the first identification information; Obtaining a first available resource status of each node in the distributed server cluster, and performing task allocation based on the first available resource status, the first target parameter, and the first monitoring data; Submitting the assigned tasks to the Actor component in the Ray distributed computing framework to train the theoretical power model to obtain a target theoretical power model; The target theoretical power model is stored in a preset object storage server according to the regional code; the regional code is a code corresponding to the administrative region marked on the photovoltaic power station after the administrative region to which the photovoltaic power station belongs is divided into regions.
6. The method for calculating the theoretical power of distributed photovoltaics according to claim 5, characterized in that: The performing real-time theoretical power calculation on the photovoltaic power station by using the target theoretical power model based on the calculation service includes: Acquire second monitoring data consumed in real time by the client server from a preset message queue based on a remote procedure call; Determine second identification information corresponding to the photovoltaic power station according to the second monitoring data, and obtain second target parameters of the photovoltaic power station from the preset cache device according to the second identification information; Obtaining a second available resource status of each node in the distributed server cluster, and performing task allocation based on the second available resource status, the second target parameter, and the second monitoring data; The target theoretical power model is loaded according to the region code, and the assigned task is submitted to the Actor component in the Ray distributed computing framework, so as to perform real-time theoretical power calculation on the photovoltaic power station using the target theoretical power model.
7. The method for calculating the theoretical power of distributed photovoltaics according to claim 6, characterized in that: After the target theoretical power model is used to calculate the real-time theoretical power of the photovoltaic power station, the method further includes: The calculation result of the theoretical power is sent to the target topic in the preset message queue, so that the preset storage device subscribes to and consumes the target topic from the preset message queue in real time and stores the consumed data.
8. A distributed photovoltaic theoretical power calculation device, characterized in that: A distributed server cluster applied to the cloud, the distributed server cluster is used to process monitoring data collected by multiple photovoltaic power stations, wherein the device includes: A service deployment module, used to start the Ray distributed computing framework and deploy the code of the algorithm service of the theoretical power model; the algorithm service includes the training service and the computing service of the theoretical power model; A model training module, used to train the theoretical power model based on the training service according to the administrative region to which the photovoltaic power station belongs and the available resources in the distributed server cluster using the Ray distributed computing framework to obtain a target theoretical model; A model calculation module is used to perform real-time theoretical power calculation on the photovoltaic power station using the target theoretical power model based on the calculation service.
9. An electronic device, characterized in that: The electronic device includes a processor and a memory; wherein the memory is used to store a computer program, and the computer program is loaded and executed by the processor to implement the theoretical power calculation method of distributed photovoltaics as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: Used to store computer programs; wherein when the computer program is executed by the processor, the theoretical power calculation method of distributed photovoltaics as described in any one of claims 1 to 7 is implemented.