Implementation Method, Device, Equipment and Storage Medium of Business Process
By obtaining processing files from the resource library in business process development and sequentially storing them in priority queues, the repeated development problems of multiple similar processes are solved, and efficient and low-cost business process development and maintenance are achieved.
Patent Information
- Application Number
- CN202111315856.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-08
- Publication Date
- 2025-07-01
- Estimated Expiration
- 2041-11-08
AI Technical Summary
In product project development, multiple similar but different processes require repetitive development and maintenance, resulting in low development efficiency and high cost.
By obtaining business processing files from the preset business process resource library, determining the execution order, and adding it to the priority queue to store, calling the execution business process in turn, supporting execution methods such as serial, parallel and subprocess, and supporting chain calls and error feedback.
It realizes clear and easy-to-manage business process development under the condition of reusing code, reduces development and maintenance costs, and improves development efficiency and accuracy.
Smart Images

Figure CN113986554B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of software development, and particularly to a method, apparatus, device and storage medium for implementing a business process. Background Art
[0002] During the development of certain product projects, when accessing multiple products with similar but slightly different processes, since a single function often cannot be directly reused and there may be inconsistent interdependencies between multiple functions, developers may need to repeatedly use some functions to develop and maintain multiple processes separately. This not only requires a large amount of manpower for development but also has low development efficiency. Summary of the Invention
[0003] Embodiments of the present disclosure provide a method, apparatus, device and storage medium for implementing a business process, which can achieve the development of a clear and easy-to-manage process while reusing code, greatly improving development efficiency and reducing development and maintenance costs.
[0004] According to one of the solutions of the present disclosure, a method for implementing a business process is provided, including:
[0005] Obtaining at least one business processing file corresponding to the business process, where the business processing file is obtained from a preset business process resource library;
[0006] Determining the execution order of the at least one business processing file;
[0007] Storing each of the business processing files in a queue with a preset priority according to the execution order;
[0008] Calling the corresponding business processing file in the queue in sequence according to the priority order of the queue to execute the business process.
[0009] In some embodiments, the business processing file includes a processing function and its corresponding processing parameters. The storing each of the business processing files in a queue with a preset priority according to the execution order includes:
[0010] Encapsulating the processing function and its corresponding processing parameters in the form of an array to obtain an executable file for executing the business process;
[0011] Adding the executable file to the queue in sequence according to the execution order.
[0012] In some embodiments, the queue is a first-in-first-out queue. The calling the corresponding business processing file in the queue in sequence according to the priority order of the queue to execute the business process includes:
[0013] According to the first-in, first-out principle, the business processing file stored earliest in the queue is executed first.
[0014] In some embodiments, the queue is a circular queue, and the step of sequentially calling the corresponding business processing files in the queue according to the priority order of the queue to execute the business process includes:
[0015] Execute each business processing file in the queue sequentially from the head of the queue according to the circular execution order of the circular queue.
[0016] In some embodiments, the method further includes:
[0017] Obtain the association relationship between each business processing file;
[0018] Based on the association relationship, determine the execution mode of each business processing file;
[0019] Package the corresponding business processing file based on the execution mode to generate a corresponding executable file;
[0020] Store the executable file in the queue according to the execution order of the business processing file.
[0021] In some embodiments, at least two business processing files are executed in parallel. The step of packaging the corresponding business processing file based on the execution mode to generate a corresponding executable file includes:
[0022] Package at least two business processing files to be executed in parallel together to generate a parallel execution file.
[0023] In some embodiments, at least two business processing files are executed serially. The step of packaging the corresponding business processing file based on the execution mode to generate a corresponding executable file includes:
[0024] Package at least two business processing files to be executed serially separately to generate at least two corresponding serial execution files, where packaging the business processing file includes packaging each business processing information in the business processing file.
[0025] In some embodiments, the business process includes at least one business sub-process, and the method further includes:
[0026] Determine the business processing file corresponding to the business sub-process based on the business sub-process;
[0027] Call the business processing file from the queue to execute the business sub-process.
[0028] In some embodiments, during the execution of the business process, the method further includes:
[0029] Obtaining the execution result of the current business processing file;
[0030] If it is detected that there is an error in the execution result, abort the business process and feedback the error result.
[0031] In some embodiments, the method further includes:
[0032] After the business processing file is successfully executed, removing the successfully executed business processing file from the queue; and / or after the business process is executed, clearing the queue.
[0033] According to one of the solutions of the present disclosure, there is also provided an apparatus for implementing a business process, including:
[0034] An obtaining module configured to obtain at least one business processing file corresponding to a business process, wherein the business processing file is obtained from a preset business process resource library;
[0035] A determining module configured to determine the execution order of the at least one business processing file;
[0036] A storage module configured to store each of the business processing files in a queue with a preset priority according to the execution order;
[0037] An execution module configured to sequentially call the corresponding business processing files in the queue according to the priority order of the queue to execute the business process.
[0038] According to one of the solutions of the present disclosure, there is also provided a device for implementing a business process, including: at least one processor and a memory; the memory stores computer-executable instructions; the at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the above method.
[0039] According to one of the solutions of the present disclosure, there is also provided a computer-readable storage medium, on which computer-executable instructions are stored, and when the computer-executable instructions are executed by a processor, the above method is implemented.
[0040] The implementation methods, apparatuses, devices, and storage media for business processes provided by various embodiments of the present disclosure, after determining at least one business processing file corresponding to a business requirement, combine the business processing files based on the execution order and execution manner of the at least one business processing file to obtain a business process, which can standardize the development of business processes. Only by assembling existing business processing files as needed for different business requirements, it is possible to achieve the development of clear and easy-to-manage business processes while reusing code, greatly reducing the development and maintenance costs. At the same time, the embodiments of the present disclosure support functions such as passing parameters, serial execution, parallel execution, subprocesses, control flow, throwing error messages, etc., and support chained calls, which can improve the development efficiency and development effect of business processes. In addition, by using a first-in-first-out queue to store the execution order of functions in a business process, the accuracy of business process development can be ensured. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 A flowchart showing the implementation method of the business process according to an embodiment of the present disclosure;
[0042] Figure 2 Another flowchart showing the implementation method of the business process according to an embodiment of the present disclosure;
[0043] Figure 3 A schematic diagram showing the queue in the implementation method of the business process according to an embodiment of the present disclosure;
[0044] Figure 4 A schematic diagram showing the structure of the implementation apparatus of the business process according to an embodiment of the present disclosure. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0045] Reference is made herein to the various aspects and features of the present disclosure with reference to the accompanying drawings.
[0046] It should be understood that various modifications can be made to the embodiments claimed herein. Accordingly, the above description should not be construed as limiting, but merely as exemplary of the embodiments. Those skilled in the art will envision other modifications within the scope and spirit of the present disclosure.
[0047] The accompanying drawings, which are included in and form a part of this specification, illustrate embodiments of the present disclosure and, together with the general description of the present disclosure given above and the detailed description of the embodiments given below, serve to explain the principles of the present disclosure.
[0048] These and other features of the present disclosure will become apparent from the following description of the preferred forms of the embodiments given by way of non-limiting examples with reference to the accompanying drawings.
[0049] It should also be understood that although the present disclosure has been described with reference to some specific examples, those skilled in the art can surely implement many other equivalent forms of the present disclosure.
[0050] When combined with the accompanying drawings, the above and other aspects, features and advantages of the present disclosure will become more apparent in view of the following detailed description.
[0051] Specific embodiments of the present disclosure will be described hereinafter with reference to the accompanying drawings; however, it should be understood that the embodiments claimed are merely examples of the present disclosure, which can be implemented in various ways. Well-known and / or repetitive functions and structures are not described in detail to avoid obscuring the present disclosure with unnecessary or redundant details. Therefore, the specific structural and functional details claimed herein are not intended to be limiting, but are merely used as a basis for the claims and a representative basis for teaching those skilled in the art to use the present disclosure in substantially any suitable detailed structure in a variety of ways.
[0052] Figure 1 The flowchart of the implementation method of the business process of the embodiment of the present disclosure is shown. As Figure 1 shown, the embodiment of the present disclosure provides a method for implementing a business process, including:
[0053] S101: Obtain at least one business processing file corresponding to the business process, wherein the business processing file is obtained from a preset business process resource library.
[0054] The implementation method of the business process of the embodiment of the present disclosure is applied to an electronic device, which includes but is not limited to fixed terminal devices such as servers, desktop computers, digital TVs, and mobile terminal devices such as laptop computers, mobile phones, PDAs (Personal Digital Assistants), PADs (Tablet Computers), PMPs (Portable Multimedia Players), and vehicle-mounted terminals (such as vehicle-mounted navigation terminals).
[0055] The electronic device has a front-end page and a back-end processor (abbreviated as the processor). The front-end page is a visual instruction input interface, and the back-end processor is various service components, engines, processes, or underlying architectures used to support the front-end display interface. The user can input a business request on the front-end page, and the back-end processor generates a business process according to the business request, and realizes the business process corresponding to the business requirements through the implementation method of the business process. At the same time, the implementation result of the business process is displayed and output through the front-end page.
[0056] In this embodiment, the processor can obtain the business requirements of the user, and determine the business process and at least one business processing file required to implement the business process according to the business information included in the business requirements. The business requirements can be development requirements for online shopping processes, online store opening processes, settlement processes, etc. in the e-commerce field, or development requirements for insurance application processes in the insurance field, or development requirements for wealth management purchase processes in the banking field, etc. The present disclosure does not specifically limit.
[0057] Among them, the business information includes business objectives and business logic information, and the business logic is the logical relationship of each business stage (each business step) for achieving the business objectives. Each business stage is combined according to the logical order to form a business process for achieving the business objectives.
[0058] In this embodiment, the entire business process can be divided into multiple different functional stages according to different functions achieved. Each functional stage is a different business stage. For example, the shopping process can be divided into multiple business stages according to functions such as browsing, collecting, adding to the shopping cart, payment, and after-sales. Each business stage contains at least one business processing item. The business processing items in different business stages can be the same or different. For example, the stage of adding to the shopping cart contains the item of adding or deleting goods, and the after-sales process can also contain the item of adding or deleting goods to be returned.
[0059] The business processing file is a file for processing the above-mentioned business processing items, that is, each business processing item corresponds to a business processing file. By processing each business processing item through each business processing file, the business process can be realized. In this embodiment, the business processing file can be a piece of code or program for realizing the above-mentioned business processing items and can be stored in the form of a function.
[0060] In this embodiment, the business processing file at least includes processing functions corresponding to each business processing item in the business process and processing parameters related to the processing functions.
[0061] The processing function can be various operation functions for realizing each business processing item in the business process. For example, the processing function can be an input or output function to input or output business data; it can also be a query function to query the required business data; it can also be an execution function for executing specific business instructions, etc. The processing parameter is a parameter related to the processing function. For example, when the processing function is an input or output function, the processing parameter can be the data type of the input or output business data, etc., so as to accurately use the processing function to process the business processing item. The business processing file can be one or more. When the business requirements are relatively simple, only one business processing file may be needed to form a complete business process; when the business requirements are relatively complex, multiple business processing files are needed to form a complete business process, and the same business processing file may exist in different business stages.
[0062] In some embodiments, in step S101, obtaining at least one business processing file corresponding to the business process includes:
[0063] S1011: determining at least one business stage included in the execution process of the business process;
[0064] S1012: Perform semantic analysis on each of the said business stages to obtain the business processing items corresponding to each business stage;
[0065] S1013: Generate corresponding business processing files based on the said business processing items.
[0066] In this embodiment, natural language processing (NPL) can be used to perform semantic analysis on multiple business stages of a business process to obtain business processing items, and then generate corresponding business processing files based on the business processing items. For example, for shopping apps and banking apps, a login process is required. When it is determined that the business process includes a "login stage", determine the business processing items for logging in, such as username and password input, user authentication, etc. Search in the preset business process resource library to obtain the processing functions and related processing parameters for the above-mentioned username and password input, user authentication, etc. For the shopping process, it can include business stages such as adding to the shopping cart, purchasing, payment, after-sales, etc. Therefore, semantic analysis can be performed on the business logic information of each business stage to obtain each business processing item, and determine the corresponding processing function and related processing parameters.
[0067] In this embodiment, the business processing files can be obtained from a preset business process resource library. The business process resource library pre-stores business processing information such as processing functions and related processing parameters for processing business processing items for users to call and execute.
[0068] The business processing files are stored in the preset business process resource library in a Map data structure, that is, the correspondence between the function name (function name) of the processing function and the actual processing function is stored. When a processing function needs to be called, the corresponding processing function can be obtained from the business process resource library based on the function name. The function name can be any character or string (string).
[0069] Map is a key-value pair (key-value) collection used to save data with a mapping relationship. In this embodiment, the processing functions and corresponding function names in the business processing files are converted into key-value pairs through the map storage structure, which is convenient for finding processing functions.
[0070] In some other embodiments, after determining the business processing items of each business stage, the business processing files can also register the required processing functions in real time, and use Map to construct a mapping set of processing functions and corresponding function names and store them. Similar to the business processing files stored in the business process resource library above, users only need to find the corresponding function name in the mapping set to obtain the corresponding processing function and related information.
[0071] S102: Determine the execution order of the said at least one business processing file.
[0072] After determining at least one business processing file according to the business process, based on the logical relationships between business stages and the logical relationships between business processing items within each business stage in the business process, determine the execution order of the at least one business processing file, that is, determine the execution order of each business stage and the execution order of each business processing item within each business stage.
[0073] Determining the execution order of each business stage is to determine the execution order of the processing functions of each business stage. For example, when the business process includes two business stages (registration and login stages), determining the execution order of each business stage is to determine the execution order of the first processing function of the first business stage (registration stage) and the second processing function of the second business stage (login stage for example). Further, when the first business stage includes multiple first processing functions, the execution order of the multiple first processing functions can continue to be determined based on the business logic between business processing items within the first business stage.
[0074] S103: Add each of the business processing files to a queue with a preset priority to store the business processing files according to the execution order.
[0075] After determining the execution order of each business processing file, add the above-mentioned business processing files to a queue with a preset priority in sequence according to the execution order for storage.
[0076] S104: Call the corresponding business processing files in the queue in sequence according to the priority order of the queue to execute the business process.
[0077] Since each business processing file is added to a queue with a preset priority in sequence according to its execution order, that is, each business processing file is stored in the queue in a certain order, and the execution order of each business processing file corresponds to the priority order of the queue, therefore, the business processing files in the queue can be directly called to perform corresponding business operations in sequence, so as to implement the business process. Specifically, the run() function can be run to call the queue to execute the business process.
[0078] When each business processing file stored in the queue is being executed, the next business processing file corresponding to the current business processing file (or the next business stage corresponding to the current business stage) and the call mechanism before and after the execution of the current business processing file can be specified through the next attribute.
[0079] After obtaining at least one business processing file corresponding to a business process, the method for implementing the business process provided by the embodiments of the present disclosure stores each of the business processing files in a queue with a preset priority based on the execution order of the at least one business processing file, and sequentially calls the corresponding business processing files in the queue according to the priority order of the queue to execute the logical steps of the business process. Different business processing files can be stored in a queue with a preset priority according to their execution order for different business processes, and the corresponding business processing files are sequentially executed according to the priority order of the queue to implement the business process. It is possible to achieve clear and easily manageable business process development while reusing code, solve the problems of development and maintenance of multiple similar complex processes in the prior art, and greatly reduce the business development and maintenance costs. At the same time, storing each business processing file through a queue with a preset priority can ensure the execution order of each business processing file and ensure the smooth implementation of the business process.
[0080] Specifically, in the embodiments of the present disclosure, a queue with a preset priority is used to store each business processing file. For multiple business processes that are similar but have some differences, according to the storage order of each business processing file in the queue, the business processing file corresponding to the different part can be located at the corresponding storage position in the queue, and the corresponding business processing file is replaced to implement the development of different business processes. For multiple business processing files that may have inconsistent interdependent relationships, the corresponding business processing files can be extracted from the queue for replacement. In this way, only the different parts (including before and after the execution steps of the different parts) of the business process need to be developed, and the direct reuse of business processing files can be achieved without developers repeatedly developing and maintaining multiple sets of processes, improving the development efficiency and saving time and effort.
[0081] In some embodiments, the business processing file includes a processing function and its corresponding processing parameters. In step S103, storing each of the business processing files in a queue with a preset priority according to the execution order includes:
[0082] S1031: Encapsulate the processing function and its corresponding processing parameters in the form of an array to obtain an executable file for executing the business process;
[0083] S1032: Sequentially add the executable files to the queue according to the execution order.
[0084] Specifically, after obtaining each processing function and its corresponding processing parameters, the processing function and its corresponding processing parameters can be encapsulated in the form of a two-dimensional array to generate an executable file for executing the business process.
[0085] The storage format of the binary array can be expressed as {key, params}, where key represents the processing function and params represents the processing parameters corresponding to the processing function. In this embodiment, after finding the corresponding processing function through the Map structure, an executable file containing the processing function and its corresponding processing parameters can be obtained simultaneously, and the business processing matters can be processed by directly calling the executable file.
[0086] For ordinary processing functions, the encapsulated executable file is stored in the form of a function and can be expressed as funcs.push({key: 'function1', params: []}). The processing function and its corresponding processing parameters can be represented as array elements respectively, and the push function can be used to load the array elements into an array. The specific parameter values of the processing parameters can be passed in according to actual needs during the implementation of the subsequent business process.
[0087] In some other embodiments, the business processing file further includes other business processing information related to the processing function, such as the execution environment of the processing function. At this time, the processing function, the processing parameters corresponding to the processing function, and the configuration information of the processing function can be encapsulated in the form of a multi-dimensional array to generate an executable file for executing the business process. In this embodiment, encapsulating each business processing information (processing function, processing parameters, configuration information, etc.) in the business processing file facilitates storing the business processing file in the queue and also facilitates extracting or calling and executing the business processing file.
[0088] In this embodiment, after encapsulating each business processing file, the different business processing files of each business stage can be encapsulated as a whole according to each business stage, and then the executable files formed after encapsulating each business stage are stored in the queue according to the execution order of each business stage.
[0089] In some embodiments, the queue is a first-in-first-out queue. In step S104, calling the corresponding business processing file in the queue to execute the business process according to the priority order of the queue includes:
[0090] S1041: According to the first-in-first-out principle, the business processing file stored earliest in the queue is executed first.
[0091] First In, First Out (FIFO) is a method for processing program work requirements issued from a queue or a stack. It enables the earliest requirements to be processed first. In this embodiment, a first-in, first-out queue is used to store the execution order of each processing function in the service processing file, which can ensure that each processing function in the service process is executed in order to prevent incorrect calls and ensure the smooth progress of the service process. At the same time, when the service process is executed, only the corresponding queue needs to be controlled, and each processing function in the queue can be automatically called to execute the service process, which can improve the execution efficiency.
[0092] The first-in, first-out queue can be stored sequentially and / or in a linked manner. The linked storage of the queue is based on a linked list and operates on data elements according to the principle of "first in, first out". Through linked storage, when the queue is called for execution, the linked call of each service processing file in the queue can be realized.
[0093] In some other embodiments, the queue is a circular queue. In step S104, according to the priority order of the queue, the corresponding service processing files in the queue are called in sequence to execute the service process, including:
[0094] S1042: According to the circular execution order of the circular queue, each service processing file in the queue is sequentially and circularly executed from the head of the queue.
[0095] When using a circular queue to store service processing files, it is necessary to determine the head of the queue, that is, to determine the first processing function to be executed, and each processing function will be executed in sequence according to the circular execution order of the circular queue.
[0096] Furthermore, the number of times the processing functions from the head to the tail of the circular queue are circularly executed can be determined to determine whether the processing functions need to be circularly executed. That is, in this embodiment, the circular queue can be executed sequentially and once as the above-mentioned first-in, first-out queue, or can be circularly executed multiple times. In this way, when it is determined that each processing function needs to be circularly executed, only the circular queue needs to be used to store each processing function, and there is no need to use a dedicated circular processing function to implement the circular execution of each processing function.
[0097] In some embodiments, as Figure 2 shown, the method further includes:
[0098] S201: Obtain the association relationship between each service processing file;
[0099] S202: Based on the association relationship, determine the execution mode of each service processing file;
[0100] S203: Package the corresponding service processing file based on the execution mode to generate a corresponding executable file;
[0101] S204: Store the executable file in the queue according to the execution order of the service processing file.
[0102] Among them, the execution mode control flow includes at least one of passing parameters, serial execution, parallel execution, and sub-processes. After determining the execution order of each service processing file, since some service processing files can be executed simultaneously or parameters need to be passed into some service processing files, etc., to improve the implementation efficiency of the service process, the execution mode of the corresponding service processing file can be determined according to the association relationship between each service processing file.
[0103] The control flow refers to controlling the execution of the processing functions of each service processing file according to the determined execution order. The control flow is realized when the above service processing files are executed in sequence according to the priority order of the queue.
[0104] Passing parameters is the transfer of the processing parameters of each service processing file, including passing values, passing addresses, etc. Serial execution is the sequential execution of the processing functions of each service processing file in series. Parallel execution is the synchronous parallel execution of the processing functions of each service processing file. Some service stages in the service process can be executed synchronously, or different processing functions within the same service stage can be executed synchronously.
[0105] It can be understood that the control flow refers to the control execution of the overall service process, and serial execution refers to the execution of each service processing file in the service process.
[0106] Exemplarily, when it is determined that parameters need to be passed between the first service processing file and the second service processing file, for example, when it is necessary to transfer the first parameter value of the processing parameters in the first service processing file to the second service processing file, the execution mode can be determined as parameter passing. At this time, when encapsulating the second processing function and the second processing parameters in the second service processing file, the first parameter value can be passed into the second processing parameter to generate an executable file for parameter passing, and it is stored in the corresponding position in the queue according to the execution order. The executable file can be represented in the form of a function and stored in the queue. The parameter passing execution function corresponding to the executable file for parameter passing can be represented as funcs.push({key: 'function1', params: params}).
[0107] In some embodiments, at least two of the service processing files are executed in parallel. In step S203, encapsulating the corresponding service processing files based on the execution mode to generate corresponding executable files includes:
[0108] Step S2031: Encapsulate at least two of the service processing files to be executed in parallel together to generate a parallel execution file.
[0109] When at least two service processing files are executed in parallel, the at least two service processing files executed in parallel can be encapsulated in the form of an array. For example, the first service processing file is encapsulated in the form of a first array, and the second service processing file is encapsulated in the form of a first array. When the first service processing file and the second service processing file are executed in parallel, the first service processing file and the second service processing file can be used as array elements to encapsulate and form a second array. The files executed in parallel can be further expressed as funcs.push([{key: 'function1', params: []}, {key: 'function2', params: []}]), that is, the at least two service processing files executed in parallel are encapsulated in the same set for easy calling and execution.
[0110] In specific implementation, the at least two service processing files can also be encapsulated in other ways. For example, the at least two service processing files executed in parallel are encapsulated in a class by an object-oriented method. Encapsulating in an object-oriented way can hide the attributes and implementation details of the object. For example, only providing the function names of the processing functions of each service processing file can improve security.
[0111] In some embodiments, at least two of the service processing files are executed serially. In step S203, based on the execution mode, the corresponding service processing files are encapsulated to generate corresponding executable files, including:
[0112] Step S2032: Encapsulate the at least two service processing files executed serially respectively to generate at least two corresponding serially executed files, where encapsulating the service processing file includes encapsulating each service processing information in the service processing file.
[0113] When at least two service processing files are executed serially, they can be encapsulated in the form of the above first array respectively. For example, when the first service processing file and the second service processing file are executed serially, the processing function and corresponding processing parameters of the first service processing file can be encapsulated through the above step S103, and the processing function and corresponding processing parameters of the second service processing file can be encapsulated. Then, the encapsulated first service processing file and second service processing file are separately stored in the queue according to the serial execution order. The first service processing file stored in the queue is represented as funcs.push({key: 'function1', params: []}), and the second service processing file stored in the queue is represented as funcs.push({key: 'function2', params: []}). That is, when executed serially, the service processing files formed by encapsulation in step S103 can be directly used as the serial execution files.
[0114] When the service processing file also contains other service processing information, the other service processing information can be encapsulated together with the processing function and processing parameters.
[0115] In some embodiments, the service process includes at least one service sub-process, and the method further includes:
[0116] Determining a service processing file corresponding to the service sub-process based on the service sub-process;
[0117] Invoking the service processing file from the queue to execute the service sub-process.
[0118] The service process may include a service main process (referred to as the main process) and a service sub-process (referred to as the sub-process). The main process links the sub-processes, and the sub-processes process the information transmitted by the main process using corresponding processing functions. For example, in the shopping process, when the buyer wants to return a product, a return sub-process needs to be initiated. When the return sub-process is initiated, the product to be returned needs to be determined. The main process sends the relevant information of the product to be returned to the sub-process based on the previous purchase records of the user. After receiving the corresponding information, the sub-process uses the processing function of the sub-process to execute the return process.
[0119] In this embodiment, when it is determined that the execution mode is to execute the sub-process, it is not necessary to separately store each service processing file included in the sub-process in the queue. Instead, the service processing file stored in the queue according to the main process can be directly invoked from the queue, which can reduce the number of executable files in the service process and avoid the call chaos caused by too many executable files.
[0120] One or more execution modes may be included in the business process. For example, when multiple business stages of the business process are single-threaded, the execution mode may only be serial; when multiple business stages are multi-threaded, the execution mode may simultaneously include serial, parallel, sub-process, etc.
[0121] When a certain business process includes both serial execution and parallel execution, each serial execution file is stored in the queue in order according to the execution order, and at least two processing functions for parallel execution are stored in the queue in the form of an array. As Figure 3 shown, if the first business processing file A, the second business processing file B, and the fourth business processing file D are serially executed, and the second business processing file B and the third business processing file C are executed in parallel, the first business processing file A, the second business processing file B, and the fourth business processing file D are respectively encapsulated, for example, encapsulated in the form of a first array, and then stored in the queue in the execution order. The second business processing file B and the third business processing file C are encapsulated together, for example, encapsulated in the form of a second array, and then stored in the queue.
[0122] In some embodiments, during the execution of the business process, the method further includes:
[0123] S301: Obtain the execution result of the current business processing file;
[0124] S302: If it is detected that there is an error in the execution result, abort the business process and feedback the error result.
[0125] In the embodiments of the present disclosure, using promise.all to execute each processing function in the business process can simultaneously process multiple asynchronous requests and control the order of the return results.
[0126] In a specific embodiment, it includes multiple execution modes and multiple business processing files. Among them, the first business processing file A can be represented by flow.next('A'), and the second business processing file B can be represented by flow.next('B'). The first business processing file A and the second business processing file B are executed serially; the third business processing file C and the fourth business processing file D are executed in parallel, which can be represented by flow.next('C', 'D'); the fifth business processing file E is executed after the third business processing file C and the fourth business processing file D are executed in parallel. The execution of the entire business process can be expressed as Flow.next('A').next('B').next('C', 'D').next('E').run(). When specifically executing, after the processing function of the first business processing file A is executed, the processing function of the second business processing file B is executed based on the execution result of the first business processing file A. After obtaining the execution result of the second business processing file B, the processing functions of the third business processing file C and the fourth business processing file D are synchronously executed, and after obtaining the execution results of the third business processing file C and the fourth business processing file D, the processing function of the fourth business processing file E is executed.
[0127] When the processing function of each business processing file is successfully executed, the execution result may not be returned, and the return result of this business processing file is directly passed to the next business processing file to execute the processing function of the next business processing file, and a result array is returned after the execution of each processing function is successfully completed.
[0128] After detecting that the processing function of the current business processing file fails to execute, the execution of the business process is aborted, and the error result of this processing function is returned to prevent losses caused by continued execution, etc. At the same time, the error result is returned in a timely manner so that the user can check and correct errors in a timely manner.
[0129] When the processing functions in the business process are executed, the required processing functions and corresponding configuration parameters can be called in a chained manner in a timely manner, or the above processing functions can be used in conditional statements, such as in conditional statements such as if and where. The specific execution process is not specifically limited in this disclosure.
[0130] In some embodiments, the method further includes:
[0131] S105: After the business processing file is successfully executed, remove the successfully executed business processing file from the queue and / or after the business process is executed, clear the queue.
[0132] In this embodiment, after each of the service processing files is successfully executed, the successfully executed service processing file can be removed so that a new service processing file can be added to the queue for storage. In this way, while the service process is being executed, an executable file corresponding to the service processing file can be generated in real time, improving the implementation efficiency of the service process.
[0133] Optionally, the queue can also be cleared after the entire service process is executed to prepare for the implementation of the next service process.
[0134] In addition, when a certain service process is not needed or a certain service process needs to be regenerated, the queue corresponding to the service process can be cleared.
[0135] While standardizing, facilitating, and simplifying the development of the service process, the method for implementing the service process according to the embodiments of the present disclosure supports the implementation of functions such as passing parameters, serial execution, parallel execution, sub-processes, control flow, and throwing error messages, and supports chained calls, which can further improve the development efficiency and development effect of the service process.
[0136] Figure 4 The structural schematic diagram of the device for implementing the service process according to the embodiments of the present disclosure is shown. As Figure 4 shown, the embodiments of the present disclosure also provide a device for implementing a service process, including:
[0137] An obtaining module 401 configured to obtain at least one service processing file corresponding to a service process, where the service processing file is obtained from a preset service process resource library;
[0138] A determining module 402 configured to determine the execution order of the at least one service processing file;
[0139] A storage module 403 configured to add each of the service processing files to a queue with a preset priority for storage according to the execution order;
[0140] An execution module 404 configured to sequentially call the corresponding service processing files in the queue according to the priority order of the queue to execute the service process.
[0141] In some embodiments, the service processing file includes a processing function and its corresponding processing parameters, and the storage module 403 is specifically configured to:
[0142] Encapsulate the processing function and its corresponding processing parameters in the form of an array to obtain an executable file for executing the service process;
[0143] Add the executable files to the queue in sequence according to the execution order.
[0144] In some embodiments, the queue is a first-in, first-out queue, and the execution module 404 is specifically configured to:
[0145] In accordance with the first-in, first-out principle, the business processing file that was stored in the queue earliest is executed first.
[0146] In some embodiments, the queue is a circular queue, and the execution module 404 is specifically configured to:
[0147] In accordance with the circular execution order of the circular queue, each business processing file in the queue is sequentially and circularly executed starting from the head of the queue.
[0148] In some embodiments, the storage module 403 is further configured to:
[0149] Obtain the association relationships between the business processing files;
[0150] Based on the association relationships, determine the execution modes of the business processing files;
[0151] Package the corresponding business processing files based on the execution modes to generate corresponding executable files;
[0152] Store the executable files in the queue in accordance with the execution order of the business processing files.
[0153] In some embodiments, at least two of the business processing files are executed in parallel, and the storage module 403 is further configured to:
[0154] Package at least two of the business processing files that are executed in parallel together to generate a parallel execution file.
[0155] In some embodiments, at least two of the business processing files are executed serially, and the storage module 403 is further configured to:
[0156] Individually package at least two of the business processing files that are executed serially to generate corresponding at least two serial execution files, where packaging the business processing files includes packaging each piece of business processing information in the business processing files.
[0157] In some embodiments, the business process includes at least one business subprocess, and the execution module 404 is further configured to:
[0158] Based on the business subprocess, determine the business processing file corresponding to the business subprocess;
[0159] Call the business processing file from the queue to execute the business subprocess.
[0160] In some embodiments, it further includes a detection module configured to: during the execution of the service process,
[0161] obtain the execution result of the current service processing file;
[0162] if an error is detected in the execution result, abort the service process and feedback the error result.
[0163] In some embodiments, it further includes a removal and / or clearing module configured to:
[0164] after the service processing file is successfully executed, remove the successfully executed service processing file from the queue; and / or after the service process is executed, clear the queue.
[0165] The apparatus for implementing the service process provided by the embodiments of the present disclosure corresponds to the method for implementing the service process in the above embodiments. Based on the above method for implementing the service process, those skilled in the art can understand the specific implementation manners and various variations of the apparatus for implementing the service process in the embodiments of the present disclosure. Any optional items in the embodiments of the method for implementing the service process are also applicable to the apparatus for implementing the service process, and will not be elaborated herein.
[0166] The embodiments of the present disclosure further provide a device for implementing a service process, including:
[0167] at least one processor and a memory; the memory stores computer execution instructions; the at least one processor executes the computer execution instructions stored in the memory, so that the at least one processor executes the above method for implementing the service process.
[0168] The device for implementing the service process in the embodiments of the present disclosure may be a terminal device such as a PC or a mobile phone. The processor may be a CPU, and the memory may include a random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, a flash memory, or other non-volatile solid-state memories.
[0169] In this embodiment, the memory is preferably a dedicated non-volatile memory to store the above queue and the service process resource library file. This memory may be a local memory or a remote memory (cloud memory). Storing the queue through a dedicated memory facilitates timely invocation and can ensure the security of data storage in the queue.
[0170] Those skilled in the art can understand that the structure of the device for implementing the service process does not constitute a limitation on the device for implementing the service process, and may include more or fewer components than shown in the figure. For example, it may further include a communication interface, etc., or combine certain components, or arrange different components.
[0171] Embodiments of the present disclosure also provide a computer-readable storage medium, on which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, the implementation method of the above-mentioned business process is realized.
[0172] The computer-readable storage medium of the embodiments of the present disclosure may adopt any combination of one or more computer-readable media. The computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples (a non-exhaustive list) of the computer-readable storage medium include: an electrical connection having one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the embodiments of the present disclosure, the computer-readable storage medium may be any tangible medium that contains or stores a program, and the program may be used by or in combination with an instruction execution system, apparatus, or device.
[0173] In the embodiments of the present disclosure, the computer-executable instruction program code for performing the operations of the present disclosure may be written in one or more programming languages or combinations thereof. The programming languages include Java, C++, PHP, Python, etc. The program code may be executed entirely on the user's computer, partially on the user's computer, executed as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or terminal. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (for example, by using an Internet service provider to connect through the Internet).
[0174] The above embodiments are only exemplary embodiments of the present disclosure and are not used to limit the present disclosure. The protection scope of the present disclosure is defined by the claims. Those skilled in the art can make various modifications or equivalent replacements within the essence and protection scope of the present disclosure, and such modifications or equivalent replacements should also be regarded as falling within the protection scope of the present disclosure.
Claims
1. A method for implementing a business process, comprising: Obtaining at least one business processing file corresponding to the business process, wherein the business processing file is obtained from a preset business process resource library, and the business processing file at least includes a processing function corresponding to a business processing item in the business process and processing parameters related to the processing function; Determining an execution order of the at least one business processing file; Storing each of the business processing files in a queue with a preset priority according to the execution order; in the queue, each of the business processing files is encapsulated as an executable file based on an execution mode, and the executable file includes: a parallel execution file encapsulated by at least two of the business processing files executed in parallel, and / or, at least two serial execution files respectively encapsulated by at least two of the business processing files executed serially; encapsulating the business processing file includes encapsulating the processing function and the processing parameters in the business processing file together in the form of an array; Sequentially calling the corresponding business processing files in the queue according to the priority order of the queue to execute the business process.
2. The method according to claim 1, wherein The business processing file includes a processing function and its corresponding processing parameters, and storing each of the business processing files in a queue with a preset priority according to the execution order includes: Encapsulating the processing function and its corresponding processing parameters together in the form of an array to obtain an executable file for executing the business process; Sequentially adding the executable file to the queue according to the execution order.
3. The method according to claim 1, wherein The queue is a first-in-first-out queue, and sequentially calling the corresponding business processing files in the queue according to the priority order of the queue to execute the business process includes: According to the first-in-first-out principle, the business processing file stored earliest in the queue is executed first.
4. The method according to claim 1, wherein, The queue is a circular queue, and sequentially calling the corresponding business processing files in the queue according to the priority order of the queue to execute the business process includes: According to the circular execution order of the circular queue, each business processing file in the queue is sequentially and circularly executed from the head of the queue.
5. The method according to claim 1, wherein The method further includes: Obtaining an association relationship between each of the business processing files; Determining an execution mode of each of the business processing files based on the association relationship; Encapsulating the corresponding business processing file based on the execution mode to generate a corresponding executable file; Storing the executable file in the queue according to the execution order of the business processing file.
6. The method according to claim 5, wherein At least two of the business processing files are executed in parallel, and encapsulating the corresponding business processing file based on the execution mode to generate a corresponding executable file includes: Encapsulating at least two of the business processing files executed in parallel together to generate a parallel execution file.
7. The method according to claim 5, wherein At least two of the business processing files are executed serially, and encapsulating the corresponding business processing file based on the execution mode to generate a corresponding executable file includes: Encapsulate at least two of the business processing files that are serially executed respectively to generate at least two corresponding serially executed files, wherein encapsulating the business processing file includes encapsulating each business processing information in the business processing file.
8. The method according to claim 1, wherein The business process includes at least one business sub-process, and the method further includes: Determine the business processing file corresponding to the business sub-process based on the business sub-process; Call the business processing file from the queue to execute the business sub-process.
9. The method according to claim 1, wherein, During the execution of the business process, the method further includes: Obtain the execution result of the current business processing file; If it is detected that there is an error in the execution result, abort the business process and feedback the error result.
10. The method according to any one of claims 1 to 9, wherein, The method further includes: After the business processing file is successfully executed, remove the successfully executed business processing file from the queue; and / or after the business process is executed, clear the queue.
11. An apparatus for implementing a business process, comprising: An acquisition module configured to acquire at least one business processing file corresponding to a business process, wherein the business processing file is acquired from a preset business process resource library, and the business processing file at least includes a processing function corresponding to a business processing item in the business process and processing parameters related to the processing function; A determination module configured to determine the execution order of the at least one business processing file; A storage module configured to add each of the business processing files to a queue with a preset priority for storage according to the execution order; in the queue, each of the business processing files is encapsulated into an executable file based on the execution method, and the executable file includes: a parallel execution file encapsulated from at least two of the business processing files that are executed in parallel, and / or at least two serially executed files respectively encapsulated from at least two of the business processing files that are serially executed; encapsulating the business processing file includes encapsulating the processing function and processing parameters in the business processing file together in the form of an array; An execution module configured to sequentially call the corresponding business processing file in the queue according to the priority order of the queue to execute the business process.
12. An implementation device for a business process, comprising: At least one processor and a memory; The memory stores computer execution instructions; The at least one processor executes the computer execution instructions stored in the memory, so that the at least one processor executes the method according to any one of claims 1-10.
13. A computer-readable storage medium, on which computer execution instructions are stored, and when the computer execution instructions are executed by a processor, the method according to any one of claims 1-10 is implemented.
Citation Information
Patent Citations
Business processing method and device, computer readable medium and electronic equipment
CN110716748A
Multi-thread calling method and device, computer system and storage medium
CN111324465A
Fusion system and fusion method for automatically fusing multiple professional business functions
CN111597022A
Process engine method, system and equipment and storage medium
CN113342484A