Task processing method and device, equipment, medium and product

By combining task priority in the business system and using server clusters to process tasks in parallel, the problem of increasing task allocation difficulty is solved and the task execution efficiency is improved.

CN119806819APending Publication Date: 2025-04-11INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411858812.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-17
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

In the business system, as the number of tasks increases, the difficulty of task allocation also increases, especially when different tasks have different requirements for efficiency, how to combine task priority and improve task execution efficiency has become an urgent problem.

Method used

By detecting that the cluster server receives the target task message in the task receiving layer, the task information, priority and identification number are determined, the task information table is generated and stored in a relational database; in the task scheduling layer, based on the exclusive lock mechanism of the database, the target server is assigned tasks, updated the task information table, and the task execution table is obtained; the task identification number is placed in the message queue to control the execution server to execute tasks.

Benefits of technology

By combining task priority and using server clusters to process tasks in parallel, the task execution efficiency is effectively improved and high-priority tasks are processed in a timely manner.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119806819A_ABST
    Figure CN119806819A_ABST
Patent Text Reader

Abstract

The invention discloses a task processing method and device, equipment, a medium and a product. Relates to the field of financial technology and computer technology, and comprises the following steps: when it is detected that a cluster server in a task receiving layer receives a target task message, determining associated target task information, task priority and task identification number in the target task message to generate a task information table, and storing the task information table in a target relational database; when a task query request sent by a target server in the task scheduling layer is detected, allocating tasks for the target server based on an exclusive lock mechanism of the target relational database to update the task information table to obtain a task execution table; and sequentially putting the task identification numbers corresponding to the target tasks in the task execution table into a target message queue, and controlling an execution server to execute the tasks when it is detected that the execution server in the task execution layer obtains the task execution identification number. The task execution efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of financial technology and computer technology, and in particular to a task processing method, device, equipment, medium and product. Background Art

[0002] With the continuous development of financial technology and computer technology, business systems often face a large number of tasks to be processed, especially for banking business systems. When a large number of tasks to be processed are poured in, on the one hand, the amount of tasks increases, and on the other hand, due to the different priorities of different tasks, the difficulty of task allocation also increases. That is, when tasks of different time requirements exist and accumulate, resources must be prioritized to meet high-priority tasks.

[0003] In summary, how to combine task priorities and use server clusters to receive, allocate and execute tasks in parallel to improve task execution efficiency is a problem that needs to be solved urgently. Summary of the invention

[0004] The present invention provides a task processing method, device, equipment, medium and product, which combine task priorities and utilize server clusters to receive, distribute and execute tasks in parallel, thereby improving the execution efficiency of tasks.

[0005] According to one aspect of the present invention, there is provided a task processing method, comprising:

[0006] When it is detected that the cluster server in the task receiving layer receives the target task message, the target task information, task priority and task identification number associated with the target task message are determined to generate a task information table and store it in the target relational database;

[0007] When a task query request sent by a target server in the task scheduling layer is detected, a task is assigned to the target server based on the exclusive lock mechanism of the target relational database to update the task information table and obtain a task execution table;

[0008] The task identification numbers corresponding to the target tasks in the task execution table are sequentially placed into the target message queue, and when it is detected that the execution server in the task execution layer obtains the execution task identification number, the execution server is controlled to execute the task.

[0009] According to another aspect of the present invention, there is provided a task processing device, comprising:

[0010] A storage module is used to determine the target task information, task priority and task identification number associated with the target task message when detecting that the cluster server in the task receiving layer receives the target task message, so as to generate a task information table and store it in the target relational database;

[0011] The allocation module is used to allocate tasks to the target server based on the exclusive lock mechanism of the target relational database when detecting the task query request sent by the target server in the task scheduling layer, so as to update the task information table and obtain the task execution table;

[0012] The execution module is used to put the task identification number corresponding to each target task in the task execution table into the target message queue in sequence, and when it is detected that the execution server in the task execution layer obtains the execution task identification number, control the execution server to execute the task.

[0013] According to another aspect of the present invention, there is provided an electronic device, the electronic device comprising:

[0014] at least one processor; and

[0015] a memory communicatively connected to the at least one processor; wherein,

[0016] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the task processing method described in any embodiment of the present invention.

[0017] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the task processing method described in any embodiment of the present invention when executed.

[0018] According to another aspect of the present invention, a computer program product is provided. The computer program product includes a computer program. When the computer program is executed by a processor, the task processing method of any embodiment of the present invention is implemented.

[0019] The technical solution of the embodiment of the present invention, when it is detected that the cluster server in the task receiving layer receives the target task message, the target task information, task priority and task identification number associated in the target task message are determined to generate a task information table and store it in the target relational database; when it is detected that the task query request sent by the target server in the task scheduling layer is sent, based on the exclusive lock mechanism of the target relational database, tasks are assigned to the target server to update the task information table and obtain a task execution table; the task identification numbers corresponding to each target task in the task execution table are sequentially placed in the target message queue, and when it is detected that the execution server in the task execution layer obtains the execution task identification number, the execution server is controlled to execute the task. By combining the task priority and using the server cluster to receive, assign and execute tasks in parallel, the execution efficiency of the task can be effectively improved.

[0020] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0022] Figure 1 is a flowchart of a task processing method provided by Embodiment 1 of the present invention;

[0023] Figure 2 is a flowchart of a task processing method provided by Embodiment 2 of the present invention;

[0024] Figure 3 is a structural block diagram of a task processing device provided by Embodiment 3 of the present invention;

[0025] Figure 4 It is a schematic diagram of the structure of an electronic device provided in Embodiment 4 of the present invention. DETAILED DESCRIPTION

[0026] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0027] It should be noted that the terms "first", "second", "target", "candidate", "alternative", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices. The acquisition, storage, use, processing, etc. of data in the technical solution of this application comply with the relevant provisions of national laws and regulations.

[0028] Embodiment 1

[0029] Figure 1 is a flowchart of a task processing method provided in the first embodiment of the present invention; this embodiment is applicable to the situation where a task management system configured with a relational database realizes batch reception, allocation and execution of tasks through a task receiving layer, a task scheduling layer and a task execution layer. The method can be executed by a task processing device, which can be implemented in the form of hardware and / or software. The task processing device can be configured in an electronic device, such as a task management system, wherein the task management system can be a business system of a bank, a relational database is configured in the task management system, and the task management system includes a task receiving layer, a task scheduling layer and a task execution layer, such as Figure 1 As shown, the task processing method includes:

[0030] S101. When detecting that a cluster server in a task receiving layer receives a target task message, determine the target task information, task priority and task identification number associated with the target task message to generate a task information table and store it in a target relational database.

[0031] Among them, the task receiving layer can be associated with at least two cluster servers, and the cluster servers in the task receiving layer can receive tasks respectively in a distributed deployment manner. The target task message refers to the task message of the target task received by the cluster server. The target task information includes at least one of the following: task name, task type and task content. Task priority refers to the level that can characterize the priority processing of different tasks. The task priority can be the first priority, the second priority or the third priority, and the priority of the first priority, the second priority and the third priority decreases step by step. The task identification number refers to the identification number that can uniquely identify the target task. The task information table refers to the information table of the target task information, task priority and task identification number corresponding to each target task received by each cluster server. The target relational database refers to a database configured in the task management system for storing task information tables corresponding to different target tasks.

[0032] Optionally, before detecting that the cluster servers in the task receiving layer have received the target task message, it also includes: determining the task receiving strategy corresponding to each cluster server; according to the task receiving strategy, controlling each cluster server in the task receiving layer to call the corresponding task interface to receive the target task message.

[0033] The task receiving strategy refers to the strategy that characterizes the way each cluster server receives tasks. The task receiving method refers to the way to receive tasks through the corresponding task interface. Different cluster servers may have different task receiving methods, that is, different cluster servers may receive tasks based on the corresponding task interface. The time when different cluster servers receive tasks may be the same or different.

[0034] The task interface includes at least one of the following: a transmission protocol interface, a microservice interface, and a message queue interface. The transmission protocol interface may be, for example, an Http (Hyper Text Transfer Protocol) interface, the microservice interface may be, for example, an RPC (Remote Procedure Call) interface, and the message queue interface may be, for example, a Kafka message queue or a distributed message queue interface.

[0035] Optionally, the task receiving strategy corresponding to each cluster server can be determined based on the server type of the cluster server and the correspondence between the preset server type and the task receiving strategy, and the task interface in the task receiving strategy can be determined to control the corresponding cluster server to call the corresponding task interface to receive the target task message.

[0036] It should be noted that the above embodiment of the present invention is based on the task receiving strategy. By controlling different servers to call different task interfaces to receive tasks, the richness of the task receiving methods can be improved, which helps to more comprehensively collect tasks involved in all cluster servers.

[0037] Optionally, when receiving a task message received by at least one cluster server in the task receiving layer, the task management system may determine the task message received by the at least one cluster server as a target task message.

[0038] Optionally, the target task information, task priority and task identification number associated in the target task message are determined to generate a task information table and store it in the target relational database, including: parsing the target task message to obtain the target task information associated in the target task message; determining the task priority corresponding to the target task information and determining the task identification number corresponding to the target task message based on the target task information and a preset task priority allocation strategy; generating a task information table based on the task identification number, the target task information and the task priority and storing it in the target relational database.

[0039] The target task information includes at least one of the following: task name, task type, and task content. The task priority allocation strategy may be a preset strategy for allocating corresponding priority levels to tasks of different types.

[0040] Optionally, the task identification number corresponding to the target task message may be a primary key of a relational database, and specifically may be generated based on a UUID (Universally Unique Identifier), a database auto-increment number, or a snowflake algorithm.

[0041] It should be noted that the present invention determines the corresponding priority of the task through the target task information, and further generates an information table based on the identification number and task information and stores it in the database. This can fully consider the priority of the task and help to ensure the rationality of subsequent task allocation. In addition, by storing the database in the information table, it also helps to call the task allocation layer and the execution layer, thereby improving the task processing efficiency.

[0042] Optionally, based on the target task information and in combination with a preset task priority allocation strategy, the task priority corresponding to the target task information is determined, including: based on the target task information and in combination with a preset task priority allocation strategy, if the task name is SMS sending and the task type is verification code SMS, then the task priority is determined to be the first priority; if the task name is SMS sending and the task type is reminder SMS, then the task priority is determined to be the second priority; if the task name is SMS sending and the task type is marketing campaign SMS, then the task priority is determined to be the third priority.

[0043] Among them, when the task name is SMS sending, the corresponding task type can be verification code SMS, reminder SMS or marketing activity SMS. The priority of the first priority, the second priority and the third priority decreases step by step.

[0044] Optionally, the task name in the target task information can be matched in a preset task priority allocation strategy to determine the priority information corresponding to different task types under the task name, and further, the task priority corresponding to the task can be determined based on the task type in the target task information.

[0045] It should be noted that the above embodiment of the present invention can better measure the task priority by considering the general priority of sending different types of SMS when the task name is SMS sending, and assigning corresponding priorities to them, thereby completing the task more effectively.

[0046] S102: When a task query request sent by a target server in the task scheduling layer is detected, a task is assigned to the target server based on an exclusive lock mechanism of the target relational database to update the task information table to obtain a task execution table.

[0047] Among them, at least one target server can be associated with the task scheduling layer, and each target server can also be deployed based on a distributed strategy. The target server and the cluster server can be the same or different. The task query request refers to a request from the target server to the task management system to obtain the task information table storing the tasks to be executed in the target relational database.

[0048] The exclusive lock mechanism refers to the lock mechanism that comes with the target relational database. Through the exclusive lock mechanism, when any target server requests the task information table of some tasks in the target relational database, other servers cannot obtain the task information table of this part of the task, that is, the data will be temporarily locked. In other words, the exclusive lock mechanism can ensure that the data obtained by each target server is not repeated.

[0049] The preset fields (such as the tag field) in the task execution table store the server ID of the target server to which the task is assigned. The number of task execution tables and task information tables can be different. The candidate tasks and task information tables in the target relational data correspond one to one. For example, if there are 500 candidate tasks and 500 corresponding task information tables, and target server a has pulled 100 and is sorting them by priority, then target server b can pull another 100 from the remaining 400 without affecting each other.

[0050] Optionally, the task status of each storage task in the target relational database can be monitored. If a storage task has been assigned to a server but has not been processed within a preset time period, it can be determined that the assigned server has crashed and the part can be reallocated. That is, when it is detected that a target server requests a task information table, the part of the task is allocated to the corresponding target server.

[0051] Optionally, after storing the new task information table in the target relational database, the task management system may control each target server in the task scheduling layer to request tasks from the target relational database, so as to allocate tasks based on an exclusive lock mechanism.

[0052] For example, each target server can prioritize the data in the target relational database and query 100 tasks whose preset fields are empty (i.e., not claimed) by using the select * from task_info where tag is null order by priority desc limit 100 for update syntax. When executing the select for update syntax, the database will add an exclusive lock to the database table, thereby implementing an exclusive lock mechanism.

[0053] Optionally, tasks are assigned to the target server to update the task information table to obtain a task execution table, including: prioritizing the candidate tasks according to the task priority of each candidate task in the target relational database; determining a preset number of candidate tasks from the candidate tasks after priority sorting as target tasks corresponding to the target server; and updating the task information table in the target relational database according to the server identifier of the target server to obtain a task execution table.

[0054] The candidate tasks refer to the tasks stored in the target relational database, the candidate tasks correspond to the task information table one by one, and the target tasks refer to the candidate tasks assigned by the server. The target tasks correspond to the task execution table one by one. The preset number can be 100, for example.

[0055] Optionally, a preset field may be added to the task information table corresponding to the target task to store the server identifier of the target server, thereby completing the update of the task information table corresponding to the target task and obtaining the task execution table.

[0056] For example, after querying 100 target tasks, the target server can update the task information table of these 100 tasks, and update the local IP (Internet Protocol) (if it is a containerized deployment, use the container ID (Identity Document)), that is, the server ID, to the tag field (that is, the preset field) in the task information table, indicating that the local machine has preempted this task.

[0057] It should be noted that the above-mentioned embodiment of the present invention allocates target tasks to the target server from the candidate tasks according to priority and preset number, and updates the task information table according to the server identifier, which can achieve more effective and reasonable task allocation, allocate the best tasks to each server, and maximize efficiency.

[0058] S103: Put the task identification number corresponding to each target task in the task execution table into the target message queue in sequence, and when detecting that the execution server in the task execution layer obtains the execution task identification number, control the execution server to execute the task.

[0059] Among them, the target message queue may store the task identification number corresponding to each target task in sequence. The execution server refers to the server deployed in the task execution layer for executing tasks. The execution server may specifically execute tasks by calling an interface. The task execution table may include a server identification, target task information, and a task identification number. The execution server may be deployed based on a distributed strategy, and the execution server may be a server cluster.

[0060] Optionally, the target tasks corresponding to each task execution table are all tasks to be executed, which can be added to the target message queue in sequence to instruct the task execution layer to extract tasks from the target message queue in sequence and call the corresponding execution server to execute the tasks.

[0061] Optionally, when it is detected that an execution server in the task execution layer requests a task from a target message queue, the execution server is controlled to execute the task, including: controlling each execution server in the task execution layer to obtain a task identification number from a target message queue of a relational database; if it is detected that the execution server in the task execution layer obtains an execution task identification number, then according to the execution task identification number, determining a corresponding task execution table from the target relational database; according to the task execution table, in combination with a calling interface corresponding to the execution server, controlling the execution server to execute the task.

[0062] Exemplarily, each execution server in the task execution layer can continuously and cyclically pull the task identification number from the target message queue (if it cannot be pulled, it will wait for a certain period of time before pulling again), query the task details from the task execution table according to the task identification number (task_id) in each message, and then call the task executor to execute the task according to the task executor information (such as a microservice interface), that is, the calling interface corresponding to the execution server.

[0063] It should be noted that the above-mentioned embodiment of the present invention enables each execution server to receive tasks in turn through the target message queue, and obtains execution information in the task execution table according to the task identification number, which can realize efficient collection and execution of tasks and ensure the independence and effectiveness of each task executor in receiving and executing tasks.

[0064] The technical solution of the embodiment of the present invention, when it is detected that the cluster server in the task receiving layer receives the target task message, the target task information, task priority and task identification number associated in the target task message are determined to generate a task information table and store it in the target relational database; when it is detected that the task query request sent by the target server in the task scheduling layer is sent, based on the exclusive lock mechanism of the target relational database, tasks are assigned to the target server to update the task information table and obtain a task execution table; the task identification numbers corresponding to each target task in the task execution table are sequentially placed in the target message queue, and when it is detected that the execution server in the task execution layer obtains the execution task identification number, the execution server is controlled to execute the task. By combining the task priority and using the server cluster to receive, assign and execute tasks in parallel, the execution efficiency of the task can be effectively improved.

[0065] Embodiment 2

[0066] Figure 2 is a flowchart of a task processing method provided in Embodiment 2 of the present invention; based on the above embodiments, this embodiment provides a preferred example of combining a task receiving layer, a task scheduling layer and a task execution layer to perform task processing, specifically, Figure 2 As shown, the method includes:

[0067] S201, determining the task receiving strategy corresponding to each cluster server, and according to the task receiving strategy, controlling each cluster server in the task receiving layer to call the corresponding task interface to receive the target task message.

[0068] S202: When it is detected that the cluster server in the task receiving layer receives the target task message, the target task message is parsed to obtain target task information associated with the target task message.

[0069] S203: According to the target task information and in combination with a preset task priority allocation strategy, determine the task priority corresponding to the target task information, and determine the task identification number corresponding to the target task message.

[0070] S204: Generate a task information table based on the task identification number, target task information and task priority, and store it in the target relational database.

[0071] S205 , when a task query request sent by a target server in the task scheduling layer is detected, based on an exclusive lock mechanism of the target relational database and according to the task priority of each candidate task in the target relational database, the candidate tasks are prioritized.

[0072] S206: Determine a preset number of candidate tasks from the candidate tasks after priority sorting as target tasks corresponding to the target server.

[0073] S207: Update the task information table in the target relational database according to the server identifier of the target server to obtain a task execution table.

[0074] S208: Put the task identification number corresponding to each target task in the task execution table into the target message queue in sequence, and control each execution server in the task execution layer to obtain the task identification number from the target message queue of the relational database.

[0075] S209: If it is detected that the execution server in the task execution layer obtains the execution task identification number, then the corresponding task execution table is determined from the target relational database according to the execution task identification number.

[0076] S210. According to the task execution table and in combination with the calling interface corresponding to the execution server, control the execution server to execute the task.

[0077] Embodiment 3

[0078] Figure 3 It is a structural block diagram of a task processing device provided in the third embodiment of the present invention; this embodiment can be applied to the situation where a task management system configured with a relational database realizes batch reception, allocation and execution of tasks through a task receiving layer, a task scheduling layer and a task execution layer. The task processing device provided in the embodiment of the present invention can execute the task processing method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method; the task processing device can be implemented in the form of hardware and / or software, and configured in an electronic device with a task processing function, such as a task management system, wherein the task management system can be a business system of a bank, a relational database is configured in the task management system, and the task management system includes a task receiving layer, a task scheduling layer and a task execution layer, such as Figure 3As shown, the task processing device specifically includes:

[0079] The storage module 301 is used to determine the target task information, task priority and task identification number associated with the target task message when detecting that the cluster server in the task receiving layer receives the target task message, so as to generate a task information table and store it in the target relational database;

[0080] The allocation module 302 is used to allocate tasks to the target server based on the exclusive lock mechanism of the target relational database when detecting a task query request sent by the target server in the task scheduling layer, so as to update the task information table and obtain a task execution table;

[0081] The execution module 303 is used to put the task identification number corresponding to each target task in the task execution table into the target message queue in sequence, and when it is detected that the execution server in the task execution layer obtains the execution task identification number, control the execution server to execute the task.

[0082] The technical solution of the embodiment of the present invention, when it is detected that the cluster server in the task receiving layer receives the target task message, the target task information, task priority and task identification number associated in the target task message are determined to generate a task information table and store it in the target relational database; when it is detected that the task query request sent by the target server in the task scheduling layer is sent, based on the exclusive lock mechanism of the target relational database, tasks are assigned to the target server to update the task information table and obtain a task execution table; the task identification numbers corresponding to each target task in the task execution table are sequentially placed in the target message queue, and when it is detected that the execution server in the task execution layer obtains the execution task identification number, the execution server is controlled to execute the task. By combining the task priority and using the server cluster to receive, assign and execute tasks in parallel, the execution efficiency of the task can be effectively improved.

[0083] Furthermore, the storage module 301 may include:

[0084] A parsing unit, used to parse the target task message to obtain target task information associated with the target task message;

[0085] The allocation unit is used to determine the task priority corresponding to the target task information and determine the task identification number corresponding to the target task message according to the target task information and in combination with a preset task priority allocation strategy;

[0086] The storage unit is used to generate a task information table according to the task identification number, target task information and task priority, and store it in the target relational database.

[0087] Furthermore, the allocation unit is specifically used for:

[0088] According to the target task information and the preset task priority allocation strategy, if the task name is SMS sending and the task type is verification code SMS, the task priority is determined to be the first priority;

[0089] If the task name is SMS sending and the task type is SMS reminder, the task priority is determined to be the second priority;

[0090] If the task name is SMS sending and the task type is marketing campaign SMS, the task priority is determined to be the third priority.

[0091] Furthermore, the above device is also used for:

[0092] Determine the task receiving strategy corresponding to each cluster server;

[0093] According to the task receiving strategy, each cluster server in the task receiving layer is controlled to call the corresponding task interface to receive the target task message; the task interface includes at least one of the following: a transmission protocol interface, a microservice interface and a message queue interface.

[0094] Furthermore, the allocation module 302 is specifically used for:

[0095] Prioritize the candidate tasks according to the task priorities of the candidate tasks in the target relational database;

[0096] Determining a preset number of candidate tasks from the candidate tasks after priority sorting as target tasks corresponding to the target server;

[0097] According to the server identifier of the target server, the task information table in the target relational database is updated to obtain the task execution table.

[0098] Furthermore, the execution module 303 is specifically used for:

[0099] Each execution server in the control task execution layer obtains the task identification number from the target message queue of the relational database;

[0100] If it is detected that the execution server in the task execution layer obtains the execution task identification number, then the corresponding task execution table is determined from the target relational database according to the execution task identification number;

[0101] According to the task execution table, combined with the call interface corresponding to the execution server, control the execution server to execute the task.

[0102] Embodiment 4

[0103] Figure 4 It is a schematic diagram of the structure of an electronic device provided in Embodiment 4 of the present invention. Figure 4A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0104] like Figure 4 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0105] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0106] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 performs the various methods and processes described above, such as a task processing method.

[0107] In some embodiments, the task processing method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the task processing method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the task processing method in any other appropriate manner (e.g., by means of firmware).

[0108] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0109] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0110] In the context of the present invention, a computer readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device, or equipment. A computer readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. Alternatively, a computer readable storage medium may be a machine readable signal medium. A more specific example of a machine readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0111] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0112] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0113] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0114] In one embodiment, the embodiment of the present invention further includes a computer program product, the computer program product includes a computer program, and the computer program implements the task processing method of any embodiment of the present invention when executed by a processor.

[0115] In the process of implementation, the computer program product can be written in one or more programming languages ​​or a combination thereof to perform the computer program code of the present invention, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, 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 can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).

[0116] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0117] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A task processing method, characterized in that: include: When it is detected that the cluster server in the task receiving layer receives the target task message, the target task information, task priority and task identification number associated with the target task message are determined to generate a task information table and store it in the target relational database; When a task query request sent by a target server in the task scheduling layer is detected, a task is assigned to the target server based on the exclusive lock mechanism of the target relational database to update the task information table and obtain a task execution table; The task identification numbers corresponding to the target tasks in the task execution table are sequentially placed into the target message queue, and when it is detected that the execution server in the task execution layer obtains the execution task identification number, the execution server is controlled to execute the task.

2. The method according to claim 1, characterized in that Determine the target task information, task priority and task identification number associated with the target task message to generate a task information table and store it in the target relational database, including: Parse the target task message to obtain the target task information associated with the target task message; According to the target task information, combined with the preset task priority allocation strategy, determine the task priority corresponding to the target task information, and determine the task identification number corresponding to the target task message; According to the task identification number, target task information and task priority, a task information table is generated and stored in the target relational database.

3. The method according to claim 2, characterized in that According to the target task information and the preset task priority allocation strategy, the task priority corresponding to the target task information is determined, including: According to the target task information and the preset task priority allocation strategy, if the task name is SMS sending and the task type is verification code SMS, the task priority is determined to be the first priority; If the task name is SMS sending and the task type is SMS reminder, the task priority is determined to be the second priority; If the task name is SMS sending and the task type is marketing campaign SMS, the task priority is determined to be the third priority.

4. The method according to claim 1, characterized in that: Before detecting that the cluster server in the task receiving layer receives the target task message, the process also includes: Determine the task receiving strategy corresponding to each cluster server; According to the task receiving strategy, each cluster server in the task receiving layer is controlled to call the corresponding task interface to receive the target task message; the task interface includes at least one of the following: a transmission protocol interface, a microservice interface and a message queue interface.

5. The method according to claim 1, characterized in that Assign tasks to the target server to update the task information table and obtain the task execution table, including: Prioritize the candidate tasks according to the task priorities of the candidate tasks in the target relational database; Determining a preset number of candidate tasks from the candidate tasks after priority sorting as target tasks corresponding to the target server; According to the server identifier of the target server, the task information table in the target relational database is updated to obtain the task execution table.

6. The method according to claim 1, characterized in that When it is detected that the execution server in the task execution layer requests a task from the target message queue, the execution server is controlled to execute the task, including: Each execution server in the control task execution layer obtains the task identification number from the target message queue of the relational database; If it is detected that the execution server in the task execution layer obtains the execution task identification number, then the corresponding task execution table is determined from the target relational database according to the execution task identification number; According to the task execution table, combined with the call interface corresponding to the execution server, control the execution server to execute the task.

7. A task processing device, characterized in that: include: A storage module is used to determine the target task information, task priority and task identification number associated with the target task message when detecting that the cluster server in the task receiving layer receives the target task message, so as to generate a task information table and store it in the target relational database; The allocation module is used to allocate tasks to the target server based on the exclusive lock mechanism of the target relational database when detecting the task query request sent by the target server in the task scheduling layer, so as to update the task information table and obtain the task execution table; The execution module is used to put the task identification number corresponding to each target task in the task execution table into the target message queue in sequence, and when it is detected that the execution server in the task execution layer obtains the execution task identification number, control the execution server to execute the task.

8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the task processing method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the task processing method according to any one of claims 1 to 6 when executed.

10. A computer program product, characterized in that The computer program product comprises a computer program, which, when executed by a processor, implements the task processing method according to any one of claims 1 to 6.