Interface calling method, device and electronic device
Through the business engine management end, the interface metadata of the middle-end service device is orchestrated, and the interface orchestration data is generated and sent to the middle-end service device, which solves the problem of dynamic interface orchestration in the middle-end strategic model and realizes the flexibility and control of the interface call process.
Patent Information
- Application Number
- CN202011485622.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-16
- Publication Date
- 2025-06-06
- Estimated Expiration
- 2040-12-16
AI Technical Summary
In the middle-end strategic model, how to achieve a set of middle-end services that can dynamically orchestrate interfaces to solve the flexibility and control problems of interface call process.
The service engine management end receives interface metadata sent by the middle-end service device, loads and orchestrates the interface's internal processing logic, generates interface orchestration data, and sends it to the middle-end service device to realize dynamic orchestration and calls of the interface.
It realizes dynamic orchestration of interfaces, improves flexibility and easy control of interface calling process, and supports dynamic adjustment of business rules during operation.
Smart Images

Figure CN112506590B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of cloud deployment technology, and in particular to an interface calling method, device and electronic device. Background Art
[0002] The middle platform architecture is actually composed of several layers. Among them, the microservice technology middle platform is an important part of building the middle platform architecture. SpringCloud and Kubernetes are the mainstream technology stacks currently used by Internet companies to build microservice technology middle platforms. At present, the industry's IT construction has widely adopted the middle platform strategic model. The middle platform strategic model mainly emphasizes the abstract precipitation, modularization and reuse of organizational business and technical capabilities, thereby forming a strong support for various front-end businesses, enabling the front-end front-line businesses to adapt to the ever-changing market more agilely and quickly. However, the actual implementation of the ideal goal of the middle platform strategic model (small front desk, large middle platform) encountered difficulties such as how to implement a set of middle platform services and dynamically arrange interfaces. Summary of the invention
[0003] The embodiments of the present application provide an interface scheduling method, device and electronic device, which can realize dynamic scheduling of interfaces based on a set of middleware services.
[0004] In a first aspect, an embodiment of the present application provides an interface calling method, which is applied to a business engine management end, including:
[0005] Receive interface metadata of a target service sent by a middle platform service device, wherein the interface metadata includes an interface list and internal processing logic of each of a plurality of interfaces indicated by the interface list;
[0006] Load the internal processing logic of each interface in the interface management interface;
[0007] Performing orchestration processing on the internal processing logic of a target interface among the multiple interfaces to obtain interface orchestration data, wherein the target interface is any interface among the multiple interfaces or a designated interface;
[0008] The interface arrangement data is sent to the middle platform service device so that the middle platform service device implements the interface call according to the interface arrangement data.
[0009] Optionally, the interface metadata is obtained by querying the middle platform service device according to the identification information of the target service carried in the interface metadata query instruction after receiving the interface metadata query instruction sent by the business engine management terminal; or
[0010] The interface metadata is obtained by the middle platform service device through the business engine client software development tool kit according to the preset annotations in the target service when the target service is running.
[0011] Optionally, the interface list includes description information of each interface in the multiple interfaces;
[0012] The internal processing logic of the interface includes identification information of events of the interface and identification information of rules associated with the events; the events are divided into pre-events and post-events, and the rules are divided into pre-rules and post-rules.
[0013] Optionally, the orchestrating the internal processing logic of the target interface among the multiple interfaces includes at least one of the following:
[0014] Adjusting the internal processing logic of the target interface among the multiple interfaces in a regular order;
[0015] Performing event start and stop settings on the internal processing logic of the target interface;
[0016] Perform rule start and stop settings on the internal processing logic of the target interface;
[0017] A rule change process is performed on the internal processing logic of the target interface.
[0018] In a second aspect, the embodiment of the present application further provides an interface calling method, which is applied to a middle platform service device, including:
[0019] Receive the interface request of the requester for the target service;
[0020] When it is determined that the target service has updated interface metadata, the updated interface metadata is loaded in the target service; wherein the updated interface metadata is obtained by the middle platform service device updating the interface metadata of the target service using the interface orchestration data sent by the business engine management terminal;
[0021] Start executing the method of the interface pointed to by the interface request;
[0022] During the execution of the method of the interface, if a call statement to a functional unit of the interface is detected, the start / stop state of the functional unit is obtained, and when the start / stop state is determined to be enabled, the functional unit is run; the functional unit is an event or a rule associated with the event;
[0023] After the execution of the method of the interface is completed, the response result data to the interface request is obtained, and the response result data is returned to the requesting party.
[0024] Optionally, the functional unit includes event association rules, the rules include dynamic rules, and the dynamic rules are rules newly added by the business engine management end or rules of interfaces of other services; and running the functional unit includes:
[0025] When the rules include dynamic rules, the objects corresponding to the dynamic rules are initialized, and the script engine is started to run the dynamic rules.
[0026] Optionally, the method further comprises:
[0027] receiving an interface metadata query instruction sent by the business engine management end, querying the interface metadata of the target service according to the identification information of the target service carried in the interface metadata query instruction, and sending the interface metadata of the target service to the business engine management end; or,
[0028] When the target service is running, the preset annotations in the target service are scanned by the business engine client software development toolkit to obtain the target service interface metadata, and the interface metadata of the target service is sent to the business engine management end.
[0029] In a third aspect, an embodiment of the present application provides an interface calling device, which is applied to a service engine management end, including:
[0030] A communication module, configured to receive interface metadata of a target service sent by a middle platform service device, wherein the interface metadata includes an interface list and internal processing logic of each of a plurality of interfaces indicated by the interface list;
[0031] A display module, used for loading the internal processing logic of each interface in the interface management interface;
[0032] A processing module, used for performing orchestration processing on the internal processing logic of a target interface among the multiple interfaces to obtain interface orchestration data, wherein the target interface is any interface among the multiple interfaces or a designated interface;
[0033] The communication module is further used to send the interface orchestration data to the middle platform service device, so that the middle platform service device implements interface calling according to the interface orchestration data.
[0034] In a fourth aspect, an embodiment of the present application provides an interface calling device, which is applied to a middle platform service device, including:
[0035] A communication module, used for receiving an interface request from a requester for a target service;
[0036] A processing module, configured to load the updated interface metadata in the target service when it is determined that the target service has updated interface metadata; wherein the updated interface metadata is obtained by the middle platform service device updating the interface metadata of the target service using the interface orchestration data sent by the business engine management terminal;
[0037] The processing module is further used to start executing the method of the interface pointed to by the interface request, and during the execution of the method of the interface, if a call statement to a functional unit of the interface is detected, obtain the start / stop state of the functional unit, and when determining that the start / stop state is enabled, run the functional unit; the functional unit is an event or a rule associated with the event;
[0038] The communication module is also used to obtain response result data to the interface request after the execution of the interface method is completed, and return the response result data to the requesting party.
[0039] In a fifth aspect, an embodiment of the present application provides an electronic device, comprising a processor, an input device, an output device and a memory, wherein the processor and the memory are interconnected, wherein the memory is used to store a computer program, the computer program comprises program instructions, and the processor is configured to call the program instructions to execute the method as described in the first aspect, or to execute the method as described in the second aspect.
[0040] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement the method as described in the first aspect, or to implement the method as described in the second aspect.
[0041] To summarize, the business engine management end can receive the interface metadata of the target service sent by the middle-office service device, and load the internal processing logic of each of the multiple interfaces included in the interface metadata in the interface management interface; the business engine management end can orchestrate the internal processing logic of the target interface among the multiple interfaces, obtain interface orchestration data, and send the interface orchestration data to the middle-office service device, so that the middle-office service device can implement interface call according to the interface orchestration data, thereby achieving the purpose of dynamic orchestration of the interface, making the interface calling process more flexible and easy to control. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0043] Figure 1a It is a schematic diagram of the network structure of an interface scheduling system provided in an embodiment of the present application;
[0044] Figure 1bis a schematic diagram of the network structure of another interface scheduling system provided in an embodiment of the present application;
[0045] Figure 1c is a schematic diagram of a development model provided in an embodiment of the present application;
[0046] Figure 2 It is a flowchart of an interface scheduling method provided in an embodiment of the present application;
[0047] Figure 3a is a schematic diagram of a first interface provided in an embodiment of the present application;
[0048] Figure 3b is a schematic diagram of a second interface provided in an embodiment of the present application;
[0049] Figure 3c is a schematic diagram of an interface management interface provided in an embodiment of the present application;
[0050] Figure 4 It is a flowchart of another interface scheduling method provided in an embodiment of the present application;
[0051] Figure 5 It is a structural diagram of an interface calling device provided in an embodiment of the present application;
[0052] Figure 6 It is a structural diagram of another interface calling device provided in an embodiment of the present application;
[0053] Figure 7 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0054] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.
[0055] In an embodiment of the present application, the business engine can be a mid-stage service development framework, and the business engine can include client software development kit (SDK) functions and management end functions. The business engine can develop interfaces that require dynamic orchestration rules. The business engine referred to is expanded on the existing technology stack, and by adding annotations to identify interfaces, objects, events, rules, and rule orchestration logic, it is easier to implement code transformation and development, and then the business engine can be driven by business operation to implement business logic according to dynamically adjusted rules.
[0056] In the embodiments of the present application, the business engine is fully compatible with the existing technology stack and can coexist. The business engine specification development is adopted, which is mainly used to meet business scenarios that may require dynamic adjustment of business rules during operation, and there will be corresponding sacrifices in development workload and maintainability. Therefore, interface development can adopt two coexisting development modes, namely the conventional mode and the business engine intervention mode. The conventional development mode is the normal development method of the existing technology stack; the business engine intervention mode is the development method provided by this application. During development, this application can combine the business characteristics to identify whether the interface of the corresponding service has a scenario where business rules need to be dynamically adjusted, and after identifying the scenario where business rules need to be dynamically adjusted (which can be combined with product design suggestions), it adopts the business engine intervention mode for development.
[0057] This application can abstract the internal processing logic of the interface into multiple rules during the interface development phase, and implement the complete business processing logic of the interface by assembling these rules. In addition, this application can implement dynamic orchestration and adjustment of interface rules through the business engine management end during the interface management phase, without restarting the system to complete the hot modification of the business processing logic of the interface. In actual application scenarios, this application can introduce the business engine client SDK in each service of the middle-office service device, such as each microservice. The business engine client SDK can implement parsing annotations, and can also implement functions such as obtaining corresponding interface metadata when the service is running to send it to the business engine management end.
[0058] See also Figure 1a and Figure 1bThe interface calling system shown, developers can introduce the business engine client SDK into the service when developing the service. Then, based on the business engine client SDK, the service interface, the business logic unit of the interface, and the initial orchestration configuration information of the interface are developed, and then the service can be deployed to the middle-office service device. Among them, the business logic unit may refer to the code of each rule in at least one rule corresponding to the interface. The initial orchestration configuration information may include the identification information of the object of the interface, the event list of the object (including the identification information of the event), the rule list of the event (including the identification information of the rules associated with the event), and the orchestration logic between the rules. The front-end system can call the service of the middle-office service device, such as through a gateway device, such as an interface gateway (API Gateway, APIG) device to make an interface call to the service deployed on the middle-office service device. In addition, the services running the middle-office service can also make interface calls to each other, which will not be explained in detail here. The services of the middle-office service equipment, such as the project library service center, can have multiple interfaces. The business engine management end can obtain services from the middle-office service equipment, such as the interface metadata of the project library service information, and orchestrate the internal processing logic of the interface included in the interface metadata, such as the internal processing logic newly added to a specific type of project, to obtain interface orchestration data, and send the interface orchestration data to the middle-office service equipment. The middle-office service equipment can store the interface orchestration data, or use the interface orchestration data to update the interface metadata to obtain updated interface metadata.
[0059] In the actual development process, developers can develop service interfaces, business logic units of interfaces, and initial orchestration configuration information of interfaces according to the development model. The development model here can be found in Figure 1c . Figure 1c The pre-rules shown may include Rule 1, Rule 2, Rule 3, and Rule 4. Rule 1 is a rule that requires calling a rule engine, and Rule 2 is a rule that requires calling a data engine. Figure 1c The post-rules shown include Rule 1 and Rule 2. Rule 1 included in the post-rules is a rule that needs to call other tools or services, and Rule 2 included in the post-rules is a rule that needs to call a data engine.
[0060] See code example 1-4. During the interface development phase, developers can add annotations in the following ways: Developers can add annotations to interfaces, such as @BueApi. @BueApi can be used to identify interfaces and can be used to obtain information such as interface identification information. Developers can add annotations to objects, such as @BuePO, and configure the event list corresponding to the object. Among them, @BuePO can be used to identify objects and can be used to obtain information such as object identification information. Developers can add annotations to events, such as @BueEvent, and add core business logic (standardization, productization) in the method body of the event method. Among them, the annotation @BueEvent can be used to identify events and can be used to obtain information such as event identification information. Developers can add annotations to event-related rules, such as @BueRule. Among them, @BueRule can be used to identify rules and can be used to obtain information such as rule identification information. In addition, see code example 5, developers can also set the initial orchestration configuration information of the interface.
[0061] Code Example 1:
[0062]
[0063] Code Example 2:
[0064]
[0065] Code Example 3:
[0066]
[0067] Code Example 4:
[0068]
[0069]
[0070] Code Example 5:
[0071]
[0072]
[0073] The following is an introduction to the interface calling method, device and electronic device provided in the embodiments of the present application.
[0074] See also Figure 2 , is a flow chart of an interface calling method provided in an embodiment of the present application. The method can be applied to the business engine management end. The method can include the following steps:
[0075] S201. Receive interface metadata of a target service sent by a middleware service device, where the interface metadata includes an interface list and internal processing logic of each of a plurality of interfaces indicated by the interface list.
[0076] The interface referred to may refer to an interface that can be programmed by the service engine management end, or an interface that the service engine management end has the authority to programme.
[0077] The interface list referred to includes description information of each interface in the plurality of interfaces. The interface description information may include at least one of the following: the name of the interface, the uniform resource locator (URL) of the interface, the creation time of the interface, and the update time of the interface. In one embodiment, the interface list referred to may also include identification information of the service (such as the name of the service).
[0078] The internal processing logic referred to may include the identification information of the event of the interface (such as the name of the event) and the identification information of the rule associated with the event (such as the name of the rule). Events can be divided into pre-events and post-events. Rules can be divided into pre-rules and post-rules. In one embodiment, the internal processing logic may also include the start and stop status of the event and / or the start and stop status of the rule.
[0079] In one embodiment, the internal processing logic may further include identification information of an object of the interface (such as the name of the object), and the event may include an event corresponding to the object.
[0080] In one embodiment, the interface metadata may also include historical version information of each interface. The historical version information may include version information obtained after each programming process of the internal processing logic of the interface within a preset time range (eg, within the past year).
[0081] In one embodiment, the interface metadata port may be obtained by the business engine client SDK according to a preset annotation in the target service when the target service is running, and the preset annotation may be set by a developer in the target service.
[0082] In one embodiment, the interface metadata is obtained by querying the middle office service device according to the identification information of the target service carried in the interface metadata query instruction after receiving the interface metadata query instruction sent by the business engine management terminal.
[0083] S202: Load the internal processing logic of each interface in the interface management interface.
[0084] S203: Perform orchestration processing on the internal processing logic of a target interface among the multiple interfaces to obtain interface orchestration data, wherein the target interface is any interface among the multiple interfaces or a designated interface.
[0085] In step S202 and step S203, the business engine management end can load the internal processing logic of each interface in the interface management interface, and perform orchestration processing on the internal processing logic of the target interface among the multiple interfaces to obtain interface orchestration data, thereby achieving the purpose of dynamically arranging interfaces. The target interface can be any interface among the multiple interfaces or a specified interface.
[0086] In one embodiment, the business engine management end arranges and processes the internal processing logic of the target interface among the multiple interfaces, which may include at least one of the following: the business engine management end adjusts the rule sequence of the internal processing logic of the target interface among the multiple interfaces; the business engine management end performs event start and stop settings on the internal processing logic of the target interface; the business engine management end performs rule start and stop settings on the internal processing logic of the target interface; the business engine management end performs rule change processing on the internal processing logic of the target interface. The rule change processing referred to may include at least one of the following: adding a new rule, deleting a rule, and modifying a rule.
[0087] In an application scenario, taking the rule start and stop settings as an example, the administrator can check the rules that are not enabled on the target interface. The business engine management end can detect the check operation of the unenabled rule and set the start and stop status of the rule to enabled. The administrator can uncheck the rules that are enabled on the target interface. The business engine management end can detect the uncheck operation of the enabled rule and set the start and stop status of the rule to disabled. The above check process can be based on Figure 3c For another example, taking adding a rule as an example, the administrator can click on the add a rule option for the target interface, and when the business engine management end detects the click operation on the add a rule option, it displays the editing interface for the new rule, and then the administrator can edit the new rule on the editing interface, and then the business engine management end can obtain the new rule and generate interface arrangement data including the new rule.
[0088] In one embodiment, the service engine management terminal may display an interface list on the first interface.
[0089] In one embodiment, when the service engine management terminal detects a version management instruction for a target interface of multiple interfaces on the first interface, the target interface history arrangement version information can be displayed on the second interface.
[0090] In an application scenario, the first interface can be Figure 3aThe interface shown, the second interface is Figure 3b The interface shown. Figure 3a The interface shown includes version options for each interface. Administrators can click Figure 3a The project in the interface shown in the figure has a new interface corresponding to the version option. The business engine management end can detect the Figure 3a When the version option corresponding to the newly added interface of the project is clicked in the interface shown, a version management instruction for the newly added interface of the project is generated. The business engine management end can detect the version management instruction for the newly added interface of the project and display the historical arrangement and typesetting information of the newly added interface of the project, such as Figure 3b The two arrangement version information in the interface shown may include at least one of the following: code version, interface version, interface status, service release version, version creation time, version update time and other information.
[0091] In one embodiment, when the business engine management terminal detects a rule editing instruction for the target interface on the second interface, it can display the internal processing logic arrangement of the target interface on the interface management interface, and then process the internal processing logic of the interface to obtain interface arrangement data. The interface management interface can be the second interface or not, and the embodiment of the present application does not limit it.
[0092] In one application scenario, the second interface is Figure 3b The interface shown in Figure 3b In the interface shown, the options corresponding to the first version arrangement information include a rule editing option. When the business engine management terminal detects a click operation on the rule editing option corresponding to the first arrangement version information, Figure 3c As shown in the interface, the internal processing logic of the newly added interface of the project is displayed, and the internal processing logic of the interface is processed
[0093] In one embodiment, the business engine management terminal can also perform a version copy operation based on the second interface. The version arrangement information included in the second interface can correspond to a copy button. In an application scenario, see Figure 3b When the business engine detects a click operation on the copy button corresponding to the second version arrangement information, it can copy the second version arrangement information, thereby achieving the purpose of version copying.
[0094] In one embodiment, the business engine management terminal can also perform a version rollback operation based on the second interface. For example, the administrator can select one of the version arrangement information of the second interface through the business engine management terminal, and the business engine management terminal can obtain the interface arrangement data corresponding to the selected version arrangement information to send to the middle office service device, and the interface arrangement data corresponding to the selected version arrangement information can be used to update the corresponding interface metadata in the middle office service device, thereby achieving the purpose of version rollback.
[0095] S204: Send the interface arrangement data to the middle platform service device, so that the middle platform service device implements interface calling according to the interface arrangement data.
[0096] In an embodiment of the present application, the business engine management end can send the interface orchestration data to the middle-office service device, and the middle-office service device can receive the interface orchestration data and store the interface orchestration data, or use the interface orchestration data to update the interface metadata to obtain the updated interface metadata for use in the calling process of the target interface.
[0097] In one embodiment, the business engine management terminal opens a rule management interface. The rule management interface may include information such as identification information of each rule in at least one rule corresponding to each service in the multiple services. The business engine management terminal may perform rule reset processing on the first service in the multiple services based on the rule management interface. In an application scenario, an administrator may open the rule management interface through the business engine management terminal. The administrator may perform a rule reset operation based on the rule management interface, and the business engine management terminal may reset a rule of a service in the multiple services based on the rule reset operation.
[0098] In one embodiment, the business engine management end may identify the type of each rule in at least one rule corresponding to each of the multiple services; when the business engine management end determines that the rule is a rule newly added by the business engine management end according to the type of the rule, the business engine management end grants the rule change authority. After granting the rule change authority to the rule, the business engine management end may perform add / delete / modify operations on the rule.
[0099] In one embodiment, the business engine management end can also open a service management interface, which includes identification information of each service in a plurality of services, the code version of each service, the release version of each service, and the status information of each service. In one embodiment, a service in the service management interface with an enabled status can correspond to a metadata option and a remark option, and a service in a disabled status can correspond to a metadata option, an enable option, and a remark option. When the business engine management end detects a click operation on a metadata option corresponding to a second service in the service management interface, the interface metadata of the second service can be viewed. When a click operation on an enable option corresponding to a disabled service in the service management interface is detected, the disabled service can be started. In one embodiment, the business engine management end can also perform a version rollback operation based on the service management interface.
[0100] In one embodiment, the business engine management end can also monitor the operating status of each of the multiple interfaces of the target service in the middle-office service device, and when an interface that fails to operate is detected, output operation failure alarm information to the designated device for alarm.
[0101] visible, Figure 2 In the illustrated embodiment, the business engine management end can receive the interface metadata of the target service sent by the middle-office service device, and load the internal processing logic of each of the multiple interfaces included in the interface metadata in the interface management interface; the business engine management end can orchestrate the internal processing logic of the target interface among the multiple interfaces to obtain interface orchestration data, and send the interface orchestration data to the middle-office service device, so that the middle-office service device can implement interface calls according to the interface orchestration data, thereby achieving the purpose of dynamic orchestration of interfaces.
[0102] The present application relates to blockchain technology, such as the interface orchestration data can be encrypted and written into the blockchain.
[0103] See also Figure 4 , is a flow chart of another interface calling method provided in an embodiment of the present application. The method can be applied to a middle station service device. The method can include the following steps:
[0104] S401: Receive an interface request from a requesting party for a target service.
[0105] In an embodiment of the present application, the requester may send an interface request for the target service to the middle-office service device, and the middle-office service device may receive the interface request for the target service from the requester.
[0106] In one embodiment, the requester can send an interface request for the target service through a gateway device, and the middle-office service device can receive the interface request for the target service sent by the requester through the gateway device. Specifically, the requester can send an interface request for the target service to the gateway device, and the gateway device verifies whether the requester has access rights to the middle-office service device. If so, the gateway device converts the interface input parameters carried by the interface request to obtain the converted interface input parameters, and the converted interface input parameters can be processed by the interface of the target service. The security and effectiveness of the interface call process can be improved through the gateway device.
[0107] S402: When it is determined that the target service has updated interface metadata, load the updated interface metadata into the target service.
[0108] The updated interface metadata is obtained by the middle platform service device updating the interface metadata of the target service using the interface orchestration data sent by the business engine management end. The interface orchestration data is obtained by the business engine management end orchestrating the interface included in the interface metadata, such as the internal processing logic of the target interface.
[0109] In one embodiment, the middle platform service device can obtain the historical arrangement version information of each interface of the target service, and determine whether the target service has updated interface metadata based on the historical arrangement version information. The historical arrangement version information may include the arrangement version information obtained after the internal processing logic of the interface is arranged each time within a preset time range (such as within the past year).
[0110] In one embodiment, the middle office service device can obtain the currently enabled orchestration version information of the interface, and compare the currently enabled interface version information with the historical orchestration version information to determine whether the currently enabled orchestration version information is the latest interface version information to be enabled. If not, it determines whether the target service has updated interface metadata.
[0111] S403: Start executing the method of the interface pointed to by the interface request.
[0112] In the embodiment of the present application, the middle office service device may start executing the method body of the method of the interface pointed to by the interface request.
[0113] In one embodiment, the middle platform service device may start executing the method body of the method of the interface pointed to by the interface request according to the converted access input parameter.
[0114] S404. During the execution of the method of the interface, if a call statement to a functional unit of the interface is detected, the start / stop state of the functional unit is obtained, and when the start / stop state is determined to be enabled, the functional unit is run; the functional unit is an event or a rule associated with the event.
[0115] In the embodiment of the present application, when the function unit is an event, if the middle service device detects a call statement for the event during the execution of the method of the interface, the start and stop status of the event is obtained, and when the start and stop status of the event is determined to be enabled, the method of the event is executed. When the function unit is a rule associated with the event, when the middle service device detects a call statement for the rule associated with the event during the execution of the method of the interface, the start and stop status of the rule is obtained. If the start and stop status is enabled, the rule is executed.
[0116] In one embodiment, the middle platform service device can also determine whether a dynamic rule is added to the rule. If so, the object corresponding to the dynamic rule is initialized and the script engine is started to execute the dynamic rule. The dynamic rule here can be a rule added by the business engine management end, or a rule of an interface of other services.
[0117] S405: After the execution of the method of the interface is completed, the response result data to the interface request is obtained, and the response result data is returned to the requesting party.
[0118] In one embodiment, the middle office service device may execute the static code of the target service when it is determined that the target service does not have updated interface metadata, obtain response result data to the interface request, and send the response result data to the requester.
[0119] In one embodiment, when the requesting party sends the interface request to the middle platform service device through the gateway device, the middle platform service device can send the response result data to the requesting party through the gateway device. Specifically, the middle platform service device can send the response result data to the gateway device, and the gateway device converts the response result data to obtain the converted response result data to send to the requesting party, and the converted response result data can be processed by the requesting party.
[0120] In one embodiment, the middle-office service device can also send the interface metadata of the target service to the business engine management end when the target service is running, so that the business engine management end can perform orchestration processing according to the internal processing logic of the interface included in the interface metadata. Specifically, the middle-office service device can scan out the interface metadata of the target service through the business engine client SDK when the target service is running, and then send the interface metadata of the target service to the business engine management end. More specifically, the middle-office service device can scan out the interface metadata of the target service according to the preset annotations in the target service through the business engine client SDK when the target service is running, and then send the interface metadata of the target service to the business engine management end. Or, the middle-office service device can also receive an interface metadata query instruction sent by the business engine management end, and query the interface metadata of the target service according to the identification information of the target service carried by the interface metadata query instruction, and then send the interface metadata of the target service to the business engine management end;
[0121] In one embodiment, the business engine operation may be provided with an intervention switch. The intervention switch is used to determine whether to initialize the business engine when the target service is running. If the intervention switch is turned off, the target service runs in the default display code sequence when running. If the intervention switch is turned on, the business engine runs normally. The middle platform service device may load the updated interface metadata in the target service when it is determined that the intervention switch of the business engine is turned on and that the target service has updated interface metadata.
[0122] visible, Figure 4 In the illustrated embodiment, the middle-office service device can receive an interface request from a requester for a target service, and when it is determined that the target service has updated interface metadata, load the updated interface metadata into the target service; then, the middle-office service device can start to execute the method of the interface pointed to by the interface request, and during the execution of the method of the interface, if a call statement to a functional unit of the interface is detected, the start / stop status of the functional unit is obtained, and when it is determined that the start / stop status is enabled, the functional unit is run, so that after the execution of the method of the interface is completed, response result data to the interface request is obtained, and the response result data is returned to the requester, so that the interface calling process is more flexible and easier to control.
[0123] See also Figure 5 , is a structural diagram of an interface calling device provided in an embodiment of the present application. The interface calling device can be applied to a business engine management end. Specifically, the interface calling device may include:
[0124] The communication module 501 is used to receive the interface metadata of the target service sent by the middle platform service device, and the interface metadata includes an interface list and the internal processing logic of each interface in the multiple interfaces indicated by the interface list.
[0125] The display module 502 is used to load the internal processing logic of each interface in the interface management interface.
[0126] The processing module 503 is used to perform orchestration processing on the internal processing logic of the target interface among the multiple interfaces to obtain interface orchestration data, wherein the target interface is any interface among the multiple interfaces or a designated interface.
[0127] The communication module 501 is further used to send the interface arrangement data to the middle platform service device, so that the middle platform service device implements the interface call according to the interface arrangement data.
[0128] In an optional implementation, the interface metadata is obtained by the middle-office service device after receiving the interface metadata query instruction sent by the business engine management terminal, based on the identification information of the target service carried in the interface metadata query instruction; or, the interface metadata is obtained by the middle-office service device through the business engine client software development kit according to preset annotations in the target service when the target service is running.
[0129] In an optional embodiment, the interface list includes description information of each interface in the multiple interfaces; the internal processing logic of the interface includes identification information of the interface events and identification information of the rules associated with the events; the events are divided into pre-events and post-events, and the rules are divided into pre-rules and post-rules.
[0130] In an optional embodiment, the processing module 503 is used to orchestrate the internal processing logic of the target interface among the multiple interfaces, including at least one of the following: adjusting the rule order of the internal processing logic of the target interface among the multiple interfaces; performing event start and stop settings on the internal processing logic of the target interface; performing rule start and stop settings on the internal processing logic of the target interface; and performing rule change processing on the internal processing logic of the target interface.
[0131] visible, Figure 5 In the illustrated embodiment, the interface calling device can receive the interface metadata of the target service sent by the middle-office service device, and load the internal processing logic of each of the multiple interfaces included in the interface metadata in the interface management interface; the interface calling device can orchestrate the internal processing logic of the target interface among the multiple interfaces to obtain interface orchestration data, and send the interface orchestration data to the middle-office service device, so that the middle-office service device implements the interface call according to the interface orchestration data, thereby achieving the purpose of dynamic orchestration of the interface.
[0132] See also Figure 6 , is a structural diagram of another interface calling device provided in an embodiment of the present application. The interface calling device can be applied to a business engine management end. Specifically, the interface calling device may include:
[0133] The communication module 601 is used to receive an interface request from a requesting party for a target service.
[0134] Processing module 602 is used to load the updated interface metadata in the target service when it is determined that the target service has updated interface metadata; wherein the updated interface metadata is obtained by the middle-office service device updating the interface metadata of the target service using the interface orchestration data sent by the business engine management terminal.
[0135] Processing module 602 is also used to start executing the method of the interface pointed to by the interface request, and during the execution of the method of the interface, if a call statement to the functional unit of the interface is detected, the start and stop status of the functional unit is obtained, and when it is determined that the start and stop status is enabled, the functional unit is run; the functional unit is an event or a rule associated with the event.
[0136] The communication module 601 is also used to obtain response result data to the interface request after the execution of the interface method is completed, and return the response result data to the requesting party.
[0137] In an optional implementation, the functional unit includes event-associated rules, the rules include dynamic rules, and the dynamic rules are rules newly added to the business engine management end or rules for interfaces of other services; the processing module 602 runs the functional unit, specifically when the rules include dynamic rules, the objects corresponding to the dynamic rules are initialized, and the script engine is started to run the dynamic rules.
[0138] In an optional embodiment, the processing module 602 is also used to receive an interface metadata query instruction sent by the business engine management end through the communication module 601, query the interface metadata of the target service according to the identification information of the target service carried in the interface metadata query instruction, and send the interface metadata of the target service to the business engine management end through the communication module 601; or, when the target service is running, scan the preset annotations in the target service through the business engine client software development kit to obtain the target service interface metadata, and send the interface metadata of the target service to the business engine management end through the communication module 601.
[0139] visible, Figure 6 In the illustrated embodiment, the interface calling device can receive an interface request from a requesting party for a target service, and when it is determined that the target service has updated interface metadata, load the updated interface metadata into the target service; then, the interface calling device can start executing the method of the interface pointed to by the interface request, and during the execution of the method of the interface, if a call statement to a functional unit of the interface is detected, the start / stop status of the functional unit is obtained, and when it is determined that the start / stop status is enabled, the functional unit is run, so that after the execution of the method of the interface is completed, response result data to the interface request is obtained, and the response result data is returned to the requesting party, so that the interface calling process is more flexible and easier to control.
[0140] See also Figure 7, is a structural diagram of an electronic device provided by the present application. The electronic device may be the business engine management terminal or the middle office service device mentioned in the aforementioned embodiment. The electronic device described in the embodiment of the present application may include: one or more processors 1000, one or more input devices 2000, one or more output devices 3000 and a memory 4000. The processor 1000, the input device 2000, the output device 3000 and the memory 4000 may be connected via a bus. The input device 2000 and the output device 3000 may include a standard wired or wireless communication interface. The input device 2000 may also include devices such as a touch screen or a touch display screen, and the output device 3000 may also include devices such as a display screen or a touch display screen, which is not limited by the embodiment of the present application.
[0141] The processor 1000 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.
[0142] The memory 4000 may be a high-speed RAM memory or a non-volatile memory, such as a disk memory. The memory 4000 is used to store a computer program, which includes program instructions.
[0143] In the embodiment of the present application, when the electronic device is a service engine management terminal, the processor 1000 is configured to call the program instructions and execute the following steps:
[0144] Receiving, through the input device 2000, interface metadata of the target service sent by the middle platform service device, the interface metadata including an interface list and internal processing logic of each of the multiple interfaces indicated by the interface list;
[0145] Loading the internal processing logic of each interface in the interface management interface through the output device 3000;
[0146] Performing orchestration processing on the internal processing logic of a target interface among the multiple interfaces to obtain interface orchestration data, wherein the target interface is any interface among the multiple interfaces or a designated interface;
[0147] The interface arrangement data is sent to the middle platform service device through the output device 3000, so that the middle platform service device implements the interface call according to the interface arrangement data.
[0148] In one embodiment, the interface metadata is obtained by the middle-office service device after receiving the interface metadata query instruction sent by the business engine management terminal, based on the identification information of the target service carried in the interface metadata query instruction; or, the interface metadata is obtained by the middle-office service device through the business engine client software development kit according to the preset annotations in the target service when the target service is running.
[0149] In one embodiment, the interface list includes description information of each interface in the multiple interfaces; the internal processing logic of the interface includes identification information of the events of the interface and identification information of the rules associated with the events; the events are divided into pre-events and post-events, and the rules are divided into pre-rules and post-rules.
[0150] In one embodiment, when the internal processing logic of the target interface among the multiple interfaces is arranged and processed, the processor 1000 is configured to call the program instruction to perform at least one of the following:
[0151] Adjusting the internal processing logic of the target interface among the multiple interfaces in a regular order;
[0152] Performing event start and stop settings on the internal processing logic of the target interface;
[0153] Perform rule start and stop settings on the internal processing logic of the target interface;
[0154] A rule change process is performed on the internal processing logic of the target interface.
[0155] In the embodiment of the present application, when the electronic device is a middleware service device, the processor 1000 is configured to call the program instructions and perform the following steps:
[0156] Receiving an interface request from a requester for a target service via an input device 2000;
[0157] When it is determined that the target service has updated interface metadata, the updated interface metadata is loaded in the target service; wherein the updated interface metadata is obtained by the middle platform service device updating the interface metadata of the target service using the interface orchestration data sent by the business engine management terminal;
[0158] Start executing the method of the interface pointed to by the interface request;
[0159] During the execution of the method of the interface, if a call statement to a functional unit of the interface is detected, the start / stop state of the functional unit is obtained, and when the start / stop state is determined to be enabled, the functional unit is run; the functional unit is an event or a rule associated with the event;
[0160] After the execution of the interface method is completed, the response result data to the interface request is obtained, and the response result data is returned to the requesting party through the output device 3000.
[0161] In one embodiment, the functional unit includes event-associated rules, the rules include dynamic rules, and the dynamic rules are rules newly added by the business engine management end or rules of interfaces of other services; when running the functional unit, the processor 1000 is configured to call the program instructions and perform the following steps:
[0162] When the rules include dynamic rules, the objects corresponding to the dynamic rules are initialized, and the script engine is started to run the dynamic rules.
[0163] In one embodiment, the processor 1000 is configured to call the program instructions and further perform the following steps:
[0164] Receiving the interface metadata query instruction sent by the business engine management end through the input device 2000, querying the interface metadata of the target service according to the identification information of the target service carried in the interface metadata query instruction, and sending the interface metadata of the target service to the business engine management end; or,
[0165] When the target service is running, the preset annotations in the target service are scanned by the business engine client software development toolkit to obtain the target service interface metadata, and the interface metadata of the target service is sent to the business engine management end through the output device 3000.
[0166] In a specific implementation, the processor 1000, the input device 2000, and the output device 3000 described in the embodiments of the present application may execute Figure 2 Example or Figure 4 The implementation method described in the embodiment can also execute the implementation method described in the embodiment of the present application, which will not be repeated here.
[0167] Each functional module in each embodiment of the present application can be integrated into a processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The above integrated modules can be implemented in the form of sampling hardware or sampling software functional modules.
[0168] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the computer-readable storage medium can be volatile or non-volatile. For example, the computer storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM). The computer-readable storage medium can mainly include a storage program area and a storage data area, wherein the storage program area can store an operating system, at least one application required for a function, etc.; the storage data area can store data created according to the use of the blockchain node, etc.
[0169] Among them, the blockchain referred to in this application is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.
[0170] What is disclosed above is only a preferred embodiment of the present application, and it certainly cannot be used to limit the scope of rights of the present application. Ordinary technicians in this field can understand that all or part of the processes of implementing the above embodiment and equivalent changes made according to the claims of the present application are still within the scope covered by the present application.
Claims
1. An interface calling method, It is characterized in that Applied to the business engine management end, including: Receive interface metadata of a target service sent by a middle platform service device, wherein the interface metadata includes an interface list and internal processing logic of each of a plurality of interfaces indicated by the interface list; The internal processing logic of each interface is loaded in the interface management interface; wherein the business engine is correspondingly provided with an intervention switch, and the intervention switch is used to determine whether to initialize the business engine when the target service is running. If the intervention switch is turned off, the target service runs in accordance with the default display code sequence when running, and if the intervention switch is turned on, the business engine runs normally; the internal processing logic includes identification information of the event of the interface, identification information of the rule associated with the event, start and stop status of the event and / or start and stop status of the rule, identification information of the object of the interface, and historical arrangement version information of each interface; events are divided into pre-events and post-events, and rules are divided into pre-rules and post-rules; Performing orchestration processing on the internal processing logic of a target interface among the multiple interfaces to obtain interface orchestration data, wherein the target interface is any interface among the multiple interfaces or a designated interface; wherein the performing orchestration processing on the internal processing logic of the target interface among the multiple interfaces comprises at least one of the following: performing rule sequence adjustment on the internal processing logic of the target interface among the multiple interfaces; performing event start and stop settings on the internal processing logic of the target interface; performing rule start and stop settings on the internal processing logic of the target interface; performing rule change processing on the internal processing logic of the target interface; The interface arrangement data is sent to the middle platform service device so that the middle platform service device implements the interface call according to the interface arrangement data.
2. The method according to claim 1, It is characterized in that The interface metadata is obtained by the middle platform service device after receiving the interface metadata query instruction sent by the business engine management terminal, according to the identification information of the target service carried in the interface metadata query instruction; or, The interface metadata is obtained by the middle platform service device through the business engine client software development tool kit according to the preset annotations in the target service when the target service is running.
3. An interface calling method, It is characterized in that Applied to middle office service equipment, including: Receive the interface request of the requester for the target service; When it is determined that the intervention switch of the business engine is turned on and the target service has updated interface metadata, the updated interface metadata is loaded in the target service; wherein the updated interface metadata is obtained by the middle platform service device using the interface orchestration data sent by the business engine management terminal to update the interface metadata of the target service; wherein the business engine is correspondingly provided with an intervention switch, and the intervention switch is used to determine whether to initialize the business engine when the target service is running. If the intervention switch is turned off, the target service runs according to the default display code sequence when running, and if the intervention switch is turned on, the business engine runs normally; the interface orchestration data is obtained by orchestrating the internal processing logic of the target interface among the multiple interfaces indicated by the interface metadata, and the internal processing logic includes the identification information of the event of the interface, the identification information of the rule associated with the event, the start and stop status of the event and / or the start and stop status of the rule, the identification information of the object of the interface, and the historical orchestration version information of each interface; events are divided into pre-events and post-events, and rules are divided into pre-rules and post-rules; the orchestration processing includes at least one of the following: rule order adjustment, event start and stop settings, rule start and stop settings, and rule change processing; Start executing the method of the interface pointed to by the interface request; During the execution of the method of the interface, if a call statement to a functional unit of the interface is detected, the start / stop state of the functional unit is obtained, and when it is determined that the start / stop state is enabled, the functional unit is run; the functional unit is an event or a rule associated with the event; if the functional unit is an event, during the execution of the method of the interface, if a call statement to an event is detected, the start / stop state of the event is obtained, and when it is determined that the start / stop state of the event is enabled, the method of the event is executed; if the functional unit is a rule associated with the event, during the execution of the method of the interface, if a call statement to a rule associated with the event is detected, the start / stop state of the rule is obtained, and when it is determined that the start / stop state of the rule is enabled, the rule is executed; After the execution of the method of the interface is completed, the response result data to the interface request is obtained, and the response result data is returned to the requesting party.
4. The method according to claim 3, It is characterized in that The functional unit includes event-related rules, the rules include dynamic rules, and the dynamic rules are rules newly added by the business engine management end or rules of interfaces of other services; the operation of the functional unit includes: When the rules include dynamic rules, the objects corresponding to the dynamic rules are initialized, and the script engine is started to run the dynamic rules.
5. The method according to claim 3 or 4, It is characterized in that The method further comprises: receiving an interface metadata query instruction sent by the business engine management end, querying the interface metadata of the target service according to the identification information of the target service carried in the interface metadata query instruction, and sending the interface metadata of the target service to the business engine management end; or, When the target service is running, the preset annotations in the target service are scanned by the business engine client software development toolkit to obtain the target service interface metadata, and the interface metadata of the target service is sent to the business engine management end.
6. An interface calling device, It is characterized in that Applied to the business engine management end, including: A communication module, used to receive interface metadata of a target service sent by a middle-office service device, wherein the interface metadata includes an interface list and internal processing logic of each of the multiple interfaces indicated by the interface list; wherein the business engine is correspondingly provided with an intervention switch, and the intervention switch is used to determine whether to initialize the business engine when the target service is running. If the intervention switch is turned off, the target service runs in accordance with a default display code sequence when running; if the intervention switch is turned on, the business engine runs normally; the internal processing logic includes identification information of interface events, identification information of rules associated with events, start and stop states of events and / or start and stop states of rules, identification information of interface objects, and historical arrangement version information of each interface; events are divided into pre-events and post-events, and rules are divided into pre-rules and post-rules; A display module, used for loading the internal processing logic of each interface in the interface management interface; A processing module, used for performing orchestration processing on the internal processing logic of a target interface among the multiple interfaces to obtain interface orchestration data, wherein the target interface is any interface among the multiple interfaces or a designated interface; wherein the orchestration processing on the internal processing logic of the target interface among the multiple interfaces comprises at least one of the following: performing rule sequence adjustment on the internal processing logic of the target interface among the multiple interfaces; performing event start and stop settings on the internal processing logic of the target interface; performing rule start and stop settings on the internal processing logic of the target interface; performing rule change processing on the internal processing logic of the target interface; The communication module is further used to send the interface orchestration data to the middle platform service device, so that the middle platform service device implements interface calling according to the interface orchestration data.
7. An interface calling device, It is characterized in that Applied to middle office service equipment, including: A communication module, used for receiving an interface request from a requester for a target service; A processing module, configured to load the updated interface metadata in the target service when it is determined that the intervention switch of the business engine is turned on and the target service has updated interface metadata; wherein the updated interface metadata is obtained by the middle platform service device updating the interface metadata of the target service using the interface orchestration data sent by the business engine management terminal; wherein the business engine is correspondingly provided with an intervention switch, and the intervention switch is used to determine whether to initialize the business engine when the target service is running, if the intervention switch is turned off, the target service runs according to the default display code sequence when running, and if the intervention switch is turned on, the business engine runs normally; the interface orchestration data is obtained by orchestrating the internal processing logic of the target interface among the multiple interfaces indicated by the interface metadata, and the internal processing logic includes the identification information of the event of the interface, the identification information of the rule associated with the event, the start and stop status of the event and / or the start and stop status of the rule, the identification information of the object of the interface, and the historical orchestration version information of each interface; events are divided into pre-events and post-events, and rules are divided into pre-rules and post-rules; the orchestration processing includes at least one of the following: rule sequence adjustment, event start and stop setting, rule start and stop setting, and rule change processing; The processing module is further used to start executing the method of the interface pointed to by the interface request, and during the execution of the method of the interface, if a call statement to a functional unit of the interface is detected, the start / stop state of the functional unit is obtained, and when the start / stop state is determined to be enabled, the functional unit is run; the functional unit is an event or a rule associated with the event; if the functional unit is an event, during the execution of the method of the interface, if a call statement to the event is detected, the start / stop state of the event is obtained, and when the start / stop state of the event is determined to be enabled, the method of the event is executed; if the functional unit is a rule associated with the event, during the execution of the method of the interface, if a call statement to the rule associated with the event is detected, the start / stop state of the rule is obtained, and when the start / stop state of the rule is determined to be enabled, the rule is executed; The communication module is also used to obtain response result data to the interface request after the execution of the interface method is completed, and return the response result data to the requesting party.
8. An electronic device, It is characterized in that The method comprises a processor, an input device, an output device and a memory, wherein the processor and the memory are connected to each other, wherein the memory is used to store a computer program, the computer program comprises program instructions, and the processor is configured to call the program instructions to execute the method according to any one of claims 1 to 5.
9. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
A system for flexibly configuring an interface and rapidly delivering a service
CN109542506A
Processing method and device for achieving API calling and system for achieving API
CN109739573A
Service interaction method and device based on service console, computer equipment and computer storage medium
CN111181943A