Distribution network guarantee power supply automatic mapping method and system based on knowledge graph, medium and processor
By applying ant colony algorithm to optimize the search path in the knowledge graph, the problem of slow mapping of knowledge graphs in the existing technology is solved, and more efficient construction and automatic forming of power grid knowledge graphs are achieved.
Patent Information
- Application Number
- CN202411036052.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-31
- Publication Date
- 2024-11-08
AI Technical Summary
When searching databases, existing knowledge graphs adopt a sequential search strategy, resulting in slow graph formation speed and the inability to efficiently build the power grid knowledge graph.
The ant colony algorithm is used to retrieve the sampling point information and the location and signal relationship between the sampling points in the database, and the search path is optimized through the ant colony algorithm, and the knowledge graph is automatically formed and the layout is optimized.
It improves the forming speed of the knowledge graph, reduces the time required for automatic forming, improves overall work efficiency, and achieves faster and more accurate data processing.
Smart Images

Figure CN118917395A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of distribution network power supply control technology, and in particular to a distribution network power supply automatic mapping method, system, medium and processor based on a knowledge graph. Background Art
[0002] Knowledge graph is a modern theory that combines the theories and methods of applied mathematics, graphics, information visualization technology, information science and other disciplines with methods such as citation analysis and co-occurrence analysis in metrology, and uses visual graphs to vividly display the core structure, development history, frontier fields and overall knowledge architecture of disciplines to achieve the purpose of multidisciplinary integration. It displays complex knowledge fields through data mining, information processing, knowledge metrology and graph drawing, reveals the dynamic development laws of knowledge fields, and provides practical and valuable references for disciplinary research.
[0003] For example, the prior art CN112991092A discloses a power supply warning information analysis method based on knowledge graph technology, which includes the following steps: S1, setting target value: performing data association calculation and analysis, obtaining the warning target value and displaying it on a large screen; S2, demand analysis: establishing a power supply warning information composition framework, establishing a power supply warning information model based on knowledge graph technology, and establishing a power supply warning information analysis system; S3, overall plan; S4, development plan: system function module development and data integration development; S5, implementation plan.
[0004] Another typical example is a power grid knowledge graph construction method and system disclosed in the prior art CN111930784B, which aims to solve the technical problem of the lack of practical and efficient knowledge graph construction tools in the field of power grid technology in the prior art. It includes: collecting power grid related content and organizing power grid corpus; building and training a natural language processing model based on the power grid corpus; extracting power grid knowledge based on the natural language processing model, and storing the extraction results in a graph structure database.
[0005] Let's take a look at a method and system for constructing a power grid operation and maintenance knowledge graph as disclosed in the prior art CN115759253A, which is characterized in that the method includes the following steps: Step 1, selecting the operation and maintenance knowledge corpus and segmenting it, and then updating the power industry vocabulary; Step 2, using the power industry technical names, company names, expert names, and equipment names in the power industry vocabulary as entities, and entities with hierarchical and classification relationships as labels to construct the power grid operation and maintenance knowledge system from multiple dimensions; Step 3, taking each dimension in the multiple dimensions as a system label, and constructing a power grid operation and maintenance knowledge graph in the form of a data cube based on the multi-dimensional power grid operation and maintenance knowledge system.
[0006] The following problems are common in existing knowledge graphs and power grid technologies: when searching a database, a search strategy of searching one by one in sequence is often adopted, resulting in a slow knowledge graph generation speed. In order to solve the common problems in this field, the present invention is proposed.
[0007] In view of this, a method, system, medium and processor for automatic mapping of distribution network power supply based on knowledge graph are needed. Summary of the invention
[0008] In view of the problem that the prior art adopts a retrieval strategy of searching one by one in sequence, which leads to a slow speed of generating knowledge graphs, the present invention provides a method, system, medium and processor for automatically generating distribution network power supply graphs based on knowledge graphs, which can solve the problems in the background technology. The specific technical solution is as follows:
[0009] A method for automatically generating a graph for power supply guarantee of a distribution network based on a knowledge graph, comprising:
[0010] S1: collect real-time data from several sampling points in the distribution network, pre-process the data and store it in the database;
[0011] S2: Using ant colony algorithm to retrieve sampling point information and the position and signal relationship between sampling points in the database;
[0012] S3: Based on the position of each sampling point in the database, mark the information of each sampling point on the knowledge graph template;
[0013] S4: Analyze the position and signal relationship between each sampling point and mark them on the knowledge graph template;
[0014] S5: Based on the sampling point information and their mutual positions and signal relationships, the knowledge graph is automatically formed and the layout of the graph is automatically optimized.
[0015] Furthermore, the method of using the ant colony algorithm to retrieve the sampling point information and the position and signal relationship between the sampling points in the database includes the following steps:
[0016] S21: Initialize the number m of search signals and the number N of sampling points, initialize the tentative search path of the search signal, and calculate the path length C of the tentative search path NN and the initial pheromone signal concentration τ0, the formula is as follows:
[0017] C NN =C AB +C BC +…C ri …C MN ; τ0=m / C NN ;
[0018] Among them, Cri represents the distance from sampling point r to sampling point i, where r≠i, i=B, C……N, r=A, B……M;
[0019] S22: Select a random sampling point as a starting point for the retrieval signal;
[0020] S23: constructing a corresponding search strategy for each search signal based on the path selection mechanism, the search signal performs a search according to the search strategy corresponding to the search signal, and the search signal leaves a pheromone signal on the search path as a mark that the search signal passes through the search path;
[0021] S24: Whenever a retrieval signal completes its retrieval task, the pheromone signal concentration of each retrieval path is updated;
[0022] S25: If the updated pheromone signal concentration meets the end condition, the optimal search strategy is output and the analysis is ended, otherwise the search signal that has completed the search task is turned to step S22.
[0023] Furthermore, in step S23, constructing a corresponding search strategy for each search signal based on the path selection mechanism includes the following steps:
[0024] S231: Filtering the next target location that the retrieval signal can access according to the path selection mechanism;
[0025] S232: Determine whether the number of the next target position that can be accessed is 0; if so, set the next target position as the starting point selected in step S22, and the search strategy construction is completed; if not, proceed to the next step;
[0026] S233: Calculate the probability index P(ri) of the retrieval signal going to each target position;
[0027] S234: Generate a random number, and use the roulette method to select the next target location for the retrieval signal to go to based on the random number. After the retrieval signal reaches the target location, return to step S231.
[0028] Furthermore, in step S233, the calculation formula of the probability index P(ri) is as follows:
[0029]
[0030] Among them, τ ri is the pheromone signal concentration of the path between sampling points r and i, where r≠i, i=B, C……N, r=A, B……M; ε Ai is the visibility of the path between sampling point A and i; a and β represent the weights of pheromone signal concentration and visibility, respectively. The values of a and β are randomly generated and satisfy 0.7≤α≤0.8, 0.2≤β≤0.3, and α+β=1.
[0031] Furthermore, in step S24, the updating of the pheromone signal concentration of each search path includes the following steps:
[0032] S241: Calculate the path length of each search signal to obtain C1, C2, ..., Cm; wherein C1 refers to the total length of the path passed by the first search signal, and so on, to obtain m path lengths;
[0033] S242: Update the pheromone signal concentration on each path according to the following formula:
[0034]
[0035] In the above formula, p is the evaporation rate of the pheromone signal, which is used to reduce the growth rate of the pheromone signal concentration, which is helpful to avoid inaccurate analysis results caused by the analysis ending too quickly, and p is greater than 0 and less than or equal to 1; is the pheromone left by the kth retrieval signal from the collection point r to i; τ ri1 is τ ri Updated pheromone signal concentration.
[0036] Furthermore, the termination condition is that the pheromone signal concentration on a certain path is greater than or equal to 0.8.
[0037] Furthermore, in step S25, the outputting of the optimal search strategy includes the following steps:
[0038] S251: extracting the search path of this search from the search path record of the search signal that meets the end condition;
[0039] S252: Setting this search as the optimal search strategy and marking the search path;
[0040] S253: Bind the optimal search strategy to the user instruction, and update the search strategy corresponding to the user instruction.
[0041] A distribution network power supply automatic mapping system based on knowledge graph is applied to the distribution network power supply automatic mapping method based on knowledge graph described above, comprising:
[0042] The acquisition module is used to collect real-time data from several sampling points in the distribution network, and store the data in the database after pre-processing;
[0043] A retrieval module, which is used to retrieve the sampling point information and the position and signal relationship between the sampling points in the database using an ant colony algorithm;
[0044] A first marking module, which is used to mark each sampling point information on the knowledge graph template based on the position of each sampling point in the database;
[0045] The second marking module is used to analyze the position and signal relationship between each sampling point and mark them on the knowledge graph template;
[0046] The composition module is used to automatically form a knowledge graph and automatically optimize the layout of the graph based on the sampling point information and their mutual positions and signal relationships.
[0047] A computer-readable storage medium, comprising a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the above-mentioned automatic mapping method for distribution network power supply based on knowledge graph.
[0048] A processor is used to run a program, wherein when the program is running, the above-mentioned automatic mapping method for distribution network power supply based on knowledge graph is executed.
[0049] Compared with the prior art, the present invention has the following beneficial effects:
[0050] 1. By improving the existing knowledge graph, the retrieval signal can automatically optimize the retrieval path, which can gradually reduce the time required for the automatic formation of the knowledge graph and ultimately reach an optimal solution, which is conducive to improving the speed of automatic formation of the knowledge graph and improving overall work efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following is a brief introduction to the drawings required for the specific embodiments or the description of the prior art. In all the drawings, similar elements or parts are generally identified by similar reference numerals. In the drawings, the elements or parts are not necessarily drawn according to the actual scale.
[0052] Figure 1 This is a flow chart of the first method for automatically generating a graph for power distribution network based on knowledge graph;
[0053] Figure 2 This is a schematic diagram of the structure of the automatic mapping system for power distribution network security based on knowledge graph of the present invention;
[0054] Figure 3 This is a flow chart of the second method for automatically generating a graph for power distribution network based on knowledge graph;
[0055] Figure 4 A schematic diagram of a process for searching a corresponding sampling point and related data of the sampling point in a database;
[0056] Figure 5 Construct a corresponding retrieval strategy flow chart for each retrieval signal;
[0057] Figure 6 Schematic diagram of the flow of a design method for tentatively determining a search path for a search signal. DETAILED DESCRIPTION
[0058] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0059] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0060] It should also be understood that the terms used in the present specification are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the present specification and the appended claims, the singular forms "a", "an" and "the" are intended to include plural forms unless the context clearly indicates otherwise.
[0061] It should be further understood that the term "and / or" used in the present description and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0062] Embodiment 1
[0063] like Figure 1 The figure shows a flow chart of a method for automatically generating a diagram for power distribution network based on a knowledge graph, including:
[0064] S1: collect real-time data from several sampling points in the distribution network, pre-process the data and store it in the database;
[0065] S2: receiving a user instruction, analyzing the user instruction, analyzing the sampling points that need to be retrieved by the user instruction, marking the original user instruction based on the analysis result, and then using the ant colony algorithm to retrieve the sampling point information and the position and signal relationship between the sampling points in the database according to the user instruction;
[0066] S3: Pack the relevant data of each sampling point, and mark the information of each sampling point on the knowledge graph template based on the position of each sampling point in the database;
[0067] S4: Analyze and sort out the position and signal relationship between each sampling point and mark them on the knowledge graph template, establish and mark the relationship chain between each sampling point;
[0068] S5: Based on the sampling point information and their mutual positions and signal relationships, the knowledge graph is automatically formed and the layout of the graph is automatically optimized.
[0069] In a specific implementation, the ant colony algorithm is used to retrieve the sampling point information and the position and signal relationship between the sampling points in the database, including the following steps:
[0070] S21: Initialize the number m of search signals and the number N of sampling points, initialize the tentative search path of the search signal, and calculate the path length C of the tentative search path NN and the initial pheromone signal concentration τ0, the formula is as follows:
[0071] C NN =C AB +C BC +…C ri …C MN ; τ0=m / C NN ;
[0072] Among them, C ri represents the distance from sampling point r to sampling point i, where r≠i, i=B, C……N, r=A, B……M;
[0073] It is worth noting that when the search signal is searching, a pheromone signal will be left in the search path. The pheromone signal marks the search path that the search signal has traveled. The specific implementation method can be: each time the search signal travels through a search path, the search path will be marked on the virtual path map. This is only for reference and is not limited to this.
[0074] Specifically, the number of search signals m is less than the number of sampling points N, and the tentative search path is to search from sampling point A to B in alphabetical order to sampling point N. The tentative search path is only used to obtain the initial pheromone signal concentration τ0, and the tentative search path is independent of the actual search path of the search signal. In this step, m search signals are used to search N sampling points at the same time, that is, each search signal searches N sampling points, and m search signals are performed simultaneously. Each search signal will search independently, and finally the m search signals will find the best path for each sampling point according to the pheromone signal concentration comparison, and finally determine their respective paths.
[0075] S22: Select a random sampling point as a starting point for the retrieval signal;
[0076] S23: constructing a corresponding search strategy for each search signal based on the path selection mechanism, the search signal performs a search according to the search strategy corresponding to the search signal, and the search signal leaves a pheromone signal on the search path as a mark that the search signal passes through the search path;
[0077] Specifically, the path selection mechanism includes the following features: the path covers all sampling points that need to be searched; the starting point and the end point of the path are the same; except for the starting point, each sampling point will only be passed once in the search process of each search signal. Such a setting is conducive to shortening the search distance of the search signal and improving the search efficiency; specifically, the search function can be implemented using tools such as phpMyAdmin and SQLAlchemy, which are not limited here;
[0078] S24: Whenever a retrieval signal completes its retrieval task, the pheromone signal concentration of each retrieval path is updated;
[0079] S25: If the updated pheromone signal concentration meets the end condition, the optimal search strategy and the path information of each sampling point are output and the analysis is ended, otherwise the search signal that has completed the search task is turned to step S22. After each round of search, it is necessary to output the search strategy. Because the search strategy is used to guide the subsequent search process and improve the search efficiency and accuracy. The purpose of outputting the search strategy is to optimize and adjust the subsequent search, so that each round of search is more efficient and accurate.
[0080] In step S2, the goal of the search is to find the optimal path between the sampling points and to build a search strategy. The search strategy is used in the subsequent knowledge graph construction process to guide how to efficiently retrieve and process data and ensure the accuracy and completeness of the knowledge graph.
[0081] In a specific implementation, in step S23, constructing a corresponding search strategy for each search signal based on the path selection mechanism includes the following steps:
[0082] S231: Filtering the next target location that the retrieval signal can access according to the path selection mechanism;
[0083] S232: Determine whether the number of the next target position that can be accessed is 0; if so, set the next target position as the starting point selected in step S22, and the search strategy construction is completed; if not, proceed to the next step;
[0084] S233: Calculate the probability index P(ri) of the search signal going to each target position; the calculated probability index P(ri) is used to select the next target position by the roulette method. The probability index P(ri) represents the probability of each target position being selected, and the probability index is calculated to determine the priority of each target position, so as to perform random selection by the roulette method.
[0085] S234: Generate a random number, and use the roulette method to select the next target position for the retrieval signal to go to according to the random number. After the retrieval signal reaches the target position, return to step S231. The target position refers to the sampling point where the retrieval signal will reach next. This step is to formulate a retrieval strategy, but in the process the retrieval signal will move to each sampling point to select the next target position. It is worth noting that the roulette method belongs to the existing algorithm and will not be elaborated here. The value range of the random number is greater than 0 and less than or equal to 1.
[0086] In a specific implementation, in step S233, the calculation formula of the probability index P(ri) is as follows:
[0087]
[0088] Among them, τ ri is the pheromone signal concentration of the path between sampling points r and i, where r≠i, i=B, C……N, r=A, B……M; ε Ai is the visibility of the path between sampling points A and i; a and β represent the weights of pheromone signal concentration and visibility respectively, and the values of a and β are randomly generated and satisfy 0.7≤α≤0.8, 0.2≤β≤0.3, α+β=1; further, the visibility is equal to the inverse of the distance between sampling points; further, when this retrieval is the first retrieval, the pheromone signal concentration on all paths is equal to the initial pheromone signal concentration τ0;
[0089] For example, the probability index P(AB) of the search signal going from A to the target location B is:
[0090]
[0091] Among them, τ Ai is the pheromone signal concentration of the path between sampling points A and i, where r≠i, i=B, C……N, r=A, B……M, ε Ai is the visibility of the path between sampling point A and i; α and β represent the weights of pheromone signal concentration and visibility respectively, the values of α and β are randomly generated and 0.7≤α≤0.8, 0.2≤β≤0.3, α+β=1; P(AB) represents the probability index of the retrieval signal selecting sampling point B from the current sampling point A, τ AiThe larger the retrieval signal is, the greater the probability of selecting sampling point i from the current sampling point A;
[0092] In a specific implementation, in step S24, the updating of the pheromone signal concentration of each search path includes the following steps:
[0093] S241: Calculate the path length of each search signal to obtain C1, C2, ..., Cm; wherein C1 refers to the total length of the path passed by the first search signal, and so on, to obtain m path lengths;
[0094] S242: Update the pheromone signal concentration on each path according to the following formula:
[0095]
[0096]
[0097] In the above formula, p is the evaporation rate of the pheromone signal, which is used to reduce the growth rate of the pheromone signal concentration, which is helpful to avoid inaccurate analysis results caused by the analysis ending too quickly, and p is greater than 0 and less than or equal to 1; is the pheromone left by the kth retrieval signal from the collection point r to i; τ ri1 is τ ri Updated pheromone signal concentration.
[0098] Furthermore,
[0099] Furthermore, Ck is the total length of the path traversed by the kth search signal; and the evaporation rate p is set by those skilled in the art according to the accuracy of the optimal search strategy required, and the smaller p is, the higher the accuracy is.
[0100] In a specific implementation, the end condition is that the pheromone signal concentration on a certain path is greater than or equal to 0.8.
[0101] In a specific implementation, in step S25, the output of the optimal search strategy includes the following steps:
[0102] S251: extracting the search path of this search from the search path record of the search signal that meets the end condition;
[0103] S252: Setting this search as the optimal search strategy and marking the search path;
[0104] S253: Bind the optimal search strategy to the user instruction, and update the search strategy corresponding to the user instruction.
[0105] The output is the retrieval strategy, not the retrieval path. The retrieval strategy guides the subsequent retrieval process and optimizes the construction of the knowledge graph. The optimal retrieval strategy ensures the efficiency and accuracy of the retrieval path, and provides guidance on how to effectively retrieve and process data in the subsequent process of building the graph. The role of the retrieval strategy in the construction of the knowledge graph is reflected in: 1. Improving retrieval efficiency. The optimized retrieval strategy can find data faster and increase data processing speed; 2. Ensuring data accuracy. Through the optimal retrieval path, ensure the accuracy and completeness of data retrieval to avoid omissions or errors; 3. Guiding graph construction. The retrieval strategy provides a systematic method to guide how to extract and process data from the database, ensuring that the construction process of the knowledge graph is orderly and efficient.
[0106] By improving the existing knowledge graph, the retrieval signal can automatically optimize the retrieval path, which can gradually reduce the time required for the automatic formation of the knowledge graph and ultimately reach an optimal solution. This is conducive to increasing the speed of automatic formation of the knowledge graph and improving overall work efficiency.
[0107] Embodiment 2
[0108] This embodiment should be understood to include all the features of any of the above embodiments, and further improve on the basis thereof. The solution of the present application also includes a design method for a tentative search path for a search signal, comprising the following steps:
[0109] The first step is to randomly specify a sampling point as the starting point of the retrieval signal and select the sampling points that the retrieval signal can go to;
[0110] The second step is to determine whether the number of sampling points that the search signal can go to is 0 based on the sampling point where the search signal is currently located. If so, the fourth step is executed. Otherwise, the third step is executed.
[0111] Step 3: Select the sampling point with the highest visibility among the sampling points that the retrieval signal can reach as the next target point of the retrieval signal, and return to step 2;
[0112] The fourth step is to return to the starting point of the retrieval signal and obtain a tentative retrieval path of the retrieval signal.
[0113] Beneficial effects of this embodiment:
[0114] By using the method of setting a provisional search path in this embodiment, a provisional search path consisting of local optimal solutions can be found. The initial pheromone concentration obtained by this method is neither too large nor too small. While maintaining a high pheromone update speed, it is helpful to avoid errors caused by the pheromone update ending too quickly.
[0115] Embodiment 3
[0116] A distribution network power supply automatic mapping system based on knowledge graph is applied to the distribution network power supply automatic mapping method based on knowledge graph described above, comprising:
[0117] The acquisition module is used to collect real-time data from several sampling points in the distribution network, and store the data in the database after pre-processing;
[0118] A retrieval module, which is used to retrieve the sampling point information and the position and signal relationship between the sampling points in the database using an ant colony algorithm;
[0119] A first marking module, which is used to mark each sampling point information on the knowledge graph template based on the position of each sampling point in the database;
[0120] The second marking module is used to analyze the position and signal relationship between each sampling point and mark them on the knowledge graph template;
[0121] The composition module is used to automatically form a knowledge graph and automatically optimize the layout of the graph based on the sampling point information and their mutual positions and signal relationships.
[0122] Embodiment 4
[0123] like Figures 2 to 6 As shown, an automatic mapping and analysis system for distribution network power supply based on knowledge graph includes an automatic mapping system and an analysis system. The automatic mapping system includes a data acquisition module, a data processing module, and a knowledge graph construction module. The data acquisition module is used to obtain real-time data from the distribution network, the data processing module is used to pre-process the data, and the knowledge graph construction module is used to convert the data into the form of a knowledge graph; the analysis system includes an analysis module, an anomaly detection module and an anomaly analysis module. The analysis module is used to analyze the knowledge graph according to user instructions, and the anomaly detection module is used to detect in real time whether data indicators have anomalies; the anomaly analysis module is used to analyze the causes of abnormal data and solutions.
[0124] Furthermore, the data acquisition module communicates with the local area network signal to receive the data signal, and the data collected by the data acquisition module includes the current of the sampling point, the voltage of the sampling point, the power of the sampling point, the position relationship between the sampling points, and the signal relationship between the sampling points; the data processing module includes a filter and a noise reducer, and the filter and the noise reducer are used to reduce noise and improve signal accuracy;
[0125] Furthermore, the knowledge graph construction module includes an interaction unit, a database, a retrieval unit, a marking unit, a relationship combing unit, and a graph forming unit; the interaction unit is used to receive the user's image requirement instructions and return the output results; the database is used to store the data processed by the data processing module; the retrieval unit is used to retrieve sampling points and related data of the sampling points in the database; the marking unit is used to mark the information of each sampling point on the knowledge graph template; the relationship combing unit is used to analyze the positional relationship between each sampling point and the signal relationship between each sampling point and mark them on the knowledge graph template; the graph forming unit is used to automatically form the knowledge graph and automatically optimize the layout of the graph.
[0126] Furthermore, the knowledge graph construction module constructs the knowledge graph including the following steps:
[0127] STEP 1: The interaction unit receives a user instruction and sends the instruction to the retrieval unit;
[0128] It is worth noting that the interaction unit also includes a user instruction analysis unit, which is used to analyze the user instruction and analyze the sampling points that the retrieval unit needs to retrieve for the user instruction. The interaction unit marks the original user instruction based on the analysis result and sends the marked user instruction to the retrieval unit.
[0129] STEP 2: The retrieval unit searches for the corresponding sampling point and the relevant data of the sampling point in the database according to the received user instruction, and sends the data to the marking unit;
[0130] STEP 3: The marking unit packages the relevant data of each sampling point and marks it on the knowledge graph template based on the position of each sampling point in the database;
[0131] STEP 4: The relationship combing unit establishes and marks the relationship chain between each sampling point on the knowledge graph template according to the position relationship and signal relationship between each sampling point;
[0132] STEP5: The graph forming unit automatically performs typesetting optimization on the processed knowledge graph template to obtain a power grid knowledge graph.
[0133] Furthermore, the retrieval unit searches the database for the corresponding sampling point and the relevant data of the sampling point according to the received user instruction, including the following steps:
[0134] S1: Initialize the number of search signals m and the number of sampling points N according to the user's instructions, initialize the tentative search path of the search signal, and calculate the path length C of the tentative search path according to the following formula: NN, and the initial pheromone signal concentration τ0 is obtained according to the path length of the tentative search path:
[0135] C NN =C AB +C BC +…C ri …C MN ; τ0=m / C NN ;
[0136] Among them, C ri represents the distance from sampling point r to sampling point i, where r≠i, i=B, C……N, r=A, B……M;
[0137] It is worth noting that when the search signal is searching, a pheromone signal will be left in the search path. The pheromone signal marks the search path that the search signal has traveled. The specific implementation method can be: each time the search signal travels through a search path, the search path will be marked on the virtual path map. This is only for reference and is not limited to this.
[0138] Specifically, the number m of the retrieval signals is less than the number N of the sampling points, and the tentative retrieval path is to retrieve the sampling point N in alphabetical order from sampling point A to B. The tentative retrieval path is only used to obtain the initial pheromone signal concentration τ0, and the tentative retrieval path has nothing to do with the actual retrieval path of the retrieval signal;
[0139] S2: Select a random sampling point as the starting point for the retrieval signal;
[0140] S3: Based on the path selection mechanism, a corresponding retrieval strategy is constructed for each retrieval signal. The retrieval signal is retrieved according to the corresponding retrieval strategy, and the retrieval signal leaves a pheromone signal on the retrieval path;
[0141] S4: Whenever a retrieval signal completes its retrieval task, the pheromone signal concentration of each retrieval path is updated;
[0142] S5: If the updated pheromone signal concentration meets the end condition, the optimal retrieval strategy is output and the analysis is ended, otherwise the retrieval signal that has completed the retrieval task is turned to S2.
[0143] Specifically, the path selection mechanism includes the following features: the path covers all sampling points that need to be searched; the starting point and the end point of the path are the same; except for the starting point, each sampling point will only be passed once during the search process of each search signal. Such a setting is conducive to shortening the search distance of the search signal and improving the search efficiency.
[0144] Specifically, the search function may be implemented using tools such as phpMyAdmin and SQLAlchemy, which are not limited here.
[0145] Furthermore, in step S3, constructing a corresponding search strategy for each search signal includes the following steps:
[0146] S31: screening the next target location that the retrieval signal can access according to the path selection mechanism;
[0147] S32: Determine whether the number of the next target position that can be accessed is 0. If so, the next target position is set as the starting point selected in S2, and the search strategy is constructed; if not, proceed to the next step;
[0148] S33: Calculate the probability index P(ri) of the retrieval signal going to each target position;
[0149] Specifically, the probability index P(ri) calculation formula is as follows:
[0150]
[0151] For example, the probability index P(AB) of the search signal going from A to the target location B is:
[0152]
[0153] Among them, τ Ai is the pheromone signal concentration of the path between sampling points A and i, where r≠i, i=B, C……N, r=A, B……M, ε Ai is the visibility of the path between sampling point A and i; α and β represent the weights of pheromone signal concentration and visibility respectively, the values of α and β are randomly generated and 0.7≤α≤0.8, 0.2≤β≤0.3, α+β=1; P(AB) represents the probability index of the retrieval signal selecting sampling point B from the current sampling point A, τ Ai The larger the retrieval signal is, the greater the probability of selecting sampling point i from the current sampling point A;
[0154] Specifically, the visibility magnitude is equal to the inverse of the distance between sampling points;
[0155] Specifically, when this retrieval is the first retrieval, the pheromone signal concentration on all paths is equal to the initial pheromone signal concentration τ0;
[0156] S34: Generate a random number, and use a roulette wheel method to select the next target location for the search signal to go to according to the random number. After the search signal reaches the target location, return to step S31;
[0157] It is worth noting that the roulette method belongs to an existing algorithm and will not be elaborated here. The value range of the random number is greater than 0 and less than or equal to 1.
[0158] Furthermore, in step S4, updating the pheromone signal concentration of each search path includes the following steps:
[0159] S41: Calculate the length of the path traversed by each search signal to obtain C1, C2, ..., Cm; wherein C1 refers to the total length of the path traversed by the first search signal, and so on;
[0160] S42: updating the pheromone signal concentration on each path according to the following formula;
[0161]
[0162] Wherein, p is the evaporation rate of the pheromone signal, and the evaporation rate is used to reduce the growth rate of the pheromone signal concentration, which is helpful to avoid inaccurate analysis results caused by the analysis ending too quickly; the evaporation rate is greater than 0 and less than or equal to 1; is the pheromone left by the kth retrieval signal on the path from r to i; τ ri1 is τ ri Updated pheromone signal concentration;
[0163] Specifically,
[0164] Specifically, Ck is the total length of the path traversed by the kth search signal, and the evaporation rate p is set by those skilled in the art according to the accuracy of the optimal search strategy required. The smaller p is, the higher the accuracy is.
[0165] Furthermore, in S5, the end condition is that the pheromone signal concentration on a certain path is greater than or equal to 0.8, and outputting the optimal search strategy includes the following steps:
[0166] S51, extracting the search path of this search from the search path record of the search signal that meets the end condition;
[0167] S52, setting the current search as the optimal search strategy and marking the search path;
[0168] S53, binding the optimal search strategy with the user instruction, and updating the search strategy corresponding to the user instruction.
[0169] The beneficial effects of this embodiment are as follows: by improving the existing knowledge graph, the retrieval signal can automatically optimize the retrieval path, and the time required for automatic formation of the knowledge graph can be gradually reduced, and an optimal solution can be finally reached, which is beneficial to increase the speed of automatic formation of the knowledge graph and improve the overall work efficiency.
[0170] Embodiment 5
[0171] A computer-readable storage medium, comprising a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the above-mentioned automatic mapping method for distribution network power supply based on knowledge graph.
[0172] Embodiment 6
[0173] A processor is used to run a program, wherein when the program is running, the above-mentioned automatic mapping method for distribution network power supply based on knowledge graph is executed.
[0174] The present application provides a method for automatically mapping distribution network power supply based on knowledge graph, including: S1: collecting real-time data from several sampling points in the distribution network, pre-processing the data and storing it in a database; S2: using an ant colony algorithm to retrieve sampling point information and the position and signal relationship between sampling points in the database; S3: based on the position of each sampling point in the database, marking each sampling point information on the knowledge graph template; S4: analyzing the position and signal relationship between each sampling point and marking it on the knowledge graph template; S5: automatically forming a knowledge graph and automatically optimizing the layout of the graph based on the sampling point information and their mutual position and signal relationship. By improving the existing knowledge graph, the retrieval signal can automatically optimize the retrieval path, and the time required for the automatic formation of the knowledge graph can be gradually reduced, and an optimal solution can be finally achieved, which is conducive to improving the speed of automatic formation of the knowledge graph and improving the overall work efficiency.
[0175] Those of ordinary skill in the art will appreciate that the units of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition of each example has been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0176] In the embodiments provided by the present invention, it should be understood that the division of units is only a logical function division, and there may be other division methods in actual implementation, for example, multiple units can be combined into one unit, one unit can be split into multiple units, or some features can be ignored, etc.
[0177] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0178] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-0nlyMemory), random access memory (RAM, RandomAccessMemory), mobile hard disk, magnetic disk or optical disk, etc., which can store program code.
[0179] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents. These modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present invention, and they should all be included in the scope of the claims and specification of the present invention.
Claims
1. A method for automatically generating a map for power supply guarantee in a distribution network based on a knowledge graph, characterized in that: include: S1: collect real-time data from several sampling points in the distribution network, pre-process the data and store it in the database; S2: Using ant colony algorithm to retrieve sampling point information and the position and signal relationship between sampling points in the database; S3: Based on the position of each sampling point in the database, mark the information of each sampling point on the knowledge graph template; S4: Analyze the position and signal relationship between each sampling point and mark them on the knowledge graph template; S5: Based on the sampling point information and their mutual positions and signal relationships, the knowledge graph is automatically formed and the layout of the graph is automatically optimized.
2. The method for automatically generating a map for power supply guarantee based on knowledge graph according to claim 1 is characterized in that: The method of using the ant colony algorithm to retrieve the sampling point information and the position and signal relationship between the sampling points in the database includes the following steps: S21: Initialize the number m of search signals and the number N of sampling points, initialize the tentative search path of the search signal, and calculate the path length C of the tentative search path NN and the initial pheromone signal concentration τ0, the formula is as follows: C NN =C AB +C BC +…C ri …C MN ;τ0=m / C NN ; Among them, C ri represents the distance from sampling point r to sampling point i, where r≠i, i=B, C……N, r=A, B……M; S22: Select a random sampling point as a starting point for the retrieval signal; S23: constructing a corresponding search strategy for each search signal based on the path selection mechanism, the search signal performs a search according to the search strategy corresponding to the search signal, and the search signal leaves a pheromone signal on the search path as a mark that the search signal passes through the search path; S24: Whenever a retrieval signal completes its retrieval task, the pheromone signal concentration of each retrieval path is updated; S25: If the updated pheromone signal concentration meets the end condition, the optimal search strategy is output and the analysis is ended, otherwise the search signal that has completed the search task is turned to step S22.
3. The method for automatically generating a map for power supply guarantee based on knowledge graph according to claim 2 is characterized in that: In step S23, constructing a corresponding search strategy for each search signal based on the path selection mechanism includes the following steps: S231: Filtering the next target location that the retrieval signal can access according to the path selection mechanism; S232: Determine whether the number of the next target position that can be accessed is 0; if so, set the next target position as the starting point selected in step S22, and the search strategy construction is completed; if not, proceed to the next step; S233: Calculate the probability index P(ri) of the retrieval signal going to each target position; S234: Generate a random number, and use the roulette method to select the next target location for the retrieval signal to go to based on the random number. After the retrieval signal reaches the target location, return to step S231.
4. The method for automatically generating a map for power supply guarantee based on knowledge graph according to claim 3 is characterized in that: In step S233, the calculation formula of the probability index P(ri) is as follows: Among them, τ ri is the pheromone signal concentration of the path between sampling points r and i, where r≠i, i=B, C……N, r=A, B……M; ε Ai is the visibility of the path between sampling point A and i; a and β represent the weights of pheromone signal concentration and visibility, respectively. The values of a and β are randomly generated and satisfy 0.7≤α≤0.8, 0.2≤β≤0.3, and α+β=1.
5. The method for automatically generating a map for power supply guarantee based on knowledge graph according to claim 4 is characterized in that: In step S24, the updating of the pheromone signal concentration of each search path includes the following steps: S241: Calculate the path length of each search signal to obtain C1, C2, ..., Cm; wherein C1 refers to the total length of the path passed by the first search signal, and so on, to obtain m path lengths; S242: Update the pheromone signal concentration on each path according to the following formula: In the above formula, p is the evaporation rate of the pheromone signal, which is used to reduce the growth rate of the pheromone signal concentration, which is helpful to avoid inaccurate analysis results caused by the analysis ending too quickly, and p is greater than 0 and less than or equal to 1; is the pheromone left by the kth retrieval signal from the collection point r to i; τ ri1 is τ ri Updated pheromone signal concentration.
6. The method for automatically generating a map for power supply guarantee based on knowledge graph according to claim 2 is characterized in that: The end condition is that the pheromone signal concentration on a certain path is greater than or equal to 0.
8.
7. The method for automatically generating a map for power supply guarantee based on knowledge graph according to claim 2 is characterized in that: In step S25, the outputting of the optimal search strategy includes the following steps: S251: extracting the search path of this search from the search path record of the search signal that meets the end condition; S252: Setting this search as the optimal search strategy and marking the search path; S253: Bind the optimal search strategy to the user instruction, and update the search strategy corresponding to the user instruction.
8. A knowledge graph-based automatic mapping system for power supply distribution network, characterized in that: The method for automatically generating a map for power supply guarantee based on a knowledge graph applied to any one of claims 1 to 7 comprises: The acquisition module is used to collect real-time data from several sampling points in the distribution network, and store the data in the database after pre-processing; A retrieval module, which is used to retrieve the sampling point information and the position and signal relationship between the sampling points in the database using an ant colony algorithm; A first marking module, which is used to mark each sampling point information on the knowledge graph template based on the position of each sampling point in the database; The second marking module is used to analyze the position and signal relationship between each sampling point and mark them on the knowledge graph template; The composition module is used to automatically form a knowledge graph and automatically optimize the layout of the graph based on the sampling point information and their mutual positions and signal relationships.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein when the program is running, the device where the computer-readable storage medium is located is controlled to execute the automatic mapping method for distribution network power supply based on knowledge graph as described in any one of claims 1 to 7.
10. A processor, characterized in that: The processor is used to run a program, wherein when the program is running, the method for automatically generating a map for distribution network power supply based on a knowledge graph as described in any one of claims 1 to 7 is executed.
