CN108460078B - Auxiliary function execution method and device, storage medium and terminal - Google Patents
Auxiliary function execution method and device, storage medium and terminal Download PDFInfo
- Publication number
- CN108460078B CN108460078B CN201810014125.8A CN201810014125A CN108460078B CN 108460078 B CN108460078 B CN 108460078B CN 201810014125 A CN201810014125 A CN 201810014125A CN 108460078 B CN108460078 B CN 108460078B
- Authority
- CN
- China
- Prior art keywords
- auxiliary function
- asynchronous
- thread
- executing
- executed
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/23—Updating
- G06F16/2308—Concurrency control
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/52—Program synchronisation; Mutual exclusion, e.g. by means of semaphores
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q40/00—Finance; Insurance; Tax strategies; Processing of corporate or income taxes
- G06Q40/08—Insurance
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Business, Economics & Management (AREA)
- General Physics & Mathematics (AREA)
- Accounting & Taxation (AREA)
- Finance (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Development Economics (AREA)
- General Business, Economics & Management (AREA)
- Technology Law (AREA)
- Strategic Management (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Marketing (AREA)
- Economics (AREA)
- Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
Abstract
The invention is suitable for the technical field of communication, and provides an execution method of an auxiliary function, which comprises the following steps: based on the category of the auxiliary function in the underwriting process, establishing an asynchronous execution table corresponding to the category in a database; starting a main thread of an underwriting process, and executing necessary functions in the underwriting process, wherein the necessary functions are underwriting process tasks except for auxiliary functions; writing the auxiliary function in the underwriting process into an asynchronous execution table corresponding to the type of the auxiliary function, and setting a status flag bit of the auxiliary function to be executed; if the main thread finishes executing, starting an asynchronous thread, and executing the auxiliary function based on the asynchronous execution table; and updating the status flag bit of the auxiliary function which is successfully executed in the asynchronous execution table to be executed. The invention effectively reduces the probability of unavailable whole flow caused by calling system fault or calling program fault, and improves the timeliness of underwriting flow.
Description
Technical Field
The present invention belongs to the field of communications technologies, and in particular, to an auxiliary function execution method, an auxiliary function execution device, a storage medium, and a terminal.
Background
The complex business process usually involves more functions, and the prior art adopts a single-thread serial mode to process the functional tasks in each link, including necessary functions and auxiliary functions, and the functions of each link are linked. For the auxiliary functions therein, the prior art employs interaction with an external system. For example, in an insurance sales scenario, the short message sending and receiving is one of the auxiliary functions, and needs to be completed by interacting with an external short message system. If the business process includes multiple different auxiliary functions, interaction with multiple external systems is required. For example, the insurance sales scenario needs to interact with a plurality of external systems such as a new contract system, a security system, and a short message platform.
In the interactive process, whether the flow can continue to involve the calling and execution results of the external system or not. If an external system is called or an external system fails to execute an unnecessary auxiliary function, the whole business process is terminated and cannot be continuously executed. In the insurance sales scenario, if the short message system is not called when the acceptance short message is sent, the insurance acceptance process cannot continue to move downwards. If the return fails when the security system is called, the underwriting process cannot continue to go down. The execution or non-execution of the auxiliary functions does not actually affect the final underwriting result.
Therefore, in the prior art, the insurance acceptance process is terminated when the interaction of the auxiliary functions fails, and the remaining processes cannot go down, so that the probability of unavailable processes caused by calling system faults or calling program faults is greatly improved, the timeliness of insurance acceptance is seriously influenced, and the labor cost is increased.
Disclosure of Invention
The embodiment of the invention provides an execution method, an execution device, a storage medium and a terminal of an auxiliary function, and aims to solve the problems of unavailable process, slow timeliness and high labor cost when the auxiliary function is executed in an underwriting process in the prior art.
The embodiment of the invention provides an execution method of an auxiliary function, which comprises the following steps:
based on the category of the auxiliary function in the underwriting process, establishing an asynchronous execution table corresponding to the category in a database;
starting a main thread of an underwriting process, and executing necessary functions in the underwriting process, wherein the necessary functions are functions except auxiliary functions in the underwriting process;
writing the auxiliary function in the underwriting process into an asynchronous execution table corresponding to the type of the auxiliary function, and setting a status flag bit of the auxiliary function to be executed;
if the main thread finishes executing, starting an asynchronous thread, and executing the auxiliary function based on the asynchronous execution table;
and updating the status flag bit of the auxiliary function which is successfully executed in the asynchronous execution table to be executed.
Further, the writing the auxiliary function in the underwriting process into the asynchronous execution table corresponding to the category of the auxiliary function, and setting the status flag bit of the auxiliary function to be executed includes:
if the auxiliary function in the underwriting process is executed, acquiring the category and parameter information corresponding to the auxiliary function;
and determining an asynchronous execution table corresponding to the category, writing the parameter information into a corresponding field of the asynchronous execution table, and setting a status flag bit to be executed.
Further, if the main thread finishes executing, an asynchronous thread is started, and the auxiliary function is executed based on the asynchronous execution table, including:
if the main thread finishes executing, starting an asynchronous thread, reading a field value in the asynchronous execution table, and acquiring parameter information of an auxiliary function related to the current underwriting process;
performing the auxiliary function based on the parameter information.
Further, if the main thread finishes executing, an asynchronous thread is started, and the auxiliary function is executed based on the asynchronous execution table, including:
if the main thread finishes executing, acquiring the total number of categories of the asynchronous execution table written by the main thread;
starting an asynchronous thread according to the category total number, and executing the auxiliary function through the asynchronous thread;
wherein an asynchronous thread corresponds to a class of asynchronous execution table, and processes the auxiliary function recorded therein and related to the underwriting process.
Further, the starting the asynchronous thread, executing the auxiliary function based on the asynchronous execution table, and then further comprising:
starting a compensation thread according to a preset time interval;
and inquiring the asynchronous execution table through the compensation thread to acquire and complement the execution state flag bit as an auxiliary function to be executed.
The embodiment of the invention also provides an execution device of the auxiliary function, which comprises:
the construction module is used for constructing an asynchronous execution table corresponding to the category in the database based on the category of the auxiliary function in the underwriting process;
the main execution module is used for starting a main thread of the underwriting process and executing necessary functions in the underwriting process, wherein the necessary functions are functions except for auxiliary functions in the underwriting process;
the write-in module is used for writing the auxiliary function in the underwriting process into the asynchronous execution table corresponding to the type of the auxiliary function, and setting the status flag bit of the auxiliary function to be executed;
the auxiliary execution module is used for starting an asynchronous thread and executing the auxiliary function based on the asynchronous execution table if the main thread finishes execution;
and the updating module is used for updating the status flag bit of the auxiliary function which is successfully executed in the asynchronous execution table to be executed.
Further, the sub-execution module includes:
a total number obtaining unit, configured to obtain a total number of categories of an asynchronous execution table written by a main thread if the main thread finishes execution;
the starting unit is used for starting an asynchronous thread according to the category total number and executing the auxiliary function through the asynchronous thread;
wherein an asynchronous thread corresponds to a class of asynchronous execution table, and processes the auxiliary function recorded therein and related to the underwriting process.
Further, the executing device further comprises:
and the supplementary execution module is used for starting a compensation thread according to a preset time interval, inquiring the asynchronous execution table through the compensation thread, and acquiring and supplementary-executing the auxiliary function with the status flag bit to be executed.
Embodiments of the present invention also provide a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the method for executing the auxiliary function as described above.
The embodiment of the present invention further provides a terminal, where the terminal includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the steps of the method for executing the auxiliary function when executing the computer program.
Compared with the prior art, the embodiment of the invention is based on the category of the auxiliary function in the underwriting process, and the asynchronous execution table corresponding to the category is constructed in the database; when executing the underwriting process, only executing necessary functions in the underwriting process through a main thread, namely the functions except the auxiliary functions in the underwriting process; bypassing the auxiliary function and temporarily not executing, writing the auxiliary function in the underwriting flow into an asynchronous execution table corresponding to the type of the auxiliary function, and setting a state flag bit to be executed; if the main thread finishes executing, starting an asynchronous thread, executing an auxiliary function based on the record of the asynchronous execution table, and updating a status flag bit of the auxiliary function which is successfully executed in the asynchronous execution table to be executed; therefore, the non-critical auxiliary functions with low timeliness in the underwriting process are separated from the main thread, the probability of unavailability of the whole process caused by calling system faults or calling program faults is effectively reduced, the timeliness of the underwriting process is improved, and the labor cost is reduced.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a flowchart of a first implementation of a method for executing an auxiliary function according to an embodiment of the present invention;
FIG. 2 is a flow chart of a second implementation of a method for performing an auxiliary function provided by an embodiment of the present invention;
FIG. 3 is a flow chart of a third implementation of a method for performing an auxiliary function provided by an embodiment of the present invention;
FIG. 4 is a flow chart of a fourth implementation of a method for performing an auxiliary function provided by an embodiment of the present invention;
FIG. 5 is a block diagram of an apparatus for executing auxiliary functions according to an embodiment of the present invention;
fig. 6 is a schematic diagram of a terminal according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Fig. 1 shows a first implementation flow of an execution method of an auxiliary function provided by an embodiment of the present invention. The execution method of the auxiliary function provided by the embodiment of the invention is applied to the background server. Referring to fig. 1, the execution method includes:
in step S101, based on the category of the auxiliary function in the underwriting process, an asynchronous execution table corresponding to the category is built in the database.
Illustratively, in the embodiment of the present invention, the auxiliary function includes, but is not limited to, a note issuing short message notification, a policy printing, and a renewal notification.
Here, the embodiment of the present invention builds an asynchronous execution table in the database in advance, and the asynchronous execution table is used for the main thread to write the unexecuted auxiliary function in the execution process. The auxiliary function is an unnecessary function in the underwriting process and is realized by calling an external system. As described above, the auxiliary functions include, but are not limited to, various categories such as a note-out short message notification, a policy print, a renewal notification, and the like, and for convenience of management, the embodiment of the present invention constructs a corresponding asynchronous execution table based on the auxiliary function of each category. For example, two auxiliary functions a and two auxiliary functions B of different categories are provided, where the auxiliary function a correspondingly constructs an asynchronous execution table a, the asynchronous execution table a is used to record the auxiliary function of the same category as the auxiliary function a, the auxiliary function B correspondingly constructs an asynchronous execution table B, and the asynchronous execution table B is used to record the auxiliary function of the same category as the auxiliary function B. A class of asynchronous execution tables may be used by multiple different main threads and write auxiliary functions associated with the class.
Optionally, the database includes, but is not limited to, an Oracle database, a pg database, and is a database used in the underwriting system.
In step S102, a main thread of the underwriting process is started, and necessary functions in the underwriting process are executed, where the necessary functions are functions in the underwriting process except for the auxiliary functions.
In the embodiment of the invention, the main thread of the underwriting process is started according to an underwriting instruction triggered by a service worker. The main thread is used for executing necessary functions in the underwriting process. The necessary functions are insurance process tasks except the auxiliary functions, namely indispensable link tasks in the insurance process. In the embodiment of the invention, the main thread only executes the logic part of the main thread, does not execute the auxiliary function, executes the step S103 if the auxiliary function is met, and skips the auxiliary function to continue to execute the next necessary function in the underwriting process after the step S103 is executed, thereby solving the problem that the whole process is unavailable due to the fault of a called system or a calling program when the auxiliary function is executed, reducing the probability that the process is terminated due to the failure of the auxiliary function, and particularly having great significance for systems with higher requirements on key transaction availability.
In step S103, writing the auxiliary function in the underwriting process into the asynchronous execution table corresponding to the category of the auxiliary function, and setting the status flag bit of the auxiliary function to be executed.
In the process of executing the underwriting flow, if the main thread encounters an auxiliary function, a preset table writing method is automatically called, and the auxiliary function is written into the asynchronous execution table corresponding to the type of the auxiliary function. As described above, if the auxiliary function a is executed, the asynchronous execution table a is written, and if the auxiliary function B is executed, the asynchronous execution table B is written. Writing an auxiliary function to the asynchronous execution table should be understood herein as marking an auxiliary function of the underwriting flow in the asynchronous execution table indicating that an auxiliary function is present in the underwriting flow and that the auxiliary function is not being executed.
In the embodiment of the present invention, a status flag bit field may be further added in the asynchronous execution table, so as to mark an execution status of the auxiliary function, and optionally, the execution status includes but is not limited to waiting for execution, successful execution, in execution, and failed execution. The field value of the flag bit can be customized, for example, U can be used to indicate that the execution is to be performed, S can be used to indicate that the execution is successful, and I can be used to indicate that the execution is failed. In step S103, the main thread sets the status flag bit of the auxiliary function to U according to the user definition.
In step S104, if the main thread finishes executing, an asynchronous thread is started, and the auxiliary function is executed based on the asynchronous execution table.
It should be noted that the auxiliary function is stripped from the main thread of the underwriting process, and is not executed, but is not executed in the main thread in series in the embodiment of the present invention.
And the auxiliary functions written into the asynchronous execution table are uniformly executed after the main thread finishes executing. Therefore, after the main thread finishes executing, the embodiment of the invention starts the asynchronous thread, so as to read the asynchronous execution table through the asynchronous thread and execute the auxiliary function. The embodiment of the invention strips unnecessary auxiliary functions from the main thread, so that the main thread does not need to call an external system, the execution efficiency of the underwriting process is improved, and the timeliness of the underwriting process is improved.
In step S105, the status flag bit in the asynchronous execution table of the auxiliary function that executed successfully is updated to be executed.
Here, if the auxiliary function is successfully executed, for example, no fault occurs during the process of calling the system and executing the program, the status flag bit of the auxiliary function is updated to be executed through the asynchronous thread. If the auxiliary function fails to execute, no operation is performed.
In summary, in the embodiments of the present invention, a corresponding asynchronous execution table is constructed based on the category of the auxiliary function; when executing the underwriting process, only executing necessary functions in the underwriting process through the main thread, bypassing the auxiliary functions, and writing the auxiliary functions in the underwriting process into the asynchronous execution table corresponding to the categories of the auxiliary functions; when the execution of the main thread is finished, starting an asynchronous thread and executing the auxiliary function in the asynchronous execution table; therefore, the non-critical auxiliary function with low timeliness in the underwriting process is separated from the main thread, the auxiliary function and the necessary function are respectively executed by different threads, the probability that the whole process is unavailable due to calling system faults or calling program faults is effectively reduced, the timeliness of the underwriting process is improved, and the labor cost is reduced.
Further, based on the first implementation flow of the method for executing the auxiliary function provided in fig. 1, a second implementation flow of the method for executing the auxiliary function provided in the embodiment of the present invention is provided.
Fig. 2 is a schematic flow chart of a second implementation of the method for executing the auxiliary function according to the embodiment of the present invention. In this embodiment of the present invention, in step S103, writing the auxiliary function in the underwriting process into the asynchronous execution table corresponding to its category, and setting the status flag bit of the auxiliary function to be executed includes:
in step S1031, if the auxiliary function in the underwriting process is executed, the category and parameter information corresponding to the auxiliary function are acquired.
Here, the parameter information is an execution requirement, an execution specification of the auxiliary function, and is used to instruct the asynchronous thread how to execute the auxiliary function, including but not limited to an execution time, an execution frequency, a method function, a service template number, an input parameter, an order number, and a service type. And the service template number is the number of the service template corresponding to the auxiliary function. For the categories of short message notification, mail notification and the like, corresponding sending contents and formats are available, and the sending contents and the formats jointly form a template of the categories. The embodiment of the invention assigns a number to each type of template, thereby obtaining the service template number for indexing different types of service templates.
Illustratively, for the short message notification, the parameter information includes, but is not limited to, execution time, execution frequency, execution method, short message template number, input parameter, order number, service type, short message template, short message sender, short message receiver, sending time.
In step S1032, the asynchronous execution table corresponding to the category is determined, the parameter information is written into a corresponding field of the asynchronous execution table, and a status flag is set to be executed.
As can be seen from step S1031, the asynchronous execution table corresponding to each type of auxiliary function is provided with a field corresponding to the parameter information. When the main thread executes the auxiliary function, the parameter information corresponding to the auxiliary function is obtained, then the parameter information is filled into the corresponding field of the asynchronous execution table of the corresponding category, and the status flag bit is set to be executed, so that the marking of the unexecuted auxiliary function is completed, and the auxiliary function which is executed in the main thread in the prior art is separated from the main thread and is not executed in the main thread in series.
Optionally, in this embodiment of the present invention, if the main thread finishes executing in step S104, the method starts an asynchronous thread, and executes the auxiliary function based on the asynchronous execution table, further includes:
in step S1041, if the main thread finishes executing, the asynchronous thread is started, the field value in the asynchronous execution table is read, and the parameter information of the auxiliary function related to the current underwriting process is obtained.
Different from the prior art that the whole underwriting process is finished when the main thread is finished executing, in the embodiment of the invention, after the main thread executes the necessary functions of the underwriting process, another thread called as an asynchronous thread is started, the categories of the auxiliary functions which are not executed in the underwriting process are obtained through the asynchronous thread, the corresponding asynchronous execution table is indexed in the database according to the categories, and then the recorded parameter information is obtained from the asynchronous execution table to obtain the auxiliary functions which are not executed.
In step S1042, the auxiliary function is executed based on the parameter information.
And the asynchronous thread completes the auxiliary function based on the execution time, the execution frequency and the method function in the acquired parameter information. Illustratively, taking the short message notification as an example, if the parameter information includes an execution time, and the execution time is to send the short message notification to the client within one day after underwriting, step S1041 sets the timing task when writing the execution time into the asynchronous execution table, and sets the execution time of the timing task as to send the short message notification to the client within one day after underwriting. The embodiment of the invention starts the timing task when the main thread is finished and executes the short message notification sending according to the execution time.
Therefore, the embodiment of the invention is based on the asynchronous execution table, the auxiliary function and the necessary function are executed by two paths of threads, the auxiliary function is prevented from being executed in series in the main thread, but the auxiliary function is executed uniformly after the necessary function is executed, the problem of failure of the underwriting process caused by calling system fault or calling program fault when the auxiliary function is executed is solved, the probability of occurrence of the problem is reduced, the execution efficiency of the main thread is effectively improved, and the timeliness of the underwriting process is improved.
Further, based on the first implementation flow of the method for executing the auxiliary function provided in fig. 1, a third implementation flow of the method for executing the auxiliary function provided in the embodiment of the present invention is provided.
Fig. 3 is a schematic flow chart illustrating a third implementation of the method for executing an auxiliary function according to the embodiment of the present invention. In this embodiment of the present invention, if the main thread finishes executing in step S104, the starting of the asynchronous thread and the executing of the auxiliary function based on the asynchronous execution table include:
in step S104a, when the main thread finishes executing, the total number of categories of the asynchronous execution table written by the main thread is acquired.
Here, the underwriting flow may include one or more auxiliary functions. If there are multiple auxiliary functions, step S103 writes the auxiliary functions involved in the underwriting process into the asynchronous execution tables corresponding to the categories of the auxiliary functions. When the main thread finishes executing, it needs to respond to these multiple auxiliary functions. To improve execution efficiency, embodiments of the invention separately initiate an asynchronous thread to respond for each class of asynchronous execution table. After the main thread finishes executing, the embodiment of the present invention obtains the category of the asynchronous execution table written in the underwriting process, and counts the number of the categories to determine the number of the asynchronous threads to be started.
In step S104b, an asynchronous thread is started according to the total number of categories, and the auxiliary function is executed by the asynchronous thread.
The embodiment of the invention starts the same number of asynchronous threads based on the category number. Wherein an asynchronous thread corresponds to a class of asynchronous execution table, and processes the auxiliary function recorded therein and related to the underwriting process.
Illustratively, it is assumed that an underwriting process involves two auxiliary functions, namely, an acceptance short message notification a and a policy printing B, which are written into two different types of asynchronous execution tables, namely, an asynchronous execution table a and an asynchronous execution table B, respectively, when the main thread executes step S103. After the main thread finishes executing, two asynchronous threads are synchronously started to call, such as an asynchronous thread 1 and an asynchronous thread 2, the parameter information in the asynchronous execution table A is captured through the asynchronous thread 1, the short message system is called to complete the function of accepting the short message notification, the parameter in the asynchronous execution table B is captured through the asynchronous thread 2, and the printing system is called to complete the function of insurance policy printing, so that the response efficiency of the auxiliary function is effectively improved through parallel processing of the auxiliary function, and the timeliness of the insurance flow is improved.
Further, under the condition that the execution of the main thread is successful, if the execution of the auxiliary function fails, the prior art adopts a manual mode to analyze the reason of the failure, find error points, then modify the data script, and trigger the asynchronous thread to execute the auxiliary function again until the execution of the auxiliary function is successful, the process is complex, and the labor cost is high. In order to solve the above technical problem, a fourth implementation procedure of the method for executing the auxiliary function according to the embodiment of the present invention is proposed based on the first implementation procedure of the method for executing the auxiliary function provided in fig. 1.
Fig. 4 is a schematic flow chart of a fourth implementation of the method for executing an auxiliary function according to the embodiment of the present invention. In this embodiment of the present invention, the starting an asynchronous thread in step S104, and executing the auxiliary function based on the asynchronous execution table, further includes:
in step S106, the compensation thread is started at a preset time interval.
As described above, if the auxiliary function fails to be executed, the asynchronous thread does not change its status flag, and the status flag is still to be executed. Since the embodiment of fig. 1 has stripped the auxiliary function from the main thread and stored in the asynchronous execution table, the complementary execution can be conveniently performed. In view of the asynchronous execution table, the embodiment of the present invention further adds a complementary processing mechanism, and further adds a compensation thread, where the compensation thread is used to perform complementary execution on the auxiliary function when the asynchronous thread fails to perform execution, so as to implement complementary processing on the auxiliary function.
In step S107, the asynchronous execution table is queried through the compensation thread, and an auxiliary function whose status flag bit is to be processed is obtained and complemented.
In the embodiment of the invention, the compensation thread is started after the asynchronous thread finishes executing and is triggered by a timing task. The time interval is based on traffic demand and may be hourly or daily. After starting, the compensation thread searches asynchronous execution tables one by one, captures auxiliary functions failed to be executed within one hour or one day, acquires corresponding parameter information, and completes the auxiliary functions based on an execution method in the parameter information.
According to the embodiment of the invention, the compensation mechanism is added and performs the supplementary processing on the auxiliary function which fails to execute the asynchronous thread according to the asynchronous execution table, so that the supplementary execution process of the auxiliary function does not need to be manually participated, the manpower input is effectively reduced, and the automation degree of executing the auxiliary function is improved.
It should be understood that, in the above embodiments, the order of execution of the steps is not meant to imply any order, and the order of execution of the steps should be determined by their function and inherent logic, and should not limit the implementation process of the embodiments of the present invention.
Example 2
Fig. 5 is a block diagram showing an execution apparatus of an auxiliary function according to an embodiment of the present invention, and only a part related to the embodiment of the present invention is shown for convenience of description.
In an embodiment of the present invention, the auxiliary function executing apparatus is configured to implement the auxiliary function executing method in the embodiments of fig. 1, fig. 2, fig. 3, and fig. 4, and may be a software unit, a hardware unit, or a unit combining software and hardware that is built in a server.
Referring to fig. 5, the auxiliary function executing device includes:
a building module 51, configured to build, based on the category of the auxiliary function in the underwriting process, an asynchronous execution table corresponding to the category in the database;
a main execution module 52, configured to start a main thread of the underwriting process, and execute a necessary function in the underwriting process, where the necessary function is a function in the underwriting process except for the auxiliary function;
a writing module 53, configured to write an auxiliary function in the underwriting process into an asynchronous execution table corresponding to the type of the auxiliary function, and set a status flag bit of the auxiliary function to be executed;
the auxiliary execution module 54 is configured to start an asynchronous thread if the main thread finishes executing, and execute the auxiliary function based on the asynchronous execution table;
and an updating module 55, configured to update the status flag bit in the asynchronous execution table of the auxiliary function that is successfully executed to be executed.
Optionally, the writing module 53 further includes:
a parameter obtaining unit 531, configured to, if an auxiliary function in the underwriting process is executed, obtain a category and parameter information corresponding to the auxiliary function;
a writing unit 532, configured to determine the asynchronous execution table corresponding to the category, write the parameter information into a corresponding field of the asynchronous execution table, and set a status flag bit to be executed.
Optionally, the sub-execution module 54 further includes:
a reading unit 541, configured to start an asynchronous thread if the main thread finishes execution, read a field value in the asynchronous execution table, and obtain parameter information of an auxiliary function related to a current underwriting process;
an executing unit 542 is configured to execute the auxiliary function based on the parameter information.
Optionally, the sub-execution module 54 further includes:
a total obtaining unit 543, configured to obtain, if the main thread finishes executing, a category total of the asynchronous execution table written by the main thread;
a starting unit 544, configured to start an asynchronous thread according to the total number of categories, and execute the auxiliary function through the asynchronous thread;
wherein an asynchronous thread corresponds to a class of asynchronous execution table, and processes the auxiliary function recorded therein and related to the underwriting process.
Optionally, the executing device further includes:
and the supplementary execution module 56 is configured to start a compensation thread according to a preset time interval, query the asynchronous execution table through the compensation thread, and acquire and supplement an auxiliary function to be executed in which the status flag is to be executed.
It should be noted that each module/unit in the embodiment of the present invention may be configured to implement all technical solutions in the foregoing method embodiments, and specific working processes thereof may refer to corresponding processes in the foregoing method embodiments, which are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Example 3
This embodiment provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the method for executing an auxiliary function in embodiment 1 is implemented, and details are not described here again to avoid repetition. Alternatively, the computer program is executed by the processor to implement the functions of each module/unit in the auxiliary function execution apparatus in embodiment 2, and details are not described here for avoiding redundancy.
Example 4
Fig. 6 is a schematic diagram of a terminal provided in an embodiment of the present invention, where the terminal includes, but is not limited to, a server and a mobile terminal. As shown in fig. 6, the terminal 6 of this embodiment includes: a processor 60, a memory 61 and a computer program 62 stored in said memory 61 and executable on said processor 60. When the processor 60 executes the computer program 62, the steps in the embodiment of the method for executing the auxiliary function described above are implemented, for example, steps S101 to S105 shown in fig. 1, steps S1031 to S1032 and steps S1041 to S1042 described in the embodiment of fig. 2, steps S104a to S104b described in the embodiment of fig. 3, and steps S101 to S107 described in the embodiment of fig. 4; alternatively, the processor 60, when executing the computer program 62, implements the functions of the modules/units in the above-mentioned auxiliary function execution device embodiment, for example, the functions of the modules 51 to 56 shown in fig. 5.
Illustratively, the computer program 62 may be partitioned into one or more modules/units that are stored in the memory 61 and executed by the processor 60 to implement the present invention. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution of the computer program 62 in the terminal 6. For example, the computer program 62 may be divided into a building module, a main execution module, a writing module, an auxiliary execution module, and an updating module, and the specific functions of the modules are as follows:
the construction module is used for constructing an asynchronous execution table corresponding to the category in the database based on the category of the auxiliary function in the underwriting process;
the main execution module is used for starting a main thread of the underwriting process and executing necessary functions in the underwriting process, wherein the necessary functions are functions except for auxiliary functions in the underwriting process;
the write-in module is used for writing the auxiliary function in the underwriting process into the asynchronous execution table corresponding to the type of the auxiliary function, and setting the status flag bit of the auxiliary function to be executed;
the auxiliary execution module is used for starting an asynchronous thread and executing the auxiliary function based on the asynchronous execution table if the main thread finishes execution;
and the updating module is used for updating the status flag bit of the auxiliary function which is successfully executed in the asynchronous execution table to be executed.
The terminal 6 may be a desktop computer, a notebook, a palm computer, a cloud server, or other computing devices. The terminal may include, but is not limited to, a processor 60, a memory 61. It will be appreciated by those skilled in the art that fig. 6 is only an example of a terminal 6 and does not constitute a limitation of the terminal 6, and that it may comprise more or less components than those shown, or some components may be combined, or different components, for example the terminal may further comprise input output devices, network access devices, buses, etc.
The Processor 60 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may be any conventional processor or the like, which is the control center of the terminal and connects the various parts of the overall terminal using various interfaces and lines.
The memory 61 may be used to store the computer programs and/or modules, and the processor may implement various functions of the terminal by operating or executing the computer programs and/or modules stored in the memory and calling data stored in the memory. The memory may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data created according to the use of the terminal, and the like. In addition, the memory may include high speed random access memory, and may also include non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital Card (SD), a Flash memory Card (Flash Card), at least one magnetic disk storage device, a Flash memory device, or other volatile solid state storage device.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated modules/units, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may also be implemented by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method embodiments may be implemented. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable storage medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable storage medium may contain content that is subject to appropriate increase or decrease according to the requirements of legislation and patent practice in the jurisdiction, for example, in some jurisdictions, the computer readable storage medium does not include electrical carrier signals and telecommunication signals according to legislation and patent practice.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.
Claims (10)
1. An execution method of an auxiliary function, the execution method comprising:
based on the category of the auxiliary function in the underwriting process, establishing an asynchronous execution table corresponding to the category in a database;
starting a main thread of an underwriting process, and executing necessary functions in the underwriting process, wherein the necessary functions are functions except auxiliary functions in the underwriting process;
the main thread writes the auxiliary function in the underwriting process into an asynchronous execution table corresponding to the type of the auxiliary function, and sets a status flag bit of the auxiliary function to be executed;
if the main thread finishes executing, starting an asynchronous thread, and executing the auxiliary function based on the asynchronous execution table;
and updating the status flag bit of the auxiliary function which is successfully executed in the asynchronous execution table to be executed.
2. The method for executing an auxiliary function according to claim 1, wherein the writing the auxiliary function in the underwriting process into the asynchronous execution table corresponding to its category, and setting the status flag bit of the auxiliary function to be executed includes:
if the auxiliary function in the underwriting process is executed, acquiring the category and parameter information corresponding to the auxiliary function;
and determining an asynchronous execution table corresponding to the category, writing the parameter information into a corresponding field of the asynchronous execution table, and setting a status flag bit to be executed.
3. The method of claim 2, wherein the step of starting an asynchronous thread if the main thread finishes executing, and executing the auxiliary function based on the asynchronous execution table comprises:
if the main thread finishes executing, starting an asynchronous thread, reading a field value in the asynchronous execution table, and acquiring parameter information of an auxiliary function related to the current underwriting process;
performing the auxiliary function based on the parameter information.
4. A method for performing an auxiliary function according to any of claims 1 to 3, wherein starting an asynchronous thread if the main thread finishes executing, and performing the auxiliary function based on the asynchronous execution table comprises:
if the main thread finishes executing, acquiring the total number of categories of the asynchronous execution table written by the main thread;
starting an asynchronous thread according to the category total number, and executing the auxiliary function through the asynchronous thread;
wherein an asynchronous thread corresponds to a class of asynchronous execution table, and processes the auxiliary function recorded therein and related to the underwriting process.
5. The method of claim 1, wherein the initiating an asynchronous thread, executing the auxiliary function based on the asynchronous execution table, then further comprises:
starting a compensation thread according to a preset time interval;
and inquiring the asynchronous execution table through the compensation thread to acquire and complement the execution state flag bit as an auxiliary function to be executed.
6. An apparatus for performing an auxiliary function, the apparatus comprising:
the construction module is used for constructing an asynchronous execution table corresponding to the category in the database based on the category of the auxiliary function in the underwriting process;
the main execution module is used for starting a main thread of the underwriting process and executing necessary functions in the underwriting process, wherein the necessary functions are functions except for auxiliary functions in the underwriting process;
the write-in module is used for writing the auxiliary function in the underwriting process into the asynchronous execution table corresponding to the type of the auxiliary function by the main thread and setting the status flag bit of the auxiliary function to be executed;
the auxiliary execution module is used for starting an asynchronous thread and executing the auxiliary function based on the asynchronous execution table if the main thread finishes execution;
and the updating module is used for updating the status flag bit of the auxiliary function which is successfully executed in the asynchronous execution table to be executed.
7. The auxiliary function execution apparatus of claim 6, wherein the secondary execution module comprises:
a total number obtaining unit, configured to obtain a total number of categories of an asynchronous execution table written by a main thread if the main thread finishes execution;
the starting unit is used for starting an asynchronous thread according to the category total number and executing the auxiliary function through the asynchronous thread;
wherein an asynchronous thread corresponds to a class of asynchronous execution table, and processes the auxiliary function recorded therein and related to the underwriting process.
8. An apparatus for performing an auxiliary function according to claim 6 or 7, wherein said apparatus further comprises:
and the supplementary execution module is used for starting a compensation thread according to a preset time interval, inquiring the asynchronous execution table through the compensation thread, and acquiring and supplementary-executing the auxiliary function with the status flag bit to be executed.
9. A computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, is adapted to carry out the steps of the method for performing an auxiliary function of any one of claims 1 to 5.
10. A terminal comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the steps of the method for performing an auxiliary function according to any one of the preceding claims 1 to 5 are implemented when the computer program is executed by the processor.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810014125.8A CN108460078B (en) | 2018-01-08 | 2018-01-08 | Auxiliary function execution method and device, storage medium and terminal |
PCT/CN2018/077361 WO2019134238A1 (en) | 2018-01-08 | 2018-02-27 | Method for executing auxiliary function, device, storage medium, and terminal |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810014125.8A CN108460078B (en) | 2018-01-08 | 2018-01-08 | Auxiliary function execution method and device, storage medium and terminal |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108460078A CN108460078A (en) | 2018-08-28 |
CN108460078B true CN108460078B (en) | 2020-10-13 |
Family
ID=63221239
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810014125.8A Active CN108460078B (en) | 2018-01-08 | 2018-01-08 | Auxiliary function execution method and device, storage medium and terminal |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN108460078B (en) |
WO (1) | WO2019134238A1 (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111930771A (en) * | 2020-07-21 | 2020-11-13 | 银盛支付服务股份有限公司 | Data processing method and system based on BI system |
CN112799618A (en) * | 2021-02-04 | 2021-05-14 | 上海中通吉网络技术有限公司 | Control method, device and equipment of printer |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101287166A (en) * | 2008-02-22 | 2008-10-15 | 北京航空航天大学 | Short message publishing system and method for auxiliary system of electronic meeting |
CN103365707A (en) * | 2012-03-30 | 2013-10-23 | 国际商业机器公司 | Method and device for controlling returning of asynchronous calls |
CN105528254A (en) * | 2015-12-07 | 2016-04-27 | 贵阳朗玛信息技术股份有限公司 | Business processing method and apparatus |
CN105550051A (en) * | 2015-12-25 | 2016-05-04 | 北京奇虎科技有限公司 | Asynchronous processing method and device of business request |
CN105912455A (en) * | 2016-04-27 | 2016-08-31 | 努比亚技术有限公司 | Business execution method and server |
CN107038645A (en) * | 2016-12-21 | 2017-08-11 | 阿里巴巴集团控股有限公司 | Method for processing business, apparatus and system and server |
CN107368359A (en) * | 2017-05-31 | 2017-11-21 | 杭州大搜车汽车服务有限公司 | A kind of asynchronous task performs method and its storage medium, device |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9524307B2 (en) * | 2013-03-14 | 2016-12-20 | Microsoft Technology Licensing, Llc | Asynchronous error checking in structured documents |
US20150339033A1 (en) * | 2014-05-21 | 2015-11-26 | Facebook, Inc. | Asynchronous Execution of Tasks for a GUI |
CN106600226B (en) * | 2016-12-13 | 2020-08-04 | 泰康保险集团股份有限公司 | Method and device for optimizing process management system |
-
2018
- 2018-01-08 CN CN201810014125.8A patent/CN108460078B/en active Active
- 2018-02-27 WO PCT/CN2018/077361 patent/WO2019134238A1/en active Application Filing
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101287166A (en) * | 2008-02-22 | 2008-10-15 | 北京航空航天大学 | Short message publishing system and method for auxiliary system of electronic meeting |
CN103365707A (en) * | 2012-03-30 | 2013-10-23 | 国际商业机器公司 | Method and device for controlling returning of asynchronous calls |
CN105528254A (en) * | 2015-12-07 | 2016-04-27 | 贵阳朗玛信息技术股份有限公司 | Business processing method and apparatus |
CN105550051A (en) * | 2015-12-25 | 2016-05-04 | 北京奇虎科技有限公司 | Asynchronous processing method and device of business request |
CN105912455A (en) * | 2016-04-27 | 2016-08-31 | 努比亚技术有限公司 | Business execution method and server |
CN107038645A (en) * | 2016-12-21 | 2017-08-11 | 阿里巴巴集团控股有限公司 | Method for processing business, apparatus and system and server |
CN107368359A (en) * | 2017-05-31 | 2017-11-21 | 杭州大搜车汽车服务有限公司 | A kind of asynchronous task performs method and its storage medium, device |
Non-Patent Citations (3)
Title |
---|
基于DWR的保险项目管理***的设计与实现;张敏等;《计算机工程与设计》;20110430;第32卷(第4期);第1165-1168页 * |
基于多线程技术的银行中间业务***;王加阳等;《计算机应用》;20021031;第22卷(第10期);第283-285页 * |
复杂即时流程集成模型及其在保险业的应用;蒋农等;《计算机工程》;20090731;第35卷(第13期);第70-73页 * |
Also Published As
Publication number | Publication date |
---|---|
WO2019134238A1 (en) | 2019-07-11 |
CN108460078A (en) | 2018-08-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109271265B (en) | Request processing method, device, equipment and storage medium based on message queue | |
CN109634728B (en) | Job scheduling method and device, terminal equipment and readable storage medium | |
CN110851253B (en) | Remote operation and maintenance method, system, storage medium and electronic equipment | |
CN111914520A (en) | Document collaborative editing method and device, computer device and storage medium | |
WO2021008413A1 (en) | Fault prompting method for internet of things device, and related apparatus | |
CN111274052A (en) | Data distribution method, server, and computer-readable storage medium | |
CN105468302B (en) | A kind of method, apparatus and system of processing data | |
CN109361525B (en) | Method, device, control terminal and medium for restarting distributed deployment of multiple services | |
CN113672627B (en) | Method and device for constructing index of elastic search engine | |
CN108460078B (en) | Auxiliary function execution method and device, storage medium and terminal | |
CN111049913B (en) | Data file transmission method and device, storage medium and electronic equipment | |
CN111240610A (en) | Printing process management and control method, system, terminal and storage medium | |
CN108255967B (en) | Method and device for calling storage process, storage medium and terminal | |
US20160284013A1 (en) | Order processing system and order processing method | |
CN113760610A (en) | OpenStack-based bare computer high-availability realization method and device and electronic equipment | |
CN112835885A (en) | Processing method, device and system for distributed table storage | |
CN108520401B (en) | User list management method, device, platform and storage medium | |
CN112667631A (en) | Method, device and equipment for automatically editing service field and storage medium | |
JP2012089049A (en) | Computer system and server | |
CN111045928A (en) | Interface data testing method, device, terminal and storage medium | |
CN111652580B (en) | Method and device for processing data of nodes | |
CN110264383B (en) | Electronic contract filing method and device, readable storage medium and server | |
CN114157662A (en) | Cloud platform parameter adaptation method and device, terminal equipment and storage medium | |
CN112035471A (en) | Transaction processing method and computer equipment | |
CN112423162A (en) | Configuration synchronization method and system under distributed architecture |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |