Method and device for determining routing path, and nonvolatile storage medium
By dynamically adjusting the priority of routing channels in the payment system based on actual operating status and success rate, the problem of low payment stability caused by static routing channels is solved, thereby improving the efficiency and security of the payment system.
Patent Information
- Application Number
- CN202411754428.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-02
- Publication Date
- 2025-11-11
- Estimated Expiration
- 2044-12-02
AI Technical Summary
In existing payment systems, static routing channels cannot be dynamically adjusted according to the actual operating status, resulting in low payment stability and the inability to switch in time during failures, leading to payment failures and security risks.
By receiving payment requests, querying the routing process in the local cache, determining the highest priority target payment routing channel according to the filtering strategy, and outputting a routing error prompt when no routing process is found, the priority of the routing channels is dynamically adjusted, and intelligent adjustments are made based on the real-time running status and success rate of the channels.
This improves the stability and security of the payment system, ensuring that payment requests can be switched to reliable routing channels in a timely manner, thereby increasing the success rate of payments and improving the user experience.
Smart Images

Figure CN119762056B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and more specifically, to a method and apparatus for determining a routing channel and a non-volatile storage medium. Background Technology
[0002] With the development and popularization of internet technology, people's travel, shopping, and consumption activities increasingly rely on the internet. While mobile payment, e-commerce, and other online applications bring great convenience to people's lives, they also pose challenges to the security, stability, and efficiency of network services. Currently, payment systems typically use static routing channels, meaning that routing channels are pre-configured in the system and fixed during operation. This prevents dynamic adjustments based on the operational status of the routing channels, resulting in significant limitations in the priority, security, and stability of payment channels. Therefore, existing payment systems suffer from the inability to dynamically adjust payment channels.
[0003] There is currently no effective solution to the above problems. Summary of the Invention
[0004] This application provides a method and apparatus for determining a routing channel, as well as a non-volatile storage medium, to at least solve the technical problem of low payment stability caused by the inability to adjust the routing channel according to its actual operation due to the use of a fixed routing channel for payment.
[0005] According to one aspect of the embodiments of this application, a method for determining a routing channel is provided, comprising: receiving a payment request sent by a client, wherein the payment request is used to request access to a payment server; responding to the payment request, querying a routing process in a local cache, wherein the routing process is used to record a filtering strategy for payment routing channels, and the payment routing channel is used to transmit the payment request to the payment server; if a routing process is found, determining a channel list according to the filtering strategy, and determining the target payment routing channel with the highest priority in the channel list, wherein the channel list is used to record multiple payment routing channels, and the target payment routing channel is used to transmit the payment request to the payment server; if no routing process is found, outputting a routing error message to the client.
[0006] Optionally, querying the routing process in the local cache includes: parsing the payment request to obtain key parameters for querying the routing process, wherein the key parameters include at least: request system identification information indicating the system that initiated the payment request in the client; querying historical payment information associated with the key parameters in the local cache, and extracting the routing process recorded in the historical payment information.
[0007] Optionally, the channel list is obtained by filtering in the local cache according to the filtering strategy recorded in the target routing process. The target routing process is a routing process obtained in response to a payment request query. Filtering the channel list in the local cache according to the filtering strategy recorded in the target routing process includes: sequentially executing the query parameter filtering process, the channel filtering process, and the channel sorting process contained in the filtering strategy to obtain the channel list. The query parameter filtering process is used to filter the payment routing channels stored in the local cache that meet the query conditions for the first type of payment routing channels. The query conditions are generated based on the parameters recorded in the payment request. The channel filtering process is used to filter the first type of payment routing channels that meet the business requirements for the second type of payment routing channels. The business requirements are recorded in the payment request. The channel sorting process is used to determine the priority of each second type of payment routing channel and sort the second type of payment routing channels according to the priority to obtain the channel list.
[0008] Optionally, the first type of payment routing channel is obtained through the following method: parsing the payment request to obtain channel capability parameters and business type parameters, wherein the channel capability parameters describe the payment methods supported by the payment routing channel, and the business type parameters describe the transaction type corresponding to the payment request, including: purchase transaction and recharge transaction; concatenating the channel capability parameters and business type parameters into query conditions, and querying the target payment protocol type that meets the query conditions in a preset mapping table, wherein the preset mapping table records the association between the channel capability parameters, business type parameters and payment protocol types; if the target payment protocol type is found, selecting payment routing channels with the target payment protocol type from the payment routing channels stored in the local cache as the first type of payment routing channel; if the target payment protocol type is not found, selecting payment routing channels that meet the channel capability parameters from the payment routing channels stored in the local cache as the first type of payment routing channel.
[0009] Optionally, the second type of payment routing channel is determined by the following method: parsing the payment request to obtain the business type parameter, wherein the business type parameter describes the transaction type corresponding to the payment request, and the transaction type includes: purchase transaction, recharge transaction; querying the filtering factors associated with the business type parameter in the structured database Redis, wherein the filtering factors include: payment success rate, transaction limit, and transaction time; and filtering the second type of payment routing channel from the first type of payment routing channels according to the filtering factors.
[0010] Optionally, determining the priority of each second-type payment routing channel includes: obtaining a ranking factor, wherein the ranking factor includes: the payment success rate of each second-type payment routing channel and the transaction time of each second-type payment routing channel; determining a score value for each second-type payment routing channel based on the ranking factor of each second-type payment routing channel, wherein the score value is used to indicate the priority of the second-type payment routing channel, and the score value is positively correlated with the priority.
[0011] Optionally, after obtaining the channel list, the method further includes: recording the operational information of each second-type payment routing channel in the channel list during the detection period, wherein the operational information includes at least: the total number of payments and the number of successful payments; for each second-type payment routing channel, determining the target payment success rate of the second-type payment routing channel during the detection period based on the operational information; if the target payment success rate is less than the maximum value of the preset success rate range, reducing the priority of the second-type payment routing channel to the lowest level; if the target payment success rate is less than the minimum value of the preset success rate range, performing circuit breaker processing on the second-type payment routing channel.
[0012] According to another aspect of the embodiments of this application, a routing channel determination apparatus is also provided, comprising: a receiving module, configured to receive a payment request sent by a client, wherein the payment request is used to request access to a payment server; a querying module, configured to query a routing process in a local cache in response to the payment request, wherein the routing process is used to record a filtering strategy for payment routing channels, and the payment routing channels are used to transmit the payment request to the payment server; a determining module, configured to determine a channel list according to the filtering strategy when a routing process is found, and determine the target payment routing channel with the highest priority in the channel list, wherein the channel list is used to record multiple payment routing channels, and the target payment routing channel is used to transmit the payment request to the payment server; and an output module, configured to output a routing error message to the client when a routing process is not found.
[0013] According to another aspect of the embodiments of this application, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the above-described method for determining the routing channel through the computer program.
[0014] According to another aspect of the embodiments of this application, a computer program product is also provided, including computer instructions, which, when executed by a processor, implement the steps of the above-described method for determining a routing channel.
[0015] In this embodiment, a payment request is received from a client, whereby the payment request requests access to a payment server. In response to the payment request, a routing process is queried in a local cache. This routing process records the filtering strategy for payment routing channels, and the payment routing channels are used to transmit the payment request to the payment server. If a routing process is found, a channel list is determined according to the filtering strategy, and the highest-priority target payment routing channel is selected from the channel list. This channel list records multiple payment routing channels, and the target payment routing channel is used to transmit the payment request to the payment server. If no routing process is found, a routing error message is output to the client. By adjusting the priority of each payment routing channel according to the actual operating status of the payment routing channel based on the filtering strategy corresponding to the payment request, a channel list is generated, and the routing channel to implement the payment request is determined from the channel list. This achieves the goal of adjusting the priority of the routing channels according to their actual operating status, thereby improving the technical effect of payment stability. This solves the technical problem of low payment stability caused by using fixed routing channels for payment, which prevents adjustments based on the actual operating conditions of the routing channels. Attached Figure Description
[0016] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0017] Figure 1 This is a hardware structure block diagram of a computer terminal for implementing a method for determining a routing channel according to an embodiment of this application;
[0018] Figure 2 This is a flowchart illustrating the steps of a method for determining a routing channel according to an embodiment of this application;
[0019] Figure 3 This is a structural diagram of a routing channel determination device according to an embodiment of this application. Detailed Implementation
[0020] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0021] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0022] To better understand the embodiments of this application, the technical terms involved in the embodiments of this application are explained below:
[0023] Redis database: widely used as a cache, message broker, and database.
[0024] In related technologies, payment systems typically employ static routing channels, meaning that routing channels are pre-configured in the system and used consistently during operation. When the fixed routing channel fails, it cannot be switched over in a timely manner, leading to payment failures and low payment stability. Furthermore, if a payment system malfunctions, it often broadcasts payment requests to multiple servers simultaneously, resulting in low processing efficiency, security vulnerabilities, and a poor user experience. To address these issues, this application provides relevant solutions, detailed below.
[0025] According to an embodiment of this application, a method embodiment for determining a routing channel is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0026] The methods and embodiments provided in this application can be executed on mobile terminals, computer terminals, or similar computing devices. Figure 1 A hardware block diagram of a computer terminal for implementing a method for determining routing channels is shown. Figure 1As shown, the computer terminal 10 may include one or more processors 102 (shown as 102a, 102b, ..., 102n in the figure) 102 (processor 102 may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of a BUS bus), a network interface, a power supply, and / or a camera. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, computer terminal 10 may also include... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0027] It should be noted that the aforementioned one or more processors 102 and / or other data processing circuits are generally referred to herein as "data processing circuits". These data processing circuits may be embodied, in whole or in part, in software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuits may be a single, independent processing module, or may be integrated, in whole or in part, into any other element within the computer terminal 10. As involved in the embodiments of this application, the data processing circuits serve as a form of processor control (e.g., selection of a variable resistor termination path connected to an interface).
[0028] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the method for determining the routing channel in the embodiments of this application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby implementing the aforementioned method for determining the routing channel. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0029] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of the computer terminal 10. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.
[0030] The display may be, for example, a touchscreen liquid crystal display (LCD) that allows the user to interact with the user interface of the computer terminal 10.
[0031] The method provided in this application embodiment can also be implemented using a neural network model. In step S202, the neural network model can be loaded into memory. For example, the raw data of the neural network model can be loaded from non-volatile memory into volatile memory so that the processor can run the neural network model. The raw data of the neural network model refers to unprocessed data, which typically includes the parameters and structural data of the neural network model. The structural data can be the calculation relationship based on the parameters, such as the forward propagation calculation relationship between intermediate layers and between neurons. Specifically, the structural data can include the structure-related code of the neural network model, such as code used to perform related calculations between intermediate layers and between neurons.
[0032] In one implementation, a region can be partitioned in memory for loading the neural network model, which may include a structure data storage area and a parameter storage area. The structure data storage area stores structure-related code, and the parameters referenced by it can be accessed via pointers pointing to the addresses of specific parameters in the parameter storage area. During the training of the neural network model, frequent parameter updates may be required; in this case, updating the parameter values in the parameter storage area is sufficient.
[0033] This application provides a method for determining routing channels that can operate under the above-described operating environment. Figure 2 This is a flowchart of the steps of a method for determining a routing channel according to an embodiment of this application, as shown below. Figure 2 As shown, the method includes the following steps:
[0034] Step S202: Receive a payment request sent by the client, wherein the payment request is used to request access to the payment server; in response to the payment request, query the routing process in the local cache, wherein the routing process is used to record the filtering strategy of the payment routing channel, and the payment routing channel is used to transmit the payment request to the payment server.
[0035] The method provided in this application embodiment can be applied to online payment scenarios, such as e-commerce platform payments and online financial services. When the solution of this application is used in the above-mentioned online payment scenarios, in step S202, after the method / system provided in this application embodiment receives the request information (i.e., payment request) sent by the client to request access to the payment server, it begins to query the routing process in the local cache to support the implementation of the payment function. The routing process records the filtering strategy for filtering payment routing channels that meet the payment request. The payment request can be sent to the payment server through the payment routing channel, thereby realizing the payment. The client mentioned above can be various front-ends (e.g., merchant websites, mobile applications, point of sale (POS) terminals, etc.), and the payment server mentioned above is the back-end system responsible for processing payment logic and services, including: application servers running payment processing applications, database servers for storing transaction records, cache servers, message queue servers, etc.
[0036] Optionally, querying the routing process in the local cache includes: parsing the payment request to obtain key parameters for querying the routing process, wherein the key parameters include at least: request system identification information indicating the system that initiated the payment request in the client; querying historical payment information associated with the key parameters in the local cache, and extracting the routing process recorded in the historical payment information.
[0037] When the method provided in this embodiment is initially executed, various configuration information is loaded into the local cache, such as filter factor configuration information, routing process rule configuration information, channel access information, channel business information, and channel business details. Furthermore, during execution, the relevant operation process for each payment is recorded, such as the system that sent the payment request and the payment routing channel invoked. Therefore, in this embodiment, it can be determined whether a payment request sent by the system that sent the payment request has been processed by querying the historical payment information of the system that sent the payment request. Specifically, by parsing the payment request, the identification information (i.e., the requesting system identification information) used to uniquely indicate the system that sent the payment request is obtained. This requesting system identification information is used as a key parameter for querying the routing process, and the routing process can be queried using the requesting system identification information. If historical payment information is found, the routing process of the system that sent the payment request is extracted from the historical payment information as the routing process for implementing the payment request. The aforementioned system that sends the payment request runs on the client and can be the system corresponding to an application that supports payment functionality on the client.
[0038] Step S204: If the routing process is found, determine the channel list according to the filtering strategy, and determine the target payment routing channel with the highest priority in the channel list. The channel list is used to record multiple payment routing channels, and the target payment routing channel is used to transmit the payment request to the payment server.
[0039] If the result of querying the routing process in the local cache in step S202 is found, in step S204, a channel list is determined according to the filtering strategy. Specifically, payment routing channels are filtered from the payment routing channels stored in the local cache according to the filtering strategy, and a channel list is generated to record the filtered payment routing channels. The channel list also records the priority of each payment routing channel. In this embodiment, the payment routing channel with the highest priority among all payment routing channels recorded in the channel list is determined as the target payment routing channel for transmitting the current payment request. The payment request is transmitted to the payment server through the target payment routing channel to realize the payment service corresponding to the current payment request.
[0040] According to some optional embodiments of this application, the channel list is obtained by filtering in a local cache according to the filtering strategy recorded in the target routing process. The target routing process is a routing process obtained in response to a payment request query. Filtering the channel list in the local cache according to the filtering strategy recorded in the target routing process includes: sequentially executing a query parameter filtering process, a channel filtering process, and a channel sorting process included in the filtering strategy to obtain the channel list. The query parameter filtering process is used to filter first-type payment routing channels that meet query conditions from the payment routing channels stored in the local cache. The query conditions are generated based on parameters recorded in the payment request. The channel filtering process is used to filter second-type payment routing channels that meet business requirements from the first-type payment routing channels. The business requirements are recorded in the payment request. The channel sorting process is used to determine the priority of each second-type payment routing channel and sort the second-type payment routing channels according to their priority to obtain the channel list.
[0041] The historical payment information associated with the identification information of the requesting system that sent the payment request contains the operation flow for implementing the payment. In this embodiment, after the system that sent the payment request is determined upon triggering the payment request, the routing flow recorded in the historical payment information obtained based on the identification information of that system is the routing flow for implementing the payment request (i.e., the target routing flow). The target routing flow records the filtering strategy for determining the payment routing channel. In this embodiment, the filtering strategy records a multi-stage filtering process for determining the payment routing channel. For example, a parameter query filtering process for filtering payment routing channels that meet the query conditions (first type) from those stored in the local cache; and a parameter query filtering process for... The process includes a channel filtering process that selects payment routing channels that meet business requirements (type II) from the results of the parameter query process (i.e., type I payment routing channels); and a channel sorting process that determines the priority of each payment routing channel (i.e., type II payment routing channel) obtained through the above channel filtering process. In this embodiment, by executing each filtering process in the filtering strategy in the order defined by the filtering strategy, multiple payment routing channels that meet the requirements of the filtering strategy can be filtered from all routing channels recorded in the local cache. These multiple payment routing channels that meet the requirements of the filtering strategy are then sorted by priority according to the filtering strategy to generate a channel list that records multiple payment routing channels by priority. The query conditions in the above parameter query process are generated based on the performance requirements of the payment channel (e.g., execution speed, concurrency, etc.) recorded in the payment request; the business requirements in the above channel filtering process are generated based on the business-related parameters (e.g., the type of business corresponding to the payment request, etc.) recorded in the payment request.
[0042] Optionally, the first type of payment routing channel is obtained through the following method: parsing the payment request to obtain channel capability parameters and business type parameters, wherein the channel capability parameters describe the payment methods supported by the payment routing channel, and the business type parameters describe the transaction type corresponding to the payment request, including: purchase transaction and recharge transaction; concatenating the channel capability parameters and business type parameters into query conditions, and querying the target payment protocol type that meets the query conditions in a preset mapping table, wherein the preset mapping table records the association between the channel capability parameters, business type parameters and payment protocol types; if the target payment protocol type is found, selecting payment routing channels with the target payment protocol type from the payment routing channels stored in the local cache as the first type of payment routing channel; if the target payment protocol type is not found, selecting payment routing channels that meet the channel capability parameters from the payment routing channels stored in the local cache as the first type of payment routing channel.
[0043] When filtering payment routing channels through the query parameter filtering process, the process described below in this application embodiment is executed. As mentioned in the above embodiments, when executing the query parameter filtering process, the result obtained is a payment routing channel that meets the query conditions (first type). Since the query conditions are generated based on the payment request, the first step in executing the query parameter filtering process is to generate the query conditions. In this embodiment, the channel capability parameters and business type parameters used to generate the query conditions are obtained by parsing the payment request. The channel capability parameters are parameters that describe the payment method requirements of the payment request for the payment routing channel (e.g., supporting payment based on software A, supporting payment based on software B, and supporting payment based on both software A and software B). The business type parameters are parameters that describe the transaction type supported by the payment request for the payment routing channel (e.g., supporting purchase transactions generated by shopping, supporting recharge transactions). Next, the parsed channel capability parameters and business type parameters are concatenated into a query condition (key). For example, the two parameters can be concatenated into a query condition (key) in a sequential manner, or the valid information can be filtered out according to rules and then concatenated. Furthermore, based on the generated query conditions, a pre-defined mapping table recording the association between payment protocol types and query condition parameters (channel capability parameters and business type parameters) is used to match payment protocol types that meet the query conditions. If a payment protocol type that meets the query conditions is matched (i.e., the target payment protocol type), then the payment routing channels in the local cache that follow the target payment protocol type are determined as the filtering results of the query parameter filtering process (i.e., the first type of payment routing channel); if no target payment protocol type is associated with the pre-defined mapping table, then only the channel capability parameters are used as the query conditions, and the payment routing channels stored in the local cache are filtered using the channel capability parameters. For example, the channel capability type (channel capability parameters) and accounting type (business type parameters) sent from the interface are mapped to the internal channel business type as the query condition. If the set of protocol types sent is empty, the channel capability type is set to the protocol category. The corresponding interface of the query process is mapped according to the protocol type. Taking aggregated payment as an example: if the protocol type is not aggregated, the interface of the corresponding protocol type is queried to obtain each transaction parameter. If the protocol type is aggregated, it is determined whether the transaction element cache key in the input parameter is empty. If it is not empty, the cache center is queried to obtain the channel detail number. Aggregated payment queries the merchant's application information according to the merchant number and solution, and returns the result after converting the transaction element result.
[0044] According to some alternative embodiments of this application, the second type of payment routing channel is determined by the following method: parsing the payment request to obtain a business type parameter, wherein the business type parameter is used to describe the transaction type corresponding to the payment request, and the transaction type includes: purchase transaction, recharge transaction; querying the filtering factors associated with the business type parameter in the structured database Redis, wherein the filtering factors include: payment success rate, transaction limit, and transaction time; and filtering the second type of payment routing channel from the first type of payment routing channels according to the filtering factors.
[0045] In some embodiments, the output of the query parameter filtering process (i.e., the first type of payment routing channel) is used to execute a channel filtering process to select payment routing channels that meet business requirements from the first type of payment routing channels. Specifically, the filtering factors used in the channel filtering process are determined based on the business type parameters obtained from parsing the payment request: the filtering factors associated with the business type parameters are queried in the structured database (Redis). For example, if the business type parameters are associated with parameters such as payment success rate, transaction limit, and transaction time in Redis, then payment success rate, transaction limit, and transaction time are determined as filtering factors. Payment routing channels that simultaneously meet the filtering requirements represented by the above filtering factors are selected from the first type of payment routing channels to obtain payment routing channels that satisfy both the filtering conditions corresponding to the query parameter filtering process and the filtering conditions corresponding to the channel filtering process. Taking quick payment as an example, when the payment request is quick payment, the above query parameter filtering process and channel filtering process can be expressed as follows: After filtering through product code binding routing channel, secondary merchant number routing, protocol support routing, channel limit routing, transaction element filtering and verification, channel service time filtering, merchant binding channel filtering, and monitoring circuit breaker channel filtering, the remaining finally available channels are obtained.
[0046] According to some optional embodiments of this application, determining the priority of each second type of payment routing channel includes: obtaining a ranking factor, wherein the ranking factor includes: the payment success rate of each second type of payment routing channel and the transaction time of each second type of payment routing channel; determining a score value of each second type of payment routing channel based on the ranking factor of each second type of payment routing channel, wherein the score value is used to indicate the priority of the second type of payment routing channel, and the score value is positively correlated with the priority.
[0047] After completing the payment routing channel filtering process through query parameter filtering and channel filtering, the payment routing channels that meet the channel requirements corresponding to the payment request (i.e., the second type of payment routing channels) are sorted. In this embodiment, the payment routing channels are sorted in descending order of their score values to generate the final channel list. In this embodiment, each payment routing channel is scored according to a sorting factor. In this embodiment, payment success rate and transaction time are used as sorting factors, and a scoring factor is used to determine the score value of each payment routing channel. For example, the score of payment success rate is determined based on the value of payment success rate, and the score of transaction time is determined based on transaction time. Then, the score value (score) of each payment routing channel is determined according to the formula: score = payment success rate weight * payment success rate score + transaction time weight * transaction time score. The priority of each payment routing channel is determined according to the score value, and the channels are sorted according to priority to generate a channel list. In this embodiment, the payment routing channel with a higher score value has a higher priority.
[0048] According to some optional embodiments of this application, after obtaining the channel list, the method further includes: recording the operation information of each second type of payment routing channel in the channel list during the detection period, wherein the operation information includes at least: the total number of payments and the number of successful payments; for each second type of payment routing channel, determining the target payment success rate of the second type of payment routing channel during the detection period based on the operation information; if the target payment success rate is less than the maximum value of a preset success rate range, reducing the priority of the second type of payment routing channel to the lowest level; and if the target payment success rate is less than the minimum value of a preset success rate range, performing circuit breaker processing on the second type of payment routing channel.
[0049] The method provided in this application adjusts the priority of payment routing channels based on their actual operating status. Therefore, after determining the channel list corresponding to the payment request according to the method provided in the above embodiments, the method monitors the total number of payments and the number of successful payments for each payment routing channel (i.e., the second type of payment routing channel) recorded in the channel list in real time during a preset detection period. Based on the detected operating information, the method determines the payment success rate (i.e., the target success rate) of each second type of payment routing channel within the detection period. Based on the target success rate, the method adjusts the priority of the payment routing channels. For example, the minimum acceptable success rate range is set as a preset success rate interval. If the success rate (i.e., the target success rate) of a certain payment routing channel within the detection period is only less than the maximum value of the preset success rate interval, then it is downgraded and its priority is adjusted to the lowest level among all payment routing channels recorded in the channel list. If the success rate (i.e., the target success rate) of a certain payment routing channel within the detection period is less than the minimum value of the preset success rate interval, then it is circuit-broken. The specific method of circuit-broken processing is to delete this payment routing channel from the channel list and stop sending payment requests to it.
[0050] Step S206: If no routing process is found, output a routing error message to the client.
[0051] If the result of querying the routing process in the local cache in step S202 is not found, then step S206 is executed; output a prompt message to the client to indicate a routing error; wherein, the fact that the routing process was not found in the local cache indicates that the client that sent the payment request may be a client that has not been authorized or verified for payment.
[0052] Through the above steps, a payment routing channel for transmitting payment requests can be selected based on a filtering strategy, thereby enabling payment. The filtering strategy selects and ranks the optimal channel based on multiple factors such as the channel's real-time operating status and success rate. Transmitting the payment request through the optimal channel improves the success rate of payment. In addition, by monitoring the current success rate and usage of each channel in real time, the system can automatically disconnect or downgrade unavailable channels and reload restored channels into the list of available channels. The system intelligently and dynamically adjusts the availability and usage priority of each channel, improving payment stability and meeting the high concurrency and high availability performance requirements of the payment system.
[0053] Figure 3 This is a structural diagram of a routing channel determination device provided according to an embodiment of this application, such as... Figure 3As shown, the routing channel determination device includes: a receiving module 30, used to receive a payment request sent by a client, wherein the payment request is used to request access to the payment server; a query module 32, used to query the routing process in a local cache in response to the payment request, wherein the routing process is used to record the filtering strategy of the payment routing channel, and the payment routing channel is used to transmit the payment request to the payment server; a determination module 34, used to determine a channel list according to the filtering strategy when a routing process is found, and determine the target payment routing channel with the highest priority in the channel list, wherein the channel list is used to record multiple payment routing channels, and the target payment routing channel is used to transmit the payment request to the payment server; and an output module 36, used to output a routing error message to the client when no routing process is found.
[0054] It should be noted that, Figure 3 Preferred embodiments of the shown examples can be found in [reference needed]. Figure 2 The relevant descriptions of the embodiments shown will not be repeated here.
[0055] This application also provides a non-volatile storage medium storing a computer program, wherein the device where the non-volatile storage medium is located executes the above-mentioned method for determining the routing channel by running the computer program.
[0056] The aforementioned non-volatile storage medium is used to store a program that performs the following functions: receiving a payment request sent by a client, wherein the payment request is used to request access to the payment server; responding to the payment request, querying the routing process in the local cache, wherein the routing process is used to record the filtering strategy of the payment routing channel, and the payment routing channel is used to transmit the payment request to the payment server; if a routing process is found, determining a channel list according to the filtering strategy, and determining the highest priority target payment routing channel in the channel list, wherein the channel list is used to record multiple payment routing channels, and the target payment routing channel is used to transmit the payment request to the payment server; if a routing process is not found, outputting a routing error message to the client.
[0057] This application also provides an electronic device, including a memory and a processor. The memory stores a computer program, and the processor is configured to execute the above-mentioned method for determining the routing channel through the computer program.
[0058] The processor in the aforementioned electronic device is used to run a program that performs the following functions: receiving a payment request sent by a client, wherein the payment request is used to request access to a payment server; responding to the payment request, querying a routing process in a local cache, wherein the routing process is used to record the filtering strategy of payment routing channels, and the payment routing channels are used to transmit the payment request to the payment server; if a routing process is found, determining a channel list according to the filtering strategy, and determining the highest priority target payment routing channel in the channel list, wherein the channel list is used to record multiple payment routing channels, and the target payment routing channel is used to transmit the payment request to the payment server; if a routing process is not found, outputting a routing error message to the client.
[0059] This application also provides a computer program product, including computer instructions, which, when executed by a processor, implement the steps of the above-described method for determining routing channels.
[0060] It should be noted that each module in the above-mentioned routing channel determination device can be a program module (for example, a set of program instructions that implement a certain function) or a hardware module. For the latter, it can be manifested in the following forms, but is not limited to them: each of the above modules is manifested as a processor, or the functions of each of the above modules are implemented by a processor.
[0061] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0062] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0063] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.
[0064] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0065] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0066] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to related technologies, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0067] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A method for determining a routing channel, characterized in that, include: Receive a payment request sent by the client, wherein the payment request is used to request access to the payment server; In response to the payment request, the routing process is queried in the local cache, including: parsing the payment request to obtain key parameters for querying the routing process, wherein the key parameters include at least: request system identifier information for indicating the system in the client that initiated the payment request; querying historical payment information associated with the key parameters in the local cache, and extracting the routing process recorded in the historical payment information, wherein the routing process is used to record the filtering strategy of the payment routing channel, and the payment routing channel is used to transmit the payment request to the payment server; If the routing process is found, a channel list is determined according to the filtering strategy, and the target payment routing channel with the highest priority is determined in the channel list. The channel list is used to record multiple payment routing channels, and the target payment routing channel is used to transmit the payment request to the payment server. If the routing process is not found, output a routing error message to the client.
2. The method according to claim 1, characterized in that, The channel list is obtained by filtering in the local cache according to the filtering strategy recorded in the target routing process. The target routing process is a routing process obtained in response to the payment request query. Filtering the channel list in the local cache according to the filtering strategy recorded in the target routing process includes: The channel list is obtained by sequentially executing the query parameter filtering process, channel filtering process, and channel sorting process included in the filtering strategy. The query parameter filtering process is used to filter first-type payment routing channels that meet query conditions from the payment routing channels stored in the local cache. The query conditions are generated based on parameters recorded in the payment request. The channel filtering process is used to filter second-type payment routing channels that meet business requirements from the first-type payment routing channels. The business requirements are recorded in the payment request. The channel sorting process is used to determine the priority of each second-type payment routing channel and sort the second-type payment routing channels according to the priority to obtain the channel list.
3. The method according to claim 2, characterized in that, The first type of payment routing channel is obtained through the following method: The payment request is parsed to obtain channel capability parameters and business type parameters. The channel capability parameters describe the payment methods supported by the payment routing channel, and the business type parameters describe the transaction type corresponding to the payment request. The transaction type includes: purchase transaction and recharge transaction. The channel capability parameter and the business type parameter are concatenated to form the query conditions, and the target payment protocol type that meets the query conditions is queried in the preset mapping table according to the query conditions. The preset mapping table is used to record the association between the channel capability parameter and the business type parameter and the payment protocol type. If the target payment protocol type is found, the payment routing channels with the protocol type of the target payment protocol type are selected from the payment routing channels stored in the local cache and used as the first type of payment routing channel; If the target payment protocol type is not found, payment routing channels that meet the channel capability parameters are selected from the payment routing channels stored in the local cache as the first type of payment routing channel.
4. The method according to claim 2, characterized in that, The second type of payment routing channel is determined by the following method: The payment request is parsed to obtain a business type parameter, wherein the business type parameter is used to describe the transaction type corresponding to the payment request, and the transaction type includes: purchase transaction and recharge transaction; Query the filter factors associated with the business type parameter in the structured database Redis, wherein the filter factors include: payment success rate, transaction limit, and transaction time. The second type of payment routing channel is selected from the first type of payment routing channels based on the filtering factor.
5. The method according to claim 2, characterized in that, Determine the priority of each second-type payment routing channel, including: Obtain the sorting factors, wherein the sorting factors include: the payment success rate of each second type of payment routing channel and the transaction time of each second type of payment routing channel; A score value for each type of payment routing channel is determined based on the ranking factor for each type of payment routing channel, wherein the score value is used to indicate the priority of the type of payment routing channel and is positively correlated with the priority.
6. The method according to claim 2, characterized in that, After obtaining the channel list, the following is also included: Record the operation information of each second type of payment routing channel in the channel list during the detection period, wherein the operation information includes at least: total number of payments and number of successful payments; For each of the second type of payment routing channels, the target payment success rate of the second type of payment routing channel within the detection period is determined based on the operational information. If the target payment success rate is less than the maximum value of the preset success rate range, the priority of the second type of payment routing channel will be reduced to the lowest level. If the target payment success rate is less than the minimum value of the preset success rate range, the second type of payment routing channel will be circuit-broken.
7. A device for determining a routing channel, characterized in that, include: A receiving module is used to receive a payment request sent by a client, wherein the payment request is used to request access to a payment server; A query module is used to query the routing process in a local cache in response to the payment request, including: parsing the payment request to obtain key parameters for querying the routing process, wherein the key parameters include at least: request system identifier information for indicating the system in the client that initiated the payment request; querying historical payment information associated with the key parameters in the local cache, and extracting the routing process recorded in the historical payment information, wherein the routing process is used to record the filtering strategy of the payment routing channel, and the payment routing channel is used to transmit the payment request to the payment server; The determination module is used to determine a channel list according to the filtering strategy when the routing process is found, and to determine the target payment routing channel with the highest priority in the channel list. The channel list is used to record multiple payment routing channels, and the target payment routing channel is used to transmit the payment request to the payment server. The output module is used to output a routing error message to the client if the routing process is not found.
8. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to execute the routing channel determination method according to any one of claims 1 to 6 through the computer program.
9. A computer program product comprising computer instructions, characterized in that, When the computer instructions are executed by the processor, they implement the steps of the method for determining the routing channel as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Processing method and device applied to payment routing system and storage medium
CN115689556A