Cloud resource construction question and answer method and device based on knowledge graph, equipment and medium
Through a knowledge graph-based method, a cloud resource question-and-answer model is constructed, which solves the problem that traditional cloud resource solution planning relies on expert experience, improves the response efficiency and accuracy, and enhances the user experience.
Patent Information
- Application Number
- CN202411761782.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-03
- Publication Date
- 2025-04-25
AI Technical Summary
Traditional cloud resource solution planning and responses rely on experienced cloud solution experts, resulting in inefficiency, long cycles, and susceptible to the limitations of experts' personal experience and knowledge, making it difficult to cope with rapidly changing technology environments and updated cloud products.
The cloud resource construction question-and-answer method is adopted based on the knowledge graph, and information extraction is extracted by obtaining professional cloud resource documents and materials, and the cloud resource question-and-answer model is constructed by combining the template information of historical Q&A records to achieve automated replies.
It improves the accuracy and efficiency of answering cloud resource questions, reduces dependence on experts, and enhances the overall service quality and user experience.
Smart Images

Figure CN119884294A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of cloud resource question and answer technology, and in particular to a cloud resource construction question and answer method based on a knowledge graph and a cloud resource construction question and answer device based on a knowledge graph. Background Art
[0002] With the rapid development of cloud computing technology, the demand for cloud services in various industries has become increasingly strong, and more and more companies are choosing to migrate their businesses to the cloud to improve efficiency and flexibility. However, the construction of a private cloud resource pool involves complex knowledge systems and technical details, covering multiple fields such as computing, storage, networking, and security. This makes it a very challenging task to obtain complete and accurate responses to cloud resource questions. Traditional solution planning and responses are highly dependent on experienced cloud solution experts for manual evaluation and design. These experts not only need to have a deep understanding of the customer's business needs, but also have a broad technical background and rich practical experience. This dependence leads to inefficient responses and planning processes, long cycles, and are easily affected by the personal experience and knowledge limitations of experts. In addition, in the face of a rapidly changing technical environment and constantly updated cloud products, even experienced experts find it difficult to always keep up with the latest expertise, further increasing the difficulty and uncertainty of cloud resource solutions. Therefore, how to improve the efficiency and accuracy of cloud resource solution responses and reduce dependence on experts has become an urgent problem to be solved. Summary of the invention
[0003] In view of the above problems, embodiments of the present invention are proposed to provide a cloud resource construction question and answer method based on a knowledge graph and a corresponding cloud resource construction question and answer device based on a knowledge graph that overcome the above problems or at least partially solve the above problems.
[0004] According to a first aspect of an embodiment of the present invention, a cloud resource construction question-answering method based on a knowledge graph is provided, the method comprising:
[0005] Obtain professional documentation on cloud resources;
[0006] By extracting information from the professional document materials of the cloud resources, triple information is obtained;
[0007] Construct a knowledge graph based on the triple information;
[0008] Get historical cloud resource Q&A records;
[0009] Determine the template information of the historical cloud resource question and answer record by performing regular expression recognition and entity relationship recognition on the historical cloud resource question and answer record;
[0010] A cloud resource question and answer model is constructed based on the template information of the historical cloud resource question and answer records and the knowledge graph.
[0011] Optionally, the extracting information from the professional document material of the cloud resource to obtain triple information includes:
[0012] Preprocessing the professional documents of the cloud resources;
[0013] Acquire the preprocessed professional document data of cloud resources, and extract information from the preprocessed professional document data of cloud resources; the information extraction includes entity recognition;
[0014] The triple information is obtained according to the information extraction result; the triple information includes: relationship triple information and attribute triple information.
[0015] Optionally, the constructing a cloud resource question and answer model according to the template information of the historical cloud resource question and answer record and the knowledge graph includes:
[0016] Determine the question template and answer template of the historical cloud resource question and answer record according to the recognition result of the historical cloud resource question and answer record;
[0017] A cloud resource question and answer model is constructed based on the question template of the historical cloud resource question and answer record, the answer template of the historical cloud resource question and answer record, and the knowledge graph.
[0018] Optionally, determining the question template of the historical cloud resource question and answer record according to the template information of the historical cloud resource question and answer record includes:
[0019] Obtaining a question set in the historical cloud resource question and answer record;
[0020] Performing regular expression recognition on the numbers in the question set, and replacing the numbers with placeholders according to the regular expression recognition results;
[0021] After replacing the numbers in the question set with placeholders, performing entity relationship recognition on the question set;
[0022] According to the entity relationship recognition result, all the question sets are replaced with placeholders; and the question template is determined according to the placeholders.
[0023] Optionally, determining the answer template of the historical cloud resource question and answer record according to the template information of the historical cloud resource question and answer record includes:
[0024] Obtaining a set of answers corresponding to the set of questions in the historical cloud resource question and answer record;
[0025] Performing regular expression recognition on the numbers in the answer set, and replacing the numbers with placeholders according to the regular expression recognition results;
[0026] After replacing the numbers in the answer set with placeholders, performing entity relationship recognition on the answer set;
[0027] According to the entity relationship recognition result, all the answer sets are replaced with placeholders;
[0028] The answer template is determined according to the placeholder.
[0029] Optionally, the method further includes:
[0030] Obtaining users’ cloud resources;
[0031] Inputting the cloud resource question into the cloud resource question-answering model;
[0032] The cloud resource question-answering model outputs an answer to the cloud resource question.
[0033] Optionally, outputting an answer to the cloud resource question through the cloud resource question-answering model includes:
[0034] Perform regular expression recognition on the cloud resource problem, and replace the number with a placeholder according to the regular expression recognition result;
[0035] After replacing the numbers in the cloud resource problem with placeholders, performing entity relationship recognition on the cloud resource problem;
[0036] According to the entity relationship recognition result, all the cloud resource issues are replaced with placeholders;
[0037] Searching, according to the placeholder, for a question template in the question template that is similar to the placeholder corresponding to the cloud resource question;
[0038] An answer to the cloud resource question is output according to the question template.
[0039] According to a second aspect of an embodiment of the present invention, a cloud resource construction question-answering device based on a knowledge graph is provided, the device comprising:
[0040] The first acquisition module is used to acquire professional documents of cloud resources;
[0041] A first extraction module is used to extract information from the professional document data of the cloud resources to obtain triple information;
[0042] A first construction module is used to construct a knowledge graph based on the triple information;
[0043] The second acquisition module is used to obtain historical cloud resource question and answer records;
[0044] A first determination module is used to determine the template information of the historical cloud resource question and answer record by performing regular expression recognition and entity relationship recognition on the historical cloud resource question and answer record;
[0045] The second construction module is used to construct a cloud resource question and answer model based on the template information of the historical cloud resource question and answer records and the knowledge graph.
[0046] Optionally, the first extraction module includes:
[0047] A first preprocessing submodule, used for preprocessing the professional document data of the cloud resources;
[0048] A first extraction submodule is used to obtain the preprocessed professional document material of cloud resources and extract information from the preprocessed professional document material of cloud resources; the information extraction includes entity recognition;
[0049] The first acquisition submodule is used to obtain the triple information according to the information extraction result; the triple information includes: relationship triple information and attribute triple information.
[0050] Optionally, the second building block includes:
[0051] A first determination submodule is used to determine the question template and the answer template of the historical cloud resource question and answer record according to the recognition result of the historical cloud resource question and answer record;
[0052] The first construction submodule is used to construct a cloud resource question and answer model based on the question template of the historical cloud resource question and answer record, the answer template of the historical cloud resource question and answer record and the knowledge graph.
[0053] Optionally, the first determining submodule includes:
[0054] A first acquisition unit, configured to acquire a question set in the historical cloud resource question and answer record;
[0055] A first replacement unit is used to perform regular expression recognition on the numbers in the question set, and replace the numbers with placeholders according to the regular expression recognition results;
[0056] A first recognition unit, configured to perform entity relationship recognition on the question set after replacing numbers in the question set with placeholders;
[0057] A second replacement unit, configured to replace all of the question set with placeholders according to the entity relationship recognition result;
[0058] The first determining unit is used to determine the question template according to the placeholder.
[0059] Optionally, the first determining submodule includes:
[0060] A second acquisition unit is used to acquire an answer set corresponding to the question set in the historical cloud resource question and answer record;
[0061] A third replacement unit is used to perform regular expression recognition on the numbers in the answer set, and replace the numbers with placeholders according to the regular expression recognition results;
[0062] A second recognition unit is used to perform entity relationship recognition on the answer set after replacing the numbers in the answer set with placeholders;
[0063] A fourth replacement unit, configured to replace all of the answer sets with placeholders according to the entity relationship recognition result;
[0064] The second determining unit is used to determine the answer template according to the placeholder.
[0065] Optionally, the device further comprises:
[0066] The second acquisition module is used to obtain the user's cloud resource problem;
[0067] A first input module, used to input the cloud resource question into the cloud resource question-answering model;
[0068] The first output module is used to output an answer to the cloud resource question through the cloud resource question-answering model.
[0069] Optionally, the first output module includes:
[0070] A first replacement submodule is used to perform regular expression recognition on the cloud resource problem, and replace the number with a placeholder according to the regular expression recognition result;
[0071] A first identification submodule, configured to perform entity relationship identification on the cloud resource question after replacing numbers in the cloud resource question with placeholders;
[0072] A second replacement submodule is used to replace all the cloud resource issues with placeholders according to the entity relationship recognition result;
[0073] A first search submodule is used to search, according to the placeholder, for a question template in the question template that is similar to the placeholder corresponding to the cloud resource question;
[0074] The first output submodule is used to output an answer to the cloud resource question according to the question template.
[0075] According to a third aspect of the present invention, there is provided an electronic device comprising: a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the steps of the cloud resource construction question and answer method based on the knowledge graph are implemented as described in any one of the above items.
[0076] According to a fourth aspect of the present invention, there is provided a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the cloud resource construction question-and-answer method based on the knowledge graph as described in any one of the above items.
[0077] The technical solution provided by the embodiments of the present invention may have the following beneficial effects:
[0078] The embodiment of the present invention provides a cloud resource construction question and answer method based on a knowledge graph, by obtaining cloud resource professional document materials; extracting information from the cloud resource professional document materials to obtain triple information; constructing a knowledge graph based on the triple information; obtaining historical cloud resource question and answer records; determining the template information of the historical cloud resource question and answer records by performing regular expression recognition and entity relationship recognition on the historical cloud resource question and answer records; and constructing a cloud resource question and answer model based on the template information of the historical cloud resource question and answer records and the knowledge graph. The embodiment of the present invention obtains triple information from cloud resource professional documents through information extraction, constructs a knowledge graph, and performs regular expression recognition and entity relationship recognition on historical question and answer records to obtain template information, and constructs a cloud resource question and answer model in combination with the template information and the knowledge graph to improve the accuracy of answers to cloud resource questions, while optimizing the processing efficiency of cloud resource consultation and enhancing the overall service quality and user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0079] Figure 1 It is a flowchart of the steps of a cloud resource construction question-answering method based on a knowledge graph provided by an embodiment of the present invention;
[0080] Figure 2 It is a flowchart of another cloud resource construction question-answering method based on knowledge graph provided by an embodiment of the present invention;
[0081] Figure 3 It is a structural block diagram of a cloud resource construction question and answer device based on a knowledge graph provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0082] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0083] One of the core concepts of the embodiment of the present invention is that the embodiment of the present invention obtains triple information from cloud resource professional documents through information extraction, constructs a knowledge graph, and performs regular recognition on historical question and answer records. The cloud resource question and answer model is constructed in combination with the recognition results and the knowledge graph to improve the accuracy of answering cloud resource questions, while optimizing the processing efficiency of cloud resource consultation and enhancing the overall service quality and user experience.
[0084] Reference Figure 1 , shows a flow chart of the steps of a cloud resource construction question-answering method based on a knowledge graph provided by an embodiment of the present invention, and the method may specifically include the following steps:
[0085] Step 101, obtaining professional documents of cloud resources;
[0086] Obtain professional documentation on cloud resources to gain a deeper understanding of the characteristics and usage of cloud resources, ensuring that users can use cloud resources efficiently and economically to meet their business needs. Cloud resources are diverse and complex to configure, and users often face many challenges when selecting and configuring them. By obtaining professional documentation on cloud resources, users can obtain detailed guidance and best practices to avoid resource waste and performance bottlenecks. Specifically, professional documentation on cloud resources includes product descriptions, user manuals, configuration guides, performance optimization recommendations, etc., covering the usage and configuration parameters of various types of resources such as computing, storage, networking, databases, and security. These documents not only provide technical details and operation steps, but also include actual cases and experience sharing. Using professional documentation on cloud resources as a data source helps users better understand and apply cloud resources.
[0087] Step 102, extracting information from the cloud resource professional document data to obtain triple information;
[0088] Cloud resources are of various types and complex configurations. Users often face many challenges when selecting and configuring them. Traditional document materials are usually unstructured texts, which are difficult to use directly for automated analysis and decision support. Information extraction technology can extract valuable information from unstructured document materials to form structured triple information. Triple information is usually expressed in the form of "entity-relationship-entity", which can clearly show the relationship and dependency between cloud resources. Information extraction technology integrates multiple information extraction functions such as entity recognition, relationship extraction and attribute extraction. Only a small number of labeled samples are needed to complete the fine-tuning of the information extraction model, realize entity recognition, relationship recognition, attribute recognition, etc. for the input documents, and identify the recognition results as relationship triples (entity, relationship, entity) and attribute triples (entity, attribute, value). Through information extraction, a large amount of document materials can be converted into a structured knowledge base, which is convenient for subsequent analysis and application.
[0089] Step 103, constructing a knowledge graph according to the triple information;
[0090] The knowledge graph graphically displays the relationships and dependencies between entities, helping users to understand and apply cloud resources more intuitively and efficiently. Specifically, it collects and organizes triple information extracted from professional documents on cloud resources, and identifies and classifies the entities in the triples. Entities can be types of cloud resources (such as virtual machines, storage, databases), configuration parameters (such as processors, memory, bandwidth), business scenarios (such as high concurrency, big data processing), etc. Through classification, entities can be better organized and managed, which facilitates the subsequent relationship construction.
[0091] Based on the triple information, the relationship between entities is constructed. Relationships can be usage, dependency, impact, etc. Through relationship construction, the association and dependency between different cloud resources can be clearly displayed, forming the skeleton of the knowledge graph. The constructed entities and relationships are visualized. The knowledge graph is usually presented in the form of a graph, with nodes representing entities and edges representing relationships. The constructed knowledge graph is stored in a graph database so that specific knowledge information can be obtained using the corresponding graph database query language. Through visualization tools, users can intuitively view and analyze the relationships and dependencies between cloud resources. Based on the constructed knowledge graph, knowledge reasoning and application are performed. Knowledge reasoning can discover hidden relationships and patterns through graph algorithms (such as shortest path and community discovery), helping users better understand and apply cloud resources. Knowledge application can provide users with personalized resource selection and configuration suggestions through intelligent search, recommendation systems, and other methods.
[0092] Step 104, obtaining historical cloud resource question and answer records;
[0093] The purpose of obtaining historical cloud resource Q&A records is to build an accurate and reliable cloud resource Q&A model to help users quickly solve various problems in the use of cloud resources. Cloud resources are of various types and complex configurations, and users often encounter various questions and challenges in actual operations. By analyzing historical cloud resource Q&A records, we can gain an in-depth understanding of common user questions and needs, providing rich data support for the Q&A model.
[0094] Step 105, determining the template information of the historical cloud resource question and answer record by performing regular expression recognition and entity relationship recognition on the historical cloud resource question and answer record;
[0095] Because traditional knowledge graph intelligent question answering models generally input related questions directly into the word embedding vector extraction algorithm when performing entity recognition, and the related word embedding extraction algorithm is not very reliable when processing text related to numbers. Therefore, in the case of a large number of numerical texts in the cloud computing resource pool construction scenario, before performing word embedding calculations, the corresponding numbers will be extracted through regular expression recognition and replaced with digital identifiers, and then the question will be subjected to word embedding calculations and entity recognition to improve reliability.
[0096] Step 106, constructing a cloud resource question and answer model based on the template information of the historical cloud resource question and answer records and the knowledge graph.
[0097] Based on the recognition results and knowledge graph, a cloud resource question-answering model is built. Using machine learning and natural language processing technologies, the data is deeply analyzed and modeled to generate an intelligent question-answering system. The question-answering model not only considers common user questions and solutions, but also covers cloud resource configuration parameters, performance optimization suggestions, etc. By selecting and configuring these recommended target cloud resources, users can ensure that their business systems are optimally supported in terms of high availability, scalability, and security.
[0098] In one embodiment, the method of extracting information from the professional document material of cloud resources to obtain triple information includes: preprocessing the professional document material of cloud resources; obtaining the professional document material of cloud resources after the preprocessing, and extracting information from the professional document material of cloud resources after the preprocessing; the information extraction includes entity recognition; obtaining the triple information according to the information extraction result; the triple information includes: relationship triple information and attribute triple information.
[0099] Preprocessing cloud resource professional documents and extracting information from them is to build an accurate and reliable knowledge graph to help users understand and apply cloud resources more intuitively and efficiently. Cloud resources are diverse and complex to configure, and users often face many challenges when selecting and configuring them. Traditional documents are usually unstructured texts that are difficult to use directly for automated analysis and decision support.
[0100] Specifically, the preprocessing steps include data cleaning, data conversion, data normalization, etc., which aim to eliminate noise and outliers in the data, fill in missing data, unify data formats, and ensure data consistency and integrity. Through preprocessing, the quality and availability of data can be improved, providing a more accurate and reliable data foundation for subsequent information extraction. After obtaining the preprocessed professional document materials of cloud resources, information extraction is performed, including entity recognition, relationship extraction, and attribute extraction. Entity recognition is to identify entities with specific meanings from text, such as the type of cloud resources (such as virtual machines, storage, databases), configuration parameters (such as processors, memory, bandwidth), business scenarios (such as high concurrency, big data processing), etc. Relation extraction is to identify the relationship between entities, such as "virtual machine-usage-processor" means that the virtual machine uses processor resources. Attribute extraction is to identify the attribute information of entities, such as the number of processor cores and memory size of the virtual machine. According to the information extraction results, triple information is obtained, including relationship triple information and attribute triple information. Relationship triple information represents the relationship between entities, such as "virtual machine-usage-processor"; attribute triple information represents the attributes of entities, such as "virtual machine-number of processor cores-4". These triple information can clearly show the relationship and dependency between cloud resources and form the skeleton of the knowledge graph.
[0101] By building a knowledge graph, users can more clearly understand the characteristics and applicable scenarios of different cloud resources and choose the resource type and configuration solution that best suits their needs. The knowledge graph not only provides rich information and relationship display, but also supports intelligent search and recommendation to help users quickly find the information and solutions they need.
[0102] In one embodiment, the constructing of a cloud resource question and answer model based on the template information of the historical cloud resource question and answer record and the knowledge graph includes: determining the question template and the answer template of the historical cloud resource question and answer record based on the recognition result of the historical cloud resource question and answer record; and constructing a cloud resource question and answer model based on the question template of the historical cloud resource question and answer record, the answer template of the historical cloud resource question and answer record and the knowledge graph.
[0103] Question templates and answer templates are structured representations of common problems and solutions extracted from the template history cloud resource question and answer records, and are stored in the question and answer template library. Question templates define the type and structure of questions, such as "how to configure the processor and memory of a virtual machine"; answer templates define the corresponding solutions and operation steps, such as "select appropriate virtual machine specifications and set processor and memory parameters". By determining question templates and answer templates to build a question and answer template database, the question and answer records can be standardized to facilitate subsequent model construction and application. Based on question templates, answer templates and knowledge graphs, a cloud resource question and answer model is constructed. Machine learning and natural language processing technologies are used to conduct in-depth analysis and modeling of data to generate an intelligent question and answer system. The question and answer model not only considers common user problems and solutions, but also covers cloud resource configuration parameters, performance optimization suggestions, etc. By selecting and configuring these recommended target cloud resources, users can ensure that their business systems are optimally supported in terms of high availability, scalability and security.
[0104] In one embodiment, determining the question template of the historical cloud resource question and answer record based on the template information of the historical cloud resource question and answer record includes: obtaining a question set in the historical cloud resource question and answer record; performing regular expression recognition on numbers in the question set, and replacing the numbers with placeholders based on the regular expression recognition results; after replacing the numbers in the question set with placeholders, performing entity relationship recognition on the question set; based on the entity relationship recognition results, replacing the entire question set with placeholders; and determining the question template based on the placeholders.
[0105] The question set is a collection of common questions extracted from historical cloud resource question and answer records. The specific content of these questions may contain various numbers, such as the number of processor cores, memory size, bandwidth, etc. In order to build a general question template, it is necessary to perform regular expression recognition on the numbers in the question set and replace them with placeholders. Regular expression recognition can automatically identify and extract numbers in questions to ensure the accuracy and consistency of replacement. After replacing the numbers in the question set with placeholders, entity relationship recognition is performed on the question set. Entity relationship recognition is to identify entities with specific meanings and their relationships from questions. Through entity relationship recognition, the relationships and dependencies between different cloud resources can be clearly displayed to form the skeleton of the question template. The same structure of questions is deduplicated, and the final historical question set contains all categories of question forms as much as possible. According to the entity relationship recognition results, the specific entities and relationships in the question set are replaced with placeholders to form a general question template. The question template defines the type and structure of the question. By determining the question template, the question and answer records can be standardized to facilitate subsequent model construction and application.
[0106] For example, the question is: "How many compute nodes are needed to provide 1000 core processors?" The answer is: "The required number is 4, chip processor: 2*Intel 6348 (28Cores, 2.60GHz)", and the corresponding template query result is "MATCH (h:computeServer) WHERE h.cpu_type = 'Intel 6348 (28Cores, 2.60GHz)' WITH 1000 / h.vcpu_per_host AS required_hosts RETURN required_hosts". For the above question, first perform a regular match on the question number and replace the number with a placeholder.<prop_num> , after conversion, it becomes "Build a<prop_num> <prop>How many units are needed? <server>?” Then entity relationship recognition is performed and converted into a question-answer template. It should be noted that since the specific processor chip is not specified in the question, there will be a default value in the template. If the statement specifies which processor to use, it will be replaced. Finally, the historical question template and the query statement template are stored as a key-value pair.
[0107] In one embodiment, determining the answer template of the historical cloud resource question and answer record based on the template information of the historical cloud resource question and answer record includes: obtaining an answer set corresponding to the question set in the historical cloud resource question and answer record; performing regular expression recognition on numbers in the answer set, and replacing the numbers with placeholders based on the regular expression recognition results; after replacing the numbers in the answer set with placeholders, performing entity relationship recognition on the answer set; based on the entity relationship recognition results, replacing the entire answer set with placeholders; and determining the answer template based on the placeholders.
[0108] The answer set is a collection of common answers extracted from historical cloud resource question and answer records. The specific content of these answers may contain various numbers. In order to build a universal answer template, it is necessary to perform regular expression recognition on the numbers in the answer set and replace them with placeholders. Regular expression recognition can automatically recognize and extract the numbers in the answers to ensure the accuracy and consistency of the replacement. After replacing the numbers in the answer set with placeholders, entity relationship recognition is performed on the answer set. Entity relationship recognition is to identify entities with specific meanings and the relationships between them from the answers. Through entity relationship recognition, the relationships and dependencies between different cloud resources can be clearly displayed to form the skeleton of the answer template. According to the entity relationship recognition results, the specific entities and relationships in the answer set are replaced with placeholders to form a universal answer template. The answer template defines the type and structure of the answer. By determining the answer template, the question and answer records can be standardized to facilitate subsequent model construction and application.
[0109] Reference Figure 2 , showing a step flow chart of a cloud resource construction question-answering method based on a knowledge graph provided in an embodiment of the present invention.
[0110] In one embodiment, the method further includes: obtaining a user's cloud resource question; inputting the cloud resource question into the cloud resource question and answer model; and outputting an answer to the cloud resource question through the cloud resource question and answer model.
[0111] The question-answering model is built based on historical cloud resource question-answering records and knowledge graphs. It uses machine learning and natural language processing technologies to conduct in-depth data analysis and modeling to generate an intelligent question-answering system. The question-answering model not only takes into account common user questions and solutions, but also covers cloud resource configuration parameters, performance optimization suggestions, etc. By selecting and configuring these recommended target cloud resources, users can ensure that their business systems are optimally supported in terms of high availability, scalability, and security.
[0112] In one embodiment, outputting an answer to the cloud resource question through the cloud resource question and answer model includes: performing regular expression recognition on the cloud resource question, and replacing the numbers with placeholders based on the regular expression recognition results; after replacing the numbers in the cloud resource question with placeholders, performing entity relationship recognition on the cloud resource question; based on the entity relationship recognition results, replacing all of the cloud resource questions with placeholders; based on the placeholders, searching for a question template in the question template that is similar to the placeholder corresponding to the cloud resource question; and outputting an answer to the cloud resource question based on the question template.
[0113] To obtain the user's demand question, first perform digital regular expression recognition on the question and replace the numbers in the question with digital identifiers, i.e. placeholders. Then perform entity recognition and replace the recognized entities, attributes, and categories with placeholders to obtain the template standard question. Then calculate the similarity with the historical question template in the cloud resource question and answer model, select the similar question with the highest score as the candidate question, and use the query template corresponding to the candidate answer as the candidate template.
[0114] Specifically, suppose the character sequence of the input question is Q = {q 1 ,q 2 ...,q n }, the number of entity category labels is m, where B-<entity name> indicates the beginning of an entity, and I-<entity name> indicates the characters in the entity. The vector representation of the question is extracted using the bidirectional encoder pre-training model, and the sequence X = {x 1 ,x 2 ...,x n }, the sequence X is input into the bidirectional long short-term memory network for calculation, and finally the output of the bidirectional long short-term memory network is input into the conditional random field layer to obtain the score matrix P of the label n×m, thereby obtaining the corresponding label of the current character. After determining the entity label, the entity is replaced by the placeholder to obtain a domain-independent question, and then the question is calculated again by the bidirectional encoder to obtain the sequence X ′ ={x ′ 1 ,x ′ 2 ...,x ′ n }, and calculate the cosine similarity with the historical question template matrix, sort the results with the highest scores as candidate question templates. According to the entity information extracted from the question, the entities in the knowledge graph are matched. The similarity between the two strings of the entity information extracted from the question and the entity information in the knowledge graph can be calculated, for example, by calculating the cosine similarity, and the value with the highest score is used as the value of the template instantiation.
[0115] For example, if a user inputs the question "How many object storage machines are needed to meet the disk capacity of 500T", the question is first subjected to digital regular expression recognition and entity recognition, and the recognized entities, attributes, and categories are replaced with placeholders to obtain a question sentence that is not related to the domain. After completing entity recognition, the above question sentence is converted into the question sentence "How many object storage machines are needed to meet the disk capacity of 500T" <server>To satisfy<prop_num> <prop>”, and the similarity with the historical question template, and select the similar question with the highest score as the candidate answer, and the query template obtained is "MATCH(h: <server>)WHERE h.cpu_type='Intel 6348(28Cores,2.60GHz)'WITH<prop_num> / h. <prop>AS required_hosts RETURN required_hosts". After obtaining the candidate template, the template needs to be instantiated. The instantiation replaces the placeholders in the query template with the results of entity recognition, and the query statement is "MATCH(h: <objectserver>)WHERE h.cpu_type='Intel6348(28Cores,2.60GHz)'WITH 500 / h.storage_per_host AS required_hosts RETURNrequired_hosts”. Finally, the final answer to the cloud resource question is found in the knowledge graph based on the instantiated template.
[0116] The embodiment of the present invention provides a cloud resource construction question and answer method based on a knowledge graph, by obtaining cloud resource professional document materials; extracting information from the cloud resource professional document materials to obtain triple information; constructing a knowledge graph based on the triple information; obtaining historical cloud resource question and answer records; determining the template information of the historical cloud resource question and answer records by performing regular expression recognition and entity relationship recognition on the historical cloud resource question and answer records; and constructing a cloud resource question and answer model based on the template information of the historical cloud resource question and answer records and the knowledge graph. The embodiment of the present invention obtains triple information from cloud resource professional documents through information extraction, constructs a knowledge graph, and performs regular expression recognition and entity relationship recognition on historical question and answer records to obtain template information, and constructs a cloud resource question and answer model in combination with the template information and the knowledge graph to improve the accuracy of answers to cloud resource questions, while optimizing the processing efficiency of cloud resource consultation and enhancing the overall service quality and user experience.
[0117] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
[0118] Reference Figure 3 , shows a structural block diagram of a cloud resource construction question-answering device based on a knowledge graph provided by an embodiment of the present invention, which may specifically include the following modules:
[0119] The first acquisition module 301 is used to acquire professional documents of cloud resources;
[0120] A first extraction module 302 is used to extract information from the cloud resource professional document data to obtain triple information;
[0121] A first construction module 303 is used to construct a knowledge graph according to the triple information;
[0122] The second acquisition module 304 is used to acquire historical cloud resource question and answer records;
[0123] A first determination module 305 is used to determine the template information of the historical cloud resource question and answer record by performing regular expression recognition and entity relationship recognition on the historical cloud resource question and answer record;
[0124] The second construction module 306 is used to construct a cloud resource question and answer model according to the template information of the historical cloud resource question and answer records and the knowledge graph.
[0125] In one embodiment, the first extraction module includes:
[0126] A first preprocessing submodule, used for preprocessing the professional document data of the cloud resources;
[0127] A first extraction submodule is used to obtain the preprocessed professional document material of cloud resources and extract information from the preprocessed professional document material of cloud resources; the information extraction includes entity recognition;
[0128] The first acquisition submodule is used to obtain the triple information according to the information extraction result; the triple information includes: relationship triple information and attribute triple information.
[0129] In one embodiment, the second building block includes:
[0130] A first determination submodule is used to determine the question template and the answer template of the historical cloud resource question and answer record according to the template information of the historical cloud resource question and answer record;
[0131] The first construction submodule is used to construct a cloud resource question and answer model based on the question template of the historical cloud resource question and answer record, the answer template of the historical cloud resource question and answer record and the knowledge graph.
[0132] In one embodiment, the first determining submodule includes:
[0133] A first acquisition unit, configured to acquire a question set in the historical cloud resource question and answer record;
[0134] A first replacement unit is used to perform regular expression recognition on the numbers in the question set, and replace the numbers with placeholders according to the regular expression recognition results;
[0135] A first recognition unit, configured to perform entity relationship recognition on the question set after replacing numbers in the question set with placeholders;
[0136] A second replacement unit, configured to replace all of the question set with placeholders according to the entity relationship recognition result;
[0137] The first determining unit is used to determine the question template according to the placeholder.
[0138] In one embodiment, the first determining submodule includes:
[0139] A second acquisition unit is used to acquire an answer set corresponding to the question set in the historical cloud resource question and answer record;
[0140] A third replacement unit is used to perform regular expression recognition on the numbers in the answer set, and replace the numbers with placeholders according to the regular expression recognition results;
[0141] A second recognition unit is used to perform entity relationship recognition on the answer set after replacing the numbers in the answer set with placeholders;
[0142] A fourth replacement unit, configured to replace all of the answer sets with placeholders according to the entity relationship recognition result;
[0143] The second determining unit is used to determine the answer template according to the placeholder.
[0144] In one embodiment, the device further comprises:
[0145] The second acquisition module is used to obtain the user's cloud resource problem;
[0146] A first input module, used to input the cloud resource question into the cloud resource question-answering model;
[0147] The first output module is used to output an answer to the cloud resource question through the cloud resource question-answering model.
[0148] In one embodiment, the first output module includes:
[0149] A first replacement submodule is used to perform regular expression recognition on the cloud resource problem, and replace the number with a placeholder according to the regular expression recognition result;
[0150] A first identification submodule, configured to perform entity relationship identification on the cloud resource question after replacing numbers in the cloud resource question with placeholders;
[0151] A second replacement submodule is used to replace all the cloud resource issues with placeholders according to the entity relationship recognition result;
[0152] A first search submodule is used to search, according to the placeholder, for a question template in the question template that is similar to the placeholder corresponding to the cloud resource question;
[0153] The first output submodule is used to output an answer to the cloud resource question according to the question template.
[0154] The embodiment of the present invention provides a cloud resource construction question and answer method based on a knowledge graph, by obtaining cloud resource professional document materials; extracting information from the cloud resource professional document materials to obtain triple information; constructing a knowledge graph based on the triple information; obtaining historical cloud resource question and answer records; determining the template information of the historical cloud resource question and answer records by performing regular expression recognition and entity relationship recognition on the historical cloud resource question and answer records; and constructing a cloud resource question and answer model based on the template information of the historical cloud resource question and answer records and the knowledge graph. The embodiment of the present invention obtains triple information from cloud resource professional documents through information extraction, constructs a knowledge graph, and performs regular expression recognition and entity relationship recognition on historical question and answer records to obtain template information, and constructs a cloud resource question and answer model in combination with the template information and the knowledge graph to improve the accuracy of answers to cloud resource questions, while optimizing the processing efficiency of cloud resource consultation and enhancing the overall service quality and user experience.
[0155] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0156] An embodiment of the present invention further provides an electronic device, including:
[0157] It includes a processor, a memory, and a computer program stored in the memory and capable of running on the processor. When the computer program is executed by the processor, each process of the above-mentioned cloud resource construction question and answer method embodiment based on the knowledge graph is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0158] An embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the various processes of the above-mentioned knowledge graph-based cloud resource construction question-and-answer method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0159] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0160] It will be appreciated by those skilled in the art that the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0161] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks 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 terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal 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.
[0162] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including 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.
[0163] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement 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.
[0164] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.
[0165] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal 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, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "including a..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0166] The above is a detailed introduction to a cloud resource construction question and answer method based on knowledge graph and a cloud resource construction question and answer method device based on knowledge graph provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for general technical personnel in this field, according to the ideas of the present invention, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on the present invention.< / objectserver> < / prop> < / server> < / prop> < / server> < / server> < / prop>
Claims
1. A cloud resource construction question-answering method based on knowledge graph, the method comprising: Obtain professional documentation on cloud resources; By extracting information from the professional document materials of the cloud resources, triple information is obtained; Construct a knowledge graph based on the triple information; Get historical cloud resource Q&A records; Determine the template information of the historical cloud resource question and answer record by performing regular expression recognition and entity relationship recognition on the historical cloud resource question and answer record; A cloud resource question and answer model is constructed based on the template information of the historical cloud resource question and answer records and the knowledge graph.
2. The method according to claim 1, characterized in that The triple information is obtained by extracting information from the professional document data of the cloud resources, including: Preprocessing the professional documents of the cloud resources; Acquire the preprocessed professional document data of cloud resources, and extract information from the preprocessed professional document data of cloud resources; the information extraction includes entity recognition; The triple information is obtained according to the information extraction result; the triple information includes: relationship triple information and attribute triple information.
3. The method according to claim 2, characterized in that The step of constructing a cloud resource question and answer model based on the template information of the historical cloud resource question and answer records and the knowledge graph includes: Determine the question template and answer template of the historical cloud resource question and answer record according to the template information of the historical cloud resource question and answer record; A cloud resource question and answer model is constructed based on the question template of the historical cloud resource question and answer record, the answer template of the historical cloud resource question and answer record, and the knowledge graph.
4. The method according to claim 3, characterized in that The step of determining the question template of the historical cloud resource question and answer record according to the template information of the historical cloud resource question and answer record comprises: Obtaining a question set in the historical cloud resource question and answer record; Performing regular expression recognition on the numbers in the question set, and replacing the numbers with placeholders according to the regular expression recognition results; After replacing the numbers in the question set with placeholders, performing entity relationship recognition on the question set; According to the entity relationship recognition result, all the question sets are replaced with placeholders; and the question template is determined according to the placeholders.
5. The method according to claim 4, characterized in that The step of determining the answer template of the historical cloud resource question and answer record according to the template information of the historical cloud resource question and answer record comprises: Obtaining a set of answers corresponding to the set of questions in the historical cloud resource question and answer record; Performing regular expression recognition on the numbers in the answer set, and replacing the numbers with placeholders according to the regular expression recognition results; After replacing the numbers in the answer set with placeholders, performing entity relationship recognition on the answer set; According to the entity relationship recognition result, all the answer sets are replaced with placeholders; The answer template is determined according to the placeholder.
6. The method according to claim 5, characterized in that The method further comprises: Obtaining users’ cloud resources; Inputting the cloud resource question into the cloud resource question-answering model; The cloud resource question-answering model outputs an answer to the cloud resource question.
7. The method according to claim 6, characterized in that Outputting an answer to the cloud resource question through the cloud resource question-answering model includes: Perform regular expression recognition on the cloud resource problem, and replace the number with a placeholder according to the regular expression recognition result; After replacing the numbers in the cloud resource problem with placeholders, performing entity relationship recognition on the cloud resource problem; According to the entity relationship recognition result, all the cloud resource issues are replaced with placeholders; Searching, according to the placeholder, for a question template in the question template that is similar to the placeholder corresponding to the cloud resource question; An answer to the cloud resource question is output according to the question template.
8. A cloud resource construction question-answering device based on knowledge graph, the device comprising: The first acquisition module is used to acquire professional documents of cloud resources; A first extraction module is used to extract information from the professional document data of the cloud resources to obtain triple information; A first construction module is used to construct a knowledge graph based on the triple information; The second acquisition module is used to obtain historical cloud resource question and answer records; A first determination module is used to determine the template information of the historical cloud resource question and answer record by performing regular expression recognition and entity relationship recognition on the historical cloud resource question and answer record; The second construction module is used to construct a cloud resource question and answer model based on the template information of the historical cloud resource question and answer records and the knowledge graph.
9. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the steps of building a cloud resource question and answer based on a knowledge graph are implemented as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, the steps of the cloud resource construction question-answering method based on the knowledge graph are implemented as described in any one of claims 1 to 7.