Business processing method, apparatus, and computer-readable storage medium
Patent Information
- Application Number
- CN202111456704.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-01
- Publication Date
- 2026-09-18
- Estimated Expiration
- 2041-12-01
AI Technical Summary
[0003]在对现有技术的研究和实践过程中,本发明的发明人发现,在现有技术中,随着业务节点中部署的Agent数量的增多,业务之间存在Agent功能重复建设的问题,同时,节点中部署的Agent数量的增多会导致系统资源消耗以及运维管理难度增大,从而代理服务组件的部署效率较低,进而使得业务处理的效率较低
[0043] This embodiment of the application determines the target proxy service corresponding to the target service when a business processing request for the target service is received; it then determines the target business plugin corresponding to the target proxy service in the proxy service component of the current node. The proxy service component includes at least one business plugin corresponding to a candidate proxy service, and each business plugin implements the functionality of a candidate proxy service; it then selects the target functional interface corresponding to the target business plugin from the functional interfaces corresponding to the candidate proxy services; and finally, it calls the target business plugin according to the target functional interface to respond to the business processing request. In this way, by determining the target proxy service corresponding to the business processing request, and then determining the target business plugin corresponding to that target proxy service in the proxy service component, and calling the target functional interface corresponding to the target business plugin to respond to the business processing request based on that target business plugin, this method of implementing the proxy service functionality by replacing the proxy service component with a business plugin avoids the repeated deployment of the proxy service component, improves the deployment efficiency of the proxy service component, and thus improves the business processing efficiency.
Smart Images

Figure CN116204239B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of Internet technology, specifically to a business processing method, apparatus, and computer-readable storage medium. Background Technology
[0002] In recent years, with the rapid development of internet technology, business needs have become increasingly frequent and complex. Consequently, to better meet these diverse and complex business requirements, the number of agent service components deployed on a business node has also increased. An agent service component (Agent) is a type of software that can act as a proxy for a user or another program, working continuously in a specific environment. For example, it can be distributed across cluster nodes to collect data from each node or to perform certain tasks within the nodes.
[0003] In the process of researching and practicing existing technologies, the inventors of this invention discovered that in existing technologies, as the number of Agents deployed in business nodes increases, there is a problem of redundant construction of Agent functions between businesses. At the same time, the increase in the number of Agents deployed in nodes leads to increased system resource consumption and operation and maintenance management difficulties, resulting in low deployment efficiency of proxy service components, which in turn leads to low efficiency of business processing. Summary of the Invention
[0004] This application provides a business processing method, apparatus, and computer-readable storage medium, which can improve the deployment efficiency of proxy service components and thus improve business processing efficiency.
[0005] This application provides a business processing method, including:
[0006] When a business processing request for a target business is received, the target proxy service corresponding to the target business is determined;
[0007] In the proxy service component of the current node, the target business plugin corresponding to the target proxy service is determined. The proxy service component includes at least one business plugin corresponding to a candidate proxy service, and each business plugin implements the function of a candidate proxy service.
[0008] From the functional interfaces corresponding to the candidate proxy services, the target functional interfaces corresponding to the target business plugin are selected.
[0009] The target business plugin is invoked according to the target function interface to respond to the business processing request.
[0010] Accordingly, embodiments of this application provide a business processing apparatus, including:
[0011] The target proxy service determination unit is used to determine the target proxy service corresponding to the target service when a service processing request for the target service is received.
[0012] The target business plugin determination unit is used to determine the target business plugin corresponding to the target proxy service in the proxy service component of the current node, wherein the proxy service component includes at least one business plugin corresponding to a candidate proxy service, and each business plugin implements the function of a candidate proxy service.
[0013] The filtering unit is used to filter out the target functional interface corresponding to the target business plugin from the functional interfaces corresponding to the candidate proxy services.
[0014] The invocation unit is used to invoke the target business plugin according to the target function interface in response to the business processing request.
[0015] In one embodiment, the filtering unit includes:
[0016] The lookup subunit is used to find the target plugin instance corresponding to the target business plugin based on the target plugin identifier corresponding to the target business plugin.
[0017] The target function interface determination subunit is used to determine the target function interface corresponding to the target business plugin based on the instance function interface in the target plugin instance, wherein the instance function interface is obtained by filtering based on the function interface corresponding to the candidate proxy service.
[0018] In one embodiment, the target service plugin determination unit includes:
[0019] The plugin identifier acquisition subunit is used to acquire the plugin identifier associated with the target proxy service;
[0020] The target business plugin identification subunit is used to identify the target business plugin corresponding to the target proxy service in the proxy service component of the current node based on the plugin identifier.
[0021] In one embodiment, the service processing apparatus further includes:
[0022] The candidate proxy service acquisition unit is used to determine the candidate proxy service corresponding to the current node;
[0023] The plugin file lookup unit is used to find the plugin file of at least one business plugin corresponding to the candidate proxy service;
[0024] A business plugin loading unit is used to load at least one business plugin corresponding to the candidate proxy service into the proxy service component of the current node based on the plugin file.
[0025] In one embodiment, the service processing apparatus further includes:
[0026] The plugin identifier acquisition unit is used to acquire the plugin identifier to be deleted carried in the deletion request when a plugin deletion request for the proxy service component is received.
[0027] The search unit is used to search for the plugin identifier and plugin structure corresponding to the plugin identifier to be deleted in the associated data container corresponding to the current node, based on the plugin identifier to be deleted;
[0028] The deletion unit is used to delete the plugin identifier and plugin structure corresponding to the found plugin identifier to be deleted.
[0029] In one embodiment, the service processing apparatus further includes:
[0030] The dynamic link file acquisition unit is used to acquire the dynamic link file corresponding to the business plugin to be added according to the plugin addition request when a plugin addition request for the proxy service component is received.
[0031] The mapping unit is used to load the dynamic link file into memory and map the loaded dynamic link file to the preset plugin interface of the associated data container;
[0032] The extraction unit is used to extract the plugin identifier and plugin structure corresponding to the business plugin to be added from the dynamic link file based on the preset plugin interface.
[0033] The adding unit is used to add the extracted plugin identifier and plugin structure corresponding to the business plugin to be added to the associated data container.
[0034] In one embodiment, the service processing apparatus further includes:
[0035] The management interface type determination unit is used to determine the management interface type based on the management interface call request when a management interface call request for the proxy service component is received.
[0036] The management unit is used to call the management interface corresponding to the management interface type and manage the proxy service component based on the management interface.
[0037] In one embodiment, the service processing apparatus further includes:
[0038] The startup unit is used to start the proxy service component corresponding to the current node and load the management plugin corresponding to the proxy service component;
[0039] The registration unit is used to register the proxy service component through the management plugin and to obtain and report the heartbeat information of the proxy service component.
[0040] Furthermore, embodiments of this application also provide a computer-readable storage medium storing a plurality of instructions adapted for loading by a processor to execute steps in any of the business processing methods provided in embodiments of this application.
[0041] Furthermore, this application also provides a computer device, including a processor and a memory, wherein the memory stores an application program, and the processor is used to run the application program in the memory to implement the business processing method provided in this application.
[0042] This application also provides a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the steps in the business processing method provided in this application.
[0043] This embodiment of the application determines the target proxy service corresponding to the target service when a business processing request for the target service is received; it then determines the target business plugin corresponding to the target proxy service in the proxy service component of the current node. The proxy service component includes at least one business plugin corresponding to a candidate proxy service, and each business plugin implements the functionality of a candidate proxy service; it then selects the target functional interface corresponding to the target business plugin from the functional interfaces corresponding to the candidate proxy services; and finally, it calls the target business plugin according to the target functional interface to respond to the business processing request. In this way, by determining the target proxy service corresponding to the business processing request, and then determining the target business plugin corresponding to that target proxy service in the proxy service component, and calling the target functional interface corresponding to the target business plugin to respond to the business processing request based on that target business plugin, this method of implementing the proxy service functionality by replacing the proxy service component with a business plugin avoids the repeated deployment of the proxy service component, improves the deployment efficiency of the proxy service component, and thus improves the business processing efficiency. Attached Figure Description
[0044] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0045] Figure 1 This is a schematic diagram illustrating an implementation scenario of a business processing method provided in an embodiment of this application;
[0046] Figure 2 This is a flowchart illustrating a business processing method provided in an embodiment of this application;
[0047] Figure 3a This is a schematic diagram of the business plugin loading process of a business processing method provided in an embodiment of this application;
[0048] Figure 3b This is a schematic diagram of the proxy service component file structure of a business processing method provided in an embodiment of this application;
[0049] Figure 3c This is a schematic diagram of the registration and version update process of the proxy service component of a business processing method provided in an embodiment of this application;
[0050] Figure 3d This is a schematic diagram of the external request processing flow of a business processing method provided in an embodiment of this application;
[0051] Figure 4 This is another schematic diagram of a business processing method provided in an embodiment of this application;
[0052] Figure 5 This is a schematic diagram of the asynchronous task execution flow of a business processing method provided in an embodiment of this application;
[0053] Figure 6a This is a schematic diagram of the proxy service component architecture of a business processing method provided in an embodiment of this application;
[0054] Figure 6b This is a schematic diagram of module calls for a business processing method provided in an embodiment of this application;
[0055] Figure 6c This is a schematic diagram of the data flow structure of the proxy service component framework of a business processing method provided in an embodiment of this application;
[0056] Figure 7 This is a schematic diagram of the structure of the business processing device provided in the embodiments of this application;
[0057] Figure 8 This is a schematic diagram of the structure of the computer device provided in the embodiments of this application. Detailed Implementation
[0058] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0059] This application provides a business processing method, apparatus, and computer-readable storage medium. The business processing apparatus can be integrated into a computer device, which may be a server or a terminal, etc.
[0060] For better illustration of the embodiments of this application, please refer to the following terms:
[0061] Agent: A computing entity that can continuously and autonomously function in a distributed or collaborative system, often simply called an "intelligent agent." Specifically, an agent is software that acts as a proxy for a user or another program, working continuously in a specific environment. For example, it can be distributed across cluster nodes to collect data from each node or perform certain tasks within the nodes.
[0062] .so files: These are dynamic link libraries written based on business logic, and they are binary files.
[0063] TRPC: A high-performance RPC (Remote Procedure Call) development framework that supports multiple languages.
[0064] The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery network (CDN) acceleration services, and big data and artificial intelligence platforms. The terminal can be a smartphone, tablet, laptop, desktop computer, in-vehicle terminal, smart speaker, smartwatch, etc., but is not limited to these. The terminal and server can be directly or indirectly connected via wired or wireless communication, which is not limited herein.
[0065] Please see Figure 1 Taking the integration of business processing devices into computer equipment as an example, Figure 1This is a schematic diagram illustrating an implementation scenario of the business processing method provided in this application. The computer device can be a server or a terminal. When the computer device receives a business processing request for a target business, it determines the target proxy service corresponding to the target business; determines the target business plugin corresponding to the target proxy service in the proxy service component of the current node; the proxy service component includes at least one business plugin corresponding to a candidate proxy service, and each business plugin implements the function of a candidate proxy service; selects the target function interface corresponding to the target business plugin from the function interfaces corresponding to the candidate proxy services; and calls the target business plugin according to the target function interface to respond to the business processing request.
[0066] It should be noted that, Figure 1 The illustrated implementation environment scenario of the business processing method is merely an example. The implementation environment scenario of the business processing method described in this application embodiment is for the purpose of more clearly illustrating the technical solution of this application embodiment and does not constitute a limitation on the technical solution provided in this application embodiment. Those skilled in the art will understand that, with the evolution of business processing and the emergence of new business scenarios, the technical solution provided in this application is also applicable to similar technical problems.
[0067] The following sections provide detailed descriptions of each example. It should be noted that the order in which the embodiments are described is not intended to limit the preferred order of the embodiments.
[0068] This embodiment will be described from the perspective of a business processing device, which can be integrated into a computer device, which can be a server, and this application does not limit it.
[0069] Please see Figure 2 , Figure 2 This is a flowchart illustrating a business processing method provided in an embodiment of this application. The business processing method includes:
[0070] In step 101, when a service processing request for the target service is received, the target proxy service corresponding to the target service is determined.
[0071] The target business can be any transaction that needs to be processed in various industries, such as healthcare, finance, payment, and education. Specifically, it can be a specific task generated based on business needs, such as retrieving data from a business node or monitoring that node. The business processing request can be a request generated based on the needs of the target business, which can trigger processing of that target business. The proxy service can be a service provided through an agent, that is, a function implemented through an agent. For example, the proxy service could be a service for retrieving data from a business node or a service for monitoring that node. The target proxy service can be the proxy service corresponding to the target business.
[0072] Specifically, when a service processing request for a target service is received, the target proxy service corresponding to the target service can be determined. Optionally, the target proxy service corresponding to the target service can be determined by obtaining the identification information carried in the service processing request. The identification information may include information identifying the target proxy service corresponding to the target service.
[0073] In step 102, the target business plugin corresponding to the target proxy service is determined in the proxy service component of the current node.
[0074] In existing technologies, the common approach to address the increase in Agent services is to deploy multiple Agents (proxy service components) on nodes. This deployment method leads to problems such as redundant construction of functions and lack of resource sharing among different services on the node. At the same time, the increase in the number of Agents deployed increases the difficulty and cost of operation and maintenance management, which in turn leads to excessive consumption of system resources.
[0075] To address the above issues, this application provides a business processing method that constructs a generic Agent architecture to offer unified development, deployment, operation, and management capabilities and a platform. Specifically, a generic proxy service component (generic Agent) can be deployed in a node, and business plugins can be loaded into the proxy service component to implement the proxy service corresponding to each business plugin. Furthermore, the generic Agent can dynamically and pluggably load business plugins according to business needs, satisfying the customized deployment requirements of multiple business parties on various business nodes, avoiding redundant Agent construction, and improving the deployment efficiency of the proxy service component.
[0076] In addition, the business data obtained by each plugin in the agent service component can be uniformly reported to the platform side. In this way, the resources of multiple agent services can be shared in the business, improving resource utilization and thus improving business processing efficiency.
[0077] Therefore, in order to execute the target proxy service corresponding to the target business in a plug-in manner, the target business plugin corresponding to the target proxy service can be determined in the proxy service component of the current node. Specifically, the target business plugin corresponding to the target proxy service can be determined from the multiple business plugins corresponding to the multiple candidate proxy services in the proxy service component.
[0078] The agent service component (Agent) may include at least one business plugin corresponding to a candidate agent service. Each business plugin implements the function of a candidate agent service. The business plugin may be a plugin pre-loaded into the agent service component. The candidate agent service may be the agent service required by the current node based on the business requirements of the current node. The target business plugin may be the business plugin corresponding to the candidate agent service pre-loaded in the agent service component of the current node based on the candidate agent service required by the current node.
[0079] The business plugin can be derived from the functional transformation of the proxy service. Specifically, corresponding functional interfaces can be defined based on the functions of the proxy service. A business plugin corresponding to a specific proxy service can be obtained based on its functional interfaces and specific business logic. The business plugin can then implement the corresponding proxy service's functionality by implementing these functional interfaces and the specific business logic. To enable interaction between the Agent and the business plugin, consistent functional interfaces can be defined between the business plugin and the proxy service component based on the functional interfaces defined by the proxy service. These functional interfaces allow for loading and calling between the Agent and the business plugin, thus realizing the proxy service corresponding to the business plugin. A pipeline can be used to compile and deploy the business plugin. The compilation process mainly involves statically compiling the business plugin and its dependent files into a .so file, and then uploading the .so file and related configuration files to a file server, which can be a Cloud Object Storage (COS) server.
[0080] Optionally, these functional interfaces may include, but are not limited to, the functional interfaces shown in the table below:
[0081]
[0082]
[0083] The definitions of these functional interfaces can be as follows:
[0084] a) Type: This method can be used to obtain the plugin name of a business plugin. The input parameter is empty, and the return value can be a string.
[0085] b) Version: This method can be used to obtain the version number of a business plugin. The input parameter is empty, and the return value can be a string.
[0086] c) Setup: This method can be used for the initialization of business plugins. The input parameter is the context. The context here is a concept in a programming language, which refers to passing information such as the current running status of the program to the lower-level plugin. It can generally be used to pass data required by the business, such as log handles. The return value can be an error.
[0087] d)Task: This method can be used to execute synchronous task methods. The input parameters can be context, string method name, and string execution parameters. The return value is the execution result string and error.
[0088] e) CronTask: This method can be used to execute scheduled tasks. It can return a list of scheduled tasks and related information, which can instruct the Agent on how to schedule scheduled tasks in the business plugin.
[0089] f)BackGroundTask: This method can be used to execute persistent tasks. The input parameters can be the context and the channel type indicating whether the coroutine is closed. The Agent will use the persistent coroutine to start and call this method in the business plugin. Unlike synchronous tasks that exit after execution, this method can make the persistent task in the business plugin run continuously.
[0090] g)BackGroundTaskInfo: This method queries persistent tasks. It can be used to obtain information about persistent tasks. The method takes the context and input parameters as input and returns a string of execution information and errors.
[0091] h) `AsyncTask` executes asynchronous tasks. Its input parameters include the context, method name string, and parameter strings. It returns an execution result string and an error. These methods tend to take longer to execute; using synchronous methods would result in network connection timeouts. When executing an asynchronous method, the asynchronous task call information is recorded in a local database, and a task identifier (ID) is returned to the caller. Subsequently, the asynchronous task scheduling service starts a coroutine to call the `AsyncTask` method in the plugin to execute the asynchronous task and records the execution result in the database for later retrieval.
[0092] i) `AsyncTaskInfo` queries the execution result of an asynchronous task. It takes the context and the task ID string as input and returns the result string and an error. When the caller invokes this method, it first checks the database for a result based on the task ID. If a result is found, it returns it directly; otherwise, it calls `AsyncTaskInfo` to query the business logic plugin for the result.
[0093] It should be noted that the functional interfaces in this application embodiment may include, but are not limited to, the interfaces mentioned above. Corresponding functional interfaces can be defined according to actual business needs, and no limitation is imposed here. Furthermore, the definition of a functional interface may include the interface method name, input parameter list and type, return parameter list and type, etc. To enable the loading of business plugins, this definition requires consistency between the implementation in the Agent and the business plugin.
[0094] Optionally, the plugin identifier associated with the target proxy service can be obtained. Based on this plugin identifier, the target business plugin corresponding to the target proxy service can be identified within the proxy service component of the current node. This plugin identifier can include identification information corresponding to the business plugin. This identification information can be used to uniquely identify a business plugin; for example, the identification information can be a name, an identity document (ID), etc. Accordingly, the plugin identifier can be the plugin name or plugin identity number of the business plugin. Then, based on the plugin identifier associated with the target proxy service, the business plugin matching the plugin identifier can be filtered from multiple candidate proxy service business plugins loaded in the proxy service component of the current node, thereby obtaining the target business plugin corresponding to the target proxy service.
[0095] In one embodiment, candidate proxy services that need to be set in the current node can be determined according to business requirements, and business plugins corresponding to these candidate proxy services can be loaded into the proxy service component of the current node. Specifically, the candidate proxy services corresponding to the current node can be determined; the plugin file of at least one business plugin corresponding to the candidate proxy service can be found; and at least one business plugin corresponding to the candidate proxy service can be loaded into the proxy service component of the current node based on the plugin file.
[0096] Specifically, by obtaining the proxy service information corresponding to the current node, candidate proxy services for the current node can be determined. This proxy service information can include indications of the candidate proxy services for the current node. This proxy service information can be input by developers or obtained by requesting other servers, etc., without limitation. The plugin file can include the dynamic link file (so file) of the business plugin corresponding to the candidate proxy service, other dependency files, configuration files of the business plugin, and log files, etc., used to enable the operation and use of the business plugin. The so file can be used as a dynamic link library to load the business plugin.
[0097] Specifically, the configuration file of at least one business plugin corresponding to the candidate proxy service can be read to obtain the download address of the plugin file of the business plugin corresponding to the candidate proxy service. Then, the plugin file of the business plugin corresponding to the candidate proxy service can be downloaded based on the download address, and at least one business plugin corresponding to the candidate proxy service can be loaded into the proxy service component of the current node based on the plugin file.
[0098] Optional, you can refer to Figure 3a , Figure 3a This is a schematic diagram of the business plugin loading process of a business processing method provided in this application embodiment. After starting the proxy service component on the node, service initialization can be performed. Then, the download address of the plugin file corresponding to the candidate proxy service can be obtained by reading the configuration file. The plugin file can then be downloaded from the file server through the download address. The plugin file can be loaded to load the business plugin corresponding to the candidate proxy service in the proxy service component of the current node. After the business plugin is loaded, a listening port can be started to listen for interface events so as to process interface events for the Agent.
[0099] In one embodiment, please refer to Figure 3b , Figure 3b This is a schematic diagram of the file structure of a proxy service component for a business processing method provided in this application embodiment. The file structure corresponding to the proxy service component may include plugin files, configuration files, log files, and debugging tools during Agent operation. Specifically, the plugin file path for the business plugin may include the business plugin's .so file, configuration files, and log files. The Agent function of the proxy service can be packaged into a .so file and loaded as a plugin for the Agent, enabling it to provide the corresponding proxy service externally. The configuration file path stores the configuration files for the Agent and the business plugin. The log file path stores the execution log files for the Agent and the business plugin, facilitating the location and analysis of problems occurring during Agent operation. The log files can be periodically cleaned up.
[0100] In one embodiment, some management plugins can be written on the business plugin for tasks such as agent registration, heartbeat reporting, and agent information collection, which can help the agent management platform to perceive the existence and status of agents on the node.
[0101] Specifically, the agent service component corresponding to the current node can be started, and the corresponding management plugin can be loaded. This management plugin can then be used to register the agent service component and obtain and report its heartbeat information. This heartbeat information can be reported to the management platform, which is the platform that manages the agents.
[0102] For specific details regarding Agent registration, please refer to [link / reference]. Figure 3c , Figure 3c This application provides a schematic diagram of the agent service component registration and version update process for a business processing method. When the Agent service starts and the management plugin is loaded, a setup operation is performed, at which point the Agent registration logic can begin: First, the system checks if an agent service component identifier (agentid) exists in local storage. If it exists, it is recorded (e.g., as old_agentid); if not, it is left blank. Then, a universally unique identifier (UUID) is used to generate the agent service component identifier (agentid). Simultaneously, the service address of the management terminal can be obtained through Polaris (a platform providing service discovery and load balancing). Therefore, the agentid, old_agentid, machine information, version information, and other relevant information can be sent to the Agent management terminal for Agent registration. The management terminal can record Agent data and, according to business requirements, return information such as the universally unique identifier corresponding to the agent service component, the latest version information, configuration version, plugin version, and agent service component version.
[0103] For Agent heartbeat reporting, a corresponding scheduled task method can be defined in the management plugin. This scheduled task method serves as a function to periodically report the Agent and business plugin status, sending heartbeat packets to the management end.
[0104] In one embodiment, the target service plugin corresponding to the target service can be determined based on the plugin identifier carried in the service processing request. The plugin identifier can be identification information such as the plugin name.
[0105] In step 103, the target functional interface corresponding to the target business plugin is selected from the functional interfaces corresponding to the candidate proxy services.
[0106] This functional interface can be an interface derived from the functional definition of a specific proxy service, used to implement the Agent function of the proxy service. To enable calls to business plugins, the target functional interface corresponding to the target business plugin can be selected from the functional interfaces corresponding to candidate proxy services.
[0107] In one embodiment, the plugin instance corresponding to each business plugin can be stored in memory, and the target plugin can be invoked by retrieving the plugin instance. Specifically, the step of filtering the target function interface corresponding to the target business plugin from the function interfaces corresponding to the candidate proxy service may include:
[0108] (1) Based on the target plugin identifier corresponding to the target business plugin, find the target plugin instance corresponding to the target business plugin.
[0109] The target plugin identifier can be the identification information of the target business plugin, such as the plugin name. The target plugin instance can be an instance of the target business plugin, which can include the plugin name and plugin structure. The plugin structure is a structure that can be the specific implementation of the functional interface of the business plugin, and can contain the functional interface functions corresponding to the business plugin. When the .so file compiled based on the target business plugin is loaded into the proxy service component as a dynamic link library and run, the target plugin instance corresponding to the target business plugin can be generated in memory. Optionally, to facilitate the management operations such as adding and deleting business plugins, a graph data structure can be used to store the plugin instances of the business plugins in memory. A graph (map) is a data structure that stores data in the form of key-value pairs. Specifically, the plugin name of the business plugin can be used as the key, and the corresponding plugin structure of the business plugin can be used as the value to realize the storage of plugin instances in the content.
[0110] Therefore, based on the target plugin identifier corresponding to the target business plugin, the plugin instance corresponding to that identifier can be found, thus obtaining the target plugin instance corresponding to the target business plugin. For example, when the target plugin identifier is a plugin name, the plugin instance corresponding to that plugin name can be found in the map data structure to obtain the target plugin instance corresponding to the target business plugin.
[0111] (2) Determine the target function interface corresponding to the target business plugin based on the instance function interface in the target plugin instance.
[0112] The instance function interface can be obtained by filtering based on the function interface corresponding to the candidate proxy service. Correspondingly, the instance function interface can be the function interface of the plugin structure in the target plugin instance.
[0113] Therefore, the target function interface corresponding to the target business plugin can be determined based on the instance function interface in the target plugin instance corresponding to the target business plugin.
[0114] In step 104, the target business plugin is called according to the target function interface.
[0115] Specifically, the business logic of the target proxy service corresponding to the target business plugin can be implemented by calling the target function interface, thereby enabling the call to the target business plugin and responding to the business processing request.
[0116] In one embodiment, the data in the map data structure can be dynamically controlled by managing the plugin structure in the plugin instance to achieve hot-swapping of business plugins. Hot-swapping means that business plugins can be modified, updated, or deleted without restarting the main program.
[0117] Optionally, when a plugin deletion request for the proxy service component is received, the plugin identifier to be deleted carried in the deletion request can be obtained; based on the plugin identifier to be deleted, the plugin identifier and plugin structure corresponding to the plugin identifier to be deleted can be searched in the associated data container corresponding to the current node; and the found plugin identifier and plugin structure corresponding to the plugin identifier to be deleted can be deleted.
[0118] The identifier of the plugin to be deleted can be the identification information corresponding to the business plugin that needs to be deleted. This identification information can be information that uniquely identifies a business plugin, such as the plugin name of the business plugin.
[0119] Specifically, when a plugin deletion request for the proxy service component is received, the identifier of the plugin to be deleted carried in the deletion request can be obtained. Then, based on the plugin identifier, the plugin instance corresponding to the plugin instance stored in the associated data container (map data structure) in memory can be found. The plugin identifier and plugin structure in the plugin instance can then be released and deleted from the map. In this way, the business plugin loaded in the proxy service component can be deleted, that is, the proxy service deployed in the proxy service component can be deleted.
[0120] Optionally, upon receiving a plugin addition request for the proxy service component, the system can obtain the dynamic link file corresponding to the business plugin to be added based on the plugin addition request; load the dynamic link file into memory and map the loaded dynamic link file to a preset plugin interface; based on the preset plugin interface, extract the plugin identifier and plugin structure corresponding to the business plugin to be added from the dynamic link file; and add the extracted plugin identifier and plugin structure corresponding to the business plugin to be added to the associated data container.
[0121] The dynamic link file can be the .so file corresponding to the business plugin to be added, and the preset plugin interface can be used to add the plugin identifier and plugin structure in the dynamic link file to a pre-defined interface in the associated data container.
[0122] Specifically, when a plugin addition request is received for an Agent, the dynamic link file corresponding to the business plugin to be added can be obtained based on the information carried in the plugin addition request. Then, the dynamic link file can be loaded into memory and mapped to the preset plugin interface of the associated data container. Based on the preset plugin interface, the plugin identifier and plugin structure corresponding to the business plugin to be added can be extracted from the dynamic link file, and the extracted plugin identifier and plugin structure corresponding to the business plugin to be added can be added to the associated data container in the form of key-value pairs.
[0123] Therefore, by loading the proxy service into the proxy service component as a business plugin, and then adding or deleting the business plugin according to business needs through a plugin-based approach, the problems of redundant functional construction, high resource consumption, and increased management costs caused by deploying multiple agents on nodes in the prior art are avoided. The embodiments of this application realize the function of the proxy service by replacing the proxy service component with a business plugin, and the method of adding or deleting the proxy service in a plugin-based manner avoids the repeated deployment of the proxy service component and improves the deployment efficiency of the proxy service component.
[0124] In one embodiment, the proxy service component's interface can be divided into a business interface and a management interface. The business interface can be used by the business side to call business plugins; the management interface can be used to manage the proxy service component and can execute relevant logic according to the interface type and parameters, including restarting, obtaining Agent data, updating, and detecting activity. The descriptions of the business interface and the management interface can be found in the following table:
[0125]
[0126]
[0127] It should be noted that the business interfaces in this application embodiment may include, but are not limited to, the above interfaces. The corresponding interfaces can be defined according to actual business needs, and no limitation is made here.
[0128] For details, please refer to Figure 3d , Figure 3d This is a schematic diagram of an external request processing flow provided in an embodiment of this application. When an external request is received for a proxy service component in the current node, the external request can be authenticated. Based on the authentication result, legitimate external requests are processed, and then, based on the routing information (Uniform Resource Locator, or URL) carried by the target external request, the legitimate external request can be routed to the corresponding interface, such as a business interface or a management interface.
[0129] When the interface corresponding to the external request is a business interface, the plugin instance can be obtained according to the plugin name in the request, and then the corresponding method in the business plugin can be called and the relevant parameters can be passed in. That is, the steps in steps 101 to 104 are executed to implement the corresponding proxy service. The business interface may include functional interfaces such as executing synchronous tasks, executing asynchronous tasks, querying asynchronous task information, querying scheduled task information, and querying resident task information.
[0130] When the interface corresponding to the external request is a management interface, that is, when a management interface call request for the proxy service component is received, the management interface type corresponding to the management interface call request can be determined based on the interface information carried by the management interface call request. Then, the management interface corresponding to the management interface type can be called to execute the corresponding logic, so as to manage the proxy service component based on the management interface.
[0131] Optional, please continue to refer to Figure 3c The management side can deploy and manage the proxy service components of each environment node by sending management interface call requests. This includes managing agent version updates, service restarts, obtaining agent information, and activity detection. For example, it can:
[0132] 1) Version Update: The management console can call the Agent's plugin update interface, passing in the URL of the new Agent update file, file hash value, and other data to notify the business plugins to update. When the Agent receives this request, it can download the update file provided in the URL and verify if the update file matches the hash passed from the management console. If they match, the update and upgrade logic can begin; otherwise, it can exit. During the update, calls to various business interfaces can be blocked, asynchronous tasks, background tasks, and scheduled tasks can be terminated, and the memory space of the business plugins can be released. Then, the downloaded update script is executed to begin the update, and the service can be restarted after the update is complete.
[0133] 2) Service restart: After verifying the validity of the request, the execution of asynchronous tasks, background tasks, scheduled tasks, etc. can be terminated, the memory space of the business plugin can be released, and then the service restart can begin.
[0134] As described above, this embodiment of the application determines the target proxy service corresponding to the target service when a business processing request for the target service is received; determines the target business plugin corresponding to the target proxy service in the proxy service component of the current node, wherein the proxy service component includes at least one business plugin corresponding to a candidate proxy service, and each business plugin implements the function of a candidate proxy service; selects the target function interface corresponding to the target business plugin from the function interfaces corresponding to the candidate proxy services; and calls the target business plugin according to the target function interface to respond to the business processing request. Thus, by determining the target proxy service corresponding to the business processing request, and then determining the target business plugin corresponding to the target proxy service in the proxy service component, and calling the target function interface corresponding to the target business plugin to respond to the business processing request based on the target business plugin, this method of using a business plugin to replace the proxy service component to implement the proxy service function avoids the repeated deployment of the proxy service component, improves the deployment efficiency of the proxy service component, and thus improves the business processing efficiency.
[0135] Based on the method described in the above embodiments, the following examples will provide further detailed explanations.
[0136] In this embodiment, the business processing device will be specifically integrated into a computer device as an example for explanation. The business processing method will be specifically described with a server as the executing entity.
[0137] For a better description of the embodiments of this application, please refer to Figure 4 ,like Figure 4 As shown, Figure 4 Another flowchart illustrating the business processing method provided in this application embodiment is shown below.
[0138] In step 201, the server starts the proxy service component corresponding to the current node, loads the management plugin corresponding to the proxy service component, registers the proxy service component through the management plugin, and reports the heartbeat information of the proxy service component.
[0139] Specifically, the server can start the proxy service component corresponding to the current node and load the corresponding management plugin. This plugin allows the server to register the proxy service component and obtain and report its heartbeat information. This heartbeat information can be reported to a management platform, which is the platform that manages the agents.
[0140] For specific details regarding Agent registration, please refer to [link / reference]. Figure 3c , Figure 3c This illustration shows a process flow diagram for agent service component registration and version update in a business processing method provided in this application embodiment. The server can perform a setup operation when the Agent service starts and the management plugin is loaded. At this time, the Agent registration logic can begin: First, it checks if an agent service component identifier (agentid) exists in local storage. If it exists, it is recorded (e.g., recorded as old_agentid); if it does not exist, it is left blank. Then, a universally unique identifier (UUID) can be used to generate the agent service component identifier (agentid). Simultaneously, the service address of the management terminal can be obtained through Polaris (a platform providing service discovery and load balancing). Therefore, the agentid, old_agentid, machine information, version information, and other relevant information can be sent to the Agent management terminal for Agent registration. The management terminal can record Agent data and can also return information such as the universally unique identifier, latest version information, configuration version, plugin version, and agent service component version corresponding to the agent service component according to business needs.
[0141] For Agent heartbeat reporting, the server can define a corresponding scheduled task method in the management plugin. This scheduled task method serves as a function to periodically report the Agent and business plugin status, sending heartbeat packets to the management end.
[0142] In one embodiment, the server can determine the target service plugin corresponding to the target service based on the plugin identifier carried in the service processing request. The plugin identifier can be identification information such as the plugin name.
[0143] In step 202, the server determines the candidate proxy service corresponding to the current node, finds the plugin file of at least one business plugin corresponding to the candidate proxy service, and loads at least one business plugin corresponding to the candidate proxy service into the proxy service component of the current node based on the plugin file.
[0144] Specifically, the server can determine the candidate proxy services that need to be set in the current node according to business requirements, and load the business plugins corresponding to these candidate proxy services into the proxy service component of the current node. Specifically, the server can determine the candidate proxy services corresponding to the current node; find the plugin file of at least one business plugin corresponding to the candidate proxy service; and load at least one business plugin corresponding to the candidate proxy service into the proxy service component of the current node based on the plugin file.
[0145] The server can obtain the proxy service information corresponding to the current node. Based on this information, it can determine the candidate proxy services for the current node. This proxy service information can include details indicating the candidate proxy services for the current node. This information can be input by developers or obtained by requesting other servers; no limitation is made here. The plugin file can include the dynamic link file (.so file) of the business plugin corresponding to the candidate proxy service, other dependency files, configuration files for the business plugin, and log files, etc., used to enable the business plugin to run and be used. The .so file can be used as a dynamic link library to load the business plugin.
[0146] Specifically, the server can read the configuration file of at least one business plugin corresponding to the candidate proxy service, obtain the download address of the plugin file of the business plugin corresponding to the candidate proxy service, and then download the plugin file of the business plugin corresponding to the candidate proxy service based on the download address. Based on the plugin file, at least one business plugin corresponding to the candidate proxy service is loaded into the proxy service component of the current node.
[0147] Optional, you can continue to refer to Figure 3a After the proxy service component is started on the node, the server can perform service initialization. Then, it can obtain the download address of the plugin file corresponding to the candidate proxy service by reading the configuration file. The plugin file can then be downloaded from the file server using the download address. The plugin file can then be loaded to load the business plugin corresponding to the candidate proxy service into the proxy service component of the current node. After the business plugin is loaded, a listening port can be started to listen for interface events so that interface events for the Agent can be processed.
[0148] In one embodiment, please continue to refer to Figure 3bThe file structure corresponding to the agent service component can include business plugins, configuration files, log files, and debugging tools during agent runtime. Specifically, the business plugin path can include the business plugin's .so file, configuration files, and log files. The agent functionality of the agent service can be packaged into a .so file and loaded as a plugin for the agent, enabling it to provide the corresponding agent service. The configuration file path stores the configuration files for the agent and business plugins. The log file path stores the execution log files for the agent and business plugins, facilitating the location and analysis of problems occurring during agent runtime. Log files can be periodically cleaned up.
[0149] In step 203, when a service processing request for a target service is received, the server determines the target proxy service corresponding to the target service, obtains the plugin identifier associated with the target proxy service, and identifies the target service plugin corresponding to the target proxy service in the proxy service component of the current node based on the plugin identifier.
[0150] Specifically, the business plugin can be derived from the functional transformation of the proxy service. Specifically, corresponding functional interfaces can be defined based on the functions of the proxy service. A business plugin corresponding to a specific proxy service can be obtained based on its functional interfaces and specific business logic. The business plugin can then implement the corresponding proxy service's functionality by implementing these functional interfaces and the specific business logic. To enable interaction between the Agent and the business plugin, consistent functional interfaces can be defined between the business plugin and the proxy service component based on the functional interfaces defined by the proxy service. These functional interfaces allow for loading and invocation between the Agent and the business plugin, thus realizing the proxy service corresponding to the business plugin. The server can utilize a pipeline to compile and deploy the business plugin. The compilation process mainly involves statically compiling the business plugin and its dependent files into .so files, and then uploading the .so files and related configuration files of the business plugin to a file server, which can be a Cloud Object Storage (COS) server.
[0151] Optionally, these functional interfaces may include, but are not limited to, the functional interfaces shown in the table below:
[0152]
[0153] The definitions of these functional interfaces can be as follows:
[0154] a) Type: This method can be used to obtain the plugin name of a business plugin. The input parameter is empty, and the return value can be a string.
[0155] b) Version: This method can be used to obtain the version number of a business plugin. The input parameter is empty, and the return value can be a string.
[0156] c) Setup: This method can be used for the initialization of business plugins. The input parameter is the context. The context here is a concept in a programming language, which refers to passing information such as the current running status of the program to the lower-level plugin. It can generally be used to pass data required by the business, such as log handles. The return value can be an error.
[0157] d)Task: This method can be used to execute synchronous task methods. The input parameters can be context, string method name, and string execution parameters. The return value is the execution result string and error.
[0158] e) CronTask: This method can be used to execute scheduled tasks. It can return a list of scheduled tasks and related information, which can instruct the Agent on how to schedule scheduled tasks in the business plugin.
[0159] f)BackGroundTask: This method can be used to execute persistent tasks. The input parameters can be the context and the channel type indicating whether the coroutine is closed. The Agent will use the persistent coroutine to start and call this method in the business plugin. Unlike synchronous tasks that exit after execution, this method can make the persistent task in the business plugin run continuously.
[0160] g)BackGroundTaskInfo: This method queries persistent tasks. It can be used to obtain information about persistent tasks. The method takes the context and input parameters as input and returns a string of execution information and errors.
[0161] h) `AsyncTask` executes asynchronous tasks. Its input parameters include the context, method name string, and parameter strings. It returns a result string and an error. These methods tend to take longer to execute; using synchronous methods would cause network connection timeouts. When executing an asynchronous method, the asynchronous task call information is recorded in a local database, and then the task ID is returned to the caller. Subsequently, the asynchronous task scheduling service will start a coroutine to call the `AsyncTask` method in the plugin to execute the asynchronous task and record the execution result in the database for later querying.
[0162] i) `AsyncTaskInfo` queries the execution result of an asynchronous task. It takes the context and the task ID string as input and returns the result string and an error. When the caller invokes this method, it first checks the database for the task ID. If a result is found, it returns it directly; otherwise, it calls `AsyncTaskInfo` to query the business logic plugin for the result.
[0163] For the optional options, please refer to the diagram. Figure 5 This is a schematic diagram of the asynchronous task execution flow of a business processing method provided in this application embodiment. In the asynchronous task issuance phase, the management end sends a request [TRPC, Remote Procedure Call (RPC) framework] to the Agent and records the request identifier (req_id). The server can receive this request, allocate a task identifier (task id) through the Agent, and record the task information in a local cache. The local cache then returns the recorded result to the Agent, and the server then sends the recorded result to the management end through the Agent. In the asynchronous task execution phase, the server uses the Agent to pull the task to be executed into the local cache for execution and receives the task data returned by the local cache. It can then send the asynchronous execution task to the business plugin for execution. After the business plugin completes execution, the server can report the task execution data to the distributed storage server (COS object storage) through the Agent. In the management end data consumption phase, the management end subscribes to and obtains task execution data from the distributed storage server and processes the task execution data.
[0164] It should be noted that the functional interfaces in this application embodiment may include, but are not limited to, the interfaces mentioned above. Corresponding functional interfaces can be defined according to actual business needs, and no limitation is imposed here. Furthermore, the definition of a functional interface may include the interface method name, input parameter list and type, return parameter list and type, etc. To enable the loading of business plugins, this definition requires consistency between the implementation in the Agent and the business plugin.
[0165] Specifically, upon receiving a business processing request for a target service, the server can determine the target proxy service corresponding to that service. Then, by obtaining the identification information carried in the request, the server can identify the target proxy service and its associated plugin identifier. Based on this identifier, the server can then identify the target business plugin within the proxy service component of the current node. This plugin identifier can include identification information uniquely identifying the business plugin; for example, it can be a name, identifier, or similar information. Similarly, the plugin identifier can be the plugin name or identifier number of the business plugin. Furthermore, based on the plugin identifier associated with the target proxy service, the server can filter out the business plugins matching the plugin identifier from among multiple candidate proxy service plugins loaded in the proxy service component of the current node, thus obtaining the target business plugin corresponding to the target proxy service.
[0166] In step 204, the server locates the target plugin instance corresponding to the target service plugin based on the target plugin identifier, determines the target function interface corresponding to the target service plugin based on the instance function interface in the target plugin instance, and calls the target service plugin according to the target function interface.
[0167] The target plugin identifier can be the identification information of the target business plugin, such as the plugin name. The target plugin instance can be an instance of the target business plugin, which can include the plugin name and plugin structure. The plugin structure is a structure that can contain the specific implementation of the functional interface of the business plugin. When the .so file compiled based on the target business plugin is loaded into the proxy service component as a dynamic link library, the target plugin instance corresponding to the target business plugin can be generated in memory. Optionally, to facilitate the management of adding and deleting business plugins, a graph data structure can be used to store the plugin instances of the business plugins in memory. A graph is a data structure that stores data in the form of key-value pairs. Specifically, the plugin name of the business plugin can be used as the key, and the corresponding plugin structure of the business plugin can be used as the value to realize the storage of plugin instances in the content.
[0168] Specifically, the server can find the plugin instance corresponding to the target plugin identifier based on the target plugin identifier, thus obtaining the target plugin instance for the target business plugin. For example, when the target plugin identifier is a plugin name, the server can search for the plugin instance corresponding to that plugin name in the map data structure to obtain the target plugin instance for the target business plugin. The server can then call the target function interface to implement the business logic of the target proxy service corresponding to the target business plugin, thereby invoking the target business plugin and responding to the business processing request.
[0169] In step 205, when a plugin deletion request for the proxy service component is received, the server obtains the plugin identifier to be deleted carried in the deletion request, and based on the plugin identifier to be deleted, searches for the plugin identifier and plugin structure corresponding to the plugin identifier to be deleted in the associated data container corresponding to the current node, and deletes the plugin identifier and plugin structure corresponding to the plugin identifier to be deleted.
[0170] The server can dynamically control the data in the map data structure by managing the plugin structure in the plugin instance to achieve hot-swapping of business plugins. When a plugin deletion request for the proxy service component is received, the server can obtain the plugin identifier to be deleted carried in the deletion request; based on the plugin identifier to be deleted, the server can search for the plugin identifier and plugin structure corresponding to the plugin identifier to be deleted in the associated data container corresponding to the current node; and delete the plugin identifier and plugin structure corresponding to the found plugin identifier to be deleted.
[0171] The identifier of the plugin to be deleted can be the identification information corresponding to the business plugin that needs to be deleted. This identification information can be information that uniquely identifies a business plugin, such as the plugin name of the business plugin.
[0172] Specifically, when the server receives a plugin deletion request for the proxy service component, it can obtain the plugin identifier to be deleted carried in the deletion request. Then, based on the plugin identifier, it can find the plugin instance corresponding to the plugin identifier in the plugin instances stored in the memory-based associated data container (map data structure). The server can then release the plugin identifier and plugin structure in the plugin instance and delete the plugin identifier and plugin structure in the map. This allows the deletion of the business plugin loaded in the proxy service component, that is, the deletion of the proxy service deployed in the proxy service component.
[0173] In step 206, when a plugin addition request for the proxy service component is received, the server obtains the dynamic link file corresponding to the business plugin to be added according to the plugin addition request, loads the dynamic link file into memory, and maps the loaded dynamic link file to the preset plugin interface of the associated data container.
[0174] The dynamic link file can be the .so file corresponding to the business plugin to be added, and the preset plugin interface can be used to add the plugin identifier and plugin structure in the dynamic link file to a pre-defined interface in the associated data container.
[0175] Specifically, when the server receives a plugin addition request for the Agent, it can obtain the dynamic link file corresponding to the business plugin to be added based on the information carried in the plugin addition request. Then, it can load the dynamic link file into memory and map the loaded dynamic link file to the preset plugin interface of the associated data container.
[0176] In step 207, the server extracts the plugin identifier and plugin structure corresponding to the business plugin to be added from the dynamic link file based on the preset plugin interface, and adds the extracted plugin identifier and plugin structure corresponding to the business plugin to be added to the associated data container.
[0177] Specifically, the server can extract the plugin identifier and plugin structure corresponding to the business plugin to be added from the dynamic link file based on the preset plugin interface, and add the extracted plugin identifier and plugin structure corresponding to the business plugin to be added to the associated data container in the form of key-value pairs.
[0178] Therefore, by loading the proxy service into the proxy service component as a business plugin, and then adding or deleting the business plugin according to business needs through a plugin-based approach, the problems of redundant functional construction, high resource consumption, and increased management costs caused by deploying multiple agents on nodes in the prior art are avoided. The embodiments of this application realize the function of the proxy service by replacing the proxy service component with a business plugin, and the method of adding or deleting the proxy service in a plugin-based manner avoids the repeated deployment of the proxy service component and improves the deployment efficiency of the proxy service component.
[0179] In one embodiment, the proxy service component's interface can be divided into a business interface and a management interface. The business interface can be used by the business side to call business plugins; the management interface can be used to manage the proxy service component and can execute relevant logic according to the interface type and parameters, including restarting, obtaining Agent data, updating, and detecting activity. The descriptions of the business interface and the management interface can be found in the following table:
[0180]
[0181] It should be noted that the business interfaces in this application embodiment may include, but are not limited to, the above interfaces. The corresponding interfaces can be defined according to actual business needs, and no limitation is made here.
[0182] For details, please refer to Figure 3d , Figure 3d This is a schematic diagram of an external request processing flow for a business processing method provided in this application embodiment. When an external request is received for a proxy service component in the current node, the server can authenticate the external request. Based on the authentication result, the server processes the legitimate external request and routes it to the corresponding interface based on the routing information carried by the target external request. For example, a business interface or a management interface.
[0183] When the interface corresponding to the external request is a business interface, the plugin instance can be obtained according to the plugin name in the request, and then the corresponding method in the business plugin can be called and the relevant parameters can be passed in. That is, the steps in steps 201 to 207 are executed to implement the corresponding proxy service. The business interface may include functional interfaces such as executing synchronous tasks, executing asynchronous tasks, querying asynchronous task information, querying scheduled task information, and querying resident task information.
[0184] When the interface corresponding to the external request is a management interface, that is, when a management interface call request for the proxy service component is received, the management interface type corresponding to the management interface call request can be determined based on the interface information carried by the management interface call request. Then, the management interface corresponding to the management interface type can be called to execute the corresponding logic, so as to manage the proxy service component based on the management interface.
[0185] Optional, please continue to refer to Figure 3c The management side can deploy and manage the agent service components of each environment node by sending management interface call requests, including Agent version updates, service restarts, obtaining Agent information, and activity detection.
[0186] For example, version updates can be performed: the management side can call the Agent's plugin update interface, passing in the URL of the new version of the Agent update file, the file hash value, and other data to notify the business plugins to update. When the Agent receives this request, it can download the update file provided in the URL address and then verify whether the update file matches the hash value passed in by the management side. If they match, the update and upgrade logic can be executed; otherwise, it can exit. During the update, calls to various business interfaces can be blocked, asynchronous tasks, background tasks, scheduled tasks, etc., and the memory space of the business plugins can be released. Then, the downloaded update script is executed to begin the update, and the service can be restarted after the update is complete.
[0187] Service restart: After verifying the validity of the request, the execution of asynchronous tasks, background tasks, scheduled tasks, etc. can be terminated, the memory space of the business plugins can be released, and then the service restart can begin.
[0188] In addition, for a better explanation of the embodiments of this application, please refer to Figure 6a , Figure 6b , Figure 6c .in, Figure 6aThis is a schematic diagram of the proxy service component architecture of a business processing method provided in an embodiment of this application. The proxy service component architecture may include a presentation layer, a management layer, a communication layer, and a proxy service component layer. The presentation layer includes front-end web page modules, including HTML (Hypertext Markup Language), HTMLS (Hypertext with Pagination), and Vue (Vue.js), etc., and also includes a gateway (OMS) and Hypertext Transfer Protocol (HTP). The proxy service component layer includes modules such as HTTP and HTTPS, and its management layer includes modules for node management, version management, web interface, data dashboard, plugin management, and task distribution. Within the management layer, there is a storage layer containing relational database management systems (MySQL), search servers (Elasticsearch), and message queues (Kafka). The communication layer includes modules for North Star, transport protocols (Remote Procedure Call (TRPC) and Transport Layer Security (TLS)). The proxy service component layer includes modules for synchronous interfaces, asynchronous interfaces, data reporting, service upgrades, task distribution, and plugin management. Additionally, the proxy service component layer includes a storage module, which may include a lightweight database (SQLite, a relational database management system that adheres to the four fundamental elements of correct database transaction execution). The proxy service component architecture may also include a monitoring module for real-time monitoring of the proxy service component architecture.
[0189] Figure 6b This is a module call diagram of a business processing method provided in this application embodiment. It includes modules such as a front-end, a web server (nginx, a high-performance HTTP and reverse proxy web server), an authentication module, business data, static resources, a microservice group, service registration, an agent cluster, a message service, and file storage. The service registration module can register using Polaris. The business data module can be managed using a relational database management system (MySQL). The message service can obtain data reported by the agent cluster and process it through a message queue (Kafka), stash service, and search server (Elasticsearch), and can send the business data to the microservice group. The file storage module can store data using object storage (COS). The authentication module can authenticate requests received by the microservice group. The microservice group module can include node management, version management, web interface, data statistics, plugin management, and task management. The agent cluster module can include plugin management, version management, task management, local storage management, service registration, and data reporting. The agent cluster can be stored locally using a relational database management system (MySQL).
[0190] Figure 6c This is a schematic diagram of the data flow structure of the proxy service component framework for a business processing method provided in this application embodiment. In this case, the server can report relevant Agent data to the message queue Kafka through the proxy service component, and then transmit it to the search server (Elasticsearch, ES) and the management end through subscription. At the same time, the search server can also perform data statistics and send the statistical results to the management end. The management end can also synchronize with the proxy service component through the synchronization interface. In addition, the management end can transmit the acquired business data to the search server and display the corresponding data to the user.
[0191] As described above, in this embodiment, the server starts the proxy service component corresponding to the current node and loads the management plugin corresponding to the proxy service component. The management plugin registers the proxy service component and reports its heartbeat information. The server determines candidate proxy services for the current node, searches for the plugin file of at least one business plugin corresponding to the candidate proxy service, and loads at least one business plugin corresponding to the candidate proxy service into the proxy service component of the current node based on the plugin file. When a business processing request for a target business is received, the server determines the target proxy service corresponding to the target business, obtains the plugin identifier associated with the target proxy service, and identifies the target business plugin corresponding to the target proxy service in the proxy service component of the current node based on the plugin identifier. The server searches for the target plugin instance corresponding to the target business plugin based on the target plugin identifier, and determines the target business based on the instance function interface in the target plugin instance. The server calls the target business plugin based on the target function interface corresponding to the plugin. When a plugin deletion request for the proxy service component is received, the server obtains the plugin identifier to be deleted carried in the deletion request. Based on the plugin identifier to be deleted, the server searches for the plugin identifier and plugin structure corresponding to the plugin identifier to be deleted in the associated data container corresponding to the current node, and deletes the found plugin identifier and plugin structure corresponding to the plugin identifier to be deleted. When a plugin addition request for the proxy service component is received, the server obtains the dynamic link file corresponding to the business plugin to be added based on the plugin addition request, loads the dynamic link file into memory, and maps the loaded dynamic link file to the preset plugin interface of the associated data container. Based on the preset plugin interface, the server extracts the plugin identifier and plugin structure corresponding to the business plugin to be added from the dynamic link file, and adds the extracted plugin identifier and plugin structure corresponding to the business plugin to be added to the associated data container. In this way, by identifying the target proxy service corresponding to the business processing request, the target business plugin corresponding to the target proxy service is determined in the proxy service component, and the target function interface corresponding to the target business plugin is called to respond to the business processing request based on the target business plugin. At the same time, by managing the plugin structure in the plugin instance corresponding to the target business plugin, the deletion and addition of proxy services can be performed in a pluggable manner. By using business plugins to replace the proxy service component to implement the proxy service function, the duplicate deployment of the proxy service component is avoided, the deployment efficiency of the proxy service component is improved, and thus the business processing efficiency is improved.
[0192] To better implement the above methods, embodiments of the present invention also provide a business processing device, which can be integrated into a computer device, which can be a server.
[0193] For example, such as Figure 7 The diagram shown is a schematic representation of the structure of a business processing device provided in an embodiment of this application. This business processing device may include a target proxy service determination unit 301, a target business plugin determination unit 302, a filtering unit 303, and a calling unit 304, as follows:
[0194] The target proxy service determination unit 301 is used to determine the target proxy service corresponding to the target service when a service processing request for the target service is received.
[0195] The target business plugin determination unit 302 is used to determine the target business plugin corresponding to the target proxy service in the proxy service component of the current node. The proxy service component includes at least one business plugin corresponding to a candidate proxy service, and each business plugin implements the function of a candidate proxy service.
[0196] The filtering unit 303 is used to filter out the target functional interface corresponding to the target business plugin from the functional interfaces corresponding to the candidate proxy service.
[0197] Calling unit 304 is used to call the target business plugin according to the target function interface in response to the business processing request.
[0198] In one embodiment, the screening unit 303 includes:
[0199] The lookup sub-unit is used to find the target plugin instance corresponding to the target business plugin based on the target plugin identifier corresponding to the target business plugin.
[0200] The target function interface determination subunit is used to determine the target function interface corresponding to the target business plugin based on the instance function interface in the target plugin instance. The instance function interface is obtained by filtering based on the function interface corresponding to the candidate proxy service.
[0201] In one embodiment, the target service plugin determination unit 302 includes:
[0202] The plugin identifier retrieval sub-unit is used to retrieve the plugin identifier associated with the target proxy service;
[0203] The target business plugin identification subunit is used to identify the target business plugin corresponding to the target proxy service in the proxy service component of the current node based on the plugin identifier.
[0204] In one embodiment, the service processing apparatus further includes:
[0205] The candidate proxy service acquisition unit is used to determine the candidate proxy service corresponding to the current node;
[0206] The plugin file lookup unit is used to find the plugin files of at least one business plugin corresponding to the candidate proxy service.
[0207] The business plugin loading unit is used to load at least one business plugin corresponding to the candidate proxy service into the proxy service component of the current node based on the plugin file.
[0208] In one embodiment, the service processing apparatus further includes:
[0209] The plugin identifier acquisition unit is used to acquire the plugin identifier to be deleted carried in the deletion request when a plugin deletion request for the proxy service component is received.
[0210] The search unit is used to search for the plugin identifier and plugin structure corresponding to the plugin identifier to be deleted in the associated data container corresponding to the current node, based on the plugin identifier to be deleted.
[0211] The deletion unit is used to delete the plugin identifier and plugin structure corresponding to the found plugin identifier to be deleted.
[0212] In one embodiment, the service processing apparatus further includes:
[0213] The dynamic link file acquisition unit is used to obtain the dynamic link file corresponding to the business plugin to be added based on the plugin addition request when a plugin addition request for the proxy service component is received.
[0214] The mapping unit is used to load the dynamic link file into memory and map the loaded dynamic link file to the preset plugin interface of the associated data container;
[0215] The extraction unit is used to extract the plugin identifier and plugin structure corresponding to the business plugin to be added from the dynamic link file based on the preset plugin interface.
[0216] The addition unit is used to add the extracted plugin identifier and plugin structure corresponding to the business plugin to be added to the associated data container.
[0217] In one embodiment, the service processing apparatus further includes:
[0218] The management interface type determination unit is used to determine the management interface type based on the management interface call request when a management interface call request for the proxy service component is received.
[0219] The management unit is used to call the management interface corresponding to the management interface type and manage the proxy service component based on the management interface.
[0220] In one embodiment, the service processing apparatus further includes:
[0221] The startup unit is used to start the proxy service component corresponding to the current node and load the management plugin corresponding to the proxy service component.
[0222] The registration unit is used to register the proxy service component through the management plugin and to obtain and report the heartbeat information of the proxy service component.
[0223] In practice, each of the above units can be implemented as an independent entity or can be arbitrarily combined to be implemented as the same or several entities. For the specific implementation of each of the above units, please refer to the previous method embodiments, which will not be repeated here.
[0224] As described above, in this embodiment, when the target proxy service determination unit 301 receives a service processing request for a target service, it determines the target proxy service corresponding to the target service; the target service plugin determination unit 302 determines the target service plugin corresponding to the target proxy service in the proxy service component of the current node, wherein the proxy service component includes at least one service plugin corresponding to a candidate proxy service, and each service plugin implements the function of a candidate proxy service; the filtering unit 303 filters out the target function interface corresponding to the target service plugin from the function interfaces corresponding to the candidate proxy services; and the calling unit 304 calls the target service plugin according to the target function interface to respond to the service processing request. Thus, by determining the target proxy service corresponding to the service processing request, and then determining the target service plugin corresponding to the target proxy service in the proxy service component, and calling the target function interface corresponding to the target service plugin to respond to the service processing request based on the target service plugin, this method of using a service plugin to replace the proxy service component to implement the function of the proxy service avoids the repeated deployment of the proxy service component, improves the deployment efficiency of the proxy service component, and thus improves the service processing efficiency.
[0225] This application also provides a computer device, such as... Figure 8 As shown, it illustrates a structural diagram of a computer device involved in an embodiment of this application. This computer device may be a server, specifically:
[0226] The computer device may include components such as a processor 401 with one or more processing cores, a memory 402 with one or more computer-readable storage media, a power supply 403, and an input unit 404. Those skilled in the art will understand that... Figure 8 The computer device structure shown does not constitute a limitation on the computer device and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein:
[0227] The processor 401 is the control center of the computer device. It connects various parts of the computer device via various interfaces and lines, and performs various functions and processes data by running or executing software programs and / or modules stored in the memory 402, and by calling data stored in the memory 402, thereby providing overall monitoring of the computer device. Optionally, the processor 401 may include one or more processing cores; preferably, the processor 401 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 401.
[0228] The memory 402 can be used to store software programs and modules. The processor 401 executes various functional applications and business processes by running the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 402 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 with access to the memory 402.
[0229] The computer device also includes a power supply 403 that supplies power to the various components. Preferably, the power supply 403 can be logically connected to the processor 401 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 403 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
[0230] The computer device may also include an input unit 404, which can be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
[0231] Although not shown, the computer device may also include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 401 in the computer device loads the executable files corresponding to the processes of one or more applications into the memory 402 according to the following instructions, and the processor 401 runs the applications stored in the memory 402 to realize various functions, as follows:
[0232] When a business processing request for a target business is received, the target proxy service corresponding to the target business is determined; the target business plugin corresponding to the target proxy service is determined in the proxy service component of the current node, wherein the proxy service component includes at least one business plugin corresponding to a candidate proxy service, and each business plugin implements the function of a candidate proxy service; the target function interface corresponding to the target business plugin is selected from the function interfaces corresponding to the candidate proxy services; the target business plugin is called according to the target function interface to respond to the business processing request.
[0233] The specific implementation of each of the above operations can be found in the preceding embodiments, and will not be repeated here. It should be noted that the computer device provided in this application embodiment and the business processing method in the above embodiments belong to the same concept, and its specific implementation process can be found in the above method embodiments, and will not be repeated here.
[0234] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0235] Therefore, embodiments of this application provide a computer-readable storage medium storing a plurality of instructions that can be loaded by a processor to execute steps in any of the business processing methods provided in embodiments of this application. For example, the instructions can execute the following steps:
[0236] When a business processing request for a target business is received, the target proxy service corresponding to the target business is determined; the target business plugin corresponding to the target proxy service is determined in the proxy service component of the current node, wherein the proxy service component includes at least one business plugin corresponding to a candidate proxy service, and each business plugin implements the function of a candidate proxy service; the target function interface corresponding to the target business plugin is selected from the function interfaces corresponding to the candidate proxy services; the target business plugin is called according to the target function interface to respond to the business processing request.
[0237] The computer-readable storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0238] Since the instructions stored in the computer-readable storage medium can execute the steps in any of the business processing methods provided in the embodiments of this application, the beneficial effects that any of the business processing methods provided in the embodiments of this application can achieve can be realized. For details, please refer to the previous embodiments, which will not be repeated here.
[0239] According to one aspect of this application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods provided in the various optional implementations of the above embodiments.
[0240] The above provides a detailed description of a business processing method, apparatus, and computer-readable storage medium provided in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A business processing method, characterized in that, include: When a business processing request for a target business is received, the target proxy service corresponding to the target business is determined; In the proxy service component of the current node, the target business plugin corresponding to the target proxy service is determined. The proxy service component includes at least one business plugin corresponding to a candidate proxy service. Each business plugin implements the function of a candidate proxy service. Only one proxy service component is deployed in the current node, and the business plugins and the proxy service component use a consistent functional interface so that the proxy service component can call different business plugins through the consistent functional interface to implement the functions of different candidate proxy services. Based on the target plugin identifier corresponding to the target business plugin, find the target plugin instance corresponding to the target business plugin; The target functional interface corresponding to the target business plugin is determined based on the instance functional interface in the target plugin instance, and the instance functional interface is obtained by filtering based on the functional interface corresponding to the candidate proxy service. The target business plugin is invoked according to the target function interface to respond to the business processing request.
2. The business processing method as described in claim 1, characterized in that, The step of determining the target business plugin corresponding to the target proxy service in the proxy service component of the current node includes: Obtain the plugin identifier associated with the target proxy service; Based on the plugin identifier, the target business plugin corresponding to the target proxy service is identified in the proxy service component of the current node.
3. The business processing method as described in claim 1, characterized in that, Before determining the target business plugin corresponding to the target proxy service in the proxy service component of the current node, the method further includes: Determine the candidate proxy service corresponding to the current node; Locate the plugin file of at least one business plugin corresponding to the candidate proxy service; Based on the plugin file, at least one business plugin corresponding to the candidate proxy service is loaded into the proxy service component of the current node.
4. The business processing method as described in any one of claims 1 to 3, characterized in that, The method further includes: When a plugin deletion request for the proxy service component is received, the identifier of the plugin to be deleted carried in the deletion request is obtained; Based on the plugin identifier to be deleted, search for the plugin identifier and plugin structure corresponding to the plugin identifier to be deleted in the associated data container corresponding to the current node; Delete the plugin identifier and plugin structure corresponding to the found plugin identifier to be deleted.
5. The business processing method as described in claim 4, characterized in that, The method further includes: When a plugin addition request for the proxy service component is received, the dynamic link file corresponding to the business plugin to be added is obtained according to the plugin addition request; The dynamic link file is loaded into memory, and the loaded dynamic link file is mapped to the preset plugin interface of the associated data container; Based on the preset plugin interface, extract the plugin identifier and plugin structure corresponding to the business plugin to be added from the dynamic link file; Add the extracted plugin identifier and plugin structure corresponding to the business plugin to be added to the associated data container.
6. The business processing method as described in any one of claims 1 to 3, characterized in that, The method further includes: When a management interface call request for the proxy service component is received, the management interface type is determined based on the management interface call request; Call the management interface corresponding to the management interface type, and manage the proxy service component based on the management interface.
7. The business processing method as described in any one of claims 1 to 3, characterized in that, Before determining the target business plugin corresponding to the target proxy service in the proxy service component of the current node, the method further includes: Start the proxy service component corresponding to the current node and load the management plugin corresponding to the proxy service component; The management plugin is used to register the proxy service component and to obtain and report the heartbeat information of the proxy service component.
8. A business processing device, characterized in that, include: The target proxy service determination unit is used to determine the target proxy service corresponding to the target service when a service processing request for the target service is received. The target business plugin determination unit is used to determine the target business plugin corresponding to the target proxy service in the proxy service component of the current node. The proxy service component includes at least one business plugin corresponding to a candidate proxy service. Each business plugin implements the function of a candidate proxy service. Only one of the proxy service components is deployed in the current node, and the business plugins and the proxy service component use a consistent functional interface so that the proxy service component can call different business plugins through the consistent functional interface to implement the functions of different candidate proxy services. The filtering unit is used to find the target plugin instance corresponding to the target business plugin based on the target plugin identifier corresponding to the target business plugin; and to determine the target function interface corresponding to the target business plugin based on the instance function interface in the target plugin instance, wherein the instance function interface is obtained by filtering based on the function interface corresponding to the candidate proxy service. The invocation unit is used to invoke the target business plugin according to the target function interface in response to the business processing request.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a plurality of instructions adapted for loading by a processor to perform the steps of the business processing method according to any one of claims 1 to 7.
10. A computer device, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the business processing method of any one of claims 1 to 7.
11. A computer program, characterized in that, The computer program includes computer instructions stored in a storage medium. The processor of the computer device reads the computer instructions from the storage medium and executes the computer instructions, causing the computer device to perform the business processing method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Extensible network agent method, system, and architecture
US20050097193A1
Universal Security Agent
US20180302409A1