Abnormal data detection method, system, storage medium and computer in smart grid
By constructing neighbor graphs and similarity difference calculations, abnormal data in smart grids are identified, solving the problems of detection complexity and insufficient accuracy in existing technologies, achieving efficient abnormal data monitoring, and providing guarantee for stable operation of the power grid.
Patent Information
- Application Number
- CN202410954460.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-17
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2044-07-17
AI Technical Summary
Due to the nonlinear, time-varying and complex characteristics of data in smart grids, it is difficult for existing technologies to effectively detect and process abnormal data, which affects the safe and stable operation of the grid.
A method is proposed to obtain power grid status data, calculate the distance between any two data and sort them, construct a neighbor graph, detect abnormal data, and use similarity differences and similarity calculations to gradually identify abnormal data points to form the final abnormal data. gather.
It achieves high-accuracy detection of abnormal data in smart grids, simplifies the monitoring process, is suitable for large-scale promotion, provides guarantee for the stable operation of the power grid, and promotes the healthy development of smart grids.
Smart Images

Figure CN118503885B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of machine learning, and in particular to a method, system, storage medium and computer for detecting abnormal data in a smart grid. Background Art
[0002] With the continuous development of the global economy and the continuous growth of the population, the demand for energy is increasing. At the same time, environmental problems and the gradual depletion of non-renewable energy have also brought huge challenges to the energy sector. As an important part of the energy sector, the power system is facing the pressure of transformation and upgrading. As a representative of the new generation of power systems, smart grids have achieved real-time monitoring, optimized control and intelligent management of power grids by integrating advanced information, communication, sensing and control technologies. The development of smart grids can not only improve the power supply reliability, economy and safety of the power system, but also promote the access and consumption of renewable energy and promote the construction and development of the energy Internet.
[0003] However, in the actual operation of smart grids, due to factors such as the large scale of the grid, the large number of devices, and the complex operating environment, the grid data presents characteristics such as nonlinearity and time-varying. These data may contain abnormal data caused by equipment failure, communication interference, human operation errors, etc. If these abnormal data are not detected and processed in time, they may have a serious impact on the safe and stable operation of the grid. Therefore, the detection of abnormal data in smart grids has become a hot topic and difficulty in current research. The existing mainstream methods mainly rely on the statistical properties of the data or rely on trained classification models to identify and mark abnormal data. However, statistical methods are more suitable for processing data that conforms to a specific distribution pattern, but the data of smart grids often presents complex characteristics such as nonlinearity and non-Gaussian distribution, which limits the application effect of statistical methods. Methods based on classification models require a large amount of labeled data to train the model, and have high requirements on the generalization ability of the model; affecting the detection of abnormal data. Summary of the invention
[0004] Based on this, the purpose of the present invention is to provide a method, system, storage medium and computer for detecting abnormal data in a smart grid to solve the technical problems existing in the prior art.
[0005] The present invention provides a method for detecting abnormal data in a smart grid, comprising:
[0006] Obtain the grid status data at several time points within a period of time, calculate the distance between any two grid status data, and sort the calculated distances in ascending order;
[0007] After sorting The grid status data is saved to the neighbor set In the example, based on the nearest neighbor set structure Neighborhood Graph , is the collection of power grid status data, For each grid status data and the previous The edge set formed by connecting the power grid status data;
[0008] Obtaining an abnormal data of the plurality of power grid status data , and update the abnormal data to the collection In, according to the collection Performing an abnormal data detection operation, the detection operation comprising:
[0009] Calculating Collections The first similarity difference with other grid status data ;
[0010] according to Neighborhood Graph Get Collection Adjacent data set , calculate the set Each grid status data and collection Similarity , and sort them according to the degree of similarity;
[0011] Traverse the collection in order according to the similarity All data in , calculate the set The second similarity difference between each data in and the remaining grid status data ;
[0012] If exists , then judge the data Update the original collection for abnormal data , , the updated set As a new collection Repeat the above detection operation until the collection All data in the , and get the final abnormal data set After output, all abnormal data monitoring within this time period is completed;
[0013] If not present , it means that there is only An abnormal data, the original set As the aggregate output of abnormal data, all abnormal data monitoring within the time period is completed.
[0014] The beneficial effects of the present invention are as follows: the method for detecting abnormal data in a smart grid provided by the present application first divides a period of time into time points, obtains grid status data at several time points, calculates the distance between any two grid status data, and sorts the calculated distances in ascending order, and sorts the sorted distances into the first and last order. The grid status data is saved to the neighbor set In the example, based on the nearest neighbor set structure Neighborhood Graph , that is, using the similarity relationship between data to build a Neighbor graph model; obtain an abnormal data of several power grid status data , and update the abnormal data to the collection According to the set Perform an abnormal data detection operation. In the detection operation, obtain an abnormal data, based on the abnormal data A local search is performed on the neighbor graph to gradually find all other abnormal data points with similar characteristics to the initial abnormal data point, thereby providing guarantee for the stable operation of the power grid and promoting the healthy development of the smart grid; the abnormal data monitoring process is simple and accurate, and is suitable for large-scale promotion.
[0015] Preferably, the step of acquiring the grid status data at a plurality of time points within a period of time, calculating the distance between any two grid status data, and sorting the calculated distances in ascending order comprises:
[0016] Divide a period of time into preset intervals Time point, get The grid status data at a point in time, The grid status data at each time point constitutes a data set ;
[0017] Select Grid status data at a point in time , for each selected grid status data , traverse the grid status data at other time points, and calculate the grid status data of this grid and the grid status data of other time points respectively, where, , is the number of data describing the power grid status in the power grid status data;
[0018] For each selected power grid status data, the distances between the power grid status data and other power grid status data are sorted in ascending order, and so on, to complete the distance sorting of all power grid status data.
[0019] Preferably, the distance calculation expression between the grid status data is:
[0020]
[0021] In the formula, For the The grid status data at a point in time, For the The grid status data at a point in time, , For the The first time point describing the state of the power grid data, For the The first time point describing the state of the power grid data.
[0022] Preferably, the first similarity difference The expression is:
[0023]
[0024] In the formula, is a collection of abnormal data. To remove the set in set D The data set that constitutes for and The cosine similarity between ;
[0025] The calculation expression is:
[0026]
[0027] In the formula, , shown in the figure All above and A connected collection of data, , shown in the figure All above and connected data sets, data, data, data.
[0028] Preferably, the adjacency data set The expression is:
[0029]
[0030] The similarity The expression is:
[0031]
[0032] The second similarity difference The expression is:
[0033]
[0034] In the formula, Representation diagram All above and Adjacent but not in set The data set in Representation diagram All above and Adjacent and in set The data set in data, data.
[0035] Preferably, , and it is an integer.
[0036] The present invention also proposes an abnormal data detection system in a smart grid, comprising:
[0037] The acquisition module is used to acquire the power grid status data at several time points within a period of time, calculate the distance between any two power grid status data, and sort the calculated distances in ascending order;
[0038] Construction module, used to sort the front The grid status data is saved to the neighbor set In the example, based on the nearest neighbor set structure Neighborhood Graph , is the collection of power grid status data, For each grid status data and the previous The edge set formed by connecting the power grid status data;
[0039] A detection module is used to obtain an abnormal data of the plurality of power grid status data. , and update the abnormal data to the collection In, according to the collection Performing an abnormal data detection operation, the detection operation comprising:
[0040] Calculating Collections The first similarity difference with other grid status data ;
[0041] according to Neighborhood Graph Get Collection Adjacent data set , calculate the set Each grid status data and collection Similarity , and sort them according to the degree of similarity;
[0042] Traverse the collection in order according to the similarity All data in , calculate the set The second similarity difference between each data in and the remaining grid status data ;
[0043] Judgment module, used to determine if there is , then judge the data Update the original collection for abnormal data , , the updated set As a new collection Repeat the above detection operation until the collection All data in the , and get the final abnormal data set After output, all abnormal data monitoring within this time period is completed;
[0044] If not present , it means that there is only An abnormal data, the original set As the aggregate output of abnormal data, all abnormal data monitoring within the time period is completed.
[0045] The present invention also proposes a storage medium on which a computer program is stored, and when the program is executed by a processor, the abnormal data detection method in the smart grid is implemented.
[0046] The present invention also proposes a computer, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned abnormal data detection method in the smart grid when executing the computer program.
[0047] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 is a flow chart of a method for detecting abnormal data in a smart grid in a first embodiment of the present invention;
[0049] Figure 2 FIG. 4 is a structural block diagram of a computer in a fourth embodiment of the present invention.
[0050] The following specific implementation manner will further illustrate the present invention in conjunction with the above-mentioned drawings. DETAILED DESCRIPTION
[0051] In order to facilitate the understanding of the present invention, the present invention will be described more fully below with reference to the relevant drawings. Several embodiments of the present invention are given in the drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present invention more thorough and comprehensive.
[0052] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which the present invention belongs. The terms used herein in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more of the related listed items.
[0053] Embodiment 1
[0054] See also Figure 1 , which shows a method for detecting abnormal data in a smart grid in a first embodiment of the present invention. The method for detecting abnormal data in a smart grid specifically includes steps S10 to S40:
[0055] S10, obtaining power grid status data at a plurality of time points within a period of time, calculating the distance between any two power grid status data, and sorting the calculated distances in ascending order;
[0056] Optionally, in this embodiment, the step of acquiring grid state data at a plurality of time points within a period of time, calculating the distance between any two grid state data, and sorting the calculated distances in ascending order includes:
[0057] Divide a period of time into preset intervals Time point, get The grid status data at a point in time, The grid status data at each time point constitutes a data set ;
[0058] Select Grid status data at a point in time , for each selected grid status data , traverse the grid status data at other time points, and calculate the grid status data of this grid and the grid status data of other time points respectively, where, , is the number of data describing the power grid status in the power grid status data;
[0059] For each selected power grid status data, the distances between the power grid status data and other power grid status data are sorted in ascending order, and so on, to complete the distance sorting of all power grid status data.
[0060] Optionally, the distance calculation expression between the power grid status data is:
[0061]
[0062] In the formula, For the The grid status data at a point in time, For the The grid status data at a point in time, , For the The first time point describing the state of the power grid data, For the The first time point describing the state of the power grid data.
[0063] In the specific implementation, first divide a period of time into equal intervals. Time point, get The grid status data at each time point constitutes a data set At each time point, the state of the power grid is observed from the smart grid. data, ; That is, Understood as a vector containing Elements; schematically, in this embodiment, it is assumed that the data set Contains 5 data, namely ;for , respectively calculate and , and , and , and The distance between them is sorted in ascending order. , respectively calculate and , and , and , and The distance between them is sorted in ascending order. , , , and so on, no further details will be given here; for each data , and calculate the distance between it and the other four data respectively.
[0064] S20, the sorted front The grid status data is saved to the neighbor set In the example, based on the nearest neighbor set structure Neighborhood Graph , is the collection of power grid status data, For each grid status data and the previous The edge set formed by connecting the power grid status data;
[0065] In the specific implementation, the sorted The grid status data is saved to the neighbor set Medium, optional, , and is an integer, schematically, in this embodiment, Take 2, that is, in the distance between the current data and the other four data, take the first two data with the closest distance to form the nearest neighbor set , for different data, the neighbor data may be different; schematically, for data , assuming that the distances to the other four data are sorted from small to large as , , , , the first two grid status data after sorting are , ; For data , assuming that the distances to the other four data are sorted from small to large as , , , ; The first two grid status data after sorting are , ;for , , , and so on, which will not be repeated here; based on the nearest neighbor set structure Neighborhood Graph ,in, , gather at the edge middle, Respectively and connect, Respectively and Connection, for , , , and so on, I will not go into details here.
[0066] S30, obtaining an abnormal data of the plurality of power grid status data , and update the abnormal data to the collection In, according to the collection Perform an abnormal data detection operation, the detection operation includes: calculating the set The first similarity difference with other grid status data ;according to Neighborhood Graph Get Collection Adjacent data set , calculate the set Each grid status data and collection Similarity , and sort them according to the similarity; traverse the collection in order according to the similarity All data in , calculate the set The second similarity difference between each data in and the remaining grid status data ;
[0067] In the specific implementation, first initialize an empty collection A collection used to record abnormal data. An abnormal data , recorded as . Update the abnormal data to the collection In, recorded as ; According to the collection An abnormal data detection operation is performed to detect all other data under the same type of abnormality. In this embodiment, through a single discovered abnormal data, all other data under the same type of abnormality can be effectively identified and defined, providing guarantee for the stable operation of the power grid and promoting the healthy development of the smart grid.
[0068] Optionally, the detection operation includes:
[0069] Calculating Collections The first similarity difference with other grid status data ;
[0070] According to the The neighbor graph obtains the set Adjacent data set , calculate the set Each grid status data and collection Similarity , and sort them according to the degree of similarity;
[0071] Traverse the collection in order according to the similarity All data in are calculated separately The second similarity difference between each data in and the remaining grid status data ;
[0072] Furthermore, the first similarity difference The expression is:
[0073]
[0074] In the formula, is a collection of abnormal data. To remove the set in set D The data set that constitutes for and The cosine similarity between ;
[0075] The calculation expression is:
[0076]
[0077] In the formula, , shown in the figure All above and connected data sets, , shown in the figure All above and connected data sets, data, data, data.
[0078] The adjacency data set The expression is:
[0079]
[0080] The similarity The expression is:
[0081]
[0082] The second similarity difference The expression is:
[0083]
[0084] In the formula, Representation diagram All above and Adjacent but not in set The data set in Representation diagram All above and Adjacent and in set The data set in data, data.
[0085] Indicative, hypothetical data is abnormal data, that is, ,calculate With data The first similarity difference , according to the Neighborhood Graph Get A collection of adjacent data; optional, since the assumption is that the data The distances to the other four data are sorted from small to large as follows: , , , ,therefore At least with and Connection, it is understandable that, due to the selection of the front When the grid status data is available, for other data, Also connected with other data, for example, , assuming that the distances to the other four data are sorted from small to large as , , , ,So Also with Connection, that is ; Calculate separately With abnormal data , and sort them in descending order according to the similarity values; assuming that the order of sorting from high to low according to the similarity is ,from Traverse in sequence and calculate Second similarity difference with the remaining grid status data , in this embodiment, The corresponding remaining grid state data refers to the edge set Zhongyu Connected, but not in the abnormal data set The data in .
[0086] S40, if present , then judge the data Update the original collection for abnormal data , , the updated set As a new collection Repeat the above detection operation until the data All data in the , and get the final abnormal data set After output, all abnormal data monitoring within this time period is completed;
[0087] Indicatively, in obtaining The first similarity difference and The second similarity difference After that, if , then judge the data Update the original collection for abnormal data , , update the collection get ,no longer The calculation of other data in is based on the updated As a set of abnormal data, repeat the above detection operation; if , then further judge The second similarity difference , determine whether , if satisfied, update ; If not satisfied, continue to judge ; Until the data All data in the , and get the final abnormal data set After output, all abnormal data monitoring within this time period is completed.
[0088] S50, if not present , it means that there is only An abnormal data, the original set As the aggregate output of abnormal data, all abnormal data monitoring within the time period is completed.
[0089] If you traverse , found that it does not exist , then determine the set of abnormal data Adjacent data set There is no abnormal data in the original set As the aggregate output of abnormal data, all abnormal data monitoring within the time period is completed.
[0090] In summary, the method for detecting abnormal data in a smart grid provided by the present application first divides a period of time into time points, obtains the grid status data at several time points, calculates the distance between any two grid status data, and sorts the calculated distances in ascending order, and sorts the sorted distances into the first and last order. The grid status data is saved to the neighbor set In the example, based on the nearest neighbor set structure Neighborhood Graph , that is, using the similarity relationship between data to build a Neighbor graph model; obtain an abnormal data of several power grid status data , and update the abnormal data to the collection According to the set Perform an abnormal data detection operation. In the detection operation, obtain an abnormal data, based on the abnormal data A local search is performed on the neighbor graph to gradually find all other abnormal data points with similar characteristics to the initial abnormal data point, thereby providing guarantee for the stable operation of the power grid and promoting the healthy development of the smart grid; the abnormal data monitoring process is simple and accurate, and is suitable for large-scale promotion.
[0091] Embodiment 2
[0092] This embodiment provides a system for detecting abnormal data in a smart grid. The system for detecting abnormal data in a smart grid includes:
[0093] The acquisition module is used to acquire the power grid status data at several time points within a period of time, calculate the distance between any two power grid status data, and sort the calculated distances in ascending order;
[0094] The steps of obtaining the grid status data at a plurality of time points within a period of time, calculating the distance between any two grid status data, and sorting the calculated distances in ascending order include:
[0095] Divide a period of time into preset intervals Time point, get The grid status data at a point in time, The grid status data at each time point constitutes a data set ;
[0096] Select Grid status data at a point in time , for each selected grid status data , traverse the grid status data at other time points, and calculate the grid status data of this grid and the grid status data of other time points respectively, where, , is the number of data describing the power grid status in the power grid status data;
[0097] For each selected power grid status data, the distances between the power grid status data and other power grid status data are sorted in ascending order, and so on, to complete the distance sorting of all power grid status data.
[0098] The distance calculation expression between the power grid status data is:
[0099]
[0100] In the formula, For the The grid status data at a point in time, For the The grid status data at a point in time, , For the The first time point describing the state of the power grid data, For the The first time point describing the state of the power grid data.
[0101] Construction module, used to sort the front The grid status data is saved to the neighbor set In the example, based on the nearest neighbor set structure Neighborhood Graph , is the collection of power grid status data, For each grid status data and the previous The edge set formed by connecting the power grid status data;
[0102] in, , and it is an integer.
[0103] A detection module is used to obtain an abnormal data of the plurality of power grid status data. , and update the abnormal data to the collection According to the set Performing an abnormal data detection operation, the detection operation comprising:
[0104] Calculating Collections The first similarity difference with other grid status data ;
[0105] According to the The neighbor graph obtains the set Adjacent data set , calculate the set Each grid status data and collection Similarity , and sort them according to the degree of similarity;
[0106] Traverse the collection in order according to the similarity All data in are calculated separately The second similarity difference between each data in and the remaining grid status data ;
[0107] The first similarity difference The expression is:
[0108]
[0109] In the formula, is a collection of abnormal data. To remove the set in set D The data set that constitutes for and The cosine similarity between ;
[0110] The calculation expression is:
[0111]
[0112] In the formula, , shown in the figure All above and connected data sets, , shown in the figure All above and connected data sets, data, data, data;
[0113] The adjacency data set The expression is:
[0114]
[0115] The similarity The expression is:
[0116]
[0117] The second similarity difference The expression is:
[0118]
[0119] In the formula, Representation diagram All above and Adjacent but not in set The data set in Representation diagram All above and Adjacent and in set The data set in data, data.
[0120] Judgment module, used to determine if there is , then judge the data Update the original collection for abnormal data , , the updated set As a new collection Repeat the above detection operation until the data All data in the , and get the final abnormal data set After output, all abnormal data monitoring within this time period is completed;
[0121] If not present , it means that there is only An abnormal data, the original set As the aggregate output of abnormal data, all abnormal data monitoring within the time period is completed.
[0122] Embodiment 3
[0123] A third embodiment of the present invention provides a storage medium on which a computer program is stored. When the program is executed by a processor, the method for detecting abnormal data in a smart grid as described above is implemented.
[0124] Embodiment 4
[0125] The present invention also provides a computer, see Figure 2 , shown is a computer in the fourth embodiment of the present invention, including a memory 10, a processor 20, and a computer program 30 stored in the memory 10 and executable on the processor 20. When the processor 20 executes the computer program 30, the above-mentioned abnormal data detection method in the smart grid is implemented.
[0126] The memory 10 includes at least one type of storage medium, including flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory, etc.), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 10 may be an internal storage unit of a computer, such as a hard disk of the computer. In other embodiments, the memory 10 may also be an external storage device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card, etc. Further, the memory 10 may also include both an internal storage unit of the computer and an external storage device. The memory 10 may be used not only to store application software and various types of data installed in the computer, but also to temporarily store data that has been output or is to be output.
[0127] Among them, in some embodiments, the processor 20 can be an electronic control unit (Electronic Control Unit, abbreviated as ECU, also known as a vehicle computer), a central processing unit (Central Processing Unit, CPU), a controller, a microcontroller, a microprocessor or other data processing chip, used to run the program code stored in the memory 10 or process data, such as executing access restriction programs, etc.
[0128] It should be pointed out that Figure 2 The structure shown does not constitute a limitation on the computer. In other embodiments, the computer may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.
[0129] Those skilled in the art will appreciate that the logic and / or steps represented in the flowchart or otherwise described herein, for example, may be considered as an ordered list of executable instructions for implementing logical functions, and may be specifically implemented in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For purposes of this specification, "computer-readable medium" may be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.
[0130] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.
[0131] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or a combination thereof: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0132] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0133] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A method for detecting abnormal data in a smart grid, characterized in that: include; Obtain the grid status data at several time points within a period of time, calculate the distance between any two grid status data, and sort the calculated distances in ascending order; After sorting The grid status data is saved to the neighbor set In the example, based on the nearest neighbor set structure Neighborhood Graph , is the collection of power grid status data, For each grid status data and the previous The edge set formed by connecting the power grid status data; Obtaining an abnormal data of the plurality of power grid status data , and update the abnormal data to the collection In, according to the collection Performing an abnormal data detection operation, the detection operation comprising: Calculating Collections The first similarity difference with other grid status data ; according to Neighborhood Graph Get Collection Adjacent data set , calculate the set Each grid status data and collection Similarity , and sort them according to the degree of similarity; Traverse the collection in order according to the similarity All data in , calculate the set The second similarity difference between each data in and the remaining grid status data ; If exists , then judge the data Update the original collection for abnormal data , , the updated set As a new collection Repeat the above detection operation until the collection All data in the , and get the final abnormal data set After output, all abnormal data monitoring within this time period is completed; If not present , it means that there is only An abnormal data, the original set As the aggregate output of abnormal data, all abnormal data monitoring within the time period is completed.
2. The method for detecting abnormal data in a smart grid according to claim 1, characterized in that: The steps of obtaining the grid status data at a plurality of time points within a period of time, calculating the distance between any two grid status data, and sorting the calculated distances in ascending order include: Divide a period of time into preset intervals Time point, get The grid status data at a point in time, The grid status data at each time point constitutes a data set ; Select Grid status data at a point in time , for each selected grid status data , traverse the grid status data at other time points, and calculate the grid status data of this grid and the grid status data of other time points respectively, where, , is the number of data describing the power grid status in the power grid status data; For each selected power grid status data, the distances between the power grid status data and other power grid status data are sorted in ascending order, and so on, to complete the distance sorting of all power grid status data.
3. The method for detecting abnormal data in a smart grid according to claim 2, characterized in that: The distance calculation expression between the power grid status data is: In the formula, For the The grid status data at a point in time, For the The grid status data at a point in time, , For the The first time point describing the state of the power grid data, For the The first time point describing the state of the power grid data.
4. The method for detecting abnormal data in a smart grid according to claim 2, characterized in that: The first similarity difference The expression is: In the formula, is a collection of abnormal data. To remove the set in set D The data set that constitutes for and The cosine similarity between ; The calculation expression is: In the formula, , shown in the figure All above and connected data sets, , shown in the figure All above and connected data sets, data, data, data.
5. The method for detecting abnormal data in a smart grid according to claim 4, characterized in that: The adjacency data set The expression is: The similarity The expression is: The second similarity difference The expression is: In the formula, Representation diagram All above and Adjacent but not in set The data set in Representation diagram All above and Adjacent and in set The data set in data, data.
6. The method for detecting abnormal data in a smart grid according to claim 1, characterized in that: , and it is an integer.
7. An abnormal data detection system in a smart grid, characterized in that: include: The acquisition module is used to acquire the power grid status data at several time points within a period of time, calculate the distance between any two power grid status data, and sort the calculated distances in ascending order; Construction module, used to sort the front The grid status data is saved to the neighbor set In the example, based on the nearest neighbor set structure Neighborhood Graph , is the collection of power grid status data, For each grid status data and the previous The edge set formed by connecting the power grid status data; A detection module is used to obtain an abnormal data of the plurality of power grid status data. , and update the abnormal data to the collection In, according to the collection Performing an abnormal data detection operation, the detection operation comprising: Calculating Collections The first similarity difference with other grid status data ; according to Neighborhood Graph Get Collection Adjacent data set , calculate the set Each grid status data and collection Similarity , and sort them according to the degree of similarity; Traverse the collection in order according to the similarity All data in , calculate the set The second similarity difference between each data in and the remaining grid status data ; Judgment module, used to determine if there is , then judge the data Update the original collection for abnormal data , , the updated set As a new collection Repeat the above detection operation until the collection All data in the , and get the final abnormal data set After output, all abnormal data monitoring within this time period is completed; If not present , it means that there is only An abnormal data, the original set As the aggregate output of abnormal data, all abnormal data monitoring within the time period is completed.
8. A storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the abnormal data detection method in a smart grid as described in any one of claims 1 to 6 is implemented.
9. A computer comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method for detecting abnormal data in a smart grid as described in any one of claims 1 to 6 is implemented.
