Interface route configuration method and device, equipment and storage medium

By using an interface routing configuration method based on the Spring-MVC framework, zero-code or low-code interface integration and dynamic route generation are achieved, solving the problems of low efficiency and insufficient security in the process of external system integration, improving development efficiency and data security, and making it suitable for business data routing in fields such as finance, healthcare, and insurance.

CN121940331APending Publication Date: 2026-04-28PING AN HEALTH CLOUD CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
PING AN HEALTH CLOUD CO LTD
Filing Date
2026-01-28
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

In fields such as finance, healthcare, and insurance, existing technologies require extensive code development when interfacing with external systems, resulting in low development efficiency, high maintenance costs, difficulty in rapid integration, and a tendency to make configuration errors. They also fail to meet the rapidly changing business needs of enterprises and lack a unified security control mechanism, posing a risk of data leakage.

Method used

It adopts an interface routing configuration method based on the Spring-MVC framework, and achieves zero-code or low-code interface integration by extending the processing mapper and processing adapter. Combined with dynamic route generation and multi-layer security control mechanism, it automatically identifies and adapts to the protocols and data formats of different external systems, and provides a unified security control mechanism.

Benefits of technology

It significantly improves the development efficiency of interface integration, shortens the delivery cycle, reduces the risk of configuration errors, enhances data security and system stability, and enables rapid response to business changes and adjustments to external systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121940331A_ABST
    Figure CN121940331A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an interface routing configuration method and device, equipment and a storage medium, relates to the technical field of data routing, and can be applied to the fields of finance, medical treatment, insurance and the like. According to the method, in response to an interface docking request, a processing mapper is searched for a target handler through a front-end controller, so that the processing mapper returns a processing execution chain according to a proxy extension processing mapping service. And searching a processing adapter of the target handler based on the processing execution chain, calling the handler controller through the processing adapter to execute the target handler, and outputting a processing execution result returned by the handler controller. According to the method, protocols and data formats of different external systems can be automatically identified and adapted through multiple protocol adaptation services and expansion interfaces built in the spring-MVC framework system, and the development efficiency is improved. And through a multi-level security management and control mechanism, the security risk in the interface docking process is reduced, and the data security and stability are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data routing technology, and in particular to an interface routing configuration method, apparatus, device and storage medium. Background Technology

[0002] In fields such as finance, healthcare, and insurance, business applications are needed to generate, transform, transmit, and store business data. These applications can be developed for specific business scenarios and connect to external system interfaces to achieve data transfer with external systems, thus meeting the usage needs of different users or different business scenarios.

[0003] During the development phase of business applications, if the application needs to interface with external systems, it relies on code development to implement routing configuration, interface configuration, security policy configuration, and port mapping configuration. For example, configuring interfaces with external systems requires writing a significant amount of code to configure the interface's IP address and subnet mask, as well as application access rules to allow or deny specific traffic.

[0004] However, the integration process with external systems requires extensive code development. From requirements analysis to feature implementation and testing, the entire process is time-consuming and fails to meet enterprises' needs for rapid integration. Furthermore, as the number of external systems increases, the complexity of interface configuration also rises. Code development leads to high maintenance costs and is prone to configuration errors or omissions, reducing development efficiency. Summary of the Invention

[0005] In view of this, embodiments of this application provide an interface routing configuration method, apparatus, device, and storage medium, which can be applied to business data routing in fields such as finance, healthcare, and insurance to solve the problem of low efficiency in business application development.

[0006] According to a first aspect of this application, an interface routing configuration method is provided, applied to an application system based on the Spring-MVC framework; the method includes:

[0007] In response to an interface connection request, the front controller searches for the target handler in the processing mapper. The processing mapper is configured to forward the interface connection request according to either the proxy extended processing map service or the request processing map service, with the proxy extended processing map service having a higher priority than the request processing map service. Obtain the processing execution chain returned by the processing mapper, the processing execution chain including the target handler and the processing interceptor chain; Based on the processing execution chain, locate the processing adapter of the target handler; The target handler is executed by calling the handler controller through the processing adapter; the handler controller is configured to register the target handler mapping to the proxy extended processing mapping service, and to perform routing forwarding based on the proxy extended processing mapping service; Output the processing execution result returned by the handler controller, which includes data model and view information.

[0008] According to a second aspect of this application, an interface routing configuration device is provided, applied to an application system based on the Spring-MVC framework; the device includes: The processing lookup module is used to respond to interface connection requests by looking up the target handler in the processing mapper through the front controller; the processing mapper is configured to forward the interface connection request according to the proxy extended processing map service or the request processing map service, and the proxy extended processing map service has a higher priority than the request processing map service. An execution chain module is used to obtain the processing execution chain returned by the processing mapper, wherein the processing execution chain includes a target handler and a processing interceptor chain; The adapter lookup module is used to find the processing adapter of the target handler based on the processing execution chain; The processing execution module is used to call the handler controller through the processing adapter to execute the target handler; the handler controller is configured to register the target handler mapping to the proxy extended processing mapping service, and to perform routing forwarding based on the proxy extended processing mapping service; The result output module is used to output the processing execution result returned by the handler controller, which includes data model and view information.

[0009] According to a third aspect of this application, a computer device is provided, including a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, wherein the processor implements the above-described interface routing configuration method when executing the program.

[0010] According to a fourth aspect of this application, a storage medium is provided on which a computer program is stored, which, when executed by a processor, implements the above-described interface routing configuration method.

[0011] By employing the above technical solutions, embodiments of this application provide an interface routing configuration method, apparatus, device, and storage medium. The method, in response to an interface connection request, searches for a target handler in a processing mapper through a front-end controller, causing the processing mapper to return a processing execution chain according to the proxy extended processing mapping service. Based on the processing execution chain, it then searches for the processing adapter of the target handler, and finally calls the handler controller to execute the target handler through the processing adapter, thereby outputting the processing execution result returned by the handler controller. This method can automatically identify and adapt to the protocols and data formats of different external systems through the various protocol adaptation services and extended interfaces built into the Spring-MVC framework, improving development efficiency. Furthermore, through a multi-layered security control mechanism, it reduces security risks during interface connection, improving data security and stability.

[0012] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description

[0013] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments of this application and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings: Figure 1 This is an overall architecture diagram of the interface routing configuration provided in the embodiments of this application; Figure 2 This is a schematic diagram of the interface routing configuration method provided in the embodiments of this application; Figure 3 This is a schematic diagram of the dynamic route generation process provided in an embodiment of this application; Figure 4 This is a schematic diagram of the request forwarding process provided in an embodiment of this application; Figure 5 This is a schematic diagram of the multi-layered security control mechanism provided in the embodiments of this application; Figure 6 This is a schematic diagram of the interface routing configuration device provided in an embodiment of this application. Detailed Implementation

[0014] The present application will be described in detail below with reference to the accompanying drawings and embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in the embodiments of the present application can be combined with each other.

[0015] In this embodiment, the interface routing configuration method is used to form dynamic routing rules in business areas such as finance, healthcare, and insurance, so as to transmit data between multiple business systems based on the dynamic routing rules. The interface routing configuration method can be applied to a server that functions as a routing system. The server can establish communication connections with multiple business systems. When executing interface routing, it can receive business data input from one business system and forward the business data to another business system according to specific business needs. For ease of description, in this embodiment, the business system that inputs the business data is referred to as the source system, and the business system that receives the business data is referred to as the external system.

[0016] Both the source system and the external system can run business applications to generate, transform, transmit, and store business data. When the source system needs to access business data from an external system, it can send a data access request to the server. The server can then forward the request to the external system based on the external system information specified in the request. Conversely, upon receiving the data access request, the external system can send the requested business data back to the server, which then forwards the data back to the source system, thus enabling the data access from the external system.

[0017] For example, in the financial or insurance sector, the source system could be a financial business platform, an insurance business platform, etc., while the external system could be a logistics data system, a data service system, etc. During the loss assessment process, the insurance business platform can refer to the logistics costs provided by the logistics data system to determine the insurance claim amount. At this time, the insurance business platform can send a data retrieval request to the server to obtain the logistics costs. The server can then forward the data retrieval request to the logistics data system according to routing rules, allowing the logistics data system to provide relevant logistics cost information in response to the data retrieval request. The server then forwards the relevant logistics cost information to the insurance business platform, thus realizing interface routing between the insurance business platform and the logistics data system.

[0018] It should be noted that during the interface routing process, the server can identify multiple external systems for a single piece of business data based on specific business needs, and then perform interface routing for those multiple external systems. For example, in the insurance industry, when determining the insurance claim amount, both logistics costs and medical expenses need to be considered. Therefore, data retrieval requests from the insurance business platform can be routed by the server to both the logistics data system and the medical data system simultaneously.

[0019] For the data transfer process between the source system and external systems, interface routing configuration needs to be performed during the development phase, and the routing configuration needs to be updated as the business system is updated to meet the usage needs of different users or different business scenarios.

[0020] For example, during the development phase, if the source system needs to interface with external systems, it can rely on code development to implement routing configuration, interface configuration, security policy configuration, and port mapping configuration.

[0021] Routing configuration can include static routing configuration and dynamic routing configuration. Static routing uses fixed routing rules to enable data transfer between business systems, and is suitable for business scenarios with a fixed network structure and small scale. Dynamic routing configuration, on the other hand, is based on dynamic routing protocols and automatically learns and updates routing information to enable data transfer between business systems. Therefore, dynamic routing configuration is suitable for scenarios with complex and frequently changing network structures.

[0022] Interface configuration is fundamental for connecting to external systems, ensuring that business system interfaces can communicate correctly. This process involves writing significant amounts of code to configure the interface's IP address and subnet mask, as well as application access rules to allow or deny specific traffic.

[0023] Security policy configuration ensures network security by configuring specific data access rules. For example, allow specific traffic, such as IPSec tunnel traffic and TCP traffic, can be permitted through "allow access" rules in application access rules. Conversely, deny access rules can be used to block spoofed traffic, traffic originating from broadcasts, local loopbacks, and traffic originating from private addresses.

[0024] The integration process with external systems requires extensive code development, from requirements analysis to feature implementation and testing, which is time-consuming and fails to meet enterprises' needs for rapid integration. Furthermore, as the number of external systems increases, the complexity of interface configuration also rises, leading to high maintenance costs and a higher risk of configuration errors or omissions, thus reducing development efficiency.

[0025] Furthermore, when the external systems being interfaced are adjusted, redevelopment and deployment are required to adjust the interface routes, making it difficult to meet the needs of rapidly changing business requirements. Different external systems may use different protocols or data formats, requiring individual adaptation for each system, increasing development and maintenance workload. In addition, the lack of a unified security control mechanism during interface integration makes the interfaces vulnerable to malicious attacks or data leaks, resulting in insufficient security.

[0026] While some interface management tools or platforms exist, most still require some coding skills and cannot fully achieve rapid configuration with zero or low code. Furthermore, there is significant room for improvement in dynamic route generation, compatibility adaptation, and security management.

[0027] To address the issue of low efficiency in business application development, some embodiments of this application provide an interface routing configuration method. This method can be applied to application systems based on the Spring-MVC framework. The Spring-MVC framework is a lightweight Java-based web development framework used for building web applications.

[0028] like Figure 1 As shown, an application system based on the Spring MVC framework can include core components such as the front controller (DispatcherServlet), handler mapping, controller, and view resolver. The front controller is the core of the Spring MVC framework, responsible for receiving all user requests and distributing them to the appropriate components. The front controller can locate the corresponding handler based on information such as the request's Uniform Resource Locator (URL) and delegate the request to the handler for processing.

[0029] The handler mapper is used to find the corresponding handler based on information such as the request URL. The handler mapper maps the request to a specific handler method, providing the front controller (Dispatcher Servlet) with the execution information of the handler.

[0030] The controller is the implementation part of the business logic. It receives user requests, processes the business logic, and returns model data and view information. The controller can be a Java class, identified by annotations such as "@Controller".

[0031] The view resolver is used to resolve logical view names into concrete view implementations. Based on the view name returned by the controller, the view resolver can find the corresponding view template file, such as JSP or HTML, render it, and finally return the result to the user.

[0032] The method can be based on the application architecture of the Spring-MVC framework. By extending the services of the front controller (DispatchServlet) component, it can maintain the relationship between URL and request handler, and provide the ability to adapt to external systems by providing the Abstract Proxy Servlet interface.

[0033] To enhance the compatibility and scalability of interface routing configurations, the Spring MVC framework supports multiple protocols and interface types, and provides extension interfaces to meet complex business needs. In some embodiments, applications based on the Spring MVC framework can also provide unified interface adaptation, i.e., providing a unified external interface and supporting multiple protocols such as RESTful, WebSocket, and SOAP. Applications based on the Spring MVC framework can also provide extension interfaces to allow users to customize common processing logic such as signature verification, encryption / decryption, and protocol conversion, improving the framework's flexibility and applicability.

[0034] The method can be applied to electronic devices with data processing capabilities. These electronic devices include, but are not limited to, computers, servers, mobile terminals, smart wearable devices, and industrial control machines. For ease of description, this embodiment uses a server as the execution subject of the method. It should be understood that the method can also be applied to other types of execution subjects, which are not illustrated in this embodiment. Figure 2 As shown, the method includes: S101. In response to the interface connection request, the front controller searches for the target handler in the processing mapper.

[0035] When configuring interface routing, the server first obtains an interface connection request. This request can be input by the user or by the source system based on user interaction. The interface connection request may include information about the source system and the target external system, such as the address information of the source system and the target external system. It may also include information for configuring the interface connection method, such as the data type, transmission protocol, transmission format, and transmission bandwidth of the business data transmitted between the source and target external systems.

[0036] After obtaining the interface connection request, the server can use the front controller (Dispatch Servlet) in the application system of the Spring-MVC framework to send a lookup command to the handler mapping to find the handler corresponding to the interface connection request, i.e., the target handler.

[0037] To enable zero-code or low-code routing configuration for connecting to external system interfaces, the processing mapper can be extended to allow it to forward interface connection requests according to the proxy servlet handler mapping service or the request mapping handler mapping service.

[0038] The proxy extension processing mapping service is a predefined extension component used to implement Application Programming Interface (API) gateways or proxy routes to forward specific requests to other services. As a handler mapping service within the Spring-MVC framework, the request processing mapping service can process annotations such as "@Controller" and "@Request Mapping," thereby mapping requests to specific controller methods.

[0039] Since the service proxy extension processing mapping service is an extension component specifically optimized for the interface integration process, its priority can be adjusted during interface routing configuration to prioritize it over the request processing mapping service. For example, by setting a higher priority, the service proxy extension processing mapping service can be placed earlier in the Handler Mapping chain, thus enabling special URL pattern processing, such as handling / proxy / . / gateway / Paths such as...

[0040] In some embodiments, when the front controller looks up the handler in the processing mapper, the server can first receive the interface connection request input from the source system, and then extract the proxy configuration information from the interface connection request. The proxy configuration information includes the external system name and the source system request address context.

[0041] Next, the target service address and proxy controller are determined based on the proxy configuration information, and a routing rule list is configured. The routing rule list includes the source system request relative address and the target system request relative address; the source system request relative address is set based on the source system request address context and the proxy controller; the target system request relative address is set based on the target service address.

[0042] For example, servers can provide configuration files to enable zero-code or low-code routing configuration, allowing users to configure interface routes without writing code. This is achieved by configuring proxy forwarding rules through a YAML-formatted configuration file for proxy configuration.

[0043] The configuration file can include basic information such as "proxy:server:name: dataApi" and "urlPattern: / dataApi", representing the system name and source system request address context. Then, through the target service configuration, the target service address is determined based on "target-domain: ${data-api.server.url}", and the proxy controller is determined based on the proxy implementation class, such as the custom proxy controller class "proxy-class: com.paic.jarvis.analysis.data.DataApiProxyServletController". Next, routing rules are configured. "location:" retrieves the list of routing rules, specifying the source system request relative address using "path: / sleepPad / getSleepPadDate" and the target system request relative address using "target-path: / sleepPad / getSleepPadDate".

[0044] Therefore, for a request flow that uses the front controller to find the target handler in the processing mapper, the server can first obtain the interface configuration request sent by the source system, such as the interface configuration request including the text format "GET ×× / dataApi / sleepPad / getSleepPadDate". At this time, the server can recognize "urlPattern: / dataApi" and extract the actual path: " / sleepPad / getSleepPadDate". Then, it matches the routing rules, that is, when it obtains "path: / sleepPad / getSleepPadDate", it means that the match is successful. Then, it constructs the target URL by concatenating the target-domain and target-path to obtain the target URL result. This allows it to forward the original request's Headers, Parameters, and Body by forwarding the request, and receive the target service response, returning it to the source system.

[0045] After configuring the routing rule list, you can use the front controller (HandlerMapping) to find the target handler according to the routing rule list.

[0046] S102. Obtain the processing execution chain returned by the processing mapper.

[0047] After the front controller finds the target handler from the handler mapper, the handler mapper service can find the corresponding handler based on the request URL. Since the application system of the Spring-MVC framework may include multiple handler mappings, they can be arranged into a chain according to priority, which is the return handler execution chain.

[0048] Therefore, the target handler can be determined by obtaining the processing execution chain returned by the processing mapper. This processing execution chain includes the target handler and a chain of handler interceptors. The target handler represents the processor method used to actually process the request. The handler interceptor chain can be represented as a list, such as a handler interceptor chain that may include interceptors like Handler Interceptor1, Handler Interceptor2, etc.

[0049] Based on the processing execution chain, dynamic route generation is possible, enabling Spring-MVC framework-based applications to dynamically generate interface routes according to user configurations, eliminating the need for redevelopment and deployment. Furthermore, configuration-driven routing can be implemented, dynamically generating corresponding routing rules by reading user configuration information. Figure 3 As shown, in some embodiments, the server can obtain user configuration information based on interface connection requests. This user configuration information includes route configuration parameters for adding route configurations and / or adding interceptors. The server then reads the route configuration parameters from the user configuration information, dynamically generates route rules based on these parameters, and configures the driving route according to the route rules.

[0050] When configuring driver routing according to routing rules, you can set up a proxy extension processing mapping service based on routing configuration parameters to add route configurations and / or processing interceptors within the proxy extension processing mapping service. Then, by setting the association between the target server address of the external system and the handler controller, you can register an optional set of handlers according to the routing rules. Next, add the processing interceptors to the processing execution chain, adjust the priority of the proxy extension processing mapping service, and register the proxy extension processing mapping service to the Spring container.

[0051] For example, the Proxy Servlet Handler Mapping service can be initialized and configured first to integrate this custom handling mapping service into the Spring-MVC framework. To do this, the server can first create a Proxy Servlet Handler Mapping instance as the entry point component of the entire proxy forwarding mechanism.

[0052] Then, add route configurations, configure routing rules for the processor mapper, and define which URL paths should be handled by the proxy mechanism. For example, configure / api / / proxy / The path pattern is used. Then, interceptors are added to the processing mapper. Interceptors can execute custom logic before and after request processing, such as logging, permission verification, and performance monitoring.

[0053] After creating the proxy extension processing mapping service, route registration can be performed. Route registration can include handler registration and controller association. For handler registration, specific handlers can be registered to the Proxy Servlet Handler Mapping according to the route configuration, and each route pattern will be associated with a specific Handler object. When associating controllers, the relationship between URLs and controllers can be established.

[0054] Based on the registered routes, an interceptor chain can be built. This is achieved by adding interceptors to the execution chain. The configured Handler Interceptor is added to the Handler Execution Chain, and when a request matches a route, these interceptors are called sequentially before and after the handler execution.

[0055] Next, by setting the priority, the Proxy Servlet Handler Mapping is given a higher priority than the Request Mapping Handler Mapping in the Spring-MVC processing mapper chain. This ensures that when the processing mapper matches proxy requests, it will preferentially use the Proxy Servlet Handler Mapping service to complete the matching. Then, through Spring container registration, the configured Proxy Servlet Handler Mapping is registered into the Spring container, making it part of the Spring-MVC framework and participating in the request processing flow.

[0056] In some embodiments, a configuration file-driven proxy forwarding mechanism can be used. That is, when configuring interface routing, the configuration file corresponding to the user configuration information can be loaded into the initialization configuration class, and the routing configuration parameters in the user configuration information can be recorded through proxy extension attributes. Then, the mapping relationship between the local path and the target path is maintained based on the proxy extension attributes. Thus, based on the proxy extension attributes, the target path query and request body or response body transformation can be performed by overriding service methods.

[0057] By loading the configuration file into the initialization configuration class and using the proxy extended properties (Proxy ServletProperties) service to record routing configuration information, an Abstract Proxy Servlet is implemented. Then, based on the ProxyServlet Properties, the mapping between local paths and target paths is maintained, and by overriding service methods, target path lookup and request / response body conversion are implemented.

[0058] For example, when configuring a driver-driven proxy forwarding mechanism, the system can first scan predefined locations at startup to identify configuration files containing proxy route configurations. Then, by reading the YAML / Properties format configuration file, it parses the file into structured configuration data. Next, it creates an instance of the Proxy Servlet Properties configuration class, populates the parsed configuration data into the object's properties, and establishes a complete route configuration data structure in memory.

[0059] For the Abstract Proxy Servlet, all routing configurations can be read from the Proxy Servlet Properties, and an efficient path matching data structure can be built in memory, as well as a mapping relationship between local path patterns and complete routing rules can be established.

[0060] During request processing, a target path query can be performed. This involves receiving and parsing the request, matching and searching for the path, and constructing the target URL. During the construction of the target URL, path transformation can be performed based on the original request path. The flags in the target path rules are replaced with actual fields based on the original request path, and then combined with the target domain to form the complete target URL.

[0061] When performing request body or response body transformation, for the request body, the request content can be extracted first by reading the original request input stream and determining the request body format based on Content-Type, such as JSON, form, XML, etc. Then, transformation rules are applied. Based on the original request body (JSON format), the transformation rules configured in the route are combined to process the request body, resulting in a transformed request body with added system identifiers. Finally, format conversion processing is performed to convert XML into a JSON object and unify character encoding.

[0062] For the response body, the target service's HTTP response status code can be obtained to receive the response. Then, the response headers and body are read, and the response content is transformed. During this transformation, the original target service response can be standardized according to configuration to obtain a uniform response. Finally, through exception handling, the target service's error codes are mapped to standard error codes, and error context information is added to unify the error response format.

[0063] As can be seen, an application system based on the spring-MVC framework can implement an Abstract Proxy Servlet, maintain the mapping relationship between the local path and the target path according to the Proxy Servlet Properties, and override the service method to implement target path query and request body or response body conversion.

[0064] S103. Based on the processing execution chain, find the processing adapter of the target handler.

[0065] After obtaining the execution chain returned by the handler mapper, the server can use this chain to find the handler adapter for the target handler and request it to execute. In other words, after obtaining the target handler, it needs to find a handler adapter capable of executing it. Different handlers require different adapters, such as @Controller methods and HTTP Request Handlers.

[0066] For example, the server can use the command "public interface Handler Adapter" to find the interface corresponding to the Handler Adapter. The command "boolean supports(Object handler)" determines whether each Handler Adapter supports the target Handler. When a Handler Adapter supports the target Handler, the handler logic can be actually executed by calling "Model AndView handle(...) throws Exception".

[0067] S104. The target handler is executed by calling the handler controller through the processing adapter.

[0068] After finding the handler adapter for the target handler, the Handler Adapter can call the actual controller method to pass request parameters and execute business logic. Therefore, the target handler can be executed by calling the handler controller through the handler adapter.

[0069] Specifically, the handler controller is configured to register the target handler mapping to the Proxy Servlet Handler Mapping service, and to perform routing forwarding based on the Proxy Servlet Handler Mapping service.

[0070] like Figure 4 As shown, in some embodiments, when the handler controller is invoked by the processing adapter to execute the target handler, the proxy extension processing mapping service can be followed first, and the proxy extension controller can be matched by the address path. Then, the abstract proxy extension service is invoked through the proxy extension controller, whereby the abstract proxy extension service is used to obtain the address path and record the target service address.

[0071] Then, the request body is parsed and converted into a JSON object. Next, based on the inherited abstract proxy extension service, the target handler is executed, whereby the inherited abstract proxy extension service is used to handle the request and response from the target server.

[0072] For example, HTTP request proxy forwarding can forward requests to a target external system and return a response via a proxy mechanism. When performing request proxy forwarding, request matching can be performed first. That is, for the received HTTP request, path matching can be performed using Proxy Servlet Handler Mapping, matching based on the request's URL path. If the path match is successful, a proxy servlet controller is selected as the request handler.

[0073] The service method is then invoked through the Proxy Servlet Controller, calling the service method of its base class, Abstract Proxy Servlet, as the entry point for proxy processing. Information is then extracted from the request's URL path, combined with configuration rules to determine the target server's address, and logged to obtain the target address. Finally, the request body is parsed into a JSON object for subsequent processing and conversion.

[0074] Next, request forwarding and execution are performed, that is, through a custom handler that executes a custom handler method inherited from Abstract ProxyServlet. Then, request encapsulation is performed, wrapping the original request into a request to be sent to the target server. Based on the communication connection between the server and the external system, the request is sent and the response is processed.

[0075] S105. Output the processing execution result returned by the handler controller.

[0076] After the handler controller executes the target handler by calling the adapter, the handler controller can obtain the processing execution result and output the result. The processing execution result includes data model and view information.

[0077] In some embodiments, to output the processing execution result returned by the handler controller, the server can first obtain the processing result of the target handler, and then write the processing result of the target handler into the response information. Then, the proxy extends the controller to assemble the data model and view information in the response information to generate the processing execution result.

[0078] For example, based on the communication connection between the server and the external system, after forwarding the request to the external system, the server can receive the response from the external system, encapsulate and process it accordingly, and return it to Spring. During the return process to Spring, after the proxy processing is completed, control can be returned to the front controller (Dispatcher Servlet), allowing Spring-MVC to continue executing its standard subsequent processing flow.

[0079] Subsequent processing can include response construction, namely model-view assembly and writing the results to the response. During model-view assembly, the processing results can be assembled into Model and View objects using the Proxy Servlet Controller. When writing the results to the response, the processor's processing result can be retrieved and written into the HTTP response to be returned to the origin system.

[0080] As can be seen, the Proxy Servlet Handler Mapping service provides a programmable custom extension through the Abstract Proxy Servlet interface, which is based on the Spring MVC framework. This allows for the implementation of request or response body conversion logic and the instantiation of bean objects.

[0081] By applying the technical solutions of the above embodiments, the interface routing configuration method described in the above embodiments can provide the ability to interface with external systems in a zero-code or low-code manner, significantly improving the development efficiency of external system integration, shortening the delivery cycle, and enabling unified management and flexible plug-and-play of interfaces. It can be applied to data interface services, routing gateways, interface auditing, and other fields. Through zero-code configuration and dynamic route generation, users can quickly complete interface integration, shortening the development cycle by more than 80%. The method can be based on the Spring-MVC framework application system. By building multiple protocol adaptation modules and extended interfaces within the framework, it can automatically identify and adapt to the protocols and data formats of different external systems, significantly improving development efficiency and compatibility.

[0082] In some embodiments, as a refinement and extension of the specific implementation of the above embodiments, and to fully illustrate the specific implementation process of this embodiment, some embodiments of this application also provide an interface routing configuration method. The difference between this method and the above embodiments is that it can reduce security risks during interface integration through a multi-layered security control mechanism. For example... Figure 5 As shown, the method includes: S201. Query the execution permissions of the target handler; S202. Based on the execution permission, the target handler is executed by calling the handler controller through the processing adapter; S203. Generate routing logs based on the processing results.

[0083] In an application system based on the Spring-MVC framework, a unified security management mechanism can be implemented, including functions such as interface access control, permission management, and logging, to ensure the security and traceability of interface connections and improve the security and management capabilities of the server.

[0084] Therefore, after locating the processing adapter for the target handler based on the execution chain, the processing adapter can query the target handler's execution permissions based on the server's preset security control mechanisms, including interface access control permissions and routing permissions. Then, based on the execution permissions, the processing adapter calls the handler controller that matches the specified permissions, and obtains the processing execution result by executing the target handler. Finally, routing logs are generated based on the processing execution result.

[0085] By applying the technical solutions of the above embodiments, the interface routing configuration method described in the above embodiments can be based on the unified security management mechanism built into the Spring-MVC framework. It calls the handler controller that matches the execution permission according to the execution permission, and generates routing logs based on the processing execution result obtained by the target handler. Through a multi-layered security management mechanism, the security risks during interface integration are effectively reduced, ensuring data security and system stability.

[0086] In some embodiments, as a specific implementation of the interface routing configuration method described in the above embodiments, some embodiments of this application also provide an interface routing configuration device, such as... Figure 6 As shown, this device is applied to an application system based on the Spring-MVC framework; the device includes: The processing lookup module is used to respond to interface connection requests by looking up the target handler in the processing mapper through the front controller; the processing mapper is configured to forward the interface connection request according to the proxy extended processing map service or the request processing map service, and the proxy extended processing map service has a higher priority than the request processing map service. An execution chain module is used to obtain the processing execution chain returned by the processing mapper, wherein the processing execution chain includes a target handler and a processing interceptor chain; The adapter lookup module is used to find the processing adapter of the target handler based on the processing execution chain; The processing execution module is used to call the handler controller through the processing adapter to execute the target handler; the handler controller is configured to register the target handler mapping to the proxy extended processing mapping service, and to perform routing forwarding based on the proxy extended processing mapping service; The result output module is used to output the processing execution result returned by the handler controller, which includes data model and view information.

[0087] By applying the technical solutions of the above embodiments, the interface routing configuration device described in the above embodiments responds to the interface connection request through the processing lookup module. It searches for the target handler in the processing mapper through the front-end controller, so that the processing mapper returns a processing execution chain according to the proxy extended processing mapping service. After the execution chain module obtains the processing execution chain, it can trigger the adapter lookup module to find the processing adapter of the target handler based on the processing execution chain. Then, the processing execution module calls the handler controller to execute the target handler through the processing adapter, thereby outputting the processing execution result returned by the handler controller through the result output module. The device can automatically identify and adapt to the protocols and data formats of different external systems through the various protocol adaptation services and extended interfaces built into the Spring-MVC framework system, improving development efficiency. Furthermore, through a multi-layered security control mechanism, it reduces security risks during the interface connection process and improves data security and stability.

[0088] It should be noted that other corresponding descriptions of the functional units involved in the interface routing configuration device provided in this application embodiment can be found in the corresponding descriptions in the interface routing configuration method provided in the above embodiments, and will not be repeated here.

[0089] This application also provides a computer device, specifically a personal computer, server, network device, etc. The computer device includes a bus, processor, memory, and communication interface, and may also include input / output interfaces and a display device. The processor of the computer device provides computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database of the computer device stores location information. The network interface of the computer device is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements the steps in the various method embodiments.

[0090] Those skilled in the art will understand that the structure of the computer device described above is only a partial structure related to the solution of this application, and does not constitute a limitation on the computer device to which the solution of this application is applied. A specific computer device may include more or fewer components, or combine certain components, or have different component arrangements.

[0091] In one embodiment, a computer-readable storage medium is also provided, which may be non-volatile or volatile, and a computer program is stored thereon, which, when executed by a processor, implements the steps in the above method embodiments.

[0092] In one embodiment, a computer program product is also provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0093] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0094] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods.

[0095] Any references to memory, database, or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc.

[0096] Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM can take many forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0097] The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchain. The processors involved in the embodiments provided in this application may be, but are not limited to, general-purpose processors, graphics processors, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc.

[0098] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0099] The embodiments described above are merely examples of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these modifications and improvements all fall within the protection scope of this application.

Claims

1. An interface routing configuration method, characterized in that, Applied to application systems based on the Spring-MVC framework; the method includes: In response to an interface connection request, the front controller searches for the target handler in the processing mapper. The processing mapper is configured to forward the interface connection request according to either the proxy extended processing map service or the request processing map service, with the proxy extended processing map service having a higher priority than the request processing map service. Obtain the processing execution chain returned by the processing mapper, the processing execution chain including the target handler and the processing interceptor chain; Based on the processing execution chain, locate the processing adapter of the target handler; The target handler is executed by calling the handler controller through the processing adapter; the handler controller is configured to register the target handler mapping to the proxy extended processing mapping service, and to perform routing forwarding based on the proxy extended processing mapping service; Output the processing execution result returned by the handler controller, which includes data model and view information.

2. The interface routing configuration method according to claim 1, characterized in that, In response to an API connection request, the front controller looks up the handler in the processing mapper, including: Receive interface connection requests from the source system; Extract proxy configuration information from the interface connection request. The proxy configuration information includes the external system name and the source system request address context. The target service address and proxy controller are determined based on the proxy configuration information; Configure a routing rule list, which includes a source system request relative address and a target system request relative address; the source system request relative address is set according to the source system request address context and the proxy controller; the target system request relative address is set according to the target service address; According to the routing rule list, the front-end controller searches for the target handler in the processing mapper.

3. The interface routing configuration method according to claim 2, characterized in that, The method further includes: Obtain user configuration information, which includes route configuration parameters for adding route configuration and / or adding interceptors; Read the routing configuration parameters from the user configuration information; Dynamically generate routing rules based on the routing configuration parameters, and configure driving routes according to the routing rules.

4. The interface routing configuration method according to claim 3, characterized in that, Configure the driver route according to the routing rules, including: Configure the proxy extended processing mapping service based on the routing configuration parameters to add routing configuration and / or processing interceptors in the proxy extended processing mapping service; By setting the association between the target server address of the external system and the handler controller, an optional set of handlers can be registered according to the routing rules; Add the processing interceptor to the processing execution chain; Adjust the priority of the proxy extension processing mapping service, and register the proxy extension processing mapping service to the Spring container.

5. The interface routing configuration method according to claim 4, characterized in that, The method further includes: Load the configuration file corresponding to the user configuration information into the initialization configuration class; The routing configuration parameters in the user configuration information are recorded through the proxy extended attributes; The mapping relationship between the local path and the target path is maintained based on the aforementioned proxy extended attributes; Based on the aforementioned proxy extension attributes, the target path query and request or response body transformation are performed by rewriting the service method.

6. The interface routing configuration method according to claim 1, characterized in that, The execution of the target handler by invoking the handler controller through the processing adapter includes: The proxy extension processing mapping service matches the proxy extension controller based on the address path; The abstract proxy extension service is invoked through the proxy extension controller. The abstract proxy extension service is used to obtain the address path and record the target service address. Parse the request body and convert it into a JSON object; The target handler is executed based on the inherited abstract proxy extension service, which is used to handle the request and response of the target server.

7. The interface routing configuration method according to claim 6, characterized in that, Output the processing execution result returned by the handler controller, including: Obtain the processing result of the target handler; Write the processing result of the target handler into the response information; The proxy extension controller assembles the data model and view information in the response information to generate the processing execution result.

8. An interface routing configuration device, characterized in that, Applied to application systems based on the Spring-MVC framework; the device includes: The processing lookup module is used to respond to interface connection requests by looking up the target handler in the processing mapper through the front controller; the processing mapper is configured to forward the interface connection request according to the proxy extended processing map service or the request processing map service, and the proxy extended processing map service has a higher priority than the request processing map service. An execution chain module is used to obtain the processing execution chain returned by the processing mapper, wherein the processing execution chain includes a target handler and a processing interceptor chain; The adapter lookup module is used to find the processing adapter of the target handler based on the processing execution chain; The processing execution module is used to call the handler controller through the processing adapter to execute the target handler; the handler controller is configured to register the target handler mapping to the proxy extended processing mapping service, and to perform routing forwarding based on the proxy extended processing mapping service; The result output module is used to output the processing execution result returned by the handler controller, which includes data model and view information.

9. A computer device, comprising a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, characterized in that, When the processor executes the computer program, it implements the interface routing configuration method according to any one of claims 1 to 7.

10. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the interface routing configuration method according to any one of claims 1 to 7.