Task processing method and device, electronic equipment and storage medium

By using Redis and Lua scripts in the authorization task processing of commercial banks, the task processing pressure caused by relational databases was resolved, enabling real-time matching and approval of authorization tasks, and improving the system's processing efficiency and stability.

CN115048626BActive Publication Date: 2025-12-09AGRICULTURAL BANK OF CHINA
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210560994.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-23
Publication Date
2025-12-09
Estimated Expiration
2042-05-23

AI Technical Summary

Technical Problem

In the current technology for processing authorization tasks in commercial banks, the task processing method based on relational databases leads to increased database operating pressure, making it impossible to achieve real-time matching and review, thus affecting the efficiency and speed of authorization task review.

Method used

Redis is used as the caching database, and Lua scripts are used to store and process task information. The task distribution control parameters are used to match authorized users in real time, and the tasks are added to the queues to be distributed and pushed, so as to realize the real-time review of authorized tasks.

Benefits of technology

It enables real-time matching and review of authorized tasks, improves system processing efficiency and stability, reduces resource consumption, and ensures the efficiency and consistency of task distribution and push.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115048626B_ABST
    Figure CN115048626B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a task processing method and device, electronic equipment and storage medium, wherein the method comprises: receiving an authorization request user initiated authorization task, writing task information corresponding to the authorization task into Redis, and adding the authorization task to a to-be-distributed task queue; reading the task in the to-be-distributed task queue by calling a Lua script, and determining an authorization audit user corresponding to the authorization task according to a task distribution control parameter pre-flushed into Redis; adding the authorization task to a to-be-pushed task queue corresponding to the authorization audit user, i.e. a to-be-processed task queue, so that the authorization audit user reads the to-be-pushed task and audits information corresponding to the authorization task. The above technical solution solves the technical problem that the authorization task cannot be efficiently, quickly and timely audited, and achieves the technical effect of real-time matching of the authorization audit user for the authorization task and real-time auditing.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present application relate to the technical field of computer, and particularly relate to a task processing method and device, electronic equipment and storage medium. BACKGROUND

[0002] In the process of commercial bank counter business processing, a remote authorization approval link is set for in-process risk control, and auditors who concentrate in the authorization center office perform in-process risk audit work on high-risk transactions submitted by scattered tellers in each branch.

[0003] The prior art solution is based on a task processing method designed by a relational database, which needs to filter a set from table records according to the key value of the data table each time, and then perform join table query, subquery and other methods, so as to match the authorization center and auditors with the audit tasks.

[0004] With the continuous expansion of the business scale of the authorization center, the existing technical solution gradually exposes drawbacks in task processing. In the task processing process based on the relational database design, a large number of operations that consume the CPU and memory of the database are involved. With the increase of business volume, the running pressure of the database gradually increases, and the running effect is no longer ideal. The existing technical solution cannot meet the real-time matching and real-time audit requirements of the authorization tasks. SUMMARY

[0005] Embodiments of the present application provide a task processing method, device, electronic equipment and storage medium to achieve the technical effect of real-time matching of authorization tasks and real-time audit of authorization audit users.

[0006] In a first aspect, the embodiments of the present application provide a task processing method, which comprises:

[0007] Receiving an authorization request user initiated authorization task, writing task information corresponding to the authorization task into Redis, and adding the authorization task into a to-be-distributed task queue;

[0008] Reading the authorization task to be distributed in the to-be-distributed task queue by invoking a Lua script, and determining an authorization audit user corresponding to the read authorization task according to a task distribution control parameter pre-flushed into Redis;

[0009] Adding the authorization task into a to-be-pushed task queue corresponding to the authorization audit user, so that the authorization audit user reads the authorization task in the to-be-pushed task queue, and audits the task information corresponding to the read authorization task.

[0010] In a second aspect, the embodiments of the present application further provide a task processing device, which comprises:

[0011] The authorization task receiving module is configured to receive an authorization task initiated by an authorization request user, write task information corresponding to the authorization task into Redis, and add the authorization task into a to-be-distributed task queue;

[0012] The authorization audit user determining module is configured to read the authorization task to be distributed in the to-be-distributed task queue by invoking a Lua script, and determine an authorization audit user corresponding to the read authorization task according to a task distribution control parameter pre-flushed into Redis.

[0013] The authorization task pushing module is configured to add the authorization task into a to-be-pushed task queue corresponding to the authorization audit user, so that the authorization audit user reads the authorization task in the to-be-pushed task queue and audits the task information corresponding to the read authorization task.

[0014] In a third aspect, an electronic device is provided, and the electronic device includes:

[0015] one or more processors;

[0016] a storage device configured to store one or more programs,

[0017] When the one or more programs are executed by the one or more processors, the one or more processors implement the task processing method provided by any of the embodiments of the present application.

[0018] In a fourth aspect, a computer readable storage medium is provided, and the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the task processing method provided by any of the embodiments of the present application.

[0019] The technical solution of the embodiments of the present application receives an authorization task initiated by an authorization request user, writes task information into Redis, and adds the authorization task into a to-be-distributed task queue, so as to determine an authorization audit user corresponding to the authorization task according to a task distribution control parameter, and then audits the authorization task, thereby solving the technical problem that the authorization task cannot be efficiently, quickly and timely audited, and achieving the technical effect of real-time matching of an authorization audit user for an authorization task and then real-time auditing. BRIEF DESCRIPTION OF DRAWINGS

[0020] In order to more clearly illustrate the technical solutions of the example embodiments of the present application, the drawings needed in the description of the embodiments are briefly introduced as follows. Obviously, the drawings introduced are only a part of the drawings of the embodiments to be described by the present application, and not all the drawings. Those skilled in the art can also obtain other drawings according to these drawings without creating creative labor.

[0021] Figure 1is a flowchart of a task processing method provided by the embodiment one of the present application;

[0022] Figure 2 is a flowchart of a task processing method provided by the embodiment two of the present application;

[0023] Figure 3 is a schematic diagram of a control parameter set establishing method provided by the embodiment two of the present application;

[0024] Figure 4 is a flowchart of an authorized task matching of a task processing method provided by the embodiment two of the present application;

[0025] Figure 5 is a general framework diagram of a task processing method provided by the embodiment two of the present application;

[0026] Figure 6 is a structural schematic diagram of a task processing device provided by the embodiment three of the present application;

[0027] Figure 7 is a structural schematic diagram of an electronic device provided by the embodiment one of the present application. DETAILED DESCRIPTION

[0028] The present application will be further described below in conjunction with the drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the present application, but not to limit the present application. In addition, it should be noted that, for the convenience of description, only the parts related to the present application are shown in the drawings, but not all the structures.

[0029] In addition, it should be noted that, for the convenience of description, only the parts related to the present application are shown in the drawings, but not all the structures. Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe the operations (or steps) as sequential processes, many of the operations can be implemented in parallel, concurrently or simultaneously. In addition, the order of the operations can be rearranged. The processes can be terminated when the operations are completed, but can also have additional steps not included in the drawings. The processes can correspond to methods, functions, procedures, subroutines, etc.

[0030] Embodiment one

[0031] Figure 1A flowchart of a task processing method provided by the first embodiment of the present application is shown in the figure. The embodiment can be applied to the distribution and pushing of received tasks. The method can be executed by a task processing device, which can be implemented by software and / or hardware, and can be configured in a terminal and / or a server to implement the task processing method of the present application.

[0032] As shown in the figure, the method of the embodiment can specifically include the following steps. Figure 1

[0033] S110, receiving an authorization request user to initiate an authorization task, writing task information corresponding to the authorization task into Redis, and adding the authorization task into a to-be-distributed task queue.

[0034] The authorization request user can be a requester initiating the authorization task. The authorization request user can initiate an authorization request task through a device. The device can be placed at various locations, such as a management network point of a bank. The authorization request user can initiate an authorization task through the management network point.

[0035] The authorization task can be a task that needs to be authorized, such as a task that needs to be authorized to perform a transaction, or other tasks that need to be authorized. For example, in the process of commercial bank counter business processing, a remote authorization approval link is set for in-process risk control, and auditors centralized in the authorization center office perform real-time in-process risk audit work on high-risk transactions submitted by scattered tellers in each network point. The authorization task can be the high-risk transaction.

[0036] The task information can be specific task information carried by the authorization task. For example, the task information can include at least one of the following: application network point number, transaction code, application teller number, task status, priority, authorization center, and authorization audit user. The task information can also include to-be-authorized information that needs to be audited by the authorization audit user. The authorization audit user can audit the authorization task according to the to-be-authorized information.

[0037] ​The Redis is an open source Key-value database, and the Redis is widely applied to the cache direction, in the embodiment of the application, the Redis is used to store task information and other information, so as to improve the efficiency of task processing; the parameter configuration of a large number of business management ranges is used in the authorization task distribution, these parameters are inclined to be static, the change frequency is extremely low, and generally, it is a 1:N relationship, that is, a set, for example, the regional range managed by the authorization center A: {network point A, network point B,..., network point Z}. Limited by the management mode of the relational database, the data are stored in one or several tables, for example, the regional range table managed by the authorization center. These static data need to be filtered from the table record according to the key value at each task distribution, and this frequent operation consumes a large amount of system resources, and affects the distribution efficiency of each task, therefore, the Redis is used to store task information and other information in the embodiment of the application, so as to improve the efficiency of task processing; and the relational database is limited by the connection pool, and the relational database will gradually become the performance bottleneck of the multi-thread concurrent task distribution, when the number of task distribution threads is too large, the database connection pool is occupied, other service requests cannot be responded, or the overall delay of the application request is possible, and the system service capability is degraded. Taking Oracle as an example, the connection pool is generally limited to 150 or less; the Redis connection is limited to 1000 by default.

[0038] The task queue to be distributed can be a queue containing tasks to be distributed, the task queue to be distributed can arrange the tasks to be distributed in a first-in first-out manner, or can arrange the tasks to be distributed according to the priority and time information of the tasks to be distributed, that is, the tasks to be distributed with high priority are arranged in front of the queue, the tasks to be distributed arranged in front of the queue are distributed first, and the tasks to be distributed with the same priority are arranged in the queue according to time.

[0039] It can be understood that the task processing device writes the task information corresponding to the authorization task into the Redis by receiving the authorization request initiated by the user, stores the task information and other information through the Redis, and adds the authorization task according to the authorization task priority into the task queue to be distributed.

[0040] S120, the authorization audit user corresponding to the read authorization task is determined according to the task distribution control parameter pre-flushed into the Redis by calling the Lua script to read the authorization task to be distributed in the task queue to be distributed.

[0041] The Lua script can be a lightweight and small open source script language, the design purpose of the Lua script is to embed the application program, and provide flexible expansion and customization functions for the program, in the embodiment of the application, the Redis task queue to be distributed is read by calling the Lua script.

[0042] The task distribution control parameter can be a parameter capable of controlling task distribution, for example, a parameter including a matching relationship between task information and an authorized audit user in the task distribution control parameter, for example, a business type, i.e., a transaction code, handled by the authorized audit user, which needs to be the same as the business type in the task information, and the like matching rule. The authorized task and the authorized audit user are matched through the task distribution control parameter, so as to determine the authorized audit user corresponding to the authorized task.

[0043] The authorized audit user can be a user capable of auditing an authorized task, and the authorized audit user can handle different business types, i.e., corresponding to several transaction codes. The authorized center can include several authorized audit users.

[0044] The Lua script is invoked to read the authorized task to be distributed in the task queue to be distributed, the task distribution control parameter is brushed into Redis through a timing task, the authorized task and the authorized audit user are matched according to the task distribution control parameter, for example, the transaction code of the authorized task needs to be the same as the transaction code of the authorized audit user, and the application branch of the authorized task corresponds to the authorized center where the authorized audit user is located, and the like task distribution control parameter is matched, so as to determine the authorized audit user corresponding to the authorized task.

[0045] S130, the authorized task is added to the task queue to be pushed corresponding to the authorized audit user, so that the authorized audit user reads the authorized task in the task queue to be pushed, and audits the task information corresponding to the read authorized task.

[0046] The task queue to be pushed can be a queue containing a task to be pushed. The task queue to be pushed can arrange the task to be pushed in a first-in first-out manner, or arrange the task to be pushed according to the priority and time information of the task to be pushed, i.e., the task to be pushed with high priority is arranged in front of the queue, the task to be pushed arranged in front of the queue is pushed earlier, and the tasks with the same priority are arranged in the queue according to the time.

[0047] The authorization task can be a task that needs authorization, such as a task that needs authorization to perform a transaction, or other tasks that need authorization, such as a remote authorization approval link set for in-process risk control in the process of commercial bank counter service processing, and the auditor centralized in the authorization center office performs real-time in-process risk audit work on the high-risk transactions submitted by the scattered tellers of each branch, and the authorization task can be the above-mentioned high-risk transaction. The authorization task can also be the authorization task time, that is, the time when the authorization task is created, for example, the authorization task time can be the date and time accurate to the second. Through the authorization task time, the authorization audit user can understand the waiting time of the authorization request user after initiating the authorization task, and then can conduct targeted authorization audit on the authorization task, for example, if the authorization task time is too long from the current time, the authorization request user can be soothed, or the authorization audit process can be adjusted to stabilize the authorization request user's mood.

[0048] The authorization task is added to the corresponding pending task queue of the authorization audit user. The authorization task can be added to the pending task queue processed by the authorization audit user according to the corresponding authorization audit user. The pending task queue can use a first-in, first-out method to arrange the pending tasks, or can arrange the pending tasks according to the priority and time information of the pending tasks, so that the authorization audit user reads the authorization task in the pending task queue and audits the task information corresponding to the read authorization task. For example, the task information includes to-be-authorized information, which can be to-be-authorized information that needs to be audited by the authorization audit user. The authorization audit user can audit the authorization task according to the to-be-authorized information, or the authorization audit user can audit the authorization task according to the task information and communication with the authorization request user.

[0049] Optionally, in the embodiment of the application, any optional technical solution is added to the task processing method.

[0050] If the authorization audit user corresponding to the read authorization task is not determined, the processing priority of the authorization task is increased, and the authorization task is re-added to the pending distribution queue according to the processing priority.

[0051] The processing priority can be a priority level for processing the authorization task. According to the different processing priorities, the authorization task with a high processing priority can be processed first.

[0052] The undetermined authorized review user corresponding to the read authorized task can be understood as that when the authorized task is added to the to-be-pushed task queue corresponding to the authorized review user, the authorized review user cannot receive the authorized task, that is, the authorized task pushing fails. Then, the processing priority of the authorized task is improved, and the authorized task is re-added to the to-be-distributed queue according to the processing priority.

[0053] Optionally, based on any optional technical solution in the embodiments of the application, the task processing method further comprises:

[0054] If the cumulative number of times that the authorized review user corresponding to the read authorized task is not determined reaches a preset number threshold in the case that there is an idle authorized review user, a fault prompt information is generated.

[0055] If the cumulative number of times that the authorized review user corresponding to the read authorized task is not determined reaches a preset number threshold in the case that there is an idle authorized review user, a fault prompt information is generated. It can be understood that when the number of times of single or overall authorized task pushing failure is too much, that is, exceeds the set number threshold, the fault prompt information is generated. For example, the network failure or other types of failure can be generated. When the number of times of authorized task pushing failure of the authorized review user corresponding to the authorized task exceeds the set number threshold, the fault prompt information is generated to prompt the authorized review user that the fault occurs, so that the authorized review user or related personnel or system can be checked and repaired.

[0056] The technical solution of the embodiment receives the authorized task initiated by the authorized request user, writes the task information into Redis, and adds the authorized task to the to-be-distributed task queue, so as to determine the authorized review user corresponding to the authorized task according to the task distribution control parameter, and then audits the authorized task. The technical problem that the authorized task cannot be efficiently, quickly and timely audited is solved, and the technical effect that the authorized review user is matched with the authorized task in real time and then audited in real time is achieved.

[0057] Embodiment two

[0058] Figure 2This is a flowchart illustrating a task processing method provided in Embodiment 2 of the present invention. Optionally, based on any optional technical solution in the embodiments of the present invention, the task processing method further includes: flushing task distribution control parameters into Redis in the form of a control parameter set at a preset time point using a Spring scheduled task. The control parameter set includes at least one of the following: a set of transaction-distributable authorization centers, a set of branch task-distributable authorization centers, a set of transaction-distributable authorization review users, a set of branch task-distributable authorization review users, a set of idle authorization review users, a set of priority authorization review users, a set of task-distributable queues, and a set of task-pushable queues.

[0059] like Figure 2 As shown, the method in this embodiment may specifically include:

[0060] S210. Using Spring Scheduled, the task distribution control parameters are flushed into Redis in the form of a control parameter set at a preset time point. The control parameter set includes at least one of the following: a set of transaction-distributable authorization centers, a set of branch task-distributable authorization centers, a set of transaction-distributable authorization review users, a set of branch task-distributable authorization review users, a set of idle authorization review users, a set of priority authorization review users, a set of task-distributable queues, and a set of task-pushable queues.

[0061] The scheduled task can be a program that starts running at a fixed time or a program that executes cyclically at fixed intervals. The scheduled task can be an annotation of @Scheduled provided by Spring. The scheduled task effectively solves the needs of scheduled tasks. In this embodiment of the invention, the scheduled task can be used to flush task distribution control parameters into Redis in the form of a set of control parameters. For example, the task distribution control parameters for the day can be flushed into Redis at the daily cut-off time.

[0062] The control parameter set can be a set data type in Redis, and the control parameter set can be certain parameter conditions that the authorization task needs to meet. The authorization review user corresponding to the authorization task can be determined based on the control parameter set.

[0063] Specifically, the set of transaction-distributable authorization centers can be organized using the transaction code as the key and the identity information of the authorization center as the value; the set of branch task-distributable authorization centers can be organized using the management branch number as the key and the identity information of the authorization center as the value; the set of transaction-distributable authorization review users can be organized using the transaction code as the key and the identity information of both the authorization center and the authorization review user as the value; and the set of branch task-distributable authorization review users can be organized using the management branch number as the key and the identity information of both the authorization center and the authorization review user as the value. The set of idle authorization review users can be organized using the identity information of the authorization center as the key and the identity information of the authorization center and the identity information of the authorization review users as the value; the set of priority authorization review users can be organized using the identity information of the authorization center as the key and the identity information of the authorization center and the identity information of the authorization review users as the value; the set of task dispatchable queues can be organized using the region information as the key and the identity information of the task queue to be dispatched as the value; the set of task pushable queues can be organized using the region information as the key and the identity information of the task queue to be pushed as the value.

[0064] like Figure 3 The diagram shown is a schematic representation of a method for establishing a control parameter set according to Embodiment 2 of the present invention. Figure 2 The following are examples of how the above control parameter sets are established. For instance, the Authorization Center Business Scope Table contains two fields: Authorization Center ID (the identity information of the Authorization Center) and Transaction Code. Then, based on the Transaction Code, a set of Authorization Centers that can distribute transactions is established, meaning that the Authorization Center ID corresponding to one Transaction Code constitutes one set. The Authorization Center Regional Scope Table contains two fields: Authorization Center ID (the identity information of the Authorization Center) and Management Outlet Number. Then, based on the Management Outlet Number, a set of Authorization Centers that can distribute outlet tasks is established. The Auditor Business Scope Table includes three fields: Authorization Center ID (the identity information of the Authorization Center), Auditor ID (the identity information of the Authorized Auditor User), and Transaction Code. Then, based on the Transaction Code, a set of Auditors that can distribute transactions is established, i.e., a set of Authorized Auditors that can distribute transactions. The Auditor Regional Scope Table includes three fields: Authorization Center ID (the identity information of the Authorization Center), Auditor ID (the identity information of the Authorized Auditor User), and Outlet Number (the Management Outlet Number). Then, based on the Outlet Number, a set of Auditors that can distribute outlet tasks is established, i.e., a set of Authorized Auditors that can distribute outlet tasks.

[0065] Optionally, based on any optional technical solution in the embodiments of the present application, the control parameter set is established based on at least one of the following manners:

[0066] The transaction distributable authorization center set is reversely established by taking the specific transaction code in the business scope of the authorization center as a key and taking the identity information of the authorization center as a value.

[0067] The branch task distributable authorization center set is reversely established by taking the management branch number in the regional scope of the authorization center as a key and taking the identity information of the authorization center as a value.

[0068] The transaction distributable authorized audit user set is established by taking the specific transaction code number in the business scope of the auditor as a key and taking the identity information of the authorization center and the identity information of the authorized audit user as a value.

[0069] The branch task distributable authorized audit user set is established by taking the management branch number in the regional scope of the auditor as a key and taking the identity information of the authorization center and the identity information of the authorized audit user as a value.

[0070] The idle authorized audit user set is established by taking the identity information of the authorization center in the business scope of the auditor as a key and taking the identity information of the authorization center and the identity information of the authorized audit user as a value according to the working state identification information of the authorized audit user.

[0071] The priority authorized audit user set is established by taking the identity information of the authorization center in the business scope of the auditor as a key and taking the identity information of the authorization center and the identity information of the authorized audit user as a value according to the priority information of the authorized audit user.

[0072] The task distributable queue set is established by taking the regional information corresponding to the authorization task as a key and taking the identification information of the task queue to be distributed as a value.

[0073] The task pushable queue set is established by taking the regional information corresponding to the authorization task as a key and taking the identification information of the task queue to be pushed as a value.

[0074] Optionally, based on any optional technical solution in the embodiments of the present application, the authorized audit user corresponding to the read authorization task is determined according to the task distribution control parameter pre-flushed into Redis, and the method comprises the following steps:

[0075] The application branch number and the transaction code of the authorization task are acquired, and a matching authorization center number is found in the transaction distributable authorization center set and the branch task distributable authorization center set according to the application branch number and the transaction code.

[0076] finding a matching authorization audit user in an intersection of the transaction distributable authorization audit user set and the branch task distributable authorization audit user set according to the application branch number, the transaction code and the matching authorization center number;

[0077] finding a matching idle authorization audit user in the idle authorization audit user set according to the matching authorization center number and the matching authorization audit user;

[0078] determining an authorization audit user corresponding to the read authorization task according to the idle authorization audit user.

[0079] The application branch number can be a branch number of a branch where an authorization request user initiates an authorization task, and the application branch number can be a management branch number.

[0080] The transaction code can be a task type code representing an authorization task, different types of authorization tasks can be distinguished by the transaction code, and an authorization audit user can handle an authorization task corresponding to the transaction code.

[0081] According to the application branch number and the transaction code, the matching authorization center number can be found in the intersection of the transaction distributable authorization center set and the branch task distributable authorization center set, that is, the identity information set A of the authorization center corresponding to the application branch number, that is, the authorization center number set A, is found in the branch task distributable authorization center set through the application branch number, the authorization center number set B corresponding to the transaction code is found in the transaction distributable authorization center set through the transaction code, and the matching authorization center number is obtained through intersection operation.

[0082] According to the application branch number, the transaction code and the matching authorization center number, the matching authorization audit user can be found in the intersection of the transaction distributable authorization audit user set and the branch task distributable authorization audit user set, that is, the identity information set C of the authorization center and the identity information set of the authorization audit user corresponding to the application branch number is found in the branch task distributable authorization audit user set through the application branch number, the identity information set D of the authorization center and the identity information set of the authorization audit user corresponding to the transaction code is found in the transaction distributable authorization audit user set through the transaction code, the matching authorization audit user is obtained through intersection operation, and the identity information set E of the authorization center and the identity information set of the authorization audit user is obtained through intersection operation, and the matching authorization audit user meeting the matching authorization center number is selected from the identity information set E of the authorization center and the identity information set of the authorization audit user.

[0083] The set of idle authorization review users can be a set of authorization review users in an idle state. When an authorization review user is performing authorization review, the status of the authorization review user is busy. When the authorization review user finishes authorization review or does not perform authorization review, the status of the authorization review user is idle.

[0084] The step of finding the matching idle authorization review user in the set of idle authorization review users based on the matching authorization center number and the matching authorization review user can be achieved by finding the idle authorization review user corresponding to the authorization center number in the set of idle authorization review users based on the authorization center number, and then performing a union operation on the idle authorization review users corresponding to each authorization center number to obtain the set of idle authorization review users, which is the matching idle authorization review user.

[0085] The step of determining the authorization review user corresponding to the read authorization task based on the idle authorization review user can be done by selecting one authorization review user from the matched idle authorization review users as the authorization review user corresponding to the authorization task. The selection method can be random selection, or selection based on the processing volume of the authorization review user. For example, priority can be given to authorization review users with small processing volumes to ensure that the workload is averaged. Alternatively, authorization review users can be selected based on their priority, and the priority can be dynamically changed to adapt to different situations.

[0086] like Figure 4 The above is a schematic diagram of the authorized task matching process of a task processing method provided in Embodiment 2 of the present invention, as shown in the figure. Figure 4 The process involves obtaining an authorized task by reading the head of the task queue to be distributed. Based on the application branch number and transaction code of the authorized task, an authorized center set is found in both the set of authorized centers that can be distributed for branch tasks and the set of authorized centers that can be distributed for transactions. The intersection of these sets yields a matching set of authorized centers. Then, based on the application branch number, transaction code, and the matching set of authorized centers, authorized review users are found in both the set of reviewers that can be distributed for branch tasks and the set of reviewers that can be distributed for transactions. The intersection of these sets yields a matching set of authorized review users. Finally, the union of the sets of idle reviewers yields a matching set of idle review users. Finally, the union of the sets of priority reviewers determines the authorized review user corresponding to the authorized task. The authorized center number and authorized review user ID are added to the task details of the authorized task, and the authorized task is added to the task queue to be pushed.

[0087] Optionally, based on any of the optional technical solutions in the embodiments of the present invention, the step of determining the authorization review user corresponding to the read authorization task according to the idle authorization review user includes:

[0088] If the found idle authorization audit users are two or more, the authorization audit user with the highest priority among the idle authorization audit users in the priority authorization audit user set is selected as the authorization audit user corresponding to the read authorization task.

[0089] S220, receiving an authorization request user initiated authorization task, writing task information corresponding to the authorization task into Redis, and adding the authorization task into a to-be-distributed task queue.

[0090] S230, reading the authorization task to be distributed in the to-be-distributed task queue by starting a Lua script, and determining the authorization audit user corresponding to the read authorization task according to the task distribution control parameter pre-flushed into Redis.

[0091] S240, adding the authorization task into the to-be-pushed task queue corresponding to the authorization audit user, so that the authorization audit user reads the authorization task in the to-be-pushed task queue and audits the task information corresponding to the read authorization task.

[0092] The technical scheme of the embodiment, the Spring scheduled task is used to flush the task distribution control parameter into Redis in the form of a control parameter set at a preset time point, solves the technical problem of how to flush the task distribution control parameter into Redis, and achieves the technical effect of efficiently, accurately and timely flushing the task distribution control parameter into Redis.

[0093] As shown in Figure 5 , it is a general framework diagram of a task processing method provided by the second embodiment of the application, as shown in Figure 5 , the task processing method can include:

[0094] Step 1, flush the control parameter of task distribution into Redis memory by Spring scheduled task at the time point of day change. The parameters flushed in this step include: the business scope and the region scope managed by the authorization center: according to the specific transaction code in the business scope, the specific transaction code in the region scope, the branch number as Key, the authorization center ID as Value, and a plurality of sets are reversely established; the business scope and the region scope set that can be accepted by the auditor: according to the specific transaction code in the business scope, the transaction code in the region scope, the branch number as Key, the auditor ID as Value, and a plurality of sets are reversely established; an idle user set and a busy user set are set for each authorization center, the authorization center ID as Key, and a set is established; a to-be-distributed task queue and a to-be-pushed task queue are set for each province, the province code as Key, and a ZSet is established;

[0095] Step 2, after the daytime auditor logs in the system, the user information and state are written into Redis, including: using the authorized audit user's identity information as Key, selecting Hash Table as data type, writing user information; updating the authorized center idle user set and busy user set in Redis every time the user receives a service, ends a service, logs in, and exits.

[0096] Step 3, after the branch clerk or authorized request user initiates a real-time authorization task, the task information is written into Redis, and the task is added to the pending task queue, including: using the authorization task ID as Key, and selecting Hash Table as task details; the authorization task is allowed to have priority weight when it is added to the pending queue, and ZSet is used to solve the priority problem.

[0097] Step 4, through the configuration of timing tasks and multi-threading, multiple timing tasks are started, and in the task, Lua scripts are called to read the content of the Redis pending task queue, and according to the authorized center management range, auditor management range and state set information, the authorization task and the authorized audit user are matched, including: the authorization task is matched with the authorized center, and the authorized center information is marked; the authorization task is matched with the authorized audit user, and the authorized audit user information is marked; the authorization task is moved from the pending queue to the pending queue, and the state of the authorized audit user is changed from idle to busy; the authorization task cannot complete the matching and returns to the pending task queue, and the task priority is increased.

[0098] Step 5, the content of the Redis pending task queue is read through the timing task, and the authorization task is selected from the pending task queue for task pushing.

[0099] Step 6, provide the function of writing the failed authorization task pushing into the Redis pending task queue again, including: deleting the authorization task matching information, increasing the task priority, adding the authorization task to the pending queue, changing the state of the authorized audit user from busy to idle, and accumulating the number of pushing failures; if the number of failures exceeds the system setting, it is prompted that there is a problem with the network of the authorized audit user, and the equipment needs to be checked.

[0100] The application embodiment has the advantages that: the Redis in-memory database is used to replace the relational database for distribution and pushing of authorization tasks, the configuration parameters are pre-flushed into the cache, the data reading and writing and set operation are faster, the system has strong real-time processing and low resource consumption, the data stored in the single table of the relational database is scattered and converted into multiple sets in Redis, the Redis set operation capability is used to realize the task distribution algorithm based on the time complexity O(n), and the system operation effect is improved; the task distribution algorithm is designed based on Redis, and the concurrent processing capability is further improved; the task distribution no longer depends on the relational database, the database connection pool resources can better support other services, and the overall operation stability and performance of the system are improved; the set operation during the distribution of the authorization task is encapsulated using the atomicity of the Lua script, the data consistency during multiple set operations is ensured, the Redis transaction is realized, the set operation of the authorization task distribution is realized based on the embedded Lua script calling in the system, is lightweight and efficient, can be flexibly extended, and the Redis server executes the Lua script in a single thread atomically, ensures that the Lua script cannot be interrupted by any other request during processing, and achieves the transaction feature provided by the relational database; the authorization task distribution and pushing failure processing is provided, the priority weight of the authorization task is improved after the distribution failure, and it is ensured that the authorization task can be distributed according to the application time sequence; through the mechanism of re-distribution after pushing failure, the influence of network jitter on the task acceptance success rate is avoided, the automatic operation of the system is realized to the greatest extent, the authorization task distribution and pushing failure processing can ensure the balance of the same task in the overall acceptance time, avoid the extension of the customer waiting time caused by the system network reason, realize the automatic operation of the overall system process, and have high task processing efficiency and success rate.

[0101] Embodiment three

[0102] Figure 6 A structural schematic diagram of a task processing device provided for the third embodiment of the application. The task processing device provided in the embodiment can be realized by software and / or hardware, and can be configured in a terminal and / or a server to realize the task processing method in the embodiment. The device can specifically include: an authorization task receiving module 310, an authorization audit user determining module 320, and an authorization task pushing module 330.

[0103] The authorization task receiving module 310 is configured to receive an authorization task initiated by an authorization request user, write task information corresponding to the authorization task into Redis, and add the authorization task into a to-be-distributed task queue.

[0104] The technical scheme of the embodiment receives an authorization task initiated by an authorization request user, writes task information into Redis, and adds the authorization task into a to-be-distributed task queue, thereby determining an authorization audit user corresponding to the authorization task according to a task distribution control parameter, and further auditing the authorization task, which solves the technical problem that the authorization task cannot be efficiently, quickly and timely audited, and achieves the technical effect of real-time matching of an authorization audit user for the authorization task and further real-time auditing.

[0105] On the basis of any optional technical scheme in the embodiment of the application, optionally, the task processing device further comprises:

[0106] The task distribution control parameter writing module is configured to write the task distribution control parameter into Redis in the form of a control parameter set at a preset time point through a Spring scheduled task, wherein the control parameter set comprises at least one of a transaction distributable authorization center set, a branch task distributable authorization center set, a transaction distributable authorization audit user set, a branch task distributable authorization audit user set, an idle authorization audit user set, a priority authorization audit user set, a task distributable queue set, and a task pushable queue set.

[0107] On the basis of any optional technical scheme in the embodiment of the application, optionally, the control parameter set is established based on at least one of the following manners:

[0108] The transaction distributable authorization center set is reversely established by taking a specific transaction code in the business scope of the authorization center as a key and taking identity information of the authorization center as a value.

[0109] The branch task distributable authorization center set is reversely established by taking a management branch number in the regional scope of the authorization center as a key and taking identity information of the authorization center as a value.

[0110] The transaction distributable authorized audit user set is established by taking the specific transaction code number in the audit scope of the auditor as a key, and taking the identity information of the authorized center and the identity information of the authorized audit user as values.

[0111] The branch task distributable authorized audit user set is established by taking the management branch number in the audit scope of the auditor as a key, and taking the identity information of the authorized center and the identity information of the authorized audit user as values.

[0112] The idle authorized audit user set is established by taking the identity information of the authorized center in the audit scope of the auditor as a key, and taking the identity information of the authorized center and the identity information of the authorized audit user as values, according to the working state identification information of the authorized audit user.

[0113] The priority authorized audit user set is established by taking the identity information of the authorized center in the audit scope of the auditor as a key, and taking the identity information of the authorized center and the identity information of the authorized audit user as values, according to the priority information of the authorized audit user.

[0114] The task distributable queue set is established by taking the regional information corresponding to the authorized task as a key, and taking the identification information of the task queue to be distributed as a value.

[0115] The task pushable queue set is established by taking the regional information corresponding to the authorized task as a key, and taking the identification information of the task queue to be pushed as a value.

[0116] In any optional technical solution in the embodiments of the application, the authorized audit user determination module 320 can optionally include:

[0117] The authorized center number matching unit is configured to obtain the application branch number and the transaction code of the authorized task, and find a matching authorized center number in the transaction distributable authorized center set and the branch task distributable authorized center set according to the application branch number and the transaction code.

[0118] The authorized audit user matching unit is configured to find a matching authorized audit user in the intersection of the transaction distributable authorized audit user set and the branch task distributable authorized audit user set according to the application branch number, the transaction code and the matching authorized center number.

[0119] The idle authorized audit user determination unit is configured to find a matching idle authorized audit user in the idle authorized audit user set according to the matching authorized center number and the matching authorized audit user.

[0120] The authorized audit user determination unit is configured to determine the authorized audit user corresponding to the authorized task read according to the idle authorized audit user.

[0121] Based on any optional technical solution in the embodiments of the present invention, the authorized review user determination unit may be used to select the idle authorized review user with the highest priority from the set of priority authorized review users as the authorized review user corresponding to the read authorization task if there are two or more idle authorized review users found.

[0122] Optionally, based on any of the optional technical solutions in the embodiments of the present invention, the task processing device further includes:

[0123] The authorization task processing priority module is used to increase the processing priority of the authorization task if no authorization review user corresponding to the read authorization task is identified, and to re-add the authorization task to the distribution queue according to the processing priority.

[0124] Optionally, based on any of the optional technical solutions in the embodiments of the present invention, the task processing device further includes:

[0125] The fault information generation module is used to generate a fault prompt message if, in the presence of idle authorization review users, the cumulative number of times the authorization review user corresponding to the read authorization task has not been determined reaches a preset threshold.

[0126] The above-described task processing device can execute the task processing method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the task processing method.

[0127] Example 4

[0128] Figure 7 This is a schematic diagram of the structure of an electronic device provided in Embodiment 4 of the present invention, as shown below. Figure 7 As shown, the electronic device includes a processor 410, a memory 420, an input device 430, and an output device 440; the number of processors 410 in the device can be one or more. Figure 7 Taking a processor 410 as an example; the processor 410, memory 420, input device 430, and output device 440 in the device can be connected via a bus or other means. Figure 7 Taking the example of a connection between China and Israel via a bus.

[0129] The memory 420, as a computer-readable storage medium, can be used to store software programs, computer-executable programs, and modules, such as the program instructions / modules corresponding to the task processing method in this embodiment of the invention. The processor 410 executes various functional applications and data processing of the device by running the software programs, instructions, and modules stored in the memory 420.

[0130] The memory 420 can include a program storage area and a data storage area, where the program storage area can store an operating system, application programs required by at least one function, and the data storage area can store data created according to the use of the terminal, etc. In addition, the memory 420 can include a high-speed random access memory, and can also include a nonvolatile memory, such as at least one magnetic disk storage device, flash memory device, or other nonvolatile solid-state memory device. In some examples, the memory 420 can further include a memory remotely disposed relative to the processor 410, which can be connected to the device through a network. Examples of the above network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.

[0131] The input device 430 can be used to receive input digital or character information, and to generate signal input related to the user settings and function control of the device. The output device 440 can include a display device such as a display screen.

[0132] Embodiment five

[0133] Embodiment five of the present application also provides a storage medium containing computer executable instructions, which when executed by a computer processor, are used to perform a task processing method, the method comprising: receiving an authorization request user initiated authorization task, writing task information corresponding to the authorization task to Redis, and adding the authorization task to a to-be-distributed task queue; by invoking a Lua script, reading the authorization task to be distributed in the to-be-distributed task queue, and according to the task distribution control parameters pre-flushed into Redis, determining the authorization audit user corresponding to the read authorization task; adding the authorization task to the to-be-pushed task queue corresponding to the authorization audit user, so that the authorization audit user reads the authorization task in the to-be-pushed task queue, and audits the task information corresponding to the read authorization task.

[0134] The computer storage medium of the embodiments of the present application can adopt any combination of one or more computer readable media. The computer readable medium can be a computer readable signal medium or a computer readable storage medium. The computer readable storage medium may, for example, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or apparatus, or any combination thereof. More specific examples (non-exhaustive list) of the computer readable storage medium include an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, the computer readable storage medium can be any tangible medium that contains or stores a program that can be used by or in connection with an instruction execution system, apparatus or device.

[0135] The computer readable signal medium can include a data signal propagated in baseband or propagated as a carrier wave in a propagated data signal, in which the computer readable program code is contained. Such propagated data signal can take a variety of forms, including but not limited to electro-magnetic, optical or any suitable combination thereof. The computer readable signal medium can also be any computer readable medium that is not a storage medium and that can communicate, propagate or transport program for use by or in connection with an instruction execution system, apparatus or device.

[0136] The program code contained on the computer readable medium can be transmitted using any suitable medium, including but not limited to wireless, wire line, optical fiber cable, RF, etc., or any suitable combination of the above.

[0137] The computer program code for carrying out operations of the embodiments of the present application can be written in one or more programming languages or combinations of languages including an object oriented programming language such as Java, Smalltalk, C++ or the like and conventional procedural programming languages such as "C" or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider). In an embodiment of the present application, the remote computer can be a server or another desktop computer.

[0138] Note that the above merely describes preferred embodiments of the present application and the principles of the technology applied. Those skilled in the art will understand that the present application is not limited to the specific embodiments described herein, and that various obvious changes, modifications and substitutions can be made without departing from the scope of the present application. Therefore, although the present application has been described in detail through the above embodiments, the present application is not limited to the above embodiments, and can include more other equivalent embodiments without departing from the concept of the present application, and the scope of the present application is determined by the scope of the claims.

Claims

1. A task processing method characterized by, The method comprises: receiving an authorization request initiated by a user, writing task information corresponding to the authorization task into Redis, and adding the authorization task into a to-be-distributed task queue; reading the authorization task to be distributed in the to-be-distributed task queue by invoking a Lua script, and determining an authorization audit user corresponding to the read authorization task according to a task distribution control parameter pre-flushed into Redis; adding the authorization task into a to-be-pushed task queue corresponding to the authorization audit user, so that the authorization audit user reads the authorization task in the to-be-pushed task queue and audits the task information corresponding to the read authorization task; The method further comprises: flushing the task distribution control parameter into Redis in the form of a control parameter set at a preset time point through a Spring scheduled task, wherein the control parameter set comprises at least one of a transaction distributable authorization center set, a branch task distributable authorization center set, a transaction distributable authorization audit user set, a branch task distributable authorization audit user set, an idle authorization audit user set, a priority authorization audit user set, a task distributable queue set, and a task pushable queue set; and the control parameter set is a set collection data type in Redis; The control parameter set is established based on at least one of the following ways: establishing the transaction distributable authorization center set in reverse by taking a specific transaction code in the business scope of an authorization center as a key and taking the identity information of the authorization center as a value; establishing the branch task distributable authorization center set in reverse by taking a management branch number in the regional scope of an authorization center as a key and taking the identity information of the authorization center as a value; establishing the transaction distributable authorization audit user set by taking a specific transaction code number in the business scope of an auditor as a key and taking the identity information of the authorization center and the identity information of the authorization audit user as values; establishing the branch task distributable authorization audit user set by taking a management branch number in the regional scope of an auditor as a key and taking the identity information of the authorization center and the identity information of the authorization audit user as values; establishing the idle authorization audit user set according to the work state identification information of the authorization audit user by taking the identity information of the authorization center in the business scope of an auditor as a key and taking the identity information of the authorization center and the identity information of the authorization audit user as values; establishing the priority authorization audit user set according to the priority information of the authorization audit user by taking the identity information of the authorization center in the business scope of an auditor as a key and taking the identity information of the authorization center and the identity information of the authorization audit user as values; establishing the task distributable queue set by taking regional information corresponding to the authorization task as a key and taking the identification information of the to-be-distributed task queue as a value; establishing the task pushable queue set by taking regional information corresponding to the authorization task as a key and taking the identification information of the to-be-pushed task queue as a value.

2. The method of claim 1, wherein, The determination of the authorization audit user corresponding to the read authorization task according to the task distribution control parameter pre-flushed into Redis comprises: obtaining an application network point number and a transaction code of the authorization task, and searching for a matching authorization center number in the set of network task distributable authorization centers and the set of transaction distributable authorization centers according to the application network point number and the transaction code; finding a matching authorization audit user in the intersection of the set of transaction distributable authorization audit users and the set of network task distributable authorization audit users according to the application network point number, the transaction code, and the matching authorization center number; finding a matching idle authorization audit user in the set of idle authorization audit users according to the matching authorization center number and the matching authorization audit user; determining an authorization audit user corresponding to the read authorization task according to the idle authorization audit user.

3. The method of claim 2, wherein, The method further includes: if the found idle authorization audit user is two or more, selecting an idle authorization audit user with the highest priority in the set of priority authorization audit users as the authorization audit user corresponding to the read authorization task according to the idle authorization audit user.

4. The method of claim 1, wherein, The method further includes: if no authorization audit user corresponding to the read authorization task is determined, increasing the processing priority of the authorization task, and re-adding the authorization task to the to-be-distributed queue according to the processing priority.

5. The method of claim 4, wherein, The method further includes: if the cumulative number of times that no authorization audit user corresponding to the read authorization task is determined reaches a preset number threshold in the presence of idle authorization audit users, generating a fault prompt message.

6. A task processing apparatus characterized by comprising: The method further includes: an authorization task receiving module configured to receive an authorization task initiated by an authorization request user, write task information corresponding to the authorization task into Redis, and add the authorization task to a to-be-distributed task queue; an authorization audit user determining module configured to read an authorization task to be distributed in the to-be-distributed task queue by invoking a Lua script, and determine an authorization audit user corresponding to the read authorization task according to task distribution control parameters pre-flushed into Redis; an authorization task pushing module configured to add the authorization task to a to-be-pushed task queue corresponding to the authorization audit user, so that the authorization audit user reads an authorization task in the to-be-pushed task queue and audits task information corresponding to the read authorization task. The task processing device further includes: a task distribution control parameter flushing module configured to flush task distribution control parameters in the form of a control parameter set into Redis at a preset time point through a Spring scheduled task, wherein the control parameter set includes at least one of a set of transaction distributable authorization centers, a set of network task distributable authorization centers, a set of transaction distributable authorization audit users, a set of network task distributable authorization audit users, a set of idle authorization audit users, a set of priority authorization audit users, a set of to-be-distributed queues, and a set of to-be-pushed queues; and the control parameter set is a set collection data type in Redis. The control parameter set is established based on at least one of the following manners: A transaction code in the business scope of the authorization center is taken as a key, and identity information of the authorization center is taken as a value, to reversely establish a transaction distributable authorization center set; A management point number in the regional scope of the authorization center is taken as a key, and identity information of the authorization center is taken as a value, to reversely establish a point task distributable authorization center set; A specific transaction code number in the business scope of the auditor is taken as a key, and identity information of the authorization center and identity information of the authorized audit user are taken as values, to establish a transaction distributable authorized audit user set; A management point number in the regional scope of the auditor is taken as a key, and identity information of the authorization center and identity information of the authorized audit user are taken as values, to establish a point task distributable authorized audit user set; Identity information of the authorization center in the business scope of the auditor is taken as a key, and identity information of the authorization center and identity information of the authorized audit user are taken as values, to establish an idle authorized audit user set according to work state identification information of the authorized audit user; Identity information of the authorization center in the business scope of the auditor is taken as a key, and identity information of the authorization center and identity information of the authorized audit user are taken as values, to establish a priority authorized audit user set according to priority information of the authorized audit user; Regional information corresponding to the authorization task is taken as a key, and identification information of a task queue to be distributed is taken as a value, to establish a task distributable queue set; Regional information corresponding to the authorization task is taken as a key, and identification information of a task queue to be pushed is taken as a value, to establish a task pushable queue set.

7. An electronic device, comprising: The electronic device includes: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the task processing method of any one of claims 1-5.

8. A computer-readable storage medium having stored thereon a computer program, characterized in that, The program is executed by the processor to implement the task processing method of any one of claims 1-5.

Citation Information

Patent Citations

  • Task distribution method and device, electronic equipment and storage medium

    CN112184050A

  • Task allocation method and device

    CN113159628A

  • Auditing task distribution method and device, equipment and storage medium

    CN114066335A