CN111651279A - Method and system for processing business process - Google Patents

Method and system for processing business process Download PDF

Info

Publication number
CN111651279A
CN111651279A CN202010106769.7A CN202010106769A CN111651279A CN 111651279 A CN111651279 A CN 111651279A CN 202010106769 A CN202010106769 A CN 202010106769A CN 111651279 A CN111651279 A CN 111651279A
Authority
CN
China
Prior art keywords
processing
logic
asynchronous
business process
thread
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.)
Pending
Application number
CN202010106769.7A
Other languages
Chinese (zh)
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.)
China Unionpay Co Ltd
Original Assignee
China Unionpay 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 China Unionpay Co Ltd filed Critical China Unionpay Co Ltd
Priority to CN202010106769.7A priority Critical patent/CN111651279A/en
Publication of CN111651279A publication Critical patent/CN111651279A/en
Pending legal-status Critical Current

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/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • G06F9/548Object oriented; Remote method invocation [RMI]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/34Network arrangements or protocols for supporting network services or applications involving the movement of software or configuration parameters 

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention provides a method for processing a business process, which comprises the following steps: creating an asynchronous business process, wherein the asynchronous business process is used for processing asynchronous tasks; calling a service thread for processing according to the step-by-step processing logic in the asynchronous task; releasing the current service thread after each step processing logic is executed so as to be called by other step processing logics in the step processing logics; and after the step processing logic is finished, the asynchronous task is finished. By using the invention, a large amount of services can be driven by adopting a small amount of threads, thereby effectively reducing the number of threads required to be created by the computer and reducing the bottleneck of a single machine.

Description

Method and system for processing business process
Technical Field
The present application relates to the field of computer software, and more particularly, to the field of computer software for asynchronously processing business logic.
Background
In computer software applications, such as Java applications, it is often the case that some business logic occasionally slows down. If the application does not properly handle the slowed business logic, then this portion of the accidentally slowed business logic may deplete the thread resources of the computer, thereby significantly reducing the throughput capability of the computer processor. This causes application false death, which directly affects other service logic that can be normally processed.
Typical slowed business logic such as remote service calls, disk reads and writes, database access, crypto operations, etc. A common approach is to set a constant amount of operating time for such potentially slow service logic, and to terminate the service logic beyond the set operating time. And also sets a fairly large (often thousands) thread pool for the business logic to process.
In order to implement the scenario of massive concurrent business logic, some related solutions are proposed, in which there is a Thread-Per-Request (Thread-Per-Request) model for processing multiple requests. In a thread model for each request, when a request (business logic) enters the program framework or program container, the program framework or program container will take an idle thread from the thread pool or create a new thread for the request. The program framework or application container then processes the request using the newly created thread. In a per-request per-thread model, a request will always monopolize a processing thread regardless of how many processing steps the process may go through, but before processing the completion request and getting a response. Because computer thread resources are expensive and the number of threads which can be created by a single machine is limited, the model still cannot cope with the scenes of tens of thousands or even tens of thousands of massive concurrent service logics.
In order to solve the problem of thread blocking, the person skilled in the art proposes a servlet3.0 asynchronous model on the basis of a thread model corresponding to each request, and proposes a non-blocking type NIO thread facing a buffer area. When the NIO thread receives a request, the request is handed to a Servlet container thread for preliminary processing. After the container thread initially processes the request, the container thread delivers the request to a specific service thread for processing, and the original container thread returns for other requests. And after the business thread processing is finished, generating a response message and delivering the response message to the IO thread to return to the client. In the servlet3.0 asynchronous model, container threads are not blocked any more, but service threads for processing requests are still blocked, and only lightweight concurrency scenarios can be solved, and the fundamental problem is not solved.
In Java, an rxjava (reactive extensions Java) asynchronous model has also been proposed for more convenient handling of asynchronous data streams. The RxJava model provides a consistent programming interface based on observer patterns, helping users to more conveniently process asynchronous data streams. In the RxJava model, requests are wrapped through a series of operators. For this request, a watcher object and a data source object are first created. When the data source generates new data, the observer objects process one by one and deliver to the downstream operators for processing. Thus, a request need not monopolize one business thread, but can get a response in an asynchronous manner. However, particularly inside the operator method, if a time-consuming remote invocation task still blocks a thread, and there is a high possibility that the business model and the observer model of different stages do not match in a long flow. Meanwhile, the programming threshold and complexity of the RxJava model are too high, and the applicable scene is limited.
Aiming at a large-scale mass concurrent service scene, the existing processing scheme has the problems that the number of threads is limited, the whole processing process needs to monopolize thread resources, and the normal processing of other requests is influenced when the processing of some requests is slowed down.
Disclosure of Invention
In view of the above problems, the present invention provides an effective service orchestration processing method and system, which provide stable processing capability for applications in a massive concurrent scenario.
According to a first aspect of the present disclosure, a method for processing a business process is provided, including: creating an asynchronous business process, wherein the asynchronous business process is used for processing asynchronous tasks; calling a service thread for processing according to the step-by-step processing logic in the asynchronous task; releasing the current service thread after each step processing logic is executed so as to be called by other step processing logics in the step processing logics; and after the step processing logic is finished, the asynchronous task is finished.
Optionally, when the step processing logic includes a processing logic with an indefinite duration, the service thread that is processing the processing logic with indefinite duration is released for other step processing logics in the step processing logic to call, and after a response of the processing logic with indefinite duration is obtained, the idle service thread is called again to continue processing.
The method of processing a business process as described above, optionally further comprising, based on the demand of the step processing logic for business threads, the step processing logic being divided into one or more of: initial processing logic, asynchronous processing logic, subsequent processing logic, timeout processing logic, and exception handling logic.
The method for processing a business process as described above, optionally further comprising assigning the asynchronous task to a different business thread pool, and invoking a business thread in the different business thread pool by dividing into different step processing logic.
The method of processing a business process as described above, optionally further comprising, after issuing a calling business thread to the asynchronous execution logic, the asynchronous execution logic immediately spawning the business thread for use by other processing logic in the step processing logic.
The method for processing a service flow as described above may optionally further include assigning a timeout time to the asynchronous execution logic, and if the asynchronous execution logic does not receive a response after the timeout time is exceeded, turning to a timeout processing logic.
The method for processing business process as described above, optionally further comprising, if an exception occurs while processing the step processing logic, turning to an exception processing logic.
The method for processing a business process as described above, optionally further creating another asynchronous business process in the method for processing an asynchronous task, thereby implementing a nested sub-asynchronous business process in which non-blocking logic operates.
The method for processing a business process as described above, optionally further comprising the step of AsyncTask in Android.
The method for processing a business process as described above, optionally, after the asynchronous business process is started, the method is used for releasing the entry thread resource of the asynchronous business process.
The method for processing business process as described above, optionally further comprising performing thread resource isolation on different types of business logic in case that the task processing specifies different business thread pools.
The method of processing a business process as described above, optionally further comprising distributing the step processing logic across a plurality of applications, the plurality of applications interacting asynchronously using message queues.
As described above, optionally, the method for processing a business process further adopts RxJava or vert.x to implement processing logic.
A processing system for processing a business process according to a second aspect of the present disclosure is additionally provided, which includes:
the system comprises a creating module, a processing module and a processing module, wherein the creating module is used for creating an asynchronous business process which is used for processing asynchronous tasks;
the calling module is used for calling a service thread for processing according to the step-by-step processing logic in the asynchronous task; and
an execution module to execute the step processing logic,
the execution module releases the current service thread after the execution of each step processing logic is finished so as to be called by other step processing logics in the step processing logics, and the asynchronous task is finished after the step processing logics are finished.
The processing system for processing a service flow as described above, optionally, when the step processing logic includes a processing logic with an indefinite duration, the calling module immediately releases the service thread that is processing the processing logic with an indefinite duration after the call is issued, so that the service thread is called by other step processing logic in the step processing logic, and after a response of the processing logic with an indefinite duration is obtained, the idle service thread is called again to continue processing.
The processing system for processing a business process as described above, optionally further comprising the execution module dividing the step processing logic into one or more of the following according to the requirement of the step processing logic on a business thread: initial processing logic, asynchronous processing logic, subsequent processing logic, timeout processing logic, and exception handling logic.
The processing system for processing a business process as described above, optionally, the invoking module assigns the asynchronous task to a different business thread pool, and divides the asynchronous task into different step processing logics to invoke business threads in the different business thread pools.
The processing system for processing a business process as described above, optionally, after the calling module issues a calling business thread to the asynchronous execution logic, the asynchronous execution logic immediately hands over the business thread for use by other processing logic in the step processing logic.
The processing system for processing a business process as described above, optionally, the execution module specifies a timeout time for the asynchronous execution logic, and if the asynchronous execution logic does not receive a response after the timeout time is exceeded, the execution module goes to a timeout processing logic.
The processing system for processing a business process as described above, optionally further comprising the step processing logic, and if an exception occurs while the execution module processes the step processing logic, the execution module goes to the exception processing logic.
In the processing system for processing a business process as described above, optionally, the execution module creates another asynchronous business process in the processing of the asynchronous task, so as to implement a nested sub-asynchronous business process with non-blocking logic operation.
The processing system for processing a business process as described above, optionally further comprising the asynchronous task being AsyncTask in Android.
The processing system for processing a business process as described above, optionally, after the asynchronous business process is started, the processing system is used for releasing the entry thread resource of the asynchronous business process.
In the processing system for processing a business process as described above, optionally, the execution module performs thread resource isolation on different types of business logic when the task processing specifies different business thread pools.
The processing system for processing business process as described above, optionally further comprising the step processing logic being distributed by the execution module to a plurality of applications, and the plurality of applications performing asynchronous interaction with each other using a message queue.
In the processing system for processing a business process as described above, optionally, the execution module implements processing logic by using RxJava or vert.x.
The present invention also provides a computer-readable medium having stored thereon a computer program which, when executed by a processor, implements the method of processing a business process described above.
The present invention also provides a computer device, which includes a storage module, a processor, and a computer program stored in the storage module and executable on the processor, and when the computer program is executed by the processor, the method for processing the business process is implemented.
According to the processing method for processing the business process and the processing system for processing the business process, provided by the invention, a large amount of business can be driven by a small amount of threads, so that the number of threads required to be created by a computer is effectively reduced, and the bottleneck of a single machine is reduced. In the method and the system, the influence of the slow service logic with uncertain time consumption on the application is reduced to be extremely low, simultaneously, the sequence among all the service logics can be arranged, the important service logic can be processed preferentially, and the influence of the slow service logic is avoided.
Drawings
Fig. 1 is a flowchart showing the specific steps of the application business process arrangement method of the present invention.
FIG. 2 is a schematic diagram illustrating the orchestration of asynchronous tasks into an asynchronous business process.
FIG. 3 is a diagram illustrating an implementation of non-blocking concurrent multiple threads according to the application business process orchestration method of the present invention.
Fig. 4 is a schematic structural diagram of a processing system 1000 for processing a business process according to an embodiment of the present invention.
Detailed Description
The following description is of some of the several embodiments of the invention and is intended to provide a basic understanding of the invention. It is not intended to identify key or critical elements of the invention or to delineate the scope of the invention.
For the purposes of brevity and explanation, the principles of the present invention are described herein with reference primarily to exemplary embodiments thereof. However, those skilled in the art will readily recognize that the same principles are equally applicable to all types of application business process orchestration methods and systems, and that these same principles, as well as any such variations, may be implemented therein without departing from the true spirit and scope of the present patent application.
Moreover, in the following description, reference is made to the accompanying drawings that illustrate certain exemplary embodiments. Electrical, mechanical, logical, and structural changes may be made to these embodiments without departing from the spirit and scope of the invention. In addition, while a feature of the invention may have been disclosed with respect to only one of several implementations/embodiments, such feature may be combined with one or more other features of the other implementations/embodiments as may be desired and/or advantageous for any given or identified function. The following description is, therefore, not to be taken in a limiting sense, and the scope of the present invention is defined by the appended claims and their equivalents.
Terms such as "comprising" and "comprises" mean that, in addition to having elements (modules) and modules directly and explicitly stated in the description and claims, the solution of the invention does not exclude the presence of other elements (modules) and modules not directly or explicitly stated.
Fig. 1 is a flowchart showing the specific steps of the application business process arrangement method of the present invention. It is depicted in the flow chart that a business process comprising a plurality of steps is handled without blocking.
The method begins at step S1, when a business process comprising a series of steps needs to be processed, an asynchronous business process will first be created or initiated for processing the business process. Asynchronous business processes are characterized in that, upon starting the asynchronous business process, the previous entry thread for the asynchronous business process can be released to process other business requests, thereby avoiding the need to monopolize entry thread resources.
At step S2, the various steps of the business logic to be processed are choreographed to the asynchronous business process created at step S1. The arrangement can be performed according to the original sequence of each step, or the user can rearrange the processing sequence of each step as required. The steps scheduled in the asynchronous business process will be executed to determine whether to select a new execution thread or directly follow the execution thread of the previous step to continue execution.
At step S3, the pending step is divided into an initial execution logic, an asynchronous execution logic, and a subsequent execution logic by priority and processing requirements. The execution of the initial logic is the step to be executed first, which is generally a step that can ensure an instant. Subsequent execution logic, which generally is logic that can ensure instantaneous completion, needs to continue execution after the asynchronous execution logic is completed. Transient completion refers to logic that does not require long-term occupation of the thread of execution and can get an answer soon after a request is issued. Asynchronous execution logic is logic that cannot guarantee instantaneous completion and whose execution is time consuming and unstable.
At step S4, the various processing steps classified as initial execution logic, asynchronous execution logic, and subsequent execution logic may each specify a thread of execution or a pool of threads of execution. After the execution is completed, the logic releases the current execution thread so that other service requests can be processed. Also in this step, the asynchronous execution logic typically designates a dedicated pool of execution threads to process in order to avoid too fast a depletion of asynchronous thread resources.
In step S5, when the asynchronous execution logic encounters the initial execution logic, the asynchronous execution logic issues an execution request and directly releases the execution thread, so that the asynchronous business process does not need to occupy the execution thread resources for a long time.
At step S6, the idle business thread is reassigned after waiting for the response to the request to continue processing the subsequent business logic in the asynchronous business process. In step S6, there is a wait for a response to the request, and therefore, a timeout time and timeout processing logic may be preset for the asynchronous execution process. If the time consumed by the asynchronous execution process exceeds a preset timeout, timeout handling logic may be triggered. The timeout handling logic referred to herein is various common interface methods in the art for handling timeouts, and may be implemented differently in different program frameworks, and may specifically choose to abort the entire asynchronous execution logic or ignore the asynchronous execution logic or retry the asynchronous execution logic, etc.
At step S7, the idle business thread is reassigned to process subsequent business logic after the response is obtained. Through step S7, the subsequent service logic accepting to the asynchronous service logic will not continue to execute along the execution thread of the previous step, but will select a new idle service thread to execute, thereby implementing asynchronous service processing in which the execution thread resource is replaced by time in the asynchronous service flow.
At step S8, all steps in the asynchronous traffic process are completed. Various exceptions that the initial execution logic, the asynchronous execution logic and the subsequent execution logic may throw during the processing process include, but are not limited to, exceptions thrown by the program code or exceptions thrown by the program framework code, exceptions that may be thrown by a network, a database, an encryption engine, a disk IO, etc., calls, exceptions that may be thrown by the asynchronous execution process that are not returned after timeout, etc. If processing logic in each processing step throws an exception, the exception that occurred may be handled according to various exception handling logic as is common in the art.
With the application business process orchestration method 100 according to some embodiments of the invention, a program application that employs asynchronous business process processing a business process comprising a series of steps enables asynchronous processing of both entry thread resources and execution thread resources simultaneously. While the execution of the steps may also be ordered in a programmable manner. This enables a completely radio program-blocking process.
FIG. 2 shows a schematic diagram of the orchestration of asynchronous tasks into an asynchronous business process. An asynchronous business process is created in a program framework for processing a business that contains a series of steps, where each step corresponds to an executed task. And arranging each task required to be executed in the service into an asynchronous service flow through the inlet thread resource, wherein the inlet thread resource can be released for other services to use. In the method, tasks are arranged into asynchronous business processes, and are firstly classified mainly according to the properties of the tasks, and meanwhile, in the same category, the tasks can be sorted according to the priority of program requirements. For example, tasks that can be completed instantaneously, such as performing computations, outputting results, etc., may be classified as initial execution logic, subsequent execution logic, while tasks that require time-consuming waiting for responses, such as remote calls, disk reads, etc., may be classified as asynchronous execution logic. Note that the individual asynchronous tasks in fig. 2 are shown by way of example only, and there may be any number of asynchronous tasks in the asynchronous business process, i.e., there may be multiple initial execution logic, asynchronous execution logic, and subsequent execution logic.
In FIG. 2, a thread of execution or pool of threads of execution is first designated to execute asynchronous tasks classified as initial execution logic. After the first asynchronous task is completed, the asynchronous task can be completed instantly, so that asynchronous processing is not needed, and the used execution thread or execution thread pool continues to execute the next asynchronous task. The next asynchronous task may also be completed instantaneously so the thread of execution continues to work down in order until an asynchronous task classified as asynchronous execution logic is encountered. Taking hard disk reading and writing as an example, when the execution thread encounters an asynchronous execution logic that needs to wait for a reading and writing result, a request for hard disk reading and writing is sent out through the execution thread. And then directly releasing the execution thread after the request of reading and writing the hard disk is sent out, wherein the execution thread can be used for executing other tasks, and the asynchronous business process enters a waiting state. After the waiting response of hard disk read-write is returned, the asynchronous task is completed, and the program frame appoints a new idle service thread again to continue processing the subsequent service logic. In the asynchronous business process, the alternation of business thread paper caused by asynchronous execution logic can be carried out for unlimited times, namely, the asynchronous task logic can still be arranged after the subsequent business logic, and the business thread can be released when meeting the asynchronous task logic in the process of execution. Therefore, the asynchronous service flow can not occupy too many service threads, and simultaneously, the entry thread is released after the asynchronous task is scheduled, so that the asynchronous task flow realizes the double asynchronization of the entry thread and the service thread.
The application workflow orchestration method will be described below in conjunction with Java pseudo code. The service comprising a series of tasks is first abstractly described by a task class, for example, called AsyncTask, where each step corresponds to a step processing logic. The processing method step1(), step2() and also the processing method fail (Throwable cause) of the stepping processing logic are provided in the Asynctask class.
Figure BDA0002387928740000111
The AsyncTask task class can specify different business threads or business thread pools to process different methods, wherein the different methods can be classified into initial execution logic, asynchronous execution logic and subsequent execution logic, and thread resource isolation can be performed on the different types of business logic, such as allocating synchronous business threads to the initial execution logic and the subsequent execution logic, allocating asynchronous business threads to the asynchronous execution logic, and further reducing the influence of slow logic
publicAsyncTaskby(ExecutorService by);
ExecutorService executor=task.getExecutor();
executor.execute(asyncTask);
For example, in the above code, the AsyncTask class provides a by method for specifying which thread or thread pool each step in the task will use to execute business logic. Then when the program framework executes a specific step in the AsyncTask, the getExecutor method of the task can be called to acquire the service thread or the service thread pool executing the task, and the obtained service thread or the service thread pool is used for executing the service logic.
In the above description of the asynchronous task class, after the asynchronous task class is defined, an asynchronous task flow class, which may be called AsyncFlow, for example, may be defined to describe the whole process or some sub-process of processing the asynchronous task class.
class AsyncFlow{}
In the process of processing asynchronous task flow type called AsyncFlow, business threads are handed out after the execution of each processing method is completed. The next method that is completed instantaneously can get the business thread of the last method through the getExecutor method described above and continue to use. For the logic with uncertain time consumption, such as remote call, after the call is issued in the step method, the business thread resource is handed out immediately for other processing logic to use.
Figure BDA0002387928740000121
Figure BDA0002387928740000131
Tasks that need to be processed through the AsyncTask flow may be defined in the AsyncFlow. After starting an AsyncFlow, executing the AsyncTask therein, specifically executing each processing method step1(), step2() and the like in the AsyncTask. The business thread resource is relinquished for use by other business logic when a processing method in which the time consumption is indeterminate, such as step3(), is encountered, while a timeout time, here set to 2 seconds, is also set for it. And after step3() is processed in the subsequent process or overtime, waking up the process and continuously processing the subsequent AsyncTask method in the AsyncFlow.
In the asynchronous task flows shown in fig. 1, fig. 2 and the above embodiments, only the simplest form of a blocked asynchronous task flow using a single thread is described. In fact, because the asynchronous task flow realizes asynchronous task processing, a plurality of task execution threads can be simultaneously and concurrently processed in the asynchronous task flow, and the plurality of asynchronous task flows can be processed in a non-blocking manner.
FIG. 3 depicts a schematic diagram of implementing non-blocking concurrent multiple threads according to the application business process orchestration method of the present invention. The asynchronous task flow can support massive concurrent asynchronous task processing. As shown in fig. 3, multiple task threads are concurrent in an asynchronous task flow, so that when a task comprising a series of step methods is executed, the step methods can be executed without blocking without executing in the order described above. In particular, another asynchronous task flow can still be created in the processing method of the task, so that a nested sub-flow running without blocking is realized.
Fig. 4 is a schematic structural diagram of a processing system 1000 for processing a business process according to an embodiment of the present invention.
As shown in fig. 4, a processing system 1000 for processing a business process includes a creation module 100, a calling module 200, and an execution module 300. According to the method for processing the business process, the creating module 100 in the system 1000 is responsible for creating an asynchronous business process, and the asynchronous business process is used for processing asynchronous tasks. The calling module 200 is responsible for calling the service thread for processing according to the step-by-step processing logic in the asynchronous task. And the execution module 300 is responsible for executing the step-by-step processing logic, wherein the execution module 300 releases the current service thread for other step-by-step processing logics to call after the execution of each step-by-step processing logic is finished, and the asynchronous task is completed after the step-by-step processing logic is finished.
The processing system 1000 for processing a business process shown in fig. 4 may be further configured that, when the step processing logic includes a processing logic with an indefinite time consumption, the invoking module 200 immediately releases the business thread that is processing the processing logic with indefinite time consumption after issuing an invocation for being invoked by other step processing logic in the step processing logic, and after obtaining a response of the processing logic with indefinite time consumption, the idle business thread is re-invoked for continuous processing.
In the processing system 1000 for processing business processes shown in FIG. 4, the execution module 300 classifies the step processing logic into one or more of the following according to its requirements for business threads: initial processing logic, asynchronous processing logic, subsequent processing logic, timeout processing logic, and exception handling logic.
In the processing system 1000 for processing a business process shown in FIG. 4, the calling module 200 assigns the asynchronous task to a different business thread pool, and divides the asynchronous task into different step processing logic to call business threads in the different business thread pools.
In the processing system 1000 for processing a business process shown in FIG. 4, after the calling module 200 issues a calling business thread to the asynchronous execution logic, the asynchronous execution logic immediately hands over the business thread for use by other processing logic in the step processing logic.
In the processing system 1000 for processing a business process shown in fig. 4, the execution module 300 specifies a timeout time for the asynchronous execution logic, and if the asynchronous execution logic does not receive a response after the timeout time is exceeded, the execution module goes to the timeout processing logic.
In the processing system 1000 for processing business processes shown in FIG. 4, the execution module 300 goes to exception handling logic if an exception occurs while processing the step processing logic.
In the processing system 1000 for processing a business process shown in fig. 4, the execution module 300 creates another asynchronous business process in the processing of the asynchronous task, thereby implementing a nested sub-asynchronous business process in which non-blocking logic operates.
In the processing system 1000 for processing a business process shown in fig. 4, the asynchronous task is AsyncTask in Android.
In the processing system 1000 for processing a business process shown in fig. 4, after the asynchronous business process is started, an entry thread resource for the asynchronous business process is released.
In the processing system 1000 for processing business processes shown in FIG. 4, the execution module 300 performs thread resource isolation on different types of business logic where the task processing specifies different business thread pools.
In 1000 shown in FIG. 4, the execution module 300 distributes the step processing logic to a plurality of processing system applications for processing a business process, with asynchronous interaction between the plurality of applications using message queues.
In the invention, the described method or system can also adopt the technology of servlet3.0 and the like supporting asynchronization, simultaneously disperse the business processing process to a plurality of applications, and adopt asynchronous interaction mechanisms such as message queues and the like among the applications. The scheme can realize similar processing asynchronization, but puts requirements on the complexity and the construction difficulty of a program system.
In the invention, the described method or system can also adopt technologies such as RxJava or Vert.X and the like to realize processing logic, but developers need to adapt to a paradigm similar to functional programming in frameworks such as RxJava or Vert.X and the like, the learning curve is steeper, the code complexity and maintainability are obviously reduced, and the debugging complexity is higher. Challenges are presented to the development of larger-scale project teams.
The present invention also provides a computer-readable medium having stored thereon a computer program which, when executed by a processor, implements the method of processing a business process described above.
The invention also provides a computer device, which comprises a storage module, a processor and a computer program which is stored on the storage module and can run on the processor, and is characterized in that the processor implements the above arrangement method of the application business process when executing the computer program.
The above examples mainly illustrate the method for processing business processes and the processing system for processing business processes of the present invention. Although only a few embodiments of the present invention have been described in detail, those skilled in the art will appreciate that the present invention may be embodied in many other forms without departing from the spirit or scope thereof. Accordingly, the present examples and embodiments are to be considered as illustrative and not restrictive, and various modifications and substitutions may be made therein without departing from the spirit and scope of the present invention as defined by the appended claims.

Claims (28)

1. A method for processing a business process, comprising:
creating an asynchronous business process, wherein the asynchronous business process is used for processing asynchronous tasks;
calling a service thread for processing according to the step-by-step processing logic in the asynchronous task;
releasing the current service thread after each step processing logic is executed so as to be called by other step processing logics in the step processing logics; and
after the step processing logic is finished, the asynchronous task is completed.
2. The method of processing a business process of claim 1,
when the step processing logic comprises time-consuming uncertain processing logic, releasing the service thread which is processing the time-consuming uncertain processing logic for other step processing logic to call,
and after the response of the processing logic with uncertain time consumption is obtained, the idle service thread is called again to continue processing.
3. The method of processing a business process of claim 1, further comprising:
according to the requirements of the step processing logic on the service thread, the step processing logic is divided into one or more of the following: initial processing logic, asynchronous processing logic, subsequent processing logic, timeout processing logic, and exception handling logic.
4. The method of processing a business process of claim 2, further comprising:
the asynchronous tasks are assigned to different business thread pools, and the different business thread pools are divided into different step processing logics for calling business threads.
5. The method of processing a business process of claim 2, further comprising:
after issuing a call service thread to the asynchronous execution logic, the asynchronous execution logic immediately commits the service thread for use by other processing logic in the step-by-step processing logic.
6. The method of processing a business process of claim 5, further comprising:
and appointing a timeout time for the asynchronous execution logic, and if the asynchronous execution logic response is not received after the timeout time is exceeded, turning to a timeout processing logic.
7. The method of processing a business process of any one of claims 1-5, further comprising:
and if an exception occurs while processing the step processing logic, switching to exception processing logic.
8. The method of processing a business process of any one of claims 1-5, further comprising:
and another asynchronous service flow is created in the processing method of the asynchronous task, so that the nested sub-asynchronous service flow operated by non-blocking logic is realized.
9. The method of processing a business process of any one of claims 1 to 5,
the asynchronous task is AsyncTask in Android.
10. The method of processing a business process of claim 9,
and after the asynchronous business process is started, releasing the inlet thread resources of the asynchronous business process.
11. The method of processing a business process of claim 10,
and under the condition that the task processing specifies different service thread pools, thread resource isolation is performed on different types of service logic.
12. The method of processing a business process of any one of claims 1 to 5,
and dispersing the step processing logic to a plurality of applications, and performing asynchronous interaction among the plurality of applications by adopting a message queue.
13. The method of processing a business process of claim 8,
processing logic is implemented using RxJava or vert.x.
14. A processing system for processing a business process, comprising:
the system comprises a creating module, a processing module and a processing module, wherein the creating module is used for creating an asynchronous business process which is used for processing asynchronous tasks;
the calling module is used for calling a service thread for processing according to the step-by-step processing logic in the asynchronous task; and
an execution module to execute the step processing logic,
the execution module releases the current service thread after the execution of each step processing logic is finished so as to be called by other step processing logics in the step processing logics, and the asynchronous task is finished after the step processing logics are finished.
15. The processing system for processing a business process of claim 14,
when the step processing logic comprises a processing logic with uncertain time consumption, the calling module immediately releases the service thread which is processing the processing logic with uncertain time consumption after calling so as to be called by other step processing logics in the step processing logic, and after the response of the processing logic with uncertain time consumption is obtained, the idle service thread is called again to continue processing.
16. The processing system for processing a business process of claim 14,
the execution module divides the step processing logic into one or more of the following according to the requirements of the step processing logic on the service thread: initial processing logic, asynchronous processing logic, subsequent processing logic, timeout processing logic, and exception handling logic.
17. The processing system for processing a business process of claim 14,
and the calling module assigns the asynchronous tasks to different service thread pools, and the asynchronous tasks are divided into different step processing logics to call service threads in the different service thread pools.
18. The processing system for processing a business process of claim 15,
and after the calling module sends a calling service thread to the asynchronous execution logic, the asynchronous execution logic immediately gives up the service thread for other processing logics in the step processing logic to use.
19. The process system for processing a business process of claim 18,
the execution module appoints timeout time for the asynchronous execution logic, and if the asynchronous execution logic response is not received after the timeout time is exceeded, the execution module goes to timeout processing logic.
20. The processing system for processing business processes of any one of claims 14-18,
and if the execution module generates an exception when the step processing logic is processed, the execution module goes to the exception processing logic.
21. The processing system for processing business processes of any one of claims 14-18,
the execution module creates another asynchronous service flow in the processing of the asynchronous task, thereby realizing the nested sub-asynchronous service flow of non-blocking logic operation.
22. The processing system for processing business processes of any one of claims 14-18,
the asynchronous task is AsyncTask in Android.
23. The processing system for processing a business process of claim 22,
and after the asynchronous business process is started, releasing the inlet thread resources of the asynchronous business process.
24. The processing system for processing a business process of claim 23,
and the execution module performs thread resource isolation on different types of service logic under the condition that different service thread pools are specified by the task processing.
25. The system for processing business processes of any one of claims 14-18,
the execution module distributes the step processing logic to a plurality of applications, and the plurality of applications use message queues for asynchronous interaction.
26. The processing system for processing a business process of claim 21,
the execution module adopts RxJava or Vert.X to realize processing logic.
27. A computer-readable medium, having stored thereon a computer program,
the computer program, when executed by a processor, implements a method of processing a business process as claimed in any one of claims 1 to 13.
28. A computer device comprising a memory module, a processor, and a computer program stored on the memory module and executable on the processor,
the processor, when executing the computer program, implements the method for processing business process of any one of claims 1 to 13.
CN202010106769.7A 2020-02-20 2020-02-20 Method and system for processing business process Pending CN111651279A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010106769.7A CN111651279A (en) 2020-02-20 2020-02-20 Method and system for processing business process

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010106769.7A CN111651279A (en) 2020-02-20 2020-02-20 Method and system for processing business process

Publications (1)

Publication Number Publication Date
CN111651279A true CN111651279A (en) 2020-09-11

Family

ID=72347922

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010106769.7A Pending CN111651279A (en) 2020-02-20 2020-02-20 Method and system for processing business process

Country Status (1)

Country Link
CN (1) CN111651279A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112181641A (en) * 2020-09-14 2021-01-05 中国银联股份有限公司 Thread processing method, device, equipment and storage medium
CN113010153A (en) * 2021-04-02 2021-06-22 深圳市中深伟业科技有限公司 Workflow link dynamic menu binding design method in government affairs field
CN113037875A (en) * 2021-05-24 2021-06-25 武汉众邦银行股份有限公司 Method for realizing asynchronous gateway in distributed real-time service system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1584842A (en) * 2004-06-09 2005-02-23 中兴通讯股份有限公司 Method for applied server of computer system
US20100138836A1 (en) * 2008-12-03 2010-06-03 David Dice System and Method for Reducing Serialization in Transactional Memory Using Gang Release of Blocked Threads
CN103164273A (en) * 2012-09-06 2013-06-19 佳都新太科技股份有限公司 Method for changing synchronous service call to asynchronous parallel call with self-expanding choking algorithm
CN106897299A (en) * 2015-12-17 2017-06-27 阿里巴巴集团控股有限公司 A kind of data bank access method and device
CN109976891A (en) * 2019-03-28 2019-07-05 北京网聘咨询有限公司 The server task processing method of task based access control thread configuration

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1584842A (en) * 2004-06-09 2005-02-23 中兴通讯股份有限公司 Method for applied server of computer system
US20100138836A1 (en) * 2008-12-03 2010-06-03 David Dice System and Method for Reducing Serialization in Transactional Memory Using Gang Release of Blocked Threads
CN103164273A (en) * 2012-09-06 2013-06-19 佳都新太科技股份有限公司 Method for changing synchronous service call to asynchronous parallel call with self-expanding choking algorithm
CN106897299A (en) * 2015-12-17 2017-06-27 阿里巴巴集团控股有限公司 A kind of data bank access method and device
CN109976891A (en) * 2019-03-28 2019-07-05 北京网聘咨询有限公司 The server task processing method of task based access control thread configuration

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112181641A (en) * 2020-09-14 2021-01-05 中国银联股份有限公司 Thread processing method, device, equipment and storage medium
CN113010153A (en) * 2021-04-02 2021-06-22 深圳市中深伟业科技有限公司 Workflow link dynamic menu binding design method in government affairs field
CN113037875A (en) * 2021-05-24 2021-06-25 武汉众邦银行股份有限公司 Method for realizing asynchronous gateway in distributed real-time service system
CN113037875B (en) * 2021-05-24 2021-07-27 武汉众邦银行股份有限公司 Method for realizing asynchronous gateway in distributed real-time service system

Similar Documents

Publication Publication Date Title
CN109582455B (en) Multithreading task processing method and device and storage medium
US9501319B2 (en) Method and apparatus for scheduling blocking tasks
WO2020211579A1 (en) Processing method, device and system for distributed bulk processing system
CN111651279A (en) Method and system for processing business process
CN113535367B (en) Task scheduling method and related device
JP2866241B2 (en) Computer system and scheduling method
US7272820B2 (en) Graphical development of fully executable transactional workflow applications with adaptive high-performance capacity
CN102455933B (en) Method for increasing multi-tasking efficiency through thread management
CN107918556A (en) A kind of timed task performs method and apparatus in the parallel of multiple servers
KR20040086214A (en) Enhanced runtime hosting
US20180189093A1 (en) Systems and methods for executing software robot computer programs on virtual machines
CN102508716A (en) Task control device and task control method
CN103365718A (en) Thread scheduling method, thread scheduling device and multi-core processor system
CN110795254A (en) Method for processing high-concurrency IO based on PHP
CN112181621A (en) Task scheduling system, method, equipment and storage medium
CN111666141A (en) Task scheduling method, device and equipment and computer storage medium
CN102968303A (en) Program design system and program design method
CN114840318A (en) Scheduling method for preempting hardware key encryption and decryption resources through multiple processes
CN113485812B (en) Partition parallel processing method and system based on large-data-volume task
CN111240819A (en) Dispatching task issuing system and method
Prokopec Pluggable scheduling for the reactor programming model
WO2004046923A1 (en) Concurrent operation of a state machine family
US11301304B2 (en) Method and apparatus for managing kernel services in multi-core system
Aziz et al. decoding parallel program execution by using Java interactive visualization environment (JIVE): behavioral and performance analysis
CN112162840B (en) Coroutine processing and management method based on interrupt reentry mechanism

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