A method and system for implementing multi-vendor interface docking based on Spring AOP
Through Spring AOP technology, implementation classes from different manufacturers are obtained and called, which solves the complexity problem of business switching of Inspur Cloud Platform in a multi-vendor environment, realizes automatic interface selection and code reuse, and reduces business complexity.
Patent Information
- Application Number
- CN202110793714.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-13
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2041-07-13
AI Technical Summary
Inspur cloud platform convergence service product projects are difficult to implement different business and user switching according to different manufacturers in a multi-vendor environment, resulting in high complexity of interface docking and difficulty in achieving automated scheduling.
Using aspect programming technology based on Spring AOP, the vendor type is obtained through user information, the corresponding vendor implementation class is obtained, and the third-party interface is called through the implementation class to realize the function of automatically selecting and calling different third-party vendor interfaces.
It realizes automatic scheduling of different manufacturer types, improves code reuse capabilities, reduces business complexity, and solves the problem of business switching in a multi-vendor environment.
Smart Images

Figure CN113504899B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of spring framework, in particular to a method and system for implementing Spring AOP-based docking of multi-vendor interfaces. Background Art
[0002] Inspur Cloud Service Platform provides excellent integration and embedded capabilities, integrates service products from multiple manufacturers, and can support rapid cloud migration. Based on this demand, a set of integrated framework technologies for accessing manufacturers needs to be implemented.
[0003] Therefore, this paper designs and develops an AOP aspect programming technology based on the Spring framework to implement a method and system for connecting a fusion service product to multiple vendor interfaces. Summary of the invention
[0004] In view of the needs and shortcomings of current technological development, the present invention provides an implementation method and system for docking multi-vendor interfaces based on Spring AOP, so as to solve the problem of implementing different services and users according to different vendors and switching in a multi-vendor environment when the Inspur cloud platform integrated service product project is docked with multiple cooperative vendors.
[0005] First, the present invention provides an implementation method for connecting to multiple vendor interfaces based on Spring AOP. The technical solution adopted to solve the above technical problems is as follows:
[0006] A method for implementing multi-vendor interfaces based on Spring AOP, the implementation process of which includes the following steps:
[0007] S1. The user purchases a fusion service product and obtains the manufacturer type and corresponding manufacturer implementation class of the fusion service product, and binds the user and the information obtained;
[0008] S2. Under the premise of knowing the user information, obtain the manufacturer type of the fusion service product purchased by the user through the AOP aspect programming capability of Spring;
[0009] S3. Based on the vendor type of the integrated service product, further obtain the corresponding vendor implementation class;
[0010] S4. Call the corresponding third-party manufacturer interface through the manufacturer implementation class, so as to realize the function of the integrated service product automatically selecting to call different third-party manufacturer interfaces according to different manufacturer types matched with different users.
[0011] Optionally, after the user purchases the integrated service product, the manufacturer type and the corresponding manufacturer implementation class of the acquired integrated service product are stored in the database.
[0012] Further optionally, based on the fusion service product, the mapping relationship after binding the user information, the manufacturer type and the corresponding manufacturer implementation class is also stored in the database. In this case, the fusion service product can be distinguished by the fields of user information and manufacturer type.
[0013] Optionally, through Spring's AOP aspect programming capability, first add annotations at the business level as the AOP entry point, and then obtain the manufacturer type of the purchased fusion service product based on the user information.
[0014] Secondly, the present invention provides an implementation system for connecting to multiple vendor interfaces based on Spring AOP. The technical solutions adopted to solve the above technical problems are as follows:
[0015] A system for implementing multi-vendor interfaces based on Spring AOP, whose implementation framework includes a binding module, an AOP aspect programming module, a query acquisition module, and a call interface module;
[0016] When a user purchases a fusion service product, the manufacturer type and corresponding manufacturer implementation class of the fusion service product will be obtained. The binding module is used to bind the user and the information obtained;
[0017] The AOP aspect programming module is used to obtain the manufacturer type of the fusion service product purchased by the user based on known user information and transmit it to the query acquisition module;
[0018] The query acquisition module is used to further query and acquire the corresponding manufacturer implementation class according to the manufacturer type, and transmit it to the calling interface module;
[0019] On the premise of knowing the manufacturer type, the calling interface module calls the corresponding third-party manufacturer interface through the manufacturer implementation class, thereby realizing the function of the fusion service product automatically selecting to call different third-party manufacturer interfaces according to the different manufacturer types matched by different users.
[0020] Optionally, after the user purchases the integrated service product, the manufacturer type and the corresponding manufacturer implementation class of the acquired integrated service product are stored in the database.
[0021] Further optionally, based on the fusion service product, the mapping relationship after binding the user information, the manufacturer type and the corresponding manufacturer implementation class is also stored in the database. In this case, the fusion service product can be distinguished by the fields of user information and manufacturer type.
[0022] Optionally, the AOP aspect programming module first adds annotations at the business level as an entry point for AOP, then obtains the manufacturer type of the fusion service product purchased by the user based on the user information, and finally transmits it to the query acquisition module.
[0023] The present invention provides a method and system for implementing Spring AOP-based docking of multi-vendor interfaces, which has the following beneficial effects compared with the prior art:
[0024] (1) The present invention can automatically schedule different types of vendors, realize the integration of multiple third-party cooperative vendors with integrated service products, and solve the problem of implementing different services and users according to different vendors and switching in a multi-vendor environment when the integrated service product project of the Inspur cloud platform is connected to multiple cooperative vendors;
[0025] (2) The present invention can improve code reuse capability and reduce business complexity. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Attached Figure 1 is a flow chart of the method of the present invention;
[0027] Attached Figure 2 It is a module connection diagram of the present invention.
[0028] The information of each reference number in the accompanying drawings indicates:
[0029] 1. Binding module, 2. AOP aspect programming module, 3. Query acquisition module, 4. Calling interface module. DETAILED DESCRIPTION
[0030] In order to make the technical solution, the technical problem solved and the technical effect of the present invention more clearly understood, the technical solution of the present invention is clearly and completely described below in conjunction with specific embodiments.
[0031] Embodiment 1:
[0032] Combined with Figure 1 This embodiment proposes a method for implementing multi-vendor interfaces based on Spring AOP, which mainly solves the problem of implementing different services and users according to different vendors and switching in a multi-vendor environment when the Inspur cloud platform integrated service product project is connected to multiple cooperative vendors.
[0033] The implementation process of this embodiment includes the following steps:
[0034] S1. The user purchases a fusion service product and obtains the manufacturer type and corresponding manufacturer implementation class of the fusion service product, and binds the user and the information obtained.
[0035] After the user purchases the integrated service product, the manufacturer type and the corresponding manufacturer implementation class of the acquired integrated service product are stored in the database.
[0036] Based on the fusion service product, the mapping relationship between the user information, the manufacturer type and the corresponding manufacturer implementation class is also stored in the database. At this time, the fusion service product can be distinguished by the user information and the manufacturer type fields.
[0037] S2. Under the premise of knowing the user information, through the AOP aspect programming capability of Spring, first add annotations at the business level as the entry point of AOP, and then obtain the manufacturer type of the integrated service product purchased by the user based on the user information.
[0038] In this step, the corresponding user information in the parameter is retrieved through the sqlEL expression, and the user information is set to ThreadLocal by querying the corresponding manufacturer type in the database, and provided to ProviderFactory, and then different manufacturers are retrieved in ProviderFactory.
[0039] S3. Based on the vendor type of the integrated service product, further obtain the corresponding vendor implementation class.
[0040] S4. Call the corresponding third-party manufacturer interface through the manufacturer implementation class, so as to realize the function of the integrated service product automatically selecting to call different third-party manufacturer interfaces according to different manufacturer types matched with different users.
[0041] Embodiment 2:
[0042] Combined with Figure 2 This embodiment proposes an implementation system for connecting to multiple vendor interfaces based on Spring AOP, and its implementation framework includes a binding module 1, an AOP aspect programming module 2, a query acquisition module 3, and a calling interface module 4.
[0043] When a user purchases a fusion service product, the manufacturer type and the corresponding manufacturer implementation class of the fusion service product will be obtained. The binding module 1 is used to bind the user and the information obtained.
[0044] The AOP aspect programming module 2 adds annotations at the business level as the entry point of AOP, then obtains the manufacturer type of the integrated service product purchased by the user based on the user information, and finally transmits it to the query acquisition module 3.
[0045] The query acquisition module 3 is used to further query and acquire the corresponding manufacturer implementation class according to the manufacturer type, and transmit it to the calling interface module 4;
[0046] On the premise of knowing the manufacturer type, the calling interface module 4 calls the corresponding third-party manufacturer interface through the manufacturer implementation class, thereby realizing the function of the fusion service product automatically selecting to call different third-party manufacturer interfaces according to different manufacturer types matched by different users.
[0047] In this embodiment, after the user purchases the fusion service product, the manufacturer type and the corresponding manufacturer implementation class of the obtained fusion service product are stored in the database. Based on the fusion service product, the mapping relationship after binding the user information, the manufacturer type and the corresponding manufacturer implementation class is also stored in the database. At this time, the fusion service product can be distinguished by the fields of user information and manufacturer type.
[0048] In summary, the implementation method and system of the Spring AOP-based multi-vendor interface docking of the present invention can automatically schedule different vendor types and realize the integration of fusion service products for multiple third-party cooperative vendors.
[0049] The above specific examples are used to explain the principles and implementation methods of the present invention in detail. These examples are only used to help understand the core technical content of the present invention. Based on the above specific embodiments of the present invention, any improvements and modifications made by technicians in this technical field without departing from the principles of the present invention should fall within the scope of patent protection of the present invention.
Claims
1. A method for implementing multi-vendor interfaces based on Spring AOP, characterized in that ,The implementation process includes the following steps: S1. The user purchases a fusion service product and obtains the manufacturer type and corresponding manufacturer implementation class of the fusion service product, and binds the user and the information obtained; S2. Under the premise of knowing the user information, obtain the manufacturer type of the fusion service product purchased by the user through the AOP aspect programming capability of Spring; S3. Based on the vendor type of the integrated service product, further obtain the corresponding vendor implementation class; S4. Call the corresponding third-party manufacturer interface through the manufacturer implementation class, so as to realize the function of the integrated service product automatically selecting to call different third-party manufacturer interfaces according to different manufacturer types matched with different users.
2. According to claim 1, a method for implementing multi-vendor interface docking based on Spring AOP is characterized in that: After the user purchases the integrated service product, the manufacturer type and the corresponding manufacturer implementation class of the acquired integrated service product are stored in the database.
3. According to claim 2, a method for implementing multi-vendor interface docking based on Spring AOP is characterized in that: Based on the fusion service product, the mapping relationship between the user information, the manufacturer type and the corresponding manufacturer implementation class is also stored in the database. At this time, the fusion service product can be distinguished by the user information and the manufacturer type fields.
4. According to claim 1, a method for implementing Spring AOP-based multi-vendor interface docking is characterized in that: Through Spring's AOP aspect programming capabilities, we first add annotations at the business level as the AOP entry point, and then obtain the manufacturer type of the integrated service product purchased by the user based on the user information.
5. A system for implementing multi-vendor interfaces based on Spring AOP, characterized by ,Its implementation framework includes binding module, AOP aspect programming module, query acquisition module, and calling interface module; When a user purchases a fusion service product, the manufacturer type and the corresponding manufacturer implementation class of the fusion service product will be obtained, and the binding module is used to bind the user and the information obtained; The AOP aspect programming module is used to obtain the manufacturer type of the fusion service product purchased by the user according to the known user information, and transmit it to the query acquisition module; The query acquisition module is used to further query and acquire the corresponding manufacturer implementation class according to the manufacturer type, and transmit it to the calling interface module; On the premise of knowing the manufacturer type, the calling interface module calls the corresponding third-party manufacturer interface through the manufacturer implementation class, thereby realizing the function of the fusion service product automatically selecting to call different third-party manufacturer interfaces according to different manufacturer types matched by different users.
6. According to claim 5, a system for implementing multi-vendor interface docking based on Spring AOP is characterized in that: After the user purchases the integrated service product, the manufacturer type and the corresponding manufacturer implementation class of the acquired integrated service product are stored in the database.
7. According to claim 6, a system for implementing multi-vendor interface docking based on Spring AOP, characterized in that: Based on the fusion service product, the mapping relationship between the user information, the manufacturer type and the corresponding manufacturer implementation class is also stored in the database. At this time, the fusion service product can be distinguished by the user information and the manufacturer type fields.
8. According to claim 5, a system for implementing multi-vendor interface docking based on Spring AOP is characterized in that: The AOP aspect programming module first adds annotations at the business level as the entry point of AOP, then obtains the manufacturer type of the purchased fusion service product based on the user information, and finally transmits it to the query acquisition module.
Citation Information
Patent Citations
Adaptation method, device and equipment for cloud architecture system and storage medium
CN111858101A
Service call chain implementation method based on self-research framework
CN112559212A
