CN112348507A - Service processing method and device - Google Patents
Service processing method and device Download PDFInfo
- Publication number
- CN112348507A CN112348507A CN202011252455.4A CN202011252455A CN112348507A CN 112348507 A CN112348507 A CN 112348507A CN 202011252455 A CN202011252455 A CN 202011252455A CN 112348507 A CN112348507 A CN 112348507A
- Authority
- CN
- China
- Prior art keywords
- server
- target
- payment channel
- routing rule
- payment
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000003672 processing method Methods 0.000 title abstract description 14
- 238000012545 processing Methods 0.000 claims abstract description 15
- 238000000034 method Methods 0.000 claims description 48
- 230000002159 abnormal effect Effects 0.000 claims description 3
- 238000010586 diagram Methods 0.000 description 5
- 238000007726 management method Methods 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 238000005034 decoration Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000013468 resource allocation Methods 0.000 description 2
- 238000013461 design Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q20/00—Payment architectures, schemes or protocols
- G06Q20/22—Payment schemes or models
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5011—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
- G06F9/5016—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/544—Buffers; Shared memory; Pipes
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2209/00—Indexing scheme relating to G06F9/00
- G06F2209/50—Indexing scheme relating to G06F9/50
- G06F2209/5018—Thread allocation
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Business, Economics & Management (AREA)
- Accounting & Taxation (AREA)
- Strategic Management (AREA)
- General Business, Economics & Management (AREA)
- Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
Abstract
The invention provides a business processing method and a business processing device, wherein a transaction request sent by a user is obtained, and the transaction request carries a transaction type and a payment mode; determining a target payment channel from all pre-stored payment channels in the cache center according to the transaction type and the payment mode, and acquiring a routing rule of the target payment channel and a service time period of each server providing service for the target payment channel; selecting a target server from all servers providing services for the target payment channel according to a routing rule and the service time period of all servers providing services for the target payment channel, wherein the routing rule is a random routing rule, a weighted routing rule or a polling routing rule; the transaction request is distributed to the target server through the target payment channel. Based on the invention, the purpose of effectively allocating resources by using each payment channel under each bank can be realized.
Description
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for processing a service.
Background
Along with the continuous development of banking industry and internet technology in China, the application of financial electronization is more and more popular. The banking industry as the financial service industry can provide high-quality service for vast customers. Each bank distributes the bank transaction request sent by the user to the corresponding server through the corresponding payment channel so as to process the service requested by the user. Each bank has a plurality of payment channels, the number of threads occupied by each payment channel and the maximum number of concurrencies provided by a server providing services for each payment channel are limited, and therefore how to effectively utilize the plurality of channels of each bank for resource allocation is a problem which needs to be solved at present.
Disclosure of Invention
In view of this, the present invention provides a method and an apparatus for service processing, so as to achieve the purpose of performing effective resource allocation by using each payment channel of each bank.
In order to achieve the above purpose, the embodiments of the present invention provide the following technical solutions:
a first aspect of the present invention discloses a method for processing a service, which is characterized in that the method includes:
acquiring a transaction request sent by a user, wherein the transaction request carries a transaction type and a payment mode;
determining a target payment channel from all pre-stored payment channels in a cache center according to the transaction type and the payment mode, and acquiring a routing rule of the target payment channel and a service time period of each server providing service for the target payment channel;
selecting a target server from the servers providing services for the target payment channel according to the routing rule and the service time period of each server providing services for the target payment channel, wherein the routing rule is a random routing rule, a weighted routing rule or a polling routing rule;
distributing the transaction request to the target server through the target payment channel.
Optionally, the determining a target payment channel from among the pre-stored payment channels in the cache center according to the transaction type and the payment method includes:
determining at least one payment channel matched with the payment mode from all the payment channels pre-stored in a cache center according to the corresponding relation between the payment mode and the payment channels;
and determining a target payment channel supporting the transaction types from the at least one payment channel according to the transaction types supported by the payment channels stored in the cache center in advance.
Optionally, the selecting a target server from the servers providing services for the target payment channel according to the routing rule and the service time periods of the servers providing services for the target payment channel includes:
selecting at least one server from the servers serving the target payment channel, wherein the time for executing the transaction request is within a service period of each server of the at least one server;
based on a random routing rule, carrying out remainder on the maximum thread number of the target payment channel based on a timestamp of the time for executing the transaction request to obtain a remainder result;
and determining a target server from the at least one server according to the remainder result.
Optionally, the selecting a target server from the servers providing services for the target payment channel according to the routing rule and a service time period of each server providing services for the target payment channel includes:
selecting at least one server from the servers serving the target payment channel, wherein the time for executing the transaction request is within a service period of each server of the at least one server;
weighting the maximum concurrency number of each server in the at least one server based on the weighted routing rule to obtain a weighted result of each server in the at least one server;
and selecting the server corresponding to the maximum weighting result as the target server.
Optionally, the routing rule is the polling routing rule, and selecting a target server from the servers providing services for the target payment channel according to the routing rule and a service time period of each server providing services for the target payment channel includes:
based on the polling routing rule, one server is sequentially selected from all servers of the service provided for the target payment channel;
determining whether the time to execute the transaction request is within a service time period of the server;
if so, determining that the server is a target server;
if not, continuing to select the next server until determining the target server.
Optionally, before acquiring the transaction request sent by the user, the method further includes:
setting a corresponding routing rule for each payment channel, and storing the set routing rule of each payment channel to the cache center;
and setting a corresponding service time period and a maximum concurrency number for each server providing services for the payment channel, and caching the service time period and the maximum concurrency number to the cache center.
Optionally, before distributing the transaction request to the target server through the target payment channel, the method further includes:
judging whether the current channel state of the target payment channel is an open state;
if the current channel state of the target payment channel is an open state, executing the step of distributing the transaction request to the target server through the target payment channel;
and if the current state of the target payment channel is not the opening state, sending alarm information, wherein the alarm information is used for indicating that the target payment channel is abnormal.
A second aspect of the present invention discloses a service processing apparatus, which includes:
the system comprises a first acquisition unit, a second acquisition unit and a payment unit, wherein the first acquisition unit is used for acquiring a transaction request sent by a user, and the transaction request carries a transaction type and a payment mode;
the first determining unit is used for determining a target payment channel from all payment channels pre-stored in a cache according to the transaction type and the payment mode, acquiring a routing rule of the target payment channel and a service time period of each server providing services for the target payment channel;
the first selecting unit is used for selecting a target server from the servers providing services for the target payment channel according to the routing rule and the service time period of each server providing services for the target payment channel, wherein the routing rule is a random routing rule, a weighted routing rule or a polling routing rule;
an allocation unit for allocating the transaction request to the target server through the target payment channel.
Optionally, the first determining unit includes:
the second determining unit is used for determining at least one payment channel matched with the payment mode from the payment channels pre-stored in the cache center according to the corresponding relation between the payment mode and the payment channels;
and the third determining unit is used for determining a target payment channel supporting the transaction type from the at least one payment channel according to the transaction types supported by the payment channels stored in the cache center in advance.
Optionally, the routing rule is the random routing rule, and the first selecting unit includes:
a second selecting unit, configured to select at least one server from the servers that provide services for the target payment channel, where a time for executing the transaction request is within a service time period of each server in the at least one server;
the surplus unit is used for carrying out surplus on the maximum thread number of the target payment channel based on a random routing rule and a timestamp of the time for executing the transaction request to obtain a surplus result;
and the fourth determining unit is used for determining the target server from the at least one server according to the residue taking result.
The invention provides a business processing method and a device, which store each payment channel and the routing rule corresponding to each payment channel in a cache center in advance, and a service period of the respective server providing the service for each payment channel, when a transaction request transmitted by the user is received, determining a target payment channel from the pre-stored payment channels in the cache center according to the transaction types and payment modes carried in the transaction request sent by the user, and acquires the routing rule of the target payment channel and the service time period of each server providing the server for the target payment channel, so as to select a target server from the respective servers according to the acquired routing rule and the service time periods of the respective servers, and the transaction request is distributed to the target server through the determined target payment channel, so that the aim of effectively allocating resources by utilizing each payment channel is fully fulfilled.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a schematic flow chart of a service processing method according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a configuration platform according to an embodiment of the present invention;
fig. 3 is a schematic flow chart of another service processing method according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a service processing apparatus according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In this application, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
Referring to fig. 1, a flow diagram of a service processing method provided in an embodiment of the present invention is shown, where the service processing method specifically includes the following steps:
s101: and acquiring a transaction request sent by a user, wherein the transaction request carries a transaction type and a payment mode.
In the process of specifically executing step S101, when a transaction request sent by a user is received, the transaction type and the payment method carried in the transaction request sent by the user are obtained.
In step S101, the transaction category may be a public payment, a private payment, and the like. The payment mode can be a bank enterprise, a bank bill, a bank establishment bank enterprise and the like.
S102: and determining a target payment channel from the pre-stored payment channels in the cache center according to the transaction types and the payment modes, and acquiring a routing rule of the target payment channel and a service time period of each server for providing services for the target payment channel.
In step S102, a plurality of payment channels may be set for each payment method in advance by configuring the channel management unit in the platform, and a corresponding transaction type may be set for each payment channel, and the plurality of payment channels set for each payment method in advance, and the corresponding transaction type set for each payment channel may be stored in the cache center. The structural schematic diagram of the configuration platform is shown in fig. 2.
In step S102, a corresponding routing rule, a maximum number of threads occupied, and a server providing services for each payment channel may be set in advance for each payment channel by a routing rule management unit in the configuration platform, and a corresponding server time and a maximum number of concurrencies may be set for each server by a service time management unit in the configuration platform, and the routing rule set in advance for each payment channel, the maximum number of threads occupied, the server providing services for each payment channel, and the corresponding server time and the maximum number of concurrencies set for each server may be stored in the cache center. The routing rule may be a polling routing rule, a random routing rule, or a weighted routing rule.
Round-robin routing rules are the simplest load balancing algorithms, by distributing transaction requests to the various servers in turn until a server is determined that can handle the transaction request, e.g., starting with service 1 and going to server N.
The random routing rule is a concept turing machine, namely, a random factor is introduced into the algorithm, namely, the next operation of the algorithm is selected through a random number, specifically, the current available payment channel can be subjected to modular operation through the system millisecond number, and therefore the random server is obtained.
According to the weighting routing rule, due to the fact that the configuration of each server providing services for the payment channel is inconsistent, the maximum concurrent number configured for each server is inconsistent, the maximum concurrent number of each server is weighted through a weighting algorithm, and the server corresponding to the weighting result with the maximum weight value is selected from the obtained weighting results to be the final result of the algorithm.
In step S102, a corresponding server time and a maximum concurrency number are set in advance for each server providing a service for the payment channel, and a corresponding server time and a maximum concurrency number are set in advance for each server providing a service for the payment channel.
In the process of specifically executing step S102, after the transaction type and the payment method carried in the transaction request are obtained from the transaction request sent by the user, at least one payment channel matched with the payment method is determined from the payment channels pre-stored in the cache center according to the correspondence between the payment method and the payment channel; and according to the transaction types supported by the payment channels selected and stored in the cache in advance, determining a payment channel supporting the transaction type carried in the transaction request from at least one determined payment channel (for convenience of distinguishing, the payment channel supporting the transaction type carried in the transaction request is called a target payment channel), and acquiring a routing rule corresponding to the target payment channel from the cache center and a server time period of each server providing services for the target payment channel.
For example, the pre-stored payment channels corresponding to the bank of the bank are a payment channel 1 of the bank of; the routing rule corresponding to the bank-enterprise payment channel 2 is a polling routing rule, the servers providing services for the bank-enterprise payment channel 2 are the server 3 and the server 4, the service time period of the server 3 is 9:00-17:00, and the server time of the server 4 is 8:00-19: 00.
The payment channel corresponding to the bank note is a bank note payment channel, the payment type corresponding to the bank note payment channel is bill payment, the routing rule corresponding to the bank note payment channel is a weighted routing rule, the servers providing services for the bank note payment channel are a server 5, a server 6 and a server 7, the service time period of the server 5 is 9:00-17:00, the server time of the server 6 is 8:00-20:00, and the server time of the server 7 is 24 hours.
The payment channels corresponding to the bank-enterprise establishment are a bank-enterprise establishment payment channel 1 and a bank-enterprise establishment payment channel 2, the transaction type corresponding to the bank-enterprise establishment payment channel 1 is private payment, the transaction type corresponding to the bank-enterprise establishment payment channel 2 is public payment, the routing rule corresponding to the bank-enterprise establishment payment channel 1 is a random routing rule, the server providing service for the bank-enterprise establishment payment channel 1 is a server 8, and the service time period of the server 8 is 9:00-18: 00; the routing rule corresponding to the bank-enterprise payment channel 2 is a weighted routing rule, the server providing service for the bank-enterprise payment channel 2 is a server 9 and a server 10, the service time period of the server 9 is 8:00-17:00, and the server time period of the server 10 is 8:00-19: 00.
If the payment mode carried by the transaction request sent by the user is acquired as a bank enterprise of a bank, the transaction type is private payment, and the payment channels corresponding to the bank enterprise of the bank enterprise are determined to be a bank enterprise payment channel 1 and a bank enterprise payment channel 2 from the payment channels pre-stored in the cache center according to the corresponding relation between the payment mode and the payment channels; and determining a payment channel pair bank-enterprise payment channel 1 supporting the private payment from the bank payment channel 1 and the bank payment channel 2 according to the private payment, and further obtaining that a routing rule corresponding to the bank payment channel 1 is a random routing rule, wherein the service time period of the server 1 providing service for the bank payment channel 1 is 9:00-18:00, and the server time of the server 2 providing service for the bank payment channel 2 is 24 hours.
S103: and selecting the target server from the servers providing services for the target payment channel according to the routing rule and the service time period of each server providing services for the target payment channel, wherein the routing rule is a random routing rule, a weighted routing rule or a polling routing rule.
In the specific process of executing step S103, after the routing rule of the target payment channel and the service time period of each server providing service for the target payment channel are obtained, at least one server may be selected from the servers providing service for the target payment channel according to the service time period of each server and the time of executing the transaction request, and the target server may be determined from the selected servers according to the routing rule of the target payment channel. Wherein the time to execute the transaction request is within a server period of each of the at least one server.
As a preferred mode of the embodiment of the present application, if the routing rule of the target payment channel is a random routing rule, according to the routing rule and the service time periods of the servers providing services for the target payment channel, a mode of selecting a target server from the servers providing services for the target payment channel may be: selecting at least one server from the servers providing the servers for the target payment channel, so as to carry out remainder on the maximum thread number of the target payment channel based on the timestamp of the time for executing the transaction request based on the random routing rule to obtain a remainder result, and finally determining the target server from the determined at least one server according to the remainder result.
For example, as can be known from the example in step S102, the target payment channel is the bank-enterprise payment channel 1, the routing rule corresponding to the target payment channel is the random routing rule, the service time period of the server 1 providing service for the target payment channel is 9:00-18:00, and the server time of the server 2 providing service for the target payment channel is 24 hours.
If the time for executing the transaction request is 15:00, selecting a server 1 and a server 2 from various servers for providing service for the target payment channel; the total number of the servers for providing services for the target payment channel is 2, so that the maximum thread number of the target payment channel can be determined to be 2, the time stamp (15:00) for executing the transaction request is 2, the result of the remainder taking is 0, the target server is determined to be the server 1 from the server 1 and the server 2 according to the remainder taking result (0), and the transaction request can be distributed to the target server (the server 1) through the target payment channel (the bank-enterprise payment channel 1).
As another preferred mode of the embodiment of the present application, if the routing rule of the target payment channel is the polling routing rule, according to the routing rule and the service time periods of the servers providing services for the target payment channel, the method of selecting the target server from the servers providing services for the target payment channel may be: based on a polling routing rule, one server is selected from all servers of the service provided for the target payment channel in sequence; judging whether the time for executing the transaction request is within the service time period of the server; if the time for executing the transaction request is within the service time period of the server, determining the server as a target server; and if the time for executing the transaction request is not within the service time period of the server, continuously selecting the next server until the target server is determined.
For example, it can be known from the example in step S102 that, if the payment mode carried by the obtained transaction request sent by the user is a bank and enterprise of a work bank, and the transaction type is a payment to public, the payment channel 2 of the bank and enterprise of the work bank can be determined as a target payment channel, and further, the routing rule corresponding to the target payment channel (the payment channel 2 of the bank and enterprise of the work bank) can be determined as a polling routing rule, the service time period of the server 3 providing service for the target payment channel (the payment channel 2 of the bank and enterprise of the work bank) is 9:00-17:00, and the server time of the server 4 providing service for the target payment channel (the payment channel 2 of the bank and enterprise of the work bank) is 8:00-19: 00.
Based on the polling routing rule, the server 3 is selected from the server 3 and the server 4 in sequence, if the time for executing the transaction request is 18:00, because 18:00 is not within 9:00-17:00, it may be determined that the time to execute the transaction request is not within the server time period of server 3, and server 4 may continue to be selected because 18:00 in 8:00-19:00, the time for executing the transaction request can be determined within the service time period of the server 4, the server 4 is determined to be the target server, and the transaction request can be distributed to the target server (the server 4) through the target payment channel (the bank-enterprise payment channel 2).
As a further preferable mode of the embodiment of the present application, if the routing rule of the target payment channel is a weighted routing rule, according to the routing rule and the service time periods of the servers providing services for the target payment channel, a mode of selecting a target server from the servers providing services for the target payment channel may be: selecting at least one server from servers providing servers for the target payment channel, and weighting the determined maximum concurrency number of each server in the at least one server based on a weighted routing rule to obtain a weighted result of each server in the at least one server; and selecting the server corresponding to the maximum weighting result as the target server.
For example, it can be known from the example in step S102 that, if the payment mode carried by the obtained transaction request sent by the user is a bank-building bank, and the transaction type is a payment to public, the bank-building bank-enterprise payment channel 2 can be determined as a target payment channel, and further, the routing rule corresponding to the target payment channel (the bank-building bank-enterprise payment channel 2) can be determined as a weighted routing rule, the service time period of the server 9 providing service for the target payment channel (the bank-building bank-enterprise payment channel 2) is 8:00-17:00, and the server time of the server 10 providing service for the target payment channel (the bank-building bank-enterprise payment channel 2) is 8:00-19: 00.
If the time for executing the transaction request is 15:00, selecting the server 9 and the server 10 from various servers for providing service for the target payment channel; if the maximum concurrent number pre-stored in the server 9 in the cache center is 30 and the maximum concurrent number of the server 10 is 40, weighting the maximum concurrent number (30) of the server 9 based on the weighted routing rule to obtain a weighted result 1, weighting the concurrent number (40) of the server 10 to obtain a weighted result 2, wherein the weighted result 1 is greater than the weighted result 2, the server corresponding to the weighted result 2 can be selected as a target server, the server 9 can be selected as the target server, and further a transaction request can be distributed to the target server (the server 10) through a target payment channel (bank-enterprise payment channel 2).
S104: the transaction request is distributed to the target server through the target payment channel.
In the specific implementation of step S104, after the target payment channel and the target server are determined, the transaction request is distributed to the determined target server through the determined target payment channel, so that the target server processes the distributed transaction request.
The invention provides a service processing method, which stores each payment channel and the routing rule corresponding to each payment channel in a cache center in advance, and a service period of the respective server providing the service for each payment channel, when a transaction request transmitted by the user is received, determining a target payment channel from the pre-stored payment channels in the cache center according to the transaction types and payment modes carried in the transaction request sent by the user, and acquires the routing rule of the target payment channel and the service time period of each server providing the server for the target payment channel, so as to select a target server from the respective servers according to the acquired routing rule and the service time periods of the respective servers, and the transaction request is distributed to the target server through the determined target payment channel, so that the aim of effectively allocating resources by utilizing each payment channel is fully fulfilled.
Referring to fig. 3, a schematic flow chart of another service processing method provided in the embodiment of the present invention is shown, where the service processing method specifically includes the following steps:
s301: and acquiring a transaction request sent by a user, wherein the transaction request carries a transaction type and a payment mode.
S302: and determining a target payment channel from the pre-stored payment channels in the cache center according to the transaction types and the payment modes, and acquiring a routing rule of the target payment channel and a service time period of each server for providing services for the target payment channel.
S303: and selecting the target server from the servers providing services for the target payment channel according to the routing rule and the service time period of each server providing services for the target payment channel, wherein the routing rule is a random routing rule, a weighted routing rule or a polling routing rule.
In the process of specifically executing step S301 to step S303, the specific execution process and implementation principle of step S301 to step S303 are the same as the specific execution process and implementation principle of step S101 to step S103 in fig. 1 disclosed in the present invention, and reference may be made to corresponding parts in fig. 1 disclosed in the present invention, which is not described herein again.
S304: judging whether the current channel state of the target payment channel is an open state; if the current channel status of the target payment channel is the open status, executing step S305; if the current state of the target payment channel is not the open state, step S306 is executed.
In step S304, a switch button is provided in advance for each payment channel, and the switch button may switch the channel state of the payment channel to the on state when the channel state of the payment channel is in the off state, or switch the channel state of the payment channel to the off state when the channel state of the payment channel is in the on state.
In the specific process of executing step S304, after a target server is selected from each server providing services for a target payment channel, it may be further determined whether the current channel state of the target payment channel is in an open state, when the current channel state of the target payment channel is in the open state, a transaction request is allocated to the determined target server through the target payment channel, and when the current channel state of the target payment channel is not in the open state, that is, when the current channel state of the target payment channel is in the closed state, alarm information is sent, so that a technician maintains the target payment channel based on the alarm information, and through a switch button, the channel state of the target payment channel is converted into the open state.
S305: the transaction request is distributed to the target server through the target payment channel.
In the specific execution process of step S305, when the current channel state of the target payment channel is in the open state, the transaction request is distributed to the determined target server through the target payment channel, so that the target server processes the distributed transaction request.
S306: and sending alarm information.
In the process of specifically executing step S306, when the current channel state of the target payment channel is not in the on state, that is, when the current channel state of the target payment channel is in the off state, alarm information is sent, so that a technician can maintain the target payment channel based on the alarm information, and the channel state of the target payment channel is converted into the on state through a switch button.
Further, in this embodiment of the present application, after the step S306 is executed, the step S301 may be executed again to allocate the payment channel for the transaction request sent by the user, so as to solve the problem of reallocation when the resource of one payment channel is unavailable.
Based on the service processing method provided by the foregoing embodiment of the present invention, correspondingly, an embodiment of the present invention further provides a service processing apparatus, and referring to fig. 4, a schematic structural diagram of the service processing apparatus provided by the embodiment of the present invention is shown, where the service processing apparatus includes:
a first obtaining unit 41, configured to obtain a transaction request sent by a user, where the transaction request carries a transaction type and a payment method;
a first determining unit 42, configured to determine a target payment channel from the payment channels pre-stored in the cache according to the transaction type and the payment method, and obtain a routing rule of the target payment channel and a service time period of each server providing a service for the target payment channel;
a first selecting unit 43, configured to select a target server from servers providing services for the target payment channel according to a routing rule and a service time period of each server providing services for the target payment channel, where the routing rule is a random routing rule, a weighted routing rule, or a polling routing rule;
an assigning unit 44 for assigning the transaction request to the target server through the target payment channel.
The specific principle and the execution process of each unit in the service processing apparatus disclosed in the above embodiment of the present invention are the same as those of the service processing method disclosed in the above embodiment of the present invention, and reference may be made to corresponding parts in the service processing method disclosed in the above embodiment of the present invention, which are not described herein again.
The invention provides a business processing device, which stores each payment channel and the routing rule corresponding to each payment channel in a cache center in advance, and a service period of the respective server providing the service for each payment channel, when a transaction request transmitted by the user is received, determining a target payment channel from the pre-stored payment channels in the cache center according to the transaction types and payment modes carried in the transaction request sent by the user, and acquires the routing rule of the target payment channel and the service time period of each server providing the server for the target payment channel, so as to select a target server from the respective servers according to the acquired routing rule and the service time periods of the respective servers, and the transaction request is distributed to the target server through the determined target payment channel, so that the aim of effectively allocating resources by utilizing each payment channel is fully fulfilled.
In the embodiment of the present application, preferably, the first determining unit includes:
the second determining unit is used for determining at least one payment channel matched with the payment mode from the payment channels pre-stored in the cache center according to the corresponding relation between the payment modes and the payment channels;
and the third determining unit is used for determining a target payment channel supporting the transaction types from at least one payment channel according to the transaction types supported by the payment channels stored in the cache center in advance.
In this embodiment of the present application, preferably, the routing rule is a random routing rule, and the first selecting unit includes:
the second selection unit is used for selecting at least one server from various servers for providing services for the target payment channel, wherein the time for executing the transaction request is positioned in the service time period of each server in the at least one server;
the surplus unit is used for carrying out surplus on the maximum thread number of the target payment channel based on the random routing rule and the timestamp of the time for executing the transaction request to obtain a surplus result;
and the fourth determining unit is used for determining the target server from at least one server according to the residue taking result.
In this embodiment of the present application, preferably, the routing rule is a weighted routing rule, and the first selecting unit includes:
the third selecting unit is used for selecting at least one server from various servers for providing services for the target payment channel, wherein the time for executing the transaction request is positioned in the service time period of each server in the at least one server;
the weighting unit is used for weighting the maximum concurrency number of each server in the at least one server based on the weighted routing rule to obtain a weighting result of each server in the at least one server;
and the fourth selecting unit is used for selecting the server corresponding to the maximum weighting result as the target server.
In this embodiment of the present application, preferably, the routing rule is a polling routing rule, and the first selecting unit includes:
a fifth selecting unit, configured to sequentially select one server from servers of services provided for the target payment channel based on the polling routing rule;
a first judgment unit for judging whether the time for executing the transaction request is within the service time period of the server;
a fifth determining unit, configured to determine that the server is the target server if the server is present;
and the sixth selecting unit is used for continuously selecting the next server if the server is not present until the target server is determined.
Further, the service processing apparatus provided in the embodiment of the present application further includes:
the first storage unit is used for setting a corresponding routing rule for each payment channel and storing the set routing rule of each payment channel to the cache center;
a second storage unit for setting corresponding service time period and maximum concurrency number for the server providing service for each payment channel, and caching to the cache center
Further, the service processing apparatus provided in the embodiment of the present application further includes:
the second judgment unit is used for judging whether the current channel state of the target payment channel is an open state;
and the execution unit is used for executing the distribution unit if the current channel state of the target payment channel is an opening state.
And the alarm information sending unit is used for sending alarm information if the current state of the target payment channel is not the opening state, and the alarm information is used for indicating that the target payment channel is abnormal.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, the system or system embodiments are substantially similar to the method embodiments and therefore are described in a relatively simple manner, and reference may be made to some of the descriptions of the method embodiments for related points. The above-described system and system embodiments are only illustrative, wherein the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.
Claims (10)
1. A method for processing a service, the method comprising:
acquiring a transaction request sent by a user, wherein the transaction request carries a transaction type and a payment mode;
determining a target payment channel from all pre-stored payment channels in a cache center according to the transaction type and the payment mode, and acquiring a routing rule of the target payment channel and a service time period of each server providing service for the target payment channel;
selecting a target server from the servers providing services for the target payment channel according to the routing rule and the service time period of each server providing services for the target payment channel, wherein the routing rule is a random routing rule, a weighted routing rule or a polling routing rule;
distributing the transaction request to the target server through the target payment channel.
2. The method of claim 1, wherein the determining a target payment channel from among the pre-stored payment channels in the cache center according to the transaction type and the payment method comprises:
determining at least one payment channel matched with the payment mode from all the payment channels pre-stored in a cache center according to the corresponding relation between the payment mode and the payment channels;
and determining a target payment channel supporting the transaction types from the at least one payment channel according to the transaction types supported by the payment channels stored in the cache center in advance.
3. The method of claim 1, wherein the routing rule is the random routing rule, and wherein selecting the target server from the servers serving the target payment channel according to the routing rule and a service time period of the servers serving the target payment channel comprises:
selecting at least one server from the servers serving the target payment channel, wherein the time for executing the transaction request is within a service period of each server of the at least one server;
based on a random routing rule, carrying out remainder on the maximum thread number of the target payment channel based on a timestamp of the time for executing the transaction request to obtain a remainder result;
and determining a target server from the at least one server according to the remainder result.
4. The method of claim 1, wherein the routing rule is the weighted routing rule, and wherein selecting a target server from the servers serving the target payment channel according to the routing rule and a service time period of the servers serving the target payment channel comprises:
selecting at least one server from the servers serving the target payment channel, wherein the time for executing the transaction request is within a service period of each server of the at least one server;
weighting the maximum concurrency number of each server in the at least one server based on the weighted routing rule to obtain a weighted result of each server in the at least one server;
and selecting the server corresponding to the maximum weighting result as the target server.
5. The method of claim 1, wherein the routing rule is the polling routing rule, and wherein selecting the target server from the servers serving the target payment channel according to the routing rule and the service time periods of the servers serving the target payment channel comprises:
based on the polling routing rule, one server is sequentially selected from all servers of the service provided for the target payment channel;
determining whether the time to execute the transaction request is within a service time period of the server;
if so, determining that the server is a target server;
if not, continuing to select the next server until determining the target server.
6. The method of claim 1, wherein prior to obtaining the transaction request sent by the user, the method further comprises:
setting a corresponding routing rule for each payment channel, and storing the set routing rule of each payment channel to the cache center;
and setting a corresponding service time period and a maximum concurrency number for each server providing services for the payment channel, and caching the service time period and the maximum concurrency number to the cache center.
7. The method of claim 1, wherein prior to distributing the transaction request to the target server over the target payment channel, the method further comprises:
judging whether the current channel state of the target payment channel is an open state;
if the current channel state of the target payment channel is an open state, executing the step of distributing the transaction request to the target server through the target payment channel;
and if the current state of the target payment channel is not the opening state, sending alarm information, wherein the alarm information is used for indicating that the target payment channel is abnormal.
8. A traffic processing apparatus, characterized in that the apparatus comprises:
the system comprises a first acquisition unit, a second acquisition unit and a payment unit, wherein the first acquisition unit is used for acquiring a transaction request sent by a user, and the transaction request carries a transaction type and a payment mode;
the first determining unit is used for determining a target payment channel from all payment channels pre-stored in a cache according to the transaction type and the payment mode, acquiring a routing rule of the target payment channel and a service time period of each server providing services for the target payment channel;
the first selecting unit is used for selecting a target server from the servers providing services for the target payment channel according to the routing rule and the service time period of each server providing services for the target payment channel, wherein the routing rule is a random routing rule, a weighted routing rule or a polling routing rule;
an allocation unit for allocating the transaction request to the target server through the target payment channel.
9. The apparatus of claim 8, wherein the first determining unit comprises:
the second determining unit is used for determining at least one payment channel matched with the payment mode from the payment channels pre-stored in the cache center according to the corresponding relation between the payment mode and the payment channels;
and the third determining unit is used for determining a target payment channel supporting the transaction type from the at least one payment channel according to the transaction types supported by the payment channels stored in the cache center in advance.
10. The apparatus according to claim 8, wherein the routing rule is the random routing rule, and the first selecting unit includes:
a second selecting unit, configured to select at least one server from the servers that provide services for the target payment channel, where a time for executing the transaction request is within a service time period of each server in the at least one server;
the surplus unit is used for carrying out surplus on the maximum thread number of the target payment channel based on a random routing rule and a timestamp of the time for executing the transaction request to obtain a surplus result;
and the fourth determining unit is used for determining the target server from the at least one server according to the residue taking result.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011252455.4A CN112348507A (en) | 2020-11-11 | 2020-11-11 | Service processing method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011252455.4A CN112348507A (en) | 2020-11-11 | 2020-11-11 | Service processing method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112348507A true CN112348507A (en) | 2021-02-09 |
Family
ID=74363273
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011252455.4A Pending CN112348507A (en) | 2020-11-11 | 2020-11-11 | Service processing method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112348507A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114025332A (en) * | 2021-10-13 | 2022-02-08 | 深圳市新国都支付技术有限公司 | Payment service communication method and device, computer equipment and storage medium |
WO2024001696A1 (en) * | 2022-06-30 | 2024-01-04 | 杭州海康威视数字技术股份有限公司 | User service request assigning method, apparatus and system, and device |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107705118A (en) * | 2017-09-19 | 2018-02-16 | 深圳金融电子结算中心有限公司 | Transaction payment method, system, server and storage medium based on channel route |
CN109409865A (en) * | 2018-09-18 | 2019-03-01 | 平安科技(深圳)有限公司 | Pay limit synchronization adjustment method, device, computer equipment and storage medium |
CN110601977A (en) * | 2019-08-29 | 2019-12-20 | 凡普数字技术有限公司 | Configuration method and device of routing strategy and storage medium |
WO2020136584A1 (en) * | 2018-12-24 | 2020-07-02 | Vibhor Jain | An automated system and method for identifying target payment mode/s for electronic payment transaction |
-
2020
- 2020-11-11 CN CN202011252455.4A patent/CN112348507A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107705118A (en) * | 2017-09-19 | 2018-02-16 | 深圳金融电子结算中心有限公司 | Transaction payment method, system, server and storage medium based on channel route |
CN109409865A (en) * | 2018-09-18 | 2019-03-01 | 平安科技(深圳)有限公司 | Pay limit synchronization adjustment method, device, computer equipment and storage medium |
WO2020136584A1 (en) * | 2018-12-24 | 2020-07-02 | Vibhor Jain | An automated system and method for identifying target payment mode/s for electronic payment transaction |
CN110601977A (en) * | 2019-08-29 | 2019-12-20 | 凡普数字技术有限公司 | Configuration method and device of routing strategy and storage medium |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114025332A (en) * | 2021-10-13 | 2022-02-08 | 深圳市新国都支付技术有限公司 | Payment service communication method and device, computer equipment and storage medium |
CN114025332B (en) * | 2021-10-13 | 2023-12-29 | 深圳市新国都支付技术有限公司 | Payment service communication method, device, computer equipment and storage medium |
WO2024001696A1 (en) * | 2022-06-30 | 2024-01-04 | 杭州海康威视数字技术股份有限公司 | User service request assigning method, apparatus and system, and device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP3989443B2 (en) | Method for controlling a web farm and web farm | |
US5341477A (en) | Broker for computer network server selection | |
CN107231496B (en) | Traffic processing method, service processing method, device and server | |
CN110266716B (en) | Unified service platform system of power grid | |
CN101371238B (en) | Distributed on-demand computing system | |
US7451226B1 (en) | Method for grouping content requests by behaviors that relate to an information system's ability to deliver specific service quality objectives | |
CN112348507A (en) | Service processing method and device | |
CN103810045B (en) | Resource allocation methods, explorer, Resource Server and system | |
CN106227596A (en) | Mission Monitor method and apparatus for task scheduling server | |
CN110928662B (en) | Distributed timing task scheduler facing micro-service architecture | |
Wolf et al. | On balancing the load in a clustered web farm | |
CN101297272A (en) | Method and system for virtualized health monitoring of resources | |
CN106330987A (en) | Dynamic load balancing method | |
JPH1132085A (en) | Communication network managing method and computer system for communication network management | |
CN111985646A (en) | Service processing method and device | |
CN107967175A (en) | A kind of resource scheduling system and method based on multiple-objection optimization | |
US8656005B2 (en) | Method for providing performance characteristics on demand | |
CN115633039A (en) | Communication establishing method, load balancing device, equipment and storage medium | |
CN110290228A (en) | A kind of internet protocol address distribution method and device | |
CN106469091B (en) | For distributing the method and apparatus of available area | |
CN105187483B (en) | Distribute the method and device of cloud computing resources | |
CN112738247B (en) | Cloud computing resource distribution system and method based on multi-layer space scheduling | |
CN115580618A (en) | Load balancing method, device, equipment and medium | |
CN109598411A (en) | A kind of processing method and electronic equipment of product design task | |
CN110992572B (en) | Method and system for distributing numbers |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |