Power data transmission method and device
By assembling REST rules and asynchronous API calls on power data, the problem that traditional data transmission methods cannot meet the needs of large data volumes is solved, and efficient and reliable data transmission and display are achieved.
Patent Information
- Application Number
- CN202411941113.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-03-28
AI Technical Summary
Traditional power data transmission methods cannot meet the transmission needs of large data volumes, and are prone to risks such as data loss or errors.
The power data is assembled using REST rules to form a standard data packet, and the data is sent to the data access management platform for storage and display through asynchronous call.
It ensures the unity and standardization of data formats, reduces the difficulty of data analysis and processing, improves the efficiency of data transmission, simplifies data verification and display, and promptly discovers and handles abnormal data.
Smart Images

Figure CN119728794A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of data acquisition, and in particular relates to a method and device for transmitting power data. Background Art
[0002] The collection and transmission of power data in power generation systems is a core link in the operation of the power industry, which is related to the stable operation of the entire power system, efficiency optimization and effective integration of new energy. With the continuous expansion of new energy installed capacity, the scale of power data has also exploded, bringing unprecedented challenges to all aspects of power data collection, transmission, processing and display.
[0003] At present, the traditional data collection and transmission process usually uses data collection services to send the collected power data directly to the formal environment and store it in the database of the big data platform; however, as the amount of power data increases, the efficiency and reliability of data transmission become key issues; traditional data transmission methods can no longer meet the transmission requirements under large data volumes, and are prone to risks such as data loss or errors. Summary of the invention
[0004] In response to the technical problems existing in the prior art, the present invention provides a power data transmission method and device to solve the technical problem that traditional data transmission methods can no longer meet the transmission requirements under large data volumes and are prone to risks such as data loss or errors.
[0005] In order to achieve the above object, the technical solution adopted by the present invention is: The present invention provides a power data transmission method, comprising: Acquiring power data to be transmitted; Assemble the power data to be transmitted according to REST rules to obtain a standard data message; By calling the standard API in an asynchronous manner, the standard data message is sent to the data access management platform for storage and display.
[0006] Furthermore, the power data to be transmitted includes basic power data, real-time power data and power status data in the power generation system.
[0007] Furthermore, the format of the standard data message is JSON format; the standard API is a RESTful style API.
[0008] Furthermore, in the process of sending the standard data message to the data access management platform by asynchronously calling the standard API, the HTTP protocol is used for communication.
[0009] Furthermore, the process of sending the standard data message to the data access management platform for storage and display includes: When the data access management platform receives the standard data message, it uses the standard API to parse the received standard data message to obtain the data type, acquisition drive code and station code of the standard data message; According to the data type, acquisition drive code and station code of the standard data message, the received standard data message is classified according to the data type dimension, service dimension and station dimension respectively to obtain the message classification result; According to the message classification result, the received standard data message is written into the preset database or preset data table of the data access management platform.
[0010] Further, according to the message classification result, the process of writing the received standard data message into a preset database or a preset data table of the data access management platform includes: According to the collection drive code and station code of the standard data message, query the preset database of the data access management platform to obtain the query data; According to the preset unique identifier, the standard data message is compared with the query data to determine whether the standard data message is the latest data; if so, the standard data message is written into the preset database of the data access management platform according to the message classification result, and the data is displayed.
[0011] The present invention also provides a power data transmission system, comprising: A data acquisition module, used to obtain power data to be transmitted; The data assembly module is used to assemble the power data to be transmitted according to the REST rules to obtain a standard data message; The data transmission and storage module is used to call the standard API in an asynchronous manner to send the standard data message to the data access management platform for storage and display.
[0012] The present invention also provides an electronic device, comprising: a processor suitable for executing a computer program; A computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by the processor, the power data transmission system method is executed.
[0013] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the power data transmission system method is implemented.
[0014] The present invention also provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the power data transmission system method is implemented.
[0015] Compared with the prior art, the present invention has the following beneficial effects: The present invention provides a power data transmission method, which assembles the power data to be transmitted according to REST rules, and sends standard data messages to a data access management platform for storage and display by asynchronously calling a standard API. Using REST rules and standard APIs for data transmission can ensure the unification and standardization of data formats and reduce the difficulty of data parsing and processing. Secondly, the asynchronous communication method improves the efficiency of data transmission, so that data transmission is no longer limited by network delays or the response time of the other party's system. In addition, the standardized data format and asynchronous communication method make data verification simpler and more efficient, so that the power data can be intuitively viewed and analyzed through the data access management platform, and abnormal data can be discovered and processed in time.
[0016] The power data transmission system, electronic device, computer-readable storage medium and computer program product provided by the present invention have all the advantages of the above-mentioned power data transmission system method. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 A flowchart of the power data transmission method provided in Example 1; Figure 2 A structural block diagram of a power data transmission system provided in Example 2; Figure 3 This is a structural block diagram of an electronic device provided in Example 3. DETAILED DESCRIPTION
[0018] In order to make the technical problems, technical solutions and beneficial effects solved by the present invention more clearly understood, the present invention is further described in detail in the following specific embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0019] Example 1 As attached Figure 1 As shown, this embodiment 1 provides a power data transmission method, including the following steps: Step 1: Obtain power data to be transmitted, wherein the power data to be transmitted includes basic power data, real-time power data and power status data in the power generation system.
[0020] Specifically, basic power data mainly refers to data information of power grid models and equipment ledgers, which are used in the planning, design, simulation and analysis of power systems; basic power data include models, specifications, technical parameters, geographical locations and connection relationships of power equipment, as well as the structure, topology and parameter information of the power grid.
[0021] Real-time power data refers to data that reflects the dynamic operation of the power grid in real time and is used for real-time monitoring, dispatching and control of the power system; real-time power data includes voltage, current, power, frequency and load.
[0022] Power status data refers to data that reflects the operating status of power equipment and is used for status monitoring, fault diagnosis, and preventive maintenance of power equipment. Power status data includes temperature, humidity, vibration, insulation resistance, and partial discharge parameters of power equipment.
[0023] The process of obtaining the power data to be transmitted is as follows: Through the preset data collection drive service, the basic power data, real-time power data and power status data of the power system are collected to obtain the power data to be transmitted.
[0024] Step 2: Assemble the power data to be transmitted according to the REST (Representational State Transfer) rules to obtain a standard data message. The data exchange format of the standard data message is JSON format; preferably, the standard data message includes an HTTP request line, an HTTP header and an HTTP body; the HTTP request line includes a request method, a request resource path and an HTTP protocol version; taking the use of the POST method to send power data as an example, the HTTP request line is, for example, POST / electricity-data HTTP / 1.1; the HTTP header includes metadata, such as: Content-Type (indicating the data type of the request body), User-Agent (indicating client information) and authentication information; the HTTP body contains the power data to be transmitted, expressed in JSON format.
[0025] Step 3: Call the standard API asynchronously to send the standard data message to the data access management platform for storage and display. The standard API is a RESTful API, and the HTTP protocol is used for communication during the process of sending the standard data message to the data access management platform.
[0026] It should be noted that the RESTful style is a design style and development method for network applications. It is based on the HTTP protocol and can transmit data in XML or JSON format. It has the characteristics of simplicity, efficiency, easy expansion and maintenance. The RESTful style uses various request methods of the HTTP protocol to operate resources. RESTful-style network services should be stateless, that is, the server does not need to save any information about the client status.
[0027] Specifically, the following steps are included: Step 31: Create a service class, which is used to encapsulate the logic of asynchronous calls. The service class has predefined asynchronous methods, and the asynchronous methods are marked with @Async annotations.
[0028] Step 32. In the Spring Boot configuration class, configure TaskExecutor or ThreadPoolTaskExecutor as the executor of the asynchronous method. Specifically, add the @EnableAsync annotation to the configuration class and define the TaskExecutor bean.
[0029] Step 33: In the asynchronous service class, implement the method of asynchronously calling the API; specifically, use RestTemplate or WebClient to send an HTTP request, and send the standard data message as a request body to the API interface of the data access management platform.
[0030] Step 34: After receiving the standard data message, the data access management platform uses the standard API to parse the received standard data message to obtain the data type, acquisition drive code and station code of the standard data message. Specifically, the standard data message is parsed using the JACKSON library.
[0031] Step 35: According to the data type, acquisition drive code and station code of the standard data message, the received standard data message is classified according to the data type dimension, service dimension and station dimension respectively to obtain the message classification result.
[0032] Step 36: Write the received standard data message into a preset database or preset data table of the data access management platform according to the message classification result. Preferably, the data access management platform is a cloud-edge combined data access management platform for storage, display and quality monitoring of power data.
[0033] Specifically, according to the collection drive code and station code of the standard data message, the preset database of the data access management platform is queried to obtain the query data; according to the preset unique identifier, the standard data message is compared with the query data to determine whether the standard data message is the latest data; if so, the standard data message is written into the preset database of the data access management platform according to the message classification result, and the data is displayed.
[0034] It should be noted that when using the data access management platform for data display, the stored data is viewed through a web interface or other visual methods, so that users can perform data query, screening and other operations as needed to obtain the required information; among them, the specific data display and quality monitoring methods are not described here.
[0035] The power data transmission method described in this embodiment 1 assembles the collected power data into a standard data message according to the unified standard and data format specification of REST rules through a variety of different collection drive services; calls the standard API in an asynchronous manner to send the standard data message to the production and also to the cloud-edge combined data access management platform for data quality monitoring; the collection drive service in the cloud-edge combined data access management platform receives the sent standard data message by providing a standard API interface, and parses the received standard data message through the standard API to obtain the data type, collection drive code, and site code, and classifies them according to the data type dimension, service dimension, and site dimension. To distinguish the source of power data, and then classify and write the power data; in the process of classified writing, through the newly added or modified logic, with the goal of always keeping the latest data, different types of data are written into the preset database or preset data table of the cloud-edge combined data access management platform; wherein, before writing the data, the data is queried from the preset database or preset data table according to the drive code and station code, and compared according to the preset unique identifier, and when the data does not exist after the comparison, new data is added to achieve the goal of always keeping the latest data; in the cloud-edge combined data access management platform, the latest data is displayed through database query for data analysis and monitoring, thereby improving the quality of collected service data.
[0036] In this embodiment 1, REST rules and JSON format are used for data assembly and transmission, which improves the standardization and interoperability of data; the RESTful API enables the data access management platform to be easily integrated with other systems, promoting data sharing and exchange; calling the standard API in an asynchronous manner to send data improves the efficiency of data transmission and avoids the blockage and delay that may be caused by synchronous calls; Among them, the asynchronous processing mechanism of Spring Boot, such as @Async annotation and TaskExecutor, is used to make the implementation of asynchronous calls more concise and efficient; the standard data message is parsed using the JACKSON library, and information such as data type, collection drive code and station code can be quickly extracted, providing a basis for subsequent data processing and classification; the message is classified according to the data type, collection drive code and station code, making data management and query more orderly and efficient; as a cloud-edge combined platform, the data access management platform not only provides data storage and display functions, but also has the ability to monitor data quality, ensuring the accuracy and reliability of the data; by comparing the standard data message with the query data, it can be determined whether the data is the latest data, avoiding the writing and display of duplicate data, and improving the timeliness and accuracy of the data.
[0037] Example 2 As attached Figure 2 As shown, this embodiment 2 provides a power data transmission system, including a data acquisition module, a data assembly module and a data transmission and storage module.
[0038] The data acquisition module is used to obtain the power data to be transmitted; the data assembly module is used to assemble the power data to be transmitted according to the REST rules to obtain the standard data message; the data transmission and storage module is used to call the standard API in an asynchronous manner and send the standard data message to the data access management platform for storage and display.
[0039] Preferably, the data transmission and storage module described in this embodiment 2 includes a data transmission unit and a data storage unit; specifically, the data transmission unit is used to create a service class, and the service class is used to encapsulate the logic of asynchronous calls; in the configuration class of Spring Boot, TaskExecutor or ThreadPoolTaskExecutor is configured as the executor of the asynchronous method; in the asynchronous service class, the method of asynchronously calling the API is implemented; specifically, RestTemplate or WebClient is used to send an HTTP request, and the standard data message is sent as a request body to the API interface of the data access management platform; the data storage unit is used to parse the received standard data message using the standard API after the data access management platform receives the standard data message, and obtain the data type, collection drive code and station code of the standard data message; according to the data type, collection drive code and station code of the standard data message, the received standard data message is classified according to the data type dimension, service dimension and station dimension respectively to obtain the message classification result; according to the message classification result, the received standard data message is written into the preset database or preset data table of the data access management platform.
[0040] Example 3 As attached Figure 3 As shown, this embodiment 3 provides an electronic device, including: a memory for storing a computer program; and a processor for implementing the steps of the power data transmission method when executing the computer program.
[0041] When the processor executes the computer program, the steps of the above-mentioned power data transmission method are implemented, for example: Obtain the power data to be transmitted; assemble the power data to be transmitted according to REST rules to obtain a standard data message; call the standard API in an asynchronous manner to send the standard data message to the data access management platform for storage and display.
[0042] Alternatively, when the processor executes the computer program, the functions of each module in the above-mentioned power data transmission system are realized, for example: The data acquisition module is used to obtain the power data to be transmitted; the data assembly module is used to assemble the power data to be transmitted according to the REST rules to obtain the standard data message; the data transmission and storage module is used to call the standard API in an asynchronous manner and send the standard data message to the data access management platform for storage and display.
[0043] Preferably, the data transmission and storage module includes a data transmission unit and a data storage unit; specifically, the data transmission unit is used to create a service class, and the service class is used to encapsulate the logic of asynchronous calls; in the configuration class of SpringBoot, TaskExecutor or ThreadPoolTaskExecutor is configured as the executor of the asynchronous method; in the asynchronous service class, the method of asynchronously calling the API is implemented; specifically, RestTemplate or WebClient is used to send an HTTP request, and the standard data message is sent as a request body to the API interface of the data access management platform; the data storage unit is used to parse the received standard data message using the standard API after the data access management platform receives the standard data message, and obtain the data type, collection drive code and station code of the standard data message; according to the data type, collection drive code and station code of the standard data message, the received standard data message is classified according to the data type dimension, service dimension and station dimension respectively to obtain the message classification result; according to the message classification result, the received standard data message is written into the preset database or preset data table of the data access management platform.
[0044] Exemplarily, the computer program may be divided into one or more modules / units, which are stored in the memory and executed by the processor to complete the present invention. The one or more modules / units may be a series of computer program instruction segments capable of completing preset functions, and the instruction segments are used to describe the execution process of the computer program in the electronic device.
[0045] For example, the computer program can be divided into a data acquisition module, a data assembly module and a data transmission and storage module, and the specific functions of each module are as follows: the data acquisition module is used to obtain the power data to be transmitted; the data assembly module is used to assemble the power data to be transmitted according to REST rules to obtain a standard data message; the data transmission and storage module is used to call the standard API in an asynchronous manner to send the standard data message to the data access management platform for storage and display.
[0046] Preferably, the data transmission and storage module includes a data transmission unit and a data storage unit; specifically, the data transmission unit is used to create a service class, and the service class is used to encapsulate the logic of asynchronous calls; in the configuration class of SpringBoot, TaskExecutor or ThreadPoolTaskExecutor is configured as the executor of the asynchronous method; in the asynchronous service class, the method of asynchronously calling the API is implemented; specifically, RestTemplate or WebClient is used to send an HTTP request, and the standard data message is sent as a request body to the API interface of the data access management platform; the data storage unit is used to parse the received standard data message using the standard API after the data access management platform receives the standard data message, and obtain the data type, collection drive code and station code of the standard data message; according to the data type, collection drive code and station code of the standard data message, the received standard data message is classified according to the data type dimension, service dimension and station dimension respectively to obtain the message classification result; according to the message classification result, the received standard data message is written into the preset database or preset data table of the data access management platform.
[0047] The electronic device may be a computing device such as a desktop computer, a notebook, a PDA, and a cloud server. The electronic device may include, but is not limited to, a processor and a memory. Those skilled in the art will appreciate that the above are examples of electronic devices and do not constitute a limitation on the electronic device. The electronic device may include more components than the above, or a combination of certain components, or different components. For example, the electronic device may also include input and output devices, network access devices, buses, etc.
[0048] The processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the electronic device, and uses various interfaces and lines to connect various parts of the entire electronic device.
[0049] The memory may be used to store the computer programs and / or modules, and the processor implements various functions of the electronic device by running or executing the computer programs and / or modules stored in the memory and calling the data stored in the memory.
[0050] The memory may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (SmartMediaCard, SMC), a secure digital (SecureDigital, SD) card, a flash card (FlashCard), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0051] Example 4 This embodiment 4 further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the power data transmission method are implemented, for example: Obtain the power data to be transmitted; assemble the power data to be transmitted according to REST rules to obtain a standard data message; call the standard API in an asynchronous manner to send the standard data message to the data access management platform for storage and display.
[0052] If the module / unit integrated in the power data transmission system is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium.
[0053] Based on such understanding, the present invention implements all or part of the processes in the above-mentioned power data transmission method, and can also be completed by instructing related hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the above-mentioned power data transmission method can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or preset intermediate form, etc.
[0054] The computer-readable storage medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal and software distribution medium, etc.
[0055] It should be noted that the content contained in the computer-readable storage medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable storage media do not include electrical carrier signals and telecommunication signals.
[0056] Example 5 This embodiment 5 provides a computer product, which computer program product includes a computer program, which is stored in a computer-readable storage medium; the processor of the electronic device reads the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the electronic device can execute the power data transmission method described in embodiment 1, which will not be repeated here.
[0057] It should be noted that a person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing related hardware through a computer program. The program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods.
[0058] The electric power data transmission method described in the present invention is based on the REST design style, performs data transmission through the HTTP protocol, is developed based on the springboot microservice framework, and realizes the data transmission function by providing a standard API. Different collection drivers implement data transmission to the cloud-edge combined data access management platform according to the standard API specification; the latest collected data is sent to the cloud-edge combined data access management platform to ensure that platform users can timely view the content of the collected data and check the data quality.
[0059] The above embodiment is only one of the implementation methods that can realize the technical solution of the present invention. The scope of protection claimed by the present invention is not limited only to this embodiment, but also includes changes, replacements and other implementation methods that can be easily thought of by any technician familiar with the technical field within the technical scope disclosed by the present invention.
Claims
1. A method for transmitting power data, characterized in that: include: Acquiring power data to be transmitted; Assemble the power data to be transmitted according to REST rules to obtain a standard data message; By calling the standard API in an asynchronous manner, the standard data message is sent to the data access management platform for storage and display.
2. A method for transmitting power data according to claim 1, characterized in that: The power data to be transmitted includes basic power data, real-time power data and power status data in the power generation system.
3. A method for transmitting power data according to claim 1, characterized in that: The format of the standard data message is JSON format; the standard API is a RESTful style API.
4. A method for transmitting power data according to claim 1, characterized in that: In the process of sending the standard data message to the data access management platform by asynchronously calling the standard API, the HTTP protocol is used for communication.
5. A method for transmitting power data according to claim 1, characterized in that: The process of sending the standard data message to the data access management platform for storage and display includes: When the data access management platform receives the standard data message, it uses the standard API to parse the received standard data message to obtain the data type, acquisition drive code and station code of the standard data message; According to the data type, acquisition drive code and station code of the standard data message, the received standard data message is classified according to the data type dimension, service dimension and station dimension respectively to obtain the message classification result; According to the message classification result, the received standard data message is written into the preset database or preset data table of the data access management platform.
6. A method for transmitting power data according to claim 5, characterized in that: The process of writing the received standard data message into the preset database or preset data table of the data access management platform according to the message classification result includes: According to the collection drive code and station code of the standard data message, query the preset database of the data access management platform to obtain the query data; According to the preset unique identifier, the standard data message is compared with the query data to determine whether the standard data message is the latest data; if so, the standard data message is written into the preset database of the data access management platform according to the message classification result, and the data is displayed.
7. A power data transmission system, characterized in that: include: A data acquisition module, used to obtain power data to be transmitted; The data assembly module is used to assemble the power data to be transmitted according to the REST rules to obtain a standard data message; The data transmission and storage module is used to call the standard API in an asynchronous manner to send the standard data message to the data access management platform for storage and display.
8. An electronic device, characterized in that: include: a processor suitable for executing a computer program; A computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by the processor, the power data transmission system method according to any one of claims 1 to 6 is executed.
9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the power data transmission system method according to any one of claims 1 to 6 is implemented.
10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the power data transmission system method according to any one of claims 1 to 6 is implemented.
Citation Information
Cited By
Power data storage system and method
CN120011866A