A Web service publishing plugin for the HEC-HMS model and its installation method

By using the web service publishing plugin of the HEC-HMS model, a loose integration of the HEC-HMS model and the watershed decision management system was achieved, which solved the problems of long interaction chains, performance impact and low scalability in the existing technology, and built a high-performance, highly stable and easily scalable decision system.

CN115495257BActive Publication Date: 2026-03-06QUANZHOU NORMAL UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-05
Publication Date
2026-03-06

AI Technical Summary

Technical Problem

In existing technologies, the integration of the HEC-HMS model with the watershed decision management system suffers from problems such as long interaction chains, performance degradation, poor stability, and low scalability, especially the potential failure during system porting.

Method used

The web service publishing plugin adopting the HEC-HMS model includes a service listening module, a scheduling module, a service processing module, and a client connection request module. It achieves loose integration using the Restlet framework and the Java programming language, and separates the model from the decision-making system through HTTP protocol service request forwarding and resource management.

Benefits of technology

It achieves a high-performance, highly stable, and easily scalable decision-making system, reducing integration difficulty and cycle time, and improving the system's real-time performance and stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115495257B_ABST
    Figure CN115495257B_ABST
Patent Text Reader

Abstract

This invention provides a web service publishing plugin for the HEC-HMS model and its installation method, specifically including: a service listening module: accepting client HTTP protocol service requests and forwarding them to a scheduling module; a scheduling module: extracting the Uniform Resource Identifier (URI) of the client service request and, based on a preset URI and server-side resource submodule mapping dictionary, forwarding the client service request to the corresponding service processing module instance; an HEC-HMS model service module: filtering client service requests and responsible for HEC-HMS model time series editing, model input file editing, model invocation, and simulation result extraction; and a client connection request module: when the HEC-HMS model service module needs to call external resources, the client connection request module is responsible for obtaining the corresponding resources from the outside. Applying this technical solution can avoid the shortcomings of current Jython script integration solutions, building a high-performance, highly stable, and easily scalable decision-making system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of service publishing technology for the HEC-HMS model, and in particular to a web service publishing plugin for the HEC-HMS model and its installation method. Background Technology

[0002] The HEC-HMS model not only provides a detailed depiction of the main hydrological processes in the watershed but also fully reflects the spatial heterogeneity of the underlying surface and driving factors (such as rainfall), making it one of the best digital representations of the watershed. Based on these characteristics and advantages, the HEC-HMS model has been successfully applied in many watersheds around the world with significantly different characteristics. These applications have provided effective decision support for solving problems related to water resource planning, flood forecasting, urbanization impacts, and reservoir design assessment.

[0003] Therefore, when constructing a watershed decision-making management system, integrating the HEC-HMS model can fully leverage its existing decision support capabilities, providing decision support for water resource planning, flood forecasting, urbanization impact assessment, and reservoir design evaluation, thereby significantly reducing the difficulty and cycle of system development. However, when constructing a comprehensive decision-making system driven by the HEC-HMS model, the model typically needs to provide decision support in a silent form (background process). Currently, watershed decision-making management systems mainly integrate the HEC-HMS model through an HEC-HMS model scripting system. This involves developers building a module within the decision-making system to dynamically generate Jython scripts that interact with the HEC-HMS model, and another module that calls these Jython scripts through a system shell script. This approach effectively achieves silent interaction between the system and the model, but the interaction chain is long, involving communication between Shell, Jython, Java, Fortran, and the language used to develop the decision-making system. Its performance is somewhat affected, and dynamically generated shell scripts may fail due to system security restrictions (especially during system porting), thus impacting the real-time performance and stability of decision support. Furthermore, using scripts for invocation means that the integrated decision-making system and the model must be deployed on the same device, reducing the system's scalability. Summary of the Invention

[0004] In view of this, the purpose of this invention is to provide a Web service publishing plugin for the HEC-HMS model and its installation method, so as to avoid the shortcomings of the current integration solution through Jython scripts and build a high-performance, highly stable and easily scalable decision system.

[0005] To achieve the above objectives, the present invention adopts the following technical solution: a Web service publishing plugin for the HEC-HMS model, specifically comprising:

[0006] Service listening module: Accepts HTTP protocol service requests from clients and forwards the client service requests to the scheduling module;

[0007] The scheduling module extracts the Uniform Resource Identifier (URI) of the client service request and, based on the preset URI and the server-side resource submodule mapping dictionary, forwards the client service request to the corresponding service processing module instance.

[0008] HEC-HMS model service module: filters client service requests and is responsible for HEC-HMS model time series editing, model input file editing, model calling, and simulation result extraction;

[0009] Client connection request module: When the HEC-HMS model service module needs to call external resources, the client connection request module is responsible for obtaining the corresponding resources from the outside.

[0010] The order of module calls is as follows: service listening module, scheduling module, service processing module, and client connection request module. Each module decides whether to call the next module based on its business processing logic.

[0011] In a preferred embodiment, the service listening module is created and operates as follows:

[0012] Step S1-1: Create a Restlet Component, which is the main container for the Web service publishing plugin of the HEC-HMS model;

[0013] Step S1-2: Obtain the entry class of the existing service container collection in the Component component to prepare for adding a new service container in the next step;

[0014] Step S1-3: Specify the service listening protocol and port, and add a new Web service container to the existing service container collection through the add method of the entry class of the existing service container collection in the Component component;

[0015] Step S1-4: Start the Component component, which in turn starts all service containers in the existing service container set.

[0016] In a preferred embodiment, the service processing module includes:

[0017] Disassembly / assembly submodule: Decompresses the compressed information carried in the client service request and compresses the response information returned to the client;

[0018] The filtering submodule authenticates client service requests, rejects illegal requests, and returns an error message.

[0019] Routing submodule: Based on the mapping relationship between Uniform Resource Identifier (URI) and HTTP request method and server-side resources and their processing methods, it forwards client service requests to the corresponding server-side resource submodule for processing;

[0020] The server-side resource submodule defines the HEC-HMS model input time series, model input parameter files, model programs, and model input time series as resources, and defines the creation, modification, deletion, query, and operation operations for each resource according to the resource type.

[0021] In a preferred embodiment, the filtering submodule of the HEC-HMS model service module authenticates and filters illegal requests from client requests, and its processing flow is as follows:

[0022] Step S2-1: Extract the username, message body, and authentication digest from the request information;

[0023] Step S2-2: Using the extracted username, retrieve the user's password from local storage;

[0024] Step S2-3: Concatenate the username, password, and transmission information, and perform MD5 encryption to generate an authentication digest;

[0025] Step S2-4: Compare the authentication digest submitted by the client with the authentication digest generated by the filtering submodule. If they match, proceed to step S2-5; otherwise, proceed to step S2-6.

[0026] Step S2-5: Pass the request to the routing submodule for subsequent processing;

[0027] Step S2-6: Return an illegal request message and terminate the business processing flow.

[0028] This invention also provides an installation method for a Web service publishing plugin for the HEC-HMS model. The plugin installation method is as follows: add the plugin dependency library to the HEC-HMS model startup entry Shell script and specify the plugin as the program entry point; the startup entry Shell script is the hec-hms.cmd file on Windows operating systems and the hec-hms.sh file on Linux operating systems.

[0029] Compared with existing technologies, the present invention has the following advantages: First, by using the Web service publishing plugin of the HEC-HMS model, the watershed decision-making system and the HEC-HMS model can be separated and loosely integrated, giving the integrated system better stability and scalability. Second, the Web service publishing plugin of the HEC-HMS model is easy to install, making it easier to implement than traditional integration methods and reducing the difficulty and cycle of integration project development. Finally, by using the Web service publishing plugin of the HEC-HMS model, the integrated system can quickly obtain water resource planning, flood forecasting, urbanization impact, and reservoir design assessment capabilities based on the HEC-HMS model. Attached Figure Description

[0030] Figure 1 This is a schematic diagram of the plug-in structure according to a preferred embodiment of the present invention.

[0031] Figure 2 This is a schematic diagram of the service monitoring module processing flow according to a preferred embodiment of the present invention.

[0032] Figure 3 This is a schematic diagram of the HEC-HMS model service module according to a preferred embodiment of the present invention.

[0033] Figure 4 A schematic diagram of the disassembly and assembly sub-modules of the HEC-HMS model service, which is a preferred embodiment of the present invention.

[0034] Figure 5 This is a schematic diagram of the processing flow of the filtering submodule of the HEC-HMS model service module in a preferred embodiment of the present invention.

[0035] Figure 6 This is a schematic diagram illustrating the relationship between the plug-in and the HEC-HMS model in a preferred embodiment of the present invention. Detailed Implementation

[0036] The present invention will be further described below with reference to the accompanying drawings and embodiments.

[0037] It should be noted that the following detailed descriptions are illustrative and intended to provide further explanation of this application. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains.

[0038] It should be noted that the terminology used herein is for the purpose of describing particular implementations only and is not intended to limit the exemplary implementations according to this application; as used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise; furthermore, it should be understood that when the terms “comprising” and / or “including” are used in this specification, they indicate the presence of features, steps, operations, devices, components and / or combinations thereof.

[0039] like Figure 1 As shown, this embodiment provides a Web service publishing plugin for the HEC-HMS model and its installation method. The plugin includes a service listening module, a scheduling module, a service processing module, and a client connection request module. All modules of the plugin are implemented using the Restlet framework and the Java programming language. Specifically, the service listening module accepts HTTP protocol service requests from clients and forwards them to the scheduling module. The scheduling module, based on the Uniform Resource Identifier (URI) and the mapping relationship between the service and processing modules, forwards the client service requests to the service processing module instance. The service processing module filters client service requests and is responsible for HEC-HMS model time series editing, model input file editing, model invocation, and simulation result extraction. When the service processing module needs to call external resources, the client connection request module is responsible for obtaining the corresponding resources from external sources.

[0040] like Figure 2 As shown, in this embodiment, the creation and operation process of the service listening module is as follows:

[0041] S1-1: Create a Restlet Component, which is the main container for the web service publishing plugin of the HEC-HMS model;

[0042] S1-2: Obtain the entry class of the existing service container collection in the Component component to prepare for adding a new service container in the next step;

[0043] S1-3: Specify the service listening protocol and port, and add a new Web service container to the existing service container collection through the add method of the entry class of the existing service container collection in the Component component;

[0044] S1-4: Start the Component component, which in turn starts all service containers in the existing service container set.

[0045] In this embodiment, the scheduling module of the Web service publishing plugin of the HEC-HMS model forwards client service requests to service processing module instances based on the Uniform Resource Identifier (URI) and service processing module mapping. The service processing module instances are created and managed by the Component component.

[0046] Table 1 describes the mapping relationship between Uniform Resource Identifier (URI) and service processing modules. Mapping relationships numbered 1, 2, 3, and 4 respectively specify the entry paths for all operations on model parameters, operations on model input sequences, model execution, and acquisition of model output sequences. That is, when a client request path starts with the URI specified in Table 1, the request will be forwarded to the corresponding service processing module for processing.

[0047] sheet Uniform Resource Identifier (UNI) and Service Processing Type Mapping Table

[0048]

[0049] In this embodiment, as Figure 3 As shown, the HEC-HMS model service module of the web service publishing plugin for the HEC-HMS model includes:

[0050] Disassembly / assembly submodule: Decompresses the compressed information carried in the client service request and compresses the response information returned to the client;

[0051] The filtering submodule authenticates client service requests, rejects illegal requests, and returns an error message.

[0052] Routing submodule: Based on the mapping relationship between Uniform Resource Identifier (URI) and HTTP request method and server-side resources and their processing methods, it forwards client service requests to the corresponding server-side resource submodule for processing;

[0053] The server-side resource submodule defines the HEC-HMS model input time series, model input parameter files, model programs, and model input time series as resources, and defines the creation, modification, deletion, query, and operation operations for each resource according to the resource type.

[0054] In this embodiment, as Figure 4 As shown, the HEC-HMS model service's assembly / disassembly submodule decompresses client request information to facilitate processing by subsequent modules; it also compresses the returned client response information to reduce network data volume and improve information exchange efficiency.

[0055] In this embodiment, as Figure 5 As shown, the filtering submodule of the HEC-HMS model service module authenticates and filters illegal requests from client requests. Its processing flow is as follows:

[0056] Step S2-1: Extract the username, message body, and authentication digest from the request information;

[0057] Step S2-2: Using the extracted username, retrieve the user's password from local storage;

[0058] Step S2-3: Concatenate the username, password, and transmission information, and perform MD5 encryption to generate an authentication digest;

[0059] Step S2-4: Compare the authentication digest submitted by the client with the authentication digest generated by the filtering submodule. If they match, proceed to step S2-5; otherwise, proceed to step S2-6.

[0060] Step S2-5: Pass the request to the routing submodule for subsequent processing;

[0061] Step S2-6: Return an illegal request message and terminate the business processing flow.

[0062] In this embodiment, the routing submodule of the service processing module forwards client service requests to a server resource submodule instance based on the mapping relationship between the Uniform Resource Identifier (URI), HTTP request method, server resources and their processing methods. The server resource submodule instance is created and managed by the Component component.

[0063] Table 2 describes the mapping relationship between Uniform Resource Identifier (URI), HTTP request method, server-side resource, and its processing method. The Get, Put, Post, and Delete methods are specified for querying, updating, creating (or executing), and deleting resources, respectively.

[0064] Table 2. Mapping between Uniform Resource Identifiers and HTTP Request Methods and Server-Side Resources and Their Processing Methods

[0065]

[0066] In this embodiment, the order of calling modules is as follows: service listening module, scheduling module, service processing module, and client connection request module. Any module can decide whether to call the next module based on the business processing logic.

[0067] This embodiment also provides a method for installing a Web service publishing plugin for the HEC-HMS model, such as... Figure 6 As shown in Figure 1 and List 1, the plugin installation method is as follows: add the plugin dependency library to the HEC-HMS model startup entry shell script and specify the plugin as the program entry point; the startup entry shell script is the hec-hms.cmd file on Windows operating systems and the hec-hms.sh file on Linux operating systems. Besides modifying the HEC-HMS model startup entry shell script to install the plugin, you can also copy the HEC-HMS model startup entry shell script and install the plugin within this backup.

[0068] List 1. Modify the HEC-HMS entry script to implement Web service plugin installation (see underlined section for details)

[0069]

[0070] When the components of a decision-making system are developed in different languages ​​or only support specific platforms, loose integration of these components can be effectively achieved by encapsulating them as web services. Therefore, by encapsulating and integrating the HEC-HMS model as a web service, the shortcomings of current integration solutions using Jython scripts can be avoided, enabling the construction of a high-performance, highly stable, and easily scalable decision-making system.

[0071] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0072] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0073] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0074] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1The steps of the function specified in one or more boxes.

[0075] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any other way. Any person skilled in the art may make changes or modifications to the above-disclosed technical content to create equivalent embodiments. However, any simple modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the protection scope of the present invention.

Claims

1. A Web service publishing plug-in for HEC-HMS model, characterized in that, Specifically comprising: The service listening module: accepts the client HTTP protocol service request, and forwards the client service request to the scheduling module; The scheduling module: extracts the uniform resource identifier URI of the client service request, and according to the preset URI and the service resource submodule mapping dictionary, the client service request is transferred to the corresponding HEC-HMS model service module instance; The HEC-HMS model service module: filter the client service request, and be responsible for HEC-HMS model time series editing, model input file editing, model calling and simulation result extraction; The client connection request module: when the HEC-HMS model service module needs to call external resources, the client connection request module is responsible for obtaining the corresponding resources from the outside; The calling order between the modules is: service listening module, scheduling module, HEC-HMS model service module, client connection request module, any module decides whether to call the next module according to the business processing logic; The service listening module creation and operation process is as follows: step S1-1: create a Restlet Component component, the Component component is the total container of the Web service publishing plug-in of the HEC-HMS model; Step S1-2: get the existing service container set entry class in the Component component, prepare for the next step to add a new service container; Step S1-3: specify the service listening protocol and port, add a new Web service container to the existing service container set through the existing service container set entry class in the Component component; Step S1-4: start the Component component, and start all service containers in the existing service container set; The HEC-HMS model service module comprises: The disassembly submodule: decompress the compressed information carried in the client service request, and compress the response information returned to the client; The filter submodule: authenticates the client service request, discards illegal requests, and returns an error prompt; The routing submodule: according to the mapping relationship between the uniform resource identifier URI and the HTTP request method and the service resource and its processing method, the client service request is transferred to the corresponding service resource submodule for processing; The service resource submodule: the HEC-HMS model input time series, model input parameter file, model program and model input time series definition are defined as resources, and the creation, modification, deletion, query and operation of each resource are defined according to the resource type; The filtering sub-module of the HEC-HMS model service module performs the following process flow for authenticating and filtering illegal requests of a client request: Step S2-1: extracting a username, information body and authentication digest from the request information; Step S2-2: obtaining the password of the user in the local storage by using the extracted username; Step S2-3: concatenating the username, password and transmission information, and performing MD5 encryption to generate an authentication digest; Step S2-4: comparing the authentication digest submitted by the client with the authentication digest generated by the filtering sub-module, if consistent, executing Step S2-5, if inconsistent, executing Step S2-6; Step S2-5: passing the request to the routing sub-module for subsequent processing; Step S2-6: returning a prompt of illegal request and ending the business process flow.

2. A method for installing a web service publishing plug-in of a HEC-HMS model, characterized in that The Web service publishing plug-in of the HEC-HMS model in the above claim 1, the plug-in installation method is: adding plug-in dependent library in HEC-HMS model start entry Shell script, and specifying plug-in as program entry; the start entry Shell script is hec-hms.cmd file on Windows series operating system, and is hec-hms.sh file on Linux operating system.

Citation Information

Patent Citations

  • Method of constructing REST (representational state transfer) styled ontology annotation visualization system

    CN104462460A

  • Real-time online flood forecasting method based on HEC-HMS model

    CN110555069A