Interface design method applied to enterprise-level middle platform

By combining scenario-based logic writing and Spring injection mechanism based on customer types in the enterprise-level middle office, generic interfaces are defined, which solves the flexibility and scalability problems of traditional interface design methods and achieves flexibility and ease of interfaces. Usability meets the scalability and versatility needs of the middle platform.

CN118568155APending Publication Date: 2024-08-30CHINA CITIC BANK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410507268.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-04-25
Publication Date
2024-08-30

AI Technical Summary

Technical Problem

Traditional interface design methods lack flexibility, scalability, and reusability in enterprise-level middle platforms, resulting in a large number of interfaces that are difficult to maintain and limiting the versatility, scalability, and ease of use of the middle platforms.

Method used

By writing scenario-based service logic based on customer types, we obtain personalized logic methods, use Spring's injection mechanism to inject them into memory, perform class conversion, define generic interfaces to match external service API definition types, and obtain corresponding user types. Personalized logic approach.

Benefits of technology

It achieves interface flexibility and scalability, reduces the number of interfaces, improves development efficiency and maintenance convenience, and meets the versatility and ease of use requirements of the middle platform.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118568155A
    Figure CN118568155A
Patent Text Reader

Abstract

The invention discloses an interface design method applied to an enterprise-level middle station, and relates to the technical field of generic programming, and the method comprises the steps: carrying out scene service logic writing based on a customer type, and obtaining a personalized logic method; injecting an interface under the personalized logic method into a memory for storage through a Spring injection mechanism to obtain a list set; performing class conversion on the personalized logic method to obtain a packaging tool class; a generic interface is defined, when an external service api definition type is introduced, the packaging tool class is called to obtain a personalized logic method of a corresponding user type, and the problems that an existing traditional interface design mode is limited to control branch logic of a server-side code through input parameters in the same service, the number of the interfaces is numerous and jumbled, maintenance is difficult, and the service performance is poor are solved. And the expansibility and the usability are limited, so that the requirements on the universality, the expansibility and the usability of the middle platform are met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of generic programming, and in particular to an interface design method applied to an enterprise-level middle platform. Background Art

[0002] With the continuous development of enterprise-level applications, the demand for interfaces has become more and more complex and high-frequency. Traditional interface design methods often lack flexibility, scalability, and reusability, resulting in low development efficiency and difficult maintenance. Generic programming is a programming paradigm that can handle multiple data types, which can improve the reusability and readability of code. The Spring Framework is a widely used Java enterprise-level application framework that provides many features such as dependency injection, AOP, etc., making it easier for developers to build complex software systems. The strategy pattern is a behavioral design pattern that allows the behavior of an algorithm to be selected as needed at runtime, thereby improving the flexibility and maintainability of the code. The enterprise-level middle platform is a concept of organizational architecture in which the middle platform is regarded as a centralized service layer for providing services across multiple front-end applications, thereby improving service reusability and rapid innovation. However, there are still some problems in the existing technology.

[0003] The existing traditional interface design method is limited to controlling the branch logic of the server code through input parameters in the same service, which leads to a large number of interfaces, difficult maintenance, and technical problems such as limited scalability and ease of use. Ultimately, the requirements for the versatility, scalability and ease of use of the middle platform cannot be met. Summary of the invention

[0004] The present application provides an interface design method for an enterprise-level middle platform, which solves the technical problem that the existing traditional interface design method is limited to the branch logic of the server code in the same service through input parameters, resulting in a large number of interfaces, difficult maintenance, and limited scalability and ease of use, so that the requirements for the versatility, scalability and ease of use of the middle platform are met.

[0005] In view of the above problems, the present application provides an interface design method applied to an enterprise-level middle platform.

[0006] In the first aspect, the present application provides an interface design method applied to an enterprise-level middle platform, the method comprising: writing scenario-based service logic based on customer type to obtain personalized logic methods; injecting the interface under the personalized logic method into memory through Spring's injection mechanism to obtain a list collection; performing class conversion on the personalized logic method in the list collection to obtain an encapsulation tool class; defining a generic interface, and when the external service API definition type is passed in, calling the encapsulation tool class to obtain the personalized logic method of the corresponding user type.

[0007] Furthermore, the customer types include at least individual potential customers, individual customers, corporate potential customers, corporate users, merchants, and custom users.

[0008] Furthermore, the personalized logic method includes scenario-based creation, update, deregistration, jump, and query methods.

[0009] Furthermore, a Map object is created, and the Map object is used to store the personalized logic method and the corresponding Service implementation; the list collection is traversed, and the personalized logic method and the corresponding Service implementation are stored in the Map; and the corresponding Service personalized implementation is obtained through the userType type.

[0010] Furthermore, the generic interface is defined: based on the generic interface, a Service implementation class is created for the personalized logic method, and encapsulated into the encapsulation tool class; based on the external service api definition type, the corresponding personalized logic method is matched in the encapsulation tool class.

[0011] On the second aspect, the present application provides an interface design system applied to an enterprise-level middle platform, and the system includes: a logic method module: write scenario-based service logic based on customer type to obtain personalized logic methods; a memory storage module: inject the interface under the personalized logic method into memory for storage through Spring's injection mechanism to obtain a list collection; an encapsulation tool class module: perform class conversion on the personalized logic method in the list collection to obtain an encapsulation tool class; a generic interface module: define a generic interface, and when the external service api definition type is passed in, call the encapsulation tool class to obtain the personalized logic method of the corresponding user type.

[0012] One or more technical solutions provided in this application have at least the following technical effects or advantages:

[0013] The embodiment of the present application provides an interface design method for an enterprise-level middle platform. Scenario-based service logic is written through customer types to obtain personalized logic methods. Then, the interface under the personalized logic method is injected into the memory for storage through the injection mechanism of Spring to obtain a list collection. The personalized logic method in the list collection is converted into a class to obtain an encapsulation tool class. Finally, a generic interface is defined. When the external service API definition type is passed in, the encapsulation tool class is called to obtain the personalized logic method of the corresponding user type. This solves the technical problem that the existing traditional interface design method is limited to the branch logic of the server code in the same service through the input parameters, resulting in a large number of interfaces, difficult maintenance, and limited extensibility and ease of use. The requirements for the versatility, extensibility and ease of use of the middle platform are met. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] Figure 1 A flowchart of an interface design method for an enterprise-level middle platform is provided for this application;

[0015] Figure 2 A schematic diagram of the structure of an interface design system applied to an enterprise-level middle platform is provided for this application.

[0016] Explanation of the accompanying drawings: logical method module 11, memory storage module 12, encapsulation tool module 13, generalized interface module 14. DETAILED DESCRIPTION

[0017] This application provides an interface design method for enterprise-level middle platform, writes scenario-based service logic through customer types, obtains personalized logic methods, and then injects the interface under the personalized logic method into the memory through Spring's injection mechanism to obtain a list collection, and performs class conversion on the personalized logic method in the list collection to obtain an encapsulation tool class, and finally defines a generic interface. When the external service API definition type is passed in, the encapsulation tool class is called to obtain the personalized logic method of the corresponding user type. It solves the technical problem that the existing traditional interface design method is limited to the branch logic of the server code in the same service through input parameters, resulting in a large number of interfaces, difficult maintenance, and limited extensibility and ease of use, so that the requirements for the generality, extensibility and ease of use of the middle platform are met.

[0018] Embodiment 1

[0019] like Figure 1 As shown, the present application provides an interface design method applied to an enterprise-level middle platform, the method comprising:

[0020] Write scenario-based service logic based on customer types to obtain personalized logic methods;

[0021] Customer types include individual potential customers, individual customers, corporate potential customers, corporate users, merchants, custom users, etc. Scenario-based service logic is written according to customer types to obtain relevant services, that is, a specific service implementation is defined for each customer type. These service implementations are inherited from different subclasses of the same service interface. Each subclass contains logic related to a specific customer type, and the corresponding Service is obtained to write personalized logic methods for creation, update, deregistration, promotion, and query in complex scenarios corresponding to each user type.

[0022] The interface under the personalized logic method is injected into the memory and saved through the Spring injection mechanism to obtain a list collection;

[0023] These services implement the InnerService interface, and all the interface implementations under InnerService are injected into the memory and saved as a list collection through Spring's injection mechanism for subsequent use. That is, the beans corresponding to the personalized logic methods are added to this list using Spring's DI mechanism, which is a list collection. This provides a data basis for subsequent class conversion of the personalized logic methods in the list collection to obtain the encapsulation tool class.

[0024] Performing class conversion on the personalized logic method in the list set to obtain an encapsulation tool class;

[0025] Create a Map object, which is used to store the personalized logic method and the corresponding Service implementation;

[0026] Traverse the list collection and store the personalized logic method and the corresponding Service implementation in Map;

[0027] Get the corresponding personalized Service implementation through the userType type.

[0028] Convert these different service implementation classes into a unified interface or superclass so that they can be managed and called in a unified manner. The encapsulation tool class can provide a method that accepts a parameter and returns an instance of the personalized logic method corresponding to the user type. Convert the InnerService implementation class that saves all personalization into a Map whose key is the Class of each implementation and the value is the actual Service implementation, so as to conveniently obtain the corresponding Service through the Class class. Encapsulate the getInnerUserService method to quickly obtain the corresponding Service personalized implementation through the userType type. Converting the personalized service implementation class into a Map and encapsulating the getInnerUserService method can improve the efficiency and flexibility of the service, while making the code more concise, easy to test and maintain.

[0029] Define a generic interface, and when the external service API definition type is passed in, call the encapsulation tool class to obtain the personalized logic method of the corresponding user type.

[0030] Define the generic interface:

[0031] Create a Service implementation class for the personalized logic method based on the generic interface, and encapsulate it into the encapsulation tool class;

[0032] Based on the external service API definition type, the corresponding personalized logic method is matched in the encapsulation tool class.

[0033] The purpose of defining a generic interface is to provide a common way to handle different types of users. When an external API needs to use a service of a certain customer type, it will pass a parameter to this interface, and then this interface will call the method of the encapsulated tool class created previously to obtain and return an instance of the personalized logic method of the corresponding customer type. Specifically, define a generic interface, for example U create(U usertype), when the input parameter is passed into the external service api definition type, the encapsulated getInnerUserService tool class is called to obtain the specific business method of the corresponding user type Service personalized implementation to complete the business logic processing. By defining a generic interface, personalized business logic expansion for different user types can be achieved, greatly reducing the number of external interfaces.

[0034] Embodiment 2

[0035] Based on the same inventive concept as the interface design method applied to the enterprise-level middle platform in the aforementioned embodiment, Figure 2 As shown, the present application provides an interface design system applied to an enterprise-level middle platform, the system comprising:

[0036] Logical method module 11: the logical method module 11 is used to write scenario-based service logic based on customer type and obtain personalized logical methods;

[0037] Memory saving module 12: The memory saving module 12 is used to inject the interface under the personalized logic method into the memory through the injection mechanism of Spring to obtain a list collection;

[0038] Encapsulation tool class module 13: the encapsulation tool class module 13 is used to perform class conversion on the personalized logic method in the list set to obtain an encapsulation tool class;

[0039] Genericized interface module 14: The genericized interface module 14 is used to define a genericized interface. When the external service API definition type is passed in, the encapsulation tool class is called to obtain the personalized logic method corresponding to the user type.

[0040] Furthermore, the system further comprises:

[0041] The customer types include at least individual potential customers, individual customers, corporate potential customers, corporate users, merchants, and custom users.

[0042] Furthermore, the system further comprises:

[0043] The personalized logic method includes scenario-based creation, update, deregistration, jump, and query methods.

[0044] Furthermore, the system further comprises:

[0045] Create a Map object, which is used to store the personalized logic method and the corresponding Service implementation;

[0046] Traverse the list collection and store the personalized logic method and the corresponding Service implementation in Map;

[0047] Get the corresponding personalized Service implementation through the userType type.

[0048] Furthermore, the system further comprises:

[0049] Define the generic interface:

[0050] Create a Service implementation class for the personalized logic method based on the generic interface, and encapsulate it into the encapsulation tool class;

[0051] Based on the external service API definition type, the corresponding personalized logic method is matched in the encapsulation tool class.

[0052] Through the above-mentioned detailed description of an interface design method applied to an enterprise-level middle platform in this specification, technical personnel in this field can clearly know an interface design system applied to an enterprise-level middle platform in this embodiment. For the system disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.

[0053] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. An interface design method applied to an enterprise-level middle platform, characterized in that: include: Write scenario-based service logic based on customer types to obtain personalized logic methods; The interface under the personalized logic method is injected into the memory and saved through the Spring injection mechanism to obtain a list collection; Performing class conversion on the personalized logic method in the list set to obtain an encapsulation tool class; Define a generic interface, and when the external service API definition type is passed in, call the encapsulation tool class to obtain the personalized logic method of the corresponding user type.

2. The method according to claim 1, characterized in that The customer types include at least individual potential customers, individual customers, corporate potential customers, corporate users, merchants, and custom users.

3. The method according to claim 1, characterized in that The personalized logic method includes scenario-based creation, update, deregistration, jump, and query methods.

4. The method according to claim 1, characterized in that Also includes: Create a Map object, which is used to store the personalized logic method and the corresponding Service implementation; Traverse the list collection and store the personalized logic method and the corresponding Service implementation in Map; Get the corresponding personalized Service implementation through the userType type.

5. The method according to claim 4, characterized in that When the external service API definition type is passed in, the encapsulation tool class is called to obtain the personalized logic method corresponding to the user type, including: Define the generic interface: Create a Service implementation class for the personalized logic method based on the generic interface, and encapsulate it into the encapsulation tool class; Based on the external service API definition type, the corresponding personalized logic method is matched in the encapsulation tool class.

6. An interface design system applied to an enterprise-level middle platform, characterized in that: The system comprises: Logical method module: Write scenario-based service logic based on customer types and obtain personalized logical methods; Memory storage module: inject the interface under the personalized logic method into the memory through the Spring injection mechanism to obtain a list collection; Encapsulation tool class module: performs class conversion on the personalized logic method in the list set to obtain an encapsulation tool class; Generic interface module: defines a generic interface. When the external service API definition type is passed in, the encapsulation tool class is called to obtain the personalized logic method of the corresponding user type.