A method, apparatus, device, and storage medium for hot deployment of batch tasks.
By encapsulating business logic and dynamically constructing beans within the financial system, hot deployment of batch tasks is achieved. This solves the problem of large development workload and long service gaps caused by adding and deleting tasks in the financial system, thereby improving operational efficiency and flexibility.
Patent Information
- Application Number
- CN202511232739.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-01
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2045-09-01
AI Technical Summary
The frequent addition and deletion of batch tasks in the financial system leads to a heavy workload for developers and long service downtime.
By screening and encapsulating the business processes of the target financial system, reusable components are formed to constitute the basic service layer. Beans are dynamically constructed and loaded into the task pool of the Spring batch framework to achieve hot deployment of batch tasks.
It reduces the workload of developers, decreases the risk of system service interruption, improves operational efficiency and flexibility, and supports simultaneous multitasking and templated operations.
Smart Images

Figure CN120743320B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data hot deployment technology, and in particular to a method, apparatus, equipment and storage medium for hot deployment of batch tasks. Background Technology
[0002] Financial systems are characterized by complex and intricate business processes, requiring them to handle data and functional demands from multiple stakeholders, including users, back-office staff, finance personnel, auditors, and external partners. Because the required data volumes are typically large, financial systems often employ batch tasks to calculate and aggregate data during the day and at the end of the day. Frequent increases and changes in requirements necessitate frequent adjustments to these batch tasks, leading to frequent additions and deletions of such tasks.
[0003] Currently, the common approach to handling frequent additions and deletions of batch tasks in financial systems is as follows: Adding a batch task requires developing corresponding business functions based on requirements, making data changes or summarizing and statistical analyses, defining the corresponding batch task, and then, after testing and verification, deploying it online to ensure the new batch task is added to the system and starts periodically. Deleting a batch task also requires deleting or commenting out the corresponding code, testing and verification, and then deploying it online again. If the batch task needs to be reused later, the same series of steps involved in adding a batch task must be repeated. This approach results in a large workload for developers and long system service downtime. Summary of the Invention
[0004] In view of this, the purpose of this invention is to provide a method, apparatus, device, and storage medium for hot deployment of batch tasks, which enables the loading and unloading of batch tasks without requiring online deployment by orchestrating basic services and real-time task input. The specific solution is as follows:
[0005] Firstly, this application provides a method for hot deployment of batch tasks, including:
[0006] The initial business in the target financial system is screened, and the target business selected from the initial business is encapsulated to obtain reusable components corresponding to each target business, and the basic service layer is constructed using each reusable component.
[0007] Obtain initial task configuration files in different file formats, dynamically construct different initial beans based on each initial task configuration file, and use each initial bean to obtain each target batch task;
[0008] The first target bean corresponding to each target batch task is selected from each initial bean. Each first target bean is traversed, and each target batch task is determined to be the first task loaded into the target task pool based on each first target bean, so as to obtain the corresponding judgment result; wherein, the target task pool is the task pool in the Spring batch framework corresponding to the target financial system.
[0009] Based on the judgment result, each of the target batch tasks is loaded into the target task pool, and the second target bean contained in the first target bean is used in the target task pool to call each of the reusable components in the basic service layer so as to modify the tasks in the target financial system when the target financial system is in operation; wherein, the first target bean is the Job corresponding to each of the target batch tasks, and the second target bean is the ManagerStep contained in the Job.
[0010] Optionally, the initial Bean includes Job, ManagerStep, partitioner, Master-side message channel, Master-side output stream, WorkerStep, Worker-side message channel, and Worker-side input stream.
[0011] Optionally, the step of dynamically constructing different initial beans based on each of the initial task configuration files includes:
[0012] The initial task configuration files of different file formats are converted into target task configuration files of the target file format.
[0013] Each target task configuration file is converted into a target entity, the target entity corresponding to the target task configuration file is parsed to obtain the target task configuration parameters, and different initial beans are dynamically constructed according to each target task configuration parameter.
[0014] Optionally, loading each of the target batch tasks into the target task pool based on the determination result includes:
[0015] If the determination result indicates that each of the target batch tasks is a task being loaded into the target task pool for the first time, then the first target Bean corresponding to each of the target batch tasks is added to the target task pool, and the second target Bean corresponding to the first target Bean is added to the target task pool, so as to load each of the target batch tasks into the target task pool.
[0016] Optionally, loading each of the target batch tasks into the target task pool based on the determination result includes:
[0017] If the judgment result indicates that each of the target batch tasks is not the first task to be loaded into the target task pool, then the historical first target bean corresponding to each of the target batch tasks is deleted from the target task pool, the historical second target bean corresponding to the historical first target bean is deleted from the target task pool, and the partitioner, the Master-side message channel, the Master-side output stream, the Worker-side message channel, and the Worker-side input stream corresponding to the historical first target bean are deleted from the target task pool.
[0018] Each target batch task is added to the target task pool with a new first target bean, and the corresponding second target bean is added to the target task pool with a new first target bean, so as to load each target batch task into the target task pool.
[0019] Optionally, the batch task hot deployment method further includes: obtaining the task name corresponding to the batch task to be uninstalled, and searching for the first target Bean to be uninstalled corresponding to the batch task to be uninstalled from the target task pool according to the task name;
[0020] Remove the first target bean to be uninstalled corresponding to the batch task to be uninstalled from the target task pool, and find the second target bean to be uninstalled corresponding to the first target bean to be uninstalled from the target task pool;
[0021] The second target bean to be uninstalled is removed from the target task pool, and the partitioner, master-side message channel, master-side output stream, worker-side message channel, and worker-side input stream corresponding to the first target bean to be uninstalled are also removed from the target task pool, so as to modify the tasks in the target financial system when the target financial system is in operation.
[0022] Secondly, this application provides a batch task hot deployment device, comprising:
[0023] The business encapsulation module is used to screen the initial business in the target financial system, encapsulate the target business selected from the initial business to obtain reusable components corresponding to each target business, and use each reusable component to form a basic service layer.
[0024] The batch task acquisition module acquires initial task configuration files in different file formats, dynamically constructs different initial beans based on each initial task configuration file, and uses each initial bean to acquire each target batch task.
[0025] The task judgment module is used to filter out the first target bean corresponding to each target batch task from each initial bean, traverse each first target bean, and determine whether each target batch task is a task loaded into the target task pool for the first time based on each first target bean, so as to obtain the corresponding judgment result; wherein, the target task pool is the task pool in the Spring batch framework corresponding to the target financial system;
[0026] The task loading module is used to load each of the target batch tasks into the target task pool according to the judgment result, and to call each of the reusable components in the basic service layer in the target task pool using the second target bean contained in the first target bean, so as to modify the tasks in the target financial system when the target financial system is in the running state; wherein, the first target bean is the Job corresponding to each of the target batch tasks, and the second target bean is the ManagerStep contained in the Job.
[0027] Optionally, the initial Bean includes Job, ManagerStep, partitioner, Master-side message channel, Master-side output stream, WorkerStep, Worker-side message channel, and Worker-side input stream;
[0028] Accordingly, the device further includes:
[0029] The task name acquisition module is used to acquire the task name corresponding to the batch task to be uninstalled, and to search for the first target Bean to be uninstalled corresponding to the batch task to be uninstalled from the target task pool based on the task name.
[0030] The first Bean deletion module is used to delete the first target Bean to be uninstalled corresponding to the batch task to be uninstalled from the target task pool, and to search for the second target Bean to be uninstalled corresponding to the first target Bean to be uninstalled from the target task pool;
[0031] The second bean deletion module is used to delete the second target bean to be uninstalled from the target task pool, and to delete the partitioner, the Master-end message channel, the Master-end output stream, the Worker-end message channel, and the Worker-end input stream corresponding to the first target bean to be uninstalled from the target task pool, so as to modify the tasks in the target financial system when the target financial system is in operation.
[0032] Thirdly, this application provides an electronic device, comprising:
[0033] Memory, used to store computer programs;
[0034] A processor is used to execute the computer program to implement the aforementioned batch task hot deployment method.
[0035] Fourthly, this application provides a computer-readable storage medium for storing a computer program, which, when executed by a processor, implements the aforementioned batch task hot deployment method.
[0036] In this application, the initial business processes in the target financial system are first screened. The selected target business processes are then encapsulated to obtain reusable components corresponding to each target business process. These reusable components are then used to construct a basic service layer. Next, initial task configuration files in different file formats are obtained. Different initial beans are dynamically constructed based on these initial task configuration files, and each initial bean is used to obtain target batch tasks. Then, first target beans corresponding to each target batch task are selected from the initial beans. Each first target bean is traversed, and based on each first target bean, it is determined whether each target batch task is being loaded into the target task pool for the first time, thus obtaining the corresponding determination result. The target task pool is the Spring application corresponding to the target financial system. The batch framework uses a task pool; finally, based on the judgment result, each target batch task is loaded into the target task pool, and the second target bean contained in the first target bean calls each reusable component in the basic service layer in the target task pool, so as to modify the tasks in the target financial system when the target financial system is running; wherein, the first target bean is the Job corresponding to each target batch task, and the second target bean is the ManagerStep contained in the Job. It can be seen that this application encapsulates the commonly used business in the financial system to form corresponding reusable components, and summarizes them in the basic service layer. In this way, when the system needs to use these business, there is no need to recode and retest the business. It can be implemented by directly calling the reusable components in the basic service layer, which greatly reduces the workload of developers and reduces the risk of problems in function development; the task logic is defined by the configuration file, and the system parses the configuration at runtime and dynamically generates the corresponding Job Bean and Step Bean, registers them in the Spring container and task scheduling pool, so that the task can be executed immediately, avoiding service interruption caused by downtime in the traditional method. Attached Figure Description
[0037] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0038] Figure 1 This is a flowchart of a batch task hot deployment method disclosed in this application;
[0039] Figure 2This is a schematic diagram of a hot deployment loading task process disclosed in this application;
[0040] Figure 3 This is a schematic diagram of a specific hot deployment loading task process disclosed in this application;
[0041] Figure 4 This is a schematic diagram of a hot deployment unloading task process disclosed in this application;
[0042] Figure 5 This is a schematic diagram of a batch task hot deployment device disclosed in this application;
[0043] Figure 6 This is a structural diagram of an electronic device disclosed in this application. Detailed Implementation
[0044] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0045] Currently, modifying batch tasks in financial systems presents challenges such as a heavy workload for developers and long system service downtime. To address this, this application provides a hot deployment method for batch tasks. By orchestrating basic services and real-time task input, batch tasks can be loaded and unloaded without requiring a live deployment.
[0046] See Figure 1 As shown, this embodiment of the invention discloses a method for hot deployment of batch tasks, including:
[0047] Step S11: Screen the initial business in the target financial system, encapsulate the target business selected from the initial business to obtain the reusable components corresponding to each target business, and use each reusable component to form a basic service layer.
[0048] In this implementation, the basic business operations involved in batch tasks are summarized and refined into a basic service layer, containing various granular basic services. When it is necessary to add or delete batch tasks, the basic services are orchestrated and real-time input allows batch tasks to be loaded and unloaded without needing to be deployed online.
[0049] In this embodiment, the first step is to summarize commonly used basic data change, aggregation, and statistical functions (i.e., target business) based on the business experience of the financial system. These summarized functions are then encapsulated at a smaller granularity to form a basic service layer. At this point, the generated basic service layer can cover more than 90% of business scenarios. By encapsulating commonly used functions and forming a basic service layer, standardized interfaces are provided, facilitating the financial system's dynamic calling of these interfaces to implement functions without requiring repetitive coding for each task change, thus reducing the workload for developers. Furthermore, encapsulation at the business granularity supports flexible orchestration, improving the flexibility of business usage.
[0050] Step S12: Obtain initial task configuration files in different file formats, dynamically construct different initial beans based on each initial task configuration file, and use each initial bean to obtain each target batch task.
[0051] It should be noted that the initial Bean in this embodiment includes Job, ManagerStep, partitioner, Master-side message channel, Master-side output stream, WorkerStep, Worker-side message channel, and Worker-side input stream.
[0052] In this embodiment, the process of dynamically constructing different initial beans based on each initial task configuration file may specifically include: converting the initial task configuration files of different file formats into target task configuration files of the target file format; converting each target task configuration file into a target entity; parsing the target entity corresponding to the target task configuration file to obtain the target task configuration parameters; and dynamically constructing different initial beans according to each target task configuration parameter; specifically, as follows: Figure 2As shown, firstly, various task configuration files (i.e., initial task configuration files) are unified into a standard file format. Then, the standard file format file (i.e., target task configuration file) is converted into a standard resource entity (i.e., target entity). The standard resource entity is parsed to obtain the various task configuration parameters required by the system. Next, based on the configuration parameters, the necessary Beans for the Spring Batch batch task definition are constructed, such as: Job, ManagerStep, Partitioner, Master-side message channel, Master-side output stream, WorkerStep, Worker-side message channel, and Worker-side input stream. It is understood that this embodiment supports multiple task configuration methods, such as XML files, Excel files, and JSON files. The initial task configuration file includes the batch task's ID (Identity Document), name, execution time, execution frequency, the functional blocks of the underlying service layer called during execution, the call order, and post-execution processing information.
[0053] It should be noted that the Beans such as Job, Step, Partitioner, and Message Channel in Spring Batch, which are dynamically generated based on configuration parameters, include the following key components: JobBuilderFactory: builds Job instances; StepBuilderFactory: builds Step instances; Partitioner: implements parallel data sharding processing.
[0054] Step S13: Select the first target bean corresponding to each target batch task from each initial bean, traverse each first target bean, and determine whether each target batch task is a task loaded into the target task pool for the first time based on each first target bean, so as to obtain the corresponding judgment result; wherein, the target task pool is the task pool in the Spring batch framework corresponding to the target financial system.
[0055] In this embodiment, the various Spring Batch-related Beans constructed by the constructor are first aggregated, and the Spring Batch Job Bean (i.e., the first target Bean) is selected as the overall task definition for each target batch task. Then, each Spring Batch Job Bean is traversed and processed sequentially. First, it is determined whether the target batch task corresponding to the Spring Batch Job Bean is unloaded before loading or loaded for the first time, to obtain the corresponding judgment result. It should be noted that the judgment result regarding whether the target batch task is loaded into the target task pool for the first time affects how the target batch task is added to the task pool.
[0056] Step S14: Load each of the target batch tasks into the target task pool according to the judgment result, and use the second target bean contained in the first target bean to call each of the reusable components in the basic service layer in the target task pool so as to modify the tasks in the target financial system when the target financial system is running; wherein, the first target bean is the Job corresponding to each of the target batch tasks, and the second target bean is the ManagerStep contained in the Job.
[0057] In one specific implementation, the process of loading each target batch task into the target task pool according to the judgment result may specifically include: if the judgment result indicates that each target batch task is a task being loaded into the target task pool for the first time, then the first target Bean corresponding to each target batch task is added to the target task pool, and the second target Bean corresponding to the first target Bean is added to the target task pool, so as to load each target batch task into the target task pool.
[0058] In another specific implementation, if the judgment result indicates that each target batch task is not the first task to be loaded into the target task pool, then the historical first target bean corresponding to each target batch task is deleted from the target task pool, the historical second target bean corresponding to the historical first target bean is deleted from the target task pool, and the partitioner, Master-side message channel, Master-side output stream, Worker-side message channel, and Worker-side input stream corresponding to the historical first target bean are also deleted from the target task pool; the new first target bean corresponding to each target batch task is added to the target task pool, and the second target bean corresponding to the new first target bean is added to the target task pool, so that each target batch task is loaded into the target task pool;
[0059] The process of loading the target batch tasks into the target task pool described above is as follows: Figure 3 As shown, each JobBean is first iterated through to determine whether the target batch task corresponding to the current Job Bean is being added to the target task pool for the first time. If so, the Job Bean and Step Bean corresponding to the target batch task are added to the target task pool. If not, the historical Job Bean and historical Step Bean corresponding to the target batch task are deleted from the target task pool, and the new Job Bean and new Step Bean are added to the target task pool.
[0060] Specifically, the process of adding the target batch tasks to the task list is as follows:
[0061] 101. Aggregate all Spring Batch-related Beans constructed by the constructor, and filter out the Spring Batch JobBean, which serves as the overall task definition for each batch task.
[0062] 102. Iterate through each Spring Batch Job Bean and process them in turn. First, determine whether the task is unloaded and then loaded or loaded for the first time. If it is loaded for the first time, skip to step 106; if it is unloaded and then loaded, continue to step 103.
[0063] 103. Delete the Job Bean from the Spring Batch executable task pool;
[0064] 104. Delete the Step Bean under the Job Bean from the Spring Batch executable step pool;
[0065] 105. Delete the Beans related to this Job Bean, including the partitioner, Master-side message channel, Master-side output stream, Worker-side message channel, and Worker-side input stream.
[0066] 106. Add the Job Bean to the Spring Batch executable task pool;
[0067] 107. Add the Step Bean under the Job Bean to the Spring Batch executable step pool.
[0068] In this embodiment, in addition to adding batch tasks to the task pool, the method also includes deleting batch tasks from the target task pool. Correspondingly, the batch task hot deployment method in this embodiment further includes: obtaining the task name corresponding to the batch task to be uninstalled; searching for the first target bean to be uninstalled corresponding to the batch task to be uninstalled from the target task pool based on the task name; deleting the first target bean to be uninstalled corresponding to the batch task to be uninstalled from the target task pool, and searching for the second target bean to be uninstalled corresponding to the first target bean to be uninstalled from the target task pool; deleting the second target bean to be uninstalled from the target task pool, and deleting the partitioner, Master-side message channel, Master-side output stream, Worker-side message channel, and Worker-side input stream corresponding to the first target bean to be uninstalled from the target task pool, so as to modify the tasks in the target financial system when the target financial system is in operation; the process of uninstalling tasks from the target task pool is as follows: Figure 4As shown, first, the task name of the batch tasks to be uninstalled is passed in. Based on the task name, the Job Bean corresponding to the task is found from the target resource pool, and the Job Bean is deleted. Then, the Step Bean corresponding to the Job Bean is found and deleted. The specific process is as follows:
[0069] 201. Enter the name of the batch task to be uninstalled;
[0070] 202. Locate the Job Bean corresponding to this batch task in the Spring Batch executable task pool and delete it;
[0071] 203. Locate the Step Bean under the Job Bean corresponding to the batch task in the Spring Batch executable step pool and delete it;
[0072] 204. Delete the Beans related to this Job Bean, including the partitioner, Master-side message channel, Master-side output stream, Worker-side message channel, and Worker-side input stream.
[0073] This embodiment parses configuration files (such as JSON / XML files) and dynamically creates Job and Step bean definitions at runtime using BeanDefinitionRegistry. The generated bean definitions are then registered in the Spring container, making them manageable beans. Since the Spring container supports dynamically adding or removing beans, system changes take effect without a restart, eliminating the traditional methods of adding and deleting Spring Batch tasks. It allows for hot deployment of Spring Batch tasks without requiring deployment, reducing the risk of frequent deployments and minimizing downtime for the financial system. A rich usage system allows for loading, unloading, updating, and adjusting batch tasks, all supporting simultaneous processing of multiple tasks and templated operations, improving efficiency, reducing risk, and enhancing usability. By encapsulating frequently used functions in the financial system, adding and deleting batch tasks becomes a system function, significantly improving the efficiency of batch task operations and enabling more efficient integration with business requirements.
[0074] Therefore, this application encapsulates commonly used business processes in the financial system into reusable components and aggregates them in the basic service layer. In this way, when the system needs to use these business processes, there is no need to recode and retest them. The system can achieve this by directly calling the reusable components in the basic service layer, which greatly reduces the workload of developers and reduces the risk of problems in feature development. By defining task logic through configuration files, the system parses the configuration at runtime and dynamically generates the corresponding Job Bean and Step Bean, registers them in the Spring container and task scheduling pool, and enables tasks to be executed immediately, avoiding service interruptions caused by downtime in the traditional method.
[0075] like Figure 5 As shown, an embodiment of the present invention discloses a batch task hot deployment device, comprising:
[0076] The business encapsulation module 11 is used to screen the initial business in the target financial system, encapsulate the target business selected from the initial business to obtain reusable components corresponding to each target business, and use each reusable component to form a basic service layer.
[0077] Batch task acquisition module 12 acquires initial task configuration files of different file formats, dynamically constructs different initial beans based on each initial task configuration file, and uses each initial bean to acquire each target batch task;
[0078] The task judgment module 13 is used to filter out the first target bean corresponding to each target batch task from each initial bean, traverse each first target bean, and determine whether each target batch task is a task loaded into the target task pool for the first time based on each first target bean, so as to obtain the corresponding judgment result; wherein, the target task pool is the task pool in the Spring batch framework corresponding to the target financial system.
[0079] The task loading module 14 is used to load each of the target batch tasks into the target task pool according to the judgment result, and to call each of the reusable components in the basic service layer in the target task pool using the second target bean contained in the first target bean, so as to modify the tasks in the target financial system when the target financial system is in the running state; wherein, the first target bean is the Job corresponding to each of the target batch tasks, and the second target bean is the ManagerStep contained in the Job.
[0080] Therefore, this application encapsulates commonly used business processes in the financial system into reusable components and aggregates them in the basic service layer. In this way, when the system needs to use these business processes, there is no need to recode and retest them. The system can achieve this by directly calling the reusable components in the basic service layer, which greatly reduces the workload of developers and reduces the risk of problems in feature development. By defining task logic through configuration files, the system parses the configuration at runtime and dynamically generates the corresponding Job Bean and Step Bean, registers them in the Spring container and task scheduling pool, and enables tasks to be executed immediately, avoiding service interruptions caused by downtime in the traditional method.
[0081] In some specific embodiments, the batch task acquisition module 12 may specifically include:
[0082] The format conversion unit is used to convert the initial task configuration files of different file formats into target task configuration files of the target file format.
[0083] The configuration parameter acquisition unit is used to convert each of the target task configuration files into target entities, parse the target entities corresponding to the target task configuration files to obtain target task configuration parameters, and dynamically construct different initial Beans based on each of the target task configuration parameters.
[0084] In some specific embodiments, the task loading module 14 may specifically include:
[0085] The first task loading unit is configured to, if the determination result indicates that each of the target batch tasks is a task being loaded into the target task pool for the first time, add the first target Bean corresponding to each of the target batch tasks to the target task pool, and add the second target Bean corresponding to the first target Bean to the target task pool, so as to load each of the target batch tasks into the target task pool.
[0086] In some specific embodiments, the task loading module 14 may specifically include:
[0087] The task deletion unit is configured to, if the judgment result indicates that each of the target batch tasks is not the first task to be loaded into the target task pool, delete the historical first target bean corresponding to each of the target batch tasks from the target task pool, delete the historical second target bean corresponding to the historical first target bean from the target task pool, and delete the partitioner, the Master-side message channel, the Master-side output stream, the Worker-side message channel, and the Worker-side input stream corresponding to the historical first target bean from the target task pool.
[0088] The second task loading unit is used to add the new first target Bean corresponding to each of the target batch tasks to the target task pool, and add the new second target Bean corresponding to the new first target Bean to the target task pool, so as to load each of the target batch tasks into the target task pool.
[0089] In some specific embodiments, the batch task hot deployment device further includes:
[0090] The task name acquisition module is used to acquire the task name corresponding to the batch task to be uninstalled, and to search for the first target Bean to be uninstalled corresponding to the batch task to be uninstalled from the target task pool based on the task name.
[0091] The first Bean deletion module is used to delete the first target Bean to be uninstalled corresponding to the batch task to be uninstalled from the target task pool, and to search for the second target Bean to be uninstalled corresponding to the first target Bean to be uninstalled from the target task pool;
[0092] The second bean deletion module is used to delete the second target bean to be uninstalled from the target task pool, and to delete the partitioner, the Master-end message channel, the Master-end output stream, the Worker-end message channel, and the Worker-end input stream corresponding to the first target bean to be uninstalled from the target task pool, so as to modify the tasks in the target financial system when the target financial system is in operation.
[0093] Furthermore, embodiments of this application also disclose an electronic device, Figure 6 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content of the diagram should not be construed as limiting the scope of this application.
[0094] Figure 6This is a schematic diagram of the structure of an electronic device 20 provided in an embodiment of this application. Specifically, the electronic device 20 may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 stores a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the batch task hot deployment method disclosed in any of the foregoing embodiments. Alternatively, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0095] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.
[0096] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or optical disk, etc. The resources stored thereon can include operating system 221, computer program 222, etc., and the storage method can be temporary storage or permanent storage.
[0097] The operating system 221 is used to manage and control the various hardware devices on the electronic device 20 and the computer program 222, which may be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program capable of performing the batch task hot deployment method executed by the electronic device 20 as disclosed in any of the foregoing embodiments, the computer program 222 may further include a computer program capable of performing other specific tasks.
[0098] Furthermore, this application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the aforementioned batch task hot deployment method. Specific steps of this method can be found in the corresponding content disclosed in the foregoing embodiments, and will not be repeated here.
[0099] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.
[0100] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0101] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0102] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0103] The technical solutions provided in this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A method for hot deployment of batch tasks, characterized in that, include: The initial business in the target financial system is screened, and the target business selected from the initial business is encapsulated to obtain reusable components corresponding to each target business, and the basic service layer is constructed using each reusable component. Obtain initial task configuration files in different file formats, dynamically construct different initial beans based on each initial task configuration file, and use each initial bean to obtain each target batch task; The first target bean corresponding to each target batch task is selected from each initial bean. Each first target bean is traversed, and each target batch task is determined to be the first task loaded into the target task pool based on each first target bean, so as to obtain the corresponding judgment result; wherein, the target task pool is the task pool in the Spring batch framework corresponding to the target financial system. Based on the judgment result, each of the target batch tasks is loaded into the target task pool, and the second target bean contained in the first target bean is used in the target task pool to call each of the reusable components in the basic service layer so as to modify the tasks in the target financial system when the target financial system is in operation; wherein, the first target bean is the Job corresponding to each of the target batch tasks, and the second target bean is the ManagerStep contained in the Job.
2. The batch task hot deployment method according to claim 1, characterized in that, The initial Bean includes Job, ManagerStep, Partitioner, Master-side message channel, Master-side output stream, WorkerStep, Worker-side message channel, and Worker-side input stream.
3. The batch task hot deployment method according to claim 1, characterized in that, The dynamic construction of different initial beans based on each of the initial task configuration files includes: The initial task configuration files of different file formats are converted into target task configuration files of the target file format. Each target task configuration file is converted into a target entity, the target entity corresponding to the target task configuration file is parsed to obtain the target task configuration parameters, and different initial beans are dynamically constructed according to each target task configuration parameter.
4. The batch task hot deployment method according to claim 1, characterized in that, The step of loading each of the target batch tasks into the target task pool according to the judgment result includes: If the determination result indicates that each of the target batch tasks is a task being loaded into the target task pool for the first time, then the first target Bean corresponding to each of the target batch tasks is added to the target task pool, and the second target Bean corresponding to the first target Bean is added to the target task pool, so as to load each of the target batch tasks into the target task pool.
5. The batch task hot deployment method according to claim 2, characterized in that, The step of loading each of the target batch tasks into the target task pool according to the judgment result includes: If the judgment result indicates that each of the target batch tasks is not the first task to be loaded into the target task pool, then the historical first target bean corresponding to each of the target batch tasks is deleted from the target task pool, the historical second target bean corresponding to the historical first target bean is deleted from the target task pool, and the partitioner, the Master-side message channel, the Master-side output stream, the Worker-side message channel, and the Worker-side input stream corresponding to the historical first target bean are deleted from the target task pool. Each target batch task is added to the target task pool with a new first target bean, and the corresponding second target bean is added to the target task pool with a new first target bean, so as to load each target batch task into the target task pool.
6. The batch task hot deployment method according to claim 2, characterized in that, Also includes: Obtain the task name corresponding to the batch task to be uninstalled, and search for the first target Bean to be uninstalled from the target task pool based on the task name; Remove the first target bean to be uninstalled corresponding to the batch task to be uninstalled from the target task pool, and find the second target bean to be uninstalled corresponding to the first target bean to be uninstalled from the target task pool; The second target bean to be uninstalled is removed from the target task pool, and the partitioner, master-side message channel, master-side output stream, worker-side message channel, and worker-side input stream corresponding to the first target bean to be uninstalled are also removed from the target task pool, so as to modify the tasks in the target financial system when the target financial system is in operation.
7. A batch task hot deployment device, characterized in that, include: The business encapsulation module is used to screen the initial business in the target financial system, encapsulate the target business selected from the initial business to obtain reusable components corresponding to each target business, and use each reusable component to form a basic service layer. The batch task acquisition module acquires initial task configuration files in different file formats, dynamically constructs different initial beans based on each initial task configuration file, and uses each initial bean to acquire each target batch task. The task judgment module is used to filter out the first target bean corresponding to each target batch task from each initial bean, traverse each first target bean, and determine whether each target batch task is a task loaded into the target task pool for the first time based on each first target bean, so as to obtain the corresponding judgment result; wherein, the target task pool is the task pool in the Spring batch framework corresponding to the target financial system; The task loading module is used to load each of the target batch tasks into the target task pool according to the judgment result, and to call each of the reusable components in the basic service layer in the target task pool using the second target bean contained in the first target bean, so as to modify the tasks in the target financial system when the target financial system is in the running state; wherein, the first target bean is the Job corresponding to each of the target batch tasks, and the second target bean is the ManagerStep contained in the Job.
8. The batch task hot deployment device according to claim 7, characterized in that, The initial Bean includes Job, ManagerStep, Partitioner, Master-side message channel, Master-side output stream, WorkerStep, Worker-side message channel, and Worker-side input stream; Accordingly, the device further includes: The task name acquisition module is used to acquire the task name corresponding to the batch task to be uninstalled, and to search for the first target Bean to be uninstalled corresponding to the batch task to be uninstalled from the target task pool based on the task name. The first Bean deletion module is used to delete the first target Bean to be uninstalled corresponding to the batch task to be uninstalled from the target task pool, and to search for the second target Bean to be uninstalled corresponding to the first target Bean to be uninstalled from the target task pool; The second bean deletion module is used to delete the second target bean to be uninstalled from the target task pool, and to delete the partitioner, the Master-end message channel, the Master-end output stream, the Worker-end message channel, and the Worker-end input stream corresponding to the first target bean to be uninstalled from the target task pool, so as to modify the tasks in the target financial system when the target financial system is in operation.
9. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the batch task hot deployment method as described in any one of claims 1 to 6.
10. A computer-readable storage medium, characterized in that, Used to store computer programs, which, when executed by a processor, implement the batch task hot deployment method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Method for automatically constructing functional component based on multi-scene application
CN114063982A
Providing an improved web user interface framework for building web applications
US20150046915A1