Water conservancy data intelligent access method, system and device based on water conservancy micro-service control plane and AI semantic routing and medium

By using a water conservancy microservice control plane and AI semantic routing, the problem of scattered water conservancy data and service tying was solved, enabling intelligent data access, improving data access efficiency and flexibility, and providing structured data integration results.

CN121547494APending Publication Date: 2026-02-17NANJING HEHAI NANZI HYDROPOWER AUTOMATION
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202511612892.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-06
Publication Date
2026-02-17

AI Technical Summary

Technical Problem

Water conservancy data is scattered across different systems, resulting in severe data silos. Furthermore, services and paths are rigidly tied, making it difficult to automatically match data according to user needs. This leads to low data access efficiency and an inability to meet business requirements.

Method used

The approach employs a water conservancy microservice control plane and AI semantic routing method. It receives natural language requests through a unified entry point, generates intent models using a semantic parsing model, dynamically matches target services, constructs a call topology for parallel service calls, and generates structured response results, thus avoiding the need for manual configuration of routing rules.

Benefits of technology

It enables intelligent data access, accurately matches user needs, improves data access efficiency and flexibility, avoids the problems of data silos and service ties, and provides structured and clear data integration results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121547494A_ABST
    Figure CN121547494A_ABST
Patent Text Reader

Abstract

The invention discloses a water conservancy data intelligent access method, system and device based on a water conservancy micro-service control plane and AI semantic routing and a medium, and belongs to the technical field of water conservancy projects and artificial intelligence, and the method comprises the steps: obtaining a natural language request submitted by a user through a unified entrance, and constructing an initial request object based on authority authentication; generating a first intention model through the initial request object in combination with a field-specific semantic analysis model; and based on the capability description set of the registered service, calculating a service matching matrix through the first intention model, and determining a target service set. According to the invention, the original gateway which only forwards data is changed into an intelligent agent which can actively process the demand, a user does not need to remember complex interfaces and paths, the user can say a natural language demand, the routing rule does not need to be manually set in advance, and the routing is automatically completed by the system understanding semantics.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application relates to the field of water conservancy and artificial intelligence technology, in particular to a water conservancy data intelligent access method and system based on a water conservancy micro-service control plane and AI semantic routing, equipment and medium. BACKGROUND

[0002] The water conservancy industry is an important field of national infrastructure, and many data are needed for daily operations, such as flood prevention, water resource management, and monitoring water quality. These data are scattered in different systems, and it is necessary to use these data well and quickly obtain information to guide operations to make accurate decisions for water conservancy business, which is the most basic requirement. Nowadays, the water conservancy data commonly uses a technology called API gateway. The Chinese patent (CN114205191B, named "API gateway system and operation method") is a representative technology in this technology. The use of this technology is to set the request path, verification method, and parameter conversion rules in the control page, so as to uniformly call the subsequent services. However, this method is not suitable for the water conservancy scene: on the one hand, the person who wants to get the data needs to know where the data exists and the corresponding service interface, so as to get the data according to the set path, which makes the data difficult to use; on the other hand, the service and path are fixed, and the selected path can only connect to the fixed back-end service, and it is not possible to automatically find the relevant water conservancy service in different systems according to the user's real needs. For example, if the user wants to get decision-making information that needs data from multiple systems to analyze, he needs to manually set several routing rules, which is low in efficiency. The water conservancy industry has two unavoidable problems: one is "data island" (data scattered in various systems and not connected with each other), and the other is "service binding" (service and path cannot be flexibly matched). Finally, it is necessary to actively find data to get water conservancy data, which cannot meet the demand of "hoping that data can actively serve people" in business. SUMMARY

[0003] To solve the above technical problems, a water conservancy micro-service control plane and AI semantic routing water conservancy data intelligent access method is proposed, including, obtaining the natural language request submitted by the user through the unified entrance, and constructing the initial request object based on the permission authentication; through the initial request object, a first intention model is generated by combining a domain-specific semantic analysis model; based on the ability description set of the registered service, a service matching matrix is calculated through the first intention model to determine the target service set; combined with the target service set, the calling topology of the preset service is constructed, and the standardized calling parameters are generated; through the calling topology, parallel service calling is performed to obtain the return data of each service; based on the return data, field alignment and data aggregation are performed combined with the user output demand to generate a structured response result and output.

[0004] As a preferred scheme of the water conservancy micro-service control plane and AI semantic routing water conservancy data intelligent access method, wherein: obtaining the natural language request submitted by the user through the unified entrance, and constructing the initial request object based on the permission authentication includes receiving the natural language request text submitted by the user through the unified entrance; based on the natural language request text, verifying the access permission of the user to the target data, and generating an initial request object.

[0005] As a preferred scheme of the water conservancy micro-service control plane and AI semantic routing water conservancy data intelligent access method, wherein: through the initial request object, a first intention model is generated by combining a domain-specific semantic analysis model, which includes performing intention recognition through the request text of the initial request object to generate a target capability identifier; based on the target capability identifier, the parameter entities in the request text are extracted and mapped to generate a standardized parameter dictionary; combined with the target capability identifier and the parameter dictionary, the output field set expected by the user is inferred through context semantic analysis to generate a first intention model.

[0006] As a preferred scheme of the water conservancy micro-service control plane and AI semantic routing water conservancy data intelligent access method, wherein: based on the ability description set of the registered service, a service matching matrix is calculated through the first intention model to determine the target service set, which includes collecting the service capability description set provided when each service is registered; combined with the service capability description set, the matching degree of each service and the intention is evaluated based on the intention information in the first intention model to generate a service matching matrix; based on the service matching matrix, the services that meet the preset matching conditions are screened to construct the target service set.

[0007] The beneficial effects of the preferred technical scheme are that the capability descriptions written by each service during registration can be collected first, then the actual demand intention is combined to judge the matching degree of each service and demand, a clear service and demand matching table is made, and then those services that meet the demand matching degree standard are selected to form a suitable service combination, so that the service that truly meets the demand can be accurately found without blind selection in a pile of services, time and effort are saved.

[0008] As a preferred scheme of the water conservancy data intelligent access method of the water conservancy micro-service control plane and AI semantic routing, wherein: the calling topology of the preset service is constructed based on the target service set, and the standardized calling parameter is generated, including: based on the service matching degree of the target service set, the service calling demand of a single service or multi-service cooperation is evaluated; a single service calling topology or a multi-service calling topology is constructed through the service calling demand; the parameter information in the first intention model is adapted to the standardized calling parameter based on the service parameter format requirement in the calling topology; and an instruction set for service execution is generated based on the calling topology and the standardized calling parameter.

[0009] As a preferred scheme of the water conservancy data intelligent access method of the water conservancy micro-service control plane and AI semantic routing, wherein: the parallel service calling is executed through the calling topology to obtain the return data of each service, including: based on the calling topology in the instruction set, the parallel calling task is initialized; the request containing the standardized calling parameter is sent to each target service based on the initialized parallel calling task, and the service calling is executed; the calling timeout threshold is set based on the execution result of the service calling, and the return data of each service is collected.

[0010] As a preferred scheme of the water conservancy data intelligent access method of the water conservancy micro-service control plane and AI semantic routing, wherein: based on the return data, the field alignment and data aggregation are performed based on the user output demand to generate a structured response result and output, including: based on the output field demand in the first intention model, the effective fields in the return data of each service are filtered; through the effective fields, the direct field extraction is performed on the return data of a single service, the field alignment operation is performed on the return data of multi-services, and the aligned field data set is generated; based on the aligned field data set, the field data is combined by using the preset aggregation rule to generate a structured response result; through the structured response result, the calling chain meta information including the service identification list and the request tracking identification is attached to generate a complete response data packet; based on the complete response data packet, the structured response result is returned to the user through a unified entrance.

[0011] The beneficial effects of the preferred technical solution are: accurate fitting to user needs, only selecting useful content in data, no redundant and invalid information, the returned result exactly matches the content the user wants. When encountering single service data, the required part can be directly extracted, when encountering multiple service data, the relevant content from different sources will be adjusted first, then integrated together in a predetermined way, avoiding data confusion, making the integrated information clear and orderly. The integrated structured result also has relevant service and request record information, which is convenient for subsequent data source and request process checking, and is convenient for management and problem troubleshooting. Finally, the result is returned to the user through a unified export, and the user can easily obtain structured and useful data without complicated operations.

[0012] As a preferred scheme of the water conservancy data intelligent access system of the water conservancy micro-service control plane and AI semantic routing, characterized in that it comprises a request acquisition module for acquiring a natural language request submitted by a user through a unified entrance and constructing an initial request object based on permission authentication; an intention analysis module for generating a first intention model through the initial request object in combination with a domain-specific semantic analysis model; a service matching module for calculating a service matching matrix through the first intention model based on a capability description set of registered services to determine a target service set; a calling topology construction module for constructing a preset service calling topology in combination with the target service set and generating standardized calling parameters; a service calling module for executing parallel service calling through the calling topology to acquire return data of each service; and a data aggregation module for performing field alignment and data aggregation based on the return data in combination with user output requirements to generate a structured response result and output.

[0013] A computer device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the steps of the method for water conservancy data intelligent access of the water conservancy micro-service control plane and AI semantic routing when executing the computer program.

[0014] A computer readable storage medium having a computer program stored thereon, the computer program being executed by a processor to implement the steps of the method for water conservancy data intelligent access of the water conservancy micro-service control plane and AI semantic routing.

[0015] The beneficial effects of the present application: integrate AI recognition and service deployment capabilities into the gateway, let the gateway that originally only forwards data become an intelligent agent that can actively handle demand, users do not need to remember complex interfaces and paths, and a natural language demand is enough, without manually setting routing rules, routing is completed automatically by the system understanding semantics. When encountering a demand that requires the cooperation of multiple services, the system can automatically identify and coordinate the call of related services to solve the problem of insufficient single service capability. This breaks the problem of scattered water data and fixed service binding. BRIEF DESCRIPTION OF DRAWINGS

[0016] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiment description. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0017] Figure 1 The overall flowchart of a water conservancy micro-service control plane and AI semantic routing water conservancy data intelligent access method provided by an embodiment of the present application. DETAILED DESCRIPTION

[0018] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and easy to understand, the specific embodiments of the present application will be described in detail below with reference to the drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor should be within the scope of protection of the present application.

[0019] Embodiment 1, refer to Figure 1 For the first embodiment of the present application, the embodiment provides a water conservancy micro-service control plane and AI semantic routing water conservancy data intelligent access method, comprising: S1: obtaining a natural language request submitted by a user through a unified entrance, and constructing an initial request object based on permission authentication.

[0020] S2: generating a first intention model through the initial request object, combined with a domain-specific semantic analysis model.

[0021] S3: based on the capability description set of the registered service, calculating a service matching matrix through the first intention model to determine a target service set.

[0022] S4: combining the target service set, constructing a preset service call topology, and generating standardized call parameters.

[0023] S5: Through the calling topology, perform parallel service calling to obtain return data of each service.

[0024] S6: Based on the return data, perform field alignment and data aggregation in combination with user output requirements to generate a structured response result and output.

[0025] It should be noted that the existing water conservancy data access method mainly realizes service calling through pre-defined request paths and parameter rules, and the user needs to explicitly know the data source location and service interface, which is complex to operate and lacks flexibility. Especially when dealing with complex water conservancy business requirements across systems and data, there are problems of "data island" and "service static binding", which leads to low data access efficiency and is difficult to meet the needs of dynamically changing water conservancy business scenarios.

[0026] Therefore, in order to solve the above problems, the present application uses the steps of S1-S6. First, the initial request object is constructed by receiving the natural language request through the unified entrance and performing the permission authentication. Then, the first intention model is generated by using the domain-specific semantic analysis model to automatically identify the user requirements. Next, the target service is dynamically screened by using the service matching matrix, the calling topology is constructed, and the standardized parameters are generated. Finally, the parallel service calling is performed and the return data is aggregated to generate the structured response result, so as to realize the intelligent data access without manual configuration of routing rules, and significantly improve the efficiency and flexibility of water conservancy data access.

[0027] Embodiment 2, refer to Figure 1 The second embodiment of the present application is different from the first embodiment in that: a water conservancy micro-service control plane and AI semantic routing water conservancy data intelligent access method further comprises: Specifically, in step S1, the natural language request submitted by the user through the unified entrance is obtained, and the initial request object is constructed based on the permission authentication, including the following steps A1-A2: A1: receiving the natural language request text submitted by the user through the unified entrance; A2: based on the natural language request text, verifying the access permission of the user to the target data, and generating an initial request object.

[0028] In the present application, in step A1, for receiving the natural language request submitted by the user, the receiving mode is to receive the request text submitted by the user in the form of natural language through the unified entrance, including the following steps A111-A114: A111: the user submits a natural language request or natural language input through the unified entrance, for example, the user inputs "check the future 72-hour flood water level in the middle reaches of the Yangtze River", and the request is sent to the system through a single entrance (such as / ai-query).

[0029] A112: After the user submits the natural language input, the system first performs security permission authentication to ensure that the user has the right to access relevant water conservancy data. After authentication, the request is further processed.

[0030] A113: After the system receives the request text, it records the meta information of the request, such as request time, user identification, and request tracking identification, to ensure the traceability of subsequent processing.

[0031] For example, in practical applications, users may submit requests through a web interface or API interface, and the system will record the request time and a unique request tracking identification (such as request_id). These information are stored together with the request text to form a complete request record.

[0032] A114: The received request text is passed to the subsequent semantic analysis module for intent recognition and parameter extraction to ensure that the request can be correctly understood and processed.

[0033] In an optional embodiment, the received natural language request submitted by the user can also be received through a multi-modal input interface, including the following steps A121-A123: A121: The user submits a request through a multi-modal input interface, such as submitting "Check the flood water level of the middle reaches of the Yangtze River in the next 72 hours" through voice input or text input.

[0034] A122: The system converts voice input into text or directly receives text input to generate a unified natural language request text, while recording the meta information of the request, such as user identification and request time.

[0035] For example, in the water conservancy data query scenario, the user may submit a request through the voice function of a mobile application, and the system will convert the voice into text "Check the flood water level of the middle reaches of the Yangtze River in the next 72 hours" and record the user identification and request time.

[0036] A123: The generated request text is passed to the semantic analysis module to ensure that the subsequent processing process is consistent with the text input method.

[0037] In another optional embodiment, the received natural language request submitted by the user can also be received through a distributed portal and unified aggregation, including the following steps A131-A134: A131: The user submits a natural language request through a distributed portal, such as submitting "Check the flood water level of the middle reaches of the Yangtze River in the next 72 hours" through different regional server nodes.

[0038] A132: After receiving the request, each distributed entry node forwards the request text and meta information (such as user identification, request time) to the central processing node.

[0039] A133: The central processing node de-duplicates and prioritizes the received requests to ensure that repeated requests from the same user are not processed repeatedly.

[0040] A134: The unified request text is passed to the semantic analysis module for subsequent intent recognition and parameter extraction.

[0041] It should be noted that by receiving the natural language request submitted by the user through the unified entrance, it can ensure that all requests enter the system in a standardized manner, avoiding inconsistent processing due to entrance differences, and supporting subsequent call tracking and auditing by recording request meta information.

[0042] Further, in step S2: generating a first intent model by combining the initial request object with a domain-specific semantic analysis model, including the following steps B1-B3: B1: Perform intent recognition on the request text of the initial request object to generate a target capability identifier; B2: Based on the target capability identifier, extract parameter entities in the request text by recognition to generate a standardized parameter dictionary; B3: Combine the target capability identifier and the parameter dictionary to infer the user's expected output field set through context semantic analysis, and generate a first intent model.

[0043] In the embodiments of the present application, in step B2, the extraction of parameter entities is performed by using a DistilBERT model fine-tuned in the water conservancy field for named entity recognition to generate a standardized parameter dictionary, including the following steps B211-B213: B211: Receive the natural language request text submitted by the user through the unified entrance (such as / ai-query), for example "Check the future 72-hour flood water level in the middle reaches of the Yangtze River", the system passes the request text as input to the built-in natural language processing module (NLP engine).

[0044] B212: Use the DistilBERT model fine-tuned on the water conservancy field corpus to perform named entity recognition on the request text to extract key parameter entities.

[0045] For example, when processing the request "Check the flood water level of the middle reaches of the Yangtze River in the next 72 hours", the system identifies "middle reaches of the Yangtze River" as a regional entity, mapped to the standardized "Yangtze_Middle"; "72 hours" as a time span entity, mapped to the integer 72; and "water level" as an indicator entity, mapped to "water_level". These entity parameters form a standardized parameter dictionary, such as {"region": "Yangtze_Middle", "hours": 72}, which is used for subsequent service calls.

[0046] B213: Verify whether the extracted parameter dictionary meets the input parameter template (input_schema) of the target service. If the parameters are missing or the types do not match (e.g., "hours" is passed a non-integer value), return an error prompt. If the parameters are complete and correctly formatted, output the parameter dictionary to the next step for generating the first intent model.

[0047] In an optional embodiment, for parameter entity extraction, the extraction method can also be based on multi-modal input combined with context-enhanced entity recognition to generate a standardized parameter dictionary, including the following steps B221-B223: B221: Receive the request submitted by the user through the multi-modal input interface. The input form is not limited to natural language text, but also includes voice or image, etc. For example, the user inputs "Query the water level of the Three Gorges Reservoir in the next 3 days" through voice. After the system converts the voice to text, it generates an enhanced request text combined with context information such as request time.

[0048] B222: Use the DistilBERT model combined with the context enhancement mechanism to perform named entity recognition on the enhanced request text to extract parameter entities.

[0049] B223: Perform validity check on the extracted parameter dictionary to ensure that the parameters meet the input parameter template (input_schema) of the target service, and record the request tracking identifier (request_id) to support subsequent audit, and finally output the standardized parameter dictionary.

[0050] In another optional embodiment, for parameter entity extraction, the extraction method can also be based on distributed entry collaborative entity recognition to generate a standardized parameter dictionary, including the following steps B231-B234: B231: Receive the natural language request submitted by the user through the distributed entry. The entry may be deployed in different water conservancy business systems (such as flood forecasting system or reservoir dispatching system), and the request text is unified to the single entry of the gateway.

[0051] B232: Distribute the request text to multiple fine-tuned DistilBERT model nodes using a distributed computing framework, each node performs entity recognition for a specific water conservancy business scenario (such as flood forecasting, reservoir management), and extracts parameter entities.

[0052] B233: Aggregate the recognition results of each node, solve entity conflicts (such as "Huaihe River" being recognized as a region and a reservoir in the same request), select the most matching entity mapping through pre-set priority rules, and generate a standardized parameter dictionary.

[0053] B234: Cross-system consistency check on the parameter dictionary to ensure that the parameters meet the input parameter templates (input_schema) of all related services, and record the call chain meta information (such as services_used, request_id), and finally output the standardized parameter dictionary.

[0054] It should be noted that through the parameter entity extraction based on the fine-tuned DistilBERT model in the water conservancy field, the key information in the user's natural language request can be effectively identified, a standardized parameter dictionary that meets the service call requirements is generated, supporting subsequent dynamic service matching and calling, avoiding the complex operation of manually specifying service paths in traditional API gateways, and improving the intelligent degree of water conservancy data access.

[0055] Further, in step S3, based on the set of registered service capability descriptions, a service matching matrix is calculated by the first intent model to determine a target service set, including the following steps C1-C3: C1: Collect the set of service capability descriptions provided when each service is registered; C2: Based on the intent information in the first intent model, evaluate the matching degree of each service and intent, and generate a service matching matrix, combining the set of service capability descriptions; C3: Based on the service matching matrix, filter services that meet the pre-set matching conditions to construct a target service set.

[0056] In the embodiments of the present application, in step C2, for the generation of the service matching matrix, the generation method is to analyze the semantic intent of the user's request through the first intent model, combine the set of service capability descriptions, and calculate the matching score of each service and user intent, including the following steps C211-C213: C211: Based on the first intent model (DistilBERT model), triple-parsing the natural language request submitted by the user to generate a structured call intent, including target capabilities, parameter dictionary and user expected output fields. If the user request does not specify the required fields, the system will infer the default fields according to common needs, and determine the final display coverage field range according to the user request and system pre-set rules.

[0057] C212: Traverse the service capability description set of the registered service, extract the atomic capability name, input parameter template and output field list of each service, calculate the matching score of the service and the intent based on the structured invocation intent, for example, if the atomic capability of a service is "flood forecast" and its input parameter template contains "region" and "hours", the matching score is 1.0, if the parameters do not match completely, the score is 0.5, otherwise it is 0.0.

[0058] C213: According to the matching score, generate a service matching matrix, which records the matching degree of each service and the user intent, which is used for subsequent screening of target services.

[0059] In an optional embodiment, for the generation of the service matching matrix, the generated manner can also be based on the semantic similarity calculation combined with the service capability description set to evaluate the matching degree of the service and the intent, including steps C221-C223: C221: Analyze the user request through the first intent model to generate a structured invocation intent, which contains the target capability, parameter dictionary and expected output field.

[0060] C222: Based on the semantic similarity algorithm, calculate the similarity between the semantic vector of the user request and the semantic vector of the registered service capability description, and combine the input parameter template and the output field list in the service capability description to comprehensively evaluate the matching degree, for example, calculate the semantic correlation between the user intent and the service capability through the cosine similarity, if the similarity is higher than 0.85, it is considered as a valid match.

[0061] For example, in processing the request "check the flood level of the middle reaches of the Yangtze River in the next 72 hours", the system compares the semantic vector of the user intent with the semantic vector of the flood forecast service, if the similarity is 0.9, it is marked as a high matching service.

[0062] C223: According to the semantic similarity and the parameter matching result, generate a service matching matrix, which records the comprehensive matching score of each service, which is used for screening target services.

[0063] In another optional embodiment, for the generation of the service matching matrix, the generated manner can also be based on the weighted rule matching combined with the service capability description set to evaluate the matching degree of the service and the intent, including steps C231-C234: C231: Analyze the user request through the first intent model to generate a structured invocation intent, which contains the target capability, parameter dictionary and expected output field.

[0064] C232: Set the weight for each field of the service capability description, for example, the target capability matching weight is 0.6, the input parameter matching weight is 0.3, and the output field matching weight is 0.1. The matching score of each service is calculated based on the weighted rules.

[0065] C233: Traverse the registered services, and calculate the weighted matching score of each service with the user intent in combination with the weighted rules.

[0066] C234: Generate a service matching matrix according to the weighted matching score, and record the weighted score of each service in the matrix. The service with the highest score is selected as the target service set.

[0067] It should be noted that by generating the service matching matrix, the most suitable service or service combination can be dynamically selected based on the semantic intent of the user request, avoiding the limitations of traditional static routing relying on path binding, and improving the intelligence of data access.

[0068] Further, in step S4, the calling topology of the preset service is constructed in combination with the target service set, and standardized calling parameters are generated, including the following steps D1-D4: D1: Based on the service matching degree of the target service set, the service calling demand of a single service or multi-service cooperation is evaluated; D2: A single service calling topology or multi-service calling topology is constructed through the service calling demand; D3: The parameter information in the first intent model is adapted to the standardized calling parameters in combination with the service parameter format requirements in the calling topology; D4: Based on the calling topology and the standardized calling parameters, an instruction set for service execution is generated.

[0069] In the embodiments of the present application, in step D1, the evaluation of the service calling demand is based on the service matching score and the output field coverage to determine whether to use a single service or a multi-service cooperation mode, including the following steps D111-D113: D111: Traverse each service in the target service set, and check whether its matching score is equal to 1.0 If there is at least one service =1.0, it is marked as a single service mode.

[0070] D112: If there is no service =1.0, it is marked as a single service mode. >0, and the union set of the output field list of these services completely covers the in the user intent.

[0071] For example, in processing the request, the system finds that the flood forecast service is a complete match, =1.0, so the single-service mode is adopted, avoiding redundant calls.

[0072] D113: If the union covers , mark as multi-service cooperation mode, otherwise return an error prompt that the user's demand cannot be met.

[0073] In an optional embodiment, for the evaluation of service call demand, the evaluation method can also be to judge the single-service or multi-service cooperation mode in combination with the intent confidence and the matching score, including the following steps D121-D123: D121: First check whether the confidence of the structured call intent generated in step 3 is greater than or equal to 0.85, and if it is lower than the threshold, directly return an error.

[0074] D122: Under the condition that the confidence meets the condition, further judge according to the matching score, if there is =1.0, then the single-service mode, otherwise check >0 service output_fields union covers , for example, under the same request, if the confidence is 0.92, and there is =1.0 service, then enter the single-service.

[0075] For example, when the confidence is 0.78, even if there is =1.0 service, it is not executed to prevent misanalysis from causing incorrect calls.

[0076] D123: Finally determine the call mode for subsequent topology construction.

[0077] In another optional embodiment, for the evaluation of service call demand, the evaluation method can also be to judge the single-service or multi-service cooperation mode in combination with the real-time state of the service and the matching score, including the following steps D131-D134: D131: Obtain the current load state and historical average response time of each service in the target service set.

[0078] D132: Preferentially select =1.0 and the service with the lowest load to enter the single-service mode, if not, select the combination with the shortest response time from the >0 services, and the output_fields union of the combination needs to cover .

[0079] D133: If multiple combinations meet the coverage, further compare the total predicted response time to select the optimal combination to construct the multi-service cooperation.

[0080] D134: Record the selected mode and basis for use in constructing the invocation topology in step D2.

[0081] It should be noted that by evaluating the service invocation requirements, it can be automatically determined whether to use single service or multiple services in cooperation, avoiding invocation failure or low efficiency caused by static binding, supporting dynamic combination of distributed services in complex water conservancy business scenarios, and improving the flexibility of data access.

[0082] Further, in step S5, the parallel service invocation is performed through the invocation topology to obtain the return data of each service, including the following steps E1-E3: E1: Based on the invocation topology in the instruction set, initialize the parallel invocation task; E2: In combination with the initialized parallel invocation task, send a request containing standardized invocation parameters to each target service to perform service invocation; E3: In combination with the execution result of the service invocation, set the invocation timeout threshold, and collect the return data of each service.

[0083] In the embodiment of the present application, in step E2, the execution mode for service invocation is to send standardized parameters through parallel HTTP requests to initiate service invocation, including the following steps E211-E213: E211: According to the target service list in the invocation topology (multi-service invocation cooperation mode), construct the JSON request body of each service, and the parameter value has been standardized.

[0084] E212: Then, simultaneously initiate HTTP invocation to all target services, and the request body strictly conforms to the input_schema of each service.

[0085] For example, the user requests "Check the flood water level in the middle reaches of the Yangtze River in the next 72 hours", if it is multi-service cooperation, the system simultaneously sends requests to the flood_forecast and river_flow services, and the two invocations are executed concurrently.

[0086] E213: Each HTTP invocation is set to timeout for 3000ms, and after timeout, it is marked as failed and continues to wait for the return of other services.

[0087] In an optional embodiment, the execution mode for service invocation can also be to send requests one by one through synchronous sequential invocation to obtain return data, including the following steps E221-E223: E221: According to the invocation topology order, construct the JSON request body of each service in turn, and the parameters have been standardized.

[0088] E222: Then, send HTTP requests one by one, and initiate the next invocation only after the previous service returns, for example.

[0089] For example, under the same request, the system waits for the flood forecast service to return first, and then initiates a river flow query, ensuring the data dependency order.

[0090] E223: After all services complete the call in turn, the returned data is summarized, and the collection phase is entered.

[0091] In another optional embodiment, the execution mode for service call execution can also be event-driven initiation of call through asynchronous callback mechanism, including the following steps E231-E234: E231: Register a callback function for each target service, and construct a standardized JSON request body.

[0092] E232: Then, all asynchronous HTTP requests are submitted at the same time, and the system does not block and wait.

[0093] E233: Trigger the corresponding callback when the service returns, and collect the data.

[0094] E234: After all callbacks are completed or timeout, the returned data is summarized, and the services that do not respond are marked.

[0095] It should be noted that by executing the service call, the user natural language intent can be converted into actual data acquisition, supporting single-service or multi-service parallel operation, avoiding call interruption caused by traditional path binding, and improving the response speed of water conservancy data access.

[0096] Further, in step S6, based on the returned data, the field alignment and data aggregation are performed in combination with the user output requirement, a structured response result is generated and output, including the following steps F1-F5: F1: Based on the output field requirement in the first intent model, the effective fields in the returned data of each service are filtered; F2: Through the effective fields, direct field extraction is performed on the returned data of a single service, and field alignment operation is performed on the returned data of multiple services, to generate an aligned field data set; F3: Based on the aligned field data set, the field data is merged by using the preset aggregation rule, to generate a structured response result; F4: Through the structured response result, the call chain meta information is attached, including the service identification list and the request tracking identification, to generate a complete response data packet; F5: Based on the complete response data packet, the structured response result is returned to the user through a unified entrance.

[0097] In the embodiments of the present application, in step F2, the processing mode for field alignment and extraction is to perform single-service field extraction or multi-service field alignment based on user output requirements, apply derivation rules to generate a field dataset, including the following steps F211-F213: F211: Check the call topology to determine whether it is a single-service or multi-service mode. If it is a single-service, directly extract the fields in the returned data that match the output field requirements.

[0098] F212: Then, if it is a multi-service mode, traverse the returned data of each service, align the fields according to the output field requirements, and apply derivation rules if necessary.

[0099] F213: Generate an aligned field dataset containing all valid fields for subsequent aggregation.

[0100] In an optional embodiment, the processing mode for field alignment and extraction can also be to perform alignment and extraction based on field priority ordering, giving priority to high-priority fields, including the following steps F221-F223: F221: Assign priorities to fields according to output field requirements.

[0101] F222: Then, for a single-service, directly extract high-priority fields, and for a multi-service mode, align the fields according to priorities. If a field needs to be derived, preferentially use the data of high-priority services.

[0102] F223: Generate a field dataset, retaining the highest-priority valid fields.

[0103] In another optional embodiment, the processing mode for field alignment and extraction can also be to dynamically adjust alignment rules based on service real-time status to generate a field dataset, including the following steps F231-F234: F231: Check the real-time status of the returned data of each service, such as response time or data integrity.

[0104] F232: Extract fields according to the status of the optimal service, preferentially using services with fast response or complete data.

[0105] F233: Then, for a multi-service mode, dynamically adjust the alignment rules. If a field needs to be derived, preferentially use the data of the best-status service.

[0106] F234: Generate an aligned field dataset to ensure data reliability and consistency.

[0107] It should be noted that through field alignment and data aggregation, the return data of scattered services can be integrated into a unified structured result, meeting the needs of user natural language requests, avoiding data loss caused by traditional static routing, and improving the completeness and practicality of water conservancy data access.

[0108] Embodiment 3, refer to Figure 1 The third embodiment of the present application is different from the first two embodiments in that: a water conservancy micro-service control plane and AI semantic routing water conservancy data intelligent access method further comprises, for the technical effect adopted in the method, the embodiment compares the test results by scientific demonstration means to verify the real effect of the method.

[0109] A typical water conservancy business scenario is selected for the test: the user needs to query the "future 72-hour flood water level in the middle reaches of the Yangtze River".

[0110] Step 1: When the backend micro-service starts, it actively registers its service capability to the intelligent AI gateway and submits the architectural semantic opportunity, and the registration content includes: capability: service atomic capability name, string type, such as "flood_forecast"; input_schema: input parameter template, format is key-value pair dictionary, value type is limited to {"string", "integer", "float"}; output_fields: service returnable field list, such as ["water_level", "forecast_time"].

[0111] The service must send the information when it is first online or the contract is changed, if any field is missing or the type is illegal, the gateway refuses to register. The service is identified by "capability" rather than "path", which provides basic metadata for AI routing. The traditional gateway is basically based on the request URL path to route, and the present application realizes this capability by inputting natural language statements and AI identifying intelligent routing to the corresponding service.

[0112] In the form of JSON, such as the flood forecast service registration declares to send: { "capability":"flood_forecast", "input_schema":{"region":"string","hours":"int"}, "output_fields":["predicted_level","forecast_time"] }。

[0113] Step 2: Then, the user only needs to send a natural language request to the gateway single entry (such as / ai-query), for example: "Check the flood water level in the middle reaches of the Yangtze River in the next 72 hours". The gateway does not rely on any preset path (such as / flood / forecast), all requests are entered through this entry and processed by the built-in AI engine.

[0114] Step 3: The gateway will parse the request according to the built-in AI engine and generate a structured call intent.

[0115] The gateway integrates a lightweight natural language processing (NLP) module to parse the request three times: A DistilBERT model fine-tuned on water conservancy domain corpus is used to perform three times of parsing on the request: the construction method is roughly as follows: A domain-specific annotated dataset for capability is constructed for training, which is used for intent recognition and corresponding interface mapping. The semantic input of the user is mapped to the pre-defined interface, and the content of the set is as follows: These are all self-defined, such as flood_forecast corresponding to flood water level.

[0116] Construct named entity recognition for annotating entity parameters such as region, time, and indicators. The entity categories are as follows:

[0117] The entity name is strictly aligned with the input_schema above.

[0118] Then use manual annotation and training, such as asking it: "{region} future {hours} hours flood water level is how much?" etc.

[0119] Intent recognition: output target capability (such as flood_forecast); Parameter extraction: extract location="middle reaches of the Yangtze River", duration=72; Output requirement inference: infer the user's required field predicted_level according to the context.

[0120] The parsing result is a structured call intent object: { Target_capability: "flood_forecast", Params:{region:“Middle Reaches of the Yangtze River”,hours:72}, Required_outputs:[predicted_level] } The structured diagram is represented as follows: For target capabilities (e.g., "flood_forecast"); A dictionary of parameters (e.g., {"region":"Middle Reaches of the Yangtze River","hours":72}); For the fields that the user expects to output (such as ["water_level"]).

[0121] When step 2 is triggered and a request is received, a validity check is performed, and the intent confidence level is determined. If the condition is met, execution can continue; otherwise, an error will be returned.

[0122] Step 4: Traverse the registered services (referring to a comprehensive check or management operation of all registered services in the system) and calculate their relevance to the intent. The degree of matching. The formula is as follows: For the capability of service s, The set of parameter names accepted by service s. Trigger condition: Step 3 successfully outputs the intent. Output: Service list by... Sort in descending order.

[0123] That is, based on the set matching of the previous gateway NLP module, if all the matched semantics are within the range of the set and belong to a certain capability, then it is 1.0.

[0124] Based on the above parameters of the service, the matching degree between the service and the user request is calculated using the Scoreset, and a Scoreset score is generated for service selection.

[0125] Step 5: Determine if multi-service collaboration is required.

[0126] Check if service satisfaction exists. If it exists, mark it as a single-service mode and proceed to step 6; if it does not exist, but multiple services exist... The service, and its output field union covers Then it enters a multi-service collaboration mode and automatically builds parallel calls.

[0127] Step 6: The gateway dynamically generates the call parameters and executes the service call.

[0128] For each target service, standardize the natural language parameter value (e.g., "Yangtze Middle" -> "Yangtze_Middle"); construct a JSON request body conforming to its input_schema; initiate an HTTP call in parallel, with a timeout of 3000 ms.

[0129] Step 7: The gateway aggregates the responses and generates a unified result.

[0130] Collect all service return data, align and merge by field. The aggregation rules are as follows: If the field comes from a single service, it is directly cancelled; if the semantic recognition comes from multiple, the corresponding capability mapping interface is requested in turn, and the final output structured JSON result is aggregated.

[0131] Step 8: Return the result and record the call chain meta information, return the result to the caller through the original request channel, the response body contains: result: aggregated data; services_used: actual service ID list called; request_id: unique tracking ID. The key management service performs post-audit authentication (non-blocking) on this call to ensure the legality of the call.

[0132] The end user only needs to interact once to get the result, and there is no manual routing configuration, no path binding, and no service orchestration intervention throughout the process.

[0133] Embodiment 4, which is different from the first three embodiments, is a water conservancy data intelligent access system of a water conservancy micro-service control plane and AI semantic routing, comprising a request acquisition module for acquiring a natural language request submitted by a user through a unified entrance and constructing an initial request object based on permission authentication; an intent analysis module for generating a first intent model through the initial request object in combination with a domain-specific semantic analysis model; a service matching module for calculating a service matching matrix through the first intent model based on a capability description set of registered services to determine a target service set; a call topology construction module for constructing a preset service call topology in combination with the target service set and generating standardized call parameters; a service call module for executing parallel service calls through the call topology to obtain return data of each service; and a data aggregation module for aligning fields and aggregating data based on the return data in combination with user output requirements to generate a structured response result and output.

[0134] If the functions are implemented in the form of software function units and sold or used as independent products, they can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application or the parts of the technical solutions that essentially contribute to the prior art or the parts of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.

[0135] The logic and / or steps represented in the flowcharts or otherwise described herein, for example, can be considered as a list of executable instructions for implementing logic functions, which can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus or device, such as a computer-based system, a system including a processor or other system that can fetch the instructions from the instruction execution system, apparatus or device and execute the instructions, or in conjunction with these instructions execution systems, apparatus or devices. For the purpose of this specification, the "computer-readable medium" can be any device that can contain, store, communicate, propagate or transport programs for use by or in connection with an instruction execution system, apparatus or device, or in conjunction with these instruction execution systems, apparatus or devices.

[0136] More specific examples (a non-exhaustive list) of the computer-readable medium include the following: an electrical connection having one or more wires (electrical devices), a portable computer diskette (magnetic devices), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CD ROM). In addition, the computer readable medium can even be paper or other suitable medium on which the program can be printed, because the program can be electronically obtained, for example, by optical scanning of the paper or other medium, followed by editing, interpreting or processing, if necessary, in other suitable ways, to be electronically obtained and then stored in the computer memory.

[0137] It should be understood that portions of the present application can be implemented in hardware, software, firmware, or combinations thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, implementation can be with a combination of any of the following technologies, which are all well known in the art: a discrete logic circuit having logic gates for implementing logic functions on data signals, an application specific integrated circuit having appropriate combinational logic gates, a programmable gate array (PGA), a field programmable gate array (FPGA), and / or the like.

[0138] It should be noted that the above examples are only used to illustrate the technical solutions of the present application but not limit the present application. Although the present application has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present application can be modified or replaced equivalently without departing from the spirit and scope of the present application, and all of them should be covered in the scope of the claims of the present application.

Claims

1. A method for water data intelligent access of water utility microservice control plane with AI semantic routing, characterized in that: Comprising, obtaining a natural language request submitted by a user through a unified portal, and constructing an initial request object based on permission authentication; generating a first intention model through the initial request object in combination with a semantic parsing model; calculating a service matching matrix through the first intention model based on a set of capability descriptions of registered services, and determining a target service set; constructing a calling topology of a preset service in combination with the target service set, and generating standardized calling parameters; executing parallel service calling through the calling topology, and obtaining return data of each service; based on the return data, aligning fields and aggregating data in combination with user output requirements, generating a structured response result and outputting.

2. The method of claim 1, wherein the water data intelligent access of the water industry microservice control plane and the AI semantic routing is characterized in that: obtaining a natural language request submitted by a user through a unified portal, and constructing an initial request object based on permission authentication includes, receiving a natural language request text submitted by a user through a unified portal; verifying the user's access rights to the target data based on the natural language request text, and generating an initial request object.

3. The method of claim 2, wherein the water data intelligent access of the water industry microservice control plane and the AI semantic routing is characterized in that: generating a first intention model through the initial request object in combination with a domain-specific semantic parsing model includes, performing intention recognition through the request text of the initial request object to generate a target capability identifier; based on the target capability identifier, extracting parameter entities in the request text through recognition to generate a standardized parameter dictionary; in combination with the target capability identifier and the parameter dictionary, inferring the user's expected output field set through context semantic analysis to generate a first intention model.

4. The method of claim 3, wherein the water data intelligent access of the water industry microservice control plane and the AI semantic routing is characterized in that: calculating a service matching matrix through the first intention model based on a set of capability descriptions of registered services, and determining a target service set includes, collecting a set of service capability descriptions provided when each service is registered; based on the intention information in the first intention model, evaluating the matching degree of each service and the intention in combination with the set of service capability descriptions, and generating a service matching matrix; based on the service matching matrix, filtering services that meet the preset matching conditions to construct a target service set.

5. The method of claim 4, wherein the water data intelligent access of the water industry microservice control plane and AI semantic routing is characterized by: constructing a calling topology of a preset service in combination with the target service set, and generating standardized calling parameters includes, based on the service matching degree of the target service set, evaluating the service calling demand of a single service or multi-service cooperation; constructing a single service calling topology or a multi-service calling topology through the service calling demand; in combination with the service parameter format requirements in the calling topology, adapting the parameter information in the first intention model to standardized calling parameters; based on the calling topology and the standardized calling parameters, generating an instruction set for service execution.

6. The method of claim 5, wherein the water data intelligent access of the water industry microservice control plane and AI semantic routing is characterized by: executing parallel service calling through the calling topology, and obtaining return data of each service includes, based on the calling topology in the instruction set, initializing a parallel calling task; in combination with the initialized parallel calling task, sending a request containing standardized calling parameters to each target service to execute service calling; in combination with the execution result of the service calling, setting a calling timeout threshold, and collecting return data of each service.

7. The method of claim 6, wherein the water data intelligent access of the water industry microservice control plane and the AI semantic routing is characterized by: based on the return data, aligning fields and aggregating data in combination with user output requirements, generating a structured response result and outputting includes, based on the output field requirements in the first intention model, filtering effective fields in the return data of each service; The effective field is used to perform direct field extraction on single-service return data, field alignment operation is performed on multi-service return data, and an aligned field data set is generated; Based on the aligned field data set, the field data is combined using the preset aggregation rule to generate a structured response result; Through the structured response result, additional call chain meta information is added, including a service identification list and a request tracking identification, to generate a complete response data packet; Based on the complete response data packet, the structured response result is returned to the user through a unified entrance.

8. A system for intelligent access of water data by a water microservice control plane and AI semantic routing, applying a method for intelligent access of water data by a water microservice control plane and AI semantic routing according to any one of claims 1 to 7, characterized in that, It includes: The request acquisition module is configured to acquire a natural language request submitted by a user through a unified entrance and construct an initial request object based on permission authentication; The intent analysis module is configured to generate a first intent model based on the initial request object and a domain-specific semantic analysis model; The service matching module is configured to calculate a service matching matrix based on a capability description set of a registered service and the first intent model, and determine a target service set; The call topology construction module is configured to construct a call topology of a preset service based on the target service set, and generate standardized call parameters; The service calling module is configured to execute parallel service calling based on the call topology, and acquire return data of each service; The data aggregation module is configured to perform field alignment and data aggregation based on the return data and user output requirements, generate a structured response result, and output the structured response result.

9. A computer device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the steps of the method for water conservancy micro-service control plane and AI semantic routing water conservancy data intelligent access according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium having a computer program stored thereon, the computer program being executed by a processor to implement the steps of the method for water conservancy micro-service control plane and AI semantic routing water conservancy data intelligent access according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • An API gateway system and its operation method

    CN114205191B