API arrangement execution method and device
Through the API orchestration execution method, we obtain user orchestration requests and flexibly orchestrate multiple APIs, which solves the problem of bulky existing API orchestration execution engines, achieves rapid release of API call services, low latency, and high throughput capabilities, and simplifies function development. and extensions.
Patent Information
- Application Number
- CN202410593117.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-14
- Publication Date
- 2024-08-30
AI Technical Summary
The existing API orchestration execution engine is cumbersome and cannot achieve low latency and high throughput. As a result, when the number of services in the microservice architecture increases, API combination calling workload is heavy, difficult to maintain, and function launch and expansion are limited.
Obtain user orchestration requests through the API orchestration execution method, flexibly orchestrate multiple APIs, build API call services, use the configuration reader priority to traverse from high to low to obtain API orchestration execution information, and use asynchronous event notification and processor processing nodes Logic, output return parameters, support dynamic loading of node processors and plug-in packages.
It realizes the flexible combination and rapid release of API calling services, avoids dependence on old business processes, improves the low-latency and high-throughput capabilities of the API orchestration execution engine, and simplifies function development and expansion.
Smart Images

Figure CN118567634A
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of orchestration execution engines, and in particular, relates to an API orchestration execution method and device. Background Art
[0002] As microservice architecture is increasingly used in enterprises, many applications are split into separate services to reduce coupling between modules and solve the problem of application complexity. However, with the continuous increase of new requirements, the number of services in the microservice architecture is also increasing. In order to achieve a certain requirement, many microservice APIs need to be called in combination. Calling microservice APIs in sequence by coding or writing files has the disadvantages of large workload and difficult maintenance, which is not conducive to the timely launch of functions and function expansion. Existing API orchestration execution engine solutions are basically built using the bpmn protocol-related process engine framework technology, but this method is too cumbersome for the API orchestration execution engine and cannot achieve low latency and high throughput. Summary of the invention
[0003] In view of the above shortcomings of the prior art, the purpose of the invention is to provide an API orchestration execution method and device, by which when a user makes an orchestration request, the API orchestration execution engine can flexibly orchestrate multiple APIs according to the user's API orchestration requirements, and finally build an API call service. In this way, users can flexibly reorganize the functions of the API call service and quickly publish the reorganized API call service, thereby avoiding the problem that the existing business system is overly dependent on the old business process and the API orchestration execution engine is too cumbersome to achieve low latency and high throughput.
[0004] A first aspect of the present invention provides an API orchestration execution method, comprising:
[0005] S1, obtaining a user's scheduling request, where the scheduling request includes a unique identifier;
[0006] S2, obtaining the orchestration execution information of the API according to the unique identifier;
[0007] S3, choreographing the service logic of the API according to the orchestration execution information, executing the atomic capability API of the node, and outputting return parameters.
[0008] Furthermore, the S2 specifically includes:
[0009] S201: Build configuration reader;
[0010] S202: According to the unique identifier, environment configuration, and runtime status, traverse in order from high to low according to the reader priority to obtain API orchestration execution information, wherein the API orchestration execution information is to select a target reader that can generate an orchestration template reading strategy corresponding to the unique identifier;
[0011] S203: configuring the arrangement template reading strategy in the target reader.
[0012] Furthermore, the reader includes a file reader, a database reader, a redis middleware reader, and a jvm memory reader, and the priority of the jvm memory reader is higher than that of the redis middleware reader, the priority of the redis middleware reader is higher than that of the file reader, and the priority of the file reader is higher than that of the database reader.
[0013] Furthermore, the S3 specifically includes:
[0014] S301: Sending an asynchronous event notification of the start of a process according to the orchestration execution information;
[0015] S302: Call the handle method of BaseHandler to execute the node processing logic;
[0016] S303: Send a notification of the end of the process and output return parameters.
[0017] Furthermore, the S302 specifically includes:
[0018] Call the handle method of the BaseHandler and pass in the parameters of the node;
[0019] Obtaining a processor corresponding to the node according to the type of the node;
[0020] Call the preHandler pre-processing of the BaseHandler and send the pre-processing event;
[0021] Call the pre-processor preHandler of the node to process the business logic of the current node;
[0022] Process the child node business, call the handle method of the BaseHandler, and pass in the child node information, wherein the node includes at least one child node;
[0023] Processing post-processing of the node;
[0024] Call the afterHandle post-processing of the BaseHandler and send the post-processing event.
[0025] A second aspect of the present invention provides an API orchestration execution device, comprising:
[0026] A first acquisition module, configured to acquire an orchestration request from a user, wherein the orchestration request includes a unique identifier;
[0027] A second acquisition module, used to acquire the orchestration execution information of the API according to the unique identifier;
[0028] The execution module is used to orchestrate the service logic of the API according to the orchestration execution information, execute the atomic capability API of the node, and output the return parameters.
[0029] Furthermore, the second acquisition module includes:
[0030] Building modules for building configuration readers;
[0031] A third acquisition module is used to traverse the reader priorities from high to low according to the unique identifier and the environment configuration and runtime status to acquire the orchestration execution information of the API, wherein the orchestration execution information of the API is to select a target reader that can generate an orchestration template reading strategy corresponding to the unique identifier;
[0032] A configuration module is used to configure the arrangement template reading strategy in the target reader.
[0033] Furthermore, the reader includes a file reader, a database reader, a redis middleware reader, and a jvm memory reader, and the priority of the jvm memory reader is higher than that of the redis middleware reader, the priority of the redis middleware reader is higher than that of the file reader, and the priority of the file reader is higher than that of the database reader.
[0034] Furthermore, the execution module specifically includes:
[0035] A first sending module, configured to send an asynchronous event notification of the start of a process according to the orchestration execution information;
[0036] The calling module is used to call the handle method of BaseHandler to execute the node processing logic;
[0037] The second sending module is used to send a notification of the end of the process and output a return parameter.
[0038] Furthermore, the calling module is specifically used for:
[0039] Call the handle method of the BaseHandler and pass in the parameters of the node;
[0040] Obtaining a processor corresponding to the node according to the type of the node;
[0041] Call the preHandler pre-processing of the BaseHandler and send the pre-processing event;
[0042] Call the pre-processor preHandler of the node to process the business logic of the current node;
[0043] Process the child node business, call the handle method of the BaseHandler, and pass in the child node information, wherein the node includes at least one child node;
[0044] Processing post-processing of the node;
[0045] Call the afterHandle post-processing of the BaseHandler and send the post-processing event.
[0046] A third aspect of the present invention provides an API orchestration execution system, comprising: a memory and one or more processors.
[0047] One or more application programs are stored in the memory, and the one or more application programs are suitable for being executed by one or more processors to implement the API orchestration execution method of the first aspect.
[0048] According to a fourth aspect of the present invention, a computer-readable storage medium is provided, on which a computer program is stored. The computer program can be loaded and executed by a processor to execute the method according to the API arrangement of the first aspect.
[0049] The beneficial effects of the present invention are as follows:
[0050] The method and device of the present invention can flexibly arrange multiple APIs according to the user's API arrangement requirements when the user makes an arrangement request, and finally build an API call service. In this way, the user can flexibly reorganize the functions of the API call service and quickly publish the reorganized API call service, thereby avoiding the problem that the existing business system is overly dependent on the old business process and the API arrangement execution engine is too cumbersome to achieve low latency and high throughput. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] The accompanying drawings are only used to illustrate specific embodiments and are not considered to limit the present invention. In the entire drawings, the same reference symbols represent the same components. Obviously, the drawings described below are only some embodiments recorded in the embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings.
[0052] Figure 1 A flowchart of an API orchestration execution method provided by an embodiment of the present invention;
[0053] Figure 2 A schematic diagram of the structure of an API orchestration execution device provided by an embodiment of the present invention;
[0054] Figure 3 A schematic diagram of the structure of an API orchestration execution system provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0055] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. It should be understood that these descriptions are only exemplary and are not intended to limit the scope of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in the field without making creative work should fall within the scope of protection of the present invention.
[0056] Furthermore, in the following description, descriptions of well-known structures and technologies are omitted to avoid unnecessarily obscuring the concepts disclosed in the present invention.
[0057] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the orientation or position relationship indicated by the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inside", "outside", etc. is based on the orientation or position relationship shown in the drawings, which is only for the convenience of describing the present invention and simplifying the description, and does not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation of the present invention. In addition, the terms "first", "second", and "third" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. The terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be a connection between the two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0058] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of methods and devices consistent with some aspects of the present invention as detailed in the appended claims.
[0059] The present invention proposes an API orchestration execution method and device, based on a microservice system architecture constructed by java-web, spring, and springcould. The present invention is to solve the problem that as new demands continue to increase, the number of services in the microservice architecture also continues to increase. In order to achieve a certain demand, many microservice APIs need to be called in combination. Calling the microservice APIs in sequence by coding or writing files has the disadvantages of large workload and difficult maintenance, which is not conducive to the timely launch of functions and function expansion. Existing API orchestration execution engine solutions are basically constructed using bpmn protocol-related process engine framework technology, but this method is too cumbersome for the API orchestration execution engine and cannot achieve low latency and high throughput.
[0060] The present invention generates an API orchestration execution engine according to the characteristics of the API open platform. The API orchestration execution engine can be deployed on the API development platform in the form of a plug-in. When a user logs in to the API open platform, the API orchestration execution engine can flexibly orchestrate multiple APIs according to the user's API orchestration requirements, and finally build an API call service. In this way, the user can flexibly recombine the functions of the API call service and quickly publish the recombined API call service, thereby avoiding the problem that the new business function module cannot be quickly developed due to the existing business system's excessive reliance on the old business process.
[0061] Method Embodiment
[0062] Reference Manual Attached Figure 1 , which shows a flow chart of an API orchestration execution method provided by an embodiment of the present invention.
[0063] An embodiment of the present invention provides an API orchestration execution method, including:
[0064] Specifically, the method includes steps S1 to S3.
[0065] S1, obtain the user's orchestration request.
[0066] The arrangement request includes a unique identifier.
[0067] Optionally, the unique identifier is specifically an API unique identifier.
[0068] API, or Application Programming Interface, is a set of conventions that define how software components interact with other components. They allow different software systems to communicate, exchange data, and call functions, thereby achieving integration and interoperability between systems.
[0069] Furthermore, the API unique identifier refers to a unique identifier used to distinguish different APIs. In API design and management, it is very important to assign a unique identifier to each API, because it can help developers and systems identify and locate specific APIs and ensure uniqueness and consistency in the system.
[0070] S2, obtain the API orchestration execution information according to the unique identifier.
[0071] In an optional embodiment, S2 specifically includes:
[0072] S201: Build a configuration reader.
[0073] S202: According to the unique identifier, environment configuration, and runtime status, traverse in descending order according to the reader priority to obtain the orchestration execution information of the API, wherein the orchestration execution information of the API is to select a target reader that can generate an orchestration template reading strategy corresponding to the unique identifier.
[0074] The readers include file readers, database readers, redis middleware readers, and jvm memory readers, and the priority of jvm memory readers is higher than that of redis middleware readers, the priority of redis middleware readers is higher than that of file readers, and the priority of file readers is higher than that of database readers. In addition, for jvm memory readers, broadcasting is used to send to other server nodes.
[0075] S203: configuring the orchestration template reading strategy in the target reader.
[0076] S3, according to the orchestration execution information, orchestrates the business logic of the API, executes the atomic capability API of the node, and outputs the return parameters.
[0077] In an optional embodiment, S3 specifically includes:
[0078] S301: Sending an asynchronous event notification of the start of a process according to the orchestration execution information.
[0079] S302: Call the handle method of BaseHandler to execute the node processing logic.
[0080] In an optional embodiment, S302 specifically includes:
[0081] Call the handle method of BaseHandler and pass in the parameters of the node.
[0082] Get the processor of the corresponding node by the node type.
[0083] Call the preHandler pre-processing of BaseHandler and send the pre-processing event.
[0084] Call the node's pre-processor preHandler to process the business logic of the current node.
[0085] To process child node business, call the handle method of BaseHandler and pass in the child node information, where a node includes at least one child node.
[0086] Post-processing of processing nodes.
[0087] Call the afterHandle post-processing of BaseHandler and send the post-processing event.
[0088] Specifically, the input and output parameter information of the orchestration API call is recorded through event monitoring, message monitoring, database, etc. The node input and output parameter information is obtained and filled in the jsonschema method for each node input and output parameter. When executing the node, the upstream node or environment variable can be read, obtained and filled in through the jsonschema expression method.
[0089] Among them, event monitoring includes process start event; node start event; node end event; node suspension event; node re-entry event and process end event.
[0090] Based on class inheritance and strategy mode, all node executors inherit BaseHandler, abstract node executors, and perform common processing on logs, initialization variables, termination judgment, etc.
[0091] Based on the recursive method, the child nodes of each node are processed. In this solution, the overall syntax of API orchestration adopts a tree structure, and the tree is traversed from top to bottom and from left to right.
[0092] Specifically, after obtaining the configuration, the node is executed. First, the built-in node selector is used, and the adapter mode is used here to select the node. The node can be loaded into the jvm through dynamic class loading, that is, it supports pluggable extensions. The node selection logic is implemented by the callback method provided by the node itself. Each node provides a canhandle method and is injected into the spring container. When selecting the node, the executor nodes that inherit BaseHandler in the container are traversed, and the canhandle method of the node is called in turn. When the conditions are met, the node is used, and the prehandle method of the node is called for pre-processing and verification, and then the handler is called to enter the processing logic of the node. When the node is processed, the parameters are extracted through the parameter converter, the parameters are assembled according to the jsonschmal description file, and the parameters are extracted using jsonpath. The node execution results are placed in a container for downstream nodes to extract; after the node logic is executed, handler-log is used for logging, and the logging strategy is built into this module. For formula processing, the formula processor is called to parse and execute the formula according to the formula expression; for asynchronous execution, the asynchronous flag configured in the process is used to jump out of the current execution and record the current execution cursor to facilitate callback and re-entry.
[0093] In an optional embodiment, the execution node types supported by the execution engine mainly include the following:
[0094] 1. Input parameter node: The process start node extracts and processes the total input parameters of the orchestration API and stores them in memory.
[0095] 2. Serial node, which executes the child nodes of the current node sequentially, and is generally used for the outermost virtual logic node.
[0096] 3. Parallel nodes, multi-threaded asynchronous execution of the current node's child nodes.
[0097] 4. If branch node, the condition determines whether the condition configuration in the node is met. The condition factor supports jsonchema to obtain parameters and supports common formulas.
[0098] 5. For loop nodes, the loop factor obtains parameters through jsonchema, loops through the loop factor parameters, and records them in the loop variable for use by the child nodes in the loop. After entering the loop, the child nodes are executed in a loop until the loop ends or a jump node is encountered.
[0099] 6. Jump out node, used in conjunction with loop node, exists in the subordinate node of loop node, and jumps out of the nearest loop when encountering this node.
[0100] 7. Business service node, API orchestration core business node, a single node corresponds to a single atomic capability API, according to the data provided by the orchestration API, such as API address, request method, request header, request parameters and other information, extract the upstream parameters and fill them, assemble the request parameters required for the microservice API call, use restTemplate to call, and store the call results in the context for subsequent nodes to use.
[0101] 8. Internal service nodes have some interfaces that need to be within the system and need to be configured into the API orchestration process. The logic here is similar to that of the business service nodes. The difference is that the service name can be used for fegin calls when calling and load balancing can be performed through LoadBalance.
[0102] 9. Orchestration service node. The orchestration API after orchestration can also be used as a sub-node in the API orchestration, similar to the business node.
[0103] 10. Constant node, used to set temporary variables and store variable values temporarily.
[0104] 11. At the end of the process, the upstream node parameters are obtained through the jsonchema or formula configured in the node, and returned as the orchestration API interface.
[0105] In an optional embodiment, the node processor can be derived from three methods:
[0106] 1. Inside the executor: the node processor is placed in the executor. When the executor starts, it is loaded into the jvm reader by the default classloader and dynamically loaded into the spring IOC container according to the configuration method. The loading of the node processor can be realized through the configuration file.
[0107] 2. Plugin package loading: that is, the node processor is provided by the plugin package, and the node processor class in the plugin package is loaded into the jvm reader in a custom classloader when the executor starts. In the spring IOC container, the plugin package file can be freely mounted and configured for loading.
[0108] 3. Runtime upload: that is, by uploading the plug-in package, the node processor is added at runtime. When uploading the plug-in package, the node processor class is dynamically loaded into the jvm reader through the custom classloader, and then the node processor instance is registered into the spring IOC container through the registerSingleton of DefaultListableBeanFactory, and the spring IOC container is refreshed through refresh. Here, the node processor can be dynamically loaded during the operation of the executor.
[0109] S303: Send a notification of the end of the process and output return parameters.
[0110] The beneficial effects of the present invention are as follows:
[0111] When a user makes an orchestration request, the API orchestration execution engine can flexibly orchestrate multiple APIs according to the user's API orchestration requirements, and finally build an API call service. In this way, users can flexibly reassemble the functions of the API call service and quickly publish the reassembled API call service, thereby avoiding the problem that the existing business system is overly dependent on the old business process and the API orchestration execution engine is too cumbersome to achieve low latency and high throughput.
[0112] System Example
[0113] Reference Manual Attached Figure 2 , showing a structural schematic diagram of an API orchestration execution device provided by an embodiment of the present invention.
[0114] An embodiment of the present invention provides an API orchestration execution device 20, comprising:
[0115] A first acquisition module 201 is used to acquire a user's scheduling request, where the scheduling request includes a unique identifier;
[0116] A second acquisition module 202 is used to acquire the orchestration execution information of the API according to the unique identifier;
[0117] The execution module 203 is used to orchestrate the service logic of the API according to the orchestration execution information, execute the atomic capability API of the node, and output the return parameters.
[0118] In a possible implementation manner, the second acquisition module 202 includes:
[0119] Building modules for building configuration readers;
[0120] A third acquisition module is used to traverse the reader priorities from high to low according to the unique identifier and the environment configuration and runtime status to acquire the orchestration execution information of the API, wherein the orchestration execution information of the API is to select a target reader that can generate an orchestration template reading strategy corresponding to the unique identifier;
[0121] A configuration module is used to configure the arrangement template reading strategy in the target reader.
[0122] In a possible implementation, the reader includes a file reader, a database reader, a redis middleware reader, and a jvm memory reader, and the jvm memory reader has a higher priority than the redis middleware reader, the redis middleware reader has a higher priority than the file reader, and the file reader has a higher priority than the database reader.
[0123] In a possible implementation, the execution module specifically includes:
[0124] A first sending module, configured to send an asynchronous event notification of the start of a process according to the orchestration execution information;
[0125] The calling module is used to call the handle method of BaseHandler to execute the node processing logic;
[0126] The second sending module is used to send a notification of the end of the process and output a return parameter.
[0127] In a possible implementation manner, the calling module is specifically used to:
[0128] Call the handle method of the BaseHandler and pass in the parameters of the node;
[0129] Obtaining a processor corresponding to the node according to the type of the node;
[0130] Call the preHandler pre-processing of the BaseHandler and send the pre-processing event;
[0131] Call the pre-processor preHandler of the node to process the business logic of the current node;
[0132] Process the child node business, call the handle method of the BaseHandler, and pass in the child node information, wherein the node includes at least one child node;
[0133] Processing post-processing of the node;
[0134] Call the afterHandle post-processing of the BaseHandler and send the post-processing event.
[0135] The API orchestration execution device 20 provided by the present invention can implement the API orchestration execution method in the above method embodiment and can obtain the same technical effect. To avoid repetition, the present invention will not go into details.
[0136] The beneficial effects of the present invention are as follows:
[0137] When a user makes an orchestration request, the API orchestration execution engine can flexibly orchestrate multiple APIs according to the user's API orchestration requirements, and finally build an API call service. In this way, users can flexibly reassemble the functions of the API call service and quickly publish the reassembled API call service, thereby avoiding the problem that the existing business system is overly dependent on the old business process and the API orchestration execution engine is too cumbersome to achieve low latency and high throughput.
[0138] System Example
[0139] Reference Manual Attached Figure 3 , showing a structural diagram of an API orchestration execution system provided by an embodiment of the present invention.
[0140] The present invention proposes an API orchestration execution system 30 , comprising: a memory 303 and one or more processors 301 .
[0141] One or more application programs are stored in the memory 303 , and the one or more application programs are suitable for being executed by the one or more processors 301 to implement the API orchestration execution method described in the method embodiment.
[0142] The API orchestration execution system 30 includes: a processor 301 and a memory 303. The processor 301 and the memory 303 are connected, for example, through a bus 302.
[0143] The structure of the API orchestration execution system 30 does not constitute a limitation on the embodiment of the present invention.
[0144] The beneficial effects of the present invention are as follows:
[0145] When a user makes an orchestration request, the API orchestration execution engine can flexibly orchestrate multiple APIs according to the user's API orchestration requirements, and finally build an API call service. In this way, users can flexibly reassemble the functions of the API call service and quickly publish the reassembled API call service, thereby avoiding the problem that the existing business system is overly dependent on the old business process and the API orchestration execution engine is too cumbersome to achieve low latency and high throughput.
[0146] Processor 301 may be a CPU, a general purpose processor, a DSP, an ASIC, an FPGA or other programmable logic device, a transistor logic device, a hardware component or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of the present invention. Processor 301 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0147] The bus 302 may include a path to transmit information between the above components. The bus 302 may be a PCI bus or an EISA bus, etc. The bus 302 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0148] The memory 303 can be a ROM or other type of static storage device that can store static information and instructions, a RAM or other type of dynamic storage device that can store information and instructions, or an EEPROM, a CD-ROM or other optical disk storage, an optical disk storage (including a compressed optical disk, a laser disk, an optical disk, a digital versatile disk, a Blu-ray disk, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited to these.
[0149] Computer Readable Storage Medium Embodiments
[0150] The present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program can be loaded and executed by a processor to arrange and execute the execution method according to the API in the first aspect.
[0151] The applicant of the present invention has made a detailed explanation and description of the implementation examples of the present invention in conjunction with the drawings in the specification. However, those skilled in the art should understand that the above implementation examples are only preferred implementation schemes of the present invention, and the detailed description is only to help readers better understand the spirit of the present invention, but not to limit the scope of protection of the present invention. On the contrary, any improvements or modifications based on the inventive spirit of the present invention should fall within the scope of protection of the present invention.
[0152] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the embodiments of the present invention, rather than to limit them. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions recorded in the above embodiments, or replace some of the technical features therein by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention. Any changes or replacements that can be easily thought of by those skilled in the art within the technical scope disclosed in the present invention should be covered within the protection scope of the present invention.
Claims
1. An API orchestration execution method, characterized in that: include: S1, obtaining a user's scheduling request, where the scheduling request includes a unique identifier; S2, obtaining the orchestration execution information of the API according to the unique identifier; S3, choreographing the service logic of the API according to the orchestration execution information, executing the atomic capability API of the node, and outputting return parameters.
2. The API arrangement execution method according to claim 1, characterized in that: The S2 specifically includes: S201: Build configuration reader; S202: According to the unique identifier, the environment configuration, and the runtime status, traverse the reader priority from high to low to obtain the orchestration execution information of the API, wherein the orchestration execution information of the API is to select a target reader that can generate an orchestration template reading strategy corresponding to the unique identifier; S203: configuring the arrangement template reading strategy in the target reader.
3. The API arrangement execution method according to claim 2, characterized in that: The readers include a file reader, a database reader, a redis middleware reader, and a jvm memory reader, and the jvm memory reader has a higher priority than the redis middleware reader, the redis middleware reader has a higher priority than the file reader, and the file reader has a higher priority than the database reader.
4. The API arrangement execution method according to claim 1, characterized in that: The S3 specifically includes: S301: Sending an asynchronous event notification of the start of a process according to the orchestration execution information; S302: calling the handle method of BaseHandler to execute the node processing logic; S303: Send a notification of the end of the process, and output and return the parameters.
5. The API arrangement execution method according to claim 4, characterized in that: The S302 specifically includes: Call the handle method of the BaseHandler and pass in the parameters of the node; Obtaining a processor corresponding to the node according to the type of the node; Call the preHandler pre-processing of the BaseHandler and send the pre-processing event; Call the pre-processor preHandler of the node to process the business logic of the current node; Process the child node business, call the handle method of the BaseHandler, and pass in the child node information, wherein the node includes at least one child node; Processing post-processing of the node; Call the afterHandle post-processing of the BaseHandler and send the post-processing event.
6. An API orchestration execution device, characterized in that: include: A first acquisition module, configured to acquire an orchestration request from a user, wherein the orchestration request includes a unique identifier; A second acquisition module, used to acquire the orchestration execution information of the API according to the unique identifier; The execution module is used to orchestrate the business logic of the API according to the orchestration execution information, execute the atomic capability API of the node, and output the return parameters.
7. The API arrangement execution device according to claim 6, characterized in that: The second acquisition module includes: Building modules for building configuration readers; A third acquisition module is used to traverse the reader priorities in descending order according to the unique identifier and the environment configuration and runtime status to acquire the orchestration execution information of the API, wherein the orchestration execution information of the API is to select a target reader that can generate an orchestration template reading strategy corresponding to the unique identifier; A configuration module is used to configure the arrangement template reading strategy in the target reader.
8. The API arrangement execution device according to claim 7, characterized in that: The readers include a file reader, a database reader, a redis middleware reader, and a jvm memory reader, and the jvm memory reader has a higher priority than the redis middleware reader, the redis middleware reader has a higher priority than the file reader, and the file reader has a higher priority than the database reader.
9. The API arrangement execution device according to claim 6, characterized in that: The execution module specifically includes: A first sending module, configured to send an asynchronous event notification of the start of a process according to the orchestration execution information; A calling module is used to call the handle method of BaseHandler to execute the node processing logic; The second sending module is used to send a notification of the end of the process and output and return the parameters.
10. The API arrangement execution device according to claim 9, characterized in that: The calling module is specifically used for: Call the handle method of the BaseHandler and pass in the parameters of the node; Obtaining a processor corresponding to the node according to the type of the node; Call the preHandler pre-processing of the BaseHandler and send the pre-processing event; Call the pre-processor preHandler of the node to process the business logic of the current node; Process the child node business, call the handle method of the BaseHandler, and pass in the child node information, wherein the node includes at least one child node; Processing post-processing of the node; Call the afterHandle post-processing of the BaseHandler and send the post-processing event.
