CN111722914B - 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
CN111722914B
CN111722914B CN202010536838.8A CN202010536838A CN111722914B CN 111722914 B CN111722914 B CN 111722914B CN 202010536838 A CN202010536838 A CN 202010536838A CN 111722914 B CN111722914 B CN 111722914B
Authority
CN
China
Prior art keywords
message
timing task
timing
acquiring
task
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.)
Active
Application number
CN202010536838.8A
Other languages
Chinese (zh)
Other versions
CN111722914A (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; establishing 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 the timing tasks involved in the loan process into the 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 present invention relates to the field of computer technologies, and in particular, to a method, a system, a computer device, and a storage medium for distributing timed tasks.
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 services at present may include a plurality of products, each product has its own flow service, and for services that need to be checked regularly, its own corresponding timing task and subsequent processing are added. Therefore, a large amount of redundancy exists in the codes, the problems of follow-up code maintenance, timing function modification and optimization exist, and the problems are easily caused by multiple modification of the same codes. And additionally rewriting a processing flow of a timing task for the subsequent newly added product and function.
Disclosure of Invention
In view of the above problems, the present invention provides a timing task distribution method, system, computer device and storage medium, wherein timing tasks involved in a loan process are all put into a timing task system, each type of timing task is provided with corresponding parameters, timing scene tasks are processed for 24 hours, and then subsequent process processing is performed, and meanwhile, the load of a loan transaction processing server can be reduced, and the method, system, computer device and storage medium are easy to maintain and develop.
In order to solve the technical problems, the technical scheme adopted by the invention is as follows: 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; according to the mq message, establishing a timing task and storing the timing task in a timing task table; establishing 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 include: 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: deserializing the mq message, acquiring service data and a 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 in a timing mode and obtaining the checking 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 a deserializing module, and the deserializing module is used for deserializing the mq message, acquiring the 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 which stores a computer program for executing the timing 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 timing tasks are newly added without increasing a large number of configuration 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 concerned any more, the code redundancy and development of the business system are reduced, and the pressure of a 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 flowchart 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 limiting or restricting 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 repayment 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: specifically, which message queue is selected according to a service scene and system requirements, and here, the RabbitMQ is selected as message processing of a timeout 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 a timing task table according to the current machine name and the service type to acquire service data, and then inquiring and verifying related 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 timed task creating module 130 includes an deserializing module, which is configured to deserialize the mq message, obtain the service data and the current machine name, and create the timed 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 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 (6)

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; the acquiring of the mq message specifically is acquiring the mq message according to the message queue name;
according to the mq message, establishing a timing task and storing the timing task in a timing task table;
establishing a thread pool, running a timing task at regular time, and acquiring verification data;
inquiring the timing task table to obtain service data; the service data comprises a service serial number, a service type and error information;
performing checking operation according to the checking data and the service data;
the acquiring timing task data and generating an mq message specifically include: acquiring service data, serializing the service data, and adding a message queue name to generate an mq message; 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.
2. 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.
3. The timed task distribution method according to claim 2, wherein said configuration includes log configuration, system information configuration, configuration related to a framework, message queue configuration and short message configuration.
4. 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; the acquiring of the mq message specifically is acquiring the mq message according to the message queue name;
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 in a timing mode and obtaining the checking data;
the timing task query module is used for querying the timing task table and acquiring service data; the service data comprises a service serial number, a service type and error information;
the checking module is used for carrying out checking operation according to the checking data and the service data;
the mq message generation 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.
5. 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 of claims 1 to 3 when executing the computer program.
6. A storage medium, characterized in that it stores a computer program for executing the method of any one of claims 1 to 3.
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 CN111722914A (en) 2020-09-29
CN111722914B true 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)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112395057B (en) * 2020-11-12 2023-04-21 苏宁云计算有限公司 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

Also Published As

Publication number Publication date
CN111722914A (en) 2020-09-29

Similar Documents

Publication Publication Date Title
CN102456185B (en) Distributed workflow processing method and distributed workflow engine system
CN106503132A (en) A kind of distributed transaction management method and system
CN105119966A (en) Official account management method and device
US20030158883A1 (en) Message processing
CN108768837A (en) Message treatment method and relevant apparatus
CN111399909A (en) Service system data distribution processing method, device and storage medium
CN110912972A (en) Service processing method, system, electronic equipment and readable storage medium
CN112559208A (en) Method for constructing micro-service MQ applied to government affair cloud platform
CN111722914B (en) Timed task distribution method, timed task distribution system, computer equipment and storage medium
CN115544044A (en) Data consistency keeping method, device, equipment and storage medium
CN112395570B (en) Alliance chain intelligent contract calling authority control method, system and storage medium
CN114895879B (en) Management system design scheme determining method, device, equipment and storage medium
CN112181380B (en) Credit product multi-product parallel development system and credit granting, payment and repayment method thereof
CN112445860A (en) Method and device for processing distributed transaction
CN113312359B (en) Distributed job progress calculation method and device and storage medium
CN111695901B (en) Accounting document processing method, device, equipment and storage medium
CN113553180A (en) Container scheduling method and device and electronic equipment
CN106878369B (en) Service processing method and device
CN111538491A (en) Data event processing method, device, equipment and storage medium
CN109922141A (en) The real time acquiring method and device of activity request list in Java application server
CN115269161B (en) Abnormal process reverse rollback method and system
CN116643733B (en) Service processing system and method
CN116703359A (en) Application operation and maintenance management method and device, electronic equipment and storage medium
CN115358720A (en) Credit information acquisition method and related equipment
CN116560845A (en) Unified external number management method, device, electronic equipment and readable storage medium

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