Policy routing implementation method and system for unified foreign data platform
Through dynamic rule configuration and intelligent routing strategies, the problem of insufficient stability and fault tolerance of the unified foreign data platform in a multi-data source environment is solved, intelligent disaster recovery and resource optimization are achieved, and the efficient and stable operation of the business system is ensured.
Patent Information
- Application Number
- CN202410964016.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-18
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2044-07-18
AI Technical Summary
The existing unified foreign data platform has insufficient stability and fault tolerance when using multiple third-party data sources, resulting in long response times and low efficiency of the business system when third-party data sources fail, affecting the user experience, and the cost of rule iteration is high. Fault tolerance is weak and requires manual intervention.
Adopting dynamic rule-based configuration algorithms and intelligent routing strategies, through real-time monitoring of data source status, dynamic selection of the best data source, intelligent disaster recovery strategies, automatic switching or shielding of faulty data sources, ensuring the normal operation of the business system, and through intelligent Routing strategies optimize resource allocation and improve service quality.
It improves the stability and fault tolerance of the unified foreign number platform, reduces abnormal risks caused by external factors, optimizes resource allocation, adapts to complex network environments, and achieves service stability guarantee without manual intervention.
Smart Images

Figure CN118524047B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of policy routing, and in particular to a policy routing implementation method and system for a unified external data platform. Background Art
[0002] The unified external data platform manages external data and services in a unified manner, packages business function interfaces and provides them to business systems to meet the realization of business functions. As the undertaker of the underlying data services, the unified external data platform is connected to the business systems of various business lines, which places very high demands on the stability and fault tolerance of the external data platform services.
[0003] Due to the large number of third-party sources and their complex types, the service quality of each data source varies greatly. We cannot interfere with the stability of the third-party system, nor can we perceive the future risks of the third-party services. Risks such as service unavailability and response timeout may occur at any time, which will directly affect the business system, resulting in the inability to carry out business normally and even causing economic losses, which is unacceptable for the business system.
[0004] Currently, data integration and management platforms can help users integrate multiple third-party data sources, but even a small change to the rules still requires running the entire process such as development, testing, and deployment. The cost of rule development and maintenance is high, resulting in high rule iteration costs for switching data sources. When a third-party data source fails or is unavailable, it is easy to affect the stability of the business system. In addition, the fault tolerance capability of the existing platform is weak, and when the failure is serious, it still needs to rely on manual intervention, which can easily lead to long platform response time and low efficiency, affecting the user experience.
[0005] In view of this, it is necessary to propose a policy routing implementation method for a unified external data platform to solve the shortcomings of the above-mentioned existing platforms when using multiple third-party data sources. Summary of the invention
[0006] The purpose of the present invention is to provide a unified external data platform policy routing implementation method and system, improve the stability and fault tolerance of the unified external data platform service, optimize resource allocation through policy routing, and improve service quality.
[0007] The present invention provides a method for implementing policy routing of a unified foreign data platform, comprising:
[0008] responding to a target service request;
[0009] Based on the dynamic rule configuration algorithm, the feature data in the current business environment is collected and extracted, and the corresponding rule engine is called to calculate the routing rules to generate the dynamically configured target routing rules. The target routing rules are updated and applied to the requested routing decision process to adjust the current routing strategy and generate an intelligent routing strategy.
[0010] Based on the intelligent routing strategy, the corresponding policy routing is executed and combined with the dynamically acquired indicators related to the routing channel capabilities, one or more target channel results that can meet the business needs are calculated;
[0011] When the target channel result does not specify a routing selection strategy, all target channel lists are traversed to obtain a real-time indicator list, the real-time indicators corresponding to all the target channels are calculated and standardized to obtain standardized indicators, and the comprehensive score of each target channel is calculated based on the difference between the standardized indicators corresponding to the target channel, and the target channel with the highest comprehensive score is returned to satisfy the intelligent selection of the optimal channel as the final target channel result.
[0012] Preferably, the target channels with the highest comprehensive scores returned include:
[0013] Traverse the success rate list, abnormal rate list and average time consumption list of all target channels to calculate the maximum success rate, minimum success rate, maximum abnormal rate, minimum abnormal rate, maximum average time consumption and minimum average time consumption;
[0014] Calculate the normalized success rate for each goal channel ,
[0015] Calculate the normalized anomaly rate for each target channel ,
[0016] Calculate the normalized average time spent in each goal funnel ,
[0017] Normalized success rate based on current target channels , Standardized abnormality rate and standardized average time Calculate the overall score of the goal funnel ;
[0018] Sort by the comprehensive score of each target channel and return the target channel with the highest score;
[0019] Among them, SRi is the average request success rate of the current channel, min(SR) is the minimum success rate of the current channel, max(SR) is the maximum success rate of the current channel, ERi is the average request exception rate of the current channel, min(ER) is the minimum exception rate of the current channel, max(ER) is the maximum exception rate of the current channel, ATi is the average time consumption of the current channel, min(AT) is the minimum time consumption of the current channel, and max(AT) is the maximum time consumption of the current channel.
[0020] As a preferred embodiment, it also includes: based on the time sliding window algorithm, statistics are collected on the health of various indicator data corresponding to the business requests entering the window time to obtain the real-time status of each current target channel, and according to the real-time status of each target channel, it is determined whether the current channel and the business system are abnormal;
[0021] In normal mode, each target channel is selected according to the routing strategy selection algorithm, and the optimal channel is selected as the final routing result. The third-party service corresponding to the target channel is executed and the business execution status is fed back. The report request result is generated and the monitored indicator data is updated.
[0022] In the fault mode, when it is monitored that the current target channel and the business system are in an abnormal state, causing the data source corresponding to the current target channel to fail or become unavailable, the intelligent disaster recovery strategy is triggered to switch or shield the current target channel to ensure the normal operation of the business system. The intelligent disaster recovery strategy includes a single interface fault disaster recovery mechanism and an interface continuous fault disaster recovery mechanism.
[0023] Preferably, the intelligent routing strategy is combined with the dynamically acquired indicators related to the routing channel capability to execute the corresponding policy routing, and the one or more target channel results that can meet the business needs are calculated, including:
[0024] Obtain the access party's intelligent routing policy configuration based on the caller and service attributes;
[0025] Determine whether there is an intelligent routing policy configuration for the access party;
[0026] If there is an intelligent routing policy configuration, the service interface range is determined according to the service attributes and interface groups to which the intelligent routing configuration belongs, and the service interface list and the corresponding routing rule group corresponding to the current routing rule are obtained, and the routing rule group includes a routing rule condition group and a routing rule action group;
[0027] Match the routing rules according to the business interface list, first execute the routing rule condition group, then execute the routing rule action group according to whether the executed routing rule conditions are met, and finally filter out the interface list corresponding to the matching target channel;
[0028] If there is no corresponding intelligent routing policy configuration, and there is no target channel interface that meets the routing rules or multiple target channel interfaces are matched, the fallback routing strategy is executed. In the absence of a backup channel, the target channel interface in a faulty state is restored and the target channel interface is selected to ensure that the target channel interface can output results under any circumstances.
[0029] Preferably, the intelligent routing strategy further includes:
[0030] In the business scenario of four-factor ID card verification, access the first target channel and the second target channel that meet the business needs, where the first target channel has a higher accuracy in verifying the ID card validity period than the second target channel, and the price of the first target channel is higher than the price of the second target channel;
[0031] In the above business scenario, configure the following routing rules based on the intelligent routing strategy:
[0032] The configuration rule category is the four-factor ID card verification routing rule, which includes the name on the ID card, the ID card number, and the ID card's validity start and end dates;
[0033] The configuration rule details are whether the ID card validity period is within the preset period;
[0034] The rule condition is configured to determine whether the valid start date of the ID card in the input parameter is within the preset period;
[0035] Configure the rule action to route to the first target channel when the condition is met, and to route to the second target channel when the condition is not met;
[0036] During operation, when the validity period of the ID card submitted by the business is within the preset period, the routing rule hits the rule condition, executes the rule action that meets the condition, and routes to the first target channel with higher accuracy;
[0037] When the validity period of the ID card submitted by the business is not within the preset period, the routing rule does not hit the rule condition, and the rule action that does not meet the condition is executed, that is, routing to the second target channel with a lower price.
[0038] Preferably, when it is monitored that the current target channel and the business system are in an abnormal state so that the data source corresponding to the current target channel fails or is unavailable, triggering the intelligent disaster recovery strategy to switch or shield the current target channel to ensure the normal operation of the business system includes:
[0039] Get access to multiple target channels based on business requests;
[0040] When it is monitored that the service communication of the initial target channel has network fluctuations and the request to the initial target channel fails, the single interface fault recovery mechanism is triggered to filter the initial target channel and then execute the corresponding routing rules to select other channels except the initial target channel;
[0041] Obtaining indicator data of the initial target channel called within a preset time in an inaccessible state, and determining whether the indicator data triggers an indicator threshold corresponding to a fuse, and triggering an interface continuous fault disaster recovery mechanism when the fuse indicator threshold is triggered, wherein the indicator data includes the total number of requests, the total number of successes, the total number of exceptions, the total time consumption, the minimum time consumption, and the maximum time consumption;
[0042] Based on the fault recovery mechanism, the initial target channel fuse downgrade strategy is triggered to reduce the priority of the initial target channel to the lowest level. When the automatic recovery time is exceeded, the initial target channel interface is restored again and routed in all target channels again according to the next service request.
[0043] After the above downgrading process, if the initial target channel is still in an inaccessible state, the initial target channel will continue to be downgraded, and the time for the next automatic recovery will be gradually increased.
[0044] Preferably, the single interface fault disaster recovery mechanism includes:
[0045] When a fault occurs in the current target channel after the server initiates an HTTP request, the misalignment detection mechanism is triggered to detect the fault of the current target channel. The fault condition at least includes abnormal connection between the business system and the current target channel, connection timeout or server error. The misalignment detection mechanism is completed by monitoring the network connection status, setting the connection timeout or receiving the error code returned by the server;
[0046] In the case of receiving an error code, determining whether to request a retry based on an influencing factor of a routing retry operation, wherein the influencing factor of the routing retry operation includes an error type in network communication and a limit on the number of routing retries;
[0047] Before performing a routing retry operation, a delay strategy or a backoff strategy is introduced from the client to increase the pre-delay time before the routing retry operation to prevent too frequent requests from causing excessive load on the server. The delay strategy includes a fixed delay mechanism for keeping the delay time between each routing retry operation unchanged, and the backoff strategy includes an exponential backoff mechanism for controlling the delay time of each routing retry operation to be a multiple of the previous one;
[0048] When performing a route retry operation, the server resends the same HTTP request as the previous one by saving the previous request data and generates a route retry record log;
[0049] The routing retry operation refers to a retry operation on the current target channel or a retry operation on a switching channel that is determined and configured based on the tolerance of the business system to errors.
[0050] Preferably, the interface continuous fault disaster recovery mechanism includes:
[0051] Monitor the health of each target channel interface and store it in the Redis distributed cache;
[0052] Based on the configurable time window length and circuit breaker degradation strategy, it is determined whether the circuit breaker needs to reach the indicator threshold to evaluate the health of each target channel interface;
[0053] When the indicator of the current target channel interface reaches the threshold within the preset time, the fuse downgrade strategy is triggered, and the disaster recovery switching and fault recovery mechanism are automatically performed to ensure the normal operation of the business system. The disaster recovery switching and fault recovery mechanism refers to automatically reducing the weight of the current channel, giving priority to routing to another target channel interface, ensuring the normal operation of the business system through a backup data source or a cache mechanism, and automatically switching back to the original data source after the current channel is restored; wherein, the configurable time window length and fuse downgrade strategy refers to a combination of the time sliding window algorithm and the fuse strategy, including: when the number of request exceptions exceeds the request exception number threshold within the set time window, triggering fuse downgrade for the current channel; And / or, when the request abnormal error rate exceeds the error rate threshold within the set time window, the current channel is triggered to be circuit-breaker and downgraded; and / or, when the average request time exceeds the time threshold within the set time window, the current channel is triggered to be circuit-breaker and downgraded; configure the automatic recovery time sequence, and after exceeding the configured automatic recovery time, the downgraded channel is restored from the server; if the channel triggers the circuit breaker again, the next recovery time of the channel is gradually increased; the time sliding window algorithm adopts Bucket to count various indicator data within a window time, and Bucket adopts LongAdder array to record various indicator data within the window time to ensure the atomicity of data modification.
[0054] Preferably, the system model adopted by the unified foreign data platform includes a knowledge base, a rule management module and a rule engine.
[0055] The knowledge base is used to obtain the corresponding relationship between configuration views and mode factors and select them, converting the original input configuration expression into rule categories, rule details, rule conditions, rule actions and source data related to the configuration in the form of visual views;
[0056] A rule management module, which includes rule categories, rule details, rule conditions and rule actions, and is used to determine the corresponding rule categories under the target scenario and the relationship between the rule details, rule conditions and rule actions under the rule categories, and to combine the selected pattern factors of the knowledge base into a target rule expression; wherein a rule category includes multiple rule details, and each rule detail includes N rule conditions and N rule actions;
[0057] The rule engine is used to control the execution of the rules of the configured intelligent routing strategy. When executing the routing rules, a mode of matching conditions first and then executing actions is adopted. The rule conditions and the rule actions corresponding to each rule condition are executed one by one according to the configuration order of each rule detail. When executing the routing strategy, the rule condition statements are matched according to the routing strategies with high to low priorities, and the judgment is started from the rule condition with the highest priority, and the corresponding satisfied and unsatisfied rule actions are executed. The rule actions are also executed from high to low priorities.
[0058] The present invention also provides a policy routing implementation system for a unified foreign data platform, comprising:
[0059] A request module, used to respond to a target service request;
[0060] The dynamic configuration module is used to collect and extract feature data in the current business environment based on the dynamic rule configuration algorithm, call the corresponding rule engine to calculate the routing rules to generate the dynamically configured target routing rules, and apply the updated target routing rules to the requested routing decision process to adjust the current routing strategy and generate an intelligent routing strategy;
[0061] The routing strategy module is used to execute corresponding strategy routing based on intelligent routing strategy and in combination with the dynamically acquired indicators related to routing channel capabilities, and calculate one or more target channel results that can meet business needs;
[0062] The scoring optimization module is used to traverse all target channel lists to obtain real-time indicator lists when the target channel result does not specify a routing selection strategy, calculate the real-time indicators corresponding to all the target channels and standardize them to obtain standardized indicators, and calculate the comprehensive score of each target channel based on the difference between the standardized indicators corresponding to the target channel, and return the target channel with the highest comprehensive score to satisfy the intelligent selection of the optimal channel as the final target channel result.
[0063] With respect to the prior art, the present invention has the following beneficial effects:
[0064] The present invention provides a unified foreign data platform policy routing implementation method, which provides API services based on visual intelligent routing, and guarantees the access of services through interface routing rules, load balancing strategies, and intelligent routing strategies, thereby improving the stability and fault tolerance of foreign data platform services, minimizing the abnormal risks caused by external factors, optimizing resource allocation, improving network security, and adapting to complex network environments.
[0065] The present invention dynamically selects the best data source through a dynamically configured intelligent routing strategy: according to the characteristics of business data or the experience of operators, dynamic routing rules are configured to dynamically select the best data source for use by the business system. By real-time monitoring of the status of the data source, it can automatically switch to a reliable data source, thereby avoiding system interruption or performance degradation caused by the failure of a certain data source.
[0066] The present invention realizes exception handling and fault tolerance through intelligent disaster recovery strategy: for abnormal situations such as unavailability of third-party services or response timeout, the present invention provides corresponding exception handling mechanisms and fault tolerance strategies. For example, the normal operation of the business system can be guaranteed through a backup data source or cache mechanism, and it can automatically switch back to the original data source after the third-party service is restored; without manual intervention, the stability of the service is guaranteed to the maximum extent.
[0067] The present invention realizes a convenient rule configuration method through a dynamically configured system model: it provides a simple and easy-to-use management background, allowing operators to directly modify routing rules, load strategies and other configurations, so as to quickly select the best data source to meet business needs, and at the same time can quickly switch and shield data sources with poor effects. BRIEF DESCRIPTION OF THE DRAWINGS
[0068] Figure 1 A schematic diagram of the steps of a method for implementing policy routing of a unified foreign data platform in an embodiment of the present invention;
[0069] Figure 2 This is an example diagram of a rule management module in an embodiment of the present invention;
[0070] Figure 3 This is a functional example diagram of the rule engine in an embodiment of the present invention;
[0071] Figure 4 This is an example diagram of the process of the intelligent routing strategy in the embodiment of the present invention;
[0072] Figure 5 This is an example diagram of the process of the fuse downgrade strategy in an embodiment of the present invention. DETAILED DESCRIPTION
[0073] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0074] Embodiment 1
[0075] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0076] It should be noted that the concepts such as "once" and "second" mentioned in the present application are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0077] It should be noted that the modifications of "one" and "plurality" mentioned in the disclosure of this application are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0078] The unified external data platform used in this embodiment will have many intelligence data sources. These channel suppliers may execute different business requests, but many suppliers may make the same business request. For example, the accessed suppliers are divided by the scope of use: supplier A provides the US data source, supplier B provides Southeast Asian data, or supplier C provides global data; there are also suppliers with different capabilities such as price, supplier arrival rate or accuracy. Different suppliers have better effects on specific capabilities. In order to better apply to different suppliers, this embodiment provides a set of rule matching logic to adapt the capabilities of each supplier, which can automatically route and better solve business needs. The unified external data platform used in this embodiment, that is, the external data comprehensive management platform, is managed uniformly and centrally within the platform, forming a unified external data access standard, and providing safe, convenient and stable external data services for various systems within the bank. Routing rules in this embodiment: a set of rules that define and configure how the program selects the best data source in the system. Disaster recovery strategy: refers to a series of measures and plans formulated to deal with unexpected disasters or failure events to ensure the continuity and recovery capabilities of systems, data and businesses.
[0079] In order to solve the above defects and meet the above requirements, Figure 1 As shown, the present invention provides a method for implementing policy routing of a unified external data platform, including:
[0080] S1: respond to the target service request;
[0081] S2: Based on the dynamic rule configuration algorithm, the feature data in the current business environment is collected and extracted, and the corresponding rule engine is called to calculate the routing rules to generate the dynamically configured target routing rules. The updated target routing rules are applied to the requested routing decision process to adjust the current routing strategy and generate an intelligent routing strategy.
[0082] S3: Based on the intelligent routing strategy, the corresponding policy routing is executed and combined with the dynamically acquired indicators related to the routing channel capabilities, one or more target channel results that can meet the business needs are calculated;
[0083] S4: When the target channel result does not specify a routing selection strategy, traverse all target channel lists to loop and obtain real-time indicator lists, calculate and standardize the real-time indicators corresponding to all the target channels to obtain standardized indicators, and calculate the comprehensive score of each target channel based on the difference between the standardized indicators corresponding to the target channels, and return the target channel with the highest comprehensive score to satisfy the intelligent selection of the optimal channel as the final target channel result.
[0084] S5: In monitoring mode, the health of various indicator data corresponding to the business requests entering the window time is counted based on the time sliding window algorithm to obtain the real-time status of each target channel, and judge whether the current target channel and business system are abnormal based on the real-time status of each target channel;
[0085] S6: In normal mode, each target channel is selected according to the routing strategy selection algorithm, and the optimal channel is selected as the final routing result. The third-party service corresponding to the target channel is executed and the business execution status is fed back, and the report request result is generated. The background asynchronously updates the indicator data according to the request result. When selecting the routing strategy in this embodiment, the system has built-in random routing strategy, weight random strategy and weight priority strategy, which can be flexibly expanded according to actual business needs.
[0086] S7: In failure mode, when it is monitored that the current target channel and the business system are in an abnormal state, causing the data source corresponding to the current target channel to fail or become unavailable, the intelligent disaster recovery strategy is triggered to switch or shield the current target channel to ensure the normal operation of the business system. The intelligent disaster recovery strategy includes a single interface failure disaster recovery mechanism and an interface continuous failure disaster recovery mechanism.
[0087] In order to adapt to the capabilities of different suppliers, the system model used for the intelligent routing strategy pre-rule configuration in this embodiment includes a knowledge base, a rule management module and a rule engine. The knowledge base is used to obtain the corresponding relationship between the configuration view and the mode factor and select it, and convert the original input configuration expression into the rule category, rule details, rule conditions, rule actions and source data related to the configuration in the form of a visual view; it is responsible for providing configuration views and mode factors. The view and mode have a one-to-one correspondence. For example, when a "greater than" view is displayed on the configuration interface, there is a "$parameter 1>$parameter 2" mode corresponding to it. The knowledge base can preset commonly used views and operations, which on the one hand reduces the threshold for business personnel to configure, and on the other hand constrains user input to ensure the legality of input. Views and modes can be understood as the basic data of the rule management module. In order to reduce the threshold for business personnel to configure and constrain the legality, the configuration input by the business personnel will be converted into the source data of the configuration of rule categories, rule details, rule conditions, and rule actions in the form of a visual view. For example, if the source data of rule conditions and actions is an expression, the corresponding view can display the methods, symbols and other elements in the expression for business personnel to choose and finally generate the expression without paying attention to the syntax and rules of the expression itself.
[0088] The rule management module includes rule categories, rule details, rule conditions and rule actions. The relationship between them is as follows: Figure 2 As shown, it is used to determine the relationship between the rule category corresponding to the target scenario and the rule details, rule conditions and rule actions under the rule category, and combine the pattern factors of the selected knowledge base into a target rule expression; wherein a rule category includes multiple rule details, and each rule detail includes N rule conditions and N rule actions;
[0089] The rule engine is used to control the execution of the rules of the intelligent routing strategy after configuration. When executing the routing rules, the mode of matching conditions first and then executing actions is adopted. The rule conditions and the rule actions corresponding to each rule condition are executed one by one according to the configuration order of each rule detail. When executing the routing strategy, the rule condition statements are matched according to the routing strategies with high to low priorities, and the judgment is started from the rule conditions with the highest priority, and the corresponding satisfied and unsatisfied rule actions are executed. The rule actions are also executed from high to low priorities. It can be understood that the rule engine is responsible for executing the rules. When executing the rules, the rule conditions and the rule actions corresponding to the conditions are executed one by one according to the order of the details of each rule, and the final result is obtained. The rule execution adopts the condition matching-action execution mode, that is, matching conditions first and then executing actions. When executing the routing strategy, the conditional statement is matched from the routing strategy with the highest priority. For example, in the business scenario of the four-element verification of the ID card, its conditional statement is to judge whether the startDate in the input parameter is within the past 3 months. The system will make a logical judgment based on the configured expression to determine whether the condition is met. Start judging from the rule condition with the highest priority, and execute the corresponding satisfied and unsatisfied rule actions. The rule actions are also executed from high to low priority. Figure 3 The example is shown in the figure.
[0090] In order to make the intelligent routing function highly flexible and customizable, it is necessary to dynamically configure and calculate routing rules according to different business needs and conditions, so as to provide the system with powerful and flexible routing functions. We use parsing expression language to achieve this. The technical implementation of parsing expression language mainly includes the following aspects:
[0091] 1. Expression parsing: The target expression corresponding to the business request is parsed based on the lexical analyzer and the syntax analyzer, and the string expression is divided into a series of lexical units. An abstract syntax tree (AST) is constructed based on the lexical units to represent the structure and meaning of the target expression. It can be understood that the target expression needs to be parsed to obtain its specific meaning. In technical implementation, a lexical analyzer and a syntax analyzer are usually used to parse the target expression. The lexical analyzer divides the string expression into a series of lexical units, such as variable names, operators, etc. The syntax analyzer constructs an abstract syntax tree (AST) based on the lexical units to represent the structure and meaning of the target expression.
[0092] 2. Context: By defining a context object and setting the context-related information as the object's properties or methods, the context required for the target expression to be executed is determined. The context-related information includes variable and function information. The context includes request parameters, service status, business data, and information related to routing policies. It can be understood that the execution of the target expression requires a context, which contains relevant information such as variables and functions. In the intelligent routing function, the context usually includes request parameters, service status, business data, and other information. In technical implementation, a context object can be defined and relevant information can be set as the object's properties or methods so that it can be accessed and calculated in the expression.
[0093] 3. Expression calculation: Use recursion or iteration to traverse the abstract syntax tree AST, and perform corresponding calculation operations according to the node type, that is, during the calculation process, evaluate according to the variables and function information in the context environment, and finally get the calculation result of the target expression; it can be understood that once the target expression is parsed and the context environment is ready, the target expression can be calculated. During the calculation process, the target expression will be evaluated according to the information such as variables and functions in the context environment. In technical implementation, the abstract syntax tree is usually traversed recursively or iteratively, and the corresponding calculation operations are performed according to the node type, and finally the calculation result of the target expression is obtained.
[0094] 4. Dynamic configuration: Dynamically adjust the target expression through an editable configuration interface or interface. When the target expression is modified, re-perform the above steps from parsing to calculation to obtain the optimized target expression, and apply the updated routing rules to the requested routing decision process; it can be understood that the user can modify the expression at runtime to flexibly adjust the routing rules. In technical implementation, an editable configuration interface or interface can be provided to allow users to enter and modify the expression content. Once the expression is modified, the system will re-parse and calculate the expression and apply the new routing rules to the requested routing decision process.
[0095] With the support of the rule configuration function, business personnel can configure the weight, priority and routing strategy of the access channels, and configure the best routing strategy based on the actual business situation and comprehensive evaluation of the conditions of each channel.
[0096] See also Figure 4 As shown, in order to adapt to the different capabilities of each supplier channel interface, the intelligent routing strategy based on dynamic configuration in this embodiment is specifically implemented as follows:
[0097] Obtain the access party's intelligent routing policy configuration based on the caller and service attributes;
[0098] Determine whether there is an intelligent routing policy configuration for the access party;
[0099] If there is an intelligent routing policy configuration, the service interface range is determined according to the service attributes and interface groups to which the intelligent routing configuration belongs, and the service interface list corresponding to the current routing rule and the corresponding routing rule group are obtained. The routing rule group includes a routing rule condition group and a routing rule action group; routing rule conditions: generally filtering conditions, the format is {#attribute#operator#value}, for example: interface price>3 yuan; routing rule actions: implemented through the system built-in method, divided into two types: with return value and without return value. The return value is generally an operation action, such as sorting, filtering according to attributes, etc.; the non-return value is generally a printing action, such as output logs, etc.
[0100] Match the routing rules according to the service interface list, first execute the routing rule condition group, then execute the routing rule action group according to whether the executed routing rule conditions are met, and finally filter out the matching interface list;
[0101] If there is no corresponding intelligent routing policy configuration, if there is no target channel interface that meets the routing rules or multiple target channel interfaces are matched, the fallback routing policy is executed. In the absence of a backup channel, the target channel interface in the faulty state is restored and the target channel interface is selected to ensure that the target channel interface can output results in any case. That is, if there is no interface that meets the routing rules or multiple interfaces are matched, the fallback routing policy is used to select an interface; the interface information is returned.
[0102] The bottom-line routing strategy adopted in this embodiment is to ensure that the interface can output results under any circumstances. Since the route output by this embodiment has an intelligent disaster recovery function, a certain faulty channel may be excluded during the last routing. In this case, there may be no other backup channels during this routing. In this case, the bottom-line routing strategy will restore the faulty channel to avoid the abnormal situation that there is no channel to choose from in this case. The built-in method of the system in this embodiment: provides actions such as reverse sorting by attribute, forward sorting by attribute, specifying routes, and outputting logs. It can be flexibly expanded and freely configured according to actual business needs. Technical implementation of the bottom-line routing strategy: When the final channel result calculated by the routing rules configured by the business personnel contains multiple channels and no routing selection strategy is specified, the system will make a comprehensive judgment based on the collected real-time indicator data of the channel. For example, the score, cost and other indicators of the channel, where the score is calculated based on the real-time indicators such as the total number of requests, the total number of successes, the total number of exceptions, the total time, the minimum time, and the maximum time within 10 seconds of the channel. The system will intelligently select the most suitable channel as the final result.
[0103] In this embodiment, the application of the intelligent routing strategy in the business scenario of four-element ID card verification is as follows: the first target channel and the second target channel that meet the business needs are accessed, wherein the first target channel has a higher accuracy in verifying the validity period of the ID card than the second target channel, and the price of the first target channel is higher than the price of the second target channel; in the business scenario of four-element ID card verification, two channels A and B are accessed, wherein the verification result of channel A for the ID card with a validity period of nearly 3 months is more accurate, but the price of channel B is lower. In order to ensure the accuracy of verification and reduce costs as much as possible, the following routing rules can be configured as follows, that is, the following routing rules are configured based on the intelligent routing strategy in the above business scenario:
[0104] The configuration rule category is the four-factor ID card verification routing rule, which includes the name on the ID card, the ID card number, and the ID card's validity start and end dates;
[0105] The configuration rule details are whether the ID card is valid within the preset period; Rule details 1: whether the validity period is within 3 months;
[0106] The rule condition is to determine whether the valid start date of the ID card in the input parameter is within the preset period; the rule condition is to determine whether the startDate in the input parameter is within the past 3 months;
[0107] Configure the rule action to route to the first target channel when the condition is met, and to the second target channel when the condition is not met; the rule condition is to determine whether the startDate in the input parameter is within the past 3 months; the rule action is to route to channel A when the condition is met, and to channel B when the condition is not met;
[0108] During operation, when the validity period of the ID card submitted by the business is within the preset period, the routing rule hits the rule condition, executes the rule action that meets the condition, and routes to the first target channel with higher accuracy; in actual business, when the validity period of the ID card submitted by the business is within 3 months, the routing rule will hit the rule condition, execute the rule action that meets the condition, and route to the A channel with higher accuracy.
[0109] When the validity period of the ID card submitted by the business is not within the preset period, the routing rule does not hit the rule condition, and the rule action that does not meet the condition is executed, that is, routing to the second target channel with a lower price. When the validity period of the ID card submitted by the business is not within 3 months, the routing rule does not hit the rule condition, and the rule action that does not meet the condition is executed, that is, routing to the B channel with a lower price.
[0110] Another example of an intelligent routing strategy is as follows:
[0111] In the business scenario of the withdrawal channel, different transaction scenarios correspond to different channels. It must be ensured that each transaction scenario can accurately send funds through the designated channel. Therefore, configure the following routing rules:
[0112] The main category of configuration rules is the routing rules for withdrawal;
[0113] Configure the first rule details to determine whether it is the first transaction scenario A and generate the corresponding transaction scenario code; configure the rule condition to determine whether it belongs to the first transaction scenario A through the scenario code; configure the first rule action to specify the first target channel a, second target channel b, and third target channel c of the first transaction scenario A when the condition is met; if the condition is not met, proceed to the next rule detail judgment; configure the second rule action to specify the weights of the first target channel a, second target channel b, and third target channel c as 50, 30, and 20 respectively when the condition is met;
[0114] Configure the second rule details to determine whether it is the second transaction scenario B and generate the corresponding transaction scenario code; configure the rule condition to determine whether it belongs to the second transaction scenario B by the scenario code; configure the third rule action to specify the fourth target channel d of the second transaction scenario B when the condition is met; if the condition is not met, proceed to the next rule detail judgment;
[0115] Configure the third rule details to determine whether the common transaction scenario C is used and generate the corresponding transaction scenario code; configure the rule conditions to be any scenario except the first transaction scenario A and the second transaction scenario B; configure the fourth rule action to be all target channels / channels that meet the conditions.
[0116] In actual business, when the business submits a request for transaction scenario A, the routing rule will execute rule details 1, 2, and 3 in order of priority, and will hit the satisfying condition of rule detail 1. At this time, two rule actions that meet the conditions will be taken, one is to frame the channel range a, b, and c, and the other is to assign weight values to the three channels a, b, and c. At this time, the system will determine the final channel based on the routing strategy configured by the business personnel.
[0117] In order to intelligently select the most appropriate channel, reduce latency, distribute traffic among multiple paths, avoid overloading a single path, and thus improve network stability and performance, in this embodiment, when the final channel result calculated by the routing rules configured by the business personnel contains multiple channels and no routing selection strategy is specified, the system will make a comprehensive judgment based on the collected channel real-time indicator data. For example, the channel's score, cost and other indicators, where the score is calculated based on the channel's total number of requests, total number of successes, total number of exceptions, total time, minimum time, maximum time and other real-time indicators. The system will intelligently select the most appropriate channel as the final result. The specific implementation steps are as follows: When we have n target channels, the success rate, exception rate and average time of each channel are recorded as SRi, ERi and ATi respectively, and the success rate list, exception rate list and average time list of all target channels are traversed to calculate the maximum success rate, minimum success rate, maximum exception rate, minimum exception rate, maximum average time and minimum average time; specifically, the channels list is looped to obtain the success rate list (successRates), exception rate list (exceptionRates) and average time list (avgTimes); when calculating the maximum and minimum values, the maximum success rate (maxSuccessRate), minimum success rate (minSuccessRate), maximum exception rate (maxExceptionRate), minimum exception rate (minExceptionRate), maximum average time (maxAvgTime) and minimum average time (minAvgTime) are calculated according to the success rate list (successRates), exception rate list (exceptionRates) and average time list (avgTime).
[0118] Calculate the normalized success rate for each goal channel ,
[0119] Calculate the normalized anomaly rate for each target channel ,
[0120] Calculate the normalized average time spent in each goal funnel ,
[0121] Normalized success rate based on current target channels , Standardized abnormality rate and standardized average time Calculate the overall score of the goal funnel ; Obtain a comprehensive score according to the calculation formula and assign it to channel.score. Sort the target channels according to their comprehensive scores and return the target channel with the highest score. Where SRi is the average request success rate of the current channel, min(SR) is the minimum success rate of the current channel, max(SR) is the maximum success rate of the current channel, ERi is the average request exception rate of the current channel, min(ER) is the minimum exception rate of the current channel, max(ER) is the maximum exception rate of the current channel, ATi is the average time consumption of the current channel, min(AT) is the minimum time consumption of the current channel, and max(AT) is the maximum time consumption of the current channel.
[0122] When business personnel believe that channels a, b, and c of transaction scenario A can meet the needs and all three channels can be selected, a random routing strategy is configured. At this time, the system will ignore the priorities of the three channels and select any channel through a random algorithm.
[0123] In this embodiment, the application of selecting each target channel based on the routing strategy selection algorithm is as follows:
[0124] 1. The routing strategy selection algorithm adopted in this embodiment is implemented by a random routing strategy algorithm:
[0125] It is implemented based on the linear congruential generator (LCG) algorithm. The linear congruential generator is a simple mathematical formula used to generate a series of pseudo-random numbers. Its basic principle is to use a linear equation to generate a series of numbers that are statistically random. By specifying the upper limit of the number of remaining channels, the random algorithm generates a number between 0 and the maximum number of channels, thereby selecting the channel corresponding to the array index as the final routing result.
[0126] When business personnel conclude from experience that the stability of the three channels is c>a>b and expect to distribute traffic according to channel stability, they will configure a weighted random strategy. At this time, the system will route traffic based on the weight values of the three channels a, b, and c according to their proportions. 50% of the traffic will go to a, 30% of the traffic will go to b, and 20% of the traffic will go to c.
[0127] 2. The routing strategy selection algorithm adopted in this embodiment is implemented by a weighted random routing strategy algorithm:
[0128] The weighted random algorithm is a method that considers the weights of different elements in random selection. The core of the algorithm is that the probability of each element being selected is proportional to its weight, which can be achieved using the cumulative weight method. The channel corresponding to the array index is selected based on the obtained random number as the final routing result.
[0129] When business personnel know that a certain channel is better and only want to use the remaining channels as backup channels, they will configure a weight priority strategy. At this time, the system will sort the three channels a, b, and c according to their weight values, and give priority to channel a with the highest weight value.
[0130] In order to maximize the stability of the service without manual intervention, when the current channel and the business system are monitored to be in an abnormal state so that the data source corresponding to the current channel fails or is unavailable, the specific steps of triggering the intelligent disaster recovery strategy to ensure the normal operation of the business system are as follows:
[0131] Get access to multiple target channels based on business requests;
[0132] When it is monitored that the service communication of the initial target channel has network fluctuations and the request to the initial target channel fails, the single interface fault recovery mechanism is triggered to filter the initial target channel and then execute the corresponding routing rules to select other channels except the initial target channel;
[0133] Obtaining indicator data of the initial target channel called within a preset time in an inaccessible state, and determining whether the indicator data triggers an indicator threshold corresponding to a fuse, and triggering an interface continuous fault disaster recovery mechanism when the fuse indicator threshold is triggered, wherein the indicator data includes the total number of requests, the total number of successes, the total number of exceptions, the total time consumption, the minimum time consumption, and the maximum time consumption;
[0134] Based on the fault recovery mechanism, the initial target channel fuse downgrade strategy is triggered to reduce the priority of the initial target channel to the lowest level. When the automatic recovery time is exceeded, the initial target channel interface is restored again and routed in all target channels again according to the next service request.
[0135] After the above downgrade process, if the initial target channel is still in an inaccessible state, the initial target channel will continue to be downgraded, and the time for the next automatic recovery will be gradually increased to avoid frequent attempts to increase the burden on the system, give the problem channel time to recover, reduce interference with user experience, prioritize system stability, and prevent chain failures.
[0136] In one embodiment, the intelligent disaster recovery strategy adopted in this embodiment includes a single interface fault disaster recovery mechanism, which is designed to handle errors or failures that may occur in network communications. It allows the client to automatically retry to send the same request when a connection problem, timeout, or server error occurs. Implementation details:
[0137] Detection error: When the current channel fails after the server initiates an HTTP request, the misalignment detection mechanism is triggered to detect the fault of the current channel. The fault condition at least includes abnormal connection between the business system and the current channel, connection timeout or server error. The misalignment detection mechanism is completed by monitoring the network connection status, setting the connection timeout or receiving the error code returned by the server;
[0138] Decide to retry: When an error code is received, the decision on whether to retry the request is determined based on the influencing factors of the routing retry operation, which include the error type in network communication and the limit on the number of routing retries; if an error occurs, the client needs to determine whether a retry should be performed. This usually involves the following considerations: 1. Error type: Some error types, such as connection problems, may be temporary and can be resolved by retrying; while other error types, such as permission errors, may be permanent and not suitable for retrying. 2. Retry limit: In order to avoid infinite loops, an upper limit on the number of retries can be set. If the upper limit on the number of retries has been reached, no further retries will be made. Among them, the routing retry operation refers to a retry operation on the current channel or a retry operation on switching channels that is determined and configured based on the tolerance of the business system to errors.
[0139] Delay and backoff strategy: Before performing a routing retry operation, a delay strategy or backoff strategy is introduced from the client to increase the pre-delay time before the routing retry operation to prevent too frequent requests from causing excessive load on the server. The delay strategy includes a fixed delay mechanism to keep the delay time between each routing retry operation unchanged, and the backoff strategy includes an exponential backoff mechanism to control the delay time of each routing retry operation to be a multiple of the previous one;
[0140] Retry request: When deciding to retry the route, the server will resend the same HTTP request as the previous one by saving the previous request data and generate a route retry record log;
[0141] Record retry logs: When retrying, you usually need to record relevant log information for subsequent analysis and troubleshooting.
[0142] Flexible retry strategy configuration: You can configure the current channel retry strategy and the switching channel retry strategy, which is determined based on the business system's tolerance for errors. For example, switching channels to retry can minimize errors caused by problems in a single channel.
[0143] In one embodiment, the intelligent disaster recovery strategy adopted in this embodiment also includes an interface continuous fault disaster recovery mechanism. In daily business, each functional interface of the external data platform will receive a large number of business requests. If a high-priority channel has a continuous fault, although the single interface fault disaster recovery mechanism can ensure the normal response of the current request, in fact, each request will waste some resources on routing retries, and the response time of the interface will also be correspondingly longer. In view of this situation, the system has an interface continuous fault disaster recovery mechanism, and the implementation details are as follows:
[0144] Monitor the health of each channel interface and store it in the Redis distributed cache;
[0145] Based on the configurable time window length and circuit breaker degradation strategy, the health of each channel interface is evaluated by determining whether the circuit breaker needs to reach the indicator threshold. For example, if the interface error rate reaches 30% within 10 seconds, the circuit breaker degradation strategy will be triggered, the weight of the channel will be automatically reduced, and it will be routed to other channel interfaces first.
[0146] When the indicator of the current channel interface reaches the threshold within the preset time, the fuse downgrade strategy is triggered, and the disaster recovery switching and fault recovery mechanism are automatically performed to ensure the normal operation of the business system. The disaster recovery switching and fault recovery mechanism refers to automatically reducing the weight of the current channel, giving priority to routing to another connected channel interface, ensuring the normal operation of the business system through a backup data source or a cache mechanism, and automatically switching back to the original data source after the current channel is restored; wherein, the configurable time window length and fuse downgrade strategy refers to a combination strategy of the time sliding window algorithm and the fuse strategy, including: when the number of request exceptions exceeds the request exception number threshold within the set time window, the current channel is triggered to be fuse downgraded; and / or, when the request exception error rate exceeds the error rate threshold within the set time window, the current channel is triggered to be fuse downgraded; and / or, when the average request time within the set time window exceeds the time threshold, the current channel is triggered to be fuse downgraded; configure the automatic recovery time sequence, and after exceeding the configured automatic recovery time, the server performs a re-recovery operation on the downgraded channel; if the channel triggers the fuse again, the next recovery time of the channel is incremented one by one;
[0147] At the same time, the circuit breaker cannot be permanent. After the configured automatic recovery time has passed, the service will restore the downgraded channel. If the channel triggers the circuit breaker again, the next recovery time will increase. For example, the first recovery time is 10 minutes, the second time becomes 30 minutes, the third time becomes 1 hour, and so on. The recovery time sequence can also be configured, see Figure 5 shown.
[0148] This embodiment implements a real-time indicator data statistics algorithm for continuous interface failures: the time sliding window algorithm used uses Bucket to count various indicator data within a window time, and Bucket uses LongAdder array to record various indicator data within the window time to ensure the atomicity of data modification. Statistics of various indicator data within a window time include the total number of requests, the total number of successes, the total number of exceptions, the total time consumption, the minimum time consumption, the maximum time consumption, etc., and a Bucket can record data within one second or within 10 milliseconds. This time length is called the window time. For example, when it is necessary to count the number of requests processed every 1 second and to save the data of the last minute, the size of the Bucket array is set to 60, and the window time size of each Bucket is 1000 milliseconds / 1 second. It is only necessary to remove the millisecond part of the current timestamp to obtain the current number of seconds, and then take the remainder of the obtained number of seconds and the length of the array to obtain the position / index of the Bucket in the current time window in the array, thereby obtaining the interface indicator data of this 1 second, and being able to locate the Bucket. In the calculateTimeIdx method, taking the remainder is to realize the recycling of the array. If you want to obtain Bucket data for a continuous minute, you cannot simply traverse the array from the beginning. Instead, you must specify a start time and an end time, calculate the index of the Bucket stored in the array from the start timestamp, and then loop each time to add 1 second to the start timestamp until the start time equals the end time. When you need to obtain the total number of successful requests or total number of exceptions or total request processing time recorded by the Bucket, you can obtain the corresponding LongAdder from the Bucket's LongAdder array according to the event type (MetricEvent) and call the sum method to obtain the total number. When you need the Bucket to record a successful request or an exception request or the time it takes to process a request, you can obtain the corresponding LongAdder from the LongAdder array according to the event type (MetricEvent) and call its add method. The system collects indicator data from each channel interface in real time, and intelligently determines whether to trigger the threshold based on the threshold configured by the business personnel, thereby achieving intelligent disaster recovery.
[0149] Examples of intelligent disaster recovery strategies are as follows:
[0150] In the transaction notification SMS business scenario, three SMS channels are connected: the first target channel a, the second target channel b, and the third target channel c. In a certain business request, when the service communication with the first target channel a experiences network fluctuations and the first target channel a cannot be requested, a single interface fault disaster recovery is triggered. The system will execute the routing rules again after excluding the first target channel a, and choose between the second target channel b and the third target channel c to ensure that this request is not affected by the first target channel a.
[0151] Assume that within 10 seconds, the business requested the transaction notification SMS interface multiple times, such as 10 times, and the first target channel a became inaccessible, triggering the threshold of continuous interface failure. For example, the interface error rate reaches a threshold of 30% within the configured preset time, such as 10 seconds. At this time, the system's continuous interface failure disaster recovery will trigger the fuse downgrade strategy, and reduce the priority of the first target channel a to the lowest. After this action is completed, the next business request will no longer be routed to the first target channel a, but to the second target channel b and the third target channel c. At the same time, when the automatic recovery time is exceeded, the system will restore the first target channel a again, and the business request will be routed again in the first target channel a, the second target channel b, and the third target channel c. Of course, if the first target channel a is still unavailable, it will continue to downgrade the first target channel a, and increase the time for the next automatic recovery.
[0152] Embodiment 2
[0153] Based on the same inventive concept, the present invention provides a policy routing implementation system for a unified foreign data platform, including:
[0154] A request module, used to respond to a target service request;
[0155] The dynamic configuration module is used to collect and extract feature data in the current business environment based on the dynamic rule configuration algorithm, call the corresponding rule engine to calculate the routing rules to generate the dynamically configured target routing rules, and apply the updated target routing rules to the requested routing decision process to adjust the current routing strategy and generate an intelligent routing strategy;
[0156] The routing strategy module is used to execute the corresponding strategy routing based on the intelligent routing strategy and combine the dynamically acquired indicators related to the routing channel capabilities to calculate one or more target channel results that can meet the business needs;
[0157] The scoring optimization module is used to traverse all target channel lists to loop and obtain real-time indicator lists when the target channel result does not specify a routing selection strategy, calculate the real-time indicators corresponding to all the target channels and standardize them to obtain standardized indicators, and calculate the comprehensive score of each target channel according to the difference between the standardized indicators corresponding to the target channel, and return the target channel with the highest comprehensive score to meet the intelligent selection of the optimal channel as the final target channel result;
[0158] In monitoring mode, the health of various indicator data corresponding to the business requests entering the window time is counted based on the time sliding window algorithm to obtain the real-time status of each current target channel, and judge whether the current channel and business system are abnormal based on the real-time status of each target channel;
[0159] In normal mode, each target channel is selected according to the routing strategy selection algorithm, and the optimal channel is selected as the final routing result. The third-party service corresponding to the target channel is executed and the business execution status is fed back. The report request result is generated and the monitored indicator data is updated.
[0160] In the fault mode, when it is monitored that the current channel and the business system are in an abnormal state, causing the data source corresponding to the current channel to fail or become unavailable, the intelligent disaster recovery strategy is triggered to switch or shield the current target channel to ensure the normal operation of the business system. The intelligent disaster recovery strategy includes a single interface fault disaster recovery mechanism and an interface continuous fault disaster recovery mechanism.
[0161] The principles, contents and implementation methods of the above-mentioned request module, dynamic configuration module and routing strategy module are as described in the first embodiment and will not be repeated here.
[0162] Embodiment 3
[0163] In some embodiments of the present application, an electronic device is also provided. The electronic device includes a memory and a processor, wherein the memory is used to store a processing program, and the processor executes the processing program according to instructions. When the processor executes the processing program, the policy routing implementation method of the unified foreign data platform in the above-mentioned embodiment is implemented.
[0164] In some embodiments of the present application, a readable storage medium is also provided, which can be a non-volatile readable storage medium or a volatile readable storage medium. The readable storage medium stores instructions, and when the instructions are executed on a computer, an electronic device including the readable storage medium executes the aforementioned unified foreign data platform policy routing implementation method.
[0165] It is understandable that, for the aforementioned unified foreign data platform policy routing implementation method, if it is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program codes.
[0166] Computer readable storage media may include data signals propagated in baseband or as part of a carrier wave, wherein readable program codes are carried. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The readable storage medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, device, or device. The program codes contained on the readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination thereof.
[0167] The program code involved in executing the technical solution disclosed in the present application can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and also conventional procedural programming languages such as C language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, as an independent software package, partially on the user computing device and partially on the remote computing device, or completely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect through the Internet).
[0168] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for implementing policy routing in a unified foreign data platform, characterized in that: include: responding to a target service request; Based on the dynamic rule configuration algorithm, the feature data in the current business environment is collected and extracted, and the corresponding rule engine is called to calculate the routing rules to generate the dynamically configured target routing rules. The target routing rules are updated and applied to the requested routing decision process to adjust the current routing strategy and generate an intelligent routing strategy. Execute corresponding policy routing based on intelligent routing strategy and combine with the dynamically acquired indicators related to routing channel capability to calculate one or more target channel results that can meet the business needs, including: obtain the access party intelligent routing policy configuration according to the caller and business attributes; determine whether there is an access party intelligent routing policy configuration; if there is an intelligent routing policy configuration, determine the business interface range according to the business attributes and interface grouping to which the intelligent routing configuration belongs, obtain the business interface list and corresponding routing rule group corresponding to the current routing rule, and the routing rule group includes a routing rule condition group and a routing rule action group; match the routing rules according to the business interface list, first execute the routing rule condition group, and then execute the routing rule action group according to whether the executed routing rule conditions are established, and finally filter out the matching target channel corresponding interface list; if there is no corresponding intelligent routing policy configuration, if there is no target channel interface that meets the routing rules or multiple target channel interfaces are matched, execute the fallback routing strategy to restore the target channel interface in a faulty state and select the target channel interface in the absence of a backup channel to ensure that the target channel interface can output results under any circumstances; When the target channel result does not specify a routing selection strategy, all target channel lists are traversed to obtain a real-time indicator list, the real-time indicators corresponding to all the target channels are calculated and standardized to obtain standardized indicators, and the comprehensive score of each target channel is calculated based on the difference between the standardized indicators corresponding to the target channel, and the target channel with the highest comprehensive score is returned to satisfy the intelligent selection of the optimal channel as the final target channel result.
2. The method for implementing policy routing of a unified foreign data platform as claimed in claim 1, characterized in that: The target channels with the highest comprehensive scores include: Traverse the success rate list, abnormal rate list and average time consumption list of all target channels to calculate the maximum success rate, minimum success rate, maximum abnormal rate, minimum abnormal rate, maximum average time consumption and minimum average time consumption; Calculate the normalized success rate for each goal channel , Calculate the normalized anomaly rate for each target channel , Calculate the normalized average time spent in each goal funnel , Normalized success rate based on current target channels , Standardized abnormality rate and standardized average time Calculate the overall score of the goal funnel ; Sort by the comprehensive score of each target channel and return the target channel with the highest score; where SR𝑖 is the average request success rate of the current channel, min(SR) is the minimum success rate of the current channel, max(SR) is the maximum success rate of the current channel, ER𝑖 is the average request exception rate of the current channel, min(ER) is the minimum exception rate of the current channel, max(ER) is the maximum exception rate of the current channel, AT𝑖 is the average time consumption of the current channel, min(AT) is the minimum time consumption of the current channel, and max(AT) is the maximum time consumption of the current channel.
3. The method for implementing policy routing of a unified foreign data platform as claimed in claim 1, characterized in that: Also includes: Based on the time sliding window algorithm, the health of various indicator data corresponding to the business requests entering the window time is counted to obtain the real-time status of each current target channel, and the current channel and business system are judged whether they are abnormal according to the real-time status of each target channel; In normal mode, each target channel is selected according to the routing strategy selection algorithm, and the optimal channel is selected as the final routing result. The third-party service corresponding to the target channel is executed and the business execution status is fed back. The report request result is generated and the monitored indicator data is updated. In the fault mode, when it is monitored that the current target channel and the business system are in an abnormal state, causing the data source corresponding to the current target channel to fail or become unavailable, the intelligent disaster recovery strategy is triggered to switch or shield the current target channel to ensure the normal operation of the business system. The intelligent disaster recovery strategy includes a single interface fault disaster recovery mechanism and an interface continuous fault disaster recovery mechanism.
4. The method for implementing policy routing of a unified foreign data platform as claimed in claim 1, characterized in that: The intelligent routing strategy further includes: In the business scenario of four-factor ID card verification, access the first target channel and the second target channel that meet the business needs, where the first target channel has a higher accuracy in verifying the ID card validity period than the second target channel, and the price of the first target channel is higher than the price of the second target channel; In the above business scenario, configure the following routing rules based on the intelligent routing strategy: The configuration rule category is the four-factor ID card verification routing rule, which includes the name on the ID card, the ID card number, and the ID card's validity start and end dates; The configuration rule details are whether the ID card validity period is within the preset period; The rule condition is configured to determine whether the valid start date of the ID card in the input parameter is within the preset period; Configure the rule action to route to the first target channel when the condition is met, and to route to the second target channel when the condition is not met; During operation, when the validity period of the ID card submitted by the business is within the preset period, the routing rule hits the rule condition, executes the rule action that meets the condition, and routes to the first target channel with higher accuracy; When the validity period of the ID card submitted by the business is not within the preset period, the routing rule does not hit the rule condition, and the rule action that does not meet the condition is executed, that is, routing to the second target channel with a lower price.
5. The method for implementing policy routing of a unified foreign data platform as claimed in claim 3, characterized in that: When it is detected that the current target channel and the business system are in an abnormal state so that the data source corresponding to the current target channel fails or is unavailable, triggering the intelligent disaster recovery strategy to switch or shield the current target channel to ensure the normal operation of the business system includes: Get access to multiple target channels based on business requests; When it is monitored that the service communication of the initial target channel has network fluctuations and the request to the initial target channel fails, the single interface fault recovery mechanism is triggered to filter the initial target channel and then execute the corresponding routing rules to select other channels except the initial target channel; Obtaining indicator data of the initial target channel called within a preset time in an inaccessible state, and determining whether the indicator data triggers an indicator threshold corresponding to a fuse, and triggering an interface continuous fault disaster recovery mechanism when the fuse indicator threshold is triggered, wherein the indicator data includes the total number of requests, the total number of successes, the total number of exceptions, the total time consumption, the minimum time consumption, and the maximum time consumption; Based on the fault recovery mechanism, the initial target channel fuse downgrade strategy is triggered to reduce the priority of the initial target channel to the lowest level. When the automatic recovery time is exceeded, the initial target channel interface is restored again and routed in all target channels again according to the next service request. After the above downgrading process, if the initial target channel is still in an inaccessible state, the initial target channel will continue to be downgraded, and the time for the next automatic recovery will be gradually increased.
6. The method for implementing policy routing of a unified foreign data platform as claimed in claim 3, characterized in that: The single interface fault disaster recovery mechanism includes: When a fault occurs in the current target channel after the server initiates an HTTP request, the misalignment detection mechanism is triggered to detect the fault of the current target channel. The fault condition at least includes abnormal connection between the business system and the current target channel, connection timeout or server error. The misalignment detection mechanism is completed by monitoring the network connection status, setting the connection timeout or receiving the error code returned by the server; In the case of receiving an error code, determining whether to request a retry based on an influencing factor of a routing retry operation, wherein the influencing factor of the routing retry operation includes an error type in network communication and a limit on the number of routing retries; Before performing a routing retry operation, a delay strategy or a backoff strategy is introduced from the client to increase the pre-delay time before the routing retry operation to prevent too frequent requests from causing excessive load on the server. The delay strategy includes a fixed delay mechanism for keeping the delay time between each routing retry operation unchanged, and the backoff strategy includes an exponential backoff mechanism for controlling the delay time of each routing retry operation to be a multiple of the previous one; When performing a route retry operation, the server resends the same HTTP request as the previous one by saving the previous request data and generates a route retry record log; The routing retry operation refers to a retry operation on the current target channel or a retry operation on a switching channel that is determined and configured based on the tolerance of the business system to errors.
7. The method for implementing policy routing of a unified foreign data platform as claimed in claim 3, characterized in that: The interface continuous fault disaster recovery mechanism includes: Monitor the health of each target channel interface and store it in the Redis distributed cache; Based on the configurable time window length and circuit breaker degradation strategy, it is determined whether the circuit breaker needs to reach the indicator threshold to evaluate the health of each target channel interface; When the indicator of the current target channel interface reaches the threshold within the preset time, the fuse downgrade strategy is triggered, and the disaster recovery switching and fault recovery mechanism are automatically performed to ensure the normal operation of the business system. The disaster recovery switching and fault recovery mechanism refers to automatically reducing the weight of the current channel, giving priority to routing to another target channel interface, ensuring the normal operation of the business system through a backup data source or a cache mechanism, and automatically switching back to the original data source after the current channel is restored; wherein, the configurable time window length and fuse downgrade strategy refers to a combination of the time sliding window algorithm and the fuse strategy, including: when the number of request exceptions exceeds the request exception number threshold within the set time window, triggering fuse downgrade for the current channel; And / or, when the request abnormal error rate exceeds the error rate threshold within the set time window, the current channel is triggered to be circuit-breaker and downgraded; and / or, when the average request time exceeds the time threshold within the set time window, the current channel is triggered to be circuit-breaker and downgraded; configure the automatic recovery time sequence, and after exceeding the configured automatic recovery time, the downgraded channel is restored from the server; if the channel triggers the circuit breaker again, the next recovery time of the channel is gradually increased; the time sliding window algorithm adopts Bucket to count various indicator data within a window time, and Bucket adopts LongAdder array to record various indicator data within the window time to ensure the atomicity of data modification.
8. The method for implementing policy routing of a unified foreign data platform as claimed in claim 1, characterized in that: The system model adopted by the unified foreign data platform includes a knowledge base, a rule management module and a rule engine. The knowledge base is used to obtain the corresponding relationship between configuration views and mode factors and select them, converting the original input configuration expression into rule categories, rule details, rule conditions, rule actions and source data related to the configuration in the form of visual views; A rule management module, which includes rule categories, rule details, rule conditions and rule actions, and is used to determine the corresponding rule categories under the target scenario and the relationship between the rule details, rule conditions and rule actions under the rule categories, and to combine the selected pattern factors of the knowledge base into a target rule expression; wherein a rule category includes multiple rule details, and each rule detail includes N rule conditions and N rule actions; The rule engine is used to control the execution of the rules of the configured intelligent routing strategy. When executing the routing rules, a mode of matching conditions first and then executing actions is adopted. The rule conditions and the rule actions corresponding to each rule condition are executed one by one according to the configuration order of each rule detail. When executing the routing strategy, the rule condition statements are matched according to the routing strategies with high to low priorities, and the judgment is started from the rule condition with the highest priority, and the corresponding satisfied and unsatisfied rule actions are executed. The rule actions are also executed from high to low priorities.
9. A policy routing implementation system for a unified foreign data platform, characterized in that: include: A request module, used to respond to a target service request; The dynamic configuration module is used to collect and extract feature data in the current business environment based on the dynamic rule configuration algorithm, call the corresponding rule engine to calculate the routing rules to generate the dynamically configured target routing rules, and apply the updated target routing rules to the requested routing decision process to adjust the current routing strategy and generate an intelligent routing strategy; The routing strategy module is used to execute the corresponding strategy routing based on the intelligent routing strategy and in combination with the dynamically acquired indicators related to the routing channel capability, and calculate one or more target channel results that can meet the business needs, including: obtaining the intelligent routing strategy configuration of the access party according to the caller and the business attributes; judging whether there is an intelligent routing strategy configuration of the access party; if there is an intelligent routing strategy configuration, determining the service interface range according to the service attributes and interface grouping to which the intelligent routing configuration belongs, obtaining the service interface list and the corresponding routing rule group corresponding to the current routing rule, wherein the routing rule group includes a routing rule condition group and a routing rule action group; matching the routing rules according to the service interface list, first executing the routing rule condition group, and then executing the routing rule action group according to whether the executed routing rule conditions are established, and finally filtering out the interface list corresponding to the matching target channel; if there is no corresponding intelligent routing strategy configuration, when there is no target channel interface that meets the routing rule or multiple target channel interfaces are matched, executing the fallback routing strategy, in the absence of a backup channel, recovering the target channel interface in a faulty state and selecting the target channel interface to ensure that the target channel interface can output results under any circumstances; The scoring optimization module is used to traverse all target channel lists to obtain real-time indicator lists when the target channel result does not specify a routing selection strategy, calculate the real-time indicators corresponding to all the target channels and standardize them to obtain standardized indicators, and calculate the comprehensive score of each target channel based on the difference between the standardized indicators corresponding to the target channel, and return the target channel with the highest comprehensive score to satisfy the intelligent selection of the optimal channel as the final target channel result.
Citation Information
Cited By
Multi-channel routing fusing method based on multi-dimensional index perception and automatic recovery
CN122293578A
