Knowledge graph construction method and device and nonvolatile storage medium
By obtaining, dividing and correlating text data of oil field underground operations, the knowledge graph of oil field underground operations is generated, which solves the problem of inefficiency caused by manual collation in the existing technology, and realizes the efficient generation of knowledge graphs.
Patent Information
- Application Number
- CN202311280895.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-28
- Publication Date
- 2025-04-04
AI Technical Summary
In the prior art, the knowledge graph of underground operations of oil wells is manually sorted out data, resulting in low efficiency in generating knowledge graphs and cannot meet the needs of releasing the value of data knowledge.
By obtaining the underground operation target text data of the oil field well site, dividing it into multiple target words, determining the correlation between the target words, and generating the underground operation knowledge graph of the oil field well site.
The purpose of automatically sorting the data required to build a knowledge graph is realized, the efficiency of generating knowledge graphs is improved, and the problem of inefficiency caused by manual sorting is solved.
Smart Images

Figure CN119761468A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing, and in particular, to a method and device for constructing a knowledge graph and a non-volatile storage medium. Background Art
[0002] As an important daily measure for oilfield production and operation, oil well downhole operation and maintenance are related to the formulation and modification of production plans and emergency plans, which in turn affect the production and maintenance costs of oilfields. At present, most oilfields have achieved unified management of downhole operation data by building professional database storage and document service management. In the application of downhole operation work, a wealth of record text data such as measure design, operation construction, completion summary, and cost settlement have been accumulated, and there are complete data structured management and maintenance plans and rules. There is a lot of business information and knowledge content that should be mined and worth mining in the accumulated data, and there are also hidden knowledge contexts between various processes.
[0003] However, due to the high level of business specialization and the storage of some specific fields in unstructured text state, the current production management system does not have the corresponding intelligent analysis capabilities and modules. The establishment of the knowledge graph about oil well downhole operations is limited to manual operations, which makes it difficult to carry out deep data mining. Unleashing the value of data knowledge is an urgent need, and the current system cannot meet this need.
[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0005] The embodiments of the present invention provide a method, device and non-volatile storage medium for constructing a knowledge graph, so as to at least solve the technical problem in the related art that the knowledge graph is generated inefficiently due to manual data organization.
[0006] According to one aspect of an embodiment of the present invention, a method for constructing a knowledge graph is provided, including: obtaining target text data of downhole operations in an oilfield well site; dividing the target text data into multiple target words; determining the association relationship between the multiple target words; and generating a knowledge graph of downhole operations in the oilfield well site based on the multiple target words and the association relationship between the multiple target words.
[0007] Optionally, determining the association relationship between multiple target words includes: determining the first feature vector of each of the multiple target words; classifying the multiple target words according to a preset classification rule and the first feature vector of each of the multiple target words to obtain multiple types and words included in each of the multiple types; and determining the association relationship between the words included in each of the multiple types.
[0008] Optionally, determining the association relationship between words included in each of the multiple types includes: determining a second feature vector of the words included in each of the multiple types; determining the similarity between the words included in each of the multiple types based on the second feature vector; and determining the association relationship between the words included in each of the multiple types based on the similarity between the words included in each of the multiple types.
[0009] Optionally, determining the association relationship between words included in each of the multiple types includes: inputting the words included in each of the multiple types into a latent Dirichlet distribution model, and outputting the association relationship between the words included in each of the multiple types from the latent Dirichlet distribution model, wherein the latent Dirichlet distribution model is a model obtained by unsupervised training using multiple sample words, and the multiple sample words are related to the oil field well site.
[0010] Optionally, obtaining target text data for downhole operations at an oilfield well site includes: obtaining initial data related to the oilfield well site, wherein the initial data includes initial text data and initial non-text data; extracting text information from the initial non-text data to obtain text information data; and determining target text data based on the initial text data and the text information data.
[0011] Optionally, the target text data is divided into multiple target words, including: converting the target text data into a preset text format to obtain first text data; dividing the first text data into multiple initial words; among the multiple initial words, removing words that match words included in a preset vocabulary to obtain multiple target words, wherein the preset vocabulary includes stop words.
[0012] Optionally, a knowledge graph is generated based on the association relationship between multiple words, including: generating multiple target nodes based on the multiple words; generating multiple target edges based on the association relationship between the multiple words, wherein the multiple target edges are used to represent the connection relationship between the multiple target nodes; generating a knowledge graph based on the multiple target nodes and the multiple target edges.
[0013] According to another aspect of an embodiment of the present invention, a device for constructing a knowledge graph is also provided, including: an acquisition module for acquiring target text data of downhole operations in an oilfield well site; a division module for dividing the target text data into multiple target words; a determination module for determining the association relationship between multiple target words; and a generation module for generating a knowledge graph of downhole operations in an oilfield well site based on multiple target words and the association relationship between multiple target words.
[0014] According to another aspect of an embodiment of the present invention, a non-volatile storage medium is provided, the non-volatile storage medium including a stored program, wherein when the program is running, the device where the non-volatile storage medium is located is controlled to execute any one of the above-mentioned knowledge graph construction methods.
[0015] According to another aspect of an embodiment of the present invention, a computer device is provided, comprising a processor for running a program, wherein the program executes any one of the above-mentioned knowledge graph construction methods when the program is running.
[0016] In an embodiment of the present invention, a method for constructing a knowledge graph is adopted, by obtaining target text data of downhole operations in an oilfield well site; dividing the target text data into multiple target words; determining the association relationship between the multiple target words; and generating a knowledge graph of downhole operations in an oilfield well site based on the multiple target words and the association relationship between the multiple target words, thereby achieving the purpose of automatically organizing the data required for constructing the knowledge graph, thereby realizing the technical effect of improving the efficiency of knowledge graph generation, and further solving the technical problem in the related art that the efficiency of knowledge graph generation is low due to manual organization of data. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0018] Figure 1 A hardware structure block diagram of a computer terminal for implementing a method for constructing a knowledge graph is shown;
[0019] Figure 2 It is a flowchart of a method for constructing a knowledge graph according to an embodiment of the present invention;
[0020] Figure 3 It is a structural block diagram of a method for constructing a knowledge graph provided according to an embodiment of the present invention. DETAILED DESCRIPTION
[0021] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only 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 should fall within the scope of protection of the present invention.
[0022] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0023] According to an embodiment of the present invention, an embodiment of a method for constructing a knowledge graph is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in an order different from that shown here.
[0024] The method embodiment provided in the first embodiment of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 FIG. 1 shows a hardware structure block diagram of a computer terminal for implementing a method for constructing a knowledge graph. Figure 1 As shown, the computer terminal 10 may include one or more (102a, 102b, ..., 102n are used to illustrate) processors (the processor may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.
[0025] It should be noted that the one or more processors and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer terminal 10. As described in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).
[0026] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the method for constructing the knowledge graph in the embodiment of the present invention. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, the method for constructing the knowledge graph of the above-mentioned application is realized. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0027] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 .
[0028] As an important daily measure for oilfield production and operation, downhole operation and maintenance of oil wells are related to the formulation and modification of production plans and emergency plans, which in turn affects the production and maintenance costs of oil fields. At present, most oil fields have achieved unified management of downhole operation data by building professional database storage and document service management, but the current production management system does not have corresponding intelligent analysis capabilities and modules. The establishment of knowledge graphs related to downhole operations of oil wells is limited to manual operations, which makes it difficult to carry out deep data mining. However, releasing the value of data knowledge is an urgent need, and the current system cannot meet this need. In response to the problems in the prior art, the present invention provides a method for constructing a knowledge graph. Figure 2 is a flow chart of a method for constructing a knowledge graph according to an embodiment of the present invention. Figure 2 As shown, the method comprises the following steps:
[0029] Step S202, obtaining target text data of downhole operations at an oil field well site.
[0030] In this step, the text data of downhole operations in the oil field well site is obtained, wherein downhole operations are technical means to ensure the normal production of oil and water wells during oil field exploration and development, which can include many aspects, such as measure design, operation construction, completion summary, etc. The target text data can be the text data recorded by the staff in the previous downhole operations, which will be helpful for the future downhole operations.
[0031] Step S204, dividing the target text data into a plurality of target words.
[0032] In this step, the target text data is divided into multiple target words in a segmentation manner. The target text data can be segmented using a statistical segmentation method and a string matching segmentation method. The statistical segmentation method mainly defines the mutual information between two words, calculates their frequency of occurrence, and reflects the closeness between words through the frequency calculation, so as to determine whether they belong to a word; the string matching segmentation method is also called a mechanical segmentation method, which matches the string to be analyzed with the entries in a "sufficiently large" machine dictionary according to a certain strategy. If a string is found in the dictionary, the match is successful, that is, a word is identified. Dividing the target text data into words can prepare for the subsequent generation of knowledge graphs.
[0033] Step S206, determining the association relationship between the multiple target words.
[0034] In this step, the association relationship between multiple target words is determined, and the degree of association between different target words will affect the generation of the final knowledge graph. The degree of association can be obtained by semantic relationship learning, or unsupervised learning can be used for semantic clustering to obtain the degree of association between words. Knowledge graph generation requires finding words associated with each word. Specifically, the distributed word vector obtained by semantic relationship learning can be used as input to calculate the similarity between words, that is, the degree of association between words. The above method is used to calculate the degree of association, compared with manual data mining and the arrangement of word associations based on manual experience, which achieves the technical effect of improving work efficiency and higher accuracy.
[0035] Step S208, generating a knowledge graph of downhole operations in an oil field well site according to the multiple target words and the association relationships between the multiple target words.
[0036] In this step, a knowledge graph related to the oilfield well site can be generated based on multiple target words and the associations between the multiple target words. Specifically, a suitable knowledge graph model can be selected, and multiple target words and the associations between the multiple target words can be substituted to generate a knowledge graph. The knowledge graph can better display the data involved in the downhole operations of the oilfield well site and the associations between the data, which is convenient for staff to query and manage knowledge.
[0037] Through the above steps, the purpose of automatically organizing the data required for constructing the knowledge graph is achieved, thereby realizing the technical effect of improving the generation efficiency of the knowledge graph, and further solving the technical problem in related technologies that the efficiency of generating the knowledge graph is low due to manual organization of data.
[0038] As an optional embodiment, determining the association relationship between multiple target words includes: determining the first feature vector of each of the multiple target words; classifying the multiple target words according to preset classification rules and the first feature vector of each of the multiple target words to obtain multiple types and words included in each of the multiple types; determining the association relationship between the words included in each of the multiple types.
[0039] Optionally, to determine the association relationship between multiple target words, the first feature vectors of each of the multiple target words can be determined first, and then the target words are classified into different types according to the preset allocation rules and the first feature vectors, and then under different types, the association relationship between the words included in each of the multiple types is determined. Because there are many technical fields involved in the downhole operations of the oil field well site, generating corresponding knowledge graphs according to different technical fields can help the staff better understand the relevant data in different fields of downhole operations.
[0040] The first feature vectors of multiple target words can be determined first, wherein the feature vectors are used to classify words. The category to which the target words belong can be determined according to the preset classification rules and the first feature vectors of the multiple target words. Specifically, a portion of sample words belonging to different technical fields can be selected as a training set, and then a suitable model can be selected for training. For example, algorithms such as naive Bayes, support vector machines, and deep learning models can be used. In the process of using the training set to train the selected model, the feature vectors of the sample words and the corresponding classification labels can be input as training data to generate a corresponding classification model, and then the multiple target words can be divided into different types according to the generated classification model, and under different types, the association relationship between the words included in each of the different types is determined.
[0041] As an optional embodiment, determining the association relationship between words included in each of the multiple types includes: determining a second feature vector of the words included in each of the multiple types; determining the similarity between the words included in each of the multiple types based on the second feature vector; and determining the association relationship between the words included in each of the multiple types based on the similarity between the words included in each of the multiple types.
[0042] Optionally, to determine the association relationship between the words included in each of the multiple types, the second feature vectors of the words included in each of the multiple types can be determined first, and then the similarity between the multiple words can be determined based on the second feature vectors, and the degree of association can be determined based on the similarity. Specifically, the semantic learning process can be used to first obtain the second feature vectors of the words included in each of the multiple types, and the feature vectors can be generated by the word embedding model. The word embedding model is trained on a large-scale corpus. After the training, each word will get a feature vector, and then the spatial "distance" calculation method of the feature vector is used to calculate the semantic similarity between the words. The similarity is the degree of association between the two words. On this basis, for any word, a certain number of word pairs with a large degree of association with it are selected as associated words to form the knowledge graph of the word. Taking "underground operation" as an example, the words selected that are associated with it are: "process design" with a degree of association of 1.577, "petroleum" with a degree of association of 1.567, "production daily" with a degree of association of 1.552, "maintenance" with a degree of association of 1.501, and "Xinjiang" with a degree of association of 1.499. Semantic relationship learning refers to the task of learning and understanding the semantic relationship between entities from text or data, usually involving the relationship between two entities. These relationships can be the connection between concepts, attributes or events in any field. In semantic relationship learning, commonly used methods include: supervised learning methods, which can use labeled sample data to learn the feature expression and classifier of entity relationships by building classifiers or neural network models. Unsupervised learning methods can use unlabeled data to discover potential semantic relationships through methods such as clustering and topic modeling.
[0043] As an optional embodiment, determining the association relationship between words included in each of the multiple types includes: inputting the words included in each of the multiple types into a latent Dirichlet distribution model, and outputting the association relationship between the words included in each of the multiple types from the latent Dirichlet distribution model, wherein the latent Dirichlet distribution model is a model obtained by unsupervised training using multiple sample words, and the multiple sample words are related to the oil field well site.
[0044] Optionally, unsupervised learning can be used to determine the association relationship between the words included in each of the multiple types. Among them, a latent Dirichlet distribution model can be used, and the words included in each of the multiple types can be input into the model to obtain the association relationship between the words included in each of the multiple types. The latent Dirichlet distribution model is an unsupervised learning algorithm. Its basic idea is to assume that each document consists of multiple topics, and each topic consists of multiple words. Through the method of statistical learning, the latent Dirichlet distribution model can infer the topic distribution in multiple words and the distribution and association relationship of words under each topic based on given text data. Specifically, the latent Dirichlet distribution model regards text data as the result of a generation process. In this generation process, a part of sample words can be selected first, and then topics are randomly assigned, and words are randomly selected according to the topic distribution. Through iterative training, the latent Dirichlet distribution model will update the topic distribution of the document and the distribution of words under the topic, so that the generated association relationship is more accurate, and then multiple target words are input into the latent Dirichlet distribution model to obtain the association relationship between multiple target words under different categories. The use of unsupervised learning eliminates the process of manually labeling multiple target words, which saves time and improves the efficiency of knowledge graph generation.
[0045] As an optional embodiment, obtaining target text data for downhole operations at an oilfield well site includes: obtaining initial data related to the oilfield well site, wherein the initial data includes initial text data and initial non-text data; extracting text information from the initial non-text data to obtain text information data; and determining target text data based on the initial text data and the text information data.
[0046] Optionally, to obtain data related to an oilfield well site, initial data may be obtained first, and the initial data may include initial text data and initial non-text data. By extracting text information from the initial non-text data, text information data may be obtained, and then target text data may be obtained based on the initial text data and text information data. Among them, non-text data may be audio, pictures, etc. The text on the picture or the audio may be converted into text, extracted as text information data, and then the initial text data and text information data may be integrated together to obtain the target text data. Specifically, a text detection algorithm may be used to locate the text area on the picture, and then optical character recognition technology may be used to convert the text on the picture into readable text. Converting non-text data into text data makes the content in the subsequently generated knowledge graph more comprehensive.
[0047] As an optional embodiment, the target text data is divided into multiple target words, including: converting the target text data into a preset text format to obtain first text data; dividing the first text data into multiple initial words; among the multiple initial words, removing words that match words included in a preset vocabulary to obtain multiple target words, wherein the preset vocabulary includes stop words.
[0048] Optionally, the target text data can be divided into a plurality of target words by first converting the target text data into a preset text format, and then dividing the converted text data into a plurality of initial words. The initial words are filtered using a preset word library to obtain the target words. Among them, it is first necessary to convert the source data of different formats into a uniform plain text format that can be recognized by word segmentation. The converted data includes database tables and file format data of different formats. The process includes two steps of format parsing and type conversion. The format in the text data is first parsed, and then the different formats are converted into a plain text format that can be used for word segmentation according to a preset method. Then, the text data after the format adjustment is word segmented. The word segmentation of the underground operation data can be realized by combining a statistical word segmentation method and a string matching word segmentation method. Then, the initial words are filtered by filtering the word library to obtain the target words. The word library can include stop words, invalid high-frequency words and invalid low-frequency words. Invalid high-frequency words refer to words that are meaningless and appear too frequently, and invalid low-frequency words refer to words that appear very rarely and have no contribution to the topic clustering. In this way, the words obtained are all meaningful, avoiding useless words from affecting subsequent operations.
[0049] As an optional embodiment, a knowledge graph is generated based on the association relationship between multiple words, including: generating multiple target nodes based on the multiple words; generating multiple target edges based on the association relationship between the multiple words, wherein the multiple target edges are used to represent the connection relationship between the multiple target nodes; generating a knowledge graph based on the multiple target nodes and the multiple target edges.
[0050] Optionally, to generate a knowledge graph based on the association between multiple words, nodes in the knowledge graph may be first determined based on multiple target words, and then edges in the knowledge graph may be determined based on the association between multiple words, and then the knowledge graph may be generated based on the nodes and edges. Specifically, the knowledge graph includes entities and relationships, where nodes represent entities and edges represent relationships between entities.
[0051] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.
[0052] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method for constructing the knowledge graph according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product is stored in a storage medium (such as ROM / RAM, disk, CD), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present invention.
[0053] According to an embodiment of the present invention, a knowledge graph construction device for implementing the above-mentioned knowledge graph construction method is also provided. Figure 3 It is a structural block diagram of a knowledge graph construction device provided according to an embodiment of the present invention. As shown in the figure, the knowledge graph construction device includes: an acquisition module 32, a division module 34, a determination module 36 and a generation module 38. The knowledge graph construction device is described below.
[0054] The acquisition module 32 is used to acquire target text data of downhole operations in an oil field well site.
[0055] The division module 34 is connected to the acquisition module 32 and is used to divide the target text data into a plurality of target words.
[0056] The determination module 36 is connected to the division module 34 and is used to determine the association relationship between multiple target words.
[0057] The generating module 38 is connected to the determining module 36 and is used to generate a knowledge graph of downhole operations of an oil field well site according to a plurality of target words and associations between the plurality of target words.
[0058] It should be noted that the acquisition module 32, the division module 34, the determination module 36 and the generation module 38 correspond to steps S202 to S208 in the embodiment, and the examples and application scenarios implemented by the multiple modules and the corresponding steps are the same, but are not limited to the contents disclosed in the above embodiment. It should be noted that the above modules, as part of the device, can be run in the computer terminal 10 provided in the embodiment.
[0059] An embodiment of the present invention may provide a computer device. Optionally, in this embodiment, the computer device may be located in at least one network device among multiple network devices of a computer network. The computer device includes a memory and a processor.
[0060] Among them, the memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the method and device for constructing the knowledge graph in the embodiment of the present invention. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, realizing the above-mentioned method for constructing the knowledge graph. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the computer terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0061] The processor can call the information and application programs stored in the memory through the transmission device to execute the following steps: obtain the target text data of the downhole operations of the oil field well site; divide the target text data into multiple target words; determine the association relationship between the multiple target words; and generate a knowledge graph of the downhole operations of the oil field well site based on the multiple target words and the association relationship between the multiple target words.
[0062] Optionally, the processor may also execute the program code of the following steps: determining the association relationship between multiple target words, including: determining the first feature vector of each of the multiple target words; classifying the multiple target words according to preset classification rules and the first feature vector of each of the multiple target words to obtain multiple types and words included in each of the multiple types; determining the association relationship between the words included in each of the multiple types.
[0063] Optionally, the processor may also execute the program code of the following steps: determining the association relationship between words included in each of the multiple types, including: determining a second feature vector of the words included in each of the multiple types; determining the similarity between the words included in each of the multiple types based on the second feature vector; determining the association relationship between the words included in each of the multiple types based on the similarity between the words included in each of the multiple types.
[0064] Optionally, the processor may also execute the program code of the following steps: determining the association relationship between words included in each of the multiple types, including: inputting the words included in each of the multiple types into a latent Dirichlet distribution model, and outputting the association relationship between the words included in each of the multiple types from the latent Dirichlet distribution model, wherein the latent Dirichlet distribution model is a model obtained by unsupervised training using multiple sample words, and the multiple sample words are related to the oil field well site.
[0065] Optionally, the processor may also execute program code for the following steps: obtaining target text data for downhole operations at an oilfield well site, including: obtaining initial data related to the oilfield well site, wherein the initial data includes initial text data and initial non-text data; extracting text information from the initial non-text data to obtain text information data; and determining target text data based on the initial text data and the text information data.
[0066] Optionally, the processor may also execute program code for the following steps: dividing the target text data into multiple target words, including: converting the target text data into a preset text format to obtain first text data; dividing the first text data into multiple initial words; and removing, from the multiple initial words, words that match words included in a preset vocabulary to obtain multiple target words, wherein the preset vocabulary includes stop words.
[0067] Optionally, the processor may also execute program code for the following steps: generating a knowledge graph based on the association relationship between multiple words, including: generating multiple target nodes based on multiple words; generating multiple target edges based on the association relationship between multiple words, wherein the multiple target edges are used to represent the connection relationship between multiple target nodes; generating a knowledge graph based on multiple target nodes and multiple target edges.
[0068] By adopting the embodiment of the present invention, a method for constructing a knowledge graph is provided. By acquiring the target text data of the downhole operation of the oil field well site; dividing the target text data into multiple target words; determining the association relationship between the multiple target words; and generating the knowledge graph of the downhole operation of the oil field well site according to the multiple target words and the association relationship between the multiple target words, the purpose of automatically arranging the data required for constructing the knowledge graph is achieved, thereby achieving the technical effect of improving the generation efficiency of the knowledge graph, and further solving the technical problem in the related technology that the knowledge graph is generated by manually arranging the data, which leads to low efficiency.
[0069] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a non-volatile storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0070] The embodiment of the present invention further provides a non-volatile storage medium. Optionally, in this embodiment, the non-volatile storage medium can be used to store the program code executed by the method for constructing the knowledge graph provided in the above embodiment.
[0071] Optionally, in this embodiment, the non-volatile storage medium may be located in any computer terminal in a computer terminal group in a computer network, or in any mobile terminal in a mobile terminal group.
[0072] Optionally, in this embodiment, the non-volatile storage medium is configured to store program codes for executing the following steps: obtaining target text data of downhole operations in an oilfield well site; dividing the target text data into multiple target words; determining the association relationship between the multiple target words; and generating a knowledge graph of downhole operations in an oilfield well site based on the multiple target words and the association relationship between the multiple target words.
[0073] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for executing the following steps: determining the association relationship between multiple target words, including: determining the first feature vector of each of the multiple target words; classifying the multiple target words according to preset classification rules and the first feature vector of each of the multiple target words to obtain multiple types and words included in each of the multiple types; determining the association relationship between the words included in each of the multiple types.
[0074] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for executing the following steps: determining the association relationship between words included in each of the multiple types, including: determining a second feature vector of the words included in each of the multiple types; determining the similarity between the words included in each of the multiple types based on the second feature vector; determining the association relationship between the words included in each of the multiple types based on the similarity between the words included in each of the multiple types.
[0075] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for executing the following steps: determining the association relationship between words included in each of the multiple types, including: inputting the words included in each of the multiple types into a latent Dirichlet distribution model, and outputting the association relationship between the words included in each of the multiple types from the latent Dirichlet distribution model, wherein the latent Dirichlet distribution model is a model obtained by unsupervised training using multiple sample words, and the multiple sample words are related to the oil field well site.
[0076] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for executing the following steps: obtaining target text data for downhole operations in an oil field well site, including: obtaining initial data related to the oil field well site, wherein the initial data includes initial text data and initial non-text data; extracting text information from the initial non-text data to obtain text information data; and determining target text data based on the initial text data and the text information data.
[0077] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for executing the following steps: dividing the target text data into multiple target words, including: converting the target text data into a preset text format to obtain first text data; dividing the first text data into multiple initial words; among the multiple initial words, removing words that match words included in a preset vocabulary to obtain multiple target words, wherein the preset vocabulary includes stop words.
[0078] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: generating a knowledge graph based on the association relationship between multiple words, including: generating multiple target nodes based on the multiple words; generating multiple target edges based on the association relationship between the multiple words, wherein the multiple target edges are used to represent the connection relationship between the multiple target nodes; generating a knowledge graph based on the multiple target nodes and the multiple target edges.
[0079] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0080] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0081] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0082] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0083] 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.
[0084] 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 non-volatile storage medium. Based on this understanding, the technical solution of the present invention, 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. The computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server or 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-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
[0085] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for constructing a knowledge graph, characterized in that: include: Obtain target text data of downhole operations at an oil field well site; Dividing the target text data into a plurality of target words; Determine the association relationship between the multiple target words; A knowledge graph of downhole operations of the oil field well site is generated according to the multiple target words and the association relationships between the multiple target words.
2. The method according to claim 1, characterized in that Determining the association relationship between the multiple target words includes: Determine a first feature vector of each of the plurality of target words; According to a preset classification rule and the first feature vectors of each of the plurality of target words, the plurality of target words are classified to obtain a plurality of types and words included in each of the plurality of types; Determine the association relationship between the words included in each of the multiple types.
3. The method according to claim 2, characterized in that Determining the association relationship between the words included in each of the multiple types includes: Determine a second feature vector of the words included in each of the plurality of categories; Determining, based on the second feature vector, similarities between words included in each of the plurality of types; According to the similarities between the words included in each of the multiple types, the association relationship between the words included in each of the multiple types is determined.
4. The method according to claim 2, characterized in that: Determining the association relationship between the words included in each of the multiple types includes: The words included in each of the multiple types are input into a latent Dirichlet distribution model, and the latent Dirichlet distribution model outputs the association relationship between the words included in each of the multiple types, wherein the latent Dirichlet distribution model is a model obtained by unsupervised training using multiple sample words, and the multiple sample words are related to the oil field well site.
5. The method according to claim 1, characterized in that The method of obtaining target text data of downhole operations of an oil field well site includes: Acquire initial data of downhole operations of the oil field well site, wherein the initial data includes initial text data and initial non-text data; Extracting text information from the initial non-text data to obtain text information data; The target text data is determined according to the initial text data and the text information data.
6. The method according to claim 1, characterized in that The step of dividing the target text data into a plurality of target words comprises: Converting the target text data into a preset text format to obtain first text data; Dividing the first text data into a plurality of initial words; Among the multiple initial words, words matching words included in a preset word library are removed to obtain the multiple target words, wherein the preset word library includes stop words.
7. The method according to any one of claims 1 to 6, characterized in that: The step of generating a knowledge graph of downhole operations of the oil field well site according to the association relationship between the multiple target words and the multiple target words includes: According to the plurality of words, generating a plurality of target nodes; Generate a plurality of target edges according to the association relationship between the plurality of words, wherein the plurality of target edges are used to represent the connection relationship between the plurality of target nodes; The knowledge graph is generated according to the multiple target nodes and the multiple target edges.
8. A device for constructing a knowledge graph, characterized in that: include: An acquisition module is used to acquire target text data of downhole operations at an oil field well site; A division module, used for dividing the target text data into a plurality of target words; A determination module, used to determine the association relationship between the multiple target words; A generation module is used to generate a knowledge graph of downhole operations in the oil field well site based on the multiple target orders and the association relationship between the multiple target words.
9. A non-volatile storage medium, characterized in that: The non-volatile storage medium includes a stored program, wherein when the program is running, the device where the non-volatile storage medium is located is controlled to execute the method for constructing a knowledge graph as described in any one of claims 1 to 7.
10. A computer device, characterized in that: include: Memory and processor, The memory stores a computer program; The processor is used to execute the computer program stored in the memory, and when the computer program is run, the processor executes the method for constructing the knowledge graph described in any one of claims 1 to 7.