Electric power data hierarchical statistical method and system based on block chain
Through the blockchain-based power data hierarchical statistical method, clustering terminal acquisition equipment, creating a matrix and building three-dimensional blocks, the problem of isolation of power data is solved and more accurate regional power consumption analysis is achieved.
Patent Information
- Application Number
- CN202411673982.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-21
- Publication Date
- 2025-02-28
AI Technical Summary
In the existing power data storage architecture, power data is usually isolated and cannot accurately reflect its regional characteristics, resulting in the analysis results that are inconsistent with the actual situation.
Through the blockchain-based power data hierarchical statistical method, the installation location of the terminal acquisition equipment is queried, clustered, created a matrix for data statistics, and constructed three-dimensional blocks to achieve non-isolated data statistics.
It effectively avoids data isolation, provides a more realistic power data statistical architecture, and can more accurately reflect regional power consumption.
Smart Images

Figure CN119537447A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of power data statistics, and specifically to a blockchain-based power data hierarchical statistics method and system. Background Art
[0002] The importance of electricity data is self-evident. By analyzing electricity data, we can obtain the electricity consumption in a region and then update the electricity consumption control measures. The accuracy of electricity data is very high. In the existing technology, blockchain technology is usually used for statistical storage, relying on the decentralization, immutability and traceability of blockchain technology to achieve multi-level statistics and analysis of electricity data.
[0003] However, in the existing power data storage architecture, the power data obtained is generally isolated, and the power data actually has obvious regional characteristics, so isolated analysis of power data has the risk of not being consistent with the actual situation. Therefore, how to provide a more practical, non-isolated data statistics architecture is the technical problem that the technical solution of the present invention aims to solve. Summary of the invention
[0004] The purpose of the present invention is to provide a blockchain-based power data hierarchical statistical method and system to solve the problems raised in the above-mentioned background technology.
[0005] To achieve the above object, the present invention provides the following technical solutions:
[0006] A blockchain-based power data hierarchical statistical method and system, the method comprising:
[0007] Querying the installation locations of terminal acquisition devices, and clustering the terminal acquisition devices according to the installation locations;
[0008] Create a matrix corresponding to each type of terminal collection device, and count the data uploaded by each terminal collection device based on the matrix;
[0009] Receiving a hierarchical structure set by an administrator, reading a matrix based on the hierarchical structure, and constructing a three-dimensional block; the three-dimensional block is a three-dimensional matrix, and the third dimension represents time;
[0010] Identify the three-dimensional block and determine the display color value of the point;
[0011] In the process of identifying the three-dimensional block, the displayed color value of a certain point is correlated with the deviation of the data at the point in three dimensions.
[0012] Furthermore, the step of querying the installation location of the terminal acquisition device and clustering the terminal acquisition devices according to the installation location includes:
[0013] Query the installation location of the terminal collection device and calculate the distance between any two terminal collection devices;
[0014] Receive the K value pre-set by the staff and select K initial centers from all terminal collection devices;
[0015] Allocate each terminal collection device to K initial centers based on the distance, and after the allocation is completed, update the K initial centers;
[0016] The loop is executed until the update distance of the K initial centers is less than the preset threshold, and the clustering result is input.
[0017] Furthermore, the step of querying the installation location of the terminal acquisition device and clustering the terminal acquisition devices according to the installation location also includes:
[0018] Taking the current time as the end time, read the collected data before the preset time period;
[0019] Performing Fourier transformation on the acquired data to obtain a harmonic function; the harmonic function is in the form of a trigonometric function, the number of harmonic functions is a preset value, and the first term is called a fundamental wave function;
[0020] Extracting the amplitude, frequency and phase of the harmonic function as the characteristics of the collected data;
[0021] Compare the features corresponding to different terminal acquisition devices and update the distance;
[0022] The updating process of the distance is:
[0023] d ′ =(1+C)d;
[0024] Where, d ′ is the distance after update, d is the distance before update, C represents the update coefficient, N represents the number of harmonic functions, ΔA i , Δw i and They respectively represent the amplitude difference, frequency difference and phase difference of the i-th harmonic function; α, β and γ are preset correction coefficients, and their values include zero.
[0025] Furthermore, the step of creating a matrix corresponding to each type of terminal collection device and counting the data uploaded by each terminal collection device based on the matrix includes:
[0026] For each type of terminal acquisition device, the terminal acquisition devices are read in sequence in two preset directions; wherein the two directions correspond to rows and columns respectively;
[0027] Create new row and column positions according to the order of reading, and create a matrix corresponding to each type of terminal acquisition device;
[0028] Receive the data with time tags uploaded by each terminal acquisition device in real time and perform time domain registration on the data;
[0029] Convert the time-domain registered data and insert the converted data into the row and column positions corresponding to the terminal acquisition device in the matrix;
[0030] Among them, all matrices contain time tags, and the time tags are the same as the time tags of the data in the matrices.
[0031] Furthermore, the step of receiving the hierarchical structure set by the administrator, reading the matrix based on the hierarchical structure, and constructing the three-dimensional block includes:
[0032] Receive the device range for each layer input by the administrator;
[0033] Get the terminal acquisition devices in the device range, and read the class corresponding to each terminal acquisition device in the device range;
[0034] Query the matrix containing time tags corresponding to each type of terminal acquisition device, and splice the matrix in the time dimension according to the time tags to obtain a three-dimensional block.
[0035] Furthermore, the step of identifying the three-dimensional block and determining the display color value of the point includes:
[0036] Intercepting a three-dimensional block within a preset time period;
[0037] For any point in the three-dimensional block, calculate its deviation score in each dimension;
[0038] Determining a display color value according to the deviation score;
[0039] The process of determining the display color value is as follows:
[0040] Calculate the first-order difference of point data in each dimension;
[0041] Determine the S and V values based on the first-order difference; Wherein, B1, B2 and B3 are preset constants used to convert data to the range of 0 to 255; Q x,y,t is the data at the point (x, y, t), Represents the previous data of the point (x, y, t) in the time dimension. and Respectively represent the data at adjacent positions of the point (x, y, t) in the matrix at the same time;
[0042] Q x,y,t Compare with a preset threshold value, and determine the H value according to the threshold value reached; wherein the relationship between the threshold value and the H value is determined by a preset value table;
[0043] The parameters H, S, and V represent hue, saturation, and value, respectively.
[0044] The technical solution of the present invention also provides a blockchain-based power data hierarchical statistical system, the system comprising:
[0045] A device clustering module, used to query the installation location of the terminal acquisition device and cluster the terminal acquisition device according to the installation location;
[0046] A data acquisition and statistics module is used to create a matrix corresponding to each type of terminal collection device, and to count the data uploaded by each terminal collection device based on the matrix;
[0047] A three-dimensional block construction module is used to receive a hierarchical structure set by an administrator, read a matrix based on the hierarchical structure, and construct a three-dimensional block; the three-dimensional block is a three-dimensional matrix, and the third dimension represents time;
[0048] A three-dimensional area recognition module is used to recognize the three-dimensional block and determine the display color value of the point;
[0049] In the process of identifying the three-dimensional block, the displayed color value of a certain point is correlated with the deviation of the data at the point in three dimensions.
[0050] Furthermore, the device clustering module includes:
[0051] A distance calculation unit is used to query the installation location of the terminal acquisition device and calculate the distance between any two terminal acquisition devices;
[0052] The center selection unit is used to receive the K value preset by the staff and select K initial centers from all terminal collection devices;
[0053] A center updating unit, configured to allocate each terminal collection device to K initial centers based on the distance, and update the K initial centers after the allocation is completed;
[0054] The loop execution unit is used for loop execution until the update distance of the K initial centers is less than a preset threshold value, and inputting the clustering result.
[0055] Furthermore, the data acquisition statistics module includes:
[0056] A device reading unit, used for reading the terminal acquisition devices of each type in two preset directions in sequence; wherein the two directions correspond to rows and columns respectively;
[0057] A matrix creation unit, used to create new row and column positions according to the order of reading, and create a matrix corresponding to each type of terminal acquisition device;
[0058] The time domain registration unit is used to receive the data with time tags uploaded by each terminal acquisition device in real time and perform time domain registration on the data;
[0059] A data conversion unit, used to convert the data after time domain registration, and insert the converted data into the row and column positions corresponding to the terminal acquisition device in the matrix;
[0060] Among them, all matrices contain time tags, and the time tags are the same as the time tags of the data in the matrices.
[0061] Furthermore, the three-dimensional block construction module includes:
[0062] A layer information receiving unit, used for receiving a device range of each layer input by an administrator;
[0063] A clustering result query unit, used to obtain terminal acquisition devices in the device range, and read the class corresponding to each terminal acquisition device in the device range;
[0064] The matrix expansion unit is used to query the matrix containing time tags corresponding to each type of terminal acquisition device, and splice the matrix in the time dimension according to the time tags to obtain a three-dimensional block.
[0065] Compared with the prior art, the present invention has the following beneficial effects:
[0066] The present invention clusters the terminal acquisition devices, creates a matrix to perform data statistics on the data of the same type of terminal acquisition devices, converts the original isolated data into centralized matrix data, and then constructs three-dimensional blocks. The docking process with the blockchain technology is very smooth, and data isolation is greatly avoided while ensuring that the existing system remains unchanged. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention.
[0068] Figure 1 The overall flow chart of the electricity data hierarchical statistical method based on blockchain is shown.
[0069] Figure 2 The structural diagram of the blockchain-based electricity data hierarchical statistical system is shown. DETAILED DESCRIPTION
[0070] In order to make the technical problems, technical solutions and beneficial effects to be solved by the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0071] Figure 1 The figure is a general flow chart of a power data hierarchical statistical method and system based on blockchain. In an embodiment of the present invention, a power data hierarchical statistical method based on blockchain includes:
[0072] Step S100: querying the installation location of the terminal acquisition device, and clustering the terminal acquisition devices according to the installation location;
[0073] Power data is collected from various terminal collection devices, including smart meters and sensors. In addition to the basic data collection function, the existing new terminal collection devices also have data transmission functions, and the process of obtaining power data is very simple.
[0074] After the terminal acquisition device is successfully installed, it will be recorded, and its installation location is the key recording data. In the technical solution of the present invention, the installation location is known data and can be directly read. By analyzing the installation location, the terminal acquisition devices can be clustered, that is, similar terminal acquisition devices can be classified into one category.
[0075] Step S200: creating a matrix corresponding to each type of terminal collection device, and counting the data uploaded by each terminal collection device based on the matrix;
[0076] For each type of terminal collection device, each terminal collection device will collect data independently, and the data collection frequency is the same preset value, such as once every 30 seconds. Terminal collection devices of the same type are similar, and the volatility of the corresponding data is almost the same. Therefore, they can be analyzed together. This application creates a matrix for each type of terminal collection device. Each row and column position in the matrix corresponds to a terminal collection device. The data collected by the terminal collection device based on the matrix statistics has a high degree of concentration. Based on the similar volatility, the data in the matrix at different times will almost show a characteristic of the same increase or decrease.
[0077] Step S300: receiving a hierarchical structure set by an administrator, reading a matrix based on the hierarchical structure, and constructing a three-dimensional block; the three-dimensional block is a three-dimensional matrix, and the third dimension represents time;
[0078] The concept of hierarchy in the technical solution of the present invention is different statistical standards, which are pre-input by the administrator, that is, the hierarchical structure in the above content; receiving the hierarchical structure set by the administrator, obtaining data within the corresponding range, reading the matrix within the corresponding range, arranging them in chronological order, and obtaining a three-dimensional matrix, also called a three-dimensional block; at this time, the present application can be externally connected to blockchain technology, introduce node sharing and other solutions to ensure that its data is not tampered with, and realize the statistical storage needs of power data based on blockchain.
[0079] In the above content, the concept of hierarchical architecture still needs to be explained. It is actually a classification standard and a range of equipment selection. For example, data can be divided into multiple levels, such as user layer (user electricity consumption data) and regional layer (data in a specific area). After determining the range, locate the corresponding device, further read the matrix for splicing, and then generate blocks.
[0080] In the prior art, blockchain technology itself is very mature, and the focus lies in the way blocks are generated. The purpose of this application is to provide a definite block generation scheme for power data.
[0081] Step S400: identifying the three-dimensional block and determining the display color value of the point;
[0082] In an example of the technical solution of the present invention, since the present application generates a three-dimensional block, it has great advantages in terms of visualization. Based on this, the present application analyzes the data at each position in the three-dimensional block, and then determines its display color value, and can mark the more prominent data; wherein, in the process of identifying the three-dimensional block, the display color value of a certain point is related to the deviation score of the data at the point in three dimensions, and the deviation score represents the difference between the data at a certain point and the data at other points and the difference between the data at a certain point and the data at the previous moment of the same point. Both of these reflections can be used to evaluate whether the data is prominent. Therefore, by analyzing the difference, it can be determined whether the data is abnormal. The parameter for evaluating whether it is abnormal uses the display color value, which can be directly displayed when it needs to be displayed, and the visualization process is extremely convenient.
[0083] Regarding step S100, the step of querying the installation location of the terminal acquisition device and clustering the terminal acquisition devices according to the installation location includes:
[0084] Query the installation location of the terminal collection device and calculate the distance between any two terminal collection devices;
[0085] Receive the K value pre-set by the staff and select K initial centers from all terminal collection devices;
[0086] Allocate each terminal collection device to K initial centers based on the distance, and after the allocation is completed, update the K initial centers;
[0087] The loop is executed until the update distance of the K initial centers is less than the preset threshold, and the clustering result is input.
[0088] The above content provides a specific device clustering solution, which queries the installation location of the terminal acquisition device, calculates the distance between any two terminal acquisition devices, and clusters the terminal acquisition devices based on the distance; the clustering solution adopts the K-means clustering solution. The description of the clustering solution is as follows:
[0089] 1. Select an integer K in advance, which represents the number of clusters you want to divide the data into. This value is pre-entered by the administrator.
[0090] 2. Randomly initialize the centroid, that is, select K devices as the center.
[0091] 3. Calculate the Euclidean distance from each data point to each centroid, and assign each data point to the cluster with the nearest centroid.
[0092] 4. After each allocation is completed, the location of the same type of equipment changes. According to its distribution position, the new center is calculated, that is, the center of mass is updated.
[0093] 5. Repeat steps 3 and 4 until convergence. The meaning of full convergence is that the centroid is almost unchanged. In other words, the distance between the centroids in two adjacent calculation processes is small enough.
[0094] 6. Output the final centroid and its clustering results.
[0095] It should be noted that regarding the installation position of the terminal acquisition device, in actual scenarios, the installation position of the terminal acquisition device is three-dimensional, that is, there is a height difference between different terminal acquisition devices; however, this height difference can be ignored and is used to simplify the calculation process. At this time, the installation position of the terminal acquisition device of this application is the projection of the actual spatial coordinates in the horizontal plane.
[0096] Further, in combination with the above description, the distance between any two terminal acquisition devices is actually the plane distance between the projection points of the spatial coordinates of the two terminal acquisition devices in the horizontal plane.
[0097] As a preferred embodiment of the technical solution of the present invention, the step of querying the installation location of the terminal acquisition device and clustering the terminal acquisition devices according to the installation location further includes:
[0098] Taking the current time as the end time, read the collected data before the preset time period;
[0099] Performing Fourier transformation on the acquired data to obtain a harmonic function; the harmonic function is in the form of a trigonometric function, the number of harmonic functions is a preset value, and the first term is called a fundamental wave function;
[0100] Extracting the amplitude, frequency and phase of the harmonic function as the characteristics of the collected data;
[0101] Compare the features corresponding to different terminal acquisition devices and update the distance;
[0102] The updating process of the distance is:
[0103]
[0104] Where, d ′ is the distance after update, d is the distance before update, C represents the update coefficient, N represents the number of harmonic functions, ΔA i , Δw i and They respectively represent the amplitude difference, frequency difference and phase difference of the i-th harmonic function; α, β and γ are preset correction coefficients, and their values include zero.
[0105] In an example of the technical solution of the present invention, the parameter relied on by the solution for determining whether two terminal acquisition devices are close is actually only the spatial distance. In actual scenarios, two devices are close. In addition to the spatial distance factor, there may be other factors. For example, the data of two devices connected in series have almost the same change characteristics. At this time, they can also be considered to be close.
[0106] In order to introduce the above-mentioned evaluation criteria, the present application takes the current moment as the end moment, reads the collected data before the preset time period (reads the data within the latest generated time period), performs Fourier transform on the read collected data, obtains the harmonic function, and extracts the amplitude, frequency and phase of the harmonic function as the characteristics of the collected data. The characteristics reflect the periodic characteristics of the data. If the periodic characteristics of two devices connected in series are highly similar, then by comparing the characteristics, the difference in period can be obtained, which can also be used as a distance to further correct the clustering scheme.
[0107] Regarding the distance update process, it involves accumulation operations. The reason for the accumulation operation is that the harmonic function is not unique. If there is only one harmonic function (only the fundamental function is selected), then the sum of the products of the amplitude difference, frequency difference and phase difference and the corresponding coefficients can be directly calculated. In addition, C is a composite function based on the exponential function, which is an increasing function with a value from zero to one, indicating that the degree of distance amplification is proportional to the amplitude difference, frequency difference and phase difference.
[0108] It is worth mentioning that the coefficient corresponding to the amplitude difference and the coefficient corresponding to the phase difference can both be zero. In this case, only the influence of the frequency is retained, that is, only the periodicity is considered.
[0109] Regarding step S200, the step of creating a matrix corresponding to each type of terminal collection device and counting the data uploaded by each terminal collection device based on the matrix includes:
[0110] For each type of terminal acquisition device, the terminal acquisition devices are read in sequence in two preset directions; wherein the two directions correspond to rows and columns respectively;
[0111] Create new row and column positions according to the order of reading, and create a matrix corresponding to each type of terminal acquisition device;
[0112] Receive the data with time tags uploaded by each terminal acquisition device in real time and perform time domain registration on the data;
[0113] Convert the time-domain registered data and insert the converted data into the row and column positions corresponding to the terminal acquisition device in the matrix;
[0114] Among them, all matrices contain time tags, and the time tags are the same as the time tags of the data in the matrices.
[0115] As a preferred embodiment of the technical solution of the present invention, a specific description is given of the generation and application process of the matrix. For each type of terminal acquisition device, there is a matrix generation and application process. First, two directions are determined, such as from west to east and from north to south, and the terminal acquisition devices are queried in sequence. For the first queried terminal acquisition device, a (1,1) position is created. Then, each time a new terminal acquisition device is queried, a new position is generated according to the direction relationship. After the reading is completed, a matrix is obtained.
[0116] After the matrix is generated, each row and column position in the matrix corresponds to a terminal acquisition device. According to this correspondence, the data collected by each terminal acquisition device at the same time is inserted into the matrix to obtain the matrix filled with data at that moment; in order to represent time, time labels are required in both the collected data and the matrix.
[0117] Regarding step S300, the steps of receiving the hierarchical structure set by the administrator, reading the matrix based on the hierarchical structure, and constructing the three-dimensional block include:
[0118] Receive the device range for each layer input by the administrator;
[0119] Get the terminal acquisition devices in the device range, and read the class corresponding to each terminal acquisition device in the device range;
[0120] Query the matrix containing time tags corresponding to each type of terminal acquisition device, and splice the matrix in the time dimension according to the time tags to obtain a three-dimensional block.
[0121] The hierarchical architecture is multiple ranges, called device ranges. The terminal acquisition devices in the device range are obtained, and the category of each terminal acquisition device is queried, and then the corresponding matrix is read. This process actually expands the device range because each terminal acquisition device is expanded into a category of terminal acquisition device, which makes the acquired data more complete.
[0122] Since the matrix contains time tags, the matrices are spliced in the third dimension (time axis) in chronological order to obtain a three-dimensional matrix, which is called a three-dimensional block.
[0123] Regarding step S400, the step of identifying the three-dimensional block and determining the display color value of the point includes:
[0124] Intercepting a three-dimensional block within a preset time period;
[0125] For any point in the three-dimensional block, calculate its deviation score in each dimension;
[0126] Determining a display color value according to the deviation score;
[0127] The process of determining the display color value is as follows:
[0128] Calculate the first-order difference of point data in each dimension;
[0129] Determine the S and V values based on the first-order difference; Wherein, B1, B2 and B3 are preset constants used to convert data to the range of 0 to 255; Q x,y,t is the data at the point (x, y, t), Represents the previous data of the point (x, y, t) in the time dimension. and Respectively represent the data at adjacent positions of the point (x, y, t) in the matrix at the same time;
[0130] Q x,y,t Compare with a preset threshold value, and determine the H value according to the threshold value reached; wherein the relationship between the threshold value and the H value is determined by a preset value table;
[0131] The parameters H, S, and V represent hue, saturation, and value, respectively.
[0132] The above content limits the generation process of the display color value. As time goes by, the three-dimensional block will be very long in the time dimension. The older three-dimensional blocks have no display significance. Therefore, this application intercepts the three-dimensional blocks within a preset time period for analysis, such as the three-dimensional blocks within a day; for any point in the three-dimensional block, calculate its deviation score in each dimension. The deviation score represents the difference between the data and the surrounding data (corresponding to the probability of partial derivative in mathematics), and then the risk value of the corresponding data can be determined. The risk value is converted into a display color value, which can be displayed directly on the display device, so that the administrator can intuitively understand the collection of power data.
[0133] The display color value adopts the HSV color space. The parameters H, S and V represent hue, saturation and brightness respectively. Hue means appearance. When the data at the point reaches different thresholds, different appearances are selected. Then, the S value is determined by the time difference of the data at the point, and the V value is determined by the difference of the data at the point in the matrix at the same time. By adjusting the coefficient and converting it to the range of 0 to 255, the display color value can be obtained.
[0134] It is worth mentioning that the process of determining the S value and the V value can be swapped, that is, the V value is determined by the time difference of the data at the point, and the S value is determined by the difference of the data at the point in the matrix at the same time.
[0135] Figure 2 The structure diagram of the power data hierarchical statistical system based on blockchain is shown. In a preferred embodiment of the technical solution of the present invention, a power data hierarchical statistical system based on blockchain is also provided. The system 10 includes:
[0136] The device clustering module 11 is used to query the installation location of the terminal acquisition device and cluster the terminal acquisition device according to the installation location;
[0137] The data acquisition and statistics module 12 is used to create a matrix corresponding to each type of terminal collection device, and to count the data uploaded by each terminal collection device based on the matrix;
[0138] The three-dimensional block construction module 13 is used to receive the hierarchical structure set by the administrator, read the matrix based on the hierarchical structure, and construct the three-dimensional block; the three-dimensional block is a three-dimensional matrix, and the third dimension represents time;
[0139] A three-dimensional area recognition module 14 is used to recognize the three-dimensional block and determine the display color value of the point;
[0140] In the process of identifying the three-dimensional block, the displayed color value of a certain point is correlated with the deviation of the data at the point in three dimensions.
[0141] Furthermore, the device clustering module 11 includes:
[0142] A distance calculation unit is used to query the installation location of the terminal acquisition device and calculate the distance between any two terminal acquisition devices;
[0143] The center selection unit is used to receive the K value preset by the staff and select K initial centers from all terminal collection devices;
[0144] A center updating unit, configured to allocate each terminal collection device to K initial centers based on the distance, and update the K initial centers after the allocation is completed;
[0145] The loop execution unit is used for loop execution until the update distance of the K initial centers is less than a preset threshold value, and inputting the clustering result.
[0146] Specifically, the data acquisition and statistics module 12 includes:
[0147] A device reading unit, used for reading the terminal acquisition devices of each type in two preset directions in sequence; wherein the two directions correspond to rows and columns respectively;
[0148] A matrix creation unit, used to create new row and column positions according to the order of reading, and create a matrix corresponding to each type of terminal acquisition device;
[0149] The time domain registration unit is used to receive the data with time tags uploaded by each terminal acquisition device in real time and perform time domain registration on the data;
[0150] A data conversion unit, used to convert the data after time domain registration, and insert the converted data into the row and column positions corresponding to the terminal acquisition device in the matrix;
[0151] Among them, all matrices contain time tags, and the time tags are the same as the time tags of the data in the matrices.
[0152] Furthermore, the three-dimensional block construction module 13 includes:
[0153] A layer information receiving unit, used for receiving a device range of each layer input by an administrator;
[0154] A clustering result query unit, used to obtain terminal acquisition devices in the device range, and read the class corresponding to each terminal acquisition device in the device range;
[0155] The matrix expansion unit is used to query the matrix containing time tags corresponding to each type of terminal acquisition device, and splice the matrix in the time dimension according to the time tags to obtain a three-dimensional block.
[0156] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A blockchain-based power data hierarchical statistical method, characterized in that: The method comprises: Querying the installation locations of terminal acquisition devices, and clustering the terminal acquisition devices according to the installation locations; Create a matrix corresponding to each type of terminal collection device, and count the data uploaded by each terminal collection device based on the matrix; Receiving a hierarchical structure set by an administrator, reading a matrix based on the hierarchical structure, and constructing a three-dimensional block; the three-dimensional block is a three-dimensional matrix, and the third dimension represents time; Identify the three-dimensional block and determine the display color value of the point; In the process of identifying the three-dimensional block, the displayed color value of a certain point is correlated with the deviation of the data at the point in three dimensions.
2. The power data hierarchical statistical method based on blockchain according to claim 1 is characterized in that: The step of querying the installation location of the terminal acquisition device and clustering the terminal acquisition devices according to the installation location comprises: Query the installation location of the terminal collection device and calculate the distance between any two terminal collection devices; Receive the K value pre-set by the staff and select K initial centers from all terminal collection devices; Allocate each terminal collection device to K initial centers based on the distance, and after the allocation is completed, update the K initial centers; The loop is executed until the update distance of the K initial centers is less than the preset threshold, and the clustering result is input.
3. The power data hierarchical statistical method based on blockchain according to claim 2 is characterized in that: The step of querying the installation location of the terminal acquisition device and clustering the terminal acquisition devices according to the installation location further includes: Taking the current time as the end time, read the collected data before the preset time period; Performing Fourier transformation on the acquired data to obtain a harmonic function; the harmonic function is in the form of a trigonometric function, the number of harmonic functions is a preset value, and the first term is called a fundamental wave function; Extracting the amplitude, frequency and phase of the harmonic function as the characteristics of the collected data; Compare the features corresponding to different terminal acquisition devices and update the distance; The updating process of the distance is: Where, d ′ is the distance after update, d is the distance before update, C represents the update coefficient, N represents the number of harmonic functions, ΔA i , Δw i and They respectively represent the amplitude difference, frequency difference and phase difference of the i-th harmonic function; α, β and γ are preset correction coefficients, and their values include zero.
4. The power data hierarchical statistical method based on blockchain according to claim 1 is characterized in that: The step of creating a matrix corresponding to each type of terminal collection device and counting the data uploaded by each terminal collection device based on the matrix comprises: For each type of terminal acquisition device, the terminal acquisition devices are read in sequence in two preset directions; wherein the two directions correspond to rows and columns respectively; Create new row and column positions according to the order of reading, and create a matrix corresponding to each type of terminal acquisition device; Receive the data with time tags uploaded by each terminal acquisition device in real time and perform time domain registration on the data; Convert the time-domain registered data and insert the converted data into the row and column positions corresponding to the terminal acquisition device in the matrix; Among them, all matrices contain time tags, and the time tags are the same as the time tags of the data in the matrices.
5. The power data hierarchical statistical method based on blockchain according to claim 1 is characterized in that: The step of receiving the hierarchical structure set by the administrator, reading the matrix based on the hierarchical structure, and constructing the three-dimensional block includes: Receive the device range for each layer input by the administrator; Get the terminal acquisition devices in the device range, and read the class corresponding to each terminal acquisition device in the device range; Query the matrix containing time tags corresponding to each type of terminal acquisition device, and splice the matrix in the time dimension according to the time tags to obtain a three-dimensional block.
6. The blockchain-based power data hierarchical statistical method according to claim 1, characterized in that: The step of identifying the three-dimensional block and determining the display color value of the point includes: Intercepting a three-dimensional block within a preset time period; For any point in the three-dimensional block, calculate its deviation score in each dimension; Determining a display color value according to the deviation score; The process of determining the display color value is as follows: Calculate the first-order difference of point data in each dimension; Determine the S and V values based on the first-order difference; Wherein, B1, B2 and B3 are preset constants used to convert data to the range of 0 to 255; Q x,y,t is the data at the point (x, y, t), Represents the previous data of the point (x, y, t) in the time dimension. and Respectively represent the data at adjacent positions of the point (x, y, t) in the matrix at the same time; Q x,y,t Compare with a preset threshold value, and determine the H value according to the threshold value reached; wherein the relationship between the threshold value and the H value is determined by a preset value table; The parameters H, S, and V represent hue, saturation, and value, respectively.
7. A blockchain-based power data hierarchical statistical system, characterized in that: The system comprises: A device clustering module, used to query the installation location of the terminal acquisition device and cluster the terminal acquisition device according to the installation location; A data acquisition and statistics module is used to create a matrix corresponding to each type of terminal collection device, and to count the data uploaded by each terminal collection device based on the matrix; A three-dimensional block construction module is used to receive a hierarchical structure set by an administrator, read a matrix based on the hierarchical structure, and construct a three-dimensional block; the three-dimensional block is a three-dimensional matrix, and the third dimension represents time; A three-dimensional area recognition module is used to recognize the three-dimensional block and determine the display color value of the point; In the process of identifying the three-dimensional block, the displayed color value of a certain point is correlated with the deviation of the data at the point in three dimensions.
8. The blockchain-based power data hierarchical statistical system according to claim 7, characterized in that: The device clustering module includes: A distance calculation unit is used to query the installation location of the terminal acquisition device and calculate the distance between any two terminal acquisition devices; The center selection unit is used to receive the K value preset by the staff and select K initial centers from all terminal collection devices; A center updating unit, configured to allocate each terminal collection device to K initial centers based on the distance, and update the K initial centers after the allocation is completed; The loop execution unit is used for loop execution until the update distance of the K initial centers is less than a preset threshold value, and inputting the clustering result.
9. The blockchain-based power data hierarchical statistical system according to claim 8, characterized in that: The data acquisition statistics module includes: A device reading unit, used for reading the terminal acquisition devices of each type in two preset directions in sequence; wherein the two directions correspond to rows and columns respectively; A matrix creation unit, used to create new row and column positions according to the order of reading, and create a matrix corresponding to each type of terminal acquisition device; The time domain registration unit is used to receive the data with time tags uploaded by each terminal acquisition device in real time and perform time domain registration on the data; A data conversion unit, used to convert the data after time domain registration, and insert the converted data into the row and column positions corresponding to the terminal acquisition device in the matrix; Among them, all matrices contain time tags, and the time tags are the same as the time tags of the data in the matrices.
10. The blockchain-based power data hierarchical statistical system according to claim 7, characterized in that: The three-dimensional block building module includes: A layer information receiving unit, used for receiving a device range of each layer input by an administrator; A clustering result query unit, used to obtain terminal acquisition devices in the device range, and read the class corresponding to each terminal acquisition device in the device range; The matrix expansion unit is used to query the matrix containing time tags corresponding to each type of terminal acquisition device, and splice the matrix in the time dimension according to the time tags to obtain a three-dimensional block.
Citation Information
Cited By
Distributed concentrator state monitoring method and system
CN119848707A
Data feature simplification and computing power distribution method and system
CN122431873A