CN111722914A - Timed task distribution method, timed task distribution system, computer equipment and storage medium - Google Patents

Timed task distribution method, timed task distribution system, computer equipment and storage medium Download PDF

Info

Publication number
CN111722914A
CN111722914A CN202010536838.8A CN202010536838A CN111722914A CN 111722914 A CN111722914 A CN 111722914A CN 202010536838 A CN202010536838 A CN 202010536838A CN 111722914 A CN111722914 A CN 111722914A
Authority
CN
China
Prior art keywords
message
timing task
task
timing
service data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010536838.8A
Other languages
Chinese (zh)
Other versions
CN111722914B (en
Inventor
湛友
闵建仁
张德华
仲崇光
黄进
周祎生
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jiangsu Suning Bank Co Ltd
Original Assignee
Jiangsu Suning Bank Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jiangsu Suning Bank Co Ltd filed Critical Jiangsu Suning Bank Co Ltd
Priority to CN202010536838.8A priority Critical patent/CN111722914B/en
Publication of CN111722914A publication Critical patent/CN111722914A/en
Application granted granted Critical
Publication of CN111722914B publication Critical patent/CN111722914B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/485Task life-cycle, e.g. stopping, restarting, resuming execution
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/03Credit; Loans; Processing thereof

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • General Engineering & Computer Science (AREA)
  • Development Economics (AREA)
  • General Business, Economics & Management (AREA)
  • Technology Law (AREA)
  • Strategic Management (AREA)
  • Marketing (AREA)
  • Economics (AREA)
  • Debugging And Monitoring (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

The invention provides a timing task distribution method, a system, computer equipment and a storage medium, wherein the method is applied to a timing processing subsystem and comprises the following steps: acquiring timing task data, generating an mq message and sending the mq message to an mq message queue; monitoring the mq message queue to obtain the mq message; establishing a timing task according to the mq message, and storing the timing task into a timing task table; creating a thread pool, running a timing task at regular time and acquiring verification data; inquiring the timing task table to obtain service data; and performing checking operation according to the checking data and the service data. The invention puts timing tasks related to the loan process into a timing task system, sets corresponding parameters for each type of timing task, processes the timing scene task for 24 hours, then carries out subsequent process treatment, can reduce the pressure of a loan service processing server, and is easy to maintain and develop.

Description

Timed task distribution method, timed task distribution system, computer equipment and storage medium
Technical Field
The invention relates to the technical field of computers, in particular to a timed task distribution method, a timed task distribution system, computer equipment and a storage medium.
Background
With the diversified development of bank loan services, loan channels and loan processes related to the loan services are more and more, in many service processing processes, messages are returned in real time or in a short time, for example, the situations of paying, repayment, short message sending and the like are met, but due to the influence of problems of system environment, network and the like, the services of paying, repayment, short message sending and the like cannot return the messages in time or return the messages abnormally, and the results need to be checked at regular time at this time, so that subsequent operations are further performed.
Many loan businesses at present may include a plurality of products, each product has its own flow business, and for the business needing timing verification, its own corresponding timing task and subsequent processing are added. Therefore, not only can the codes have a large amount of redundancy, but also the problems of follow-up code maintenance, timing function modification and optimization are very large, and the problems are easily caused by the modification of a plurality of positions of the same codes. And additionally rewriting a processing flow of a timing task for the subsequent newly added products and functions.
Disclosure of Invention
In view of the above problems, the present invention provides a timed task distribution method, system, computer device and storage medium, which puts all timed tasks involved in a loan process into a timed task system, sets corresponding parameters for each type of timed task, processes timed scene tasks for 24 hours, and then performs subsequent process processing, and at the same time, can reduce the pressure of a loan transaction processing server, and is easy to maintain and develop.
In order to solve the technical problems, the invention adopts the technical scheme that: a timing task distribution method is applied to a timing task subsystem and comprises the following steps: acquiring timing task data, generating an mq message and sending the mq message to an mq message queue; monitoring the mq message queue to obtain the mq message; establishing a timing task according to the mq message, and storing the timing task into a timing task table; creating a thread pool, running a timing task at regular time and acquiring verification data; inquiring the timing task table to obtain service data; and performing checking operation according to the checking data and the service data.
As a preferred scheme, the acquiring timing task data and generating an mq message specifically includes: acquiring service data, serializing the service data, and adding a message queue name to generate an mq message; correspondingly, the creating a timing task according to the mq message specifically includes: and deserializing the mq message, acquiring service data and the current machine name, and creating a timing task according to the service data and the current machine name.
As a preferred scheme, the acquiring the mq message specifically is acquiring the mq message according to the message queue name.
As an optimal scheme, the timing tasks are divided into a credit granting flow timing task, a payment release flow timing task, a payment flow timing task and a background management timing task according to types and are respectively configured correspondingly.
Preferably, the configuration includes log configuration, system information configuration, frame-related configuration, message queue configuration and short message configuration.
As a preferred scheme, the service data includes a service serial number, a service type, and error information.
The invention also discloses a timing task distribution system, which comprises: the mq message generating module is used for acquiring the timing task data, generating an mq message and sending the mq message to an mq message queue; a message queue monitoring module, configured to monitor the mq message queue to obtain the mq message; a timing task creating module, configured to create a timing task according to the mq message, and store the timing task in a timing task table; the timing task running module is used for creating a thread pool, running the timing task at regular time and acquiring verification data; the timing task query module is used for querying the timing task table and acquiring service data; and the checking module is used for carrying out checking operation according to the checking data and the service data.
As a preferred scheme, the mq message generating module comprises a serialization module, wherein the serialization module is used for acquiring service data, serializing the service data, and adding a message queue name to generate an mq message; correspondingly, the timing task creating module comprises an deserializing module, and the deserializing module is used for deserializing the mq message, acquiring service data and the current machine name and creating the timing task according to the service data and the current machine name.
The invention also discloses computer equipment which comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, wherein the processor realizes the timing task distribution method when executing the computer program.
The invention also discloses a storage medium storing a computer program for executing the timed task distribution method.
Compared with the prior art, the invention has the beneficial effects that: sending a message queue to a timed task system according to scenes needing timed tasks in the loan process, customizing and processing the timed tasks according to different types, sharing a set of codes for the subsequent process processing of the same type or data operation and verification operation of the same logic, and being easy to maintain and develop; subsequent newly-added timing tasks do not need to increase various configurations and repeated codes, so that development tasks are greatly simplified, and the error rate is reduced; for the business system, the problem of timing task verification is not needed to be concerned, the code redundancy and development of the business system are reduced, and the pressure of the loan business system can be relieved.
Drawings
The disclosure of the present invention is illustrated with reference to the accompanying drawings. It is to be understood that the drawings are designed solely for the purposes of illustration and not as a definition of the limits of the invention. In the drawings, like reference numerals are used to refer to like parts. Wherein:
fig. 1 is a schematic flow chart of a timed task distribution method according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of generating an mq message after serializing service data according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of deserializing acquiring service data according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a timed task distribution system according to an embodiment of the present invention.
Detailed Description
It is easily understood that according to the technical solution of the present invention, a person skilled in the art can propose various alternative structures and implementation ways without changing the spirit of the present invention. Therefore, the following detailed description and the accompanying drawings are merely illustrative of the technical aspects of the present invention, and should not be construed as all of the present invention or as limitations or limitations on the technical aspects of the present invention.
An embodiment according to the present invention is shown in connection with fig. 1. A timing task distribution method is applied to a timing task subsystem and comprises the following steps:
s110: and acquiring timing task data, generating an mq message and sending the mq message to an mq message queue.
Acquiring timing task data and generating an mq message, wherein the method specifically comprises the following steps: and acquiring service data, wherein the service data comprises a service serial number, a service type and error information. And after serializing the service data, adding a message queue name to generate an mq message.
S120: and monitoring the mq message queue to obtain the mq message. And acquiring the mq message, specifically acquiring the mq message according to the message queue name.
S130: and creating a timing task according to the mq message and storing the timing task into a timing task table.
Creating a timing task according to the mq message, which specifically comprises the following steps: and deserializing the mq message, acquiring the service data and the current machine name, and creating a timing task according to the service data and the current machine name. The timing tasks are divided into a credit granting flow timing task, a payment release flow timing task, a payment flow timing task and a background management timing task according to types and are configured correspondingly. The configuration comprises log configuration, system information configuration, related framework configuration, message queue configuration and short message configuration.
S140: creating a thread pool, running a timing task at regular time and acquiring verification data;
s150: inquiring a timing task table to obtain service data;
s160: and performing verification operation according to the verification data and the service data.
Taking the bank loan service as an example, a timed task subsystem is added in the loan service system, and a timed task distribution method is applied in the timed task subsystem, and the specific process is described as follows:
it should be understood that in the business system, since the calling interface in the loan approval process has a timeout or abnormal scene, we need to check the result again at this time, and then perform the subsequent processing. Here we use message queue + timing task to process the verification operation, there are many message queues in the mainstream today, for example: the message queue is specifically selected according to the service scene and the system requirement, and here the RabbitMQ is selected as the message processing of the overtime scene.
When an overtime or abnormal scene occurs, we need to acquire the serial number of the service, check the service type, and check service data such as error information, then serialize the service data, add a message queue name, and send the message queue to an mq message queue, where a specific data structure is shown in fig. 2.
The timing task system monitors the mq message queue, acquires the mq message according to the message queue name, then deserializes to acquire corresponding service data and acquire the current machine name, creates a timing task, and stores the timing task in a timing task table, wherein the specific data structure is shown in fig. 3. The process tasks can be configured according to the specific loan service system service process, for example, the individual timing tasks are formed according to the loan process, credit granting, loan payment, repayment, background management system and the like.
The timing task system can create a thread pool during initialization and run timing tasks at regular time, wherein the tasks include regular acquisition and updating of current machine names, data required to be verified in each loan process and the like.
And inquiring the timing task table according to the current machine name and the service type to acquire service data, and then checking the relevant interfaces to perform subsequent flow operation.
It should be understood that a loan transaction system may involve a plurality of loan products of different forms, and for some loan products requiring verification and subsequent data information update, the same processing logic may be packaged into tools and the like, may share a set of codes, reduces code redundancy, and is beneficial for maintenance.
As shown in fig. 4, the present invention also discloses a timing task distribution system, which includes:
and an mq message generating module 110, configured to acquire timing task data, generate an mq message, and send the mq message to an mq message queue.
And a message queue monitoring module 120, configured to monitor the mq message queue to obtain the mq message.
And a timed task creating module 130, configured to create a timed task according to the mq message, and store the timed task in a timed task table.
And the timing task running module 140 is configured to create a thread pool, run the timing task at a timing, and acquire verification data.
And the timing task query module 150 is configured to query the timing task table to obtain the service data.
And the verification module 160 is used for performing verification operation according to the verification data and the service data.
The mq message generating module 110 includes a serialization module, where the serialization module is used to obtain service data, serialize the service data, and add a message queue name to generate an mq message; correspondingly, the timing task creating module 130 includes an deserializing module, and the deserializing module is configured to deserialize the mq message, obtain the service data and the current machine name, and create the timing task according to the service data and the current machine name.
The invention also discloses computer equipment which comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, wherein the processor realizes the timing task distribution method when executing the computer program.
The invention also discloses a storage medium which stores a computer program for executing the timing task distribution method.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
It should be understood that the integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention essentially or partially contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The technical scope of the present invention is not limited to the above description, and those skilled in the art can make various changes and modifications to the above-described embodiments without departing from the technical spirit of the present invention, and such changes and modifications should fall within the protective scope of the present invention.

Claims (10)

1. A timing task distribution method is applied to a timing task subsystem and is characterized by comprising the following steps:
acquiring timing task data, generating an mq message and sending the mq message to an mq message queue;
monitoring the mq message queue to obtain the mq message;
establishing a timing task according to the mq message, and storing the timing task into a timing task table;
creating a thread pool, running a timing task at regular time and acquiring verification data;
inquiring the timing task table to obtain service data;
and performing checking operation according to the checking data and the service data.
2. The method for distributing the timed task according to claim 1, wherein the acquiring the timed task data and generating the mq message specifically comprises: acquiring service data, serializing the service data, and adding a message queue name to generate an mq message;
correspondingly, the creating a timing task according to the mq message specifically includes: and deserializing the mq message, acquiring service data and the current machine name, and creating a timing task according to the service data and the current machine name.
3. The method for distributing the timed task according to claim 2, wherein the acquiring the mq message is specifically to acquire the mq message according to the message queue name.
4. The timed task distribution method according to claim 1, wherein the timed tasks are divided into a credit flow timed task, a deposit flow timed task, a repayment flow timed task and a background management timed task according to types, and are configured correspondingly.
5. The timed task distribution method according to claim 4, wherein said configuration includes log configuration, system information configuration, configuration related to a framework, message queue configuration and short message configuration.
6. The timed task distribution method according to claim 1, characterized in that said service data includes a service serial number, a service type and error information.
7. A timed task distribution system, comprising:
the mq message generating module is used for acquiring the timing task data, generating an mq message and sending the mq message to an mq message queue;
a message queue monitoring module, configured to monitor the mq message queue to obtain the mq message;
a timing task creating module, configured to create a timing task according to the mq message, and store the timing task in a timing task table;
the timing task running module is used for creating a thread pool, running the timing task at regular time and acquiring verification data;
the timing task query module is used for querying the timing task table and acquiring service data;
and the checking module is used for carrying out checking operation according to the checking data and the service data.
8. The timed task distribution system according to claim 7, wherein the mq message generation module comprises a serialization module, the serialization module is configured to obtain service data, serialize the service data, add a message queue name to generate an mq message;
correspondingly, the timing task creating module comprises an deserializing module, and the deserializing module is used for deserializing the mq message, acquiring service data and the current machine name and creating the timing task according to the service data and the current machine name.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of any one of claims 1 to 6 when executing the computer program.
10. A storage medium storing a computer program for performing the method of any one of claims 1 to 6.
CN202010536838.8A 2020-06-12 2020-06-12 Timed task distribution method, timed task distribution system, computer equipment and storage medium Active CN111722914B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010536838.8A CN111722914B (en) 2020-06-12 2020-06-12 Timed task distribution method, timed task distribution system, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010536838.8A CN111722914B (en) 2020-06-12 2020-06-12 Timed task distribution method, timed task distribution system, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111722914A true CN111722914A (en) 2020-09-29
CN111722914B CN111722914B (en) 2022-07-22

Family

ID=72566493

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010536838.8A Active CN111722914B (en) 2020-06-12 2020-06-12 Timed task distribution method, timed task distribution system, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111722914B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112395057A (en) * 2020-11-12 2021-02-23 苏宁云计算有限公司 Data processing method and device based on timing task and computer equipment

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111045806A (en) * 2019-12-16 2020-04-21 云南优鸟科技有限公司 Method and system for realizing delay message queue
CN111045807A (en) * 2019-12-17 2020-04-21 深圳前海环融联易信息科技服务有限公司 Zookeeper task processing method and device, computer equipment and storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111045806A (en) * 2019-12-16 2020-04-21 云南优鸟科技有限公司 Method and system for realizing delay message queue
CN111045807A (en) * 2019-12-17 2020-04-21 深圳前海环融联易信息科技服务有限公司 Zookeeper task processing method and device, computer equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112395057A (en) * 2020-11-12 2021-02-23 苏宁云计算有限公司 Data processing method and device based on timing task and computer equipment

Also Published As

Publication number Publication date
CN111722914B (en) 2022-07-22

Similar Documents

Publication Publication Date Title
CN102456185B (en) Distributed workflow processing method and distributed workflow engine system
CN111382150A (en) Real-time computing method and system based on Flink
CN105119966A (en) Official account management method and device
CN104077362A (en) Online mass data processing system and method
US20030158883A1 (en) Message processing
CN111026602A (en) Health inspection scheduling management method and device of cloud platform and electronic equipment
CN111399909A (en) Service system data distribution processing method, device and storage medium
CN111784318A (en) Data processing method and device, electronic equipment and storage medium
CN107295031A (en) A kind of method of data synchronization and device
CN111722914B (en) Timed task distribution method, timed task distribution system, computer equipment and storage medium
CN112395570B (en) Alliance chain intelligent contract calling authority control method, system and storage medium
CN109871394B (en) Full-distributed high-concurrency calculation method and device
CN112783629A (en) Service calling method and device, electronic equipment and storage medium
CN116467085A (en) Task processing method, system, electronic device and storage medium
CN112445860A (en) Method and device for processing distributed transaction
CN107678856B (en) Method and device for processing incremental information in business entity
CN111695901B (en) Accounting document processing method, device, equipment and storage medium
CN117112121A (en) Distributed task processing system, method, apparatus and computer program product
CN113553180A (en) Container scheduling method and device and electronic equipment
CN113312359A (en) Distributed job progress calculation method and device and storage medium
CN112118310A (en) Resource processing method, device, platform, electronic equipment and storage medium
CN109922141A (en) The real time acquiring method and device of activity request list in Java application server
CN111538491A (en) Data event processing method, device, equipment and storage medium
CN111506644A (en) Application data processing method and device and electronic equipment
CN116643733B (en) Service processing system and method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant