Task registration method and device, equipment and storage medium
By fixing task configuration in the task scan data table of the database, automatically configuring and registering tasks, the problem of repeated configuration when users add new report tasks is solved, and the efficiency and accuracy of task registration are improved.
Patent Information
- Application Number
- CN202411971931.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-03-21
AI Technical Summary
In the process of enterprise digitalization, when users add new report tasks, they need to repeat the task configuration multiple times, which is cumbersome and prone to errors, resulting in inefficient task registration process.
By obtaining the target task information entered by the user in the task information acquisition page, fix the task configuration in the task scan data table of the database, configure the task to be scanned, and read it into the task data table, scan the task data table to obtain the task information to be scanned, assemble it into the task to be registered and register it in the task center.
Simplify task configuration operations, reduce the number of repeated configurations by technicians, improve the efficiency of task configuration, and avoid operational errors.
Smart Images

Figure CN119668816A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and more specifically, to a task registration method, device, equipment and storage medium. Background Art
[0002] In the process of enterprise digitalization, data reports are crucial for decision-making and business monitoring. At present, market competition is fierce, business changes frequently, and users' demand for reports is diverse and changing rapidly.
[0003] In the traditional model, when users add a new report task, they must first submit requirements to the technical team. Then, in the code development phase, they rely on professional developers to convert the requirements into code, configure and register the task, and thus complete the registration of the new report task.
[0004] However, most of the required tasks are data cleaning tasks of the same type and logic. When developers deal with multiple data cleaning tasks of the same type and logic, they need to repeat the task configuration multiple times, which is cumbersome and error-prone.
[0005] Based on this, how to simplify the task configuration operation and improve the task configuration efficiency during the task registration process is an issue that needs attention. Summary of the invention
[0006] In view of the above problems, the present application provides a task registration method, apparatus, device and storage medium to simplify the task configuration operation and improve the task configuration efficiency.
[0007] In order to achieve the above objectives, the specific plan is proposed as follows:
[0008] A task registration method, comprising:
[0009] Obtaining the first information of the target task entered by the user in the task information acquisition page;
[0010] Under the task configuration of the target task fixed in the task scanning data table of the database, according to the first information, a task to be scanned of the target task is configured, and the task to be scanned is read into the task data table of the database;
[0011] Scanning the task data table to obtain second information of the task to be scanned;
[0012] The second information is assembled into a task to be registered, and the task to be registered is registered in a task center to obtain a registered task.
[0013] Optionally, after registering the task to be registered in the task center to obtain the registered task, the method further includes:
[0014] A sub-table lock is added to each task of the task center so that the target container that successfully grabs the lock among the containers of the task center executes its corresponding task, wherein each container of the task center corresponds to each task one by one.
[0015] Optionally, adding a table-based lock to each task in the task center includes:
[0016] In an aspect-oriented manner, a sub-table lock is added to each task of the task center.
[0017] Optionally, scanning the task data table to obtain the second information of the task to be scanned includes:
[0018] After every preset period, the task data table is scanned to obtain the second information of the task to be scanned.
[0019] Optionally, the process of fixing the task configuration of the target task in the task scanning data table of the database includes:
[0020] Determine the task type and database logic of the target task;
[0021] Based on the task type and the database logic, basic information and alarm configuration are entered into the task scanning data table of the database to complete the task configuration of the target task.
[0022] A task registration device, comprising:
[0023] A first information page input unit, used to obtain first information of a target task input by a user in a task information acquisition page;
[0024] A task configuration unit for scanning is used to configure the task to be scanned of the target task according to the first information under the task configuration of the target task fixed in the task scanning data table of the database, and read the task to be scanned into the task data table of the database;
[0025] A scanning unit, used for scanning the task data table to obtain the second information of the task to be scanned;
[0026] The task registration unit is used to assemble the second information into a task to be registered, and register the task to be registered in a task center to obtain a registered task.
[0027] Optionally, the device further comprises:
[0028] The sub-table lock adding unit is used to add sub-table locks to each task of the task center after registering the task to be registered to the task center and obtaining the registered task, so that the target container that successfully grabs the lock among the containers of the task center executes its corresponding task, wherein each container of the task center corresponds to each task one by one.
[0029] Optionally, the sub-table lock adding unit includes:
[0030] The sub-table lock adding sub-unit is used to add sub-table locks to each task of the task center in an aspect-oriented manner.
[0031] Optionally, the scanning unit includes:
[0032] The periodic scanning unit is used to scan the task data table to obtain the second information of the task to be scanned after every preset period.
[0033] Optionally, the device further comprises:
[0034] A task type logic determination unit, used to determine the task type and database logic of the target task;
[0035] The basic information alarm configuration entry unit is used to enter basic information and alarm configuration in the task scanning data table of the database based on the task type and the database logic to complete the task configuration of the target task.
[0036] A task registration device includes a memory and a processor;
[0037] The memory is used to store programs;
[0038] The processor is used to execute the program to implement the various steps of the task registration method described above.
[0039] A storage medium stores a computer program, which, when executed by a processor, implements the various steps of the task registration method described above.
[0040] By means of the above technical solution, the present application obtains the first information of the target task input by the user in the task information acquisition page, fixes the task configuration of the target task in the task scanning data table of the database, configures the task to be scanned of the target task according to the first information, reads the task to be scanned into the task data table of the database, scans the task data table to obtain the second information of the task to be scanned, assembles the second information into a task to be registered, and registers the task to be registered to the task center to obtain a registered task. It can be seen that after the task configuration in the fixed task scanning data table is completed, the same type of tasks are templated, and the user only needs to fill in the relevant information to configure it into a task, without the need for the technician to repeat the task configuration multiple times, thereby simplifying the task configuration operation and improving the task configuration efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present application. Also, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0042] Figure 1 A schematic diagram of a process for implementing task registration provided in an embodiment of the present application;
[0043] Figure 2 A diagram of a task information input interface for a data cleaning task provided in an embodiment of the present application;
[0044] Figure 3 A logical diagram of a registered task being executed by lock snatching provided in an embodiment of the present application;
[0045] Figure 4 A basic information editing interface diagram for task configuration provided in an embodiment of the present application;
[0046] Figure 5 A diagram of an alarm configuration editing interface for task configuration provided in an embodiment of the present application;
[0047] Figure 6 A schematic diagram of a device structure for implementing task registration provided in an embodiment of the present application;
[0048] Figure 7 A schematic diagram of the structure of a device for implementing task registration provided in an embodiment of the present application. DETAILED DESCRIPTION
[0049] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0050] The present application solution can be implemented based on a terminal with data processing capabilities, and the terminal can be applied to a computer, a server, a cloud, etc.
[0051] Next, combine Figure 1 The task registration method of the present application may include the following steps:
[0052] Step S110: Obtain first information of the target task input by the user in the task information acquisition page.
[0053] Specifically, Figure 2 As shown, the user can enter the rule name, write table name, cron expression and extraction SQL of the target task in "Add Cleaning Rule". In addition, the user can also enter the bi table name and rule description of the target task.
[0054] Step S120, under the task configuration of the target task fixed in the task scanning data table of the database, configure the task to be scanned of the target task according to the first information, and read the task to be scanned into the task data table of the database.
[0055] Specifically, the task scanning data table can represent a scheduled task that scans a data source and then performs data statistics based on the configured SQL logic. The task data table can represent a data table that is configured with target task information, and the task data table can contain attributes such as the task start time and the SQL logic of task execution.
[0056] It can be understood that for tasks of the same type, the task configuration in the task scanning data table can be fixed, thereby locking the task type template, so that multiple tasks of the same type can be templated during the task configuration stage, and the task to be scanned can be configured based on the first information of the target task.
[0057] Step S130: Scan the task data table to obtain second information of the task to be scanned.
[0058] Specifically, the second information may represent information that can be used to assemble into the task to be registered.
[0059] Step S140: assemble the second information into a task to be registered, and register the task to be registered to a task center to obtain a registered task.
[0060] Specifically, the terminal can scan the task data table, automatically assemble the scanned second information into a task, at which time the task is a task to be registered, and then register the task to be registered to the task center, complete the registration of the target task, and obtain a registered task.
[0061] The task registration method provided in this embodiment obtains the first information of the target task input by the user in the task information acquisition page, fixes the task configuration of the target task in the task scanning data table of the database, configures the task to be scanned of the target task according to the first information, reads the task to be scanned into the task data table of the database, scans the task data table to obtain the second information of the task to be scanned, assembles the second information into the task to be registered, and registers the task to be registered to the task center to obtain a registered task. It can be seen that after the task configuration in the fixed task scanning data table is completed, the same type of tasks are templated, and the user only needs to fill in the relevant information to configure it into a task, without the need for the technician to repeat the task configuration multiple times, thereby simplifying the task configuration operation and improving the task configuration efficiency.
[0062] Taking into account that resources need to be allocated for execution after the target task is registered, in some embodiments of the present application, after registering the task to be registered to the task center as mentioned in the aforementioned embodiment and obtaining the registered task, thread resources can also be allocated to each task in the task center for execution of each task.
[0063] Specifically, a table-based lock may be added to each task in the task center, so that a target container that successfully grabs a lock among each container in the task center executes its corresponding task.
[0064] Each container of the task center corresponds to each task one by one.
[0065] like Figure 3 As shown, the task center can assign each registered task to a container. To prevent the scheduled tasks of each container from being executed at the same time, a table lock is added to each registered task, so that all containers can grab a lock, and the container that successfully grabs the lock can execute the registered task corresponding to the container.
[0066] Furthermore, a sub-table lock may be added to each task of the task center in an aspect-oriented manner.
[0067] Specifically, the locking process can be designed as an AOP aspect, which makes it easier for all scheduled tasks to be locked with the same logic.
[0068] Among them, aop (Aspect Oriented Programming) refers to a method of unified maintenance of program functions through pre-compilation and dynamic proxy during runtime.
[0069] The task registration method provided in this embodiment adds a sub-table lock to each task in the task center so that the target container that successfully grabs the lock in each container of the task center executes its corresponding task, thereby avoiding the execution of scheduled tasks of multiple containers at the same time.
[0070] In some embodiments of the present application, the process of scanning the task data table to obtain the second information of the task to be scanned in step S130 is introduced, and the process may include:
[0071] After every preset period, the task data table is scanned to obtain the second information of the task to be scanned.
[0072] It is understandable that at any time, the task data table may contain tasks to be scanned and processed, so the terminal can periodically scan the task data table to check whether there are tasks to be scanned, and scan and process the tasks to be scanned in a timely manner.
[0073] In some embodiments of the present application, the process of fixing the task configuration of the target task in the task scanning data table of the database mentioned in the above embodiment is introduced, and the process may include:
[0074] S1. Determine the task type and database logic of the target task.
[0075] It is understandable that since the task configuration in the fixed task scanning data table can reduce the number of repeated task configurations, the task configuration needs to extract the task type and database logic information of the same type and SQL logic tasks, so it is necessary to determine the task type and database logic of the target task.
[0076] S2. Based on the task type and the database logic, basic information and alarm configuration are entered into the task scanning data table of the database to complete the task configuration of the target task.
[0077] Specifically, Figure 4 As shown, the basic information may include the basic information configuration of the task, the horizontal axis time configuration, and the vertical axis indicator configuration. Among them, the basic information configuration may include the project, report name, data workshop task id, bi table type, database name, data table name, and statistical method. The horizontal axis time configuration may include data table fields and date format. The vertical axis indicator configuration may include data table fields and measurement indicators. The above information can be entered according to the task type of the target task and the database logic.
[0078] like Figure 5 As shown, the alarm configuration may include alarm rules, alarm thresholds, alarm methods, alarm contents, and whether to enable options. The above information may be entered according to the task type of the target task and the database logic.
[0079] The following is a description of an apparatus for implementing task registration provided in an embodiment of the present application. The apparatus for implementing task registration described below and the method for implementing task registration described above can refer to each other.
[0080] See also Figure 6 , Figure 6 A schematic diagram of the structure of a device for implementing task registration disclosed in an embodiment of the present application.
[0081] like Figure 6 As shown, the device may include:
[0082] The first information page input unit 11 is used to obtain the first information of the target task input by the user in the task information acquisition page;
[0083] A task to be scanned configuration unit 12 is used to configure the task to be scanned of the target task according to the first information under the task configuration of the target task fixed in the task scanning data table of the database, and read the task to be scanned into the task data table of the database;
[0084] A scanning unit 13, configured to scan the task data table to obtain second information of the task to be scanned;
[0085] The task registration unit 14 is used to assemble the second information into a task to be registered, and register the task to be registered in a task center to obtain a registered task.
[0086] Optionally, the device further comprises:
[0087] The sub-table lock adding unit is used to add sub-table locks to each task of the task center after registering the task to be registered to the task center and obtaining the registered task, so that the target container that successfully grabs the lock among the containers of the task center executes its corresponding task, wherein each container of the task center corresponds to each task one by one.
[0088] Optionally, the sub-table lock adding unit includes:
[0089] The sub-table lock adding sub-unit is used to add sub-table locks to each task of the task center in an aspect-oriented manner.
[0090] Optionally, the scanning unit includes:
[0091] The periodic scanning unit is used to scan the task data table to obtain the second information of the task to be scanned after every preset period.
[0092] Optionally, the device further comprises:
[0093] A task type logic determination unit, used to determine the task type and database logic of the target task;
[0094] The basic information alarm configuration entry unit is used to enter basic information and alarm configuration in the task scanning data table of the database based on the task type and the database logic to complete the task configuration of the target task.
[0095] The task registration device provided in the embodiment of the present application can be applied to task registration devices, such as terminals: mobile phones, computers, etc. Optionally, Figure 7 The hardware structure diagram of the task registration device is shown in FIG. Figure 7 ,The hardware structure of the task registration device may include: at least one processor 1, at least one communication interface 2, at least one memory 3, and at least one communication bus 4;
[0096] In the embodiment of the present application, the number of the processor 1, the communication interface 2, the memory 3, and the communication bus 4 is at least one, and the processor 1, the communication interface 2, and the memory 3 communicate with each other through the communication bus 4;
[0097] The processor 1 may be a central processing unit CPU, or an application-specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present invention, etc.;
[0098] The memory 3 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), etc., such as at least one disk memory;
[0099] The memory stores a program, and the processor can call the program stored in the memory, wherein the program is used to:
[0100] Obtaining the first information of the target task entered by the user in the task information acquisition page;
[0101] Under the task configuration of the target task fixed in the task scanning data table of the database, according to the first information, a task to be scanned of the target task is configured, and the task to be scanned is read into the task data table of the database;
[0102] Scanning the task data table to obtain second information of the task to be scanned;
[0103] The second information is assembled into a task to be registered, and the task to be registered is registered in a task center to obtain a registered task.
[0104] Optionally, the detailed functions and extended functions of the program may refer to the above description.
[0105] The embodiment of the present application further provides a storage medium, which may store a program suitable for execution by a processor, wherein the program is used to:
[0106] Obtaining the first information of the target task entered by the user in the task information acquisition page;
[0107] Under the task configuration of the target task fixed in the task scanning data table of the database, according to the first information, a task to be scanned of the target task is configured, and the task to be scanned is read into the task data table of the database;
[0108] Scanning the task data table to obtain second information of the task to be scanned;
[0109] The second information is assembled into a task to be registered, and the task to be registered is registered in a task center to obtain a registered task.
[0110] Optionally, the detailed functions and extended functions of the program may refer to the above description.
[0111] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0112] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can refer to each other.
[0113] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A task registration method, characterized in that: include: Obtaining the first information of the target task entered by the user in the task information acquisition page; Under the task configuration of the target task fixed in the task scanning data table of the database, according to the first information, a task to be scanned of the target task is configured, and the task to be scanned is read into the task data table of the database; Scanning the task data table to obtain second information of the task to be scanned; The second information is assembled into a task to be registered, and the task to be registered is registered in a task center to obtain a registered task.
2. The method according to claim 1, characterized in that After registering the task to be registered in the task center and obtaining the registered task, the method further includes: A sub-table lock is added to each task of the task center so that the target container that successfully grabs the lock among the containers of the task center executes its corresponding task, wherein each container of the task center corresponds to each task one by one.
3. The method according to claim 2, characterized in that The adding of sub-table locks to each task in the task center includes: In an aspect-oriented manner, a sub-table lock is added to each task of the task center.
4. The method according to claim 1, characterized in that: The scanning the task data table to obtain the second information of the task to be scanned includes: After every preset period, the task data table is scanned to obtain the second information of the task to be scanned.
5. The method according to claim 1, characterized in that The process of fixing the task configuration of the target task in the task scanning data table of the database includes: Determine the task type and database logic of the target task; Based on the task type and the database logic, basic information and alarm configuration are entered into the task scanning data table of the database to complete the task configuration of the target task.
6. A task registration device, characterized in that: include: A first information page input unit, used to obtain first information of a target task input by a user in a task information acquisition page; A task configuration unit for scanning is used to configure the task to be scanned of the target task according to the first information under the task configuration of the target task fixed in the task scanning data table of the database, and read the task to be scanned into the task data table of the database; A scanning unit, used for scanning the task data table to obtain the second information of the task to be scanned; The task registration unit is used to assemble the second information into a task to be registered, and register the task to be registered in a task center to obtain a registered task.
7. The device according to claim 6, characterized in that Also includes: The sub-table lock adding unit is used to add sub-table locks to each task of the task center after registering the task to be registered to the task center and obtaining the registered task, so that the target container that successfully grabs the lock among the containers of the task center executes its corresponding task, wherein each container of the task center corresponds to each task one by one.
8. The method according to claim 7, characterized in that The sub-table lock adding unit includes: The sub-table lock adding sub-unit is used to add sub-table locks to each task of the task center in an aspect-oriented manner.
9. A task registration device, characterized in that: including memory and processor; The memory is used to store programs; The processor is used to execute the program to implement each step of the task registration method according to any one of claims 1 to 5.
10. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, each step of the task registration method according to any one of claims 1 to 5 is implemented.