A photovoltaic monitoring platform data source switching system and method based on a micro-service architecture

The photovoltaic monitoring platform data source switching system based on microservice architecture enables flexible switching and decoupling of photovoltaic equipment data sources, solving the problem that data source switching in existing technologies requires modification of business code, reducing maintenance costs and risks, and improving the system's flexibility and efficiency.

CN122332145APending Publication Date: 2026-07-03ANHUI CONCH IT ENG CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ANHUI CONCH IT ENG CO LTD
Filing Date
2026-03-18
Publication Date
2026-07-03

Smart Images

  • Figure CN122332145A_ABST
    Figure CN122332145A_ABST
Patent Text Reader

Abstract

This invention provides a data source switching system and method for a photovoltaic (PV) monitoring platform based on a microservice architecture, belonging to the field of data source construction technology. It includes a data source layer, a data storage layer, an access layer, a microservice layer, and a support service layer. The access layer sends a data query command to the microservice layer. The data routing service microservice in the microservice layer obtains the data source type of the PV device through a relational database based on the unique identifier of the PV device in the data query command. The data routing service microservice then calls the corresponding data service microservice based on the data source type of the PV device. The corresponding data service microservice performs a data query based on the data query type in the data query command. After receiving the data returned in step four, the data routing service microservice encapsulates it into a standard response format and returns it to the access layer. This invention decouples core business logic from specific data access technologies, reducing maintenance costs and error risks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of data source construction technology. Specifically, this invention relates to a data source switching system and method for a photovoltaic monitoring platform based on a microservice architecture. Background Technology

[0002] Centralized monitoring platforms for photovoltaic power plants need to collect and process operational data in real time from numerous photovoltaic devices (such as inverters, combiner boxes, and weather stations) distributed across different geographical locations. This data is collected and uploaded by various gateway acquisition devices deployed on-site. However, in actual industry practice, due to equipment model iterations, phased project construction, and differences in technology selection by different investors, the data upload and storage solutions adopted by on-site equipment exhibit significant heterogeneity.

[0003] Chinese Patent 121508130A provides a photovoltaic module management system based on wireless communication. The system includes: multiple photovoltaic modules, each photovoltaic module integrating an Internet of Things (IoT) communication module to collect operating data of the corresponding photovoltaic module; an access point, which is wirelessly connected to the IoT communication module of each photovoltaic module to manage the data collected by each IoT communication module; and a cloud server, which is connected to the access point to receive the operating data of the photovoltaic modules or send control commands to the photovoltaic modules.

[0004] Existing technologies rely on data aggregation solutions based on IoT platforms, uniformly uploading data to the cloud or local IoT platform via lightweight messaging protocols (such as MQTT). After parsing and processing the data, the platform typically provides real-time message push and historical data query APIs for business systems to call. This results in deep coupling between core business logic and specific data access technologies. When the data access method of field devices needs to be changed (e.g., migrating from the IoT platform to a local time-series database), or when support for new types of data sources (such as directly reading Kafka data streams) is required, the business layer code must be modified and retested. This not only increases maintenance costs and error risks but also makes the change process slow and inflexible. Summary of the Invention

[0005] The present invention aims to provide a data source switching system and method for a photovoltaic monitoring platform based on a microservice architecture, so as to decouple the core business logic from the specific data access technology, reduce maintenance costs and error risks.

[0006] To achieve the above objectives, the technical solution adopted by the present invention is as follows:

[0007] This invention provides a photovoltaic monitoring platform data source switching system based on a microservice architecture, characterized in that it includes a data source layer, a data storage layer, an access layer, a microservice layer, and a support service layer;

[0008] The data source layer uses gateway devices to collect operating data from photovoltaic equipment;

[0009] The data storage layer is used to store the operating data of photovoltaic equipment collected by the data source layer;

[0010] The access layer is used to issue data query commands and receive data;

[0011] The microservice layer is used to query data based on data query instructions issued by the access layer and return the data to the access layer;

[0012] The support service layer is used to store the data source types and access parameters corresponding to photovoltaic devices, and to register multiple microservices.

[0013] The gateway devices include gateway devices that upload data to the IoT platform, gateway devices that upload data to the time-series database, and gateway devices that upload data to both the IoT platform and the time-series database via dual paths.

[0014] The data storage layer includes an IoT platform, a time-series database, and a memory database. The memory database is used to cache real-time operating data of photovoltaic devices received by the IoT platform.

[0015] The access layer includes the web front-end and third-party APIs.

[0016] The microservice layer includes a data routing service microservice, an IoT data service microservice, and a time-series database data service microservice.

[0017] The supporting service layer includes a relational database and a Nacos service registry. The relational database is used to store the data source types and access parameters corresponding to photovoltaic devices, and the Nacos service registry is used to register data routing service microservices, IoT data service microservices, and time-series database data service microservices.

[0018] This invention provides a method for switching data sources in a photovoltaic monitoring platform based on a microservice architecture, comprising the following steps:

[0019] Step 1: The access layer sends a data query command to the microservice layer;

[0020] Step 2: Data routing service in the microservice layer. The microservice obtains the data source type of the photovoltaic device through a relational database based on the unique identifier of the photovoltaic device in the data query instruction.

[0021] Step 3: The data routing service microservice in the microservice layer calls the corresponding data service microservice based on the data source type of the photovoltaic device;

[0022] Step 4: The corresponding data service microservice performs data query based on the data query type in the data query instruction;

[0023] Step 5: After receiving the data returned in Step 4, the data routing service microservice encapsulates it into a standard response format and returns it to the access layer.

[0024] In step three, when the data routing service microservice determines that the data source type is MQTT, it calls the IOT data service microservice; when the data routing service microservice determines that the data source type is TDengine, it calls the time series database data service microservice; when the data routing service microservice determines that the data source type is both MQTT and TDengine dual-routing type, it calls the IOT data service microservice and the time series database data service microservice respectively.

[0025] In step four, if the data service microservice is an IoT data service microservice, then when the query type is a real-time query, it queries the operating data of the photovoltaic device from the in-memory database; when the query type is a historical query, it sends a request to the historical data interface of the IoT platform, retrieves the data, and returns it; if the data service microservice is a time-series database data service microservice, it accesses the time-series database and retrieves the data before returning it.

[0026] The technical effects of this invention are as follows:

[0027] (1) This invention manages the mapping relationship between devices and data sources through an independent configuration table, thereby achieving complete decoupling between business logic and data access logic. Adding or changing data sources does not require modifying the business code; only the configuration needs to be updated and a new data access microservice needs to be implemented.

[0028] (2) By extracting standardized interface modules, this invention forces all data access services to follow the same contract, ensuring the consistency of upstream service calling methods and reducing system complexity.

[0029] (3) This invention adopts a microservice architecture, in which each data source access service is deployed, upgraded and scaled independently. To add a new data source (such as direct access to Kafka or other types of databases), it is only necessary to develop a new microservice and implement a standardized interface, and then add the corresponding type in the configuration module, which has minimal intrusion into the existing system.

[0030] (4) The present invention adopts the optimal query path according to the characteristics of different data sources (such as querying Redis for real-time IoT data and querying the database directly for TDengine data), which takes into account both query efficiency and reasonable utilization of system resources.

[0031] (5) The front end of this invention only needs to interact with a single data routing service, and does not need to care about the actual storage location and access method of the back end data, which simplifies the front end development. Attached Figure Description

[0032] This manual includes the following figures, which illustrate the following:

[0033] Figure 1 This is a flowchart of a photovoltaic monitoring platform data source switching system and method based on a microservice architecture, according to the present invention.

[0034] Figure 2 This is a schematic diagram of the system architecture of a photovoltaic monitoring platform data source switching system and method based on microservice architecture according to the present invention. Detailed Implementation

[0035] The specific embodiments of the present invention will be further described in detail below with reference to the accompanying drawings, in order to help those skilled in the art to have a more complete, accurate and in-depth understanding of the inventive concept and technical solution of the present invention, and to facilitate its implementation.

[0036] This invention provides a photovoltaic (PV) monitoring platform data source switching system based on a microservice architecture, characterized by comprising a data source layer, a data storage layer, an access layer, a microservice layer, and a support service layer; wherein the data source layer uses a gateway device to collect operational data from PV devices; the data storage layer stores the operational data from PV devices collected by the data source layer; the access layer issues data query commands and receives data; the microservice layer queries data according to the data query commands issued by the access layer and returns the results to the access layer; and the support service layer stores the data source type and access parameters corresponding to the PV devices and registers multiple microservices.

[0037] Gateway devices include gateway devices that upload data to the IoT platform, gateway devices that upload data to the time series database, and gateway devices that upload data to both the IoT platform and the time series database via dual paths.

[0038] The data storage layer includes an IoT platform, a time-series database, and an in-memory database. The in-memory database is used to cache real-time operating data of photovoltaic devices received by the IoT platform.

[0039] The access layer includes the web front-end and third-party APIs.

[0040] The microservice layer includes data routing service microservice, IoT data service microservice, and time-series database data service microservice.

[0041] The supporting service layer includes a relational database and a Nacos service registry. The relational database is used to store the data source types and access parameters corresponding to photovoltaic devices, while the Nacos service registry is used to register data routing service microservices, IoT data service microservices, and time-series database data service microservices.

[0042] This invention provides a method for switching data sources in a photovoltaic monitoring platform based on a microservice architecture, comprising the following steps:

[0043] Step 1: The access layer sends a data query command to the microservice layer;

[0044] Step 2: Data routing service in the microservice layer. The microservice obtains the data source type of the photovoltaic device through a relational database based on the unique identifier of the photovoltaic device in the data query instruction.

[0045] Step 3: The data routing service microservice in the microservice layer calls the corresponding data service microservice based on the data source type of the photovoltaic device;

[0046] Step 4: The corresponding data service microservice performs data query based on the data query type in the data query instruction;

[0047] Step 5: After receiving the data returned in Step 4, the data routing service microservice encapsulates it into a standard response format and returns it to the access layer.

[0048] In step three, when the data routing service microservice determines that the data source type is MQTT, it calls the IOT data service microservice; when the data routing service microservice determines that the data source type is TDengine, it calls the time series database data service microservice; when the data routing service microservice determines that the data source type is both MQTT and TDengine dual-routing type, it calls the IOT data service microservice and the time series database data service microservice respectively.

[0049] In step four, if the data service microservice is an IoT data service microservice, then when the query type is a real-time query, it queries the operating data of the photovoltaic device from the in-memory database; when the query type is a historical query, it sends a request to the historical data interface of the IoT platform, retrieves the data, and returns it; if the data service microservice is a time-series database data service microservice, it accesses the time-series database and retrieves the data before returning it.

[0050] The present invention will now be described in detail.

[0051] This invention discloses a photovoltaic (PV) monitoring platform data source switching system based on a microservice architecture, comprising a data source layer, a data storage layer, an access layer, a microservice layer, and a support service layer. The data source layer utilizes gateway devices, configured according to site requirements and business needs to upload PV equipment operation data in three ways: the first type of gateway device uploads collected PV data to an IoT platform via the MQTT protocol; the second type directly uploads data to a time-series database; and the third type simultaneously uploads data via dual paths to both the IoT platform and the time-series database, enabling flexible configuration of data storage methods. In this embodiment, the time-series database uses TDengine.

[0052] The data storage layer includes an IoT platform, a time-series database, and an in-memory database, where the in-memory database is used to cache real-time operating data of photovoltaic devices received by the IoT platform.

[0053] The access layer is used to issue data query commands and receive data; the access layer includes the web front-end and third-party APIs.

[0054] The microservice layer includes a data routing service microservice, an IoT data service microservice, and a time-series database data service microservice. The data routing service microservice serves as the unified data query entry point, receiving all photovoltaic device data query commands from the access layer. Based on the unique device identifier in the query command, it determines the data source type the current device should use through a relational database. Subsequently, it uses the Dubbo framework to perform remote service calls, dynamically invoking the corresponding microservice instance in the data access service microservice and returning the result to the access layer.

[0055] The IoT data service microservice is used to process data from the IoT platform. It subscribes to the IoT platform's message queue (such as Pulsar) and persists the latest photovoltaic equipment operation data to an in-memory database (such as Redis) in real time. When querying real-time data, it directly queries the in-memory database; when querying historical data, it obtains it by calling the HTTP RESTful API provided by the IoT platform.

[0056] The Time Series Database Data Service microservice processes data from the time series database. Whether querying real-time or historical data, the process involves directly accessing the time series database (TDengine) and executing SQL statements to retrieve the result set.

[0057] The standardized query interface for data querying is a separate Java module (such as query-api), which defines a unified public entity class for device data querying and a data query service interface; the interface includes at least method declarations for querying real-time device data and querying historical device data.

[0058] The supporting service layer includes a relational database and a Nacos service registry. The relational database stores the data source types and access parameters corresponding to photovoltaic devices. In this embodiment, the relational database uses MySQL and exists in the form of a `datasource_config` table. The Nacos service registry registers data routing service microservices, IoT data service microservices, and time-series database data service microservices. The IoT data service microservice and time-series database data service microservice are specifically responsible for the actual data access operations of one type of data source and implement the interfaces defined in the standardized query interface module. Simultaneously, the implemented services are exposed as RPC services through the Dubbo framework.

[0059] The following describes in detail a data source switching method for a photovoltaic regulatory platform based on a microservice architecture.

[0060] The access layer sends a data query command to the microservice layer; the data routing service microservice in the microservice layer obtains the data source type of the photovoltaic device through a relational database based on the unique identifier of the photovoltaic device in the data query command.

[0061] The data routing service microservice in the microservice layer calls the corresponding data service microservice based on the data source type of the photovoltaic device. When the data routing service microservice determines that the data source type is MQTT, it calls the IoT data service microservice. When the data routing service microservice determines that the data source type is TDengine, it calls the time series database data service microservice. When the data routing service microservice determines that the data source type is both MQTT and TDengine dual-routing type, it calls the IoT data service microservice and the time series database data service microservice respectively.

[0062] The corresponding data service microservice performs data queries based on the data query type in the data query instruction. If the data service microservice is an IoT data service microservice, then when the query type is a real-time query, it queries the operating data of the photovoltaic device from the in-memory database; when the query type is a historical query, it sends a request to the historical data interface of the IoT platform, retrieves the data, and returns it; if the data service microservice is a time-series database data service microservice, it accesses the time-series database and retrieves the data before returning it.

[0063] After receiving the data returned from step four, the data routing service microservice encapsulates it into a standard response format and returns it to the access layer.

[0064] The present invention will now be described in detail with reference to the embodiments.

[0065] When a user needs to query the historical data of photovoltaic device DEV-001 for the past 24 hours, a GET request is used to reach the controller of the data routing service microservice (data-service). The data routing service microservice resolves the photovoltaic device ID to DEV-001, queries the datasource_config table in the relational database (MySQL), and learns that its data source type (source_type) is TDENGINE.

[0066] The data routing service microservice (data-service) initiates an RPC (Remote Procedure Call) call to the time-series database data service microservice (td-service) provider queried from the Nacos service registry via the Dubbo framework (specifically, the proxy injected by @DubboReference), calling the queryHistoricalData method.

[0067] The time-series database data service microservice (td-service) receives an RPC call and executes its internal implementation: generating time-series database SQL, executing the query, and obtaining the result set.

[0068] The time-series database data service microservice (td-service) returns the result set to the data routing service microservice (data-service) via an RPC response. The data routing service microservice (data-service) converts the data into JSON format and returns it to the access layer via an HTTP response. At this point, the user obtains the required data. The entire process is configuration-driven and utilizes the Nacos service registry and the Dubbo framework to achieve automatic service discovery and efficient invocation.

[0069] The `datasource_config` table in the aforementioned relational database (MySQL) includes fields such as `id`, `device_id` (device ID), `source_type` (an enumeration, such as `IOT`, `TDENGINE`), and `config_json` (other connection parameters). A standardized query interface (`query-api`) is packaged into a JAR file, which is depended upon by all microservices. The `DeviceDataQueryService` interface is defined within this JAR, a Dubbo service interface containing methods for real-time and historical data queries. The IoT data service microservice implements the `DeviceDataQueryService` interface, internally exposing its implementation class as a service provider using the `@DubboService` annotation and registering it with the Nacos registry. Its business logic includes: subscribing to Pulsar topics to update photovoltaic device data to an in-memory database (Redis); during queries, real-time data is retrieved from the in-memory database (Redis), and historical data is retrieved via an HTTP client calling the IoT platform API. The time-series database data service microservice also implements and exposes the `DeviceDataQueryService` interface to the Nacos registry. It internally integrates a time-series database client, directly assembling and executing SQL queries. The data routing service microservice serves as a unified entry point and is registered with the Nacos registry. Internally, it contains a Spring MVC controller that receives HTTP requests from the access layer. The controller injects a remote proxy for DeviceDataQueryService using the @DubboReference annotation. When processing a request, it first queries the relational database (MySQL) configuration table based on the deviceId to determine the data source type (source_type), and then dynamically calls the remote service provided by the IoT data service microservice or the time-series database data service microservice via Dubbo.

[0070] The beneficial effects of the present invention are described in detail below.

[0071] This invention manages the mapping relationship between devices and data sources through an independent configuration table, achieving complete decoupling between business logic and data access logic. Adding or changing data sources does not require modifying the business code; only updating the configuration and implementing a new data access microservice are needed.

[0072] This invention extracts standardized interface modules, forcing all data access services to follow the same contract, ensuring the consistency of upstream service invocation methods and reducing system complexity.

[0073] This invention employs a microservice architecture, where each data source access service is deployed, upgraded, and scaled independently. Adding a new data source (such as direct access to Kafka or other types of databases) requires only the development of a new microservice, the implementation of a standardized interface, and the addition of the corresponding type to the configuration module, resulting in minimal intrusion into the existing system.

[0074] This invention adopts the optimal query path according to the characteristics of different data sources (such as querying Redis for real-time IoT data and directly querying the database for TDengine data), which takes into account both query efficiency and rational utilization of system resources.

[0075] The front end of this invention only needs to interact with a single data routing service, without having to care about the actual storage location and access method of the backend data, thus simplifying front end development.

[0076] The present invention has been described above by way of example with reference to the accompanying drawings. Obviously, the specific implementation of the present invention is not limited to the above-described manner. Any non-substantial improvements made using the inventive concept and technical solution of the present invention, or the direct application of the inventive concept and technical solution of the present invention to other occasions without modification, are all within the protection scope of the present invention.

Claims

1. A data source switching system of a photovoltaic supervision platform based on a micro-service architecture, characterized in that: It includes the data source layer, data storage layer, access layer, microservice layer, and support service layer; The data source layer uses gateway devices to collect operating data from photovoltaic equipment; The data storage layer is used to store the operating data of photovoltaic equipment collected by the data source layer; The access layer is used to issue data query commands and receive data; The microservice layer is used to query data based on the data query instructions issued by the access layer and return the data to the access layer; The support service layer is used to store the data source types and access parameters corresponding to photovoltaic devices, and to register multiple microservices.

2. The photovoltaic monitoring platform data source switching system based on a microservice architecture as described in claim 1, characterized in that: The gateway devices include gateway devices that upload data to the IoT platform, gateway devices that upload data to the time-series database, and gateway devices that upload data to both the IoT platform and the time-series database via dual paths.

3. The photovoltaic monitoring platform data source switching system based on a microservice architecture as described in claim 1, characterized in that: The data storage layer includes an IoT platform, a time-series database, and a memory database. The memory database is used to cache real-time operating data of photovoltaic devices received by the IoT platform.

4. The photovoltaic monitoring platform data source switching system based on a microservice architecture as described in claim 1, characterized in that: The access layer includes the web front-end and third-party APIs.

5. The photovoltaic monitoring platform data source switching system based on a microservice architecture as described in claim 1, characterized in that: The microservice layer includes a data routing service microservice, an IoT data service microservice, and a time-series database data service microservice.

6. The photovoltaic monitoring platform data source switching system based on a microservice architecture as described in claim 1, characterized in that: The supporting service layer includes a relational database and a Nacos service registry. The relational database is used to store the data source types and access parameters corresponding to photovoltaic devices, and the Nacos service registry is used to register data routing service microservices, IoT data service microservices, and time-series database data service microservices.

7. A method for switching data source systems of a photovoltaic monitoring platform based on a microservice architecture as described in any one of claims 1-6, characterized in that: Includes the following steps: Step 1: The access layer sends a data query command to the microservice layer; Step 2: Data routing service in the microservice layer. The microservice obtains the data source type of the photovoltaic device through a relational database based on the unique identifier of the photovoltaic device in the data query instruction. Step 3: The data routing service microservice in the microservice layer calls the corresponding data service microservice based on the data source type of the photovoltaic device; Step 4: The corresponding data service microservice performs data query based on the data query type in the data query instruction; Step 5: After receiving the data returned in Step 4, the data routing service microservice encapsulates it into a standard response format and returns it to the access layer.

8. The data source switching method for a photovoltaic monitoring platform based on a microservice architecture as described in claim 7, characterized in that: In step three, when the data routing service microservice determines that the data source type is MQTT, it calls the IoT data service microservice. When the data routing service microservice determines that the data source type is TDengine, it calls the time-series database data service microservice. When the data routing service microservice determines that the data source type is MQTT and TDengine dual-routing type, it calls the IOT data service microservice and the time-series database data service microservice respectively.

9. The data source switching method for a photovoltaic monitoring platform based on a microservice architecture as described in claim 7, characterized in that: In step four, if the data service microservice is an IoT data service microservice, then when the query type is real-time query, the operating data of the photovoltaic device is queried from the in-memory database. When the query type is historical query, a request is sent to the historical data interface of the IoT platform, the data is retrieved and returned; If the data service microservice is a time-series database data service microservice, it accesses the time-series database and returns the data after retrieving it.

Citation Information

Patent Citations

  • Photovoltaic module management system based on wireless communication

    CN121508130A