An api system and method for controlling data separation
Patent Information
- Application Number
- CN202211280393.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-19
- Publication Date
- 2026-09-29
- Estimated Expiration
- 2042-10-19
AI Technical Summary
[0006]本发明为了解决由于API技术的Request/Response形式固有的数据传输和数据执行控制的耦合特性,导致针对多上下文场景服务组合的系统无法兼顾运行效率和组合灵活性的问题,进而提出了一种控制数据分离的API系统及方法
[0054]本发明构建了一种新的API系统,通过定义API系统的标准化配置信息模块、标准化数据接收模块和标准化控制执行模块,同时构建API系统的数据缓冲存储模块、处理方法模块、目的服务引用模块,将上述部分组合为API系统。即所述API系统包括标准化数据接收模块、数据缓冲存储模块、标准化配置信息模块、处理方法模块、标准化控制执行模块、目的服务引用模块;标准化数据接收模块用于接收多个软件服务发送的入参;数据缓冲存储模块用于接收并储存标准化数据接收模块发送的入参;标准化配置信息模块用于存储驱动标准化控制执行模块在不同上下文下执行的标准化配置信息;所述标准化配置信息包括上下文信息、入参信息、处理方法信息、出参信息;处理方法模块用于提供软件服务的数据处理方法;目的服务引用模块,用于提供目的服务的数据接收模块引用信息;标准化控制执行模块用于执行控制器的控制请求、调用标准化配置信息模块的标准化配置信息、读取数据缓冲储存模块的入参、调用处理方法模块的处理方法、调用目的服务引用模块的目的服务数据接收模块引用信息。
Smart Images

Figure CN115509773B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to an API system and method, specifically to a standardized API system and method for separating control data, belonging to the field of cloud computing. Background Technology
[0002] In a multi-service architecture, multiple functionally specialized and independently deployed software services can be assembled through service composition to form the required system functions. Since software services can be reused and recombined to build multiple systems, multi-service composition techniques enable low-cost, high-speed, and flexible software system development. Furthermore, the independence of software services ensures the independence of development and operation, thereby improving the stability and reliability of the software system. Currently, software service composition can be implemented using two methods: service orchestration and service organization.
[0003] Service orchestration is a method where multiple software services are directly connected via API technology to form functionality. It involves relatively small data transfer volumes and high operational efficiency. Furthermore, service orchestration can employ communication middleware to reduce the implementation cost of connections between software services. When a software service needs to be used within a specific context, its related code needs to be modified according to the context's flow control requirements, parameter passing requirements, and service connection requirements. These code modifications significantly reduce the reusability of the software service, resulting in poor flexibility in service orchestration. While communication middleware can achieve relatively flexible service connections in asynchronous scenarios with discontinuous contexts using the Publish / Subscribe method, this approach cannot achieve flexible software service connections in synchronous scenarios requiring continuous contexts.
[0004] Service orchestration achieves the connection and combination of multiple software services by calling the API interfaces of various software services through a centralized controller. The centralized controller handles the entire process control and data transfer between services. With a centralized controller, using a software service in different contexts only requires modifying the controller; the software service's code itself remains unchanged. Therefore, service orchestration ensures the flexibility of service reuse. The centralized controller can be implemented using low-code technology, which further enhances the flexibility of service orchestration. However, the single data aggregation point parameter passing mechanism of service orchestration significantly increases the amount of network communication data, thereby reducing system efficiency. Furthermore, data aggregation and parameter passing increase the workload of the centralized controller, further reducing system efficiency.
[0005] Neither service orchestration nor service compilation methods can simultaneously achieve both service reuse flexibility and system operational efficiency in software service composition. The root cause of this is the Request / Response format of existing API technologies, which stems from the coupling between data transmission and data execution control. The Request / Response format requires control requests and all parameters to arrive at the execution point simultaneously. Upon receiving the control request and all parameters, the execution point immediately performs the calculation and returns the settlement result to the point that sent the control request and data parameters. This coupling of control requests and parameters causes existing software to fail to balance system operational efficiency and compositional flexibility in service composition. Summary of the Invention
[0006] To address the problem that the inherent coupling between data transmission and data execution control in the Request / Response format of API technology makes it difficult for systems that combine services in multiple context scenarios to balance operational efficiency and combination flexibility, this invention proposes an API system and method for controlling data separation.
[0007] The technical solution adopted in this invention is:
[0008] An API system for controlling data separation includes a standardized data receiving module, a data buffer storage module, a standardized configuration information module, a processing method module, a standardized control execution module, and a destination service reference module.
[0009] A standardized data receiving module is used to receive input parameters sent by multiple software services;
[0010] The data buffer storage module is used to receive and store the input parameters sent by the standardized data receiving module;
[0011] The standardized configuration information module is used to store standardized configuration information that drives the standardized control execution module to execute in different contexts;
[0012] The processing method module is used to provide data processing methods for software services.
[0013] The destination service reference module is used to provide reference information for the data receiving module of the destination service;
[0014] The standardized control execution module is used to execute the controller's control requests, call the standardized configuration information of the standardized configuration information module, read the input parameters of the data buffer storage module, call the processing methods of the processing method module, and call the reference information of the destination service reference module's destination service data receiving module.
[0015] The standardized data receiving module is connected to the data buffer storage module, and the standardized control execution module is connected to the standardized configuration information module, processing method module, destination service reference module, controller, and data buffer storage module, respectively.
[0016] Furthermore, the standard definition of the standardized data receiving module is state dataRecv:paramMap. The parameter paramMap contains the input parameters sent by a certain software service. The key values of the input parameters are defined as AppID, TaskID, NodeID, RequestID, and ParamID. AppID is the application ID of the current context; TaskID is the task ID of the current context; NodeID is the running node ID of the current context; RequestID is the request ID of the current runtime; and ParamID is the ID defined in the output parameter information of the software service, which is the same as the source parameter ID of the corresponding input parameter in the local context.
[0017] Furthermore, the standardized configuration information includes context information, input parameter information, processing method information, and output parameter information;
[0018] The context information includes the software application identifier targeted by the currently running API, the specific task information under the software application, and the running node information of the API under the specific task;
[0019] The input parameter information includes the identification information of multiple input parameters of the currently running API. The identification information of each input parameter includes the node information of the source of the input parameter in the context of the task, the source parameter ID of the input parameter, the parameter ID of the input parameter in the processing method, and the source of the input parameter acquisition.
[0020] The processing method information includes the data processing methods referenced by the API when processing software service data;
[0021] The output parameters are divided into multiple output parameter groups according to the target service. The output parameter information of each output parameter group includes the referenced output parameter target service data receiving module, the output parameter information of each output parameter, and the output parameter information of each output parameter includes the processing method output parameter ID and the target service output parameter ID.
[0022] Furthermore, the standard definition of the standardized control execution module is ctOutput ctExec: contextInfo, paramMap. The two input parameters of the standardized control execution module are the context information corresponding to the current runtime and the additional parameters of the processing method.
[0023] Furthermore, the method of using the API system includes the following steps:
[0024] a. When the controller calls the standardized control execution module, the standardized control execution module receives parameters sent by the controller, including the current runtime context information and additional parameters of the required processing method;
[0025] b. The standardized control execution module extracts the APPID, TaskID, and NodeID from the context information, and calls the corresponding API standardized configuration information from the standardized configuration information module based on the APPID, TaskID, and NodeID.
[0026] c. The standardization control execution module parses the API standardization configuration information to obtain the input parameter information in the API standardization configuration information. For each input parameter, the standardization control execution module uses the APPID, TaskID, RequestID in the context information and the NodeID of the input parameter in the API standardization configuration information to construct the key value of the input parameter, and uses the key value and the source of the input parameter to obtain the input parameter value.
[0027] d. For each input parameter value obtained, the standardized control execution module uses the processing method parameter ID of the corresponding input parameter as the key value of the processing method and inserts the key value into the processing method input parameter Map;
[0028] e. The standardized control execution module uses the configuration information to reference the processing method, and then uses the Map parameter of the processing method after inserting the key-value pair to call the processing method, and obtains the return value of the processing method according to the processing method and additional parameters;
[0029] f. The standardized control execution module parses the target service, obtains the target service reference, and parses the output parameter information of each output target service in the standardized configuration information module according to the target service reference. The standardized control execution module obtains the output parameter value of the output parameter information according to the output parameter processing method output parameter ID.
[0030] g. The standardized control execution module uses the destination service output parameter ID and the APPID, TaskID, NodeID, and RequestID from the context information to construct the output key value;
[0031] h. The standardized control execution module uses the output key value to insert the output parameter value into the output parameter Map of the destination service;
[0032] i. Determine the type of the target service reference. If the target service reference type is the target service of the standardized data receiving module, the standardized control execution module calls the standardized data receiving module of the corresponding target service to send the output parameter Map to the corresponding software service.
[0033] For destination services with a reference type of CONTRL, after the standardized control execution module has completed the processing of all destination service parameters, it returns the corresponding output parameter Map to the controller through the controller's executor call channel.
[0034] An API method for controlling data separation, comprising the following steps:
[0035] S1. Define standardized configuration information to obtain the standardized configuration information module;
[0036] S2. Define a standardized data receiving module and a standardized control execution module;
[0037] S3. Construct a data buffer storage module, a processing method module, and a destination service reference module;
[0038] S4. Construct an API system based on the standardized configuration information module, standardized data receiving module, standardized control execution module, data buffer storage module, processing method module, and destination service reference module.
[0039] Furthermore, the standardized configuration information includes context information, input parameter information, processing method information, and output parameter information;
[0040] The context information includes the software application identifier targeted by the currently running API, the specific task information under the software application, and the running node information of the API under the specific task;
[0041] The input parameter information includes the identification information of multiple input parameters of the currently running API. The identification information of each input parameter includes the node information of the source of the input parameter in the context of the task, the source parameter ID of the input parameter, the parameter ID of the input parameter in the processing method, and the source of the input parameter acquisition.
[0042] The processing method information includes the data processing methods referenced by the API when processing software service data;
[0043] The output parameters are divided into multiple output parameter groups according to the target service. The output parameter information of each output parameter group includes the referenced output parameter target service data receiving module and the output parameter information of each output parameter. The output parameter information of each output parameter includes the processing method output parameter ID and the target service output parameter ID.
[0044] Furthermore, S2 defines a standardized data receiving module and a standardized control execution module, the specific process of which is as follows:
[0045] The standard definition of the standardized data receiving module is state dataRecv:paramMap. The parameter paramMap contains the input parameters sent by a certain software service. The key values of the input parameters include AppID, TaskID, NodeID, RequestID, and ParamID. AppID is the application ID of the current context; TaskID is the task ID of the current context; NodeID is the running node ID of the current context; RequestID is the request ID of the current runtime; and ParamID is the ID defined in the output parameter information of the software service, which is the same as the source parameter ID of the corresponding input parameter in the local context.
[0046] The standard definition of the standardized control execution module is ctOutput ctExec: contextInfo, paramMap. The two input parameters of the standardized control execution module are the context information corresponding to the current runtime and the additional parameters of the processing method.
[0047] Furthermore, the data buffer storage module, processing method module, and destination service reference module are constructed in S3, and the specific process is as follows:
[0048] The data buffer storage module includes input parameters sent from the standardized data receiving module;
[0049] The processing methods module includes data processing methods for various software services;
[0050] The destination service reference module includes reference information for the data receiving modules of multiple destination services.
[0051] Furthermore, in step S4, an API system is constructed based on the standardized configuration information module, standardized data receiving module, standardized control execution module, data buffer storage module, processing method module, and destination service reference module. The specific process is as follows:
[0052] The standardized data receiving module is connected to the data buffer storage module, and the standardized control execution module is connected to the standardized configuration information module, processing method module, destination service reference module, and data buffer storage module respectively. The above-mentioned connected parts are combined to form an API system, resulting in the constructed API system.
[0053] Beneficial effects:
[0054] This invention constructs a novel API system by defining a standardized configuration information module, a standardized data receiving module, and a standardized control execution module. Simultaneously, it constructs a data buffer storage module, a processing method module, and a destination service reference module, combining these components into a single API system. Specifically, the API system includes a standardized data receiving module, a data buffer storage module, a standardized configuration information module, a processing method module, a standardized control execution module, and a destination service reference module. The standardized data receiving module receives input parameters from multiple software services. The data buffer storage module receives and stores the input parameters sent by the standardized data receiving module. The standardized configuration information module stores standardized configuration information that drives the standardized control execution module to execute in different contexts; the standardized configuration information includes context information, input parameter information, processing method information, and output parameter information. The processing method module provides data processing methods for software services. The destination service reference module provides reference information for the data receiving module of the destination service. The standardized control execution module executes controller control requests, calls the standardized configuration information from the standardized configuration information module, reads input parameters from the data buffer storage module, calls the processing methods from the processing method module, and calls the destination service reference module's reference information for the data receiving module.
[0055] This invention achieves complete decoupling of control and data, multiplexing of data results, and configuration-based service connections, effectively decoupling the existing API Request / Response format, thereby balancing the flexibility and operational efficiency of system service composition.
[0056] The configuration information defined in this invention enables flexible service connections based on configuration, which can effectively reduce the amount of code required for connecting services. Furthermore, configuration-based service connections allow for dynamic plugging and unplugging of services across multiple contexts, thus effectively achieving low-cost service reuse. It also enables flexible refactoring of services across multiple contexts. Sharing services across multiple contexts can effectively improve service utilization, thereby increasing the utilization of corresponding computing resources.
[0057] This invention employs a direct data transmission method between services with multi-purpose service output. This method effectively avoids the data aggregation and forwarding points formed by the existing API Request / Response format. Eliminating these data aggregation and forwarding points effectively solves the high controller load problem of data compilation methods, thereby significantly improving system operating efficiency. Attached Figure Description
[0058] Figure 1 This is a structural diagram of the API system;
[0059] Figure 2This is a flowchart of the API system construction process;
[0060] Figure 3 This is an application flowchart for the standardized data receiving module;
[0061] Figure 4 This is the application flowchart of the standardized control execution module;
[0062] Figure 5 This is a logical structure diagram of the API system;
[0063] Figure 6 This is a physical structure diagram of the API system;
[0064] Figure 7 This is a structural diagram of the API system in a real-world application scenario;
[0065] Figure 8 This is a schematic diagram of an embodiment; Detailed Implementation
[0066] Specific implementation method one: Combining Figures 1-6 This embodiment describes a control data separation API system, which includes a standardized data receiving module, a data buffer storage module, a standardized configuration information module, a processing method module, a standardized control execution module, and a destination service referencing module.
[0067] A standardized data receiving module is used to receive input parameters sent by multiple software services.
[0068] The Standardized Data Receptor module is implemented using a remote API call. The standard programming function definition for the Standardized Data Receptor module is `state dataRecv(paramMap1)`. The parameter `paramMap1` contains the input parameters sent by a specific software service. The '1' in `paramMap1` is only used to distinguish different `paramMap`s and has no meaning in specific applications. The same applies to `paramMap2`, `paramMap3`, and `paramMap4`. The key values for the input parameters include AppID, TaskID, NodeID, RequestID, and ParamID. AppID is the application ID of the current context; TaskID is the task ID of the current context; NodeID is the running node ID of the current context; RequestID is the request ID of the currently running node; and ParamID is the ID defined in the output parameter information of the software service. This ID is the same as the source parameter ID of the corresponding input parameter in the local context. For example, if the ParamID of a software service's output parameter is `param1`, then the source parameter ID of the data receiving service should be `param1`. The return value `state` of the Standardized Data Receptor module represents the result of the data reception, indicating whether the data reception was successful. This invention uses a defined standardized key value format to identify the context information of the parameters.
[0069] Each software service has its own API system. When multiple software services call the corresponding standardized data receiving module, the standardized data receiving module receives the relevant input parameters and inserts them into the local data buffer using the key-value pairs of each parameter. If the data buffering is successful, a success result is returned to the corresponding software service; otherwise, a data receiving failure result is returned. The implementation flowchart of the standardized data receiving module is as follows: Figure 3 As shown. When shopping online, the customer's shopping cart and coupons are separate services. Coupons are stored in the user information. In this case, there are shopping cart services and user information services. The standardized data receiving module of the shopping cart service receives input parameters and inserts the key-value pairs of each input parameter into a local data buffer. Similarly, the standardized data receiving module of the user information service receives input parameters and inserts the key-value pairs of each input parameter into a local data buffer. Both are stored in a single local data buffer module.
[0070] The data buffer storage module is used to receive and store the input parameters sent by the standardized data receiving module. The data buffer storage module includes a local buffer storage.
[0071] The standardized configuration information module is used to store the standardized configuration information that drives the standardized control execution module to execute in different contexts.
[0072] The standardized configuration information includes context information, input parameter information, processing method information, and output parameter information.
[0073] The context information identifies the API's runtime context, and the standardized configuration information defines the API behavior within a specific context. The context information includes the software application identifier targeted by the currently running API, the specific task information within the software application, and the API's runtime node information within the specific task. The context information corresponds to the context information input parameters of the standardized control execution module. The definition expression for the context information is as follows:
[0074]
[0075] Context information, such as the context of a data statistical calculation function, includes the calculation processes such as data extraction, data transformation, data statistical calculation, and data result return. Since the data used in this calculation process is only related to the current calculation request, this data needs to be independent of other concurrent calculation requests of the same function. This calculation process with independent data forms the function's runtime context. Determining a specific context of an API system requires using the current context's application ID (AppID), task ID (TaskID), node ID (NodeID), and user request ID (RequestID). AppID, TaskID, and NodeID can be determined before system runtime. These three IDs need to be set in the above...<Config Identifier> In this context, it contains configuration information used to identify a specific API. The RequestID is dynamically generated by the user request.
[0076] The input parameter information identifies the multi-source software service input parameters of the API runtime. This input parameter information includes identification information for multiple input parameters of the currently running API. Each input parameter's identification information includes the node information of its source in the context task, the source parameter ID, the parameter ID in the processing method, and the source from which the input parameter was obtained. The input parameters are stored in a data buffer module. Input parameters with a source of "CONTROL_MAP" come from additional parameters of the processing method. The input parameter information expression is defined as follows:
[0077]
[0078] The processing method information includes the data processing methods referenced by the API system when processing software service data. The processing method is `outputMap funcName(paramMap)`, and the expression for the processing method information is defined as follows:
[0079] <Function Call>
[0080] <functionref> FuncRef< / functionref>
[0081] < / Function Call>
[0082] The output parameter information identifies the output parameter information of the multi-purpose software service running the API. The output parameters of the API's multi-purpose service are divided into multiple output parameter groups according to the purpose service. The output parameter information of each output parameter group includes the referenced data receiving module of the purpose service, the output parameter information of each output parameter, and the output parameter information of each output parameter, including the processing method output parameter ID and the purpose service output parameter ID. The output parameter information of the output parameter group is defined as follows:
[0083]
[0084] The processing method module provides data processing methods for the software service. This module refers to the collection of help API functionalities that the software service can provide externally.
[0085] The standardized control execution module is used to execute the controller's control requests, call the standardized configuration information of the standardized configuration information module, read the input parameters of the data buffer storage module, call the processing methods of the processing method module, and call the reference information of the destination service reference module's destination service data receiving module.
[0086] The Standardized Control Executor (CExec) is implemented using a remote API call. The standard programming function definition for the CExec is `ctOutput ctExec(contextInfo, paramMap2)`. The CExec's two input parameters are the current runtime context information `contextInfo` and the additional parameter `paramMap2` for the processing method. The additional parameter is provided by an external controller and is used to load the processing parameters sent by the controller. This loading refers to the `Map` structure carrying relevant data, representing the data transmission over the channel in a specific format. For example, the controller can pass data from a client request as a parameter to the CExec. If there is no data, the controller can pass an empty `map`. The CExec's built-in context information `contextInfo` is used to match the corresponding context's API configuration information. `contextInfo` also provides the CExec to the current runtime's `RequestID`. The processing parameters loaded in the additional parameter correspond to the input parameters whose source is `CONTRL_MAP` in the configuration. The implementation flowchart of the CExec is as follows: Figure 4 As shown.
[0087] The standardized control execution module executes the controller's control requests. It retrieves configuration information from the standardized configuration information module and executes the corresponding method in the processing method module based on this information. When calling a processing method, the standardized control execution module retrieves the input parameter values from the data buffer storage module. After the processing method is executed, the standardized control execution module extracts the output parameter values returned by the processing method according to the output parameter information in the standardized configuration information module and transmits the parameters to the target service by calling the target service reference module reference information in the target service reference module according to the target service requirements. The controller is the overall controller that drives one service or multiple services simultaneously.
[0088] The destination service reference module provides reference information for the data receiving module of the destination service. During online shopping, both the shopping cart service and the user information service receive corresponding outputs. These outputs are then stored uniformly within a data aggregation service. This process calls the destination service reference module, which selects the standardized data receiving module of the data aggregation service to store the data in the appropriate location.
[0089] The standardized data receiving module is connected to the data buffer storage module, and the standardized control execution module is connected to the standardized configuration information module, processing method module, destination service reference module, controller, and data buffer storage module, respectively.
[0090] From a logical structure perspective, a standardized control data separation API system can be viewed as wrapping a processing method with runtime shells suitable for different contexts. These runtime shells define the context information targeted by the API, the input parameters from multiple sources of services, and the output parameters from multiple destination services. The logical structure of a standardized control data separation API system is as follows: Figure 5 As shown.
[0091] From a physical implementation perspective, the API system for controlling data separation of this invention can be viewed as a software system. This system comprises a standardized data receiving module, a standardized control execution module, a standardized configuration information module, a data buffer storage module, a processing method module, and a destination service referencing module. The physical implementation structure of the API system for controlling data separation is as follows: Figure 6 As shown.
[0092] Specific Implementation Method Two: Combining Figures 1-6 This embodiment describes a method for using an API system with separated control data, comprising the following steps:
[0093] a. When the controller invokes the standardized control execution module, the standardized control execution module receives input parameters sent by the controller. These parameters include the current runtime context information (contextInfo) and the additional parameters (paramMap2) of the required processing method. The controller is used to control the execution logic of the standardized control execution modules of each software service API system.
[0094] b. The standardized control execution module extracts the APPID, TaskID, and NodeID from the context information, and calls the corresponding API standardized configuration information from the standardized configuration information set according to the APPID, TaskID, and NodeID.
[0095] c. The standardization control execution module parses the API standardization configuration information to obtain the input parameter information in the API standardization configuration information. For each input parameter, the standardization control execution module uses the APPID, TaskID, RequestID in the context information and the NodeID of the input parameter in the API standardization configuration information to construct the key value of the input parameter, and uses the key value and the source of the input parameter to obtain the input parameter value.
[0096] d. For each input parameter value obtained, the standardized control execution module uses the processing method parameter ID of the corresponding input parameter as the key value of the processing method and inserts the key value into the processing method input parameter Map.
[0097] e. The standardized control execution module uses the configuration information to reference the processing method, and then uses the Map parameter of the processing method after inserting the key-value pair to call the processing method, and obtains the return value of the processing method according to the processing method and additional parameters;
[0098] f. After the processing method call is completed, the standardized control execution module parses the target service and obtains the target service reference. Based on the target service reference, it parses the output parameter information of each output target service in the standardized configuration information module. For the output parameter information of each output target service, the standardized control execution module obtains the output parameter value of the output parameter information according to the processing method output parameter ID of the output parameter.
[0099] This invention addresses the problem of combining and reusing multiple software services. During service combination, each software service needs to define output parameters to implement its function. Using the combination method of this invention, one software service can send output parameters to multiple software services. The destination service of the output parameters (output destination service) is determined by the output parameter table configuration defined in this invention.
[0100] g. After obtaining the output parameter values, the standardized control execution module uses the target service output parameter ID and the APPID, TaskID, NodeID, and RequestID in the context information to construct the output key value.
[0101] h. The standardized control execution module uses the output key value to insert the output parameter value into the output parameter Map of the destination service.
[0102] i. Determine the type of the target service reference. If the target service reference type is the target service of the standardized data receiving module, the standardized control execution module calls the standardized data receiving module of the corresponding target service to send the output parameter Map to the corresponding software service.
[0103] For destination services with a reference type of CONTRL, after the standardized control execution module has completed the processing of all destination service parameters, it returns the corresponding output parameter Map to the controller through the controller's executor call channel.
[0104] Everything else is the same as in Specific Implementation Method 1.
[0105] Specific implementation method three: Combining Figures 1-6 This embodiment describes an API method for controlling data separation, which includes the following steps:
[0106] S1. Define standardized configuration information to obtain the standardized configuration information module.
[0107] The standardized configuration information includes context information, input parameter information, processing method information, and output parameter information.
[0108] The context information identifies the API's runtime context, and the standardized configuration information defines the API behavior within a specific context. The context information includes the software application identifier targeted by the currently running API, the specific task information within the software application, and the API's runtime node information within the specific task. The context information corresponds to the context information input parameters of the standardized control execution module. The definition expression for the context information is as follows:
[0109]
[0110] Context information, such as the context of a data statistical calculation function, includes the calculation processes such as data extraction, data transformation, data statistical calculation, and data result return. Since the data used in this calculation process is only related to the current calculation request, this data needs to be independent of other concurrent calculation requests of the same function. This calculation process with independent data forms the function's runtime context. Determining a specific context of an API system requires using the current context's application ID (AppID), task ID (TaskID), node ID (NodeID), and user request ID (RequestID). AppID, TaskID, and NodeID can be determined before system runtime. These three IDs need to be set in the above...<Config Identifier> In this context, it contains configuration information used to identify a specific API. The RequestID is dynamically generated by the user request.
[0111] The input parameter information identifies the multi-source software service input parameters of the API runtime. The input parameter information includes identification information for multiple input parameters of the currently running API. Each input parameter's identification information includes the node information of its source in the context task, the source parameter ID of the input parameter, the parameter ID of the input parameter in the processing method, and the source from which the input parameter was obtained. The input parameters are stored in a data buffer storage module, and the input parameter information expression is defined as follows:
[0112]
[0113] The processing method information includes the data processing methods referenced by the API system when processing software service data. The processing method is `outputMap funcName(paramMap)`, and the expression for the processing method information is defined as follows:
[0114] <Function Call>
[0115] <functionref> FuncRef< / functionref>
[0116] < / Function Call>
[0117] The output parameter information identifies the output parameters of the multi-purpose software service running the API. The output parameters of the API's multi-purpose service are divided into multiple output parameter groups according to the purpose service. The output parameter information of each output parameter group includes the referenced output parameter purpose service data receiving module and the output parameter information of each output parameter. The output parameter information of each output parameter includes the processing method output parameter ID and the purpose service output parameter ID. The output parameter information of the output parameter group is defined as follows:
[0118]
[0119] S2. Define the standardized data receiving module and the standardized control execution module. The specific process is as follows:
[0120] The Standardized Data Receptor module is implemented using a remote API call. The standard programming function definition for the Standardized Data Receptor module is `state dataRecv(paramMap3)`. The parameter `paramMap3` contains the input parameters sent by a software service. The key values of these input parameters include AppID, TaskID, NodeID, RequestID, and ParamID. AppID is the application ID of the current context; TaskID is the task ID of the current context; NodeID is the running node ID of the current context; RequestID is the request ID of the currently running node; and ParamID is the ID defined in the output parameter information of the software service, which is the same as the source parameter ID of the corresponding input parameter in the local context. For example, if the ParamID of a software service's output parameter is `param1`, then the source parameter ID of the data receiving service should be `param1`. The return value `state` of the Standardized Data Receptor module represents the result of data reception, indicating whether data reception was successful. This invention uses a defined standardized key value format to identify the context information of the parameters.
[0121] Each software service has its own API system. When multiple software services call the corresponding standardized data receiving module, the standardized data receiving module receives the relevant input parameters and inserts them into the local data buffer using the key-value pairs of each parameter. If the data buffering is successful, a success result is returned to the corresponding software service; otherwise, a data receiving failure result is returned. The implementation flowchart of the standardized data receiving module is as follows: Figure 3 As shown.
[0122] The Standardized Control Executor (SCE) is implemented using a remote API call. The standard programming function definition for the SCE is `ctOutput ctExec(contextInfo, paramMap4)`. The SCE has two input parameters: the current runtime context information `contextInfo` and the additional parameter `paramMap4` for the processing method. The additional parameter is provided by the controller. The additional parameter is used to load the processing parameters sent by the controller. Loading refers to the `Map` structure carrying relevant data, representing the data transmission over the channel in a specific format. For example, the controller can pass data from a client request as a parameter to the SCE. If there is no data, the controller can pass an empty `map`. The SCE's built-in context information `contextInfo` is used to match the API configuration information of the corresponding context. The context information `contextInfo` also provides the SCE with the `RequestID` of the current runtime context. The processing parameters loaded in the additional parameter correspond to the input parameters whose source is `CONTRL_MAP` in the configuration. The implementation flowchart of the SCE is as follows: Figure 4 As shown.
[0123] The standardized control execution module is used to execute the controller's control requests. The standardized control execution module obtains configuration information from the standardized configuration information module and executes the corresponding method in the processing method module according to the configuration information. When calling the processing method, the standardized control execution module obtains the input parameter values of the processing method from the data buffer storage module. After the processing method is executed, the standardized control execution module extracts the output parameter values returned by the processing method according to the output parameter information in the standardized configuration information module, and transmits the parameters to the target service by calling the target service reference module reference information in the target service reference module according to the target service requirements. For example, when shopping online, the shopping cart service and user information service automatically perform the above data processing according to their own API system.
[0124] S3. Construct the data buffer storage module, processing method module, and destination service reference module. The specific process is as follows:
[0125] The data buffer storage module includes input parameters sent from the standardized data receiving module;
[0126] The processing methods module includes data processing methods for various software services;
[0127] The destination service reference module includes reference information for the data receiving modules of multiple destination services.
[0128] S4. Construct the API system based on the standardized configuration information module, standardized data receiving module, standardized control execution module, data buffer storage module, processing method module, and destination service reference module. The specific process is as follows:
[0129] The standardized data receiving module is connected to the data buffer storage module. The standardized control execution module is connected to the standardized configuration information module, processing method module, destination service reference module, and data buffer storage module, respectively. These connected components form the API system, resulting in the constructed API system. The logical structure of the standardized control data separation API system is as follows: Figure 5 As shown, the physical implementation structure of the control data separation API system is as follows: Figure 6 As shown.
[0130] Example
[0131] In practical applications, a standardized control data separation API system can support the development of multiple application systems by sharing multiple microservices to achieve system functions. In real-world scenarios, the API system's runtime controller can be implemented in the application system's entry service. The runtime controller controls service method execution by calling the standardized control execution module of the microservice. The microservice uses the standardized data receiving module of the standardized control data separation API system to transmit data. In this scenario, data transmission is implemented using service orchestration (Choreography), and runtime control is implemented using service orchestration (Orchestration). Since the runtime controller does not need to handle complex data caching and forwarding, it can be implemented using a configurable standard framework system. This implementation can be further developed into a low-code implementation. The implementation method of the standardized control data separation API system in practical application scenarios is as follows: Figure 7 As shown. Figure 8 The document demonstrates running instances of the SCONDAS API in online shopping and project management application scenarios. Gray arrows represent control transfers, while black arrows represent data transfers. The online shopping instance aggregates product data from the shopping cart and customer coupon data based on customer requests and returns it to the customer. In this instance, customer coupon data and shopping cart data are managed by two independent microservices. The data aggregation service implements this as a single service. The project management instance aggregates project information and project financial reimbursement information based on customer requests and returns it to the customer. In this instance, project information and project financial reimbursement information are managed by two independent microservices. This project management instance shares the data aggregation service with the online shopping instance to address the issue of combining and reusing multiple software services.
[0132] The running process of an online shopping application instance is as follows:
[0133] Step 1: The online shopping controller (Micro-Component Controller) receives a customer request sent via the customer's mobile device;
[0134] Step 2: The online shopping controller (controller) calls the control execution module of the customer's shopping cart service (the standardized control execution module of the shopping cart service) based on the application context key value (context information) corresponding to the customer's request and the parameters (additional parameters) in the customer's request;
[0135] Step 3: The control execution module of the shopping cart service obtains the configuration information of the SCANDAS API (standardized configuration information of the standardized configuration information module) based on the application context key value, and obtains the parameters in the customer request based on the configuration information;
[0136] Step 4: The control execution module of the shopping cart service extracts the customer request parameters (input parameters) passed by the online shopping controller based on the input parameter information of the standardized configuration information module in the SCANDAS API configuration, converts the extracted parameters into the input parameter format required by the SCANDAS API configuration, and calls the processing method (processing method module) for the product data in the shopping cart in the SCANDAS API configuration according to the converted input parameter format.
[0137] Step 5: The control execution module of the shopping cart service adds corresponding keys to the output data according to the output parameter information of the standardized configuration information module in the SCANDAS API configuration, and uses the destination service reference module to call the data receiving module reference information of the data aggregation service (DataSet Join Service) to buffer the product data (input parameter) of the shopping cart service to the local data buffer (data buffer storage module) of the data aggregation service. The data receiving module of the data aggregation service returns the call result to the control execution module of the shopping cart service.
[0138] Step 6: The shopping cart service control execution module returns the call result to the online shopping controller;
[0139] Step 7: The online shopping controller calls the control execution module of the Customer Information Service (the standardized control execution module of the Customer Information Service) based on the application context key value (context information) corresponding to the customer request and the parameters (additional parameters) in the customer request;
[0140] Step 8: The control execution module of the customer information service obtains the configuration information of the SCANDAS API (standardized configuration information of the standardized configuration information module) based on the application context key value, and obtains the parameters in the customer request based on the configuration information;
[0141] Step 9: The control execution module of the customer information service extracts the customer request parameters (input parameters) passed by the online shopping controller based on the input parameter information of the standardized configuration information module in the SCANDAS API configuration, converts the extracted parameters into the input parameter format required by the SCANDAS API configuration, and calls the API processing method (processing method module) for coupon data of customer information in the SCANDAS API configuration according to the converted input parameter format.
[0142] Step 10: The control execution module of the customer information service adds the corresponding context key to the output data according to the output parameter information of the standardized configuration information module in the SCANDAS API configuration, and uses the destination service reference module to call the data receiving module reference information of the data aggregation service to buffer the coupon data of the customer information service to the local data buffer (data buffer storage module) of the data aggregation service. The data receiving module of the data aggregation service returns the call result to the control execution module of the customer information service.
[0143] Step 11: The control execution module of the customer information service returns the call result to the online shopping controller;
[0144] Step 12: The online shopping controller calls the control execution module of the data aggregation service based on the application context key-value corresponding to the customer's request;
[0145] Step 13: The control execution module of the data aggregation service obtains the configuration information of SCANDAS API according to the application context key value, and extracts the product data and coupon data under the corresponding context in the local data buffer according to the input parameter information of the standardized configuration information module in the SCANDAS API configuration.
[0146] Step 14: The control and execution module of the data aggregation service calls the API processing method (processing method set) in the SCANDAS API configuration for aggregating product data and coupon data based on the extracted product data and coupon data;
[0147] Step 15: The data aggregation service adds corresponding context keys to the output aggregated data (product data and coupon data) based on the output parameter information of the standardized configuration information module in the SCANDAS API configuration, and returns the output aggregated data to the online shopping controller;
[0148] Step 16: The online shopping controller returns the aggregated data to the client via network transmission.
[0149] In summary, the online shopping controller obtains the product list in the customer's shopping cart and the corresponding coupons through network transmission. Within the data aggregation service, it obtains the requested results from the customer. This online shopping system can provide cloud services through a cloud computing environment.
[0150] The running process of a project management application instance is as follows:
[0151] Step 1: The project management controller (Micro-Component Controller) receives a customer request sent via the customer's mobile device;
[0152] Step 2: The project management controller (controller) calls the control execution module (standardized control execution module) of the client's project information service (Project Information Service) based on the application context key value (context information) corresponding to the client's request and the parameters (additional parameters) in the client's request;
[0153] Step 3: The control execution module of the project information service obtains the configuration information of the SCANDAS API (standardized configuration information of the standardized configuration information module) based on the application context key value, and obtains the parameters in the customer request based on the configuration information;
[0154] Step 4: The control execution module of the project information service uses the input parameter information of the standardized configuration information module in the SCANDAS API configuration to extract the customer request parameters (input parameters) passed by the project management controller, converts the extracted parameters into the input parameter format required by the SCANDAS API configuration, and calls the processing method (processing method module) for project information data in the project information service in the SCANDAS API configuration according to the converted input parameter format.
[0155] Step 5: The control execution module of the project information service adds corresponding keys to the output data of the project information according to the output parameter information of the standardized configuration information module in the SCANDAS API configuration, and calls the data receiving module of the data aggregation service (destination service reference set) to buffer the project information data (input parameter) of the project information service to the local data buffer (data buffer storage module) of the data aggregation service. The data receiving module of the data aggregation service returns the call result to the control execution module of the project information service.
[0156] Step 6: The control execution module of the project information service adds the corresponding key to the project information key data according to the output parameter information of the standardized configuration information module in the SCANDAS API configuration, and calls the data receiving module of the project's financial reimbursement service (destination service reference set) to buffer the project information key data (input parameter) of the project information service to the local data buffer (data buffer storage module) of the financial reimbursement service. The data receiving module of the data aggregation service returns the call result to the control execution module of the project information service.
[0157] Step 7: The control execution module of the project information service returns the call result to the online shopping controller;
[0158] Step 8: The project management controller calls the control execution module of the Staff Reimbursement Service based on the application context key value corresponding to the customer request;
[0159] Step 9: The control execution module of the financial reimbursement service obtains the configuration information of SCANDAS API (standardized configuration information of the standardized configuration information module) based on the application context key value, and uses the input parameter information of the standardized configuration information module in the SCANDAS API configuration to extract the item key data under the corresponding context in the local data buffer.
[0160] Step 10: The control execution module of the financial reimbursement service uses the project key data to call the processing method (processing method module) in the SCANDAS API configuration;
[0161] Step 11: The control execution module of the financial reimbursement service uses the output parameter information of the standardized configuration information module in the SCANDAS API configuration to add corresponding context keys to the output data, and calls the data receiving module of the data aggregation service to buffer the project reimbursement data of the financial reimbursement service to the local data buffer (data buffer storage module) of the data aggregation service. The data receiving module of the data aggregation service returns the call result to the control execution module of the financial reimbursement service.
[0162] Step 12: The control execution module of the financial reimbursement service returns the call result to the project management controller;
[0163] Step 13: The project management controller calls the control execution module of the data aggregation service based on the application context key value corresponding to the customer request;
[0164] Step 14: The control execution module of the data aggregation service obtains the SCANDAS API configuration based on the application context key value, and uses the input parameter information of the standardized configuration information module in the SCANDAS API configuration to extract the project information data and project expense data under the corresponding context in the local data buffer.
[0165] Step 15: The control execution module of the data aggregation service uses project information data and project expense reimbursement data to call the processing method (processing method module) in the SCANDAS API configuration;
[0166] Step 16: The data aggregation service uses the output parameter information of the standardized configuration information module in the SCANDAS API configuration to add corresponding context keys to the output aggregated data (project information data and project expense reimbursement data), and returns the output aggregated data to the project management controller;
[0167] Step 17: The project management controller returns the aggregated data to the client via network transmission.
Claims
1. An API system for controlling data separation, characterized in that: It includes a standardized data receiving module, a data buffer storage module, a standardized configuration information module, a processing method module, a standardized control execution module, and a destination service referencing module; A standardized data receiving module is used to receive input parameters sent by multiple software services; The data buffer storage module is used to receive and store the input parameters sent by the standardized data receiving module; The standardized configuration information module is used to store standardized configuration information that drives the standardized control execution module to execute in different contexts; The standardized configuration information includes context information, input parameter information, processing method information, and output parameter information; The context information includes the software application identifier targeted by the currently running API, the specific task information under the software application, and the running node information of the API under the specific task; The input parameter information includes the identification information of multiple input parameters of the currently running API. The identification information of each input parameter includes the node information of the source of the input parameter in the context of the task, the source parameter ID of the input parameter, the parameter ID of the input parameter in the processing method, and the source of the input parameter acquisition. The processing method information includes the data processing methods referenced by the API when processing software service data; The output parameters are divided into multiple output parameter groups according to the target service. The output parameter information of each output parameter group includes the referenced output parameter target service data receiving module, the output parameter information of each output parameter, and the output parameter information of each output parameter includes the processing method output parameter ID and the target service output parameter ID. The processing method module is used to provide data processing methods for software services. The destination service reference module is used to provide reference information for the data receiving module of the destination service; The standardized control execution module is used to execute the controller's control requests, call the standardized configuration information of the standardized configuration information module, read the input parameters of the data buffer storage module, call the processing methods of the processing method module, and call the reference information of the destination service reference module's destination service data receiving module. The standardized data receiving module is connected to the data buffer storage module, and the standardized control execution module is connected to the standardized configuration information module, processing method module, destination service reference module, controller, and data buffer storage module, respectively.
2. The API system for controlling data separation according to claim 1, characterized in that: The standard definition of the standardized data receiving module is state dataRecv:paramMap. The parameter paramMap contains the input parameters sent by a certain software service. The key values of the input parameters include AppID, TaskID, NodeID, RequestID, and ParamID; AppID is the application ID of the current context. TaskID is the task ID of the current context; NodeID is the running node ID of the current context; RequestID is the request ID of the current runtime; ParamID is the ID defined in the software service output parameter information, and the ID is the same as the source parameter ID of the corresponding input parameter in the local context.
3. The API system for controlling data separation according to claim 2, characterized in that: The standard definition of the standardized control execution module is ctOutput ctExec: contextInfo, paramMap. The two input parameters of the standardized control execution module are the context information corresponding to the current runtime and the additional parameters of the processing method.
4. The API system for separating control data according to claim 3, characterized in that: The usage of the API system includes the following steps: a. When the controller calls the standardized control execution module, the standardized control execution module receives parameters sent by the controller, including the current runtime context information and additional parameters of the required processing method; b. The standardized control execution module extracts the APPID, TaskID, and NodeID from the context information, and calls the corresponding API standardized configuration information from the standardized configuration information module based on the APPID, TaskID, and NodeID. c. The standardization control execution module parses the API standardization configuration information to obtain the input parameter information in the API standardization configuration information. For each input parameter, the standardization control execution module uses the APPID, TaskID, RequestID in the context information and the NodeID of the input parameter in the API standardization configuration information to construct the key value of the input parameter, and uses the key value and the source of the input parameter to obtain the input parameter value. d. For each input parameter value obtained, the standardized control execution module uses the processing method parameter ID of the corresponding input parameter as the key value of the processing method and inserts the key value into the processing method input parameter Map; e. The standardized control execution module uses the configuration information to reference the processing method, and then uses the Map parameter of the processing method after inserting the key-value pair to call the processing method, and obtains the return value of the processing method according to the processing method and additional parameters; f. The standardized control execution module parses the target service, obtains the target service reference, and parses the output parameter information of each output target service in the standardized configuration information module according to the target service reference. The standardized control execution module obtains the output parameter value of the output parameter information according to the output parameter processing method output parameter ID. g. The standardized control execution module uses the destination service output parameter ID and the APPID, TaskID, NodeID, and RequestID from the context information to construct the output key value; h. The standardized control execution module uses the output key value to insert the output parameter value into the output parameter Map of the destination service; i. Determine the type of the target service reference. If the target service reference type is the target service of the standardized data receiving module, the standardized control execution module calls the standardized data receiving module of the corresponding target service to send the output parameter Map to the corresponding software service. For destination services with a reference type of CONTRL, after the standardized control execution module has completed the processing of all destination service parameters, it returns the corresponding output parameter Map to the controller through the controller's executor call channel.
5. An API method for controlling data separation, characterized in that: It includes the following steps: S1. Define standardized configuration information to obtain the standardized configuration information module; The standardized configuration information includes context information, input parameter information, processing method information, and output parameter information; The context information includes the software application identifier targeted by the currently running API, the specific task information under the software application, and the running node information of the API under the specific task; The input parameter information includes the identification information of multiple input parameters of the currently running API. The identification information of each input parameter includes the node information of the source of the input parameter in the context of the task, the source parameter ID of the input parameter, the parameter ID of the input parameter in the processing method, and the source of the input parameter acquisition. The processing method information includes the data processing methods referenced by the API when processing software service data; The output parameters are divided into multiple output parameter groups according to the destination service. The output parameter information of each output parameter group includes the data receiving module of the destination service referenced by the output parameter and the output parameter information of each output parameter. The output parameter information of each output parameter includes the processing method output parameter ID and the destination service output parameter ID. S2. Define the standardized data receiving module and the standardized control execution module. The specific process is as follows: The standard definition of the standardized data receiving module is state dataRecv:paramMap. The parameter paramMap contains the input parameters sent by a certain software service. The key values of the input parameters include AppID, TaskID, NodeID, RequestID, and ParamID; AppID is the application ID of the current context. TaskID is the task ID of the current context; NodeID is the running node ID of the current context; RequestID is the request ID of the current runtime; ParamID is the ID defined in the software service output parameter information, and the ID is the same as the source parameter ID of the corresponding input parameter in the local context; The standard definition of the standardized control execution module is ctOutput ctExec: contextInfo, paramMap. The two input parameters of the standardized control execution module are the context information corresponding to the current runtime and the additional parameters of the processing method. S3. Construct the data buffer storage module, processing method module, and destination service reference module. The specific process is as follows: The data buffer storage module includes input parameters sent from the standardized data receiving module; The processing methods module includes data processing methods for various software services; The destination service reference module includes reference information for the data receiving modules of multiple destination services; S4. Construct the API system based on the standardized configuration information module, standardized data receiving module, standardized control execution module, data buffer storage module, processing method module, and destination service reference module. The specific process is as follows: The standardized data receiving module is connected to the data buffer storage module, and the standardized control execution module is connected to the standardized configuration information module, processing method module, destination service reference module, and data buffer storage module respectively. The above-mentioned connected parts are combined to form an API system, resulting in the constructed API system.
Citation Information
Patent Citations
Extensible single point orchestration system for application program interfaces
US9921894B1