Third-party service management method and system based on dynamic configuration task
By dynamically configuring task management methods, the problem of fixed processes in the interaction between business systems and third-party services is solved. This enables configurable task processes and metadata conversion, improving development efficiency and flexibility, and adapting to inconsistencies in fields across different third-party services.
Patent Information
- Application Number
- CN202311704834.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-11
- Publication Date
- 2026-02-13
- Estimated Expiration
- 2043-12-11
AI Technical Summary
In existing technologies, the interaction process between business systems and different third-party services is fixed and cannot be dynamically changed, resulting in insufficient flexibility. Furthermore, the inconsistency of fields in different third-party services requires repeated processing by the business system, leading to low efficiency.
By dynamically configuring task management methods, the task flow can be made configurable. Meta templates are used for data mapping and encryption/decryption, a logical hierarchy of nodes, tasks, and services is established, and third-party services are dynamically adapted to avoid code duplication in business systems.
It enables rapid integration with new third-party external systems, reduces feature development, improves development efficiency, reduces costs associated with adding third-party services, and resolves the issue of inconsistent fields between different third-party services.
Smart Images

Figure CN118012585B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the technical field of computer, and particularly relates to a third-party service management method and system based on dynamic configuration tasks. BACKGROUND
[0002] The statements in this section merely provide background information related to the present application and do not necessarily constitute the prior art.
[0003] In a computer system, a common solution for the interaction mode of a business system and a third-party service is a front-end machine. Figure 1 As shown in the figure, the business system sends data to the front-end machine, the front-end machine performs data encryption and decryption, and then forwards the data to the third-party service of the third-party external system.
[0004] In the above common solution, although the interaction between the business system and different third-party external systems is realized, the following problems exist:
[0005] In the interaction process between the business system and different third-party services, the business system has a fixed business and third-party service business node flow, which cannot be dynamically changed, and the business system needs to increase different processing if there are different third-party services; if there is file interaction with the third-party service, different business systems need to process file compression and decompression, and repeated code logic, resulting in insufficient flexibility.
[0006] The same business system needs to map data fields and data dictionaries according to different third-party services due to different interface fields of different third-party services, which is not efficient. SUMMARY
[0007] To overcome the above problems of the prior art, the present application provides a third-party service management method and system based on dynamic configuration tasks, which dynamically adapts public services and third-party services, realizes task flow configurability, uniformly processes public services to avoid repeated codes of the business system, and solves the inconsistency of different third-party service fields through metadata conversion based on meta templates.
[0008] To achieve the above purpose, one or more embodiments of the present application provide the following technical solutions:
[0009] The first aspect of the present application provides a third-party service management method based on dynamic configuration tasks.
[0010] The third-party service management method based on dynamic configuration tasks comprises:
[0011] Initializing the basic configuration, including optional encryption and decryption mode, optional service, and optional meta template, wherein the service includes public service and third-party service;
[0012] Reserving a business node in a business processing flow of a business system, creating multiple tasks for each business node, and dynamically configuring a service, an encryption and decryption method, and a meta template for each task to be executed;
[0013] During execution of the business system, the reserved business nodes are triggered in sequence, and the created tasks are executed, specifically as follows:
[0014] First, according to the configured meta template, the interaction data of the business system is mapped into data required by the third-party service based on a data mapping service in the common service, and then the encrypted transmission of the mapped data between the business system and the third-party service is performed based on an encrypted transmission service in the common service; secondly, the configured third-party service is executed to process the received data; finally, according to the configured meta template, the processing result is mapped into data required by the business system based on the data mapping service in the common service, and is returned to the business system.
[0015] Further, the optional encryption and decryption method includes an encryption and decryption algorithm and corresponding parameters required for encryption and decryption, wherein the encryption and decryption algorithm includes asymmetric encryption MS2, RSA, and symmetric encryption MS4.
[0016] The optional third-party service includes a third-party service accessible under a microservice architecture.
[0017] The meta template specifically includes a meta object, a meta field, and a meta dictionary, abstracts a domain element into a meta object, specifically defines a field of a certain third party as a meta field, and defines a dictionary value of the field of the certain third party as a meta dictionary.
[0018] Further, the task is divided into two types of common tasks and specific tasks.
[0019] The common task type selects a common service from a common service library for configuration.
[0020] The specific task type selects a third-party service from a third-party service library for configuration.
[0021] Further, the common service includes an encrypted transmission service, a file compression service, a file upload service, a file download service, and a data mapping service, corresponding to different sub-task types.
[0022] The third-party service is provided by a third-party external service system.
[0023] Further, the dynamic configuration includes the following specific information:
[0024] Task, subtask, unique identification, task status, retry number, retry interval, task serial number, whether to ignore failure, whether to synchronize, remote call address, encryption and decryption method, meta template.
[0025] Further, the common class task type and the specific class task type are executed by the common class task processor and the specific class task processor respectively.
[0026] Further, the task processor executes the created task, specifically:
[0027] The subtask type of the task to be executed is searched from the common class task processor, and the current task is executed by the corresponding common class task processor;
[0028] If no common class task processor is found, the task type of the task to be executed is searched from the specific class task processor, and the current task is executed by the corresponding specific class task processor;
[0029] If no specific class task processor is found, the next task of the business node is executed;
[0030] If there is no next task, the task result is returned to the business system.
[0031] The second aspect of the application provides a third-party service management system based on dynamic configuration tasks.
[0032] The third-party service management system based on dynamic configuration tasks includes an initialization module, a dynamic configuration module and a trigger execution module.
[0033] The initialization module is configured to initialize the basic configuration, including optional encryption and decryption methods, optional services and optional meta templates, wherein the services include common services and third-party services.
[0034] The dynamic configuration module is configured to reserve business nodes in the business processing flow of the business system, create multiple tasks for each business node, and dynamically configure the services, encryption and decryption methods and meta templates for each task.
[0035] The trigger execution module is configured to trigger the reserved business nodes in sequence during the execution of the business system to execute the created tasks, specifically:
[0036] First, according to the configured meta template, the interaction data of the business system is mapped into the data required by the third-party service based on the data mapping service in the common service, and then the encrypted transmission of the mapped data between the business system and the third-party service is performed based on the encrypted transmission service in the common service; secondly, the configured third-party service is executed to process the received data; finally, according to the configured meta template, the processing result is mapped into the data required by the business system based on the data mapping service in the common service, and is returned to the business system.
[0037] The third aspect of the present application provides a computer readable storage medium, which stores a program, and the program is executed by a processor to implement the steps in the third-party service management method based on dynamically configured tasks according to the first aspect of the present application.
[0038] The fourth aspect of the present application provides an electronic device, which comprises a memory, a processor and a program stored in the memory and executable on the processor, and the processor implements the steps in the third-party service management method based on dynamically configured tasks according to the first aspect of the present application when executing the program.
[0039] The above one or more technical solutions have the following beneficial effects:
[0040] The present application establishes a logical hierarchy of nodes-tasks-services, realizes the configurability of tasks and services, and only needs to implement a specific class of task processors, make specific task configurations, encryption and decryption mode configurations and meta template configurations when interfacing with a new third-party external system, so that a third-party external system can be quickly interfaced with, the function development is reduced, the development efficiency is improved, and the online speed is improved.
[0041] The advantages of the additional aspects of the present application will be partially given in the following description, partially will become obvious from the following description, or will be understood through the practice of the present application. BRIEF DESCRIPTION OF DRAWINGS
[0042] The drawings accompanying the specification of the present application form a part thereof, serve to provide further understanding of the present application, and together with the description of the exemplary embodiments of the present application and their description serve to explain the present application, and do not constitute improper limitations on the present application.
[0043] Figure 1 The figure is a schematic diagram of the interaction mode of the existing business system and the third-party service.
[0044] Figure 2 The figure is a flowchart of the method of the first embodiment.
[0045] Figure 3 The figure is a schematic diagram of the improved interaction mode of the business system and the third-party service of the first embodiment.
[0046] Figure 4 A flow chart for the first embodiment task execution.
[0047] Figure 5 A system architecture diagram for the second embodiment. DETAILED DESCRIPTION
[0048] It should be noted that the following detailed description is exemplary in nature and is intended to provide further description of the application. Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs.
[0049] It is also important to note that the terms "or" and "and" as used herein, unless otherwise indicated, are used to mean either or both, e.g., A or B, A and B. In addition, the terms "comprise," "comprising," "include," "including," and the like are synonymous with "containing" or "including," and are used in their broadest sense, and are used in particular to refer to the inclusion of one or more steps, features, components, elements or the like.
[0050] Embodiment One
[0051] In one or more embodiments, a third-party service management method based on dynamic configuration tasks is disclosed, as shown in Figure 2 comprising the following steps:
[0052] Step S1: initialize the basic configuration, including optional encryption and decryption methods, optional services, and optional meta-templates, wherein the services include public services and third-party services;
[0053] Step S2: reserve business nodes in the business processing flow of the business system, create multiple tasks for each business node, and dynamically configure the services, encryption and decryption methods, and meta-templates for each task;
[0054] Step S3: during the execution of the business system, trigger the reserved business nodes in sequence to execute the created tasks, specifically:
[0055] First, according to the configured meta-template, the interaction data of the business system is mapped to the data required by the third-party service based on the data mapping service in the public service, and then the encrypted transmission of the mapped data between the business system and the third-party service is performed based on the encrypted transmission service in the public service; second, the configured third-party service is executed to process the received data; finally, according to the configured meta-template, the processing result is mapped to the data required by the business system based on the data mapping service in the public service, and is returned to the business system.
[0056] Further, the optional encryption and decryption mode includes an encryption and decryption algorithm and corresponding encryption and decryption required parameters, wherein the encryption and decryption algorithm includes asymmetric encryption MS2, RSA, symmetric encryption MS4;
[0057] The optional third-party service includes a third-party service accessible under a microservice architecture.
[0058] The meta template specifically includes a meta object, a meta field and a meta dictionary, abstracts a domain element into a meta object, specifically corresponds to a field definition of a certain third party as a meta field, and a dictionary value of the field corresponds to a dictionary value of a field of a certain third party as a meta dictionary.
[0059] Further, the task is divided into two types of common type tasks and specific type tasks.
[0060] The common type task is configured by selecting a common service from a common service library.
[0061] The specific type task is configured by selecting a third-party service from a third-party service library.
[0062] Further, the common service includes an encrypted transmission service, a file compression service, a file upload service, a file download service and a data mapping service, corresponding to different subtask types.
[0063] The third-party service is provided by a third-party external service system.
[0064] Further, the dynamic configuration includes the following specific information:
[0065] Task, subtask, unique identifier, task status, retry number, retry interval, task serial number, whether to ignore failure, whether to synchronize, remote call address, encryption and decryption mode, and meta template.
[0066] Further, the common type task and the specific type task are respectively executed by a common type task processor and a specific type task processor.
[0067] Further, the task processor executes the created task, specifically:
[0068] The subtask type of the task to be executed is searched from the common type task processor, and the current task is executed by the corresponding common type task processor;
[0069] If no common type task processor is found, the task type of the task to be executed is searched from the specific type task processor, and the current task is executed by the corresponding specific type task processor;
[0070] If no specific type task processor is found, the next task of the business node is executed.
[0071] If there is no next task, the task result callback service system.
[0072] The implementation process of the third-party service management method based on dynamic configuration tasks of the embodiment is described in detail below.
[0073] On the basis of the existing interactive architecture, as shown in Figure 3 A third-party service management system is added between the service system and the third-party external system for dynamic configuration of tasks, services, meta templates, and encryption and decryption methods.
[0074] Specifically, in order to improve the efficiency of business processing, realize the automation of the process, and ensure that the service system only processes its own business data without needing to care about the interaction with the third-party service, in the embodiment, the dynamic configuration of tasks, services, meta templates, and encryption and decryption methods is performed through the logical hierarchy of business nodes-tasks-services. The service system does not need to care about which business node triggers the interaction with the third-party service management system, and the logic of node interaction processing is determined by the dynamic task configuration of the third-party service management system.
[0075] The dynamic task configuration can freely configure multiple tasks, and one business node can trigger multiple task processing. The third-party service management system configuration includes basic configuration and task configuration. Different starters are established for different third-party external systems, and plug-in configuration services are performed through pom files, including specific class task processors and encryption and decryption methods.
[0076] The processor of the third-party service management system is divided into a common class task processor and a specific class task processor. The common class task processor is used to execute common class tasks, and is directed to different sub-task types, including a file compression task processor, a file upload task processor, a file download task processor, and a metadata conversion task processor. The specific class task processor is used to execute specific tasks of the third-party external system.
[0077] In order to realize dynamic configuration, the basic configurations of optional encryption and decryption methods, optional third-party services, and optional meta templates need to be maintained, including encryption and decryption methods, parameters required for encryption and decryption, unique identifiers of meta templates, unique identifiers of third-party services, and specific parameters.
[0078] The encryption methods supported are asymmetric encryption MS2 and RSA, and symmetric encryption MS4.
[0079] By configuring the encryption method, the third-party service management system will encrypt and decrypt different message data in different ways to support diversified security interaction methods of different third-party external systems.
[0080] Based on the above basic configuration, the dynamic configuration of task, meta template and encryption and decryption mode is carried out for each service node.
[0081] Specifically, the task configuration includes task type (TaskType), sub-task type (subTaskType), unique identifier (appCode), task state (node), retry number, retry interval, task sequence number, whether to ignore failure, whether to synchronize, remote call address, and metadata template ID. A task can be composed of a group of sub-tasks, and the execution order is determined by the task sequence number, which is executed from small to large.
[0082] When the task configuration takes effect, the configuration is placed in redis for task caching. The business system queries the task cache for each node in the reserved multiple nodes to determine whether to trigger the node task. If it is hit, the parameters will be assembled and the message will be sent to the message middleware.
[0083] The third-party service management system will process the message sent by the message middleware, as shown in Figure 4 The process is as follows:
[0084] (1) According to the sub-task type (subTaskType), first find the public class task processor. If the public class task processor is found, execute the current task by the corresponding public class task processor, and execute step (3) after execution is completed.
[0085] (2) If no public class task processor is found, find a specific class task processor according to appCode+subTaskType. If the specific class task processor is found, execute the current task by the corresponding specific class task processor, and execute step (3) after execution is completed.
[0086] (3) If no specific class task processor is found, find the first task greater than the current task sequence number under the same task type according to the task type (TaskType). If the next task is found, execute step (1).
[0087] (4) If there is no next task, the task result callback business system is returned, and the self-loop is ended.
[0088] During task execution, if an exception occurs, the configuration of whether to ignore failure will be processed. If the configuration is no, the next task search is not performed, and the task result callback business system is directly returned. Otherwise, the next task is searched and processed.
[0089] The metadata template is used for metadata conversion to solve the inconsistency problem of different third-party service fields.
[0090] Specifically, the field element is abstracted as a meta object, the field definition of a certain third party is defined as a meta field, the dictionary value of the field is mapped to the dictionary value of the field of a certain third party as a meta dictionary, and the required information of the third party is defined as a meta template. Thus, the various fields required by the third party are dynamically configured, thereby meeting the requirements of different third parties for different names or different conventions of the same element, and the requirements of different third parties for different numbers of elements; the coding level is changed to the configuration level, thereby reducing the cost caused by the increase of the third party.
[0091] For tasks requiring metadata conversion, only the meta template ID needs to be configured, and the task performs data conversion through the metadata service to meet the requirements of different third parties for data fields.
[0092] When the system is running and the basic configuration is updated, the real-time refresh will be performed in the following cases:
[0093] 1. A new third party service starter goes online, i.e., a new third party external system needs to be connected;
[0094] 2. Parameters need to be modified, such as public and private keys.
[0095] At this time, the third party service management system synchronizes the latest basic configuration to the cache for use by other business systems.
[0096] Through the above scheme, the following goals are achieved:
[0097] (1) The task flow is configured, and the third party service is dynamically adapted, different encryption and decryption algorithms are configured according to different services, the public task is uniformly processed by the third party service management system, and the repeated code of the business system is avoided.
[0098] (2) According to the meta template, the metadata conversion is performed to solve the inconsistency of the fields of different third party services.
[0099] Embodiment Two
[0100] In one or more embodiments, a third party service management system based on dynamically configured tasks is disclosed, as shown in Figure 5 The third party service management system includes an initialization module, a dynamic configuration module, and a trigger execution module:
[0101] The initialization module is configured to initialize the basic configuration, including optional encryption and decryption methods, optional services, and optional meta templates, wherein the services include public services and third party services;
[0102] The dynamic configuration module is configured to reserve business nodes in the business processing flow of the business system, create multiple tasks for each business node, and dynamically configure the services, encryption and decryption methods, and meta templates for each task;
[0103] The triggering execution module is configured to trigger the reserved business nodes in sequence to execute the created task during execution of the business system, specifically:
[0104] First, according to the configured meta template, the interaction data of the business system is mapped into data required by the third-party service based on the data mapping service in the common service, and then the encrypted transmission of the mapped data between the business system and the third-party service is performed based on the encrypted transmission service in the common service; secondly, the configured third-party service is executed to process the received data; finally, according to the configured meta template, the processing result is mapped into data required by the business system based on the data mapping service in the common service, and is returned to the business system.
[0105] Embodiment three
[0106] An object of the embodiment is to provide a computer-readable storage medium.
[0107] A computer-readable storage medium has a computer program stored thereon, the program being executed by a processor to implement the steps in the third-party service management method based on dynamically configured tasks according to the embodiment one of the present disclosure.
[0108] Embodiment four
[0109] An object of the embodiment is to provide an electronic device.
[0110] An electronic device includes a memory, a processor, and a program stored in the memory and executable on the processor, and the processor executes the program to implement the steps in the third-party service management method based on dynamically configured tasks according to the embodiment one of the present disclosure.
[0111] The above merely describes preferred embodiments of the present disclosure and is not intended to limit the present disclosure. The present disclosure can be variously changed and modified by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present disclosure shall be included in the scope of protection of the present disclosure.
Claims
1. A third-party service management method based on dynamically configured tasks, characterized in that, include: The basic configuration is initialized, including optional encryption / decryption methods, optional services, and optional meta templates. The services include public services and third-party services. The optional encryption / decryption methods include encryption / decryption algorithms and corresponding encryption / decryption parameters. The encryption / decryption algorithms include asymmetric encryption MS2, RSA, and symmetric encryption MS4. The public services include encrypted transmission service, file compression service, file upload service, file download service, and data mapping service, corresponding to different sub-task types; The third-party service is provided by a third-party external service system; The optional meta template specifically includes meta objects, meta fields, and meta dictionaries. Domain elements are abstracted into meta objects, and a field corresponding to a certain third party is defined as a meta field. The dictionary value of the field corresponds to the dictionary value of a certain third party field, which is a meta dictionary. In the business processing flow of the business system, reserve business nodes, create multiple tasks for each business node, and dynamically configure the execution service, encryption / decryption method and meta template for each task. During the execution of the business system, the created tasks are executed by sequentially triggering the reserved business nodes, specifically as follows: (1) First, find the common class task processor according to the subtask type. If a common class task processor is found, the current task will be executed by the corresponding common class task processor. After the execution is completed, proceed to step (3). (2) If no common class task processor is found, then a specific class task processor is searched. If a specific class task processor is found, the current task is executed by the corresponding specific class task processor. After the execution is completed, step (3) is executed. (3) If no specific task processor is found, then search for the first task with a higher number than the current task under the same task type according to the task type. If the next task is found, then execute step (1). (4) If there is no next task, the task result is called back to the business system, and the self-loop ends; During execution, metadata transformation is performed using meta-templates, specifically as follows: First, based on the configured meta template and the data mapping service in public services, the interactive data of the business system is mapped to the data required by the third-party service. Then, based on the encrypted transmission service in public services, the mapped data is transmitted encrypted between the business system and the third-party service. Second, the configured third-party service is executed to process the received data. Finally, based on the configured meta template and the data mapping service in public services, the processing result is mapped to the data required by the business system and returned to the business system.
2. The third-party service management method based on dynamic configuration tasks as described in claim 1, characterized in that, The tasks are divided into two types: public tasks and specific tasks. For public task types, select a public service from the public service library for configuration; For specific task types, a third-party service is selected from the third-party service library for configuration.
3. The third-party service management method based on dynamic configuration tasks as described in claim 1, characterized in that, The dynamic configuration includes the following specific information: Task, subtask, unique identifier, task status, number of retries, retry interval, task sequence number, whether to ignore failures, whether to synchronize, remote call address, encryption / decryption method, meta template.
4. The third-party service management method based on dynamic configuration tasks as described in claim 1, characterized in that, The tasks of the common task type and the specific task type are executed by the common task processor and the specific task processor, respectively.
5. A third-party service management system based on dynamically configured tasks, characterized in that, The method described in any one of claims 1-4 includes an initialization module, a dynamic configuration module, and a trigger execution module. The initialization module is configured to initialize the basic configuration, including optional encryption / decryption methods, optional services, and optional meta templates. The services include public services and third-party services. The dynamic configuration module is configured to: reserve business nodes in the business processing flow of the business system, create multiple tasks for each business node, and dynamically configure the service to be executed, encryption / decryption method and meta template for each task; The trigger execution module is configured to: during the execution of the business system, execute the created tasks by sequentially triggering the reserved business nodes, specifically: First, based on the configured meta template and the data mapping service in public services, the interactive data of the business system is mapped to the data required by the third-party service. Then, based on the encrypted transmission service in public services, the mapped data is transmitted encrypted between the business system and the third-party service. Second, the configured third-party service is executed to process the received data. Finally, based on the configured meta template and the data mapping service in public services, the processing result is mapped to the data required by the business system and returned to the business system.
6. An electronic device, characterized in that it comprises: Memory is used to store computer-readable instructions in a non-transitory manner. as well as Processor, for executing the computer-readable instructions, When the computer-readable instructions are executed by the processor, they perform the method described in any one of claims 1-4.
7. A storage medium characterized in that it non-transitory stores computer-readable instructions, wherein, When the non-transitory computer-readable instructions are executed by a computer, the instructions of the method according to any one of claims 1-4 are executed.
Citation Information
Patent Citations
Service process management method and system for micro-service architecture, medium and electronic equipment
CN111092933A
Service processing method and device for real estate registration center
CN112883029A