Data task management automation method, system, electronic device and storage medium
Technical Field
The invention relates to the technical field of computer application, in particular to a data task management automation method, a data task management automation system, electronic equipment and a storage medium.
Background
Enterprises employ a large number of DBAs (Database administrators), Database services are manually provided by relying on Database operation and maintenance experiences of the Database administrators, the Database administrators develop operation and maintenance scripts by themselves, and the scripts are used for ensuring the stable operation of the databases.
At present, a large number of experienced database managers are needed for 7-24-hour database service support in the manual mode, problem diagnosis (root pruning) and performance optimization (performance planning) are professional problems in the field of databases all the time, professional skills of qualified database managers are needed to be solved, and due to the fact that a large number of research and development projects exist, the database scale and the access amount are huge, and existing workers cannot guarantee to provide comprehensive database service support. Service support and operation and maintenance requirements are not matched seriously, the work efficiency of database administrators is restricted by some repetitive and flow operations, and the enterprise cost is increased continuously.
Disclosure of Invention
The present invention is directed to overcoming the above-mentioned problems associated with the related art, and providing an automated method, system, electronic device, and storage medium for data task management that overcome at least some of the problems due to the limitations and disadvantages of the related art.
According to one aspect of the invention, there is provided a data task management automation method, comprising:
the method comprises the steps that a first server stores data tasks into a message queue according to a set period, wherein the data tasks comprise first-class tasks and second-class tasks for performing statistical query on task states of the first-class tasks;
the first server acquires the data task from the message queue;
if the data task is a first type task, the first server issues the first type task to one or more clients; and
and if the data task is a second type task, the first server locally executes the second type task.
Optionally, after the first server issues the first type of task to one or more clients, the method further includes:
the first server monitors one or more clients to store and update the task state of the first type of task.
Optionally, the first server determines whether the data task is a first type task or a second type task according to a packet header of a data packet of the data task.
Optionally, before the first server stores the data task into a message queue according to a set period, the method further includes:
and the first server receives the data task from the second server, and the second server maintains a data task table which stores the data task, the type of the data task, the set period of the data task and the identification of a client to execute the data task.
Optionally, after the first server locally executes the second type of task, the method further includes:
and the first server sends the execution result of the second type of task to the second server so that the execution result is displayed on a display webpage provided by the second server.
According to another aspect of the present invention, there is also provided a first server applied to a data task management automation method, the first server including:
the tracking module is used for storing data tasks into a message queue according to a set period, wherein the data tasks comprise a first class of tasks and a second class of tasks for performing statistical query on task states of the first class of tasks;
the consumption module is used for acquiring the data task from the message queue; and
the working module is used for issuing the first type of task to one or more clients if the data task is the first type of task; and if the data task is a second type task, the working module is used for locally executing the second type task.
According to still another aspect of the present invention, there is also provided a data task management automation system, including:
the first server as described above;
the client side is used for executing the following steps:
monitoring a first type of task issued by the first server;
executing the first type of task;
and feeding back the task state of the first type of task to the first server.
Optionally, the method further comprises:
a second server for performing the steps of:
maintaining a data task table, wherein the data task table stores data tasks, types of the data tasks, set periods of the data tasks and identifications of clients to execute the data tasks;
and sending the data task to the first server according to the set period of the data task in the data task table.
Optionally, the second server is further configured to perform the following steps:
and providing a display webpage for displaying the execution result of the second type of task.
According to still another aspect of the present invention, there is also provided an electronic apparatus, including: a processor; a storage medium having stored thereon a computer program which, when executed by the processor, performs the steps as described above.
According to yet another aspect of the present invention, there is also provided a storage medium having stored thereon a computer program which, when executed by a processor, performs the steps as described above.
Compared with the prior art, the invention has the advantages that:
on one hand, the automatic execution of periodic and repetitive tasks can be realized through the automatic scheduling of the data tasks, and the labor cost for database administrators to write scripts is reduced; on the other hand, the repetitive first-class tasks are distributed to the client side to be executed, and the second-class tasks of the statistical query of the task states of the first-class tasks are executed locally at the first server side, so that the first server side can quickly and efficiently execute the second-class tasks, and a database administrator can conveniently perform subsequent database operation and maintenance operation according to the task execution results of the second-class tasks.
Drawings
The above and other features and advantages of the present invention will become more apparent by describing in detail exemplary embodiments thereof with reference to the attached drawings.
FIG. 1 shows a flow diagram of a data task management automation method according to an embodiment of the invention.
Fig. 2 is a block diagram of a first server according to an embodiment of the present invention.
FIG. 3 is a diagram illustrating a first server scheduling data tasks according to an embodiment of the present invention.
FIG. 4 illustrates a schematic diagram of a data task management automation system in accordance with an embodiment of the present invention.
FIG. 5 illustrates a flow diagram for scheduling data tasks for a client in accordance with an embodiment of the present invention.
FIG. 6 illustrates a schematic diagram of a data task management automation system in accordance with another embodiment of the present invention.
Fig. 7 schematically illustrates a computer-readable storage medium in an exemplary embodiment of the invention.
Fig. 8 schematically illustrates an electronic device in an exemplary embodiment of the invention.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
Furthermore, the drawings are merely schematic illustrations of the invention and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus their repetitive description will be omitted. Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices.
The flow charts shown in the drawings are merely illustrative and do not necessarily include all of the steps. For example, some steps may be decomposed, and some steps may be combined or partially combined, so that the actual execution sequence may be changed according to the actual situation.
FIG. 1 shows a flow diagram of a data task management automation method according to an embodiment of the invention. Referring to fig. 1, the data task management automation method includes the following steps:
step S110: the method comprises the steps that a first server stores data tasks into a message queue according to a set period, wherein the data tasks comprise first-class tasks and second-class tasks for performing statistical query on task states of the first-class tasks;
step S120: the first server acquires the data task from the message queue;
step S130: is the first server determining whether the data task is a first type of task?
If the data task is determined to be the first type task in step S130, then step S140 is executed: the first server issues the first type of task to one or more clients; and
if the data task is determined to be the second type task in step S130, step S150 is executed: the first server locally executes the second type of task.
In the data task management automation method of the exemplary embodiment of the invention, on one hand, the automatic execution of periodic and repetitive tasks can be realized through the automatic scheduling of the data tasks, and the labor cost for database administrators to write scripts is reduced; on the other hand, the repetitive first-class tasks are distributed to the client side to be executed, and the second-class tasks of the statistical query of the task states of the first-class tasks are executed locally at the first server side, so that the first server side can quickly and efficiently execute the second-class tasks, and a database administrator can conveniently perform subsequent database operation and maintenance operation according to the task execution results of the second-class tasks.
Specifically, in various embodiments of the present invention, the first type of task may be, for example, a data task such as deployment, data backup, data migration, and the like in an environment of a device where a plurality of clients are located. The second type of task may be, for example, statistics of the progress of environmental deployment of a certain device, statistics of the progress of data backup of a certain device, progress statistics of the first type of tasks of all devices, and so on. The above is merely a schematic description of the first and second tasks of the invention, and the invention is not limited thereto.
The data task management automation method provided by the invention will be described below with reference to various specific embodiments:
in one specific implementation, the step S140: after the first server issues the first type of task to one or more clients, the method further includes:
the first server monitors one or more clients to store and update the task state of the first type of task.
By the steps, the task state of the first type of task is stored in the first server, and the task state of the first type of task is updated in real time, so that the efficiency of executing the second type of task on the first server can be improved.
In a specific implementation, the step S130: the determining, by the first server, whether the data task is a first type task may include:
and the first server determines whether the data task is a first type task or a second type task according to the packet header of the data packet of the data task.
Specifically, in some specific embodiments, the message task is encapsulated by a TCP socket protocol, and if the data task is acquired from the message queue, in step S130, a secure TCP socket byte security check is performed on the data task first, and after the data task passes the secure TCP socket byte security check, a socket header analysis is performed on the data task. The first type of task and the second type of task are distinguished.
In one specific implementation, the step S140: the first server issuing the first type of task to one or more clients may further include:
the first server can issue the first type of tasks to one or more clients in a file transmission or command transmission mode to perform multi-thread concurrent execution.
In one specific implementation, before the step S110 of storing, by the first server, the data task into a message queue according to a set period, the method may further include:
and the first server receives the data task from the second server, and the second server maintains a data task table which stores the data task, the type of the data task, the set period of the data task and the identification of a client to execute the data task.
The second server may be, for example, a web server, and is configured to provide a web interface, where a user may enter a data task through the web interface, or trigger the data task to be stored in the data task table according to an operation performed by the user on the web interface. The second server can send the data task reaching the set time in the data task list to the first server. Or the first server acquires the data task reaching the set time from the second server.
In the foregoing implementation manner, after the step S150 that the first server locally executes the second type of task, the method may further include:
and the first server sends the execution result of the second type of task to the second server so that the execution result is displayed on a display webpage provided by the second server.
Specifically, the data task management automation method provided by the invention uses a producer consumer mode through a message queue, wherein a producer is a process for producing data (storing data tasks into the message queue), a consumer is a process for consuming data (consuming task data from the message queue), and the producer consumer mode solves the problem of strong coupling between the producer and the consumer through the message queue, so that direct communication is not required between the producer and the consumer.
Based on the above-mentioned producer and consumer modes, the automated data task management method provided by the present invention detects in an uninterrupted cycle, and once a data task generated regularly or actively by a user is found, the first server obtains a task time (for example, the task time can be divided into a cycle task, a daily task, a weekly task and a monthly task) and the task time is queued according to a specified time message.
The first server provided by the present invention is described below with reference to fig. 2. Fig. 2 is a block diagram of a first server according to an embodiment of the present invention. The first server 210 includes a tracking module 211, a consumption module, and a work module 213. The consuming module may for example be integrated in the working module 213. The first server may also include a message queue 212.
The tracking module 211 is configured to store data tasks into a message queue according to a set period, where the data tasks include a first type of task and a second type of task that performs statistical query on a task state of the first type of task;
the consumption module is used for acquiring the data task from the message queue; and
if the data task is a first type task, the work module 213 is configured to issue the first type task to one or more clients; if the data task is a second type task, the work module 213 is configured to locally execute the second type task.
In the first server of the exemplary embodiment of the present invention, on one hand, automatic execution of periodic and repetitive tasks can be realized by automatic scheduling of data tasks, and the labor cost for database administrators to write scripts is reduced; on the other hand, the repetitive first-class tasks are distributed to the client side to be executed, and the second-class tasks of the statistical query of the task states of the first-class tasks are executed locally at the first server side, so that the first server side can quickly and efficiently execute the second-class tasks, and a database administrator can conveniently perform subsequent database operation and maintenance operation according to the task execution results of the second-class tasks.
Fig. 2 is a schematic diagram of the first server 210 provided by the present invention, and the splitting, merging, and adding of modules are within the scope of the present invention without departing from the spirit of the present invention.
In one embodiment of the present invention, the work module 213 executes the process shown in fig. 3:
step S310: the work module 213 consumes messages (data tasks) from the message queue;
step S320: the working module 213 determines whether the message is empty, and if the message is empty, the step S310 is returned to; if not, continue to execute step S330;
step S330: the work module 213 parses the header of the message (the type of data task is stored in the header).
Step S340: the work module 213 determines whether the data task is a first type task according to the data header.
If it is determined in step S340 that the task is not the first type task, the data task is the second type task, and step S350 is executed to execute the second type task locally in the work module 213.
If the task is determined to be the first type task in step S340, the working module 213 executes step S360 to determine that the data task is the second type task;
step S370: the task module 213 determines whether the first type of task is a multi-threaded task.
If the judgment in the step S370 is no, then step S380 is executed, and the working module 213 directly calls (call) to issue the first type task to the client;
if the step S370 determines that the task is a task of the first type, the work module 213 executes the step S390 to invoke a process to issue the first type of task to the client.
The above is only one specific implementation manner of the work module 213, and the present invention is not limited thereto.
In a specific implementation of the present invention, the first server 210 further includes a first monitoring module 214, and the first monitoring module 214 is configured to monitor a task status (execution status) of the first type of task of the client.
In a specific implementation of the present invention, the first server 210 integrates an operation and maintenance tool in a plug-in manner, and realizes automatic operation of task scheduling through flow management and control. The first server 210 may further include, for example, a Daemon (Daemon) module for implementing Daemon; the interaction module is used for performing management and control and communication interaction on the client and performing remote command and file transmission; the plug-in module supports an internal data interface and integrates an automatic operation and maintenance tool; and the flow management and control module is used for managing task attributes and executing steps. The first server 210 may also integrate other modules, which is not limited in the present invention.
The following describes a data task management automation system provided by the present invention with reference to fig. 4. The data task management automation system includes a first server 410 and a client 420. The first server 410 may have the same modules as the first server described in fig. 2.
The client 420 is configured to perform a first type of task issued by the first server 410; executing the first type of task; and feeding back the task state of the first type of task to the first server 410.
In the data task management automation system of the exemplary embodiment of the invention, on one hand, the automatic execution of periodic and repetitive tasks can be realized through the automatic scheduling of the data tasks, and the labor cost for database administrators to write scripts is reduced; on the other hand, the repetitive first-class tasks are distributed to the client side to be executed, and the second-class tasks of the statistical query of the task states of the first-class tasks are executed locally at the first server side, so that the first server side can quickly and efficiently execute the second-class tasks, and a database administrator can conveniently perform subsequent database operation and maintenance operation according to the task execution results of the second-class tasks.
In this embodiment, the client 420 may include a second monitoring module 423 for monitoring the first type of task issued by the first server 410; an execution module 422 for executing the first type of task; an interaction module for feeding back the task status of the first type of task to the first server 410. The above description is only for schematically describing the module structure of the client 420 of the present invention, and the present invention is not limited thereto, and the combination and the division of the modules are within the scope of the present invention.
Specifically, in a specific implementation of the present invention, after the first server 410 issues the task in the TCP manner, the processing function of the second monitoring module 423 of the client 420 may continuously monitor the arrival of the request according to step S510 shown in fig. 5. Step S520 is then executed to determine whether the data task is the first type task. For example, it may be determined whether the task intercepted by the second interception module 423 is the first type task in the same manner as that in step S330 and step S340 of the first server (e.g., analyzing the socket header). If the task is not the first type task, step S530 is executed to return the data task to the first server 410. If the first type task is determined in step S530, step S540 is executed to further determine whether the first type task is an asynchronous task. If the first type task is not an asynchronous task in step S540, step S550 is executed, and the first type task is directly executed through interface call. If it is determined in step S540 that the first type task is not an asynchronous task, step S560 is executed to add the data task to a message queue of the client and execute the data task in an asynchronous manner. The invention is not limited thereto.
In a specific embodiment, the client 420 may return the result of the execution of the first type task to the first monitoring module in the first server again through the TCPsocket transmission, and the first monitoring module may call an application programming interface inside the first server to update and process the first type task status task.
In some implementations of client 420, client 420 may include multiple modules that call each other, which may be loaded into client 420 in the form of a common library. The plurality of modules may include, for example, an interaction module 421 (for interacting with the first service end, responsible for all data transmission); a log module (used for storing and updating the execution log of the first type task); a setting module (for providing partial global information); tool modules (for providing generic tools), the invention is not limited thereto. Modules in the common library may be mutually invoked.
A data task management automation system according to another embodiment of the present invention is described below with reference to fig. 6. The data task management automation system includes a first server 610, a client 620, and a second server 630. The first server 610 may have the same modules as the first server described in fig. 2.
The client 620 is configured to monitor a first type of task issued by the first server 610; executing the first type of task; and feeding back the task state of the first type of task to the first server 610.
The second server 630 is configured to perform: maintaining a data task table, wherein the data task table stores data tasks, types of the data tasks, set periods of the data tasks and identifications of clients to execute the data tasks; and sending the data task to the first server according to the set period of the data task in the data task table. In a specific embodiment, the second server 630 is further configured to execute the step of providing a presentation webpage presenting the execution result of the second type of task.
The second server 630 may trigger or generate a data task according to the user's operation on the web interface provided by the second server.
In an exemplary embodiment of the present invention, there is also provided a computer-readable storage medium having stored thereon a computer program which, when executed by, for example, a processor, can implement the steps of the electronic prescription flow processing method described in any one of the above embodiments. In some possible embodiments, aspects of the present invention may also be implemented in the form of a program product comprising program code for causing a terminal device to perform the steps according to various exemplary embodiments of the present invention described in the above-mentioned electronic prescription flow processing method section of this specification, when the program product is run on the terminal device.
Referring to fig. 7, a program product 700 for implementing the above method according to an embodiment of the present invention is described, which may employ a portable compact disc read only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited in this regard and, in the present document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The computer readable storage medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable storage medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the tenant computing device, partly on the tenant device, as a stand-alone software package, partly on the tenant computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of remote computing devices, the remote computing devices may be connected to the tenant computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
In an exemplary embodiment of the invention, there is also provided an electronic device that may include a processor and a memory for storing executable instructions of the processor. Wherein the processor is configured to execute the steps of the electronic prescription flow processing method in any one of the above embodiments via execution of the executable instructions.
As will be appreciated by one skilled in the art, aspects of the present invention may be embodied as a system, method or program product. Thus, various aspects of the invention may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.) or an embodiment combining hardware and software aspects that may all generally be referred to herein as a "circuit," module "or" system.
An electronic device 800 according to this embodiment of the invention is described below with reference to fig. 8. The electronic device 800 shown in fig. 8 is only an example and should not bring any limitations to the function and scope of use of the embodiments of the present invention.
As shown in fig. 8, electronic device 800 is in the form of a general purpose computing device. The components of the electronic device 800 may include, but are not limited to: at least one processing unit 810, at least one memory unit 820, a bus 830 connecting the various system components (including the memory unit 820 and the processing unit 810), a display unit 840, and the like.
Wherein the storage unit stores program codes executable by the processing unit 810 to cause the processing unit 710 to perform the steps according to various exemplary embodiments of the present invention described in the above-mentioned electronic prescription flow processing method section of the present specification. For example, the processing unit 810 may perform the steps shown in fig. 1.
The memory unit 820 may include readable media in the form of volatile memory units such as a random access memory unit (RAM)8201 and/or a cache memory unit 8202, and may further include a read only memory unit (ROM) 8203.
The memory unit 820 may also include a program/utility 8204 having a set (at least one) of program modules 8205, such program modules 8205 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
Bus 830 may be any of several types of bus structures including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
The electronic device 800 may also communicate with one or more external devices 900 (e.g., keyboard, pointing device, bluetooth device, etc.), with one or more devices that enable a tenant to interact with the electronic device 800, and/or with any devices (e.g., router, modem, etc.) that enable the electronic device 800 to communicate with one or more other computing devices. Such communication may occur via input/output (I/O) interfaces 850. Also, the electronic device 800 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the internet) via the network adapter 860. The network adapter 860 may communicate with other modules of the electronic device 800 via the bus 830. It should be appreciated that although not shown, other hardware and/or software modules may be used in conjunction with the electronic device 800, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiment of the present invention may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, or a network device, etc.) to execute the above-mentioned electronic prescription flow processing method according to the embodiment of the present invention.
Compared with the prior art, the invention has the advantages that:
on one hand, the automatic execution of periodic and repetitive tasks can be realized through the automatic scheduling of the data tasks, and the labor cost for database administrators to write scripts is reduced; on the other hand, the repetitive first-class tasks are distributed to the client side to be executed, and the second-class tasks of the statistical query of the task states of the first-class tasks are executed locally at the first server side, so that the first server side can quickly and efficiently execute the second-class tasks, and a database administrator can conveniently perform subsequent database operation and maintenance operation according to the task execution results of the second-class tasks.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.