Data synchronization method and device based on power system, and electronic device
By using a pre-set server in the power system to receive data frames transmitted by the terminal and synchronize them based on timestamps, a data and command connection is established, solving the problem that power grid measurement equipment cannot synchronize broadband data, and realizing high-density real-time data upload and full-network waveform synchronous measurement of the power system.
Patent Information
- Application Number
- CN202411462510.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-18
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2044-10-18
AI Technical Summary
Existing power grid measurement equipment cannot effectively synchronize broadband data of the new power system, thus failing to meet the measurement requirements of the new power system.
The system uses a pre-set server to receive data frames transmitted from multiple terminals, synchronizes them based on timestamps, establishes data and command connections, constructs data frames and command frames, and realizes data interaction and command control between terminals and the server, ensuring synchronization between sampling points of different terminals.
It enables high-density real-time synchronous uploading of broadband data from the power system, meets the dynamic measurement needs of new power systems, maintains synchronization between different terminal sampling points, and achieves synchronous measurement of waveform data across the entire network.
Smart Images

Figure CN119363768B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of power system communication, in particular to a data synchronization method based on a power system and a device thereof and an electronic device. BACKGROUND
[0002] With the continuous advancement of power system construction, the measurement of electrical quantities of the power system is no longer limited to the measurement of fundamental frequency information such as effective value and power. Especially with the access of large-scale photovoltaic and wind power, the grid frequency information becomes more abundant, and at the same time, the disturbances such as harmonics, transients, sub- / super-synchronous oscillations in the power grid become more frequent. In the power system, the power electronic characteristics of the power grid are highlighted, and the current power grid measurement technology is increasingly difficult to meet the measurement needs of the new power system (i.e. new energy power system).
[0003] The current power grid measurement equipment can be divided into fundamental frequency information measurement and wide frequency information measurement from the frequency domain width, wherein the fundamental frequency information includes voltage, current effective value, active power, reactive power, etc., and the wide frequency measurement information includes current, voltage, harmonics, etc. And from the aspect of whether the multi-point electrical quantity needs to be synchronized, it can be divided into synchronous measurement and non-synchronous measurement. Due to the obvious dynamic characteristics of the new power system, in order to accurately monitor the operating state of the new power system, synchronous wide frequency information is needed.
[0004] In related technologies, the measurement equipment (such as a voltmeter, a power meter, etc.) mainly measures the fundamental frequency information, which can upload the measurement data through the power system communication point table, and the generated communication data is small and does not need to be synchronized, and the IEC (International Electrotechnical Commission) 103 / 104 protocol or IEEE (Institute of Electrical and Electronics Engineers) 61850 protocol can meet the communication upload demand. The measurement of synchronous information of the new power system mainly relies on PMU (Phasor Measurement Unit) and other devices with clock synchronization function, however, the current PMU device only measures the fundamental frequency voltage and current phase angle, and its communication protocol is GB / T (i.e. national standard) 26865.2 and IEEE 37.118. In addition, neither the IEC 103 / 104, IEEE 61850 protocol, nor the GB / T 26865.2, IEEE 37.118 protocol can realize wide-area synchronous upload of wide frequency high-density data, therefore, a data synchronization method for the new power system is urgently needed to realize the full frequency domain waveform synchronous communication of the new power system.
[0005] Currently, there is no effective solution to the above problems. SUMMARY
[0006] Embodiments of the present application provide a data synchronization method and device based on a power system, and an electronic device, to at least solve the technical problem that wideband data of a power system cannot be effectively synchronized in the related art.
[0007] According to an aspect of embodiments of the present application, a data synchronization method based on a power system is provided, including: receiving data frames transmitted by a plurality of terminals using a preset server, wherein the terminals are deployed on a power system and are used to collect wideband data on the power system; the data frames carry timestamps; based on the timestamps, synchronizing the data frames transmitted by the plurality of terminals at each sampling point using the preset server, wherein the sampling point is a time point at which the wideband data on the power system is collected.
[0008] Further, before receiving the data frames transmitted by the plurality of terminals using the preset server, the method further includes: determining a data frame structure, wherein the data frame structure includes: a function byte and a data byte; the function byte includes at least one of the following: a data frame type field, a terminal number field, a connection state field, a sampling rate field, and a check code field; the data byte is used to store the wideband data; and converting the wideband data collected by the terminals into the data frames based on the data frame structure.
[0009] Further, before receiving the data frames transmitted by the plurality of terminals using the preset server, the method further includes: establishing a data connection between the preset server and each of the terminals; controlling each terminal to encrypt the data frames, and in the case that the encryption of the data frames is successful, controlling each of the terminals to transmit the encrypted data frames to the preset server based on the data connection.
[0010] Further, before receiving the data frames transmitted by the plurality of terminals using the preset server, the method further includes: establishing a command connection between the preset server and each of the terminals, wherein the command connection is used to realize command interaction between the terminals and the preset server through a command frame; determining a command frame structure, wherein the command frame structure includes at least: a command frame type field, a terminal number field, and a command identification field.
[0011] Further, after determining the command frame structure, further comprising: in the case that the preset service end needs to monitor a target terminal, constructing a heartbeat signal command frame based on a heartbeat signal identifier, a target terminal code of the target terminal and the command frame structure; controlling the preset service end to send the heartbeat signal command frame to the target terminal based on the command connection; and determining that the target terminal is in an online state in the case that the preset service end receives the heartbeat signal command frame returned by the target terminal within a preset time length.
[0012] Further, after determining the command frame structure, further comprising: in the case that the preset service end needs to switch the sampling rate of a target terminal, constructing a sampling rate switching command frame based on a sampling rate switching identifier, a target terminal code of the target terminal and the command frame structure; controlling the preset service end to send the sampling rate switching command frame to the target terminal based on the command connection; and controlling the target terminal to switch the data acquisition frequency at the next time point to the sampling rate carried in the sampling rate switching command frame and generating a determination response signal in the case that the target terminal determines to switch the sampling rate; and controlling the target terminal to return the determination response signal to the preset service end.
[0013] Further, after determining the command frame structure, further comprising: in the case that the preset service end needs to restart a target terminal, constructing a restart command frame based on a restart identifier, a target terminal code of the target terminal and the command frame structure; controlling the preset service end to send the restart command frame to the target terminal based on the command connection; and controlling the target terminal to restart and generating a determination response signal in the case that the target terminal determines to restart; and controlling the target terminal to return the determination response signal to the preset service end.
[0014] According to another aspect of the embodiment of the present application, a data synchronization device based on a power system is further provided, comprising: a first receiving unit, configured to receive data frames transmitted by a plurality of terminals by using a preset service end, wherein the terminals are deployed on a power system and are configured to collect wideband data on the power system; the data frames carry time stamps; and a first synchronization unit, configured to synchronize the data frames transmitted by the plurality of terminals at each sampling point by using the preset service end based on the time stamps, wherein the sampling point is a time point of collecting the wideband data on the power system.
[0015] Further, the data synchronization apparatus comprises: a first determining module, configured to determine a data frame structure before receiving data frames transmitted by a plurality of terminals via a preset server, wherein the data frame structure comprises a function byte and a data byte; the function byte comprises at least one of a data frame type field, a terminal number field, a connection state field, a sampling rate field and a check code field; and the data byte is configured to store the broadband data; and a first converting module, configured to convert the broadband data collected by the terminals into the data frames based on the data frame structure.
[0016] Further, the data synchronization apparatus further comprises: a first establishing module, configured to establish a data connection between the preset server and each of the terminals before receiving data frames transmitted by a plurality of terminals via the preset server; and a first controlling module, configured to control each of the terminals to encrypt the data frames, and to control each of the terminals to transmit the encrypted data frames to the preset server based on the data connection in a case that the encryption of the data frames is successful.
[0017] Further, the data synchronization apparatus further comprises: a second establishing module, configured to establish a command connection between the preset server and each of the terminals before receiving data frames transmitted by a plurality of terminals via the preset server, wherein the command connection is configured to realize command interaction between the terminals and the preset server via a command frame; and a second determining module, configured to determine a command frame structure, wherein the command frame structure comprises at least a command frame type field, a terminal number field and a command identification field.
[0018] Further, the data synchronization apparatus further comprises: a first constructing module, configured to construct a heartbeat signal command frame based on a heartbeat signal identification, a target terminal code of a target terminal and the command frame structure in a case that the preset server needs to monitor the target terminal after determining the command frame structure; a second controlling module, configured to control the preset server to send the heartbeat signal command frame to the target terminal based on the command connection; and a third determining module, configured to determine that the target terminal is in an online state in a case that the preset server receives the heartbeat signal command frame returned by the target terminal within a preset time length.
[0019] Further, the data synchronization apparatus further comprises a second constructing module configured to, after determining the command frame structure, construct a sampling rate switching command frame based on a sampling rate switching identifier, a target terminal code of the target terminal, and the command frame structure, in a case where the preset service end needs to switch a sampling rate of the target terminal.
[0020] Further, the data synchronization apparatus further comprises a third constructing module configured to, after determining the command frame structure, construct a restart command frame based on a restart identifier, a target terminal code of the target terminal, and the command frame structure, in a case where the preset service end needs to restart the target terminal.
[0021] According to another aspect of the embodiments of the present application, a computer program product is also provided, which comprises a non-volatile computer readable storage medium storing a computer program, and the computer program is executed by a processor to implement the power system based data synchronization method according to any one of the above.
[0022] According to another aspect of the embodiments of the present application, an electronic device is also provided, which comprises one or more processors and a memory, and the memory is configured to store one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement the power system based data synchronization method according to any one of the above.
[0023] In the present application, by adopting a preset service end to receive data frames transmitted by a plurality of terminals, and based on a timestamp, the preset service end is adopted to synchronize between each sampling point of the data frames transmitted by the plurality of terminals, thereby solving the technical problem that the wide frequency data of the power system cannot be effectively synchronized in the related art.
[0024] In the present application, the terminal deployed on the power system can collect the wideband data of voltage, current and the like of the power system, and transmit the wideband data to the preset server in the form of data frame, and then the preset server can synchronize the data frames transmitted by the plurality of terminals according to the time stamp carried by the data frames, realize the real-time transmission of the high-density sampling data of the terminal to the preset server, and at the same time, keep the synchronization between the sampling points of different terminals, so as to realize the synchronization measurement of the waveform data of the whole network, and achieve the technical effect of the wideband data synchronization of the power system. BRIEF DESCRIPTION OF DRAWINGS
[0025] The drawings described herein are used to provide further understanding of the present application, and form a part of the present application. The illustrative embodiments of the present application and their descriptions serve to explain the present application, and do not constitute improper limitations on the present application. In the drawings:
[0026] Figure 1 is a flow chart of an optional power system-based data synchronization method according to an embodiment of the present application;
[0027] Figure 2 is a schematic diagram of an optional command frame structure according to an embodiment of the present application;
[0028] Figure 3 is a schematic diagram of an optional power system-based data synchronization device according to an embodiment of the present application;
[0029] Figure 4 is a hardware structure block diagram of an electronic device (or mobile device) for a power system-based data synchronization method according to an embodiment of the present application. DETAILED DESCRIPTION
[0030] In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor should fall within the scope of protection of the present application.
[0031] It should be noted that the terms "first", "second", and the like in the description and claims of the application and the above drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the application described herein can be implemented in other than the order illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof, are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device that includes a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0032] It should be noted that the information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) collected and related to the present application are all authorized by the user or authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of related data comply with relevant laws, regulations and standards in relevant regions, necessary security measures are taken, public order and good customs are not violated, and appropriate operation portals are provided for users to choose authorization or refusal. For example, interfaces are provided between the system and related users or agencies, and before obtaining related information, the interface needs to send an acquisition request to the aforementioned user or agency, and after receiving the consent information feedback from the aforementioned user or agency, the related information is acquired.
[0033] In the present application, a full frequency domain waveform synchronization method for a new type of power system is proposed, which has the uploading capability of high sampling rate waveform level data, can expand the granularity of data, and meets the dynamic measurement demand of the new type of power system. In addition, the synchronization method can maintain the synchronization between different terminal sampling points, and through the construction of data modules (i.e. data frames and command frames), it can meet the high-density real-time uploading and synchronous uploading of data, and realize the synchronous measurement of full-network waveform data level.
[0034] In the present application, the terminal can use the satellite positioning system to synchronize the clock, and add time stamp to the collected power system voltage and current wide frequency domain data, and then transmit the high-density sampling data carrying time stamp after clock synchronization to the preset server after encryption. The preset server can analyze the data to realize the monitoring of the power system. In addition, the preset server can also send command signals to the terminal in the form of command frames, and the terminal can receive the command signals and perform corresponding operations, thereby realizing the data synchronization method of the power system, which can maintain the synchronization between different terminal sampling points, and realize the wide-area synchronous uploading of wide frequency high-density data.
[0035] The application will be described in detail below in conjunction with various embodiments.
[0036] Embodiment one
[0037] According to the embodiments of the application, an embodiment of a data synchronization method based on a power system is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described herein can be executed in an order different from that shown herein.
[0038] Figure 1 is a flowchart of an optional data synchronization method based on a power system according to the embodiments of the application, as shown in Figure 1 The method comprises the following steps:
[0039] In step S101, a plurality of terminals transmit data frames to a preset server, wherein the terminals are deployed on a power system and are used to collect wideband data on the power system; the data frames carry timestamps.
[0040] Optionally, the terminals (i.e. devices deployed on the power system) can collect voltage and current wideband data (i.e. voltage and current signal data including low frequency to high frequency, such as 0-2500 Hz) of the power system, and transmit the wideband data to the preset server (such as a master station server) in the form of data frames. The preset server can receive and process the data frames transmitted by the plurality of terminals to achieve monitoring of the power system.
[0041] In this embodiment, each terminal can perform clock synchronization through a satellite navigation system (such as GPS (Global Positioning System, Global Satellite Navigation System), BD (BeiDou Navigation Satellite System), etc.), and add timestamps (character sequences used to identify sampling time) to the sampling data (such as voltage and current wideband data of the power system, etc.). The high-density sampling data (i.e. high-frequency sampling data) synchronized by the clock and carrying the timestamps can be transmitted to the preset server in the form of data frames.
[0042] In step S102, the preset server synchronizes each sampling point based on the timestamps, wherein the sampling point is a time point of collecting wideband data on the power system.
[0043] Optionally, the sampling point is a time point of sampling the wideband data on the power system, and the preset server can synchronize the data transmitted by the plurality of terminals at the time point based on the timestamps carried by the data frames transmitted by each terminal.
[0044] In the embodiment, the preset server can also set and switch the sampling frequency and send it to the plurality of terminals, so that the terminals collect the wideband data according to the sampling frequency. In this way, the sampling frequencies of different terminals can be consistent, which is beneficial to the synchronization processing of the wideband data.
[0045] In summary, the preset server can receive the data frames transmitted by the plurality of terminals, and then synchronize the data frames transmitted by the plurality of terminals according to the time stamps carried by the data frames. This not only realizes the real-time transmission of the wideband high-density sampling data of the terminals to the preset server, but also maintains the synchronization between the sampling points of different terminals, thereby solving the technical problem that the wideband data of the power system cannot be effectively synchronized in the related art.
[0046] To determine the data frame structure, in the data synchronization method based on the power system provided in Embodiment One of the present application, the data frame structure is determined, wherein the data frame structure includes: a function byte and a data byte; the function byte includes at least one of the following: a data frame type field, a terminal number field, a connection state field, a sampling rate field, and a check code field; the data byte is used to store wideband data; and the wideband data collected by the terminal is converted into a data frame based on the data frame structure.
[0047] Optionally, the data frame structure can be constructed first, which can include: a function byte and a data byte. The function byte can include a data frame type field (i.e., a frame synchronization word, used to distinguish different frames), a terminal number field (used to distinguish different terminals), a connection state field (used to indicate whether it is connected to a synchronization clock system, for example, in a GPS system, 0 indicates an unconnected state and 1 indicates a connected state), a sampling rate field (used to indicate the current sampling frequency, for example, the sampling frequency is 3.2 kHz (KiloHertz, i.e., frequency unit), 6.4 kHz, or 12.8 kHz), and a check code field (used to detect whether an error occurs in the transmission or storage process of the data), for example, the check code field can be generated by using CRC16 (Cyclic Redundancy Check 16-bit, i.e., cyclic redundancy check code). The data byte is used to store the wideband data (such as the voltage and current data of 6 channels in three-phase alternating current) collected by the terminal.
[0048] In the embodiment, the function byte can further include a frame byte number, which is used to represent the total number of bytes of the data frame, and can further include a century second field (used to represent the number of seconds calculated from the starting point of the GPS time system) and a fractional second field, which can include the value of the fractional second and a time quality identifier, and can be used for high-precision time synchronization. For example, the system defines 5 frames of data per second, and the fractional seconds 1-5 represent the first frame to the fifth frame in the second, for example, the fractional second 1 represents the first frame in the second, and the time range is from 0 seconds to 0.2 seconds.
[0049] In the embodiment, each data frame can accommodate three-phase voltage and three-phase current sampling data of 200 ms (millisecond) duration, and the terminal can convert the collected wideband data into the format of the data frame.
[0050] For example, the data frame structure is shown in Table 1.
[0051] Table 1
[0052] Number Field Length (bytes) Description 1 SYNC 2 Frame sync word 2 FRAMESIZE 4 Frame byte number 3 IDCODE 8 Waveform measuring device identification 4 SOC 4 Century seconds 5 FRACSEC 4 Second fraction and time quality 6 STAT 2 State word corresponding to flags by bit 7 SAMPLE_SIZE 1 4 Byte number of first channel …… …… …… …… 14 SAMPLE_SIZE 6 4 Byte number of sixth channel 15 SAMPLE 1 SAMPLE_SIZE 1 Sampling data of first channel …… …… …… …… 22 SAMPLE 6 SAMPLE_SIZE 6 Sampling data of sixth channel 23 Check byte 2 CRC16 check code
[0053] In order to improve the accuracy of data transmission, in the data synchronization method based on the power system provided in Embodiment One of the present application, a data connection between a preset server and each terminal is established; each terminal is controlled to encrypt the data frame, and in the case of successful encryption of the data frame, each terminal is controlled to transmit the encrypted data frame to the preset server based on the data connection.
[0054] Optionally, the communication underlying layer between the preset server and the terminal device can use the TCP (Transmission Control Protocol) protocol. In the TCP protocol, a TCP connection (i.e., a data connection) needs to be established before data transmission. First, a data connection between the preset server and each terminal can be established, and the data transmission direction of the established data connection can be unidirectional. The terminal can transmit the sampling point data in the data frame to the preset server through the data connection to realize real-time uploading of wideband high-density data.
[0055] In the embodiment, each terminal can be controlled to encrypt the data frame to protect the transmitted wideband data, and in the case of successful encryption of the data frame, each terminal is controlled to transmit the encrypted data frame to the preset server according to the established data connection.
[0056] For example, the data frame can use a frequency of 5 Hz (hertz) for data transmission, and each data frame can include 200 ms of wideband waveform measurement data.
[0057] To realize the preset server and terminal command interaction, in the data synchronization method based on power system provided by the embodiment one of the present application, the command connection between the preset server and each terminal is established, wherein the command connection is used to realize the command interaction between the terminal and the preset server through the command frame; the command frame structure is determined, wherein the command frame structure at least includes: the command frame type field, the terminal number field, the command identification field.
[0058] Optionally, while establishing the data connection between the preset server and each terminal, the command connection between the preset server and each terminal can be established, according to the established command connection, the command interaction between the terminal and the preset server is realized through the command frame, and the terminal online state monitoring, terminal sampling rate (such as 3.2 kHz, 6.4 kHz, 12.8 kHz) switching and terminal remote restart can be realized by the preset server sending the command frame to the terminal.
[0059] In the embodiment, the command frame can include the command frame type field (i.e. frame synchronization word, used to identify different types of frames, such as AA00 can represent the command frame), the frame byte number (used to represent the total number of bytes of the command frame), the terminal number field (used to distinguish different terminals) and the command identification field (i.e. Command, CMD field, used to represent the identification of the specific command or operation carried by the command frame, for example, heartbeat signal identification, sampling rate switching identification and terminal remote restart control identification, etc.).
[0060] In the embodiment, the command frame can also include the switching sampling rate field (used to represent the sampling frequency to which the terminal needs to switch, such as the sampling frequency to which the terminal needs to switch includes 3.2 kHz, 6.4 kHz, 12.8 kHz and other different frequencies), the check code field (such as CRC16 check), when the GPS system is used for clock synchronization, the command frame can also include the century second field (used to record the time when the order is issued) and the fractional second field.
[0061] It should be noted that the fractional second field of the command frame can be set to 0.
[0062] Exemplarily, the command frame structure is shown in Table 2, wherein 001-3.2 kHz, 010-6.4 kHz, 011-12.8 kHz respectively represent the identification of 001 when switching to 3.2 kHz sampling frequency, the identification of 010 when switching to 6.4 kHz sampling frequency, and the identification of 011 when switching to 12.8 kHz sampling frequency.
[0063] Table 2
[0064]
[0065]
[0066] Figure 2 is a schematic diagram of an optional command frame structure according to an embodiment of the present invention, such as Figure 2 As shown in FIG, the command frame includes: SYNC (Synchronization), FRAMESIZE (frame size), ClientNo (terminal number), SOC (Start of Conversion, the starting point for synchronous data sampling), FRACSEC (Fractional Seconds, the fractional part of a second), CMD (Command), Sample (sampling rate), and CHK (Check, used for data verification or data integrity check). Among them, SYNC represents the synchronization word, with a byte length of 2. SYNC can start with the MSB (Most Significant Byte, i.e., the most significant byte in multi-byte data) and end with the LSB (Least Significant Byte, i.e., the least significant byte in multi-byte data). FRAMESIZE represents the number of frame bytes, with a byte length of 2. ClientNo represents the terminal device identifier, with a byte length of 8. SOC represents century seconds, with a byte length of 4. FRACSEC represents fractions of a second, with a byte length of 4. CMD represents the command byte, with a byte length of 2. Sample represents the sampling rate, with a byte length of 1. CHK represents the checksum, with a byte length of 2. The command frame can also be transmitted in the order of first transmission and last transmission. First transmission indicates the information transmitted at the beginning of the command frame, such as SYNC, FRAMESIZE, ClientNo, SOC, FRACSEC, and CMD. Last transmission indicates the information transmitted at the end of the data frame, such as Sample and CHK.
[0067] In this embodiment, the command frames sent by the preset server to the terminal include a heartbeat signal command frame, a sampling rate switching command frame, and a restart command frame. After receiving the sampling rate switching command frame and the remote restart command frame sent by the preset server, the terminal generates a positive response command frame. The heartbeat signal command frame, the sampling rate switching command frame, the restart command frame, and the positive response command frame can be distinguished by the CMD field. For example, the CMD field of the heartbeat signal command frame can be 4000, the CMD field of the sampling rate switching command frame can be C000, the CMD field of the restart command frame can be 6000, and the CMD field of the positive response command frame can be E000.
[0068] In this embodiment, the operation executed by the command frame may be represented by different command words.
[0069] Exemplarily, the command word (i.e. code or field for triggering the device to perform a specific operation) is shown in Table 3, wherein the command word includes 16-bit binary numbers, Bits 3-0 and Bits 12-4 can be set to 0, no information is transmitted, Bits 15-13 are used to define the high three bits of the command word, used to indicate the command type, including: 010, 011, 110, wherein 010 represents a heartbeat signal, used to periodically check whether the system or device is still running normally, 011 represents a restart signal, used to indicate that the device needs to be restarted or initialized, and 110 represents a switching sampling rate, used to command the device to change the frequency of data sampling. The master station (i.e. preset server) can send different command types to the slave station (i.e. terminal), for example, the preset server sends a heartbeat signal to the terminal (such as the command word set to 0100 0000 0000 0000), and the terminal returns the heartbeat signal command frame immediately after receiving the heartbeat signal; the preset server sends a sampling rate switching signal to the terminal (such as the command word set to 1100 0000 0000 0000), and the terminal returns an acknowledgement (such as 1110 0000 0000 0000) immediately after receiving the sampling rate switching signal.
[0070] Table 3
[0071]
[0072] In order to monitor the running state of the target terminal, in the data synchronization method based on the power system provided in Embodiment One of the present application, in the case that the preset server needs to monitor the target terminal, a heartbeat signal command frame is constructed based on the heartbeat signal identifier, the target terminal code of the target terminal and the command frame structure; the preset server is controlled to send the heartbeat signal command frame to the target terminal based on the command connection; and the preset server determines that the target terminal is in an online state if the heartbeat signal command frame returned by the target terminal is received within a preset time length.
[0073] Alternatively, the preset server can construct a heartbeat signal command frame according to the heartbeat identifier (i.e. command word, such as 0100 0000 0000 0000), the target terminal code of the target terminal (such as 000X) and the command frame structure, wherein the heartbeat signal command frame can include SYNC (such as AA40), FRAMESIZE (such as 0019), IDCODE (such as 000X), SOC (i.e. the moment of issuing the order), FRACSEC (such as 0), CMD (such as 4000), Sample (such as 00) and CRC16 (such as XXXX). If the preset server needs to monitor the target terminal, the preset server can be controlled to send the heartbeat signal command frame to the target terminal through the command connection, so as to realize heartbeat detection of the terminal.
[0074] In the embodiment, the preset server can send a heartbeat signal command frame to the target terminal every 10s. After receiving the heartbeat signal command frame sent by the preset server, the target terminal returns the frame through the command connection port. If the preset server receives the heartbeat signal command frame returned by the target terminal within a preset time length (for example, 1s), it can be determined that the target terminal is in an online state.
[0075] Exemplarily, the structure of the heartbeat signal command frame is shown in Table 4.
[0076] Table 4
[0077]
[0078] It should be noted that the CMD of the heartbeat signal command frame is a hexadecimal number 4000, which is converted into a binary number 01000000 0000 0000, and is used to indicate that the frame performs heartbeat monitoring.
[0079] In order to improve the accuracy of the sampling rate switching of the target terminal, in the data synchronization method based on the power system provided in Embodiment One of the present application, in the case where the preset server needs to switch the sampling rate of the target terminal, a sampling rate switching command frame is constructed based on the sampling rate switching identifier, the target terminal code of the target terminal and the command frame structure; the preset server is controlled to send the sampling rate switching command frame to the target terminal based on the command connection; in the case where the target terminal determines to switch the sampling rate, the target terminal is controlled to switch the data acquisition frequency at the next time point to the sampling rate carried by the sampling rate switching command frame, and to generate a determination response signal; and the target terminal is controlled to return the determination response signal to the preset server.
[0080] Alternatively, the preset server can construct a sampling rate switching command frame according to the sampling rate switching identifier (that is, a command word, such as 1100 0000 00000000), the target terminal code of the target terminal (such as 000X), and the command frame structure. The sampling rate switching command frame can include SYNC (such as AA40), FRAMESIZE (such as 0019), IDCODE (such as 000X), SOC (that is, the moment of issuing the order), FRACSEC (such as 0), CMD (such as C000), Sample (such as 02) and CRC16 (such as XXXX). If the preset server needs to switch the sampling rate of the target terminal, it can control the preset server to send the sampling rate switching command frame to the target terminal through the command connection, so as to make the terminal switch the sampling frequency.
[0081] Exemplarily, the structure of the sampling rate switching command frame is shown in Table 5.
[0082] Table 5
[0083]
[0084] It should be noted that the CMD in the sampling rate switching command frame structure is C000, C000 is a hexadecimal number, which is converted into binary number as 1100 0000 0000 0000, used to indicate that the frame performs terminal sampling rate switching, and the sampling rate 02 is a hexadecimal number, which is converted into binary number as 10, and can represent that the switching sampling rate is 6.4 kHz.
[0085] In the embodiment, after the target terminal receives the sampling rate switching command frame of the preset server, if agreeing to switch the sampling frequency, the target terminal can immediately return an acknowledgement command frame through the command connection, and switch the data acquisition frequency at the next time point to the sampling rate (such as 6.4 kHz) carried in the sampling rate switching command frame.
[0086] Exemplarily, the acknowledgement command frame structure is shown in Table 6.
[0087] Table 6
[0088] SYNC FRAMESIZE IDCODE SOC FRACSEC CMD Sample CRC16 AA40 0019 000X Issuing time 0 E000 00 XXXX
[0089] It should be noted that the CMD in the acknowledgement command frame is E000, E000 is a hexadecimal number, which is converted into binary number as 1110 0000 0000 0000.
[0090] In order to improve the accuracy of the target terminal restart, in the data synchronization method based on the power system provided in the first embodiment of the present application, in the case that the preset server needs to restart the target terminal, a restart command frame is constructed based on the restart identifier, the target terminal code of the target terminal and the command frame structure; the preset server is controlled to send the restart command frame to the target terminal based on the command connection; in the case that the target terminal determines to restart, the target terminal is controlled to restart, and a determination acknowledgement signal is generated; and the target terminal is controlled to return the determination acknowledgement signal to the preset server.
[0091] Optionally, the preset server can construct a restart command frame according to the restart identifier (i.e. command word, such as 0110 0000 0000 0000), the target terminal code of the target terminal and the command frame structure, and the restart command frame can include SYNC (such as AA40), FRAMESIZE (such as 0019), IDCODE (such as 000X), SOC (i.e. the moment of issuing the order), FRACSEC (such as 0), CMD (such as 6000), Sample (such as 00) and CRC16 (such as XXXX). If the preset server needs to restart the target terminal, the preset server can control the preset server to send the restart command frame to the target terminal through the command connection, so that the terminal restarts.
[0092] Exemplarily, the restart command frame structure is shown in Table 7.
[0093] Table 7
[0094]
[0095] It should be noted that the CMD in the restart command frame structure is 6000, 6000 is a hexadecimal number, converted into binary number is 0110 0000 0000 0000, used to indicate that the frame executes terminal remote restart.
[0096] In the embodiment, if the target terminal determines to restart, the determination acknowledgement signal can be generated while restarting, and the determination acknowledgement signal is returned to the preset server, so that the preset server can be enabled to know that the terminal has restarted.
[0097] In the embodiment of the application, the terminal can perform clock synchronization through a satellite positioning system, and add a timestamp to the collected power system voltage and current wide frequency domain data, then the terminal transmits the high-density sampling data carrying the timestamp after clock synchronization to the preset server after encryption, and the preset server realizes data analysis, which can realize real-time transmission of terminal high-density sampling data to the main station, maintain synchronization between different terminal sampling points, and realize network-wide waveform data level synchronization measurement. The preset server can also send command signals to the terminal in the form of command frames, to realize online state monitoring of the terminal, sampling rate adjustment of the terminal, and remote restart of the terminal.
[0098] The following will be described in detail in combination with another embodiment.
[0099] Embodiment two
[0100] The data synchronization device based on a power system provided in the embodiment comprises a plurality of implementation units, each of which corresponds to each implementation step in the above embodiment one.
[0101] Figure 3 is a schematic diagram of an optional data synchronization device based on a power system according to an embodiment of the application, as shown in Figure 3 The data synchronization device can comprise a first receiving unit 30 and a first synchronization unit 31.
[0102] The first receiving unit 30 is configured to receive data frames transmitted by a plurality of terminals using a preset server, wherein the terminals are deployed on a power system and used to collect wide frequency data on the power system; the data frames carry timestamps.
[0103] The first synchronization unit 31 is configured to synchronize each sampling point of the data frames transmitted by the plurality of terminals using the preset server based on the timestamps, wherein the sampling point is a time point of collecting the wide frequency data on the power system.
[0104] The data synchronization device can receive the data frames transmitted by the plurality of terminals through the first receiving unit 30 using the preset server, and synchronize the data frames transmitted by the plurality of terminals at each sampling point based on the time stamp using the first synchronization unit 31.
[0105] Optionally, the data synchronization device comprises a first determining module configured to determine a data frame structure before receiving the data frames transmitted by the plurality of terminals using the preset server, wherein the data frame structure comprises a function byte and a data byte; the function byte comprises at least one of a data frame type field, a terminal number field, a connection state field, a sampling rate field, and a check code field; and the data byte is configured to store the broadband data; and a first converting module configured to convert the broadband data collected by the terminal into the data frame based on the data frame structure.
[0106] Optionally, the data synchronization device further comprises a first establishing module configured to establish a data connection between the preset server and each terminal before receiving the data frames transmitted by the plurality of terminals using the preset server; and a first control module configured to control each terminal to encrypt the data frame, and control each terminal to transmit the encrypted data frame to the preset server based on the data connection in a case where the encryption of the data frame is successful.
[0107] Optionally, the data synchronization device further comprises a second establishing module configured to establish a command connection between the preset server and each terminal before receiving the data frames transmitted by the plurality of terminals using the preset server, wherein the command connection is configured to realize command interaction between the terminal and the preset server through a command frame; and a second determining module configured to determine a command frame structure, wherein the command frame structure at least comprises a command frame type field, a terminal number field, and a command identification field.
[0108] Optionally, the data synchronization device further comprises a first constructing module configured to, after determining the command frame structure, construct a heartbeat signal command frame based on a heartbeat signal identification, a target terminal code of a target terminal, and the command frame structure in a case where the preset server needs to monitor the target terminal; a second control module configured to control the preset server to send the heartbeat signal command frame to the target terminal based on the command connection; and a third determining module configured to determine that the target terminal is in an online state in a case where the preset server receives the heartbeat signal command frame returned by the target terminal within a preset time length.
[0109] Optionally, the data synchronization device further comprises: a second constructing module, configured to, after determining the command frame structure, construct a sampling rate switching command frame based on the sampling rate switching identifier, the target terminal code of the target terminal, and the command frame structure, in a case where the preset server needs to switch the sampling rate of the target terminal; a third control module, configured to control the preset server to send the sampling rate switching command frame to the target terminal based on the command connection; a fourth control module, configured to control the target terminal to switch the data collection frequency of the next time point to the sampling rate carried in the sampling rate switching command frame and generate a determination response signal in a case where the target terminal determines to perform sampling rate switching; and a fifth control module, configured to control the target terminal to return the determination response signal to the preset server.
[0110] Optionally, the data synchronization device further comprises: a third constructing module, configured to, after determining the command frame structure, construct a restart command frame based on the restart identifier, the target terminal code of the target terminal, and the command frame structure, in a case where the preset server needs to restart the target terminal; a sixth control module, configured to control the preset server to send the restart command frame to the target terminal based on the command connection; a seventh control module, configured to control the target terminal to perform restart and generate a determination response signal in a case where the target terminal determines to perform restart; and an eighth control module, configured to control the target terminal to return the determination response signal to the preset server.
[0111] The data synchronization device described above can further comprise a processor and a memory, and the first receiving unit 30, the first synchronization unit 31, and the like are stored in the memory as program units, and the corresponding functions are realized by the processor executing the program units stored in the memory.
[0112] The processor described above comprises a core, and the core retrieves the corresponding program units from the memory. The core can be one or more, and the synchronization between each sampling point is realized by adjusting the core parameters.
[0113] The memory described above can comprise a non-permanent memory in a computer readable medium, a random access memory (RAM), and / or a non-volatile memory such as a read-only memory (ROM) or a flash memory (flash RAM), and the memory comprises at least one memory chip.
[0114] According to another aspect of the embodiment of the present application, a computer program product is also provided, comprising a non-volatile computer readable storage medium, and the non-volatile computer readable storage medium stores a computer program, and the computer program is executed by a processor to realize the data synchronization method based on a power system according to any one of the above aspects.
[0115] When the computer program product is executed on the data processing device, the program initialized by the method steps is adapted to receive the data frames transmitted by the plurality of terminals by using the preset server, and synchronize the data frames transmitted by the plurality of terminals at each sampling point by using the preset server based on the time stamp.
[0116] According to another aspect of the embodiments of the present application, an electronic device is also provided, which includes one or more processors and a memory storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the above-mentioned power system based data synchronization method.
[0117] Figure 4 is a hardware structure block diagram of an electronic device (or a mobile device) for a power system based data synchronization method according to an embodiment of the present application. As shown in Figure 4 , the electronic device can include one or more processors (for example, processors 402a, 402b, …, 402n, etc. in Figure 4 , which can include but are not limited to processing devices such as microprocessors MCU or programmable logic devices FPGA, etc.), a memory 404 for storing data. In addition, it can also include a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which can be included as one of the ports of the I / O interface), a network interface, a keyboard, a power supply and / or a camera. Those skilled in the art can understand that Figure 4 , the structure shown is only schematic, which does not limit the structure of the above-mentioned electronic device. For example, the electronic device can also include more or less components than Figure 4 , or have a different configuration from Figure 4 .
[0118] The above-mentioned serial numbers of the embodiments of the present application are only for description, and do not represent the advantages and disadvantages of the embodiments.
[0119] The embodiments or examples of the present disclosure are not exhaustive, and are only a part of the embodiments or examples, and are not specific limitations on the protection scope of the present disclosure. Each step in a certain embodiment or example can be implemented as an independent example, and the steps can be combined arbitrarily, for example, a scheme after removing some steps in a certain embodiment or example can also be implemented as an independent example, and the order of the steps in a certain embodiment or example can be exchanged arbitrarily, in addition, the optional ways or optional examples in a certain embodiment or example can be combined arbitrarily; in addition, the embodiments or examples can be combined arbitrarily, for example, the steps of different embodiments or examples can be combined arbitrarily, a certain embodiment or example can be combined with the optional ways or optional examples of other embodiments or examples.
[0120] In the above-described embodiments of the present disclosure, the description of each embodiment has its own focus, and the parts not described in detail in a certain embodiment can be referred to the related description of other embodiments.
[0121] In the several embodiments of the present disclosure, it should be understood that the disclosed technology can be implemented in other ways. Of course, the embodiment described above is only a schematic, for example, the division of the units can be a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some interface, unit or module, and can be electrical or other forms.
[0122] The units described as separate components can or can not be physically separated, and the components shown as units can or can not be physical units, that is, they can be located in one place, or can be distributed on multiple units. Part or all of the units can be selected according to actual needs to achieve the purpose of the present embodiment scheme.
[0123] In addition, each functional unit in each embodiment of the present disclosure can be integrated in a processing unit, or each unit can exist physically, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.
[0124] The integrated unit, if implemented in the form of a software function unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application, essentially or in other words, the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, including a number of instructions to make a computer device (which can be a personal computer, a server or a network device, etc.) execute all or part of the steps of the methods described in various embodiments of the present application. The aforementioned storage medium includes: a U disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a mobile hard disk, a magnetic disk or an optical disk, and various media that can store program codes.
[0125] The above description is only the preferred embodiment of the present application, and it should be pointed out that for those skilled in the art, without departing from the principles of the present application, a number of improvements and refinements can be made, and these improvements and refinements should be considered as the protection scope of the present application.
Claims
1. A method for synchronizing data based on a power system, characterized by, The application comprises the following steps: Receiving data frames transmitted by multiple terminals through a preset server, wherein the terminals are deployed on a power system and used to collect wideband data on the power system; the data frames carry timestamps; Synchronizing the data frames transmitted by the multiple terminals through the preset server based on the timestamps, wherein the sampling points are time points of collecting the wideband data on the power system; Before receiving the data frames transmitted by the multiple terminals through the preset server, the application further comprises the following steps: determining a data frame structure, wherein the data frame structure comprises a function byte and a data byte; the function byte comprises at least one of the following: a data frame type field, a terminal number field, a connection state field, a sampling rate field, and a check code field; the data byte is used to store the wideband data; converting the wideband data collected by the terminals into the data frames based on the data frame structure; establishing a data connection between the preset server and each terminal; controlling each terminal to encrypt the data frames, and in the case of successful encryption of the data frames, controlling each terminal to transmit the encrypted data frames to the preset server based on the data connection; establishing a command connection between the preset server and each terminal, wherein the command connection is used to realize command interaction between the terminals and the preset server through command frames; determining a command frame structure, wherein the command frame structure at least comprises a command frame type field, a terminal number field, and a command identification field.
2. The data synchronization method of claim 1, wherein, After determining the command frame structure, the application further comprises the following steps: In the case that the preset server needs to monitor a target terminal, constructing a heartbeat signal command frame based on a heartbeat signal identification, a target terminal code of the target terminal, and the command frame structure; Controlling the preset server to send the heartbeat signal command frame to the target terminal based on the command connection; The preset server receives the heartbeat signal command frame returned by the target terminal within a preset time length, and determines that the target terminal is in an online state.
3. The data synchronization method of claim 1, wherein, After determining the command frame structure, the application further comprises the following steps: In the case that the preset server needs to switch the sampling rate of a target terminal, constructing a sampling rate switching command frame based on a sampling rate switching identification, a target terminal code of the target terminal, and the command frame structure; Controlling the preset server to send the sampling rate switching command frame to the target terminal based on the command connection; In the case that the target terminal determines to switch the sampling rate, controlling the target terminal to switch the data collection frequency of the next time point to the sampling rate carried by the sampling rate switching command frame, and generating a determination response signal; Controlling the target terminal to return the determination response signal to the preset server.
4. The data synchronization method of claim 1, wherein, After determining the command frame structure, the application further comprises the following steps: In the case that the preset server needs to restart a target terminal, constructing a restart command frame based on a restart identification, a target terminal code of the target terminal, and the command frame structure; The preset server is controlled to send the restart command frame to the target terminal based on the command connection; In a case where the target terminal determines to restart, the target terminal is controlled to restart, and a determination response signal is generated; The target terminal is controlled to return the determination response signal to the preset server.
5. A data synchronization apparatus based on a power system, characterized by comprising: Comprise: The first receiving unit is configured to receive data frames transmitted by a plurality of terminals using a preset server, wherein the terminals are deployed on a power system and are configured to collect wideband data on the power system; the data frames carry timestamps; The first synchronization unit is configured to synchronize the data frames transmitted by the plurality of terminals at each sampling point using the preset server based on the timestamps, wherein the sampling point is a time point at which the wideband data on the power system is collected; The data synchronization device comprises: a first determination module configured to determine a data frame structure before receiving the data frames transmitted by the plurality of terminals using the preset server, wherein the data frame structure comprises: a function byte and a data byte; the function byte comprises at least one of the following: a data frame type field, a terminal number field, a connection state field, a sampling rate field, and a check code field; and the data byte is configured to store the wideband data; and a first conversion module configured to convert the wideband data collected by the terminals into the data frames based on the data frame structure; The data synchronization device further comprises: a first establishment module configured to establish a data connection between the preset server and each of the terminals before receiving the data frames transmitted by the plurality of terminals using the preset server; and a first control module configured to control each terminal to encrypt the data frames, and in a case where the encryption of the data frames is successful, control each of the terminals to transmit the encrypted data frames to the preset server based on the data connection; The data synchronization device further comprises: a second establishment module configured to establish a command connection between the preset server and each of the terminals before receiving the data frames transmitted by the plurality of terminals using the preset server, wherein the command connection is configured to realize command interaction between the terminals and the preset server through command frames; and a second determination module configured to determine a command frame structure, wherein the command frame structure at least comprises: a command frame type field, a terminal number field, and a command identification field.
6. A computer program product, characterised in that, A non-volatile computer readable storage medium storing a computer program, wherein the computer program is executed by a processor to implement the power system based data synchronization method of any one of claims 1 to 4.
7. An electronic device, comprising: One or more processors and a memory, wherein the memory is configured to store one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the power system based data synchronization method of any one of claims 1 to 4.
Citation Information
Patent Citations
Multi-node synchronization sampling and data transmission method
CN101316160A
Method for improving PMU (power management unit) synchronous phasor measurement precision
CN104635094A