CN115438323A - A microservice-based enterprise application system integration device and method - Google Patents

A microservice-based enterprise application system integration device and method Download PDF

Info

Publication number
CN115438323A
CN115438323A CN202211084773.3A CN202211084773A CN115438323A CN 115438323 A CN115438323 A CN 115438323A CN 202211084773 A CN202211084773 A CN 202211084773A CN 115438323 A CN115438323 A CN 115438323A
Authority
CN
China
Prior art keywords
user
microservice
information
identity
data warehouse
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211084773.3A
Other languages
Chinese (zh)
Inventor
黄剑平
谢天豪
巩帅
薛涛
付雨
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Normal University
Original Assignee
Hangzhou Normal University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Normal University filed Critical Hangzhou Normal University
Priority to CN202211084773.3A priority Critical patent/CN115438323A/en
Publication of CN115438323A publication Critical patent/CN115438323A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/30Authentication, i.e. establishing the identity or authorisation of security principals
    • G06F21/31User authentication
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24552Database cache management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/283Multi-dimensional databases or data warehouses, e.g. MOLAP or ROLAP
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/30Authentication, i.e. establishing the identity or authorisation of security principals
    • G06F21/45Structures or tools for the administration of authentication

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Computer Hardware Design (AREA)
  • Computational Linguistics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

本发明公开一种基于微服务的企业应用系统整合装置及其方法。通过本发明可以在整合系统过程中,在无需对原系统的用户数据表进行重构或更改的前提下,实现了关联多系统间用户账号的功能,并简化了单用户多账号的整合过程,大大降低了用户信息整合的工作量,同时整合后的系统在微服务的架构下有益于对各个子系统的管理和监控。整个过程可在低代码的情况下快速完成整合,降低整合难度。

Figure 202211084773

The invention discloses a microservice-based enterprise application system integration device and a method thereof. Through the present invention, in the process of system integration, the function of associating user accounts between multiple systems can be realized without reconstructing or changing the user data table of the original system, and the integration process of single user and multiple accounts can be simplified. The workload of user information integration is greatly reduced, and the integrated system is beneficial to the management and monitoring of each subsystem under the microservice architecture. The whole process can be quickly integrated with low code, reducing the difficulty of integration.

Figure 202211084773

Description

一种基于微服务的企业应用系统整合装置及其方法A microservice-based enterprise application system integration device and method

技术领域technical field

本发明属于计算机技术领域,涉及一种基于微服务的企业应用系统整合装置及其方法。The invention belongs to the technical field of computers, and relates to a microservice-based enterprise application system integration device and a method thereof.

背景技术Background technique

很多中小型企业初期建立的一系列的管理系统(例如财务管理系统、OA系统等等)可能是独立开发的,导致这些系统自成体系,容易形成信息孤岛,难以实现信息资源共享,资源浪费严重。后期随着企业发展,将这些系统信息进行共享整合显的尤为必要,由于这些系统相对独立,导致整合过程中信息孤岛的弊端逐渐显现,导致整合困难,并且工作量庞大。而在整合过程中以下两个方面是要解决的难点:A series of management systems (such as financial management systems, OA systems, etc.) established by many small and medium-sized enterprises in the early stage may be developed independently, resulting in these systems being self-contained, easy to form information islands, difficult to achieve information resource sharing, and serious waste of resources . Later, with the development of the enterprise, it is particularly necessary to share and integrate the information of these systems. Since these systems are relatively independent, the disadvantages of information islands gradually appear during the integration process, resulting in difficulties in integration and a huge workload. In the integration process, the following two aspects are the difficulties to be solved:

一是用户信息的整合,因为系统独立开发,于是每个系统都有其单独的用户信息,而整合过程的首要任务就是将所有系统的用户信息筛选合并,而常规用户数据整合可能需要对系统原先用户表结构进行改变,若旧系统中业务逻辑与用户数据存在强耦合关系,会使整合过程变得极其复杂和困难,同时工作量也会变大。The first is the integration of user information. Since the systems are independently developed, each system has its own user information. The first task of the integration process is to filter and merge the user information of all systems, and conventional user data integration may require the original system If the user table structure is changed, if there is a strong coupling relationship between business logic and user data in the old system, the integration process will become extremely complicated and difficult, and the workload will also increase.

二是系统架构问题,由于开发平台和基于硬件体系的不同,存在不同类型的系统体系结构,显然要在已有系统架构的基础上开发出兼容性更强、维护更方便、且健壮的系统架构是及其困难的。The second is the problem of system architecture. Due to the difference between the development platform and the hardware-based system, there are different types of system architectures. Obviously, it is necessary to develop a system architecture with stronger compatibility, more convenient maintenance, and robustness on the basis of the existing system architecture. is extremely difficult.

术语解释:Explanation of terms:

单体应用:传统意义的、单个应用程序的应用,整个应用是在一个web项目中,是一个工程,运行在一个JVM(Java虚拟机)中。Monolithic application: In the traditional sense, the application of a single application. The entire application is in a web project, which is a project and runs in a JVM (Java Virtual Machine).

微服务:微服务架构就是将传统的单体应用,按照业务或公司的自己的规定,拆分成多个服务。每一个服务都是完整的应用,可独立运维部署,也都有自己的业务逻辑。Microservice: The microservice architecture is to split the traditional single application into multiple services according to the business or company's own regulations. Each service is a complete application, which can be independently operated, maintained and deployed, and has its own business logic.

发明内容Contents of the invention

本发明的第一个目的是为了克服上述在整合系统过程中遇到的关键问题,提供一种基于微服务的企业应用系统整合装置,其一是提供用户数据仓库,以实现在旧系统用户数据的整合的同时不改变原系统的用户数据结构,很好的避免了旧系统中若业务逻辑与用户数据存在强耦合关系,这种强耦合会使用户数据整合过程变得极其复杂和困难的问题。其二在需要整合的系统中通过系统整合代码轻侵入方式,改变旧系统架构,可实现将旧系统从单体应用到微服务架构中服务概念的转变,使整合后的系统在微服务的架构下运行。结合二者,相比于在单体架构的基础上进行系统整合,在增加业务功能时,单一应用架构需要在原先架构的代码基础上做比较大的调整,而微服务架构只需要增加新的微服务节点,并调整与之有关联的微服务节点即可。在增加业务响应能力时,单一架构需要进行整体扩容,而微服务架构仅需要扩容响应能力不足的微服务节点。The first purpose of the present invention is to provide a microservice-based enterprise application system integration device in order to overcome the above-mentioned key problems encountered in the process of integrating the system, one of which is to provide a user data warehouse to realize The integration does not change the user data structure of the original system, which well avoids the strong coupling relationship between business logic and user data in the old system. This strong coupling will make the user data integration process extremely complicated and difficult. . Second, in the system that needs to be integrated, through the light intrusion method of system integration code, changing the old system architecture can realize the transformation of the old system from the single application to the service concept in the microservice architecture, so that the integrated system can be integrated in the microservice architecture run. Combining the two, compared to system integration on the basis of a single architecture, when adding business functions, a single application architecture needs to make relatively large adjustments on the basis of the code of the original architecture, while the microservice architecture only needs to add new Microservice nodes, and adjust the associated microservice nodes. When increasing business responsiveness, a single architecture needs to be expanded as a whole, while the microservice architecture only needs to expand the microservice nodes with insufficient responsiveness.

一种基于微服务的企业应用系统整合装置包括:A microservice-based enterprise application system integration device includes:

数据仓库,作为API网关的基础上,包括信息获取单元、用户关联模型单元;Data warehouse, as the basis of API gateway, includes information acquisition unit and user association model unit;

信息获取单元,用于抽取待整合旧系统各用户的身份关键信息,并按照预设规则整合,得到用户基本表;所述每一个用户的身份关键信息包括用户ID、用户名、手机号、邮箱、登录密码;若不存在某身份关键信息,则将用户基本表中该信息设置为空。The information acquisition unit is used to extract the identity key information of each user of the old system to be integrated, and integrate it according to preset rules to obtain a user basic table; the identity key information of each user includes user ID, user name, mobile phone number, email address , login password; if there is no key identity information, set the information in the basic user table to be empty.

用户关联模型单元,用于对用户基本表中所有用户身份关键信息进行优先级降序排列,用户基本表中各身份关键信息Si进行优先级降序排列,1≤i≤I,I表示一个用户的身份关键信息个数,根据优先级依次根据身份关键信息进行如下操作:The user association model unit is used to arrange the priority of all user identity key information in the user basic table in descending order, and the priority of each identity key information S i in the user basic table is arranged in descending order, 1≤i≤I, and I represents a user's According to the number of key identity information, the following operations are performed according to the key identity information according to the priority:

c)若用户基本表中是否存在两个用户账户的身份关键信息Si相同时则认为是同一用户,若不存在则进行步骤b);c) If there are two user accounts whose identity key information S i is the same in the basic user table, they are considered to be the same user, and if they do not exist, proceed to step b);

d)判断当前身份关键信息Si是否为最后一个优先级身份关键信息,若是则认为两个用户账户不是同一用户,若不是则将Si更新为下一个优先级身份关键信息,即i=i+1,重复步骤a)。d) Determine whether the current identity key information S i is the last priority identity key information, if so, consider that the two user accounts are not the same user, if not, update S i to the next priority identity key information, that is, i=i +1, repeat step a).

用户校验单元,用于校验输入用户是否为当前微服务的原用户。The user verification unit is used to verify whether the input user is the original user of the current microservice.

统一登录单元,用于根据用户校验单元传送的用户认证信息进行微服务登录。The unified login unit is used to perform microservice login according to the user authentication information transmitted by the user verification unit.

配置文件单元,用于对待整合传统单体应用新增配置文件,将待整合传统单体应用转成微服务A,包括数据仓库地址,消息总线地址及服务交互地址,以实现使传统单体应用兼具微服务相关组件的功能。The configuration file unit is used to add a new configuration file for the traditional single application to be integrated, and convert the traditional single application to be integrated into a microservice A, including the address of the data warehouse, the address of the message bus and the address of the service interaction, so as to realize the integration of the traditional single application It also has the functions of microservice-related components.

本发明的第二个目的是是提供一种基于微服务的企业应用系统整合方法,包括如下:The second object of the present invention is to provide a microservice-based enterprise application system integration method, including the following:

S1:利用配置文件单元对待整合传统单体应用新增配置文件,将待整合传统单体应用转成微服务A;其中所述配置文件包括数据仓库地址,消息总线地址及服务交互地址;S1: Use the configuration file unit to add a configuration file to the integrated traditional single application, and convert the traditional single application to be integrated into microservice A; the configuration file includes the address of the data warehouse, the address of the message bus and the address of the service interaction;

S2:待整合传统单体应用根据数据仓库地址调用数据仓库;S2: The traditional single application to be integrated calls the data warehouse according to the address of the data warehouse;

S3:用户校验单元根据输入用户N的用户认证信息调用数据仓库;判断数据仓库中用户基本表内是否有匹配当前用户N在微服务A的用户身份关键信息,若有匹配则认为当前用户为微服务A中原用户,则查找与微服务名称一致的用户认证信息相匹配的用户身份关键信息,若没有匹配则认为当前用户N不是微服务A中原用户,则在用户基本表查找当前用户N是否存在其他微服务B,若当前用户N存在其他微服务B则获取当前用户N在微服务B中的所有用户身份关键信息

Figure BDA0003834551470000031
根据
Figure BDA0003834551470000032
在用户关联模型中查找当前用户N在微服务A中的关联用户M;若当前用户N不存在其他微服务B则提醒当前用户进行微服务A新用户注册,同时信息获取单元将新注册信息补充至用户基本表;所述用户认证信息包括用户名、登录密码;S3: The user verification unit invokes the data warehouse according to the user authentication information of the input user N; judges whether there is key information matching the user identity of the current user N in microservice A in the user basic table in the data warehouse, and if there is a match, the current user is considered as For a central user of microservice A, look for the key user identity information that matches the user authentication information with the same microservice name. If there is no match, it is considered that the current user N is not a central user of microservice A, and then check whether the current user N is in the basic user table. There are other microservices B, if there are other microservices B for the current user N, all key user identity information of the current user N in microservice B will be obtained
Figure BDA0003834551470000031
according to
Figure BDA0003834551470000032
Find the associated user M of the current user N in microservice A in the user association model; if there is no other microservice B for the current user N, remind the current user to register a new user of microservice A, and the information acquisition unit will supplement the new registration information To the user basic table; the user authentication information includes user name, login password;

S4:统一登录单元将用户校验单元传送的用户认证信息进行微服务A登录。S4: The unified login unit logs in the microservice A with the user authentication information transmitted by the user verification unit.

作为优选,微服务A以关联用户M登录成功时,数据仓库中Redis缓存记录用户N与关联用户M的关联信息。Preferably, when the microservice A successfully logs in with the associated user M, the Redis cache records the associated information between the user N and the associated user M in the data warehouse.

本发明的第三个目的是一种计算机可读存储介质,其上存储有计算机程序,当所述计算机程序在计算机中执行时,令计算机执行所述的方法。The third object of the present invention is a computer-readable storage medium on which a computer program is stored, and when the computer program is executed in a computer, the computer is caused to execute the method.

本发明的第四个目的是一种计算设备,包括存储器和处理器,所述存储器中存储有可执行代码,所述处理器执行所述可执行代码时,实现所述的方法。The fourth object of the present invention is a computing device, including a memory and a processor, wherein executable code is stored in the memory, and when the processor executes the executable code, the method is realized.

本发明的有益效果如下:The beneficial effects of the present invention are as follows:

通过本发明可以在整合系统过程中,在无需对原系统的用户数据表进行重构或更改的前提下,实现了关联多系统间用户账号的功能,并简化了单用户多账号的整合过程,大大降低了用户信息整合的工作量,同时整合后的系统在微服务的架构下有益于对各个子系统的管理和监控。整个过程可在低代码的情况下快速完成整合,降低整合难度。Through the present invention, in the process of system integration, the function of associating user accounts between multiple systems can be realized without reconstructing or changing the user data table of the original system, and the integration process of single user and multiple accounts can be simplified. The workload of user information integration is greatly reduced, and the integrated system is beneficial to the management and monitoring of each subsystem under the microservice architecture. The whole process can be quickly integrated with low code, reducing the difficulty of integration.

附图说明Description of drawings

图1是本发明整合系统的框架示意图;Fig. 1 is a schematic diagram of the framework of the integrated system of the present invention;

图2是本发明系统整合简要流程图;Fig. 2 is a brief flowchart of system integration of the present invention;

图3是本发明系统整合具体流程图;Fig. 3 is the specific flowchart of system integration of the present invention;

图4是本发明所建立的用户信息映射规则;Fig. 4 is the user information mapping rule established by the present invention;

图5是本发明所建立的关联模型流程图;Fig. 5 is the association model flow chart that the present invention establishes;

图6是本发明所建立的登录流程。Fig. 6 is the login process established by the present invention.

具体实施方式detailed description

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some, not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.

本发明实施例公开的一种基于微服务的小型企业应用系统整合装置,包括数据仓库、企业应用系统整合框架,所述企业应用系统整合框架包括用户校验单元、统一登录单元、配置文件单元。A microservice-based small enterprise application system integration device disclosed in an embodiment of the present invention includes a data warehouse and an enterprise application system integration framework, and the enterprise application system integration framework includes a user verification unit, a unified login unit, and a configuration file unit.

其架构参考微服务架构的模式,整合后的系统架构参见图1,即数据仓库作为整个集成后系统的统一访问入口,打通了各个系统的用户数据,拓展了其作为API网关的功能(如用户统一登录),同时将旧系统通过企业应用系统整合框架的轻侵入式接入使其成为微服务。Its architecture refers to the pattern of micro-service architecture. The integrated system architecture is shown in Figure 1, that is, the data warehouse serves as the unified access entrance of the entire integrated system, opens up the user data of each system, and expands its function as an API gateway (such as user Unified login), and at the same time make the old system a microservice through the light intrusive access of the enterprise application system integration framework.

如图2所示,本发明一种基于微服务的小型企业应用系统整合方法流程示意图,该方法的主要步骤为:首先配置数据仓库,之后在旧系统(即单体应用)中接入企业系统应用整合框架,启动数据仓库,最后启动所有微服务。As shown in Figure 2, a schematic flow chart of a microservice-based small enterprise application system integration method of the present invention, the main steps of the method are: first configure the data warehouse, and then access the enterprise system in the old system (that is, a single application) Apply the integration framework, start the data warehouse, and finally start all microservices.

具体步骤如图3所示,包括以下:The specific steps are shown in Figure 3, including the following:

1.数据仓库配置1. Data warehouse configuration

信息获取单元,用于抽取待整合旧系统各用户的身份关键信息,并按照预设规则整合,配置用户信息的基本表(以下统称基本表),包括用户名、密码、手机号、邮箱、密码加密方式、原系统用户编号、服务名称;若不存在某身份关键信息,则将用户基本表中该信息设置为空。其中用户名和密码作为统一登录的认证信息,手机号和邮箱作为数据仓库中用户关联模型单元所需的字段,加密方式、原系统用户编号以及服务名称作为数据仓库映射原先系统用户数据的映射字段,该用户身份信息基本表即为抽取旧系统用户身份信息的预设规则。The information acquisition unit is used to extract the identity key information of each user of the old system to be integrated, and integrate it according to preset rules, and configure the basic table of user information (hereinafter collectively referred to as the basic table), including user name, password, mobile phone number, email address, password Encryption method, original system user number, and service name; if there is no key identity information, set the information in the user basic table to empty. Among them, the user name and password are used as the authentication information for unified login, the mobile phone number and email address are used as the fields required by the user association model unit in the data warehouse, and the encryption method, original system user number and service name are used as the mapping fields for the data warehouse to map the original system user data. The basic table of user identity information is the preset rule for extracting the user identity information of the old system.

为拓展用户身份关键信息,可用于自定义数据仓库用户关联模型单元。用户关联模型单元,用于对用户基本表中所有用户身份关键信息进行优先级降序排列,用户基本表中各身份关键信息Si进行优先级降序排列,1≤i≤I,I表示一个用户的身份关键信息个数,根据优先级依次根据身份关键信息进行如下操作:In order to expand the key information of user identity, it can be used to customize the user association model unit of the data warehouse. The user association model unit is used to arrange the priority of all user identity key information in the user basic table in descending order, and the priority of each identity key information S i in the user basic table is arranged in descending order, 1≤i≤I, and I represents a user's According to the number of key identity information, the following operations are performed according to the key identity information according to the priority:

a)若用户基本表中是否存在两个用户账户的身份关键信息Si相同时则认为是同一用户,若不存在则进行步骤b);a) If there are two user accounts whose identity key information S i is the same in the basic user table, they are considered to be the same user, and if not, proceed to step b);

b)判断当前身份关键信息Si是否为最后一个优先级身份关键信息,若是则认为两个用户账户不是同一用户,若不是则将Si更新为下一个优先级身份关键信息,即i=i+1,重复步骤a)。b) Determine whether the current identity key information S i is the last priority identity key information, if so, consider that the two user accounts are not the same user, if not, update S i to the next priority identity key information, that is, i=i +1, repeat step a).

例如旧系统用户信息存在身份证号码,则身份证号码可作为个人身份表示,且作为身份标识其优先级大于手机号,此时拓展数据仓库基本表,新增身份证号码字段,并为用户关联模型单元添加以身份证号码为关联条件,相应的抽取预设规则也随之改变。For example, if there is an ID number in the user information of the old system, the ID number can be used as a personal identity representation, and as an identity identifier, its priority is higher than that of the mobile phone number. At this time, expand the basic table of the data warehouse, add an ID number field, and associate it with the user The model unit is added with the ID number as the association condition, and the corresponding extraction preset rules are also changed accordingly.

2.企业应用系统整合框架接入2. Access to enterprise application system integration framework

该框架作为所述装置的一部分,是对Spring Cloud微服务框架的二次封装,包含了服务注册、负载均衡、熔断器、数据监控等,以下为接入步骤:As part of the device, the framework is a secondary encapsulation of the Spring Cloud microservice framework, including service registration, load balancing, fuses, data monitoring, etc. The following are the access steps:

a)配置文件单元修改各微服务相关配置文件,包括数据仓库地址,消息总线地址及服务交互的地址。其目的是使旧系统兼具微服务相关组件的功能。a) The configuration file unit modifies the relevant configuration files of each microservice, including the address of the data warehouse, the address of the message bus and the address of service interaction. Its purpose is to make legacy systems function as microservice-related components as well.

配置文件单元对各微服务配置消息总线和服务交互的参数,采用RestfulAPI或消息机制等通信机制,若各微服务间通信若存在用户需求数据,则须知道当前登录用户所调用目标微服务中对应的账户信息,此时需配置统一的通信参数,其参数为当前登录的账户信息,以实现当前登录用户所在微服务与目标微服务间通信,即数据仓库中会对每一次微服务调用进行拦截,若存在账户信息的参数,则会先从Redis缓存中查找该账户登录时的相关信息,这样一来可以大大提高同一个用户执行多次服务之间调用的效率,同时可更全面的实现服务之间统一用户不同账号下的数据相通。The configuration file unit configures the parameters of message bus and service interaction for each microservice, and adopts communication mechanisms such as RestfulAPI or message mechanism. If there is user demand data in the communication between microservices, it is necessary to know the corresponding In this case, unified communication parameters need to be configured, and the parameters are the account information of the current login, so as to realize the communication between the microservice where the currently logged in user is located and the target microservice, that is, every microservice call will be intercepted in the data warehouse , if there is an account information parameter, it will first look up the relevant information of the account login from the Redis cache, which can greatly improve the efficiency of the same user executing multiple calls between services, and at the same time realize the service more comprehensively The data under different accounts of the unified user is connected.

b)配置基于数据仓库预设规则的用户关联模型,用于提取各个旧系统中的用户身份关键信息,由于不同系统的用户数据表设计不同(例如系统A通过用户名登录,系统B通过手机号作为登录时的用户名登录),框架根据数据仓库所制定的映射规则,抽取其相关内容,提取方式如图4所示。若旧系统原先设计中不存在手机号或邮箱字段,则置为空。在本实施例中,系统A通过用户名进行登录,且原先表结构不存在邮箱字段,系统B通过邮箱作为用户名登录,通过映射规则后对应数据仓库中保存的形式如图4中数据仓库所示,即数据仓库中保存的用户名可以是多种形式(用户名、邮箱、手机号、身份证号等等)。b) Configure a user association model based on the preset rules of the data warehouse, which is used to extract the key information of user identity in each old system. Since the user data tables of different systems are designed differently (for example, system A logs in by user name, and system B uses mobile phone number Log in as the user name when logging in), the framework extracts its relevant content according to the mapping rules formulated by the data warehouse, and the extraction method is shown in Figure 4. If the mobile phone number or email field does not exist in the original design of the old system, it will be set to empty. In this embodiment, system A logs in through the user name, and the original table structure does not have a mailbox field, and system B uses the mailbox as the user name to log in, and after passing the mapping rules, the corresponding data stored in the data warehouse is shown in the data warehouse in Figure 4 It shows that the user name stored in the data warehouse can be in various forms (user name, email address, mobile phone number, ID number, etc.).

c)配置用户身份关键信息的信息获取单元,由于数据仓库作为微服务的服务注册中心,其功能不仅仅是整合用户数据用作统一登录,更是作为整个系统集成完毕之后的服务调度中心,所以具有微服务架构下的相关功能,在本实施案例中,数据仓库提供以RestfulAPI以供调用,其中就包含了接收迁移用户数据的API,即旧系统在接入框架时需调用迁移用户数据的API并将数据以json格式传递至数据仓库。数据仓库在提取到旧系统中的用户数据信息之后通过用户关联模型单元生成相对应的关联表(以下统称关联表),以实现集成系统中的用户数据互通。在本实施例中,用户关联模型运行流程如图5所示,该关联模型是将手机号和邮箱作为用户的身份标识进行关联,若存在同一用户在不同系统下的两个账户使用了不同的手机号和邮箱,虽然这是同一个人使用,但数据仓库还是会将其认为是两个用户的账户。由于基本表中编号1和编号3的手机号相同,则认为其是同一人。在步骤a中提到可新增数据仓库的用户认证字段,例如新增身份证号码,则用户身份关联模型单元支持将身份证号码匹配步骤加入的流程中,而匹配顺序则由重要性占比(为每个匹配步骤设置一个重要性的权重大小,用阿拉伯数字来表示)决定,可自行设置(从小到大,数字越小,权重越大,匹配顺序越先),当前实施例中重要性最高的是手机号,其次是邮箱,最后是用户名(由于部分系统使用手机号或者邮箱作为用户名登录字段,所以应将用户名作为最低优先级匹配)。c) Configure the information acquisition unit for key user identity information. Since the data warehouse is the service registration center of microservices, its function is not only to integrate user data for unified login, but also as a service dispatching center after the integration of the entire system is completed. Therefore, It has relevant functions under the microservice architecture. In this implementation case, the data warehouse provides Restful API for calling, which includes the API for receiving and migrating user data, that is, the old system needs to call the API for migrating user data when accessing the framework And pass the data to the data warehouse in json format. After extracting the user data information in the old system, the data warehouse generates a corresponding association table (hereinafter collectively referred to as the association table) through the user association model unit, so as to realize the intercommunication of user data in the integrated system. In this embodiment, the operation process of the user association model is shown in Figure 5. The association model associates the mobile phone number and email address as the user's identity. If two accounts of the same user in different systems use different Although the mobile phone number and email address are used by the same person, the data warehouse will still consider them as accounts of two users. Since the mobile numbers of No. 1 and No. 3 in the basic table are the same, they are considered to be the same person. In step a, it is mentioned that the user authentication field of the data warehouse can be added, such as adding an ID number, the user identity association model unit supports adding the ID number matching step to the process, and the matching order is determined by the importance ratio (Set an importance weight for each matching step, represented by Arabic numerals) decide, you can set it yourself (from small to large, the smaller the number, the greater the weight, the earlier the matching order), the importance in the current embodiment The highest is the mobile phone number, followed by the email address, and finally the user name (since some systems use the mobile phone number or email address as the login field for the user name, the user name should be matched as the lowest priority).

d)配置用户校验单元和统一登录单元,以降低框架的侵入性,目的为将旧系统原先的登录登出入口重定向至数据仓库中,用于以下所述的自动关联注册,数据仓库作为统一登录功能的提供者,同样提供了登录登出入口,以API形式供框架接入者调用。使用框架提供的登录功能流程如图6所示,依据图6的登录流程,可实现用户数据互通,例用户A使用系统B的账户登录系统C,但前提是用户A在系统B和C下都注册了账号,若数据仓库未找到A用户注册的系统B账号与之关联的系统C账号,则登录失败,没有该用户。但可进行自动关联注册,数据仓库会将系统B账号信息复制到数据仓库基本表中,并将其服务名指向系统C,并建立A用户在系统B与系统C之间的账户关联(此步骤操作可认为A用户在系统B和系统C中使用的同一账户),而此种情况也属于登录成功,数据仓库会将系统B的账户信息传回,之后框架的登录模块会将登录返回重定向到旧系统的注册模块,注册成功之后旧系统会生成用户编号以作为数据仓库中A用户在系统C下的账户的旧系统编号字段。作为可选的,数据仓库将Redis缓存的用户登录及其关联信息删除。d) Configure the user verification unit and the unified login unit to reduce the intrusiveness of the framework. The purpose is to redirect the original login and logout entries of the old system to the data warehouse for the automatic associated registration described below. The data warehouse serves as a unified The provider of the login function also provides the login and logout entry, which is called by the framework accessor in the form of API. Use the login function process provided by the framework as shown in Figure 6. According to the login process in Figure 6, user data interoperability can be realized. For example, user A uses the account of system B to log in to system C, but the premise is that user A is under both systems B and C. After registering an account, if the data warehouse does not find the system C account associated with the system B account registered by user A, the login fails, and there is no such user. However, automatic association registration can be performed. The data warehouse will copy the account information of system B to the basic table of the data warehouse, point its service name to system C, and establish the account association between system B and system C of user A (this step The operation can be regarded as the same account used by user A in system B and system C), and this situation is also a successful login. The data warehouse will return the account information of system B, and then the login module of the framework will redirect the login return Go to the registration module of the old system. After successful registration, the old system will generate a user number as the old system number field of the account of user A under system C in the data warehouse. Optionally, the data warehouse deletes the user login and its associated information cached by Redis.

e)启动数据仓库,将正常启动数据仓库,相关功能将正常运行。各个子系统接入的框架功能都需配合数据仓库才能正常运行。e) Start the data warehouse, the data warehouse will be started normally, and the related functions will run normally. The framework functions connected to each subsystem need to cooperate with the data warehouse to operate normally.

f)启动子服务,集成后的系统将正常运转。f) Start sub-services, and the integrated system will operate normally.

通过以上方案关键步骤的详细描述可以拆分原系统用户的身份认证信息和其他相关信息,将身份认证信息统一管理以便用户数据互通,同时原系统无需重构其用户数据表甚至无需做修改,大大降低了开发者在进行集成过程的工作量,同时整个系统在微服务的架构下更易于信息交互、管理和部署。Through the detailed description of the key steps of the above scheme, the identity authentication information and other related information of the original system users can be split, and the identity authentication information can be managed in a unified way so that user data can be communicated. At the same time, the original system does not need to reconstruct its user data table or even modify it, which greatly improves the user experience. It reduces the workload of developers in the integration process, and at the same time, the whole system is easier to exchange information, manage and deploy under the microservice architecture.

以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以权利要求的保护范围为准。The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person familiar with the technical field can easily think of various equivalents within the technical scope disclosed in the present invention. Modifications or replacements shall all fall within the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims (7)

1.一种基于微服务的企业应用系统整合装置,其特征在于包括:1. A microservice-based enterprise application system integration device, characterized in that it comprises: 数据仓库,包括信息获取单元、用户关联模型单元;Data warehouse, including information acquisition unit and user association model unit; 信息获取单元,用于抽取待整合旧系统各用户的身份关键信息,并按照预设规则整合,得到用户基本表;The information acquisition unit is used to extract the identity key information of each user of the old system to be integrated, and integrate it according to preset rules to obtain the user basic table; 用户关联模型单元,用于对用户基本表中所有用户身份关键信息进行优先级降序排列,用户基本表中各身份关键信息Si进行优先级降序排列,1≤i≤I,I表示一个用户的身份关键信息个数,根据优先级依次根据身份关键信息进行如下操作:The user association model unit is used to arrange the priority of all user identity key information in the user basic table in descending order, and the priority of each identity key information S i in the user basic table is arranged in descending order, 1≤i≤I, and I represents a user's According to the number of key identity information, the following operations are performed according to the key identity information according to the priority: a)若用户基本表中是否存在两个用户账户的身份关键信息Si相同时则认为是同一用户,若不存在则进行步骤b);a) If there are two user accounts whose identity key information S i is the same in the basic user table, they are considered to be the same user, and if not, proceed to step b); b)判断当前身份关键信息Si是否为最后一个优先级身份关键信息,若是则认为两个用户账户不是同一用户,若不是则将Si更新为下一个优先级身份关键信息,即i=i+1,重复步骤a);b) Determine whether the current identity key information S i is the last priority identity key information, if so, consider that the two user accounts are not the same user, if not, update S i to the next priority identity key information, that is, i=i +1, repeat step a); 用户校验单元,用于校验输入用户是否为当前微服务的原用户;The user verification unit is used to verify whether the input user is the original user of the current microservice; 统一登录单元,用于根据用户校验单元传送的用户认证信息进行微服务登录;A unified login unit, used for microservice login according to the user authentication information transmitted by the user verification unit; 配置文件单元,用于对待整合传统单体应用新增配置文件,将待整合传统单体应用转成微服务A,包括数据仓库地址,消息总线地址及服务交互地址,以实现使传统单体应用兼具微服务相关组件的功能。The configuration file unit is used to add a new configuration file for the traditional single application to be integrated, and convert the traditional single application to be integrated into a microservice A, including the address of the data warehouse, the address of the message bus and the address of the service interaction, so as to realize the integration of the traditional single application It also has the functions of microservice-related components. 2.如权利要求1所述装置,其特征在于所述每一个用户的身份关键信息包括用户ID、用户名、手机号、邮箱、登录密码。2. The device according to claim 1, wherein the identity key information of each user includes user ID, user name, mobile phone number, email address, and login password. 3.如权利要求2所述装置,其特征在于若不存在某身份关键信息,则将用户基本表中该信息设置为空。3. The device according to claim 2, wherein if there is no key identity information, the information in the basic user table is set as empty. 4.一种基于微服务的企业应用系统整合方法,其特征在于包括如下步骤:4. A microservice-based enterprise application system integration method, characterized in that it comprises the following steps: S1:利用配置文件单元对待整合传统单体应用新增配置文件,将待整合传统单体应用转成微服务A;其中所述配置文件包括数据仓库地址,消息总线地址及服务交互地址;S1: Use the configuration file unit to add a configuration file to the integrated traditional single application, and convert the traditional single application to be integrated into microservice A; the configuration file includes the address of the data warehouse, the address of the message bus and the address of the service interaction; S2:待整合传统单体应用根据数据仓库地址调用数据仓库;S2: The traditional single application to be integrated calls the data warehouse according to the address of the data warehouse; S3:用户校验单元根据输入用户N的用户认证信息调用数据仓库;判断数据仓库中用户基本表内是否有匹配当前用户N在微服务A的用户身份关键信息,若有匹配则认为当前用户为微服务A中原用户,则查找与微服务名称一致的用户认证信息相匹配的用户身份关键信息,若没有匹配则认为当前用户N不是微服务A中原用户,则在用户基本表查找当前用户N是否存在其他微服务B,若当前用户N存在其他微服务B则获取当前用户N在微服务B中的所有用户身份关键信息
Figure FDA0003834551460000021
根据
Figure FDA0003834551460000022
在用户关联模型中查找当前用户N在微服务A中的关联用户M;若当前用户N不存在其他微服务B则提醒当前用户进行微服务A新用户注册,同时信息获取单元将新注册信息补充至用户基本表;所述用户认证信息包括用户名、登录密码;
S3: The user verification unit invokes the data warehouse according to the user authentication information of the input user N; judges whether there is key information matching the user identity of the current user N in microservice A in the user basic table in the data warehouse, and if there is a match, the current user is considered as For a central user of microservice A, look for the key user identity information that matches the user authentication information with the same microservice name. If there is no match, it is considered that the current user N is not a central user of microservice A, and then check whether the current user N is in the basic user table. There are other microservices B, if there are other microservices B for the current user N, all key user identity information of the current user N in microservice B will be obtained
Figure FDA0003834551460000021
according to
Figure FDA0003834551460000022
Find the associated user M of the current user N in microservice A in the user association model; if there is no other microservice B for the current user N, remind the current user to register a new user of microservice A, and the information acquisition unit will supplement the new registration information To the user basic table; the user authentication information includes user name, login password;
S4:统一登录单元将用户校验单元传送的用户认证信息进行微服务A登录。S4: The unified login unit logs in the microservice A with the user authentication information transmitted by the user verification unit.
5.如权利要求4所述方法,其特征在于微服务A以关联用户M登录成功时,数据仓库中Redis缓存记录用户N与关联用户M的关联信息。5. The method according to claim 4, wherein when the microservice A successfully logs in with the associated user M, the Redis cache records the associated information between the user N and the associated user M in the data warehouse. 6.一种计算机可读存储介质,其上存储有计算机程序,当所述计算机程序在计算机中执行时,令计算机执行权利要求4-5中任一项所述的方法。6. A computer-readable storage medium, on which a computer program is stored, and when the computer program is executed in a computer, it causes the computer to execute the method according to any one of claims 4-5. 7.一种计算设备,包括存储器和处理器,所述存储器中存储有可执行代码,所述处理器执行所述可执行代码时,实现权利要求4-5中任一项所述的方法。7. A computing device, comprising a memory and a processor, wherein executable code is stored in the memory, and when the processor executes the executable code, the method according to any one of claims 4-5 is implemented.
CN202211084773.3A 2022-09-06 2022-09-06 A microservice-based enterprise application system integration device and method Pending CN115438323A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211084773.3A CN115438323A (en) 2022-09-06 2022-09-06 A microservice-based enterprise application system integration device and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211084773.3A CN115438323A (en) 2022-09-06 2022-09-06 A microservice-based enterprise application system integration device and method

Publications (1)

Publication Number Publication Date
CN115438323A true CN115438323A (en) 2022-12-06

Family

ID=84246931

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211084773.3A Pending CN115438323A (en) 2022-09-06 2022-09-06 A microservice-based enterprise application system integration device and method

Country Status (1)

Country Link
CN (1) CN115438323A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117009103A (en) * 2023-07-17 2023-11-07 蝉鸣科技(西安)有限公司 Method for combining multiple service systems and integration system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117009103A (en) * 2023-07-17 2023-11-07 蝉鸣科技(西安)有限公司 Method for combining multiple service systems and integration system

Similar Documents

Publication Publication Date Title
CN111309374B (en) Micro-service system and service calling method in micro-service system
WO2021017279A1 (en) Cluster security management method and apparatus based on kubernetes and network domain, and storage medium
CN109087004B (en) Public workflow engine system based on domain model
CN112214338A (en) Internet of things cloud platform based on flexible deployment of micro-services
CN109542611A (en) Database, that is, service system, database dispatching method, equipment and storage medium
CN106850260A (en) A kind of dispositions method and device of virtual resources management platform
CN110661662B (en) Lightweight microservice configuration method
CN103049684A (en) Data authority control method and data authority control system based on RBAC (role-based access control) model extension
CN111931133B (en) Permission control method based on B/S architecture
CN115438323A (en) A microservice-based enterprise application system integration device and method
CN115086176A (en) System for realizing dynamic issuing of service administration strategy based on spring cloud micro-service technology
CN114780971A (en) Authority management method, authentication method and device
CN114240409A (en) Cross-chain asset interaction method based on improved Hash time lock
US12019647B2 (en) Accessing application services from forms
CN109358842A (en) A kind of service implementing method, electronic equipment and storage medium
CN110674173A (en) Method and system for caching data on wind control cloud
CN115396954A (en) Distributed multi-dimensional current limiting system and method
CN110572430A (en) identity data synchronization system and method based on timing task
CN101043648A (en) Business service switching system
CN115086311B (en) Management system of enterprise cross-system service based on cloud service bus
US20150356117A1 (en) Eventual consistency to resolve subscriber sharing relationships in a distributed system
CN115834198A (en) Design method of user authentication center station based on micro-service architecture
CN114448668B (en) A method and device for implementing cloud platform docking security services
CN115686497A (en) Business development data management method, development engine, electronic device, and storage medium
CN113127907A (en) Permission verification system and method based on application

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination