WO2024067155A1 - 通过编排方式解决微服务外部依赖复杂性的系统及方法 - Google Patents

通过编排方式解决微服务外部依赖复杂性的系统及方法 Download PDF

Info

Publication number
WO2024067155A1
WO2024067155A1 PCT/CN2023/119010 CN2023119010W WO2024067155A1 WO 2024067155 A1 WO2024067155 A1 WO 2024067155A1 CN 2023119010 W CN2023119010 W CN 2023119010W WO 2024067155 A1 WO2024067155 A1 WO 2024067155A1
Authority
WO
WIPO (PCT)
Prior art keywords
flow
api
library
information
orchestration
Prior art date
Application number
PCT/CN2023/119010
Other languages
English (en)
French (fr)
Inventor
王斌
杨戉
盛振明
夏建明
颜凤辉
刘毅
Original Assignee
中电信数智科技有限公司
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 中电信数智科技有限公司 filed Critical 中电信数智科技有限公司
Publication of WO2024067155A1 publication Critical patent/WO2024067155A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/20Software design
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/73Program documentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading

Definitions

  • the present invention relates to the field of microservice technology, and in particular to a system and method for solving the complexity of external dependencies of microservices through orchestration.
  • microservices rely on many external services, and these external services have multiple options.
  • the configuration center can select Etcd, Zookeeper, Spring Cloud Config, Apollo, Nacos, and the message queue can select RabbitMQ, Kafka, etc.
  • microservices actually become a large monomer. All external dependencies and core businesses need to be compiled together, and the required choices need to be recorded in the configuration file. This will cause the executable file to continue to grow and the memory occupied during runtime to continue to increase.
  • all microservices need to be recompiled.
  • the present invention provides a system and method for solving the complexity of external dependencies of microservices through orchestration, and solves the complexity of external dependencies of microservices through orchestration.
  • a system for solving the complexity of external dependencies of microservices through orchestration comprising: an information repository, a low-code front-end editor, a flow file, an orchestration framework, and an independent dynamic library.
  • the low-code front-end editor, flow file, and independent dynamic library are all connected to the information repository, and the flow file is also respectively connected to the low-code front-end editor and the orchestration framework, and the orchestration framework is also connected to the independent dynamic library.
  • the programmable framework includes: a launcher, an API/flow library, and a core API, and the launcher is connected to the core API and the API/flow library respectively.
  • the launcher is connected to the independent dynamic library and the flow file respectively.
  • the core API includes: startMain, loadLibrary, loadFlow, runApi, and runFlow.
  • the startMain is used to read the main flow in the flow file, and call related functions in the API/flow library according to the arrangement of the main flow;
  • the loadLibrary is used to read the required dynamic library and flow in the independent dynamic library, and store the API information in the dynamic library into the API/flow library;
  • the loadFlow is used to read the required flow file and store the flow function into the API/flow library;
  • the runApi is used to execute the external API; and the runFlow is used to execute the flow.
  • the present invention also provides a working method of the system for solving the complexity of microservice external dependencies by orchestration.
  • the specific steps include:
  • Step S1 Orchestrate flow through the low-code front-end editor
  • Step S2 Start the choreographic framework, load the main flow in the flow file, and continue to load other flows in the independent dynamic library and flow file according to the arrangement of the main flow;
  • Step S3 Execute the external API or flow through the core business code in the independent dynamic library.
  • step S1 includes the following sub-steps:
  • Step S1.1 compile an independent dynamic library and provide an API interface
  • Step S1.2 fill the API information into the information database
  • Step S1.3 the low-code front-end editor reads the API information from the information library to facilitate dragging and editing;
  • Step S1.4 create a flow file through the low-code front-end editor
  • Step S1.5 the low-code front-end editor writes the orchestration into the flow file according to the editing results
  • Step S1.6 the low-code front-end editor fills the information written into the orchestrated flow file into the information library.
  • step S2 includes the following sub-steps:
  • Step S2.1 the caller starts the orchestration framework and passes the main flow path in the flow file to the launcher;
  • Step S2.2 the launcher loads the main flow and performs parsing
  • Step S2.3 According to the definition of the main flow, call loadLibrary, pass in the list of dynamic libraries to be loaded, load the required dynamic libraries, obtain the API information therein, and store the API information in the API/flow library;
  • Step S2.4 According to the definition of the main flow, call loadFlow, pass in the list of flow files to be loaded, load the required flow files, and store the flow information in the API/flow library;
  • Step S2.5 According to the definition of the main flow, call runAPI or runFlow to call the business logic.
  • step S3 when the core business code executes the external API, the specific process is as follows:
  • step S3 when the core business code executes the flow, the specific process is as follows:
  • the present invention has the following beneficial effects: the present invention further splits the monomers in the microservice into API and flow, thereby decoupling the core business and external dependencies; at the same time, the API is orchestrated through a low-code front-end editor to generate flow, so that external dependencies can be flexibly selected without changing the core business logic. Unnecessary external dependencies do not need to be compiled into the microservice image, thereby saving storage and memory space.
  • Figure 1 is a framework diagram of an existing single microservice to solve complex external dependencies
  • FIG2 is a framework diagram of a system for solving the complexity of external dependencies of microservices through orchestration in the present invention
  • FIG3 is a flow chart of arranging flows through a low-code front-end editor in the present invention.
  • FIG4 is a flow chart of the startup of the programmable framework in the present invention.
  • Figure 5 is a schematic diagram of loading different message queue dynamic libraries on demand in the main flow and executing the corresponding API in the dynamic library;
  • Figure 6 is a schematic diagram of the core business logic that depends on the main flow.
  • the framework diagram of the system of the present invention that solves the complexity of external dependencies of microservices through orchestration
  • the system includes: information library, low-code front-end editor, flow file, orchestration framework, independent dynamic library
  • the information library contains API information and flow information, specifically including type, name, function, dynamic library where API is located, name of input/return parameter, and fields that depend on other APIs and flows.
  • API information is filled in by the developer after writing the API, and flow information is automatically generated after the low-code front-end editor edits the flow; the low-code front-end editor allows users to generate the final flow through dragging and editing mode based on the information library, the content of the flow is saved in the flow file, and the flow information is filled in the information table.
  • the flow file includes: main flow and other flows.
  • the main flow initializes external dependencies when it starts, and finally enters the core business of the user; the same type of interface, different underlying implementations, call a fixed-name flow in the core business, and shield the underlying implementation in the flow for different user needs; for non-core businesses, there are different business requirements, and specific business requirements are also completed in the flow for different user needs; other flows, such as message queues, commonly used ones such as Kafka and RabbitMQ, so that only a message queue with a unified interface is called to send the flow in the core business, but the KafkaAPI can be encapsulated or the RabbitMQAPI can be encapsulated internally according to customer needs; in addition, there are flows for pre/post processes.
  • the independent dynamic library is not compiled together with the programmable framework, and the programmable framework does not depend on the independent dynamic library. It is based on the main flow internally.
  • the orchestration is loaded on demand at the bottom layer, which greatly saves storage space and memory.
  • These APIs will also call other APIs and flows, but not directly through function calls, but through orchestration system calls, avoiding dependencies at compile time.
  • the orchestration framework is responsible for loading and parsing the main flow, and then loading other flows and dynamic libraries on demand according to the orchestration of the main flow, and executing various initialization and business logic.
  • the low-code front-end editor, flow files, and independent dynamic libraries are all connected to the information library, and the flow files are also connected to the low-code front-end editor and the orchestration framework, and the orchestration framework is also connected to the independent dynamic library.
  • the present invention further splits the monomers in the microservice into APIs and flows, thereby decoupling the core business and external dependencies; at the same time, the API is orchestrated through the low-code front-end editor to generate flows, so that external dependencies can be flexibly selected without changing the core business logic, and unnecessary external dependencies do not need to be compiled into the microservice image, thereby saving storage and memory space.
  • the programmable framework in the present invention includes: a launcher, an API/flow library, and a core API.
  • the launcher is responsible for initializing the system and executing the main flow by calling the core API.
  • the API/flow library is the result of loading the dynamic library and flow file using the core API.
  • the core API can be used to call the API/flow in the API code or flow. Therefore, the launcher is connected to the core API and the API/flow library respectively, and the launcher is connected to the independent dynamic library and the flow file respectively.
  • the core APIs in the present invention include: startMain, loadLibrary, loadFlow, runApi, and runFlow.
  • startMain is used to read the main flow in the flow file, and call the relevant functions in the API/flow library according to the arrangement of the main flow;
  • loadLibrary is used to read the required dynamic library and flow in the independent dynamic library, and store the API information in the dynamic library into the API/flow library;
  • loadFlow is used to read the required flow file and store the flow function into the API/flow library;
  • runApi is used to execute the external API; runFlow is used to execute the flow.
  • the present invention also provides a system working method for solving the complexity of microservice external dependency through orchestration, which specifically includes the following steps:
  • Step S1 Orchestrate flow through the low-code front-end editor; as shown in Figure 3, it specifically includes the following sub-steps:
  • Step S1.1 compile an independent dynamic library and provide an API interface
  • Step S1.2 fill the API information into the information database
  • Step S1.3 the low-code front-end editor reads the API information from the information library to facilitate dragging and editing;
  • Step S1.4 create a flow file through the low-code front-end editor
  • Step S1.5 the low-code front-end editor writes the orchestration into the flow file according to the editing results
  • Step S1.6 the low-code front-end editor fills the information written into the orchestrated flow file into the information library to facilitate calling another existing flow in one flow.
  • Step S2 start the choreography framework, load the main flow in the flow file, and continue to load other flows in the independent dynamic library and flow file according to the arrangement of the main flow; as shown in Figure 4, it specifically includes the following sub-steps:
  • Step S2.1 the caller starts the orchestration framework and passes the main flow path in the flow file to the launcher;
  • Step S2.2 the launcher loads the main flow and performs parsing
  • Step S2.3 According to the definition of the main flow, call loadLibrary, pass in the list of dynamic libraries to be loaded, load the required dynamic libraries, obtain the API information therein, and store the API information in the API/flow library;
  • Step S2.4 According to the definition of the main flow, call loadFlow, pass in the list of flow files to be loaded, load the required flow files, and store the flow information in the API/flow library;
  • Step S2.5 According to the definition of the main flow, call runAPI or runFlow to call the business logic.
  • Step S3 Execute the external API or flow through the core business code in the independent dynamic library; specifically,
  • the developer has developed a small amount deduction program that receives requests from the message queue, obtains the maximum amount of small amount without password set by the user, and executes the business processes defined by different users based on the comparison of two users.
  • the pseudo code involved includes: receiving requests from the message queue, obtaining the maximum amount of small amount without password set by the user, if the deduction amount is greater than the maximum amount, the deduction fails; otherwise, the deduction is successfully processed.
  • user A needs Kafka queues, so only the Kafka dynamic library needs to be loaded, and no RabbitMQ dynamic library needs to be loaded
  • user B needs RabbitMQ queues, so only the RabbitMQ dynamic library needs to be loaded, and no Kafka dynamic library needs to be loaded
  • user A needs to send text messages, so only the ShortMessage dynamic library needs to be loaded, and no Email dynamic library needs to be loaded
  • user B needs to send emails, so only the Email dynamic library needs to be loaded, and no ShortMessage dynamic library needs to be loaded.
  • different main flows are constructed for users A and B, as shown in Table 3.
  • the user core business abstracts external dependencies into flows, and implements dependency differentiation in flows. In this way, the user core business logic does not need to be developed and compiled separately for different users, thereby saving storage and memory space. The following will explain the four flows one by one.
  • Table 4 Comparison of the receiving request flow files of users A and B according to user needs
  • Table 5 Comparison of the maximum amount of small amount without password for users A and B according to user needs

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Library & Information Science (AREA)
  • Stored Programmes (AREA)

Abstract

本发明公开了通过编排方式解决微服务外部依赖复杂性的系统及方法,该系统包括:信息库、低代码前端编辑器、flow文件、可编排框架、独立动态库,所述低代码前端编辑器、flow文件、独立动态库均与信息库连接,所述flow文件还分别与低代码前端编辑器、可编排框架连接,所述可编排框架还与独立动态库连接。本发明将微服务中的单体进一步拆分为API和flow,从而将核心业务和外部依赖解耦;同时,通过低代码前端编辑器对API进行编排,生成flow,从而可以灵活选择外部依赖,而不改变核心业务逻辑,不需要的外部依赖不需要编入微服务镜像,从而节约了存储和内存空间。

Description

通过编排方式解决微服务外部依赖复杂性的系统及方法 技术领域
本发明涉及微服务技术领域,具体地,涉及一种通过编排方式解决微服务外部依赖复杂性的系统及方法。
背景技术
如图1,当前微服务都会依赖很多外部服务,且这些外部服务对应多种选择,如配置中心可以选取Etcd、Zookeeper、Spring Cloud Config、Apollo、Nacos,消息队列可以选取RabbitMQ、Kafka等。为了保证在不同用户环境中,用户进行了不同的选择,微服务实际又成为了一个大单体,需要将所有外部依赖和核心业务都编译到一起,并在配置文件中记录所需要的选择。这会导致可执行文件不断增大,运行时占用内存不断增大。同时如果多个微服务都使用同一个依赖,当此依赖升级时,所有微服务都需要重新编译。并且在用户环境中,可能存在依赖调用顺序不同的情况,如可能需要在依赖A中获取数值,再将此应用于依赖B;也可能出现在依赖B中获取数值,再将此应用于依赖A的情况。这种情况无法通过配置文件进行穷举,会不断增加配置的复杂性。
发明内容
针对现有技术中存在的问题,本发明提供了一种通过编排方式解决微服务外部依赖复杂性的系统及方法,通过编排方式解决微服务外部依赖复杂性。
为实现上述目的,本发明采用如下技术方案:一种通过编排方式解决微服务外部依赖复杂性的系统,包括:信息库、低代码前端编辑器、flow文件、可编排框架、独立动态库,所述低代码前端编辑器、flow文件、独立动态库均与信息库连接,所述flow文件还分别与低代码前端编辑器、可编排框架连接,所述可编排框架还与独立动态库连接。
进一步地,所述可编排框架包括:启动器、API/flow库、核心API,所述启动器分别与核心API、API/flow库连接。
进一步地,所述启动器分别与独立动态库、flow文件连接。
进一步地,所述核心API包括:startMain、loadLibrary、loadFlow、runApi、runFlow,所述startMain用于读取flow文件中的主flow,按照主flow的编排,调用API/flow库中相关功能;所述loadLibrary用于读取独立动态库中需要的动态库和flow,将动态库内的API信息存入API/flow库;所述loadFlow用于读取需要的flow文件,将flow的功能存入API/flow库;所述runApi用于执行外部API;所述runFlow用于执行flow。
本发明还提供了一种所述通过编排方式解决微服务外部依赖复杂性的系统的工作方法, 具体包括如下步骤:
步骤S1、通过低代码前端编辑器编排flow;
步骤S2、启动可编排框架,载入flow文件中的主flow,并根据主flow的编排,继续载入独立动态库和flow文件中的其他fow;
步骤S3、通过独立动态库中的核心业务代码执行外部API或flow。
进一步地,步骤S1包括如下子步骤:
步骤S1.1、编译独立动态库并提供API接口;
步骤S1.2、将API的信息填入信息库;
步骤S1.3、低代码前端编辑器从信息库中读取API的信息,方便拖曳和编辑;
步骤S1.4、通过低代码前端编辑器创建flow文件;
步骤S1.5、低代码前端编辑器根据编辑的结果将编排写入flow文件;
步骤S1.6、低代码前端编辑器将写入编排的flow文件的信息填入信息库。
进一步地,步骤S2包括如下子步骤:
步骤S2.1、调用者启动可编排框架,将flow文件中的主flow路径传给启动器;
步骤S2.2、启动器载入主flow,进行解析;
步骤S2.3、按照主flow的定义,调用loadLibrary,传入需要载入的动态库列表,载入需要的动态库,获取其中的API信息,并将API信息存入API/flow库;
步骤S2.4、按照主flow的定义,调用loadFlow,传入需要载入的flow文件列表,载入需要的flow文件,将flow信息存入API/flow库;
步骤S2.5、按照主flow的定义,调用runAPI或runFlow,调用业务逻辑。
进一步地,步骤S3中当核心业务代码执行外部API时,具体流程如下:
i、在核心业务代码中通过runApi,将所需要的API名称和参数传入,并将API名称和参数存入信息库;
ii、在编排主flow时,将依赖API对应的动态库名称作为参数传入loadLibrary;
iii、在启动时,载入对应动态库,将API信息写入API/flow库;在运行时,调用runApi,在API/flow库中查找API信息并执行。
进一步地,步骤S3中当核心业务代码执行flow时,具体流程如下:
i、在核心业务代码中通过runFlow,将所需要的flow名称和参数传入,并将flow名称和参数存入信息库;
ii、在编排主flow时,将依赖API对应的动态库名称作为参数传入loadLibrary,将依赖flow对应的flow文件名作为参数传入loadFlow;
iii、在启动时,载入对应flow文件,将flow信息写入flow库;在运行时,调用runFlow,在API/flow库中查找flow信息并执行。
与现有技术相比,本发明具有如下有益效果:本发明将微服务中的单体进一步拆分为API和flow,从而将核心业务和外部依赖解耦;同时,通过低代码前端编辑器对API进行编排,生成flow,从而可以灵活选择外部依赖,而不改变核心业务逻辑,不需要的外部依赖不需要编入微服务镜像,从而节约了存储和内存空间。
附图说明
图1为现有的单个微服务解决复杂性外部依赖的框架图;
图2为本发明通过编排方式解决微服务外部依赖复杂性的系统的框架图;
图3为本发明中通过低代码前端编辑器编排flow的流程图;
图4为本发明中可编排框架启动的流程图;
图5为主flow中按需加载不同的消息队列动态库,并执行动态库里的相应API的示意图;
如图6为依赖于主flow的核心业务逻辑示意图。
具体实施方式
下面结合附图和实施例对本发明的技术方案作进一步解释说明。
如图2为本发明通过编排方式解决微服务外部依赖复杂性的系统的框架图,该系统包括:信息库、低代码前端编辑器、flow文件、可编排框架、独立动态库,信息库包含API信息和flow信息,具体包含类型、名称、功能,API所在动态库,输入/返回参数的名称,依赖其他API和flow这些字段。API信息是由开发者在编写完API后填入的,flow信息是低代码前端编辑器编辑flow后自动生成的;低代码前端编辑器根据信息库,让用户通过拖曳、编辑的模式生成最终的flow,flow的内容存到flow文件,flow的信息填入信息表。flow文件包含:主flow和其他flow,主flow在启动时对外部依赖进行初始化,并最终进入用户核心业务;同一类型接口,不同底层实现,在核心业务调用一个固定名称flow,针对不同用户需求,在flow中完成对底层实现的屏蔽;对非核心业务,有不同的业务需求,同样针对不同用户需求,在flow中完成具体的业务需求;其他flow,比如对于消息队列,常用的如Kafka和RabbitMQ,这样在核心业务中只调用一个统一接口的消息队列发送flow,但是内部根据客户需求,可以封装KafkaAPI,或者封装RabbitMQAPI;此外,还有用于pre/post流程的flow,比如一个事务失败时,有的用户可能选择发送短信告警,有的用户可能选择发送邮件告警。本发明中独立动态库不与可编排框架编译到一起,且可编排框架不依赖于独立动态库,在内部根据主flow 编排在底层按需载入,大大节约了存储空间和内存,这些API也会调用其他API和flow,但是并不是直接通过函数调用,而是通过编排系统调用,避免了编译时的依赖。可编排框架负责加载并解析主flow,再按照主flow的编排,按需加载其他flow和动态库,并执行各种初始化和业务逻辑。因此,低代码前端编辑器、flow文件、独立动态库均与信息库连接,flow文件还分别与低代码前端编辑器、可编排框架连接,可编排框架还与独立动态库连接。本发明将微服务中的单体进一步拆分为API和flow,从而将核心业务和外部依赖解耦;同时,通过低代码前端编辑器对API进行编排,生成flow,从而可以灵活选择外部依赖,而不改变核心业务逻辑,不需要的外部依赖不需要编入微服务镜像,从而节约了存储和内存空间。
本发明中可编排框架包括:启动器、API/flow库、核心API,启动器负责系统的初始化,并通过调用核心API执行主flow;API/flow库是使用核心API加载动态库和flow文件的结果,在API代码中或者flow中可以使用核心API调用其中的API/flow。因此,启动器分别与核心API、API/flow库连接,启动器分别与独立动态库、flow文件连接。
本发明中核心API包括:startMain、loadLibrary、loadFlow、runApi、runFlow,startMain用于读取flow文件中的主flow,按照主flow的编排,调用API/flow库中相关功能;loadLibrary用于读取独立动态库中需要的动态库和flow,将动态库内的API信息存入API/flow库;loadFlow用于读取需要的flow文件,将flow的功能存入API/flow库;runApi用于执行外部API;runFlow用于执行flow。
本发明还提供了一种通过编排方式解决微服务外部依赖复杂性的系统的工作方法,具体包括如下步骤:
步骤S1、通过低代码前端编辑器编排flow;如图3,具体包括如下子步骤:
步骤S1.1、编译独立动态库并提供API接口;
步骤S1.2、将API的信息填入信息库;
步骤S1.3、低代码前端编辑器从信息库中读取API的信息,方便拖曳和编辑;
步骤S1.4、通过低代码前端编辑器创建flow文件;
步骤S1.5、低代码前端编辑器根据编辑的结果将编排写入flow文件;
步骤S1.6、低代码前端编辑器将写入编排的flow文件的信息填入信息库,便于在一个flow中调用存在的另一个flow。
步骤S2、启动可编排框架,载入flow文件中的主flow,并根据主flow的编排,继续载入独立动态库和flow文件中的其他flow;如图4,具体包括如下子步骤:
步骤S2.1、调用者启动可编排框架,将flow文件中的主flow路径传给启动器;
步骤S2.2、启动器载入主flow,进行解析;
步骤S2.3、按照主flow的定义,调用loadLibrary,传入需要载入的动态库列表,载入需要的动态库,获取其中的API信息,并将API信息存入API/flow库;
步骤S2.4、按照主flow的定义,调用loadFlow,传入需要载入的flow文件列表,载入需要的flow文件,将flow信息存入API/flow库;
步骤S2.5、按照主flow的定义,调用runAPI或runFlow,调用业务逻辑。
步骤S3、通过独立动态库中的核心业务代码执行外部API或flow;具体地,
当核心业务代码执行外部API时,具体流程如下:
i、在核心业务代码中通过runApi,将所需要的API名称和参数传入,并将API名称和参数存入信息库;
ii、在编排主flow时,将依赖API对应的动态库名称作为参数传入loadLibrary;
iii、在启动时,载入对应动态库,将API信息写入API/flow库;在运行时,调用runApi,在API/flow库中查找API信息并执行。
当核心业务代码执行flow时,具体流程如下:
i、在核心业务代码中通过runFlow,将所需要的flow名称和参数传入,并将flow名称和参数存入信息库;
ii、在编排主flow时,将依赖API对应的动态库名称作为参数传入loadLibrary,将依赖flow对应的flow文件名作为参数传入loadFlow;
iii、在启动时,载入对应flow文件,将flow信息写入flow库;在运行时,调用runFlow,在API/flow库中查找flow信息并执行。
实施例
开发者开发了一个小额免密扣款程序,从消息队列接收请求,获取用户设置的小额免密最大额度,根据两个用户的比较,执行不同用户定义的业务流程。涉及的伪代码包括:从消息队列接收请求,获取用户小额免密最大额度,如果扣款额>最大额度,扣款失败处理;否则扣款成功处理。
现在有甲、乙两个客户,其对周边的依赖和业务流程有非常大的差别,如表1所示,在传统开发模式时,需要大量的配置用于用户不同选择,同时Kafka、RabbitMQ、短信、邮件依赖都需要编译到应用中,加大了应用的体积;当更多客户引入时,可能由于不断的新依赖需求,导致配置和应用体积的不可控膨胀。
表1:甲,乙客户需求对比表

而使用本发明解决微服务外部依赖复杂性的系统后,对外的依赖将全部抽象为对外flow,表述为:runFlow(从消息队列接收请求),runFlow(获取用户小额免密最大额度),如果扣款额>最大额度,runFlow(扣款失败);否则runFlow(扣款成功)。通过本发明的方法,提取甲、乙用户的API信息,如表2所示。
表2:API信息

如图5,用户甲需要Kafka队列,因此只需要加载Kafka动态库,不需要加载RabbitMQ动态库;用户乙需要RabbitMQ队列,因此只需要加载RabbitMQ动态库,不需要加载Kafka动态库;用户甲需要发短信,因此只需要加载ShortMessage动态库,不需要加载Email动态库动态库;用户乙需要发邮件,因此只需要加载Email动态库,不需要加载ShortMessage动态库动态库。根据用户需求,针对甲,乙两个用户,构建了不同的主flow,如表3所示。
表3:根据客户需求构建主flow

如图6,用户核心业务将对外依赖抽象为flow,在flow中实现了依赖差异,这样用户核心业务逻辑不需要针对不同用户单独开发、单独编译,从而节约了存储和内存空间。下面将针对4个flow进行一一进行解释。
表4:根据用户需求,对比甲乙两个用户的接收请求flow文件
表5:根据用户需求,对比甲乙两个用户的获取用户小额免密最大额度
表6:根据用户需求,对比甲乙两个用户的扣款成功
表7:根据用户需求,对比甲乙两个用户的扣款失败
以上仅是本发明的优选实施方式,本发明的保护范围并不仅局限于上述实施例,凡属于本发明思路下的技术方案均属于本发明的保护范围。应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理前提下的若干改进和润饰,应视为本发明的保护范围。

Claims (9)

  1. 一种通过编排方式解决微服务外部依赖复杂性的系统,其特征在于,包括:信息库、低代码前端编辑器、flow文件、可编排框架、独立动态库,所述低代码前端编辑器、flow文件、独立动态库均与信息库连接,所述flow文件还分别与低代码前端编辑器、可编排框架连接,所述可编排框架还与独立动态库连接。
  2. 根据权利要求1所述的一种通过编排方式解决微服务外部依赖复杂性的系统,其特征在于,所述可编排框架包括:启动器、API/flow库、核心API,所述启动器分别与核心API、API/flow库连接。
  3. 根据权利要求2所述的一种通过编排方式解决微服务外部依赖复杂性的系统,其特征在于,所述启动器分别与独立动态库、flow文件连接。
  4. 根据权利要求2所述的一种通过编排方式解决微服务外部依赖复杂性的系统,其特征在于,所述核心API包括:startMain、loadLibrary、loadFlow、runApi、runFlow,所述startMain用于读取flow文件中的主flow,按照主flow的编排,调用API/flow库中相关功能;所述loadLibrary用于读取独立动态库中需要的动态库和flow,将动态库内的API信息存入API/flow库;所述loadFlow用于读取需要的flow文件,将flow的功能存入API/flow库;所述runApi用于执行外部API;所述runFlow用于执行flow。
  5. 一种权利要求1所述通过编排方式解决微服务外部依赖复杂性的系统的工作方法,其特征在于,具体包括如下步骤:
    步骤S1、通过低代码前端编辑器编排fow;
    步骤S2、启动可编排框架,载入flow文件中的主flow,并根据主flow的编排,继续按需载入独立动态库和flow文件中的其他flow;
    步骤S3、通过独立动态库中的核心业务代码执行外部API或flow。
  6. 根据权利要求5所述的一种通过编排方式解决微服务外部依赖复杂性的系统的工作方法,其特征在于,步骤S1包括如下子步骤:
    步骤S1.1、编译独立动态库并提供API接口;
    步骤S1.2、将API的信息填入信息库;
    步骤S1.3、低代码前端编辑器从信息库中读取API的信息,方便拖曳和编辑;
    步骤S1.4、通过低代码前端编辑器创建flow文件;
    步骤S1.5、低代码前端编辑器根据编辑的结果将编排写入flow文件;
    步骤S1.6、低代码前端编辑器将写入编排的flow文件的信息填入信息库。
  7. 根据权利要求5所述的一种通过编排方式解决微服务外部依赖复杂性的系统的工作方法,其特征在于,步骤S2包括如下子步骤:
    步骤S2.1、调用者启动可编排框架,将flow文件中的主flow路径传给启动器;
    步骤S2.2、启动器载入主flow,进行解析;
    步骤S2.3、按照主flow的定义,调用loadLibrary,传入需要载入的动态库列表,载入需要的动态库,获取其中的API信息,并将API信息存入API/flow库;
    步骤S2.4、按照主flow的定义,调用loadFlow,传入需要载入的flow文件列表,载入需要的flow文件,将flow信息存入API/flow库;
    步骤S2.5、按照主flow的定义,调用runAPI或runFlow,调用业务逻辑。
  8. 根据权利要求5所述的一种通过编排方式解决微服务外部依赖复杂性的系统的工作方法,其特征在于,步骤S3中当核心业务代码执行外部API时,具体流程如下:
    i、在核心业务代码中通过runApi,将所需要的API名称和参数传入,并将API名称和参数存入信息库;
    ii、在编排主flow时,将依赖API对应的动态库名称作为参数传入loadLibrary;
    iii、在启动时,载入对应动态库,将API信息写入API/flow库;在运行时,调用runApi,在API/flow库中查找API信息并执行。
  9. 根据权利要求5所述的一种通过编排方式解决微服务外部依赖复杂性的系统的工作方法,其特征在于,步骤S3中当核心业务代码执行flow时,具体流程如下:
    i、在核心业务代码中通过runFlow,将所需要的flow名称和参数传入,并将flow名称和参数存入信息库;
    ii、在编排主flow时,将依赖API对应的动态库名称作为参数传入loadLibrary,将依赖flow对应的flow文件名作为参数传入loadFlow;
    iii、在启动时,载入对应flow文件,将flow信息写入flow库;在运行时,调用runFlow,在API/flow库中查找flow信息并执行。
PCT/CN2023/119010 2022-09-30 2023-09-15 通过编排方式解决微服务外部依赖复杂性的系统及方法 WO2024067155A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202211207342.1A CN115543269A (zh) 2022-09-30 2022-09-30 通过编排方式解决微服务外部依赖复杂性的系统及方法
CN202211207342.1 2022-09-30

Publications (1)

Publication Number Publication Date
WO2024067155A1 true WO2024067155A1 (zh) 2024-04-04

Family

ID=84732521

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/119010 WO2024067155A1 (zh) 2022-09-30 2023-09-15 通过编排方式解决微服务外部依赖复杂性的系统及方法

Country Status (2)

Country Link
CN (1) CN115543269A (zh)
WO (1) WO2024067155A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115543269A (zh) * 2022-09-30 2022-12-30 中电信数智科技有限公司 通过编排方式解决微服务外部依赖复杂性的系统及方法
CN117369865B (zh) * 2023-12-07 2024-04-05 麒麟软件有限公司 一种GNU linux通用的应用程序打包方法及图形化应用打包器

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110286884A (zh) * 2019-06-21 2019-09-27 北京百度网讯科技有限公司 微服务编排方法、装置、设备及计算机可读存储介质
CN112506498A (zh) * 2020-11-30 2021-03-16 广东电网有限责任公司 一种智慧型可视化api编排方法、存储介质及电子设备
KR20220103490A (ko) * 2021-01-15 2022-07-22 한국전력공사 전력 시스템을 위한 마이크로 서비스 개발 플랫폼 및 마이크로 서비스 배포 실행 방법
CN115103012A (zh) * 2022-08-25 2022-09-23 中国电子科技集团公司第十五研究所 一种地理空间信息微服务集成系统及方法
CN115543269A (zh) * 2022-09-30 2022-12-30 中电信数智科技有限公司 通过编排方式解决微服务外部依赖复杂性的系统及方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110286884A (zh) * 2019-06-21 2019-09-27 北京百度网讯科技有限公司 微服务编排方法、装置、设备及计算机可读存储介质
CN112506498A (zh) * 2020-11-30 2021-03-16 广东电网有限责任公司 一种智慧型可视化api编排方法、存储介质及电子设备
KR20220103490A (ko) * 2021-01-15 2022-07-22 한국전력공사 전력 시스템을 위한 마이크로 서비스 개발 플랫폼 및 마이크로 서비스 배포 실행 방법
CN115103012A (zh) * 2022-08-25 2022-09-23 中国电子科技集团公司第十五研究所 一种地理空间信息微服务集成系统及方法
CN115543269A (zh) * 2022-09-30 2022-12-30 中电信数智科技有限公司 通过编排方式解决微服务外部依赖复杂性的系统及方法

Also Published As

Publication number Publication date
CN115543269A (zh) 2022-12-30

Similar Documents

Publication Publication Date Title
WO2024067155A1 (zh) 通过编排方式解决微服务外部依赖复杂性的系统及方法
US10757044B2 (en) Chatbot system
US9934005B2 (en) Dynamically building locale objects or subsections of locale objects based on historical data
US8875098B2 (en) Workflow engine for execution of web mashups
US8156137B2 (en) Data processing systems and methods
US9189270B2 (en) Realizing jumps in an executing process instance
CN110008018A (zh) 一种批量任务处理方法、装置及设备
US9141353B2 (en) Dynamically building locale objects at run-time
CN109102200B (zh) 一种定时任务处理方法及装置
US20110314266A1 (en) On-demand database server startup and shutdown
US7844978B2 (en) Artifact management for an extensible runtime environment
US9298473B2 (en) System and method for a generic object access layer
WO2020135129A1 (zh) 加载应用的插件的方法、装置和终端
CN113485686B (zh) 信息系统程序的生成方法、装置、电子设备及存储介质
CN115185576A (zh) 一种基于流程类应用系统的流程定制方法及系统
CN114327404A (zh) 一种文件处理方法、装置、电子设备及计算机可读介质
US20060064671A1 (en) Creating and using a building block
CN111597784A (zh) 信息发送方法、装置、终端设备及介质
US11822984B1 (en) Autonomous concurrency for serverless functions
KR20100052494A (ko) Sip 및 sdp 프로토콜을 고객화하는 사용자 동시 실행 루틴 인터페이스
CN115098222A (zh) 一种脚本的执行方法、装置以及设备
TWI236626B (en) System and method for integrating programs of targeted system to save computer system resources
CN113744048A (zh) 一种贷款交易处理方法及装置
TWI289792B (en) System and method for user to self-define execution flow process of program
US12002076B1 (en) Method, computer-readable media, and system for transaction data generation with varying fidelity

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23870389

Country of ref document: EP

Kind code of ref document: A1