Disclosure of Invention
The embodiment of the invention provides a method and equipment for distributing service handling request messages, which are used for improving the efficiency of service handling.
In a first aspect, an embodiment of the present invention provides a method for allocating a service handling request packet, including:
acquiring a service handling request message sent by a service client, wherein the service handling request message carries an identifier of a service to be handled;
determining a matched routing rule according to the identifier of the service to be handled and a preset routing matching rule to obtain an initial routing rule set, wherein the initial routing rule set carries the proportion of each initial routing rule in the initial routing rule set;
determining a target routing rule according to the proportion of each initial routing rule in the initial routing rule set;
determining a target routing channel according to the target routing rule;
and sending the service handling request message to a service handling terminal corresponding to the target routing channel through the target routing.
Optionally, the determining a target routing rule according to the percentage of each initial routing rule in the initial routing rule set includes:
determining a polling queue of each initial routing rule according to the proportion of each initial routing rule in the initial routing rule set;
and sequentially distributing target routing rules to the service clients according to the polling queues.
Optionally, the target routing rule includes a plurality of target routing channels, each of the target routing channels has a different priority,
the determining a target routing channel according to the target routing rule includes:
acquiring the priority of each target routing channel;
and determining the routing channel with the highest priority according to the acquired priority of each target routing channel to obtain a first target routing channel.
Optionally, after the routing channel with the highest priority is determined according to the obtained priority of each target routing channel to obtain a first target routing channel, the method further includes:
if receiving a prompt of service handling request message sending failure, acquiring a routing channel corresponding to the next priority of the first target routing channel to obtain a second target routing channel;
and sending the service handling request message to a service handling terminal corresponding to the second target routing channel through the second target routing channel.
Optionally, after the receiving a prompt that the service handling request message fails to be sent, obtaining a routing channel corresponding to a priority next to the priority of the first target routing channel, and obtaining a second target routing channel, the method further includes:
and if each target routing channel in the target routing rules fails to send a service handling request message, re-executing the target routing rules determined according to the proportion of each initial routing rule in the initial routing rule set to obtain new target routing rules.
Optionally, the identifier of the service to be handled is a code of the service to be handled or a name of the service to be handled.
Optionally, before acquiring the service transaction request packet sent by the service client, the method further includes:
receiving the configured routing matching rules, wherein the routing matching rules carry the identification of the service matched with each routing rule;
storing the route matching rule in a database.
In a second aspect, an embodiment of the present invention provides a device for distributing a service handling request packet, including: at least one processor and memory;
the memory stores computer-executable instructions;
the at least one processor executes computer-executable instructions stored by the memory, the processor implementing the following steps when executing the computer program:
acquiring a service handling request message sent by a service client, wherein the service handling request message carries an identifier of a service to be handled;
determining a matched routing rule according to the identifier of the service to be handled and a preset routing matching rule to obtain an initial routing rule set, wherein the initial routing rule set carries the proportion of each initial routing rule in the initial routing rule set;
determining a target routing rule according to the proportion of each initial routing rule in the initial routing rule set;
determining a target routing channel according to the target routing rule;
and sending the service handling request message to a service handling terminal corresponding to the target routing channel through the target routing channel.
Optionally, the processor, when executing the computer program, further implements the following steps:
determining a polling queue of each initial routing rule according to the proportion of each initial routing rule in the initial routing rule set;
and sequentially distributing target routing rules to the service clients according to the polling queues.
In a third aspect, an embodiment of the present invention provides a computer-readable storage medium, where a computer-executable instruction is stored in the computer-readable storage medium, and when a processor executes the computer-executable instruction, the method for allocating a service transaction request packet according to any one of the first aspect is implemented.
After the scheme is adopted, the routing rule set matched with the service to be handled can be determined according to the identification of the service to be handled and the preset routing matching rule, then the target routing rule is determined according to the proportion of each routing rule in the routing rule set, the target routing channel used for final transmission is determined from the target routing rule, and then the service handling request message is sent to the service handling terminal through the target routing channel, so that the flexibility of routing channel selection is improved, and further the service handling efficiency is improved.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims, as well as in the drawings, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are, for example, capable of operation in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Fig. 1 is an application schematic diagram of a service transaction request packet distribution method provided in an embodiment of the present invention, as shown in fig. 1, including: aservice client 101, aserver 102, aservice transaction terminal 103 and atarget route 104. The user may select a service to be transacted atservice client 101. The service to be handled by the user may be a financial-related service, such as loan transaction or payment transaction. After theservice client 101 selects a service to be handled, the user may send a service handling request message to theserver 102 through theservice client 101. After receiving the service transaction request message, theserver 102 may finally determine a target route, allocate the service transaction request message to a target routing channel, and send the service transaction request message to theservice transaction terminal 103 corresponding to the target routing channel through the target routing channel to handle a corresponding service.
The technical solution of the present invention will be described in detail below with specific examples. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments.
Fig. 2 is a schematic flow chart of a method for distributing a service transaction request packet according to an embodiment of the present invention, where the method may be executed by theserver 102. As shown in fig. 2, the method of this embodiment may include:
s201: and acquiring a service handling request message sent by a service client, wherein the service handling request message carries an identifier of a service to be handled.
Specifically, when a user wants to handle a related service, a service handling request message is sent to the server through the service client. The service transaction request message carries the identifier of the service to be handled, and the identifier is used for identifying the service to be handled. In addition, the service handling request message may also carry other information of the service to be handled. For example, the information such as the location of the user client, the credit limit of the user, and the limit of the service to be handled can be carried.
S202: and determining a matched routing rule according to the identifier of the service to be handled and a preset routing matching rule to obtain an initial routing rule set, wherein the initial routing rule set carries the proportion of each initial routing rule in the initial routing rule set.
Specifically, routing rules corresponding to different services to be managed are different. Before actual matching, routing rules corresponding to different services are configured in advance. In addition, when matching is actually performed, a plurality of matching routing rules may be determined, resulting in an initial routing rule set.
Further, the number of each routing rule is different in the initial set of routing rules. There may be more routing rules and only one routing rule. Therefore, the proportion of each routing rule in the initial routing rule set needs to be determined. Each routing rule may include a plurality of routing channels, and each routing channel has a different priority. For example, the routing rule set has three routing rules A, B and C, the size of the proportion occupied by routing rule a is 3, the size of the proportion occupied by routing rule B is 2, and the size of the proportion occupied by routing rule C is 1. The contents of routing rules A, B and C are:
routing rule a content: route channel a, priority 1; route channel b, priority 2; route path c, priority 3.
Routing rule B content: routing channel b, priority 1; route channel d, priority 2; route channel a, priority 3.
Routing rule C content: route channel d, priority 1; route channel a, priority 2; route path b, priority 3. And in this embodiment, the smaller the number, the higher the priority.
When actually determining the target routing channel, there may be three modes. Namely, the target routing channel is determined by the priority of the routing channel, the target routing channel is determined by the proportion of the routing rule in the initial routing rule set, and the target routing channel is determined by combining the priority of the routing channel and the proportion of the routing rule in the initial routing rule set. In this embodiment, the target routing channel may be determined by combining the priority of the routing channel and the proportion of the routing rule in the initial routing rule set.
S203: and determining a target routing rule according to the proportion of each initial routing rule in the initial routing rule set.
Specifically, after the ratio of each initial routing rule is determined, the initial routing rules may be ranked according to the ratio of each initial routing rule, and then the target routing rule may be determined according to the ranked initial routing rule.
S204: and determining a target routing channel according to the target routing rule.
Specifically, after the target routing rule is determined, the target routing channel is determined according to the priority of each routing channel in the target routing rule.
S205: and sending the service handling request message to a service handling terminal corresponding to the target routing channel through the target routing channel.
Specifically, each routing channel corresponds to a service handling terminal, and information can be sent to the service handling terminals through the routing channels. I.e. determining a routing path is equivalent to determining a service handling terminal.
After the scheme is adopted, the flexibility of routing channel selection is improved, and further the service handling efficiency is improved.
Based on the method of fig. 2, the present specification also provides some specific embodiments of the method, which are described below.
In a specific embodiment, there are a plurality of service clients, as shown in fig. 3, and a schematic flow chart of a method for allocating a service transaction request packet according to another embodiment of the present invention may include:
s301: and determining the polling queue of each initial routing rule according to the occupation ratio of each initial routing rule in the initial routing rule set.
Specifically, when the initial routing rules are determined from the initial routing rule set, the polling queue of each initial routing rule may be determined according to the proportion of each initial routing rule. For example, the initial routing rule set has A, B and C, the ratio of routing rule a is 3, the ratio of routing rule B is 2, and the ratio of routing rule C is 1. Then the polling queue order of the initial routing rule is: ABCABA.
S302: and sequentially distributing target routing rules to the service clients according to the polling queues.
Specifically, according to the first-in first-out principle, if the current user request turns to the routing rule a, the next request is to the routing rule B, and the routing rules are sequentially distributed. When the polling in the next period is finished, starting a polling loop in the next period.
In one embodiment, the target routing rule includes a plurality of target routing channels, each of the target routing channels having a different priority,
the determining a target routing channel according to the target routing rule may include:
and acquiring the priority of each target routing channel.
And determining the routing channel with the highest priority according to the acquired priority of each target routing channel to obtain a first target routing channel.
Specifically, in a target routing rule, there may be one target routing channel or multiple target routing channels. When there is a target route channel, the target service transaction request message is directly distributed as the first target route channel. When there are multiple target routing channels, the first target routing channel may be determined according to the priority of the target routing channel.
For example, the target routing rule a content: route channel a, priority 1; route channel b, priority 2; route path c, priority 3.
Target routing rule B content: routing channel b, priority 1; route channel d, priority 2; route channel a, priority 3.
Target routing rule C content: route channel d, priority 1; route channel a, priority 2; route path b, priority 3.
In this request, the smaller the number, the higher the priority. If polling to the target routing rule A, acquiring a first target routing channel with the highest priority of the target routing rule A: route channel a.
If polling to the target routing rule B, acquiring a first target routing channel with the highest priority of the target routing rule B: route channel b.
In a specific embodiment, after the determining, according to the obtained priority of each target routing channel, a routing channel with a highest priority to obtain a first target routing channel, the method may further include:
and if a prompt of service handling request message sending failure is received, acquiring a routing channel corresponding to the next priority of the first target routing channel to obtain a second target routing channel.
And sending the service handling request message to a service handling terminal corresponding to the second target routing channel through the second target routing channel.
Specifically, when the service handling request packet is sent to the service handling terminal through the routing channel, the service handling request packet may be sent unsuccessfully due to too many requests on the channel or network delay. For example, when the routing is sent through the routing channel a in the target routing rule a, if the sending fails, the next priority routing channel b of the target routing rule a is obtained to send again until the sending succeeds. And if the transmission fails through the routing channels a, b and c, the service handling failure of the service client is represented.
In a specific embodiment, after obtaining a routing channel corresponding to a priority next to the priority of the first target routing channel and obtaining the second target routing channel if the prompt that the service transaction request packet fails to be sent is received, the method may further include:
and if each target routing channel in the target routing rules fails to send a service handling request message, re-executing the target routing rules determined according to the proportion of each initial routing rule in the initial routing rule set to obtain new target routing rules.
Specifically, the one-time service handling request message can only be acquired to one route matching rule in the queue for analysis, and if all the route channels in the route matching rule fail to transmit, the next route rule in the polling queue cannot be directly acquired. But instead polls the queue to re-determine the new target routing rule based on the routing rule. For example, the route polling queue is ABCABA, the first determined target routing rule is a, and all routing channels in a fail to transmit the request. At this time, if the route polling is polled to C, it is determined that a after C is a new target routing rule.
In a specific embodiment, the identifier of the to-be-handled service is a code of the to-be-handled service or a name of the to-be-handled service.
In a specific embodiment, before the obtaining the service transaction request packet sent by the service client, the method may further include:
and receiving the configured routing matching rules, wherein the routing matching rules carry the identification of the service matched with each routing rule. Storing the route matching rule in a database.
Specifically, the pre-configured route matching rule is stored in a database of the server, and when the route matching rule needs to be used, the route matching rule can be directly extracted for use.
In a specific embodiment, the server returns the determined target routing channel to the service client for display.
In one embodiment, the server periodically counts the routing transmission success rate. The system respectively counts the success rate of the transaction from the dimension of the routing rule and the dimension of the routing channel, and provides reference for relevant service personnel to adjust the routing rule.
Based on the same idea, an embodiment of the present specification further provides a device corresponding to the foregoing method, and as shown in fig. 4, a schematic structural diagram of a service handling request packet distribution device provided in the embodiment of the present invention may include:
the obtainingmodule 401 is configured to obtain a service transaction request message sent by a service client, where the service transaction request message carries an identifier of a service to be handled.
A first determiningmodule 402, configured to determine a matched routing rule according to the identifier of the service to be handled and a preset routing matching rule, so as to obtain an initial routing rule set, where the initial routing rule set carries a proportion of each initial routing rule in the initial routing rule set.
A second determiningmodule 403, configured to determine a target routing rule according to a ratio of each initial routing rule in the initial routing rule set.
A third determiningmodule 404, configured to determine a target routing channel according to the target routing rule.
A sendingmodule 405, configured to send the service transaction request packet to a service transaction terminal corresponding to the target routing channel through the target routing channel.
In a specific embodiment, the number of the service clients is multiple, and the second determining module may be further configured to:
and determining the polling queue of each initial routing rule according to the proportion of each initial routing rule in the initial routing rule set.
And sequentially distributing target routing rules to the service clients according to the polling queues.
In one embodiment, the target routing rule includes a plurality of target routing channels, each of the target routing channels having a different priority,
the third determining module may be further configured to: and acquiring the priority of each target routing channel.
And determining the routing channel with the highest priority according to the acquired priority of each target routing channel to obtain a first target routing channel.
In a specific embodiment, after the third determining module, the method further includes:
and the second obtaining module is used for obtaining a routing channel corresponding to the next priority of the first target routing channel to obtain a second target routing channel if a prompt that the service handling request message fails to be sent is received.
And the second sending module is used for sending the service handling request message to a service handling terminal corresponding to the second target routing channel through the second target routing channel.
In a specific embodiment, after the second obtaining module, the method may further include:
and the re-execution module is used for re-executing the target routing rule determined according to the proportion of each initial routing rule in the initial routing rule set if each target routing channel in the target routing rule fails to send the service handling request message, so as to obtain a new target routing rule.
In a specific embodiment, the identifier of the to-be-handled service is a code of the to-be-handled service or a name of the to-be-handled service.
In a specific embodiment, before the obtaining module, the method may further include:
and the receiving module is used for receiving the configured routing matching rules, wherein the routing matching rules carry the identification of the service matched with each routing rule.
And the storage module is used for storing the routing matching rule to a database.
The apparatus provided in the embodiment of the present invention may implement the method according to the embodiment shown in fig. 4, and the implementation principle and the technical effect are similar, which are not described herein again.
Fig. 5 is a schematic diagram of a hardware structure of a service handling request packet distribution device according to an embodiment of the present invention. As shown in fig. 5, the present embodiment provides an apparatus 500 including: at least oneprocessor 501 andmemory 502. Theprocessor 501 and thememory 502 are connected by abus 503.
In a specific implementation, the at least oneprocessor 501 executes the computer-executable instructions stored in thememory 502, so that the at least oneprocessor 501 executes the method in the above-described method embodiments.
For a specific implementation process of theprocessor 501, reference may be made to the above method embodiments, which implement the similar principle and technical effect, and this embodiment is not described herein again.
In the embodiment shown in fig. 5, it should be understood that the Processor may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the present invention may be embodied directly in a hardware processor, or in a combination of the hardware and software modules within the processor.
The memory may comprise high speed RAM memory and may also include non-volatile storage NVM, such as at least one disk memory.
The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended ISA (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, the buses in the figures of the present application are not limited to only one bus or one type of bus.
The embodiment of the invention also provides a computer-readable storage medium, wherein a computer execution instruction is stored in the computer-readable storage medium, and when a processor executes the computer execution instruction, the service handling request message distribution method of the embodiment of the method is realized.
The computer-readable storage medium may be implemented by any type of volatile or non-volatile memory device or combination thereof, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk. Readable storage media can be any available media that can be accessed by a general purpose or special purpose computer.
An exemplary readable storage medium is coupled to the processor such the processor can read information from, and write information to, the readable storage medium. Of course, the readable storage medium may also be an integral part of the processor. The processor and the readable storage medium may reside in an Application Specific Integrated Circuits (ASIC). Of course, the processor and the readable storage medium may also reside as discrete components in the apparatus.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.