A method and system for constructing a knowledge base in the field of power grid based on vector database

By applying a vector database-based method in the power grid field, processing keywords and similar word vectors of power grid data, clustering and index coding, the problems of low correlation and performance bottlenecks in traditional databases when processing unstructured data are solved, and efficient and accurate information retrieval and in-depth data analysis are achieved.

CN119782448APending Publication Date: 2025-04-08BEIJING SGITG ACCENTURE INFORMATION TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411852942.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-16
Publication Date
2025-04-08

AI Technical Summary

Technical Problem

When traditional databases process unstructured or semi-structured text data in the power grid field, it is difficult for traditional databases to capture deep logical relationships and semantic connections, resulting in low correlation between knowledge indexes and inability to accurately reflect the intrinsic connections of data. At the same time, they show performance bottlenecks when facing a large number of concurrent access requests, affecting the user experience.

Method used

Using a vector database-based method, by obtaining keywords in the power grid data file and vectorizing these keywords, determining similar word vectors of word vectors, hashing operations, generating mapping values, counting, obtaining the second feature, and clustering the data file with keywords, and finally executing the index code to build a knowledge base in the power grid field.

Benefits of technology

It realizes refined classification and indexing of power grid data, improves the efficiency and accuracy of information retrieval, enhances the system's response speed and user experience, and supports deeper data analysis and mining.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119782448A_ABST
    Figure CN119782448A_ABST
Patent Text Reader

Abstract

The embodiment of the present invention provides a method and system for constructing a knowledge base in the field of power grid based on a vector database, which belongs to the field of emerging software and new information technology services. The method includes: obtaining a power grid data file to be stored; obtaining keywords in the power grid data file; using a preset vector database to process the keywords to obtain word vectors; determining similar word vectors of each word vector according to a preset similarity distance; word-processing the power grid data file; sequentially reading the power grid data file after word processing; processing the read word vectors or similar word vectors to obtain mapping values; counting according to the mapping values; using the counting result as the second feature of the power grid data file; clustering the power grid data file using the second feature and the keywords; index encoding the result of the clustering operation to obtain the power grid domain knowledge base.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of emerging software and new information technology services, and in particular to a method and system for constructing a knowledge base in the field of power grids based on a vector database. Background Art

[0002] With the continuous improvement of the informationization level of the power industry, massive amounts of power document data need to be effectively managed and utilized. These documents usually contain rich technical details, operating procedures, fault records and other key information, which are of great significance for ensuring the safe and stable operation of the power grid. Traditional relational database systems face many challenges in processing such unstructured or semi-structured text data. First, the method based on simple keyword matching is difficult to capture the deep logical relationship and semantic connection between the document content, resulting in a low correlation degree of the generated knowledge index, which cannot accurately reflect the intrinsic connection between the data. Secondly, when faced with a large number of concurrent access requests, the traditional database architecture often shows performance bottlenecks, especially when frequent read and write operations are required, the system response speed will drop significantly, affecting the user experience. In addition, due to the lack of support for natural language understanding, the existing solutions have obvious deficiencies in executing complex queries or providing intelligent services, such as difficulty in realizing accurate information retrieval, intelligent question and answer functions, which limits its effectiveness in practical applications. Therefore, how to build a knowledge management system that can both efficiently store and quickly retrieve large-scale power document data and support deeper data analysis and mining has become one of the urgent problems to be solved. Summary of the invention

[0003] The purpose of the embodiments of the present invention is to provide a method and system for constructing a knowledge base in the field of power grid based on a vector database, wherein the method and system can classify power grid data files in a more refined manner.

[0004] In order to achieve the above object, an embodiment of the present invention provides a method for constructing a power grid domain knowledge base based on a vector database, comprising:

[0005] Obtaining the power grid data file to be stored;

[0006] Obtaining keywords in the power grid data file;

[0007] Using a preset vector database to vectorize the keyword to obtain a corresponding word vector;

[0008] Determining a similar word vector of each of the word vectors according to a preset similarity distance;

[0009] Tokenizing the power grid data file;

[0010] Sequentially reading the power grid data file after the word processing;

[0011] Performing a hash operation on the word vector or similar word vector read to obtain a corresponding mapping value;

[0012] Counting in a preset counter array according to the mapping value;

[0013] Using the counting result as the second feature of the power grid data file;

[0014] performing a clustering operation on the power grid data file using the second feature and the keyword;

[0015] The result of the clustering operation is indexed and encoded to obtain the power grid domain knowledge base.

[0016] Optionally, obtaining keywords in the power grid data file includes:

[0017] Taking each word or phrase in the power grid data file as a node and the association relationship between words or phrases as an edge, constructing a keyword directed graph expressing the keyword information of the power grid data file;

[0018] Determining the weight of each edge in the keyword directed graph;

[0019] Calculate the importance of each word or phrase according to the weight;

[0020] A plurality of the words or phrases are selected from the keyword directed graph in descending order of importance to obtain the keyword.

[0021] Optionally, determining the weight of each edge in the keyword directed graph includes:

[0022] The weight is calculated according to formula (1) and formula (2):

[0023] f i =a1f1+a mid f mid +a end f end , (1)

[0024]

[0025] Among them, λ i is the weight of the ith edge, a1 is the homepage correction value, f1 is the frequency of the two words or phrases corresponding to the edge appearing simultaneously within the preset range of the homepage, a mid is the intermediate text correction value, f midThe frequency of two words or phrases corresponding to the edge appearing at the same time in the preset range except the first and last pages, a end is the last page correction value, f end is the frequency of the two words or phrases corresponding to the edge appearing simultaneously within the preset range of the last page, and I is the number of edges.

[0026] Optionally, determining a similar word vector of each of the word vectors according to a preset similarity distance includes:

[0027] The cosine similarity method is used to determine the similar word vectors.

[0028] Optionally, taking the counting result as the second feature of the power grid data file includes:

[0029] Arranging the corresponding count values ​​according to the order of each array in the counter array to obtain a one-dimensional code;

[0030] The one-dimensional code is used as the second feature.

[0031] Optionally, using the second feature and the keyword to perform a clustering operation on the power grid data file includes:

[0032] Traversing the keyword groups of each of the power grid data files, and respectively calculating the distance between each two of the power grid data files;

[0033] Initialize the number of generated centers;

[0034] randomly selecting a number of said power grid data files of said center as a center;

[0035] Put the remaining power grid data files into the set corresponding to each center according to the size relationship of the distance;

[0036] Calculate the average value of each set respectively;

[0037] Taking the power grid data file closest to the average value as a new center;

[0038] Determine whether the new center is the same as the old center;

[0039] When it is determined that the new center is different from the old center, determining whether the current number of iterations is greater than or equal to a preset number threshold;

[0040] If it is determined that the current number of iterations is greater than or equal to the number threshold, the number of centers is updated, and the step of randomly selecting the number of power grid data files as centers is returned to be executed;

[0041] When it is determined that the number of iterations is less than the number threshold, returning to the step of placing the remaining power grid data files into the set corresponding to each center according to the size relationship of the distances;

[0042] When it is determined that the new center is the same as the old center, the currently generated set is output as the preliminary clustering result.

[0043] Optionally, using the second feature and the keyword to perform a clustering operation on the power grid data file includes:

[0044] In each set of the preliminary clustering results, traverse the second feature of each of the power grid data files, and respectively calculate the feature distance between every two of the power grid data files;

[0045] Initialize and generate feature center values;

[0046] Randomly selecting the characteristic center value of the power grid data files as the characteristic center;

[0047] Put the remaining power grid data files into the set corresponding to each center according to the size relationship of the characteristic distance;

[0048] Calculate the feature average of each set respectively;

[0049] Taking the power grid data file closest to the characteristic average value as a new characteristic center;

[0050] Determine whether the new feature center is the same as the old feature center;

[0051] When it is determined that the new feature center is different from the old feature center, determining whether the current number of iterations is greater than or equal to a preset number threshold;

[0052] In the case where it is determined that the current number of iterations is greater than or equal to the number threshold, the number of centers is updated, and the step of randomly selecting the characteristic center value of the power grid data files as the characteristic center is returned;

[0053] In the case where it is determined that the number of iterations is less than the number threshold, returning to execute the step of placing the remaining power grid data files into the set corresponding to each center according to the magnitude relationship of the characteristic distances;

[0054] When it is determined that the new feature center is the same as the old feature center, the currently generated set is used as the secondary classification of the preliminary clustering result to obtain the result of the clustering operation.

[0055] Optionally, before index encoding the result of the clustering operation to obtain the power grid domain knowledge base, the method further includes:

[0056] A clustering algorithm is used to further perform distance analysis on each bottom-level category in the result of the current clustering operation according to the second feature to obtain a lower-level category.

[0057] On the other hand, the present invention further provides a system for constructing a power grid domain knowledge base based on a vector database, the system comprising a processor, and the processor is configured to execute any of the methods described above.

[0058] In yet another aspect, the present invention further provides a computer-readable storage medium storing instructions, wherein the instructions are used to be read by a machine so as to enable the machine to execute any of the above methods.

[0059] Through the above technical solution, the embodiment of the present invention provides a method and system for constructing a knowledge base in the field of power grid based on a vector database. The method and system extract the second feature of the distribution characteristics of keywords and similar word vectors from the power grid data file, and further divide the clustering results in combination with the second feature, thereby obtaining a more refined index classification result. Compared with the prior art, the method and system provided by the embodiment of the present invention further divides the distribution of keywords and similar word vectors, providing more searchable guidance for subsequent information retrieval, thereby improving the efficiency of subsequent search and call.

[0060] Other features and advantages of the embodiments of the present invention will be described in detail in the subsequent detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] The accompanying drawings are used to provide a further understanding of the embodiments of the present invention and constitute a part of the specification. Together with the following specific implementations, they are used to explain the embodiments of the present invention, but do not constitute a limitation on the embodiments of the present invention. In the accompanying drawings:

[0062] Figure 1 is a flowchart of a method for constructing a power grid domain knowledge base based on a vector database according to an embodiment of the present invention;

[0063] Figure 2 is a flow chart of a method for obtaining keywords in a power grid data file according to an embodiment of the present invention;

[0064] Figure 3 is an example diagram of a keyword directed graph according to an embodiment of the present invention;

[0065] Figure 4 is a flow chart of a method of clustering operation according to one embodiment of the present invention. DETAILED DESCRIPTION

[0066] The specific implementation of the embodiment of the present invention is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described here is only used to illustrate and explain the embodiment of the present invention, and is not used to limit the embodiment of the present invention.

[0067] It should be noted that the acquisition, transmission, storage, use, and processing of data in the technical solution of this application are in compliance with the relevant provisions of national laws and regulations. In the embodiments of this application, some existing solutions in the industry such as certain software, components, and models may be mentioned, which should be considered as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of this application, but it does not mean that the applicant has or will necessarily use the solution.

[0068] like Figure 1 FIG. 1 is a flow chart of a method for constructing a power grid domain knowledge base based on a vector database according to an embodiment of the present invention. Figure 1 In the method, the method may include the following steps:

[0069] In step S10, a power grid data file to be stored is obtained;

[0070] In step S11, keywords in the power grid data file are obtained;

[0071] In step S12, the keywords are vectorized using a preset vector database to obtain corresponding word vectors;

[0072] In step S13, similar word vectors of each word vector are determined according to a preset similarity distance;

[0073] In step S14, the power grid data file is worded;

[0074] In step S15, the power grid data file after the word processing is sequentially read;

[0075] In step S16, a hash operation is performed on the read word vector or similar word vector to obtain a corresponding mapping value;

[0076] In step S17, counting is performed in a preset counter array according to the mapping value;

[0077] In step S18, the counting result is used as the second feature of the power grid data file;

[0078] In step S19, clustering operation is performed on the power grid data file using the second feature and the keyword;

[0079] In step S20, the result of the clustering operation is indexed and encoded to obtain a power grid domain knowledge base.

[0080] In this Figure 1 In the method shown, step S11 can be used to obtain keywords in the power grid data file. The method for obtaining the keyword can be in various forms known to those skilled in the art. In one example of the present invention, the method for obtaining the keyword can include: Figure 2 In the steps shown in Figure 2 In the method for obtaining the keyword, the method may include the following steps:

[0081] In step S30, a keyword directed graph expressing keyword information of the power grid data file is constructed with each word or phrase in the power grid data file as a node and the association between words or phrases as an edge. An example graph of the keyword directed graph can be as follows: Figure 3 As shown. Figure 3 In , each edge represents the relationship between two words or phrases.

[0082] In step S31, the weight of each edge in the keyword directed graph is determined. Specifically, considering that the importance of each word or phrase can be determined by the frequency of occurrence in the text, the weight can also be determined using the following formulas (1) and (2):

[0083] f i =a1f1+a mid f mid +a end f end , (1)

[0084]

[0085] Among them, λ i is the weight of the ith edge, a1 is the homepage correction value, f1 is the frequency of the two words or phrases corresponding to the edge appearing simultaneously within the preset range of the homepage, a mid is the intermediate text correction value, f mid is the frequency of the two words or phrases corresponding to the edge appearing simultaneously in the preset range except the first and last pages, f end is the last page correction value, f end is the frequency of the two words or phrases corresponding to the edge appearing simultaneously within the preset range of the last page, and I is the number of edges.

[0086] In step S32, the importance of each word or phrase is calculated according to the weight;

[0087] In step S33, multiple words or phrases are selected from the keyword directed graph in descending order of importance to obtain keywords.

[0088] Step S14 can be used to perform word processing on the power grid data file. The specific method of word processing can be various forms known to those skilled in the art. In one example of the present invention, the word processing method can be to remove tables, pictures and short independent words or phrases in the document.

[0089] Step S13 may be used to determine similar word vectors of each word vector according to a preset similarity distance. Specifically, in this embodiment, the similar word vectors may be obtained by a cosine similarity method.

[0090] Step S18 can be used to use the counting result as the second feature of the power grid data file. Specifically, in this embodiment, step S18 can be to arrange the corresponding count values ​​according to the order of each array in the counter array to obtain a one-dimensional code, and then use the one-dimensional code as the second feature.

[0091] Step S19 may be used to perform a clustering operation on the power grid data file using the second feature and the keyword. The clustering operation may be in various forms known to those skilled in the art. In one example of the present invention, the clustering operation may be performed using Figure 4 In the steps shown in Figure 4 In the example, the clustering operation may include the following steps:

[0092] In step S40, the keyword groups of each power grid data file are traversed, and the distance between each two power grid data files is calculated respectively. The distance can be calculated by using the similarity of the keyword groups.

[0093] In step S41, the number of generated centers is initialized;

[0094] In step S42, a number of power grid data files are randomly selected as the center;

[0095] In step S43, the remaining power grid data files are placed into the set corresponding to each center according to the size relationship of the distance;

[0096] In step S44, the average value of each set is calculated respectively;

[0097] In step S45, the power grid data file closest to the average value is used as the new center;

[0098] In step S46, it is determined whether the new center is the same as the old center;

[0099] In step S47, when it is determined that the new center is different from the old center, it is determined whether the current number of iterations is greater than or equal to a preset number threshold;

[0100] In step S48, when it is determined that the current number of iterations is greater than or equal to the number threshold, the number of centers is updated, and the step of randomly selecting the number of power grid data files as the center is returned to, that is, the execution of step S is returned;

[0101] If it is determined that the number of iterations is less than the number threshold, return to the step of placing the remaining power grid data files into the set corresponding to each center according to the size relationship of the distances, that is, return to step S43;

[0102] In step S50, when it is determined that the new center is the same as the old center, the currently generated set is output as a preliminary clustering result.

[0103] In this embodiment, the preliminary clustering result is used to represent the classification results of multiple power grid data documents that are preliminarily classified according to the keyword group. In order to further refine the classification, taking into account the similarity of power grid data documents in the same category, the classification can be further divided by the second feature. Specifically, in this example, the clustering operation can also include the following: Figure 4 In the method shown in Figure 4 In the example, the clustering operation may include the following steps:

[0104] In step S60, in each set of preliminary clustering results, the second feature of each power grid data file is traversed, and the feature distance between every two power grid data files is calculated respectively;

[0105] In step S61, the feature center value is initialized and generated;

[0106] In step S62, randomly select a characteristic center value of power grid data files as characteristic centers;

[0107] In step S63, the remaining power grid data files are placed into the set corresponding to each center according to the size relationship of the characteristic distance;

[0108] In step S64, the feature average of each set is calculated respectively;

[0109] In step S65, the power grid data file closest to the characteristic average value is used as a new characteristic center;

[0110] In step S66, it is determined whether the new feature center is the same as the old feature center;

[0111] In step S67, when it is determined that the new feature center is different from the old feature center, it is determined whether the current number of iterations is greater than or equal to a preset number threshold;

[0112] In step S68, when it is determined that the current number of iterations is greater than or equal to the number threshold, the number of centers is updated, and the step of randomly selecting a characteristic center value of power grid data files as the characteristic center is returned to execute step S62;

[0113] If it is determined that the number of iterations is less than the number threshold, the process returns to the step of placing the remaining power grid data files into the set corresponding to each center according to the size relationship of the characteristic distances, that is, returns to step S63;

[0114] In step S69, when it is determined that the new feature center is the same as the old feature center, the currently generated set is used as the secondary classification of the preliminary clustering result to obtain the result of the clustering operation.

[0115] In addition, in this embodiment, since the encoding dimension of the second feature is relatively large, when more classification indexes need to be considered, the method can also be to use a clustering algorithm to further perform distance on each underlying category in the result of the current clustering operation according to the second feature before index encoding the result of the clustering operation to obtain the power grid domain knowledge base to obtain a lower-level category. The specific steps of the clustering algorithm can be the same as Figure 3 and Figure 4 The method shown in is similar, so it will not be repeated here.

[0116] On the other hand, the present invention further provides a system for constructing a power grid domain knowledge base based on a vector database, the system comprising a processor, and the processor is configured to execute any of the methods described above.

[0117] In yet another aspect, the present invention further provides a computer-readable storage medium storing instructions, wherein the instructions are used to be read by a machine so as to enable the machine to execute any of the above methods.

[0118] Through the above technical solution, the embodiment of the present invention provides a method and system for constructing a knowledge base in the field of power grid based on a vector database. The method and system extract the second feature of the distribution characteristics of keywords and similar word vectors from the power grid data file, and further divide the clustering results in combination with the second feature, thereby obtaining a more refined index classification result. Compared with the prior art, the method and system provided by the embodiment of the present invention further divides the distribution of keywords and similar word vectors, providing more searchable guidance for subsequent information retrieval, thereby improving the efficiency of subsequent search and call.

[0119] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0120] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0121] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0122] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0123] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0124] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0125] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0126] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0127] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.

Claims

1. A method for constructing a power grid domain knowledge base based on a vector database, characterized in that: The method comprises: Obtaining the power grid data file to be stored; Obtaining keywords in the power grid data file; Using a preset vector database to vectorize the keyword to obtain a corresponding word vector; Determining a similar word vector of each of the word vectors according to a preset similarity distance; Tokenizing the power grid data file; Sequentially reading the power grid data file after the word processing; Performing a hash operation on the word vector or similar word vector read to obtain a corresponding mapping value; Counting in a preset counter array according to the mapping value; Using the counting result as the second feature of the power grid data file; performing a clustering operation on the power grid data file using the second feature and the keyword; The result of the clustering operation is indexed and encoded to obtain the power grid domain knowledge base.

2. The method according to claim 1, characterized in that Obtaining keywords in the power grid data file includes: Taking each word or phrase in the power grid data file as a node and the association relationship between words or phrases as an edge, constructing a keyword directed graph expressing the keyword information of the power grid data file; Determining the weight of each edge in the keyword directed graph; Calculate the importance of each word or phrase according to the weight; A plurality of the words or phrases are selected from the keyword directed graph in descending order of importance to obtain the keyword.

3. The method according to claim 2, characterized in that Determining the weight of each edge in the keyword directed graph includes: The weight is calculated according to formula (1) and formula (2): f i =a1f1+a mid f mid +a end f emd , (1) Among them, λ i is the weight of the ith edge, a1 is the homepage correction value, f1 is the frequency of the two words or phrases corresponding to the edge appearing simultaneously within the preset range of the homepage, a mid is the intermediate text correction value, f mid The frequency of two words or phrases corresponding to the edge appearing at the same time in the preset range except the first and last pages, a end is the last page correction value, f end is the frequency of the two words or phrases corresponding to the edge appearing simultaneously within the preset range of the last page, and I is the number of edges.

4. The method according to claim 1, characterized in that: Determining a similar word vector of each of the word vectors according to a preset similarity distance includes: The cosine similarity method is used to determine the similar word vectors.

5. The method according to claim 1, characterized in that The counting result is used as the second feature of the power grid data file, including: Arranging the corresponding count values ​​according to the order of each array in the counter array to obtain a one-dimensional code; The one-dimensional code is used as the second feature.

6. The method according to claim 5, characterized in that The step of clustering the power grid data file using the second feature and the keyword includes: Traversing the keyword groups of each of the power grid data files, and respectively calculating the distance between each two of the power grid data files; Initialize the number of generated centers; randomly selecting a number of said power grid data files of said center as a center; Put the remaining power grid data files into the set corresponding to each center according to the size relationship of the distance; Calculate the mean of each set separately; Taking the power grid data file closest to the average value as a new center; Determine whether the new center is the same as the old center; When it is determined that the new center is different from the old center, determining whether the current number of iterations is greater than or equal to a preset number threshold; If it is determined that the current number of iterations is greater than or equal to the number threshold, the number of centers is updated, and the step of randomly selecting the number of power grid data files as centers is returned; When it is determined that the number of iterations is less than the number threshold, returning to the step of placing the remaining power grid data files into the set corresponding to each center according to the size relationship of the distances; When it is determined that the new center is the same as the old center, the currently generated set is output as the preliminary clustering result.

7. The method according to claim 6, characterized in that The step of clustering the power grid data file using the second feature and the keyword includes: In each set of the preliminary clustering results, traverse the second feature of each of the power grid data files, and respectively calculate the feature distance between every two of the power grid data files; Initialize and generate feature center values; Randomly selecting the characteristic center value of the power grid data files as the characteristic center; Put the remaining power grid data files into the set corresponding to each center according to the size relationship of the characteristic distance; Calculate the feature average of each set respectively; Taking the power grid data file closest to the characteristic average value as a new characteristic center; Determine whether the new feature center is the same as the old feature center; When it is determined that the new feature center is different from the old feature center, determining whether the current number of iterations is greater than or equal to a preset number threshold; In the case where it is determined that the current number of iterations is greater than or equal to the number threshold, the number of centers is updated, and the step of randomly selecting the characteristic center value of the power grid data files as the characteristic center is returned; When it is determined that the number of iterations is less than the number threshold, returning to the step of placing the remaining power grid data files into the set corresponding to each center according to the magnitude relationship of the characteristic distances; When it is determined that the new feature center is the same as the old feature center, the currently generated set is used as the secondary classification of the preliminary clustering result to obtain the result of the clustering operation.

8. The method according to claim 1, characterized in that Before index encoding the result of the clustering operation to obtain the power grid domain knowledge base, the method further includes: A clustering algorithm is used to further perform distance analysis on each bottom-level category in the result of the current clustering operation according to the second feature to obtain a lower-level category.

9. A system for constructing a power grid domain knowledge base based on a vector database, characterized in that: The system comprises a processor configured to execute the method according to any one of claims 1 to 8.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and the instructions are used to be read by a machine so as to enable the machine to execute the method according to any one of claims 1 to 8.

Citation Information

Cited By

  • Power document topological association method and device, electronic equipment and storage medium

    CN121561840A

  • Power grid professional knowledge graph construction method for green supply chain platform

    CN121766416A