WO2019062020A1 - Asynchronous task unified processing method and apparatus, and storage medium - Google Patents

Asynchronous task unified processing method and apparatus, and storage medium Download PDF

Info

Publication number
WO2019062020A1
WO2019062020A1 PCT/CN2018/077672 CN2018077672W WO2019062020A1 WO 2019062020 A1 WO2019062020 A1 WO 2019062020A1 CN 2018077672 W CN2018077672 W CN 2018077672W WO 2019062020 A1 WO2019062020 A1 WO 2019062020A1
Authority
WO
WIPO (PCT)
Prior art keywords
asynchronous task
type
asynchronous
task
service type
Prior art date
Application number
PCT/CN2018/077672
Other languages
French (fr)
Chinese (zh)
Inventor
孙强
Original Assignee
平安科技(深圳)有限公司
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 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2019062020A1 publication Critical patent/WO2019062020A1/en

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
    • 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
    • G06Q10/00Administration; Management
    • G06Q10/06Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
    • G06Q10/063Operations research, analysis or management
    • G06Q10/0631Resource planning, allocation, distributing or scheduling for enterprises or organisations
    • G06Q10/06316Sequencing of tasks or work

Abstract

Disclosed are an asynchronous task unified processing method and apparatus, and a storage medium. The method comprises: generating scripts of asynchronous tasks according to basic information of the asynchronous tasks, and adding the scripts into a database; adding configuration information and asynchronous task classes of the asynchronous tasks into a development code, adding service types involved in the asynchronous tasks into the asynchronous task classes, setting processing types involved in the service types, and setting corresponding service logic for the processing types; receiving the asynchronous tasks from a client, and storing the received asynchronous tasks in a task list according to a time sequence; reading, from the task list, an asynchronous task received earliest; and determining the service type and the processing type of the asynchronous task by means of a first determining step and a second determining step. The development time is shortened and the working efficiency is improved.

Description

异步任务统一处理方法、装置及存储介质Asynchronous task unified processing method, device and storage medium
优先权申明Priority claim
本申请要求于2017年09月30日提交中国专利局、申请号为201710916221.7,名称为“异步任务统一处理方法、装置及存储介质”的中国专利申请的优先权,该中国专利申请的整体内容以参考的方式结合本申请中。This application claims the priority of the Chinese Patent Application entitled "Asynchronous Task Unified Processing Method, Apparatus and Storage Medium" submitted by the Chinese Patent Office on September 30, 2017, with the application number of 201710916221.7. The overall content of the Chinese patent application is The manner of reference is incorporated in the present application.
技术领域Technical field
本申请涉及异步处理技术领域,尤其涉及一种异步任务统一处理方法、装置及计算机可读存储介质。The present application relates to the field of asynchronous processing technologies, and in particular, to a method, an apparatus, and a computer readable storage medium for a unified processing of asynchronous tasks.
背景技术Background technique
随着互联网技术的快速发展,越来越多的工作可以通过应用系统自动处理完成。这些应用系统能够对不同客户的不同需求进行处理,因此,需要针对客户的需求开发不同的异步任务应用系统。With the rapid development of Internet technology, more and more work can be done automatically through the application system. These applications can handle the different needs of different customers, so different asynchronous task applications need to be developed for the needs of customers.
目前,在异步任务应用系统的项目开发和应用过程中,通常同一个客户的需求涉及许多异步任务,而且每次新增一个异步任务,软件开发工程师都需要做如下内容变更:1.在数据库中添加异步任务的基础信息定义的脚本,如任务编码、任务名称和任务作者等;2.在代码中新增异步任务的配置信息,如任务编码和任务组别等,同时新增异步任务处理JAVA类;3.关注新增的异步任务的执行结果。由于相同需求涉及的异步任务具有相同的基础信息及配置信息,从而导致每次新增异步任务,软件开发工程师都要执行一些重复性工作,如配置相同的基础信息等。这样不仅浪费开发时间和测试的人力资源,而且还降低了工作效率。At present, in the project development and application process of the asynchronous task application system, usually the same customer needs involve many asynchronous tasks, and each time an asynchronous task is added, the software development engineer needs to make the following changes: 1. In the database Add scripts for basic information definition of asynchronous tasks, such as task code, task name, and task author. 2. Add configuration information of asynchronous tasks, such as task code and task group, in the code, and add asynchronous task processing JAVA. Class; 3. Focus on the execution results of the new asynchronous task. Because the asynchronous tasks involved in the same requirements have the same basic information and configuration information, the software development engineers must perform some repetitive tasks, such as configuring the same basic information, each time an asynchronous task is added. This not only wastes human resources for development time and testing, but also reduces work efficiency.
发明内容Summary of the invention
鉴于以上内容,本申请提供一种异步任务统一处理方法、装置及计算机可读存储介质,可以有效地缩短开发时间,提高工作效率。In view of the above, the present application provides a method, a device, and a computer readable storage medium for asynchronous task processing, which can effectively shorten development time and improve work efficiency.
为实现上述目的,本申请提供一种异步任务统一处理方法,该方法包括:To achieve the above objective, the present application provides a unified processing method for asynchronous tasks, including:
数据库初始化步骤:根据异步任务的基础信息生成异步任务的脚本,将 该脚本添加到数据库中;Database initialization step: generate a script of the asynchronous task according to the basic information of the asynchronous task, and add the script to the database;
代码初始化步骤:在开发代码中添加异步任务的配置信息及异步任务类,在异步任务类中添加异步任务涉及的业务类型,设置每个业务类型涉及的处理类型,并为每个处理类型设置相应的业务逻辑;Code initialization step: Add the configuration information of the asynchronous task and the asynchronous task class in the development code, add the business type involved in the asynchronous task in the asynchronous task class, set the processing type involved in each business type, and set the corresponding processing type for each processing type. Business logic
接收步骤:从客户端接收异步任务,将接收到的异步任务按照时间先后顺序存放至任务列表;Receiving step: receiving an asynchronous task from the client, and storing the received asynchronous tasks in a chronological order to the task list;
读取步骤:从任务列表中读取最早接收到的异步任务;Reading step: reading the earliest received asynchronous task from the task list;
第一判断步骤:判断该异步任务的业务类型是否为所述异步任务类中已定义的业务类型,若该异步任务的业务类型不是异步任务类中已定义的业务类型,则判断该异步任务的业务类型为未知业务类型,提示执行失败,若该异步任务的业务类型是异步任务类中已定义的业务类型,则执行第二判断步骤;及The first determining step is: determining whether the service type of the asynchronous task is a defined service type in the asynchronous task class, and if the service type of the asynchronous task is not a defined service type in the asynchronous task class, determining the asynchronous task The service type is an unknown service type, and the execution fails. If the service type of the asynchronous task is a defined service type in the asynchronous task class, the second determining step is performed;
第二判断步骤:判断该异步任务的处理类型是否为所述业务类型中已定义的处理类型,若该异步任务的处理类型不是所述业务类型中已定义的处理类型,则判断该异步任务的处理类型为未知处理类型,提示执行失败,若该异步任务的处理类型是所述业务类型中已定义的处理类型,则执行相应的业务逻辑。a second determining step: determining whether the processing type of the asynchronous task is a processing type defined in the service type, and if the processing type of the asynchronous task is not a processing type defined in the service type, determining the asynchronous task The processing type is an unknown processing type, indicating that the execution fails. If the processing type of the asynchronous task is a defined processing type in the business type, the corresponding business logic is executed.
优选地,该方法还包括:Preferably, the method further comprises:
第三判断步骤:判断相应的业务逻辑是否执行成功,若执行成功,则提示执行成功;反之,则提示执行失败。The third determining step is: determining whether the corresponding business logic is successfully executed. If the execution is successful, the execution is successful; otherwise, the execution is failed.
优选地,所述第一判断步骤还包括:Preferably, the first determining step further includes:
若读取的异步任务的业务类型不是异步任务类中已定义的业务类型,则提示该异步任务的业务类型为未知业务类型,并在异步任务类中添加相应的业务类型。If the service type of the asynchronous task is not the defined service type in the asynchronous task class, the service type of the asynchronous task is prompted to be an unknown service type, and the corresponding service type is added in the asynchronous task class.
优选地,所述第二判断步骤还包括:Preferably, the second determining step further comprises:
若读取的异步任务的处理类型不是所述业务类型中已定义的处理类型,则提示该异步任务的处理类型为未知处理类型,并在所述业务类型中添加相应的处理类型。If the processing type of the read asynchronous task is not the processing type defined in the service type, the processing type of the asynchronous task is prompted to be an unknown processing type, and a corresponding processing type is added to the service type.
优选地,该方法还包括:Preferably, the method further comprises:
记录步骤:记录每个异步任务的执行结果及执行失败的原因,并统计异 步任务执行失败的次数,以统一的格式记录在同一份异步任务执行结果清单中,以预设方式反馈给相关人员。Recording step: record the execution result of each asynchronous task and the reason for the failure of the execution, and count the number of times the asynchronous task fails to execute, record it in the same asynchronous task execution result list in a unified format, and feed back to the relevant personnel in a preset manner.
优选地,该方法还包括:Preferably, the method further comprises:
第四判断步骤:判断该异步任务失败的次数是否大于预设值;The fourth determining step is: determining whether the number of times the asynchronous task fails is greater than a preset value;
若该异步任务失败的次数大于预设值,则提示该异步任务失败次数超过预设值,不再执行该任务;If the number of times the asynchronous task fails to be greater than the preset value, the number of failed asynchronous tasks exceeds a preset value, and the task is no longer executed;
若该异步任务失败的次数小于或等于预设值,则重新启动执行该异步任务。If the number of times the asynchronous task fails is less than or equal to the preset value, the asynchronous task is restarted.
此外,本申请还提供一种电子装置,该电子装置包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的异步任务统一处理系统,所述异步任务统一处理系统被所述处理器执行,可实现如下步骤:In addition, the present application further provides an electronic device, including: a memory, a processor, and an asynchronous task unified processing system stored on the memory and operable on the processor, the asynchronous task unified processing system Executed by the processor, the following steps can be implemented:
数据库初始化步骤:根据异步任务的基础信息生成异步任务的脚本,将该脚本添加到数据库中;Database initialization step: generate a script of the asynchronous task according to the basic information of the asynchronous task, and add the script to the database;
代码初始化步骤:在开发代码中添加异步任务的配置信息及异步任务类,在异步任务类中添加异步任务涉及的业务类型,设置每个业务类型涉及的处理类型,并为每个处理类型设置相应的业务逻辑;Code initialization step: Add the configuration information of the asynchronous task and the asynchronous task class in the development code, add the business type involved in the asynchronous task in the asynchronous task class, set the processing type involved in each business type, and set the corresponding processing type for each processing type. Business logic
接收步骤:从客户端接收异步任务,将接收到的异步任务按照时间先后顺序存放至任务列表;Receiving step: receiving an asynchronous task from the client, and storing the received asynchronous tasks in a chronological order to the task list;
读取步骤:从任务列表中读取最早接收到的异步任务;Reading step: reading the earliest received asynchronous task from the task list;
第一判断步骤:判断该异步任务的业务类型是否为所述异步任务类中已定义的业务类型,若该异步任务的业务类型不是异步任务类中已定义的业务类型,则判断该异步任务的业务类型为未知业务类型,提示执行失败,若该异步任务的业务类型是异步任务类中已定义的业务类型,则执行第二判断步骤;及The first determining step is: determining whether the service type of the asynchronous task is a defined service type in the asynchronous task class, and if the service type of the asynchronous task is not a defined service type in the asynchronous task class, determining the asynchronous task The service type is an unknown service type, and the execution fails. If the service type of the asynchronous task is a defined service type in the asynchronous task class, the second determining step is performed;
第二判断步骤:判断该异步任务的处理类型是否为所述业务类型中已定义的处理类型,若该异步任务的处理类型不是所述业务类型中已定义的处理类型,则判断该异步任务的处理类型为未知处理类型,提示执行失败,若该异步任务的处理类型是所述业务类型中已定义的处理类型,则执行相应的业务逻辑。a second determining step: determining whether the processing type of the asynchronous task is a processing type defined in the service type, and if the processing type of the asynchronous task is not a processing type defined in the service type, determining the asynchronous task The processing type is an unknown processing type, indicating that the execution fails. If the processing type of the asynchronous task is a defined processing type in the business type, the corresponding business logic is executed.
优选地,所述第一判断步骤还包括:Preferably, the first determining step further includes:
若读取的异步任务的业务类型不是异步任务类中已定义的业务类型,则提示该异步任务的业务类型为未知业务类型,并在异步任务类中添加相应的业务类型。If the service type of the asynchronous task is not the defined service type in the asynchronous task class, the service type of the asynchronous task is prompted to be an unknown service type, and the corresponding service type is added in the asynchronous task class.
优选地,所述第二判断步骤还包括:Preferably, the second determining step further comprises:
若读取的异步任务的处理类型不是所述业务类型中已定义的处理类型,则提示该异步任务的处理类型为未知处理类型,并在所述业务类型中添加相应的处理类型。If the processing type of the read asynchronous task is not the processing type defined in the service type, the processing type of the asynchronous task is prompted to be an unknown processing type, and a corresponding processing type is added to the service type.
此外,为实现上述目的,本申请还提供一种计算机可读存储介质,所述计算机可读存储介质中包括异步任务统一处理系统,所述异步任务统一处理系统被处理器执行时,可实现如上所述异步任务统一处理方法中的任意步骤。In addition, in order to achieve the above object, the present application further provides a computer readable storage medium, which includes an asynchronous task unified processing system, and when the asynchronous task unified processing system is executed by a processor, The asynchronous task unifies any step in the method.
本申请提出的异步任务统一处理方法、电子装置及计算机可读存储介质,根据客户的需求,在数据库中添加由异步任务的基础信息生成的脚本,在开发代码中新增异步任务的配置信息及异步任务类,在异步任务类中添加定时任务涉及的业务类型,并为设置每个业务类型涉及的处理类型和业务逻辑,之后统一处理从客户端接收的异步任务,从而缩短开发时间,提高软件工程师的工作效率。The asynchronous task unified processing method, the electronic device and the computer readable storage medium proposed by the application add a script generated by the basic information of the asynchronous task to the database according to the needs of the client, and add configuration information of the asynchronous task in the development code. Asynchronous task class, adding the business type involved in the timing task in the asynchronous task class, and setting the processing type and business logic involved in each business type, and then uniformly processing the asynchronous tasks received from the client, thereby shortening the development time and improving the software. The efficiency of the engineer.
附图说明DRAWINGS
图1为本申请电子装置较佳实施例的示意图;1 is a schematic diagram of a preferred embodiment of an electronic device of the present application;
图2为图1中异步任务统一处理系统较佳实施例的功能模块图;2 is a functional block diagram of a preferred embodiment of the asynchronous task unified processing system of FIG. 1;
图3为本申请异步任务统一处理方法第一实施例的流程图;3 is a flowchart of a first embodiment of a method for uniformly processing an asynchronous task according to the present application;
图4为本申请异步任务统一处理方法第二实施例的流程图;4 is a flowchart of a second embodiment of a method for uniformly processing an asynchronous task according to the present application;
图5为本申请异步任务类的设置框架图。FIG. 5 is a setting frame diagram of an asynchronous task class of the present application.
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The implementation, functional features and advantages of the present application will be further described with reference to the accompanying drawings.
具体实施方式Detailed ways
应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。It is understood that the specific embodiments described herein are merely illustrative of the application and are not intended to be limiting.
如图1所示,是本申请电子装置1较佳实施例的示意图。FIG. 1 is a schematic diagram of a preferred embodiment of an electronic device 1 of the present application.
在本实施例中,电子装置1可以是服务器、智能手机、平板电脑、个人电脑、便携计算机以及其他具有运算功能的电子设备。In this embodiment, the electronic device 1 may be a server, a smart phone, a tablet computer, a personal computer, a portable computer, and other electronic devices having computing functions.
该电子装置1包括:存储器11、处理器12、显示器13及存储在所述存储器11上并可在所述处理器12上运行的异步任务统一处理系统10。所述电子装置1通过网络2连接一个或多个客户端3,从客户端3处接收客户的异步任务,并将接收到的任务按照接收时间的先后顺序存放至任务列表中。所述电子装置1还可与数据库4连接。在本实施例中,数据库4中存有异步任务的基础信息生成的脚本。The electronic device 1 includes a memory 11, a processor 12, a display 13, and an asynchronous task unified processing system 10 stored on the memory 11 and operable on the processor 12. The electronic device 1 connects one or more clients 3 through the network 2, receives the asynchronous tasks of the client from the client 3, and stores the received tasks into the task list in the order of receiving time. The electronic device 1 can also be connected to a database 4. In the present embodiment, the database 4 stores a script for generating basic information of an asynchronous task.
其中,网络2可以为局域网,广域网,城域网等等类型的网络,可以为有线网络,也可以为无线网络。The network 2 may be a network of a local area network, a wide area network, a metropolitan area network, or the like, and may be a wired network or a wireless network.
客户端3可以为桌上型计算机、笔记本、平板电脑、手机,或其它可以通过网络与电子装置进行通信的终端设备。The client 3 can be a desktop computer, a notebook, a tablet, a mobile phone, or other terminal device that can communicate with an electronic device through a network.
存储器11至少包括一种类型的可读存储介质。所述至少一种类型的可读存储介质可为如闪存、硬盘、多媒体卡、卡型存储器等的非易失性存储介质。在一些实施例中,所述存储器11可以是所述电子装置1的内部存储单元,例如该电子装置1的硬盘。在另一些实施例中,所述存储器11也可以是所述电子装置1的外部存储单元,例如所述电子装置1上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。The memory 11 includes at least one type of readable storage medium. The at least one type of readable storage medium may be a non-volatile storage medium such as a flash memory, a hard disk, a multimedia card, a card type memory, or the like. In some embodiments, the memory 11 may be an internal storage unit of the electronic device 1, such as a hard disk of the electronic device 1. In other embodiments, the memory 11 may also be an external storage unit of the electronic device 1, such as a plug-in hard disk equipped on the electronic device 1, a smart memory card (SMC), and security. Digital (Secure Digital, SD) card, flash card (Flash Card), etc.
在本实施例中,所述存储器11不仅可以用于存储安装于所述电子装置1的应用软件及各类数据,例如异步任务统一处理系统10、任务列表和异步任务执行结果清单,还可以用于暂时地存储已经输出或者将要输出的数据。In this embodiment, the memory 11 can be used not only for storing application software and various types of data installed in the electronic device 1, such as an asynchronous task unified processing system 10, a task list, and an asynchronous task execution result list, and can also be used. Temporarily storing data that has been output or is about to be output.
处理器12在一些实施例中可以是一中央处理器(Central Processing Unit,CPU),微处理器或其它数据处理芯片,用于运行存储器11中存储的程序代码或处理数据,例如执行异步任务统一处理系统10的计算机程序代码等。The processor 12, in some embodiments, may be a Central Processing Unit (CPU), microprocessor or other data processing chip for running program code or processing data stored in the memory 11, such as performing asynchronous task unification. The computer program code or the like of the processing system 10.
显示器13可以称为显示屏或显示单元。在一些实施例中显示器13可以是LED显示器、液晶显示器、触控式液晶显示器以及OLED(Organic  Light-Emitting Diode,有机发光二极管)触摸器等。显示器13用于显示在电子装置1中处理的信息以及用于显示可视化的工作界面,如:显示任务执行的结果(执行失败或执行成功)、任务失败的次数和任务失败原因。Display 13 can be referred to as a display screen or display unit. In some embodiments, the display 13 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch sensor, or the like. The display 13 is used to display information processed in the electronic device 1 and a work interface for displaying visualization, such as displaying the result of the task execution (execution failure or execution success), the number of task failures, and the reason for the task failure.
优选地,该电子装置1还可以包括用户接口,用户接口可以包括输入单元比如键盘(Keyboard)、语音输出装置比如音响、耳机等,可选地用户接口还可以包括标准的有线接口、无线接口。Preferably, the electronic device 1 may further include a user interface, and the user interface may include an input unit such as a keyboard, a voice output device such as an audio, a headphone, etc., optionally, the user interface may further include a standard wired interface and a wireless interface.
在图1所示的装置实施例中,作为一种计算机存储介质的存储器11中存储异步任务统一处理系统10的程序代码,处理器12执行异步任务统一处理系统10的程序代码,实现如下功能:In the apparatus embodiment shown in FIG. 1, the program code of the asynchronous task unified processing system 10 is stored in the memory 11 as a computer storage medium, and the processor 12 executes the program code of the asynchronous task unified processing system 10 to implement the following functions:
在数据库中添加异步任务的基础信息定义的脚本;Add a script that defines the underlying information of the asynchronous task in the database;
在开发代码中设置异步任务的配置信息及异步任务类,并在异步任务类中添加定时任务涉及的所有业务类型,并为每个业务类型设置涉及的所有处理类型和对应的业务逻辑;Setting the configuration information of the asynchronous task and the asynchronous task class in the development code, and adding all the service types involved in the timing task in the asynchronous task class, and setting all the processing types involved and the corresponding business logic for each service type;
从客户端接收异步任务,并将接收到的异步任务按照时间先后的顺序存放至任务列表;Receiving an asynchronous task from the client, and storing the received asynchronous task in a chronological order to the task list;
从任务列表中读取最早接收到的异步任务;Read the earliest received asynchronous task from the task list;
判断该异步任务的业务类型和处理类型是否为所述异步任务类中已定义的业务类型和处理类型,若该异步任务的业务类型不是异步任务类中已定义的业务类型或处理类型,则判断该异步任务的业务类型或处理类型为未知业务类型或未知处理类型,反之,则执行相应的业务逻辑。Determining whether the service type and the processing type of the asynchronous task are the defined service type and processing type in the asynchronous task class, and if the service type of the asynchronous task is not the defined service type or processing type in the asynchronous task class, determining The service type or processing type of the asynchronous task is an unknown service type or an unknown processing type. Otherwise, the corresponding business logic is executed.
具体介绍请参下方关于异步任务统一处理系统10的功能模块图的详细说明。For details, please refer to the following for a detailed description of the functional module diagram of the asynchronous task unified processing system 10.
如图2所示,是图1中异步任务统一处理系统10较佳实施例的功能模块图。本申请所称的模块是指能够完成特定功能的一系列计算机程序指令段。As shown in FIG. 2, it is a functional block diagram of a preferred embodiment of the asynchronous task unified processing system 10 of FIG. A module as referred to in this application refers to a series of computer program instructions that are capable of performing a particular function.
在本实施例中,异步任务统一处理系统10包括:数据库初始化模块110、代码初始化模块120、接收模块130、读取模块140、判断模块150、记录模块160及失败次数判断模块170。In this embodiment, the asynchronous task unified processing system 10 includes a database initialization module 110, a code initialization module 120, a receiving module 130, a reading module 140, a determining module 150, a recording module 160, and a failure number determining module 170.
数据库初始化模块110,用于根据异步任务的基础信息生成异步任务的脚本,将该脚本添加到数据库中。基础信息包括任务执行频率、预设值、业务 名称和业务处理人。假设需要开发一个异步任务统一处理系统10时,数据库初始化模块110将任务执行频率、预设值、业务名称和业务处理人等基础信息生成异步任务的脚本,添加到数据库4中。其中任务执行频率(如任务固定每30秒执行一次)、预设值(如预设值为20)、及业务名称包括业务类型名称和处理类型名称;业务处理人指各个处理类型对应的业务处理人。The database initialization module 110 is configured to generate a script of the asynchronous task according to the basic information of the asynchronous task, and add the script to the database. The basic information includes the task execution frequency, preset values, business name, and business processor. Assuming that an asynchronous task unified processing system 10 needs to be developed, the database initialization module 110 adds a script for generating an asynchronous task, such as a task execution frequency, a preset value, a service name, and a service processor, to the database 4. The task execution frequency (such as the task is fixed every 30 seconds), the preset value (such as the preset value is 20), and the service name includes the service type name and the processing type name; the service processor refers to the service processing corresponding to each processing type. people.
代码初始化模块120,用于在开发代码中添加异步任务的配置信息及异步任务类,在异步任务类中添加异步任务涉及的业务类型,设置每个业务类型涉及的处理类型,并为每个处理类型设置相应的业务逻辑。设置异步任务类,在异步任务类中添加异步任务相应的的所有业务类型,在不同的业务类型中设置相应的所有处理类型,在不同的处理类型中设置相应的业务逻辑代码。业务类型用于大体区分不同的业务逻辑,处理类型用于在同一个业务类型下细分不同的业务逻辑。例如,对开发的异步任务设置异步任务类,如图5所示。在异步任务类中添加异步任务的所有业务类型,业务类型包括业务类型A 1、业务类型A 2和业务类型A 3等。为业务类型A 1设置涉及的所有处理类型,业务类型A 1的处理类型包括处理类型B 11、处理类型B 12和处理类型B 13等;在不同的处理类型中设置相应的业务逻辑代码,如处理类型B 11相应的业务逻辑是业务逻辑C 11。其中不同业务类型的处理类型数可以不同,如业务类型A 1的处理类型数与业务类型A 2的处理类型数不同。同时,在开发代码中设置异步任务的配置信息,配置信息包括任务编码和任务组别。其中任务编码用于规范和快速查询一个异步任务对应的业务类型、处理类型和业务逻辑,例如,某异步任务的业务类型为业务类型A 1,对应的处理类型为处理类型B 12,则该异步任务的任务编码为A 1-B 12;任务组别用于将业务逻辑针对业务类型和处理类型进行分组存储。 The code initialization module 120 is configured to add the configuration information of the asynchronous task and the asynchronous task class in the development code, add the business type involved in the asynchronous task in the asynchronous task class, set the processing type involved in each business type, and perform each processing for each service type. The type sets the corresponding business logic. Set the asynchronous task class, add all the business types corresponding to the asynchronous task in the asynchronous task class, set all the corresponding processing types in different business types, and set the corresponding business logic codes in different processing types. The service type is used to roughly distinguish different business logics, and the processing type is used to subdivide different business logics under the same business type. For example, set up an asynchronous task class for a developed asynchronous task, as shown in Figure 5. All the service types of the asynchronous task are added to the asynchronous task class. The service types include service type A 1 , service type A 2, and service type A 3 . All processing type traffic type A 1 provided according to the service type A processing type 1 comprises processing type B 11, type of processing B 12 and the process type B 13 and the like; provided the corresponding business logic code in a different type of processing, such as The corresponding business logic for processing type B 11 is business logic C 11 . The number of processing types of different service types may be different. For example, the number of processing types of the service type A 1 is different from the number of processing types of the service type A 2 . At the same time, the configuration information of the asynchronous task is set in the development code, and the configuration information includes the task code and the task group. The task code is used to standardize and quickly query the service type, processing type, and business logic of an asynchronous task. For example, if the service type of an asynchronous task is the service type A 1 and the corresponding processing type is the processing type B 12 , the asynchronous The tasks of the task are coded as A 1 -B 12 ; the task group is used to store the business logic in groups for the business type and processing type.
接收模块130,用于从客户端接收异步任务,将接收到的异步任务按照时间先后顺序存放至任务列表。接收模块130通过网络2接收客户端3的异步任务,并将接收到的异步任务按照接收时间的先后顺序存放在任务列表中。例如,接收模块130从客户端3先后接收到异步任务a、异步任务b、异步任务c及异步任务d,并将异步任务a、异步任务b、异步任务c及异步任务d按照接收时间的先后顺序存放在存储器11的任务列表中。The receiving module 130 is configured to receive an asynchronous task from the client, and store the received asynchronous task in a chronological order to the task list. The receiving module 130 receives the asynchronous task of the client 3 through the network 2, and stores the received asynchronous tasks in the task list in the order of receiving time. For example, the receiving module 130 receives the asynchronous task a, the asynchronous task b, the asynchronous task c, and the asynchronous task d from the client 3, and the asynchronous task a, the asynchronous task b, the asynchronous task c, and the asynchronous task d are in accordance with the receiving time. The order is stored in the task list of the memory 11.
读取模块140,用于从任务列表中读取最早接收到的异步任务。例如,读 取模块140读取任务列表中最早接收到的异步任务a。The reading module 140 is configured to read the earliest received asynchronous task from the task list. For example, the read module 140 reads the earliest received asynchronous task a in the task list.
判断模块150,用于判断该异步任务的业务类型和处理类型是否为所述异步任务类中已定义的业务类型和处理类型,若该异步任务的业务类型不是异步任务类中已定义的业务类型或处理类型,则判断该异步任务的业务类型或处理类型为未知业务类型或未知处理类型,反之,则执行相应的业务逻辑并判断是否执行成功。判断模块150判断读取模块140读取的异步任务a的业务类型是否为异步任务类中已定义的业务类型。假设异步任务a的业务类型不是异步任务类中已定义的业务类型,则提示:执行失败。假设异步任务a的业务类型是异步任务类中已定义的业务类型,则继续判断读取的异步任务a的处理类型是否为所述任务类型中已定义的处理类型。假设异步任务a的处理类型不是所述业务类型中已定义的处理类型,则提示:执行失败。假设异步任务a的处理类型是所述业务类型中已定义的处理类型,则执行相应的业务逻辑并判断是否成功执行相应的业务逻辑。假设执行成功,则提示:执行成功;假设执行失败,则提示:执行失败。The determining module 150 is configured to determine whether the service type and the processing type of the asynchronous task are the defined service type and processing type in the asynchronous task class, and if the service type of the asynchronous task is not the defined service type in the asynchronous task class Or the processing type determines that the service type or processing type of the asynchronous task is an unknown service type or an unknown processing type. Otherwise, the corresponding business logic is executed and whether the execution is successful. The determining module 150 determines whether the service type of the asynchronous task a read by the reading module 140 is a defined service type in the asynchronous task class. Assume that the business type of asynchronous task a is not the defined business type in the asynchronous task class, then the prompt: execution fails. Assuming that the service type of the asynchronous task a is a defined service type in the asynchronous task class, it is determined whether the processed type of the asynchronous task a is the processing type defined in the task type. Assuming that the processing type of the asynchronous task a is not the processing type defined in the service type, the prompt: the execution fails. Assuming that the processing type of the asynchronous task a is the processing type defined in the service type, the corresponding business logic is executed and it is determined whether the corresponding business logic is successfully executed. Assume that the execution is successful, then the prompt: the execution is successful; if the execution fails, the prompt: the execution fails.
记录模块160,用于记录每个异步任务的执行结果及执行失败的原因,并统计异步任务执行失败的次数,以统一的格式记录在同一份异步任务执行结果清单中,以预设方式反馈给相关人员。记录模块160记录异步任务a的执行结果及异步任务a执行失败的原因,并统计该异步任务a执行失败的次数,最后以统一的格式记录在同一份异步任务执行结果清单中,以显示器13显示的方式反馈给软件开发工程师。软件开发工程师根据异步任务执行结果清单中异步任务a的失败原因进行处理,例如,判断异步任务a的业务类型不是异步任务类中已定义的业务类型,则软件开发工程师只需要在异步任务类中添加相应的业务类型而无需再重复添加基础信息和配置信息。The recording module 160 is configured to record the execution result of each asynchronous task and the reason for the failure of the execution, and count the number of times the asynchronous task fails to be executed, and record it in the same asynchronous task execution result list in a unified format, and feed back in a preset manner. Related personnel. The recording module 160 records the execution result of the asynchronous task a and the reason why the asynchronous task a fails to execute, and counts the number of times the asynchronous task a fails to execute, and finally records it in the same asynchronous task execution result list in a unified format, and displays it on the display 13 The way to feedback to the software development engineer. The software development engineer processes the failure reason of the asynchronous task a in the asynchronous task execution result list. For example, if the service type of the asynchronous task a is not the defined service type in the asynchronous task class, the software development engineer only needs to be in the asynchronous task class. Add the appropriate business type without having to add the basic and configuration information again.
失败次数判断模块170,用于判断该异步任务失败的次数是否大于预设值;若该异步任务失败的次数大于预设值,则提示该异步任务失败次数超过预设值,不再执行该任务;若该异步任务失败的次数小于或等于预设值,则重新启动执行该异步任务。失败次数判断模块170判断该异步任务a执行失败的次数是否大于20次。假设该异步任务a失败的次数大于20次,则提示:该异步任务a失败次数超过20次,不再执行该异步任务;假设该异步任务a失败的次数小于或等于20次,则将该异步任务a重新放入新的任务列表中,并 重新执行该异步任务a。The number of failures determining module 170 is configured to determine whether the number of failed asynchronous tasks is greater than a preset value; if the number of failed asynchronous tasks is greater than a preset value, the number of failed asynchronous tasks exceeds a preset value, and the task is no longer executed. If the number of times the asynchronous task fails is less than or equal to the preset value, the asynchronous task is restarted. The failure number determination module 170 determines whether the number of times the asynchronous task a fails to execute is greater than 20 times. Assuming that the asynchronous task a fails more than 20 times, it is prompted that the asynchronous task a fails more than 20 times and the asynchronous task is no longer executed; if the asynchronous task a fails less than or equal to 20 times, the asynchronous Task a is reloaded into the new task list and the asynchronous task a is re-executed.
如图3所示,是本申请异步任务统一处理方法第一实施例的流程图。As shown in FIG. 3, it is a flowchart of the first embodiment of the unified processing method for asynchronous tasks of the present application.
在本实施例中,处理器12执行存储器11中存储的异步任务统一处理系统10的计算机程序时实现异步任务统一处理方法的如下步骤:In the embodiment, when the processor 12 executes the computer program of the asynchronous task unified processing system 10 stored in the memory 11, the following steps are implemented for the asynchronous task unified processing method:
步骤S10,数据库初始化模块110根据异步任务的基础信息生成异步任务的脚本,将该脚本添加到数据库中。基础信息包括任务执行频率、预设值、业务名称和业务处理人。假设需要开发一个异步任务统一处理系统10时,数据库初始化模块110将任务执行频率、预设值、业务名称和业务处理人等基础信息进行定义生成脚本,添加到数据库4中。其中任务执行频率(如任务固定每30秒执行一次)、预设值(如预设值为20)、及业务名称包括业务类型名称和处理类型名称;业务处理人指各个处理类型对应的业务处理人。In step S10, the database initialization module 110 generates a script of the asynchronous task according to the basic information of the asynchronous task, and adds the script to the database. The basic information includes the task execution frequency, preset values, business name, and business processor. Assuming that an asynchronous task unified processing system 10 needs to be developed, the database initialization module 110 defines a basic generation information such as a task execution frequency, a preset value, a service name, and a service processor to generate a script, which is added to the database 4. The task execution frequency (such as the task is fixed every 30 seconds), the preset value (such as the preset value is 20), and the service name includes the service type name and the processing type name; the service processor refers to the service processing corresponding to each processing type. people.
步骤S20,代码初始化模块120在开发代码中添加异步任务的配置信息及异步任务类,在异步任务类中添加异步任务涉及的业务类型,设置每个业务类型涉及的处理类型,并为每个处理类型设置相应的业务逻辑。设置异步任务类,在异步任务类中添加异步任务相应的所有业务类型,在不同的业务类型中设置相应的所有处理类型,在不同的处理类型中设置相应的业务逻辑代码。业务类型用于大体区分不同的业务逻辑,处理类型用于在同一个业务类型下细分不同的业务逻辑。例如,例如设置某保险公司理赔系统的异步任务类,在异步任务类中添加异步任务的业务类型包括意外保险类A 1、旅游保险类A 2、健康保险类A 3、企业保险类A 4、财产保险类A 5等业务类型。其中意外保险类A 1对应的处理类型包括一年期交通意外险B 11、短期交通意外险B 12、航空意外险B 13、一年期人身意外险B 14和短期人身意外险B 15等处理类型。在一年期交通意外险B 11处理类型中设置一年期交通意外险业务逻辑C 11。同时,在开发代码中设置异步任务的配置信息,配置信息包括任务编码和任务组别。其中任务编码用于规范和快速查询一个异步任务对应的业务类型、处理类型和业务逻辑,例如,某异步任务的业务类型为意外保险类A 1,对应的处理类型为短期交通意外险B 12,则该异步任务的任务编码为A 1-B 12;任务组别用于将业务逻辑针对业务类型和处理类型进行分组存储。 Step S20, the code initialization module 120 adds the configuration information of the asynchronous task and the asynchronous task class in the development code, adds the business type involved in the asynchronous task in the asynchronous task class, sets the processing type involved in each service type, and performs for each processing The type sets the corresponding business logic. Set the asynchronous task class, add all the business types corresponding to the asynchronous task in the asynchronous task class, set all the corresponding processing types in different business types, and set the corresponding business logic codes in different processing types. The service type is used to roughly distinguish different business logics, and the processing type is used to subdivide different business logics under the same business type. For example, for example, an asynchronous task class of an insurance company claims system is set, and an service type of adding an asynchronous task in an asynchronous task class includes an accident insurance class A 1 , a travel insurance class A 2 , a health insurance class A 3 , a corporate insurance class A 4 , Property insurance class A 5 and other business types. Among them, the types of treatment corresponding to accident insurance class A 1 include one-year traffic accident insurance B 11 , short-term traffic accident insurance B 12 , aviation accident insurance B 13 , one-year personal accident insurance B 14 and short-term personal accident insurance B 15 Types of. Set the one-year traffic accident insurance business logic C 11 in the one-year traffic accident insurance B 11 treatment type. At the same time, the configuration information of the asynchronous task is set in the development code, and the configuration information includes the task code and the task group. Where tasks and encoding specification for a quick reference asynchronous tasks corresponding to the service type, service type, and processing logic, e.g., a service type of asynchronous tasks accident insurance A 1, corresponding to the processing type is the short-term traffic accident insurance B 12, Then the task of the asynchronous task is coded as A 1 -B 12 ; the task group is used to store the business logic in groups for the service type and the processing type.
步骤S30,接收模块130从客户端接收异步任务,将接收到的异步任务按 照时间先后顺序存放至任务列表。接收模块130通过网络2接收客户端3的异步任务,并将接收到的异步任务按照接收时间的先后顺序存放在任务列表中。例如,接收模块130先后接收到交通银行的异步任务:交通银行航班延误案件、交通银行飞机意外身故/残疾案件、交通银行境外游案件,并将交通银行航班延误案件、交通银行飞机意外身故/残疾案件、交通银行境外游案件这些异步任务按照接收时间的先后顺序存放在任务列表中。In step S30, the receiving module 130 receives the asynchronous task from the client, and stores the received asynchronous task in the chronological order to the task list. The receiving module 130 receives the asynchronous task of the client 3 through the network 2, and stores the received asynchronous tasks in the task list in the order of receiving time. For example, the receiving module 130 receives the asynchronous tasks of the Bank of Communications: the Bank of Communications flight delay case, the Bank of Communications accidental death/disability case, the Bank of Communications overseas travel case, and the Bank of Communications flight delay case, the Bank of Communications flight accidental death The asynchronous tasks of the disability case and the overseas travel case of the Bank of Communications are stored in the task list in the order of receiving time.
步骤S40,读取模块140从任务列表中读取最早接收到的异步任务。例如,读取模块140读取任务列表中最早接收到的异步任务为交通银行航班延误案件。In step S40, the reading module 140 reads the earliest received asynchronous task from the task list. For example, the reading module 140 reads the earliest received asynchronous task in the task list as a Bank of Communications flight delay case.
步骤S50,判断模块150判断该异步任务的业务类型是否为所述异步任务类中已定义的业务类型,若该异步任务的业务类型不是异步任务类中已定义的业务类型,则判断该异步任务的业务类型为未知业务类型,执行步骤S100;若该异步任务的业务类型是异步任务类中已定义的业务类型,则执行步骤S60。判断模块150判断读取的异步任务的业务类型是否为异步任务类中已定义的业务类型。假设异步任务的业务类型不是异步任务类中已定义的业务类型,则执行步骤S100;假设异步任务的业务类型是异步任务类中已定义的业务类型,则执行步骤S60。例如判断模块150判断读取的交通银行航班延误案件的业务类型为异步任务类中定义的意外保险类A 1,则执行步骤S60。 In step S50, the determining module 150 determines whether the service type of the asynchronous task is a defined service type in the asynchronous task class. If the service type of the asynchronous task is not a defined service type in the asynchronous task class, the asynchronous task is determined. The service type is an unknown service type, and step S100 is performed. If the service type of the asynchronous task is a defined service type in the asynchronous task class, step S60 is performed. The determining module 150 determines whether the service type of the read asynchronous task is a defined service type in the asynchronous task class. If the service type of the asynchronous task is not the defined service type in the asynchronous task class, step S100 is performed; if the service type of the asynchronous task is the defined service type in the asynchronous task class, step S60 is performed. For example, if the judgment module 150 determines that the business type of the read traffic bank flight delay case is the accident insurance class A 1 defined in the asynchronous task class, step S60 is performed.
步骤S60,判断模块150判断该异步任务的处理类型是否为所述业务类型中已定义的处理类型,若该异步任务的处理类型不是所述业务类型中已定义的处理类型,则判断该异步任务的处理类型为未知处理类型,执行步骤S100;若读取的异步任务的处理类型是所述业务类型中已定义的处理类型,则执行步骤S70。判断模块150判断读取的异步任务的处理类型是否为所述任务类型中已定义的处理类型。假设异步任务的处理类型不是所述业务类型中已定义的处理类型,则执行步骤S100;假设异步任务的处理类型是所述业务类型中已定义的处理类型,则执行步骤S70。例如判断模块150判断读取的交通银行航班延误案件的处理类型为意外保险类A 1中定义的一年期交通意外险B 11,则执行步骤S70。 In step S60, the determining module 150 determines whether the processing type of the asynchronous task is a processing type defined in the service type. If the processing type of the asynchronous task is not the processing type defined in the service type, determining the asynchronous task If the processing type of the asynchronous task is the processing type defined in the service type, step S70 is performed. The determining module 150 determines whether the processing type of the read asynchronous task is a processing type defined in the task type. Assuming that the processing type of the asynchronous task is not the processing type defined in the service type, step S100 is performed; if the processing type of the asynchronous task is the processing type defined in the service type, step S70 is performed. For example, the type of processing Bank of flights judgment module 150 judges read delay case for accident insurance as defined in A 1-year traffic accident insurance B 11, proceed to step S70.
步骤S70,当读取的业务类型的处理类型是所述业务类型中已定义的处理类型,执行相应的业务逻辑。例如判断模块150判断读取的交通银行航班延 误案件的处理类型为任务类型中定义的一年期交通意外险B 11,则执行一年期交通意外险业务逻辑。 Step S70: When the processing type of the read service type is a processing type defined in the service type, execute corresponding business logic. For example, the judging module 150 judges that the processing type of the read traffic bank flight delay case is the one-year traffic accident insurance B 11 defined in the task type, and executes the one-year traffic accident insurance business logic.
步骤S100,若执行相应的判断为否,则提示执行失败。若判断模块150执行相应的判断为否,则提示:执行失败。In step S100, if the corresponding judgment is negative, the execution failure is prompted. If the judgment module 150 performs the corresponding judgment to be no, the prompt: the execution fails.
本实施例提出的异步任务统一处理方法,在数据库中添加异步任务的基础信息定义的脚本;然后在异步任务类中设置所有的业务类型、处理类型及处理类型对应的业务逻辑,同时在开发代码中设置异步任务的配置信息;通过第一判断步骤和第二判断步骤使得不同的异步任务在对应的业务逻辑中处理,缩短开发时间,提高工作效率。The asynchronous task unified processing method proposed in this embodiment adds a script for defining the basic information of the asynchronous task in the database; then sets all the business logics corresponding to the business type, the processing type, and the processing type in the asynchronous task class, and simultaneously develops the code. The configuration information of the asynchronous task is set; the first determining step and the second determining step are performed to make different asynchronous tasks processed in the corresponding business logic, thereby shortening the development time and improving the working efficiency.
如图4所示,是本申请异步任务统一处理方法第二实施例的流程图。As shown in FIG. 4, it is a flowchart of the second embodiment of the method for uniformly processing asynchronous tasks of the present application.
在本实施例中,异步任务统一处理方法包括:步骤S10-步骤S140。其中,步骤S10-步骤S70和步骤S100与第一实施例中内容大致相同,这里不再赘述。In this embodiment, the asynchronous task unified processing method includes: Step S10 - Step S140. The steps S10 to S70 and the step S100 are substantially the same as those in the first embodiment, and details are not described herein again.
步骤S80,判断模块150判断相应的业务逻辑是否执行成功,若执行成功,则提示执行成功;反之,则提示执行失败。例如,判断模块150判断执行一年期交通意外险业务逻辑是否执行成功。假设执行成功,则执行步骤S90;假设执行失败,则执行步骤S100。In step S80, the determining module 150 determines whether the corresponding business logic is successfully executed. If the execution is successful, the execution is successful; otherwise, the execution fails. For example, the determination module 150 determines whether the execution of the one-year traffic accident insurance business logic is successful. Assuming that the execution is successful, step S90 is performed; if the execution fails, step S100 is performed.
步骤S90,若执行相应的业务逻辑成功,则提示执行成功。若判断模块150执行一年期交通意外险的业务逻辑执行成功,则提示:执行成功。In step S90, if the execution of the corresponding business logic is successful, the execution is prompted to be successful. If the judgment module 150 performs the business logic execution of the one-year traffic accident insurance successfully, it prompts: the execution is successful.
步骤S110,记录模块160记录每个异步任务的执行结果及执行失败的原因,并统计异步任务执行失败的次数,以统一的格式记录在同一份异步任务执行结果清单中,以预设方式反馈给相关人员。记录模块160记录异步任务的执行结果及异步任务执行失败的原因,并统计该异步任务执行失败的次数,最后以统一的格式记录在同一份异步任务执行结果清单中,以显示器13显示的方式反馈给软件开发工程师。例如交通银行航班延误案件执行失败,则记录模块160记录该异步任务的名称:交通银行航班延误案件、失败原因(如交通银行航班延误案件的业务类型不是异步任务类中已定义的业务类型)及执行失败的次数加1(如未处理此次任务前,失败次数为2,则处理此次任务后,失败次数为3)。处理完所有的异步任务后,将其结果以统一的格式记录在同一份异步任务执行结果清单中,以显示器13显示的方式反馈给软件开发 工程师。其中所述预设方式还包括邮件或短信等方式。In step S110, the recording module 160 records the execution result of each asynchronous task and the reason for the failure of the execution, and counts the number of times the asynchronous task fails to execute, and records it in the same asynchronous task execution result list in a unified format, and feeds back in a preset manner. Related personnel. The recording module 160 records the execution result of the asynchronous task and the reason for the asynchronous task execution failure, and counts the number of times the asynchronous task fails to execute, and finally records in the same asynchronous task execution result list in a unified format, and provides feedback in the manner displayed by the display 13. To a software development engineer. For example, if the Bank of Communications flight delay case fails to execute, the record module 160 records the name of the asynchronous task: the Bank of Communications flight delay case, the reason for the failure (for example, the service type of the Bank of Communications flight delay case is not the defined service type in the asynchronous task class) and The number of execution failures is increased by one. (If the number of failures is 2 before the task is processed, the number of failures after the task is 3). After all the asynchronous tasks have been processed, the results are recorded in a unified format in the same asynchronous task execution result list, and fed back to the software development engineer in the manner displayed by the display 13. The preset manner further includes a mail or a short message.
步骤S120,失败次数判断模块170判断该异步任务失败的次数是否大于预设值;若该异步任务失败的次数大于预设值,则执行步骤S130;若该异步任务失败的次数小于或等于预设值,则执行步骤S140。失败次数判断模块170判断该异步任务失败的次数是否大于预设值;假设该异步任务失败的次数大于预设值,则执行步骤S130;假设该异步任务失败的次数小于或等于预设值,则执行步骤S140。例如失败次数判断模块170判断交通银行航班延误案件处理失败的次数大于20次,则执行步骤S130。In step S120, the failure number determination module 170 determines whether the number of times the asynchronous task fails is greater than a preset value; if the number of failed asynchronous tasks is greater than a preset value, step S130 is performed; if the number of failed asynchronous tasks is less than or equal to a preset For the value, step S140 is performed. The number of failures determining module 170 determines whether the number of times the asynchronous task fails is greater than a preset value; if the number of failed asynchronous tasks is greater than a preset value, step S130 is performed; and if the number of failed asynchronous tasks is less than or equal to a preset value, Step S140 is performed. For example, if the number-of-failure determination module 170 determines that the number of times the bankruptcy flight delay case has failed to be processed is greater than 20 times, step S130 is performed.
步骤S130,若该异步任务失败的次数大于预设值,则提示:该异步任务失败次数超过预设值,不再执行该异步任务。例如交通银行航班延误案件处理失败的次数大于20次,则提示:交通银行航班延误案件失败次数超过20次,不再执行该任务。Step S130: If the number of failures of the asynchronous task is greater than a preset value, the prompting: the number of failed asynchronous tasks exceeds a preset value, and the asynchronous task is no longer executed. For example, if the Bank of Communications flight delay case fails to process more than 20 times, it indicates that the Bank of Communications flight delay case has failed more than 20 times and the task is no longer executed.
步骤S140,若该异步任务失败的次数小于或等于预设值,则判断模块150对失败原因进行处理,并重新启动执行该异步任务。例如,交通银行航班延误案件处理失败的次数小于或等于20次,则软件开发工程师根据异步任务执行结果清单中异步任务的失败原因添加相应的业务类型或处理类型并将交通银行航班延误案件放到新的任务列表中重新启动执行该异步任务。In step S140, if the number of failures of the asynchronous task is less than or equal to the preset value, the determining module 150 processes the failure reason and restarts the execution of the asynchronous task. For example, if the number of failures of the Bank of Communications flight delay case is less than or equal to 20 times, the software development engineer adds the corresponding service type or processing type according to the failure reason of the asynchronous task in the asynchronous task execution result list and puts the Bank of Communications flight delay case to Restart the asynchronous task in the new task list.
相比于第一实施例,本实施例提出的异步任务统一处理方法,将在数据库中添加异步任务的基础信息定义的脚本;然后在异步任务类中设置所有的业务类型、处理类型及处理类型对应的业务逻辑,同时在开发代码中设置异步任务的配置信息;通过第一判断步骤、第二判断步骤、第三判断步骤及第四判断步骤使得不同的异步任务在对应的业务逻辑中处理,并统计失败次数和反馈异步任务失败的原因,方便软件开发工程师针对失败原因解决问题,缩短开发时间,提高工作效率。Compared with the first embodiment, the asynchronous task unified processing method proposed in this embodiment adds a script defined by the basic information of the asynchronous task in the database; then sets all the service types, processing types, and processing types in the asynchronous task class. Corresponding business logic, at the same time, setting configuration information of the asynchronous task in the development code; and processing the different asynchronous tasks in the corresponding business logic by using the first determining step, the second determining step, the third determining step, and the fourth determining step, It also counts the number of failures and the reasons for the failure of asynchronous tasks. It is convenient for software development engineers to solve problems for failure reasons, shorten development time, and improve work efficiency.
此外,本申请实施例还提出一种计算机可读存储介质,所述计算机可读存储介质中包括异步任务统一处理系统10,所述异步任务统一处理系统10被处理器执行时实现如下操作:In addition, the embodiment of the present application further provides a computer readable storage medium, which includes an asynchronous task unified processing system 10, and when the asynchronous task unified processing system 10 is executed by the processor, the following operations are implemented:
数据库初始化步骤:根据异步任务的基础信息生成异步任务的脚本,将该脚本添加到数据库中;Database initialization step: generate a script of the asynchronous task according to the basic information of the asynchronous task, and add the script to the database;
代码初始化步骤:在开发代码中添加异步任务的配置信息及异步任务类,在异步任务类中添加异步任务涉及的业务类型,设置每个业务类型涉及的处理类型,并为每个处理类型设置相应的业务逻辑;Code initialization step: Add the configuration information of the asynchronous task and the asynchronous task class in the development code, add the business type involved in the asynchronous task in the asynchronous task class, set the processing type involved in each business type, and set the corresponding processing type for each processing type. Business logic
接收步骤:从客户端接收异步任务,将接收到的异步任务按照时间先后顺序存放至任务列表;Receiving step: receiving an asynchronous task from the client, and storing the received asynchronous tasks in a chronological order to the task list;
读取步骤:从任务列表中读取最早接收到的异步任务;Reading step: reading the earliest received asynchronous task from the task list;
第一判断步骤:判断该异步任务的业务类型是否为所述异步任务类中已定义的业务类型,若该异步任务的业务类型不是异步任务类中已定义的业务类型,则判断该异步任务的业务类型为未知业务类型,提示执行失败,若该异步任务的业务类型是异步任务类中已定义的业务类型,则执行第二判断步骤;及The first determining step is: determining whether the service type of the asynchronous task is a defined service type in the asynchronous task class, and if the service type of the asynchronous task is not a defined service type in the asynchronous task class, determining the asynchronous task The service type is an unknown service type, and the execution fails. If the service type of the asynchronous task is a defined service type in the asynchronous task class, the second determining step is performed;
第二判断步骤:判断该异步任务的处理类型是否为所述业务类型中已定义的处理类型,若该异步任务的处理类型不是所述业务类型中已定义的处理类型,则判断该异步任务的处理类型为未知处理类型,提示执行失败,若该异步任务的处理类型是所述业务类型中已定义的处理类型,则执行相应的业务逻辑。a second determining step: determining whether the processing type of the asynchronous task is a processing type defined in the service type, and if the processing type of the asynchronous task is not a processing type defined in the service type, determining the asynchronous task The processing type is an unknown processing type, indicating that the execution fails. If the processing type of the asynchronous task is a defined processing type in the business type, the corresponding business logic is executed.
优选地,该方法还包括:Preferably, the method further comprises:
第三判断步骤:判断相应的业务逻辑是否执行成功,若执行成功,则提示执行成功;反之,则提示执行失败。The third determining step is: determining whether the corresponding business logic is successfully executed. If the execution is successful, the execution is successful; otherwise, the execution is failed.
优选地,所述第一判断步骤还包括:Preferably, the first determining step further includes:
若读取的异步任务的业务类型不是异步任务类中已定义的业务类型,则提示该异步任务的业务类型为未知业务类型,并在异步任务类中添加相应的业务类型。If the service type of the asynchronous task is not the defined service type in the asynchronous task class, the service type of the asynchronous task is prompted to be an unknown service type, and the corresponding service type is added in the asynchronous task class.
优选地,所述第二判断步骤还包括:Preferably, the second determining step further comprises:
若读取的异步任务的处理类型不是所述业务类型中已定义的处理类型,则提示该异步任务的处理类型为未知处理类型,并在所述业务类型中添加相应的处理类型。If the processing type of the read asynchronous task is not the processing type defined in the service type, the processing type of the asynchronous task is prompted to be an unknown processing type, and a corresponding processing type is added to the service type.
优选地,该方法还包括:Preferably, the method further comprises:
记录步骤:记录每个异步任务的执行结果及执行失败的原因,并统计异步任务执行失败的次数,以统一的格式记录在同一份异步任务执行结果清单 中,以预设方式反馈给相关人员。Recording step: record the execution result of each asynchronous task and the reason for the failure, and count the number of failed asynchronous task executions, record them in the same asynchronous task execution result list in a unified format, and feed back to relevant personnel in a preset manner.
优选地,该方法还包括:Preferably, the method further comprises:
第四判断步骤:判断该异步任务失败的次数是否大于预设值;The fourth determining step is: determining whether the number of times the asynchronous task fails is greater than a preset value;
若该异步任务失败的次数大于预设值,则提示该异步任务失败次数超过预设值,不再执行该任务;If the number of times the asynchronous task fails to be greater than the preset value, the number of failed asynchronous tasks exceeds a preset value, and the task is no longer executed;
若该异步任务失败的次数小于或等于预设值,则重新启动执行该异步任务。If the number of times the asynchronous task fails is less than or equal to the preset value, the asynchronous task is restarted.
本申请之计算机可读存储介质的具体实施方式与上述异步任务统一处理方法的具体实施方式大致相同,在此不再赘述。The specific implementation manner of the computer readable storage medium of the present application is substantially the same as the specific implementation method of the above-mentioned asynchronous task unified processing method, and details are not described herein again.
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。The serial numbers of the embodiments of the present application are merely for the description, and do not represent the advantages and disadvantages of the embodiments.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在如上所述的一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the foregoing embodiment method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be through hardware, but in many cases, the former is better. Implementation. Based on such understanding, the technical solution of the present application, which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM as described above). , a disk, an optical disk, including a number of instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the methods described in the various embodiments of the present application.
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。The above is only a preferred embodiment of the present application, and is not intended to limit the scope of the patent application, and the equivalent structure or equivalent process transformations made by the specification and the drawings of the present application, or directly or indirectly applied to other related technical fields. The same is included in the scope of patent protection of this application.

Claims (20)

  1. 一种异步任务统一处理方法,其特征在于,所述方法包括:An asynchronous task unified processing method, the method comprising:
    数据库初始化步骤:根据异步任务的基础信息生成异步任务的脚本,将该脚本添加到数据库中;Database initialization step: generate a script of the asynchronous task according to the basic information of the asynchronous task, and add the script to the database;
    代码初始化步骤:在开发代码中添加异步任务的配置信息及异步任务类,在异步任务类中添加异步任务涉及的业务类型,设置每个业务类型涉及的处理类型,并为每个处理类型设置相应的业务逻辑;Code initialization step: Add the configuration information of the asynchronous task and the asynchronous task class in the development code, add the business type involved in the asynchronous task in the asynchronous task class, set the processing type involved in each business type, and set the corresponding processing type for each processing type. Business logic
    接收步骤:从客户端接收异步任务,将接收到的异步任务按照时间先后顺序存放至任务列表;Receiving step: receiving an asynchronous task from the client, and storing the received asynchronous tasks in a chronological order to the task list;
    读取步骤:从任务列表中读取最早接收到的异步任务;Reading step: reading the earliest received asynchronous task from the task list;
    第一判断步骤:判断该异步任务的业务类型是否为所述异步任务类中已定义的业务类型,若该异步任务的业务类型不是异步任务类中已定义的业务类型,则判断该异步任务的业务类型为未知业务类型,若该异步任务的业务类型是异步任务类中已定义的业务类型,则执行第二判断步骤;及The first determining step is: determining whether the service type of the asynchronous task is a defined service type in the asynchronous task class, and if the service type of the asynchronous task is not a defined service type in the asynchronous task class, determining the asynchronous task The service type is an unknown service type, and if the service type of the asynchronous task is a defined service type in the asynchronous task class, performing a second determining step;
    第二判断步骤:判断该异步任务的处理类型是否为所述业务类型中已定义的处理类型,若该异步任务的处理类型不是所述业务类型中已定义的处理类型,则判断该异步任务的处理类型为未知处理类型,若该异步任务的处理类型是所述业务类型中已定义的处理类型,则执行相应的业务逻辑。a second determining step: determining whether the processing type of the asynchronous task is a processing type defined in the service type, and if the processing type of the asynchronous task is not a processing type defined in the service type, determining the asynchronous task The processing type is an unknown processing type. If the processing type of the asynchronous task is a defined processing type in the service type, the corresponding business logic is executed.
  2. 根据权利要求1所述的异步任务统一处理方法,其特征在于,该方法还包括:The method for processing asynchronous tasks according to claim 1, wherein the method further comprises:
    第三判断步骤:判断相应的业务逻辑是否执行成功,若执行成功,则提示执行成功;反之,则提示执行失败。The third determining step is: determining whether the corresponding business logic is successfully executed. If the execution is successful, the execution is successful; otherwise, the execution is failed.
  3. 根据权利要求1所述的异步任务统一处理方法,其特征在于,所述第一判断步骤还包括:The method for processing the asynchronous task according to claim 1, wherein the first determining step further comprises:
    若读取的异步任务的业务类型不是异步任务类中已定义的业务类型,则提示该异步任务的业务类型为未知业务类型,并在异步任务类中添加相应的业务类型。If the service type of the asynchronous task is not the defined service type in the asynchronous task class, the service type of the asynchronous task is prompted to be an unknown service type, and the corresponding service type is added in the asynchronous task class.
  4. 根据权利要求1所述的异步任务统一处理方法,其特征在于,所述第二判断步骤还包括:The method for processing the asynchronous task according to claim 1, wherein the second determining step further comprises:
    若读取的异步任务的处理类型不是所述业务类型中已定义的处理类型, 则提示该异步任务的处理类型为未知处理类型,并在所述业务类型中添加相应的处理类型。If the processing type of the read asynchronous task is not the processing type defined in the service type, the processing type of the asynchronous task is prompted to be an unknown processing type, and a corresponding processing type is added in the service type.
  5. 根据权利要求1至4任一项所述的异步任务统一处理方法,其特征在于,该方法还包括:The method for processing asynchronous tasks according to any one of claims 1 to 4, further comprising:
    记录步骤:记录每个异步任务的执行结果及执行失败的原因,并统计异步任务执行失败的次数,以统一的格式记录在同一份异步任务执行结果清单中,以预设方式反馈给相关人员。Recording step: record the execution result of each asynchronous task and the reason for the failure, and count the number of failed asynchronous task executions, record them in the same asynchronous task execution result list in a unified format, and feed back to relevant personnel in a preset manner.
  6. 根据权利要求1所述的异步任务统一处理方法,其特征在于,该方法还包括:The method for processing asynchronous tasks according to claim 1, wherein the method further comprises:
    第四判断步骤:判断该异步任务失败的次数是否大于预设值;The fourth determining step is: determining whether the number of times the asynchronous task fails is greater than a preset value;
    若该异步任务失败的次数大于预设值,则提示该异步任务失败次数超过预设值,不再执行该任务;If the number of times the asynchronous task fails to be greater than the preset value, the number of failed asynchronous tasks exceeds a preset value, and the task is no longer executed;
    若该异步任务失败的次数小于或等于预设值,则重新启动执行该异步任务。If the number of times the asynchronous task fails is less than or equal to the preset value, the asynchronous task is restarted.
  7. 根据权利要求1所述的异步任务统一处理方法,其特征在于,所述业务类型用于大体区分不同的业务逻辑,处理类型用于在同一个业务类型下细分不同的业务逻辑。The method for processing asynchronous tasks according to claim 1, wherein the service type is used to roughly distinguish different business logics, and the processing type is used to subdivide different business logics under the same service type.
  8. 一种电子装置,其特征在于,所述装置包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的异步任务统一处理系统,所述异步任务统一处理系统被所述处理器执行,可实现如下步骤:An electronic device, comprising: a memory, a processor, and an asynchronous task unified processing system stored on the memory and operable on the processor, wherein the asynchronous task unified processing system is The processor executes, and the following steps can be implemented:
    数据库初始化步骤:根据异步任务的基础信息生成异步任务的脚本,将该脚本添加到数据库中;Database initialization step: generate a script of the asynchronous task according to the basic information of the asynchronous task, and add the script to the database;
    代码初始化步骤:在开发代码中添加异步任务的配置信息及异步任务类,在异步任务类中添加异步任务涉及的业务类型,设置每个业务类型涉及的处理类型,并为每个处理类型设置相应的业务逻辑;Code initialization step: Add the configuration information of the asynchronous task and the asynchronous task class in the development code, add the business type involved in the asynchronous task in the asynchronous task class, set the processing type involved in each business type, and set the corresponding processing type for each processing type. Business logic
    接收步骤:从客户端接收异步任务,将接收到的异步任务按照时间先后顺序存放至任务列表;Receiving step: receiving an asynchronous task from the client, and storing the received asynchronous tasks in a chronological order to the task list;
    读取步骤:从任务列表中读取最早接收到的异步任务;Reading step: reading the earliest received asynchronous task from the task list;
    第一判断步骤:判断该异步任务的业务类型是否为所述异步任务类中已定义的业务类型,若该异步任务的业务类型不是异步任务类中已定义的业务 类型,则判断该异步任务的业务类型为未知业务类型,若该异步任务的业务类型是异步任务类中已定义的业务类型,则执行第二判断步骤;及The first determining step is: determining whether the service type of the asynchronous task is a defined service type in the asynchronous task class, and if the service type of the asynchronous task is not a defined service type in the asynchronous task class, determining the asynchronous task The service type is an unknown service type, and if the service type of the asynchronous task is a defined service type in the asynchronous task class, performing a second determining step;
    第二判断步骤:判断该异步任务的处理类型是否为所述业务类型中已定义的处理类型,若该异步任务的处理类型不是所述业务类型中已定义的处理类型,则判断该异步任务的处理类型为未知处理类型,若该异步任务的处理类型是所述业务类型中已定义的处理类型,则执行相应的业务逻辑。a second determining step: determining whether the processing type of the asynchronous task is a processing type defined in the service type, and if the processing type of the asynchronous task is not a processing type defined in the service type, determining the asynchronous task The processing type is an unknown processing type. If the processing type of the asynchronous task is a defined processing type in the service type, the corresponding business logic is executed.
  9. 根据权利要求8所述的电子装置,其特征在于,所述异步任务统一处理系统被所述处理器执行,还可实现如下步骤:The electronic device according to claim 8, wherein the asynchronous task unified processing system is executed by the processor, and the following steps are also implemented:
    第三判断步骤:判断相应的业务逻辑是否执行成功,若执行成功,则提示执行成功;反之,则提示执行失败。The third determining step is: determining whether the corresponding business logic is successfully executed. If the execution is successful, the execution is successful; otherwise, the execution is failed.
  10. 根据权利要求8所述的电子装置,其特征在于,所述第一判断步骤还包括:The electronic device according to claim 8, wherein the first determining step further comprises:
    若读取的异步任务的业务类型不是异步任务类中已定义的业务类型,则提示该异步任务的业务类型为未知业务类型,并在异步任务类中添加相应的业务类型。If the service type of the asynchronous task is not the defined service type in the asynchronous task class, the service type of the asynchronous task is prompted to be an unknown service type, and the corresponding service type is added in the asynchronous task class.
  11. 根据权利要求8所述的电子装置,其特征在于,所述第二判断步骤还包括:The electronic device according to claim 8, wherein the second determining step further comprises:
    若读取的异步任务的处理类型不是所述业务类型中已定义的处理类型,则提示该异步任务的处理类型为未知处理类型,并在所述业务类型中添加相应的处理类型。If the processing type of the read asynchronous task is not the processing type defined in the service type, the processing type of the asynchronous task is prompted to be an unknown processing type, and a corresponding processing type is added to the service type.
  12. 根据权利要求8至11任一项所述的电子装置,其特征在于,所述异步任务统一处理系统被所述处理器执行,还可实现如下步骤:The electronic device according to any one of claims 8 to 11, wherein the asynchronous task unified processing system is executed by the processor, and the following steps are also implemented:
    记录步骤:记录每个异步任务的执行结果及执行失败的原因,并统计异步任务执行失败的次数,以统一的格式记录在同一份异步任务执行结果清单中,以预设方式反馈给相关人员。Recording step: record the execution result of each asynchronous task and the reason for the failure, and count the number of failed asynchronous task executions, record them in the same asynchronous task execution result list in a unified format, and feed back to relevant personnel in a preset manner.
  13. 根据权利要求8所述的电子装置,其特征在于,所述异步任务统一处理系统被所述处理器执行,还可实现如下步骤:The electronic device according to claim 8, wherein the asynchronous task unified processing system is executed by the processor, and the following steps are also implemented:
    第四判断步骤:判断该异步任务失败的次数是否大于预设值;The fourth determining step is: determining whether the number of times the asynchronous task fails is greater than a preset value;
    若该异步任务失败的次数大于预设值,则提示该异步任务失败次数超过预设值,不再执行该任务;If the number of times the asynchronous task fails to be greater than the preset value, the number of failed asynchronous tasks exceeds a preset value, and the task is no longer executed;
    若该异步任务失败的次数小于或等于预设值,则重新启动执行该异步任务。If the number of times the asynchronous task fails is less than or equal to the preset value, the asynchronous task is restarted.
  14. 根据权利要求8所述的电子装置,其特征在于,所述业务类型用于大体区分不同的业务逻辑,处理类型用于在同一个业务类型下细分不同的业务逻辑。The electronic device according to claim 8, wherein the service type is used to roughly distinguish different business logics, and the processing type is used to subdivide different business logics under the same service type.
  15. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中包括异步任务统一处理系统,所述统异步任务统一处理系统被处理器执行时实现如下步骤:A computer readable storage medium, comprising: an asynchronous task unified processing system, wherein the unified asynchronous task unified processing system is executed by a processor to implement the following steps:
    数据库初始化步骤:根据异步任务的基础信息生成异步任务的脚本,将该脚本添加到数据库中;Database initialization step: generate a script of the asynchronous task according to the basic information of the asynchronous task, and add the script to the database;
    代码初始化步骤:在开发代码中添加异步任务的配置信息及异步任务类,在异步任务类中添加异步任务涉及的业务类型,设置每个业务类型涉及的处理类型,并为每个处理类型设置相应的业务逻辑;Code initialization step: Add the configuration information of the asynchronous task and the asynchronous task class in the development code, add the business type involved in the asynchronous task in the asynchronous task class, set the processing type involved in each business type, and set the corresponding processing type for each processing type. Business logic
    接收步骤:从客户端接收异步任务,将接收到的异步任务按照时间先后顺序存放至任务列表;Receiving step: receiving an asynchronous task from the client, and storing the received asynchronous tasks in a chronological order to the task list;
    读取步骤:从任务列表中读取最早接收到的异步任务;Reading step: reading the earliest received asynchronous task from the task list;
    第一判断步骤:判断该异步任务的业务类型是否为所述异步任务类中已定义的业务类型,若该异步任务的业务类型不是异步任务类中已定义的业务类型,则判断该异步任务的业务类型为未知业务类型,若该异步任务的业务类型是异步任务类中已定义的业务类型,则执行第二判断步骤;及The first determining step is: determining whether the service type of the asynchronous task is a defined service type in the asynchronous task class, and if the service type of the asynchronous task is not a defined service type in the asynchronous task class, determining the asynchronous task The service type is an unknown service type, and if the service type of the asynchronous task is a defined service type in the asynchronous task class, performing a second determining step;
    第二判断步骤:判断该异步任务的处理类型是否为所述业务类型中已定义的处理类型,若该异步任务的处理类型不是所述业务类型中已定义的处理类型,则判断该异步任务的处理类型为未知处理类型,若该异步任务的处理类型是所述业务类型中已定义的处理类型,则执行相应的业务逻辑。a second determining step: determining whether the processing type of the asynchronous task is a processing type defined in the service type, and if the processing type of the asynchronous task is not a processing type defined in the service type, determining the asynchronous task The processing type is an unknown processing type. If the processing type of the asynchronous task is a defined processing type in the service type, the corresponding business logic is executed.
  16. 根据权利要求15所述的计算机可读存储介质,其特征在于,所述异步任务统一处理系统被所述处理器执行,还可实现如下步骤:The computer readable storage medium according to claim 15, wherein the asynchronous task unified processing system is executed by the processor, and the following steps are also implemented:
    第三判断步骤:判断相应的业务逻辑是否执行成功,若执行成功,则提示执行成功;反之,则提示执行失败。The third determining step is: determining whether the corresponding business logic is successfully executed. If the execution is successful, the execution is successful; otherwise, the execution is failed.
  17. 根据权利要求15所述的计算机可读存储介质,其特征在于,所述第一判断步骤还包括:The computer readable storage medium according to claim 15, wherein the first determining step further comprises:
    若读取的异步任务的业务类型不是异步任务类中已定义的业务类型,则提示该异步任务的业务类型为未知业务类型,并在异步任务类中添加相应的业务类型。If the service type of the asynchronous task is not the defined service type in the asynchronous task class, the service type of the asynchronous task is prompted to be an unknown service type, and the corresponding service type is added in the asynchronous task class.
  18. 根据权利要求15所述的计算机可读存储介质,其特征在于,所述第二判断步骤还包括:The computer readable storage medium according to claim 15, wherein the second determining step further comprises:
    若读取的异步任务的处理类型不是所述业务类型中已定义的处理类型,则提示该异步任务的处理类型为未知处理类型,并在所述业务类型中添加相应的处理类型。If the processing type of the read asynchronous task is not the processing type defined in the service type, the processing type of the asynchronous task is prompted to be an unknown processing type, and a corresponding processing type is added to the service type.
  19. 根据权利要求15至18任一项所述的计算机可读存储介质,其特征在于,所述异步任务统一处理系统被所述处理器执行,还可实现如下步骤:The computer readable storage medium according to any one of claims 15 to 18, wherein the asynchronous task unified processing system is executed by the processor, and the following steps are also implemented:
    记录步骤:记录每个异步任务的执行结果及执行失败的原因,并统计异步任务执行失败的次数,以统一的格式记录在同一份异步任务执行结果清单中,以预设方式反馈给相关人员。Recording step: record the execution result of each asynchronous task and the reason for the failure, and count the number of failed asynchronous task executions, record them in the same asynchronous task execution result list in a unified format, and feed back to relevant personnel in a preset manner.
  20. 根据权利要求15所述的计算机可读存储介质,其特征在于,所述异步任务统一处理系统被所述处理器执行,还可实现如下步骤:The computer readable storage medium according to claim 15, wherein the asynchronous task unified processing system is executed by the processor, and the following steps are also implemented:
    第四判断步骤:判断该异步任务失败的次数是否大于预设值;The fourth determining step is: determining whether the number of times the asynchronous task fails is greater than a preset value;
    若该异步任务失败的次数大于预设值,则提示该异步任务失败次数超过预设值,不再执行该任务;If the number of times the asynchronous task fails to be greater than the preset value, the number of failed asynchronous tasks exceeds a preset value, and the task is no longer executed;
    若该异步任务失败的次数小于或等于预设值,则重新启动执行该异步任务。If the number of times the asynchronous task fails is less than or equal to the preset value, the asynchronous task is restarted.
PCT/CN2018/077672 2017-09-30 2018-02-28 Asynchronous task unified processing method and apparatus, and storage medium WO2019062020A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710916221.7A CN108427599A (en) 2017-09-30 2017-09-30 Method, apparatus and storage medium is uniformly processed in asynchronous task
CN201710916221.7 2017-09-30

Publications (1)

Publication Number Publication Date
WO2019062020A1 true WO2019062020A1 (en) 2019-04-04

Family

ID=63155653

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/077672 WO2019062020A1 (en) 2017-09-30 2018-02-28 Asynchronous task unified processing method and apparatus, and storage medium

Country Status (2)

Country Link
CN (1) CN108427599A (en)
WO (1) WO2019062020A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109309712B (en) * 2018-09-07 2022-06-17 平安科技(深圳)有限公司 Data transmission method based on interface asynchronous call, server and storage medium
CN113011907A (en) * 2020-12-18 2021-06-22 腾讯科技(深圳)有限公司 Data processing method, device, storage medium and equipment
CN116775314A (en) * 2023-08-18 2023-09-19 国能日新科技股份有限公司 Asynchronous processing method, device and equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100198908A1 (en) * 2009-01-30 2010-08-05 Oracle International Corporation Implementing Asynchronous Processes on a Mobile Client
CN106293922A (en) * 2016-08-16 2017-01-04 天津西瑞尔信息工程有限公司 Asynchronous task processing method and system
CN106648847A (en) * 2016-10-14 2017-05-10 郑州云海信息技术有限公司 Asynchronous task management method and device in cloud computing operation system
CN106980546A (en) * 2016-01-18 2017-07-25 阿里巴巴集团控股有限公司 A kind of task asynchronous execution method, apparatus and system

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8713571B2 (en) * 2010-02-17 2014-04-29 Microsoft Corporation Asynchronous task execution
US9170798B2 (en) * 2012-03-02 2015-10-27 Vmware, Inc. System and method for customizing a deployment plan for a multi-tier application in a cloud infrastructure
CN105389209B (en) * 2015-12-25 2019-04-26 中国建设银行股份有限公司 A kind of asynchronous batch tasks processing method and system
CN105700937A (en) * 2016-01-04 2016-06-22 北京百度网讯科技有限公司 Multi-thread task processing method and device
CN107135188B (en) * 2016-02-29 2020-09-25 阿里巴巴集团控股有限公司 Method, device and system for realizing services of financial information exchange (FIX) protocol

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100198908A1 (en) * 2009-01-30 2010-08-05 Oracle International Corporation Implementing Asynchronous Processes on a Mobile Client
CN106980546A (en) * 2016-01-18 2017-07-25 阿里巴巴集团控股有限公司 A kind of task asynchronous execution method, apparatus and system
CN106293922A (en) * 2016-08-16 2017-01-04 天津西瑞尔信息工程有限公司 Asynchronous task processing method and system
CN106648847A (en) * 2016-10-14 2017-05-10 郑州云海信息技术有限公司 Asynchronous task management method and device in cloud computing operation system

Also Published As

Publication number Publication date
CN108427599A (en) 2018-08-21

Similar Documents

Publication Publication Date Title
US10241848B2 (en) Personalized diagnostics, troubleshooting, recovery, and notification based on application state
US9350747B2 (en) Methods and systems for malware analysis
US10033600B2 (en) Client application integration for workflows
US11503070B2 (en) Techniques for classifying a web page based upon functions used to render the web page
US11620444B2 (en) Providing action associated with event detected within communication
US10614208B1 (en) Management of login information affected by a data breach
US10175954B2 (en) Method of processing big data, including arranging icons in a workflow GUI by a user, checking process availability and syntax, converting the workflow into execution code, monitoring the workflow, and displaying associated information
US10394633B2 (en) On-demand or dynamic diagnostic and recovery operations in conjunction with a support service
US10956309B2 (en) Source code management systems and methods
CN111880967A (en) File backup method, device, medium and electronic equipment in cloud scene
WO2019062020A1 (en) Asynchronous task unified processing method and apparatus, and storage medium
WO2019061998A1 (en) Intelligent breakpoint distribution method, electronic device, and computer readable storage medium
US10185613B2 (en) Error determination from logs
WO2019136813A1 (en) Api file management method, server, and storage medium
US9785724B2 (en) Secondary queue for index process
US11023479B2 (en) Managing asynchronous analytics operation based on communication exchange
CN113515265B (en) Site configuration method, device, equipment and computer readable storage medium
US9921901B2 (en) Alerting service desk users of business services outages
CN112818204A (en) Service processing method, device, equipment and storage medium
JP2023553587A (en) Providing application error data for use by third party library development systems
CN110958243A (en) Network vulnerability submitting method and device, storage medium and electronic equipment
US8935343B2 (en) Instant messaging network resource validation
US20180089450A1 (en) Taxonomy-facilitated actions for content
CN112445790B (en) Report data storage method, device, equipment and medium
US11061759B1 (en) System and method for restoring deleted objects and their assignments to other objects based on any deletion of the other objects

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18860474

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 24.09.2020)

122 Ep: pct application non-entry in european phase

Ref document number: 18860474

Country of ref document: EP

Kind code of ref document: A1