Intelligent question and answer method and device, electronic equipment and storage medium
By analyzing client-side requirements to generate semantic parameters, identifying target identifiers, and obtaining semantic results, this technology solves the problem of complex maintenance of external components in existing technologies, and achieves unified management of service nodes and efficient intelligent question answering.
Patent Information
- Application Number
- CN202511042167.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-28
- Publication Date
- 2025-11-11
AI Technical Summary
Existing intelligent question answering methods that use vector databases or subdomain forwarding mechanisms require maintaining redundant external components, resulting in complex implementation and difficulty in supporting unified management of service nodes.
By obtaining the request statement information initiated by the client, analyzing and generating request semantic parameters, obtaining the tool identifier list from the client, determining the target identifier, sending a proxy request to the proxy gateway, obtaining semantic results, and finally generating the response result, the intelligent question answering is completed.
It eliminates the need to maintain additional databases or middleware, simplifying the implementation process, supporting unified management of service nodes, and improving the efficiency and scalability of intelligent question answering.
Smart Images

Figure CN120930788A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular to an intelligent question-answering method, device, electronic device, and storage medium. Background Technology
[0002] With the widespread adoption of artificial intelligence applications, AI applications driven by large language models have gradually become the mainstream trend in the industry. As the core execution unit of AI applications, the client often needs to utilize diverse tools provided by multiple service nodes to complete intelligent question-answering tasks.
[0003] In related technologies, existing intelligent question-answering methods encode the configuration information of service nodes into vectors and store them in the database. When a client raises a question, the database is retrieved to locate the corresponding service node to complete the intelligent question-answering task. This process is not only complex but also requires additional database maintenance. While using a subdomain forwarding mechanism to direct questions to different service nodes via different subdomains eliminates the need for additional database maintenance, it introduces external middleware (such as a DNS resolver), which also presents challenges in implementation complexity and difficulty in supporting unified management of service nodes. Summary of the Invention
[0004] The purpose of this application is to provide an intelligent question-answering method, device, electronic device, and storage medium to solve the technical problem that existing technologies, which use vector database construction or subdomain forwarding mechanisms, require the maintenance of redundant external components, leading to implementation difficulties and hindering unified management of service nodes. The specific technical solution is as follows:
[0005] In a first aspect of this application, an intelligent question-answering method is provided, the method comprising:
[0006] Obtain the requirement statement information initiated by the client, analyze the requirement statement information, and generate requirement semantic parameters;
[0007] Obtain a list of tool identifiers from the client, and determine the target identifier from the list of tool identifiers based on the required semantic parameters;
[0008] The target identifier and the required semantic parameters are sent to the client, so that the client sends a proxy request to the proxy gateway based on the target identifier and the required semantic parameters, and obtains a semantic result;
[0009] The semantic result is obtained from the client, and a response result is generated based on the semantic result and the requirement description information;
[0010] The response is sent to the client to complete the intelligent question-and-answer process.
[0011] In an optional implementation, the step of analyzing the requirement description information to generate requirement semantic parameters includes:
[0012] Obtain entity information, attribute information, and relationship information from the aforementioned requirement description information;
[0013] The entity information, attribute information, and relationship information are processed to generate the requirement semantic parameters.
[0014] In an optional implementation, the tool identifier list is generated through the following steps:
[0015] The proxy gateway generates a service identifier for any service node based on the service node's metadata.
[0016] For any tool of the service node, the service identifier is injected as a default parameter into the tool parameter information of the tool, and the tool parameter information of the tool with the injected service identifier is registered to the client, so that the client generates the tool identifier list according to the registered tool parameter information of the tool with the injected service identifier.
[0017] In an optional implementation, the target identifier includes a target service identifier and a target tool identifier, and determining the target identifier from the list of tool identifiers based on the requirement semantic parameters includes:
[0018] The semantic parameters of the requirements are analyzed to determine the type of requirement;
[0019] The target tool identifier is determined from the tool identifier list based on the required type;
[0020] Extract the target service identifier from the tool parameter information corresponding to the target tool identifier.
[0021] In an optional implementation, the step of sending a proxy request to the proxy gateway based on the target identifier and the required semantic parameters to obtain a semantic result includes:
[0022] The target service identifier, the target tool identifier, and the requirement semantic parameters are encapsulated into the proxy request;
[0023] The proxy request is sent to the proxy gateway, so that the proxy gateway responds to the proxy request by performing the following steps and returning the semantic result:
[0024] The proxy request is parsed to obtain the target service identifier, the target tool identifier, and the requirement semantic parameters;
[0025] The semantic result is generated based on the target service identifier, the target tool identifier, and the requirement semantic parameters, and the semantic result is returned to the client.
[0026] Receive the semantic result returned by the proxy gateway.
[0027] In an optional implementation, generating the semantic result based on the target service identifier, the target tool identifier, and the requirement semantic parameters includes:
[0028] Obtain the service registry, and retrieve the service corresponding to the target service identifier from the service registry as the target service;
[0029] Obtain the tool registry corresponding to the target service;
[0030] The target tool is determined from the tool registry based on the target tool identifier;
[0031] The target tool is invoked to generate the semantic result based on the required semantic parameters, and the semantic result is returned to the proxy gateway.
[0032] The proxy gateway receives the semantic result.
[0033] In an optional implementation, generating a response result based on the semantic result and the demand description information includes:
[0034] Obtain the response format from the aforementioned requirement description information;
[0035] The semantic result is fused with the requirement description information based on the response format to generate the response result.
[0036] In a second aspect of this application, an intelligent question-answering device is also provided, the device comprising:
[0037] The semantic parsing module obtains the requirement statement information initiated by the client, analyzes the requirement statement information, and generates requirement semantic parameters;
[0038] The matching module obtains a list of tool identifiers from the client and determines the target identifier from the list of tool identifiers based on the required semantic parameters;
[0039] The calling module sends the target identifier and the required semantic parameters to the client, so that the client sends a proxy request to the proxy gateway based on the target identifier and the required semantic parameters, and obtains a semantic result;
[0040] The execution module obtains the semantic result from the client and generates a response result based on the semantic result and the requirement description information;
[0041] The response module sends the response result to the client to complete the intelligent question and answer process.
[0042] In a third aspect of the embodiments of this application, an electronic device is also provided, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;
[0043] Memory, used to store computer programs;
[0044] When a processor executes a program stored in memory, it implements the intelligent question-answering method described in any of the first aspects above.
[0045] In a fourth aspect of the embodiments of this application, a storage medium is also provided, wherein the storage medium stores instructions that, when run on a computer, cause the computer to execute any of the intelligent question-answering methods described in the first aspect above.
[0046] In a fifth aspect of the embodiments of this application, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to execute any of the intelligent question-answering methods described in the first aspect above.
[0047] The technical solution provided in this application embodiment obtains the demand description information initiated by the client, analyzes the demand description information, generates demand semantic parameters, obtains a tool identifier list from the client, determines the target identifier from the tool identifier list according to the demand semantic parameters, and sends the target identifier and demand semantic parameters to the client. This allows the client to send a proxy request to the proxy gateway based on the target identifier and demand semantic parameters, obtains the semantic result, obtains the semantic result from the client, generates a response result based on the semantic result and demand description information, and sends the response result to the client, thus completing intelligent question answering. This process of obtaining the tool identifier list from the client to obtain the target identifier, and then generating a response result based on the target identifier and demand description information, completes intelligent question answering. This solves the technical problem in existing technologies that use vector database construction or subdomain forwarding mechanisms, which require maintaining redundant external components, leading to implementation difficulties and hindering unified management of service nodes. Attached Figure Description
[0048] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0049] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0050] Figure 1 A schematic diagram illustrating the implementation process of an intelligent question-answering method provided in this application embodiment;
[0051] Figure 2 A schematic diagram illustrating the implementation process of another intelligent question-answering method provided in this application embodiment;
[0052] Figure 3 A schematic diagram illustrating the implementation process of a method for generating demand semantic parameters provided in this application embodiment;
[0053] Figure 4 A schematic diagram illustrating the implementation process of a method for generating a tool identifier list provided in this application embodiment;
[0054] Figure 5 A schematic diagram illustrating the implementation process of a semantic result generation method provided in this application embodiment;
[0055] Figure 6 A schematic diagram illustrating the implementation process of a response result generation method provided in this application embodiment;
[0056] Figure 7 This is a schematic diagram of the structure of an intelligent question-answering device provided in an embodiment of this application;
[0057] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0058] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0059] The following disclosure provides numerous different embodiments or examples for implementing various structures of this application. To simplify the disclosure, specific examples of components and arrangements are described below. These are merely examples and are not intended to limit the scope of this application. Furthermore, reference numerals and / or letters may be repeated in different examples. Such repetition is for simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or arrangements discussed.
[0060] like Figure 1 The diagram shown illustrates the implementation flow of an intelligent question-answering method provided in this application embodiment. The method may specifically include the following steps:
[0061] S101: Obtain the requirement description information initiated by the client, analyze the requirement description information, and generate requirement semantic parameters.
[0062] In this embodiment, the requirement statement information initiated by the client is obtained and analyzed to generate requirement semantic parameters. The requirement statement information can be natural language text input by the user on the client (e.g., "Check the temperature in Beijing after 7 PM tonight"). Natural language processing (NLP) technology is used to analyze the requirement statement information to extract key semantic information, which is then converted into structured requirement semantic parameters. The requirement statement information can also be an image uploaded by the user on the client (e.g., a screenshot containing text, a handwritten requirement, etc.). The image is converted into text using OCR or image recognition technology. NLP technology is then used to analyze the requirement statement information to extract key semantic information, which is then converted into structured requirement semantic parameters. Natural language processing techniques include, but are not limited to, lexical analysis, syntactic analysis, and semantic analysis; this embodiment does not limit the specific techniques used.
[0063] In another embodiment of this application, the execution subject of this application can be a large model, such as an LLM (Large Language Model). The large model can exist in any client or on any server, or it can be an independent execution subject, that is, it can run as independent software or service, independent of the specific environment of the client and server. This application does not limit this.
[0064] For example, the client's request statement, "Help me check the temperature in Beijing after 2 PM today (January 1, 2025)," is obtained. Natural language processing is used to perform lexical, syntactic, and semantic analysis on the request statement to obtain the semantic parameters "weather query, Beijing, 2025-01-01 14:00:00, 2025-01-02 00:00:00, temperature."
[0065] S102, obtain the tool identifier list from the client, and determine the target identifier from the tool identifier list according to the requirement semantic parameters.
[0066] In this embodiment, a tool identifier list is obtained from the client, and a target identifier is determined from the tool identifier list based on the requirement semantic parameters. The tool identifier list describes the set of tools contained in all service nodes registered in the current proxy gateway.
[0067] The above-mentioned method determines the target identifier from the tool identifier list based on the semantic parameters of the requirements. Semantic matching algorithms can then be used to match the semantic parameters of the requirements with each tool identifier in the tool identifier list. These algorithms include, but are not limited to, keyword matching and semantic similarity matching. To improve matching accuracy, keyword weights can be assigned for keyword matching, with more important keywords given higher weights, and weighted processing applied when calculating the matching degree. Simultaneously, the handling of synonyms and near-synonyms is considered. By establishing a thesaurus, semantically similar words are treated as the same keywords for matching. For semantic similarity matching, word vector models (such as Word2Vec, GloVe, or BERT) convert the semantic parameters of the requirements and the tool identifier description into vector form, and calculate the cosine similarity or other similarity indicators between them.
[0068] The above method of determining the target identifier from the list of tool identifiers based on the semantic parameters of the requirements can also be achieved through matching by a rule engine. Matching rules can be formulated based on the semantic parameters of the requirements, and the rule engine can perform automatic matching. For example, the rule can be formulated as "If the semantic parameters of the requirements include 'weather query', then tool identifiers that have weather query functions in the function description will be matched first; if they also include a specific location, then tool identifiers that support weather query for that location will be further filtered".
[0069] The above method of determining the target identifier from the tool identifier list based on demand semantic parameters can also be achieved by using machine learning algorithms to train a predictive model based on a large amount of historical demand semantic parameters and corresponding functional descriptions as training data. This model can then take demand semantic parameters as input and output the target identifier. For example, a neural network model in deep learning, such as a recurrent neural network or a long short-term memory network, can be used to extract features and classify and predict the demand semantic parameters, thereby determining the target identifier. This application does not limit this approach.
[0070] Furthermore, if the function descriptions of multiple tools have a certain degree of matching with the semantic parameters of the requirement, a keyword matching threshold can be set. When the number of matched keywords reaches or exceeds the threshold, the tool identifier corresponding to the function description is used as a candidate target identifier. Then, the target identifier with the highest matching degree is selected from the candidate target identifiers. The matching degree calculation can comprehensively consider keyword matching degree, semantic similarity, rule matching priority, and other relevant factors (such as the frequency of tool use, user reviews, etc.). After setting weights for each factor, a comprehensive matching degree score is calculated, and the tool identifier with the highest matching degree score is selected.
[0071] For example, if the semantic parameters of the requirement are "weather query, Beijing, 2025-01-01 14:00:00, 2025-01-02 00:00:00, temperature", and the function description corresponding to tool identifier 1 in the tool identifier list includes "provides weather query service for Beijing area, and can obtain temperature and other information", then the tool identifier has a certain degree of matching with the semantic parameters of the requirement.
[0072] S103, the target identifier and requirement semantic parameters are sent to the client, so that the client can send a proxy request to the proxy gateway based on the target identifier and requirement semantic parameters and obtain the semantic result.
[0073] In this embodiment, the target identifier and demand semantic parameters are sent to the client, enabling the client to send a proxy request to the proxy gateway based on the target identifier and demand semantic parameters, and obtain a semantic result. The semantic result can be the output of a tool invoked by the proxy gateway based on the demand semantic parameters. This embodiment does not limit this.
[0074] For example, the target identifier 1 and the requirement semantic parameter 1 are sent to the client. The client sends a proxy request 1 to the proxy gateway based on the target identifier 1 and the requirement semantic parameter 1, and obtains the semantic result 1.
[0075] S104: Obtain semantic results from the client and generate a response based on the semantic results and the requirement description information.
[0076] In this embodiment, semantic results are obtained from the client, and a response is generated based on the semantic results and the user's request description. Some request descriptions may include personalized requirements from the user, such as concise feedback (only temperature is needed), more detailed feedback (such as clothing suggestions for the corresponding temperature), or style requirements (such as colloquial language). Therefore, it is necessary to generate a response based on the semantic results and the user's request description to better meet the user's needs. This embodiment does not limit this approach.
[0077] For example, if the semantic result is a temperature of 30℃, and the requirement description includes "Answer the temperature in Beijing at 2 PM today in one sentence", the corresponding response would be "The temperature in Beijing at 2 PM today is 30℃".
[0078] S105 sends the response to the client, completing the intelligent Q&A process.
[0079] In this embodiment, the response result is sent to the client to complete the intelligent question-and-answer process. After parsing the response result, the client can directly display the response result on the UI interface (such as a chat box or pop-up window). This application example does not limit this.
[0080] For example, send reply result 1 to the client and display it in the client's chat window.
[0081] Based on the above description of the technical solution provided in the embodiments of this application, the system obtains the client-initiated demand description information, analyzes the demand description information to generate demand semantic parameters, obtains a tool identifier list from the client, determines the target identifier from the tool identifier list according to the demand semantic parameters, and sends the target identifier and demand semantic parameters to the client. This allows the client to send a proxy request to the proxy gateway based on the target identifier and demand semantic parameters, obtain a semantic result, obtain the semantic result from the client, generate a response result based on the semantic result and demand description information, and send the response result back to the client, thus completing intelligent question answering. This process of obtaining a tool identifier list from the client to obtain the target identifier, and then generating a response result based on the target identifier and demand description information, completes intelligent question answering. This addresses the technical problem in existing technologies that use vector database construction or subdomain forwarding mechanisms, which require maintaining redundant external components, leading to implementation difficulties and hindering unified management of service nodes.
[0082] like Figure 2 The diagram shown illustrates the implementation flow of another intelligent question-answering method provided in this application embodiment, which may specifically include the following:
[0083] S201: Obtain the requirement statement information initiated by the client, analyze the requirement statement information, and generate requirement semantic parameters.
[0084] In this embodiment of the application, this step is similar to step S101 above, and will not be described in detail here.
[0085] For details on how to analyze requirement descriptions and generate requirement semantic parameters, please refer to [reference needed]. Figure 3 The method shown. (As illustrated) Figure 3 The diagram shown illustrates the implementation flow of a requirement semantic parameter generation method provided in this application embodiment, which may specifically include the following steps:
[0086] S301, Obtain entity information, attribute information and relationship information from the requirement description information.
[0087] In this embodiment of the application, entity information, attribute information and relationship information are obtained from the demand description information. Entity information (such as location) can be obtained from the demand description information through the NER model, attribute information (such as time and temperature) can be obtained from the demand description information, and the dependency relationship between the demand description information (such as "temperature" corresponding to "query") can be parsed. This application example does not limit this.
[0088] S302 processes entity information, attribute information, and relationship information to generate requirement semantic parameters.
[0089] In this embodiment of the application, entity information, attribute information and relationship information are processed to generate requirement semantic parameters, but this application example does not limit this.
[0090] For example, processing "Entity information: Beijing, Attribute information: after 2 PM on January 1, 2025, Temperature, Relationship information: Query - Temperature, Time - Beijing" generates the following semantic parameters for the requirement: "Weather query, Beijing, 2025-01-01 14:00:00, 2025-01-02 00:00:00, Temperature".
[0091] S202: Obtain the list of tool identifiers from the client, analyze the semantic parameters of the requirements, and determine the type of requirements.
[0092] In this embodiment of the application, a list of tool identifiers is obtained from the client, the semantic parameters of the requirements are analyzed, the type of requirement is determined, and the list of tool identifiers contains the functional descriptions of the tools (such as weather query, flight query, etc.).
[0093] The above analysis of the semantic parameters of the demand determines the demand type. Based on the keyword mapping, a "demand type-keyword" mapping table can be preset (e.g., "weather query" corresponds to the keywords "weather, temperature, humidity, region"; "flight query" corresponds to the keywords "flight, departure time, destination"). Keywords are extracted from the semantic parameters of the demand and matched with the keywords in the mapping table to obtain the demand type.
[0094] For details on the process of generating the tool identifier list, please refer to [reference needed]. Figure 4 The method shown. (As illustrated) Figure 4 The diagram shown illustrates the implementation flow of a method for generating a tool identifier list according to an embodiment of this application, which may specifically include the following steps:
[0095] S401, the proxy gateway generates a service identifier for any service node based on the service node's metadata.
[0096] In this embodiment, the proxy gateway generates a service identifier for any service node based on the service node's metadata. The service node can be a service unit providing a specific service (such as a Beijing weather service node or a flight service node). The metadata identifies relevant information about the service node and may include service name, function description, service address, version number, and domain. The proxy gateway analyzes the metadata to generate a unique and resolvable service identifier. This embodiment does not limit this specific approach.
[0097] The service identifier can be generated by combining the core fields in the service node metadata with the format "domain_service name_unique code". For example, if the service node's metadata is: service name = "Beijing weather query service", domain = "meteorology", version number = "v1.0", service address = "10.0.0.5", the proxy gateway extracts "meteorology" and "Beijing weather" as core fields and generates the unique code "002". The final service identifier is: weather_beijing_002.
[0098] S402, for any tool of the service node, inject the service identifier as a default parameter into the tool parameter information of the tool, and register the tool parameter information of the tool with the injected service identifier to the client, so that the client can generate a list of tool identifiers based on the tool parameter information of the registered tool with the injected service identifier.
[0099] In this embodiment, for any tool of a service node, the service identifier is injected as a default parameter into the tool parameter information of the tool, and the tool parameter information of the tool with the injected service identifier is registered to the client, so that the client generates a tool identifier list based on the tool parameter information of the registered tool with the injected service identifier. Each service node may contain multiple tools, and a tool is the smallest unit in the service node that implements a specific function (e.g., "temperature query tool" and "humidity query tool" are sub-tools of "Beijing weather service node").
[0100] The aforementioned tool parameter information is structured data used to describe the tool's attributes. Specifically, it may include: tool name, function description (such as "query the temperature at a specified time"), input parameter requirements (such as "location and time must be provided"), output format (such as "value + unit"), tool unique identifier (tool ID), etc. This application example does not limit this.
[0101] For example, the service identifier for the "Beijing Weather Service Node" is weather_beijing_002. The original parameter information for the "Temperature Query Tool" under this node is: {"Tool ID":"tool_temp_bj_001","Tool Name":"Beijing Temperature Query","Function Description":"Query the temperature in Beijing on a specified date","Input Requirements":"Location (default Beijing), Date"}; After injecting the service identifier, the tool parameter information is updated to: {"Tool ID":"tool_temp_bj_001","Tool Name":"Beijing Temperature Query","Function Description":"Query the temperature in Beijing on a specified date","Input Requirements":"Location (default Beijing), Date","Service Identifier":"weather_beijing_002"}.
[0102] S203, determine the target tool identifier from the tool identifier list based on the requirement type.
[0103] In this embodiment, the target identifier includes a target service identifier and a target tool identifier. The target tool identifier is determined from the tool identifier list based on the requirement type. The requirement type is matched with the function descriptions in the tool parameter information of the tool identifier list to find the closest function description, and the tool ID corresponding to the closest function description is used as the target tool identifier.
[0104] In addition, the semantic parameters of the requirements can be converted into vectors and clustered with the vectors of the function descriptions of each tool in the tool identifier list (such as the description vector of "Beijing Weather Query Tool"). The tool ID corresponding to the function description vector that is closest to the vector of the semantic parameters of the requirements can be used as the target tool identifier.
[0105] For example, if the requirement type is "weather query", the function description corresponding to tool ID1 obtained from the tool identifier list is closest to the requirement type "weather query", so tool ID1 is used as the target tool identifier.
[0106] S204, Extract the target service identifier from the tool parameter information corresponding to the target tool identifier.
[0107] In this embodiment of the application, the target service identifier is extracted from the tool parameter information corresponding to the target tool identifier. The tool parameter information contains the service identifier, and the service identifier in the tool parameter information corresponding to the target tool identifier is used as the target identifier.
[0108] For example, the tool parameter information corresponding to the target tool identifier is: {"Tool ID":"tool_temp_bj_001","Tool Name":"Beijing Temperature Query","Function Description":"Query the temperature in Beijing on a specified date","Input Requirements":"Location (default Beijing), Date","Service Identifier":"weather_beijing_002"}, from which the service identifier is obtained as weather_beijing_002.
[0109] S205 sends the target service identifier, target tool identifier, and requirement semantic parameters to the client so that the client can encapsulate the target service identifier, target tool identifier, and requirement semantic parameters into a proxy request.
[0110] In this embodiment, the target identifier includes a target service identifier and a target tool identifier. The target identifier and the requirement semantic parameters are sent to the client, so that the client encapsulates the target service identifier, target tool identifier, and requirement semantic parameters into a proxy request. These three types of information can be encapsulated according to a preset protocol format (such as JSON, XML, etc.) to form a proxy request containing complete invocation information, which can then be sent to the proxy gateway to execute the specific service.
[0111] For example, the target service identifier is "service_weather_bj_001" (corresponding to the Beijing weather service node); the target tool identifier is "tool_temp_bj_001" (corresponding to the Beijing temperature query tool); the requirement semantic parameters are ["weather query", "Beijing", "2025-01-01 14:00:00", "2025-01-01 20:00:00", "temperature"]; the target service identifier, target tool identifier, and requirement semantic parameters are sent to the client, and the client encapsulates the target service identifier, target tool identifier, and requirement semantic parameters into a proxy request.
[0112] S206, Send a proxy request to the proxy gateway so that the proxy gateway responds to the proxy request by performing the following steps and returning a semantic result.
[0113] In this embodiment of the application, a proxy request is sent to the proxy gateway so that the proxy gateway responds to the proxy request, executes steps S207 to S208, and returns a semantic result. This application example does not limit this.
[0114] S207, parse the proxy request to obtain the target service identifier, target tool identifier, and requirement semantic parameters.
[0115] In this embodiment, the proxy request is parsed to obtain the target service identifier, the target tool identifier, and the requirement semantic parameters. The proxy request is structured data encapsulated by the client, containing the target service identifier, the target tool identifier, and the requirement semantic parameters. The proxy gateway obtains these three parameters by parsing the proxy request.
[0116] For example, the proxy gateway parses the proxy request and obtains the target service identifier as "service_weather_bj_001" (corresponding to the Beijing weather service node); the target tool identifier as "tool_temp_bj_001" (corresponding to the Beijing temperature query tool); and the request semantic parameters as ["weather query", "Beijing", "2025-01-01 14:00:00", "2025-01-01 20:00:00", "temperature"].
[0117] S208 generates semantic results based on the target service identifier, target tool identifier, and requirement semantic parameters, and returns the semantic results to the client.
[0118] In this embodiment of the application, a semantic result is generated based on the target service identifier, the target tool identifier, and the requirement semantic parameters, and the semantic result is returned to the client. This application example does not limit this.
[0119] For details on how to generate semantic results based on the target service identifier, target tool identifier, and requirement semantic parameters, please refer to [reference needed]. Figure 5 The method shown. (As illustrated) Figure 5 The diagram shown illustrates the implementation flow of a semantic result generation method provided in this application embodiment, which may specifically include the following steps:
[0120] S501, obtain the service registry, and retrieve the service corresponding to the target service identifier from the service registry as the target service.
[0121] In this embodiment, a service registry is obtained, and the service corresponding to the target service identifier is retrieved from the service registry as the target service. The service registry records relevant information about service nodes registered with the proxy gateway, including service identifier (unique ID), service node name, network address (IP + port), service type (e.g., "weather service" or "logistics service"), availability status (online / offline), last heartbeat time, etc. The proxy gateway uses the target service identifier as a search key to query the corresponding service node information in the service registry and selects the matched service node as the target service.
[0122] For example, obtain the service registry, which contains service identifier 1, service identifier 2, and service identifier 3. The target service identifier is service identifier 3. Obtain the service 3 corresponding to the target service identifier from the service registry and use service 3 as the target service.
[0123] S502, Obtain the tool registry corresponding to the target service.
[0124] In this embodiment of the application, the tool registry corresponding to the target service is obtained. For example, if service 3 in the registry is the target service, the tool registry corresponding to service 3 will be obtained, that is, the tool information contained in service 3.
[0125] S503, determine the target tool from the tool registry based on the target tool identifier.
[0126] In this embodiment of the application, the target tool is determined from the tool registry based on the target tool identifier. For example, if the target tool identifier is tool 1, the tool ID corresponding to tool 1 is queried from the tool registry corresponding to service 3, and the corresponding tool is taken as the target tool.
[0127] S504, invoke the target tool so that the target tool generates semantic results according to the required semantic parameters and returns the semantic results to the proxy gateway.
[0128] In this embodiment of the application, the target tool is invoked so that the target tool generates semantic results according to the required semantic parameters and returns the semantic results to the proxy gateway. That is, the required semantic parameters are input into the parameter configuration information corresponding to the target tool, and the target tool outputs semantic results according to the required semantic parameters. This application example does not limit this.
[0129] S505, the proxy gateway receives the semantic results.
[0130] The above steps describe how to generate semantic results based on the target service identifier, the target tool identifier, and the semantic parameters of the requirements. During this process, it is necessary to monitor the status of the service nodes. If the service node corresponding to the target service identifier is unavailable (offline or abnormal), the corresponding abnormal information can be returned, or a secondary question-and-answer task can be triggered to rematch the target service identifier and the tool identifier.
[0131] In this embodiment of the application, after the target tool outputs the semantic result, it returns the semantic result to the proxy gateway, and the proxy gateway receives the semantic result. This application example does not limit this.
[0132] S209, Receive the semantic result returned by the proxy gateway.
[0133] In this embodiment of the application, the semantic result returned by the proxy gateway is received.
[0134] S210: Obtain semantic results from the client and generate a response based on the semantic results and the requirement description information.
[0135] In this embodiment of the application, this step is similar to step S104 above, and will not be described in detail here.
[0136] For details on how to generate a response based on semantic results and the information expressed in the request, please refer to [reference needed]. Figure 6 The method shown. (As illustrated) Figure 6 The diagram shown illustrates the implementation flow of a response result generation method provided in this application embodiment, which may specifically include the following steps:
[0137] S601, Obtain the response format from the requirement description information.
[0138] In this embodiment of the application, the response format is obtained from the requirement description information, which may be the response format that the user wants to receive.
[0139] For example, obtain the response format from the demand description information, i.e., "the user wants more specific response content".
[0140] S602, based on the response format, integrates semantic results with the information expressing the requirements to generate a response result.
[0141] In this embodiment of the application, the semantic results and the information expressing the requirements are integrated based on the response format to generate the response result.
[0142] S211, send the response to the client to complete the intelligent Q&A.
[0143] In this embodiment of the application, this step is similar to step S105 above, and will not be described in detail here.
[0144] Corresponding to the above method embodiments, this application also provides an intelligent question-answering device, such as... Figure 7 As shown, the device may include a semantic parsing module 701, a matching module 702, a calling module 703, an execution module 704, and a response module 705.
[0145] The semantic parsing module 701 obtains the requirement statement information initiated by the client, analyzes the requirement statement information, and generates requirement semantic parameters;
[0146] Matching module 702 obtains a list of tool identifiers from the client and determines the target identifier from the list of tool identifiers based on the required semantic parameters;
[0147] Module 703 is invoked to send the target identifier and the required semantic parameters to the client, so that the client can send a proxy request to the proxy gateway based on the target identifier and the required semantic parameters and obtain the semantic result.
[0148] Execution module 704 retrieves semantic results from the client and generates a response based on the semantic results and the requirement description information;
[0149] The response module 705 sends the response result to the client, completing the intelligent question and answer process.
[0150] This application also provides an electronic device, such as... Figure 8 As shown, it includes a processor 801, a communication interface 802, a memory 803, and a communication bus 804. The processor 801, communication interface 802, and memory 803 communicate with each other via the communication bus 804.
[0151] Memory 803 is used to store computer programs;
[0152] In one embodiment of this application, when the processor 801 executes a program stored in the memory 803, it performs the following steps:
[0153] The system retrieves and analyzes the client's request description to generate semantic parameters. It then obtains a list of tool identifiers from the client and determines the target identifier from this list based on the semantic parameters. The target identifier and semantic parameters are sent back to the client, enabling the client to send a proxy request to the proxy gateway based on these parameters. The system retrieves the semantic result from the client and generates a response based on the result and the request description. This response is then sent back to the client, completing the intelligent question-and-answer process. This process is repeated to obtain the target identifier from the client's tool identifier list, generate a response based on the target identifier and the request description, and complete the intelligent question-and-answer process.
[0154] The communication bus mentioned in the above electronic devices can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not indicate that there is only one bus or one type of bus.
[0155] The communication interface is used for communication between the aforementioned electronic devices and other devices.
[0156] The memory may include random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0157] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0158] In another embodiment provided in this application, a storage medium is also provided, which stores instructions that, when run on a computer, cause the computer to execute any of the intelligent question-answering methods described in the above embodiments.
[0159] In another embodiment provided in this application, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to execute any of the intelligent question-answering methods described in the above embodiments.
[0160] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a storage medium or transmitted from one storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk (SSD)).
[0161] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0162] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0163] The above description is merely a preferred embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application are included within the scope of protection of this application.
Claims
1. An intelligent question-answering method, characterized in that, The method includes: Obtain the requirement statement information initiated by the client, analyze the requirement statement information, and generate requirement semantic parameters; Obtain a list of tool identifiers from the client, and determine the target identifier from the list of tool identifiers based on the required semantic parameters; The target identifier and the required semantic parameters are sent to the client, so that the client sends a proxy request to the proxy gateway based on the target identifier and the required semantic parameters, and obtains a semantic result; The semantic result is obtained from the client, and a response result is generated based on the semantic result and the requirement description information; The response is sent to the client to complete the intelligent question-and-answer process.
2. The method according to claim 1, characterized in that, The step of analyzing the requirement description information to generate requirement semantic parameters includes: Obtain entity information, attribute information, and relationship information from the aforementioned requirement description information; The entity information, attribute information, and relationship information are processed to generate the requirement semantic parameters.
3. The method according to claim 1, characterized in that, The tool identifier list is generated through the following steps: The proxy gateway generates a service identifier for any service node based on the service node's metadata. For any tool of the service node, the service identifier is injected as a default parameter into the tool parameter information of the tool, and the tool parameter information of the tool with the injected service identifier is registered to the client, so that the client generates the tool identifier list according to the registered tool parameter information of the tool with the injected service identifier.
4. The method according to claim 3, characterized in that, The target identifier includes a target service identifier and a target tool identifier. Determining the target identifier from the tool identifier list based on the requirement semantic parameters includes: The semantic parameters of the requirements are analyzed to determine the type of requirement; The target tool identifier is determined from the tool identifier list based on the required type; Extract the target service identifier from the tool parameter information corresponding to the target tool identifier.
5. The method according to claim 4, characterized in that, The step of sending a proxy request to the proxy gateway based on the target identifier and the required semantic parameters, and obtaining a semantic result, includes: The target service identifier, the target tool identifier, and the requirement semantic parameters are encapsulated into the proxy request; The proxy request is sent to the proxy gateway, so that the proxy gateway responds to the proxy request by performing the following steps and returning the semantic result: The proxy request is parsed to obtain the target service identifier, the target tool identifier, and the requirement semantic parameters; The semantic result is generated based on the target service identifier, the target tool identifier, and the requirement semantic parameters, and the semantic result is returned to the client. Receive the semantic result returned by the proxy gateway.
6. The method according to claim 5, characterized in that, The step of generating the semantic result based on the target service identifier, the target tool identifier, and the requirement semantic parameters includes: Obtain the service registry, and retrieve the service corresponding to the target service identifier from the service registry as the target service; Obtain the tool registry corresponding to the target service; The target tool is determined from the tool registry based on the target tool identifier; The target tool is invoked to generate the semantic result based on the required semantic parameters, and the semantic result is returned to the proxy gateway. The proxy gateway receives the semantic result.
7. The method according to claim 1, characterized in that, The step of generating a response result based on the semantic result and the demand description information includes: Obtain the response format from the aforementioned requirement description information; The semantic result is fused with the requirement description information based on the response format to generate the response result.
8. An intelligent question-and-answer device, characterized in that, The device includes: The semantic parsing module obtains the requirement statement information initiated by the client, analyzes the requirement statement information, and generates requirement semantic parameters; The matching module obtains a list of tool identifiers from the client and determines the target identifier from the list of tool identifiers based on the required semantic parameters; The calling module sends the target identifier and the required semantic parameters to the client, so that the client sends a proxy request to the proxy gateway based on the target identifier and the required semantic parameters, and obtains a semantic result; The execution module obtains the semantic result from the client and generates a response result based on the semantic result and the requirement description information; The response module sends the response result to the client to complete the intelligent question and answer process.
9. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the method described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method described in any one of claims 1-7.