CN112506871B - Automated task management and log management method, system, electronic device and medium - Google Patents

Automated task management and log management method, system, electronic device and medium Download PDF

Info

Publication number
CN112506871B
CN112506871B CN202011500581.7A CN202011500581A CN112506871B CN 112506871 B CN112506871 B CN 112506871B CN 202011500581 A CN202011500581 A CN 202011500581A CN 112506871 B CN112506871 B CN 112506871B
Authority
CN
China
Prior art keywords
task
script
function
coroutine
database
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011500581.7A
Other languages
Chinese (zh)
Other versions
CN112506871A (en
Inventor
王坚
张谦
贾明皓
张光宇
王之越
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
University of Science and Technology of China USTC
Original Assignee
University of Science and Technology of China USTC
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by University of Science and Technology of China USTC filed Critical University of Science and Technology of China USTC
Priority to CN202011500581.7A priority Critical patent/CN112506871B/en
Publication of CN112506871A publication Critical patent/CN112506871A/en
Application granted granted Critical
Publication of CN112506871B publication Critical patent/CN112506871B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/1734Details of monitoring file system events, e.g. by the use of hooks, filter drivers, logs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/242Query formulation
    • G06F16/2433Query languages
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • H04L67/125Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks involving control of end-device applications over a network

Abstract

The present disclosure provides an automated task management and log management method, including: receiving a task script and a task list written by a user, and storing the task script and the task list into a first database; under the condition that the task script needs to be executed according to the current time, analyzing the task script; and recording the log information generated in the execution process of the task script, storing the log information into a second database, and displaying the log information in the second database. In addition, the disclosure also provides an automatic task management and log management system, a medium and an electronic device.

Description

Automated task management and log management method, system, electronic device and medium
Technical Field
The present disclosure relates to the field of computer technology and device control, and more particularly, to a method, system, electronic device, and medium for automated task management and log management.
Background
The large-scale experimental device is often completed by remote control operation of an operator, a remote computer is generally remotely controlled through a network, and when the environmental network condition is severe, the progress of a task flow is greatly influenced. Meanwhile, for a large-scale experimental device, the number and the types of tasks are numerous and complicated, the data and the operation process generated at the same time need to be recorded specially, and if the whole process is finished simply by operators manually, a large amount of manpower and material resources are needed undoubtedly, and the process is unreliable.
The RTS2 control system commonly used in the prior art is highly customized in module, thereby losing the expandability of the RTS2 control system as a general management system and increasing the development difficulty and cost.
Therefore, in the process of implementing the invention, it is found that under the condition of poor network conditions or complex flow, the reliability of the equipment to execute tasks and record the equipment running information is difficult to ensure by operators, and the compatibility of the prior art is poor, so that the invention is not suitable for popularization and application.
Disclosure of Invention
In view of the above, the present disclosure provides an automated task management and log management method, system, electronic device, and medium.
In a first aspect of the embodiments of the present disclosure, an automated task management and log management method is provided, including: receiving a task script and a task list written by a user, and storing the task script and the task list into a first database; under the condition that the task script needs to be executed according to the current time, analyzing the task script; and recording the log information generated in the execution process of the task script, storing the log information into a second database, and displaying the log information in the second database.
According to an embodiment of the present disclosure, storing the task script and the task list in a first database includes: under the condition that the script name of the task script is different from the script name of the existing task script in the first database, storing the task script into the first database; the task list at least comprises the starting execution time of the task script, the task parameter information and the script name of the task script required by the task execution.
According to an embodiment of the present disclosure, in a case that it is determined that the task script needs to be executed according to the current time, parsing the task script includes: polling a task script start execution time in the task list, when the task script start execution time is the same as the current time, extracting the task parameter information corresponding to the task script start execution time and a script name of the task script from the task list in the first database, and extracting the task script from the first database according to the script name of the task script; encapsulating the task script into a coroutine function, and processing the coroutine function to obtain a processed coroutine function; and executing a code corresponding to the processed coroutine function by using an execution function based on the task parameter information.
According to an embodiment of the present disclosure, the execution function includes an exec function.
According to an embodiment of the present disclosure, encapsulating the task script into a coroutine function, and processing the coroutine function to obtain a processed coroutine function includes: adding function definition at the head of the task script content, and taking the content of the task script as a function body to obtain the coroutine function; and converting the function source code of the coroutine function into an abstract syntax tree, traversing the abstract syntax tree, and removing the import statement in the coroutine function to obtain the processed coroutine function.
According to an embodiment of the present disclosure, the import statement includes an import syntax and an import function.
According to an embodiment of the present disclosure, the log information includes state switching information, attribute change information, inter-component instruction information, and custom log information.
In a second aspect of the embodiments of the present disclosure, an automated task management and log management system is provided, which includes a task management module, a task execution module, and a log management module. The task management module is used for receiving a task script and a task list written by a user and storing the task script and the task list into a first database; the task execution module is used for analyzing the task script under the condition that the task script needs to be executed according to the current time; and the log management module is used for recording the log information generated in the execution process of the task script, storing the log information into a second database and displaying the log information in the second database.
According to the embodiment of the disclosure, the task list at least includes the start execution time of the task script, the task parameter information, and the script name of the task script required for executing the task.
According to an embodiment of the present disclosure, the task management module includes: the first read-write unit is used for reading and storing data into a first database, and storing the task script into the first database under the condition that the script name of the task script is different from the script name of the task script in the first database; a polling unit configured to poll a start execution time of a task script in the task list, when the start execution time of the task script is the same as the current time, extract the task parameter information and a script name of the task script corresponding to the start execution time of the task script from the task list in the first database through the first read/write unit, extract the task script from the first database through the first read/write unit according to the script name of the task script, and send the task parameter information and the task script to the task execution module.
According to an embodiment of the present disclosure, the task execution module includes: the preprocessing unit is used for packaging the task script into a coroutine function and processing the coroutine function to obtain a processed coroutine function; and the execution unit is used for executing codes corresponding to the processed coroutine functions by utilizing an execution function based on the task parameter information.
According to an embodiment of the present disclosure, the preprocessing unit is configured to add a function definition to a header of a content of the task script, and obtain the coroutine function by using the content of the task script as a function body; and converting the function source code of the coroutine function into an abstract syntax tree, traversing the abstract syntax tree, and removing the import statement in the coroutine function to obtain the processed coroutine function.
According to an embodiment of the present disclosure, the above-mentioned import statement includes an import syntax and an import function.
According to an embodiment of the present disclosure, the execution function includes an exec function.
According to an embodiment of the present disclosure, the log management module includes: the second reading and writing unit is used for reading the log information generated in the execution process of the task script and storing the log information into a second database; and the display unit is used for displaying the log information in the second database.
According to an embodiment of the present disclosure, the log information includes state switching information, attribute change information, inter-component instruction information, and custom log information.
In a third aspect of embodiments of the present disclosure, there is provided an electronic device, comprising: one or more processors; and a memory for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors implement the automated task management and log management method.
In a fourth aspect of embodiments of the present disclosure, a medium is provided having stored thereon computer-executable instructions that, when executed by a processor, cause the processor to implement the automated task management and log management method as described above.
According to the automatic task management and log management method, the automatic task management and log management system, the electronic device and the medium, a user can edit and upload the task list and the task script, the device can run automatically according to the time sequence, the running log is recorded completely, the influence of network and human factors is reduced, and the running reliability and the running information integrity of the device are guaranteed. By analyzing the encapsulation task script, the technical scheme of the embodiment of the disclosure has better compatibility.
Drawings
The above and other objects, features and advantages of the present disclosure will become more apparent from the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:
FIG. 1 schematically illustrates an exemplary system architecture to which the automated task management and log management methods and systems of the present disclosure may be applied;
FIG. 2 schematically illustrates a flow chart of a task management and log management method according to an embodiment of the disclosure;
FIG. 3 schematically illustrates a flow chart of a task management and log management method according to another embodiment of the present disclosure;
FIG. 4 schematically illustrates a schematic diagram of a task management and log management system according to yet another embodiment of the present disclosure;
FIG. 5 schematically illustrates a block diagram of a task management module according to yet another embodiment of the disclosure;
fig. 6 schematically shows a block diagram of a task execution module according to yet another embodiment of the present disclosure.
FIG. 7 schematically shows a block diagram of a log management module according to yet another embodiment of the present disclosure.
FIG. 8 schematically illustrates a block diagram of an electronic device adapted to implement a method of automated task management and log management according to yet another embodiment of the present disclosure.
Detailed Description
Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It should be understood that these descriptions are illustrative only and are not intended to limit the scope of the present disclosure. In the following detailed description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the disclosure. It may be evident, however, that one or more embodiments may be practiced without these specific details. Moreover, in the following description, descriptions of well-known structures and techniques are omitted so as to not unnecessarily obscure the concepts of the present disclosure.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The terms "comprises," "comprising," and the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs, unless otherwise defined. It is noted that the terms used herein should be interpreted as having a meaning that is consistent with the context of this specification and should not be interpreted in an idealized or overly formal sense.
Where a convention analogous to "at least one of A, B and C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B and C" would include but not be limited to systems that have a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.). Where a convention analogous to "A, B or at least one of C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B or C" would include but not be limited to systems that have a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.).
Embodiments of the present disclosure provide an automated task management and log management method, and a system, an electronic device, and a medium to which the method can be applied. The method comprises the following steps: receiving a task script and a task list written by a user, and storing the task script and the task list into a first database; under the condition that the task script needs to be executed according to the current time, analyzing the task script; and recording the log information generated in the execution process of the task script, storing the log information into a second database, and displaying the log information in the second database.
FIG. 1 schematically illustrates an exemplary system architecture 100 to which the automated task management and log management methods and systems of the present disclosure may be applied. It should be noted that fig. 1 is only an example of a system architecture to which the embodiments of the present disclosure may be applied to help those skilled in the art understand the technical content of the present disclosure, and does not mean that the embodiments of the present disclosure may not be applied to other devices, systems, environments or scenarios.
As shown in fig. 1, a system architecture 100 according to this embodiment may include a master controller 101, an industrial controller 102, a device 103, and a communication link 104.
The communication link 104 is used for providing a communication medium between the master computer 101, the industrial computer 102 and the device 103. Communication link 104 may include a variety of wired or wireless connection types including, but not limited to, switch 1041, wireless router 1042, serial port, and the like.
The equipment 103 may include various experimental equipment, engineering equipment, etc., such as astronomical telescopes, 3D printers, etc.
The industrial personal computer 102 is used for providing a communication interface, assisting the main control computer 101 to realize functions, or assisting equipment to complete required operations.
The master control machine 101 is used for receiving input of a user and outputting information to the user. The main control computer 101 and the industrial control computer 102 may be various electronic devices having communication and information processing functions, including but not limited to a computer, a single chip, a device integrated lower computer, and the like.
It should be noted that, the automated task management and log management method provided by the embodiment of the present disclosure may be generally executed by the master controller 101. Accordingly, the automated task management and log management system provided by the embodiment of the present disclosure may be generally disposed in the main controller 101. The method for automatic task management and log management provided by the embodiment of the disclosure can also be executed by the industrial personal computer 102. Correspondingly, the automatic task management and log management system provided by the embodiment of the disclosure can also be arranged in the industrial personal computer 102. Alternatively, the automated task management and log management method provided by the embodiment of the present disclosure may also be executed by an electronic device that is different from the master controller 101 and the slave controller 102 and is capable of communicating with the device 103 and the master controller 101 or the slave controller 102. Correspondingly, the automatic task management and log management system provided by the embodiment of the present disclosure may also be disposed in an electronic device that is different from the master controller 101 and the slave controller 102 and is capable of communicating with the device 103 and the master controller 101 or the slave controller 102.
For example, software for implementing the task management and log management method may be originally installed in the main control computer 101, or a user may send the software to the branch control computer 102 and install the software. In the task process, if the main control computer 101 and the sub-control computers 102 have faults, the user can install the software in another computer which can establish communication with the equipment and at least one of the main control computer 101 and the sub-control computers 102, and read the log information to continue the task.
It should be understood that the number of industrial computers, devices and communication links in fig. 1 is merely illustrative. There may be any number of industrial computers, devices, and communication links as required by the implementation.
FIG. 2 schematically shows a flowchart of a task management and log management method according to an embodiment of the present disclosure.
As shown in fig. 2, the method includes operations S201 to S203.
In operation S201, a task script and a task list written by a user are received, and the task script and the task list are stored in a first database.
According to an embodiment of the present disclosure, a task script includes script content and a script name. The script content can be written by program voice such as python, and generally does not contain fixed parameter information, such as information indicating the operation running time, the operation times and the like corresponding to the script. The script names are unique in that the script names of all task scripts for a particular operation of a particular device are the same.
In operation S202, the task script is parsed if it is determined that the task script needs to be executed according to the current time.
According to the embodiment of the disclosure, the current time is stable and reliable, and can be the system time or the time defined by a user, and the tasks are executed according to the current time in a time sequence.
According to the embodiment of the disclosure, the task script is analyzed, so that the compatibility of the script is improved, a user can design the script aiming at any task scheme of any equipment, and the expansibility of the method of the embodiment of the disclosure is improved.
In operation S203, log information generated in the execution process of the task script is recorded, the log information is stored in a second database, and the log information in the second database is displayed.
According to the automatic task management and log management method, the database is used for storing the remote information, the requirement for real-time communication is reduced, the task script is analyzed, the method is suitable for any scheme of any equipment, and the reliability and compatibility of the method are improved.
FIG. 3 schematically shows a flowchart of a task management and log management method according to another embodiment of the present disclosure.
As shown in fig. 2, the method includes operations S301 to S313.
In operation S301, status information at the start of a task is recorded.
In operation S302, a task script and a task list written by a user are received.
According to another embodiment of the present disclosure, the task list at least includes a task script start execution time, task parameter information, and a script name of a task script required for executing the task.
In operation S303, the task script and the task list are stored in the first database.
According to another embodiment of the present disclosure, in the case that the script name of the task script is different from the script name of the existing task script in the first database, the task script is stored in the first database.
According to another embodiment of the present disclosure, the first database may be a relational database such as MySQL, PostgreSQL, or the like.
In operation S304, phase switching information or task execution information is recorded.
In operation S305, it is determined whether a task script needs to be executed according to the current time.
According to another embodiment of the present disclosure, the task scripts in the task list are polled for a start execution time, and when the start execution time of the task script is the same as the current time, operation S306 is performed.
In operation S306, task parameter information corresponding to the start execution time of the task script and a script name of the task script are extracted from the task list in the first database, and the task script is extracted from the first database according to the script name of the task script.
According to another embodiment of the disclosure, an asynchronous query method is defined, which can extract data in a database before the polling operation is finished, thereby improving the efficiency of task execution and effectively ensuring that each task step is completed in order according to time.
In operation S307, the task script extracted in operation S306 is parsed, and the processed script is run using the execution function.
According to another embodiment of the present disclosure, first, a function definition, for example, async def, is added to a header of a task script content, and the content of the task script is used as a function body to obtain a coroutine function. And then, converting the function source code of the coroutine function into an abstract syntax tree, traversing the abstract syntax tree, and removing the import statement in the coroutine function to obtain the processed coroutine function. And executing codes corresponding to the processed coroutine function by using the execution function based on the task parameter information.
According to another embodiment of the present disclosure, the task script is packaged and parsed, and script contents that can be originally written in various program languages, such as JS, Python, and the like, can be converted into an abstract syntax structure. Then, the syntax structures are traversed by using an algorithm such as nodeviistor, and sentences with import and inclusion functions such as include and import are removed, and then the processed syntax structures are compiled, so that the processed program function can be obtained. The processed coroutine function can be directly run by an execution function, and the execution function comprises an exec function and the like.
In operation S308, the instruction information obtained through operation S307 is received, the stage switching information and the instruction information are recorded, and transmitted to the device.
In operation S309, the device starts to execute the task according to the command, and records device attribute change information during the execution of the task.
In operation S310, the task end information is recorded, and it returns to operation S304 to start the execution of the next task.
In operation S311, log information generated during the whole task execution process, including but not limited to state switching information, attribute change information, inter-component instruction information, and custom log information, is obtained.
The state switching information can be information broadcast when the states of components or modules in the system applying the method are switched, for example, the method of another embodiment of the disclosure is applied to a telescope control system, and when a telescope single working task is completed, the telescope control system sends the information of 'task completion' to a control end in a broadcast mode in a local area network. The attribute change information may be various attribute changes which can be known during the operation of the device, for example, the temperature of one device is reduced from 30 ° to 29 ° during the operation, and the temperature change is also sent to the control end in a broadcast manner. The instruction information between the components can be an execution instruction sent by the system to the device side, an instruction transmitted between modules in the system, and the like. In addition, the method of another embodiment of the present disclosure also allows the user to define the log information that needs to be recorded, i.e., to customize the log information.
In operation S312, the acquired log information is stored in the second database.
According to another embodiment of the present disclosure, the log information may be obtained by using a Pyles-like method, and stored in the second database in a classified manner.
According to another embodiment of the present disclosure, the second database may be a TimescaleDB, infiluxdb, or other time-series database.
In operation S313, the log information is retrieved from the second database and displayed on the display interface of the user side.
According to another embodiment of the present disclosure, the log information stored in the second database may be displayed at the user end through a data visualization tool, such as Grafana, PowerBI, and the like. Meanwhile, the method of the embodiment of the disclosure electrically defines an alarm mechanism, and when a certain device attribute or data exceeds a threshold set by a user, the alarm mechanism warns the user side and reminds the user to process the event.
FIG. 4 schematically illustrates a schematic diagram of a task management and log management system according to an embodiment of the disclosure.
As shown in fig. 4, the task management and log management system of the embodiment of the present disclosure includes a database, a control system, a communication system, and a device 103.
The database comprises MySQL401 and Influxdb402, and is used for storing task information and real-time information in the task execution process.
The control system includes a task management module 410, a task execution module 420, and a log management module 430.
The task management module 410 is configured to receive a task script and a task list written by a user, where the task list at least includes a task script start execution time, task parameter information, and a script name of the task script required for executing the task, and store the task script and the task list in MySQL 401.
The task execution module 420 is configured to parse the task script when it is determined that the task script needs to be executed according to the current time.
The log information recorded in the log management module 430 includes state switching information, attribute change information, inter-component instruction information, and custom log information.
The Control System includes RACS2(Remote Autonomous Control System) 404.
RACS 2404 is a set of high-performance distributed control system, and has the characteristics of decentralization and automatic component discovery. The bottom layer of the system is compiled by C + +, and the system has high efficiency, real-time performance and expandability. Meanwhile, the upper layer provides full-function Python interface binding, and the component calling is facilitated. In an embodiment of the present disclosure, the control system communicates with the device 103 through the RACS 2404.
FIG. 5 schematically shows a block diagram of a task management module according to an embodiment of the disclosure.
As shown in fig. 5, the task management module 410 includes a first read-write unit 411 and a polling unit 412.
The first reading and writing unit 411 is configured to read and store data into MySQL401, and store the task script into MySQL401 when the script name of the task script is different from the script name of the existing task script in MySQL 401.
The polling unit 412 is configured to poll the task script start execution time in the task list, and when the task script start execution time is the same as the current time, extract task parameter information and a script name of the task script corresponding to the task script start execution time from the task list in the MySQL301 through the first reading and writing unit 411, extract the task script from the MySQL301 through the first reading and writing unit 411 according to the script name of the task script, and send the task parameter information and the task script to the task execution module 420.
FIG. 6 schematically shows a block diagram of a task execution module according to an embodiment of the disclosure.
As shown in fig. 6, the task execution module 420 includes a preprocessing unit 421 and an execution unit 422.
The preprocessing unit 421 is configured to add a function definition to the head of the task script content, and obtain a coroutine function by using the content of the task script as a function body; and then, converting a function source code of the coroutine function into an abstract syntax tree by using modules such as ast and the like, traversing the abstract syntax tree by using algorithms such as Node Visitor and the like, and removing lead-in statements such as include, import and the like in the coroutine function to obtain the processed coroutine function.
The execution unit 422 is configured to run the processed coroutine function as a parameter of an execution function such as exec based on the task parameter information.
Fig. 7 schematically illustrates a block diagram of a log management module according to an embodiment of the disclosure.
As shown in fig. 7, the log management module 430 includes a second reading and writing unit 431 and a display unit 432.
The second read/write unit 431 is configured to call a method in Pyles and the like to obtain log information, and store the log information in the Influxdb302 in a classified manner in real time.
The display unit 432 is configured to use the data visualization tool Grafana403 to dynamically and intuitively display the log information on a graphical interface on the user side.
The embodiment of the disclosure adopts a decoupling design idea, and expands the application range of the method or the system of the embodiment of the disclosure by ensuring that each functional module is independent and analyzing and processing the task script; by using the database to store the remote information, the requirement for real-time communication is reduced, and the reliability and stability are improved.
FIG. 8 schematically illustrates a block diagram of an electronic device suitable for implementing automated task management and log management methods in accordance with an embodiment of the present disclosure. The electronic device shown in fig. 8 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 8, an electronic device 500 according to an embodiment of the present disclosure includes a processor 501 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)502 or a program loaded from a storage section 508 into a Random Access Memory (RAM) 503. Processor 501 may include, for example, a general purpose microprocessor (e.g., a CPU), an instruction set processor and/or associated chipset, and/or a special purpose microprocessor (e.g., an Application Specific Integrated Circuit (ASIC)), among others. The processor 501 may also include onboard memory for caching purposes. Processor 501 may include a single processing unit or multiple processing units for performing different actions of a method flow according to embodiments of the disclosure.
In the RAM 503, various programs and data necessary for the operation of the electronic apparatus 500 are stored. The processor 501, the ROM 502, and the RAM 503 are connected to each other by a bus 504. The processor 501 performs various operations of the method flows according to embodiments of the present disclosure by executing programs in the ROM 502 and/or RAM 503. Note that the programs may also be stored in one or more memories other than the ROM 502 and the RAM 503. The processor 501 may also perform various operations of method flows according to embodiments of the present disclosure by executing programs stored in the one or more memories.
According to an embodiment of the present disclosure, electronic device 500 may also include an input/output (I/O) interface 505, input/output (I/O) interface 505 also being connected to bus 504. The system 500 may also include one or more of the following components connected to the I/O interface 505: an input portion 506 including a keyboard, a mouse, and the like; an output portion 507 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 508 including a hard disk and the like; and a communication section 509 including a network interface card such as a LAN card, a modem, or the like. The communication section 509 performs communication processing via a network such as the internet. A drive 510 is also connected to the I/O interface 505 as needed. A removable medium 511 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 510 as necessary, so that a computer program read out therefrom is mounted on the storage section 508 as necessary.
According to embodiments of the present disclosure, method flows according to embodiments of the present disclosure may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable storage medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 509, and/or installed from the removable medium 511. The computer program, when executed by the processor 501, performs the above-described functions defined in the system of the embodiments of the present disclosure. The systems, devices, apparatuses, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the present disclosure.
The present disclosure also provides a computer-readable storage medium, which may be contained in the apparatus/device/system described in the above embodiments; or may exist alone without being assembled into the device/apparatus/system. The computer-readable storage medium carries one or more programs which, when executed, implement a method according to an embodiment of the disclosure.
According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium. Examples may include, but are not limited to: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer 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.
For example, according to embodiments of the present disclosure, a computer-readable storage medium may include ROM 502 and/or RAM 503 and/or one or more memories other than ROM 502 and RAM 503 described above.
Embodiments of the present disclosure also include a computer program product comprising a computer program containing program code for performing the method provided by the embodiments of the present disclosure, when the computer program product is run on an electronic device, the program code being configured to cause the electronic device to implement the automated task management and log management method provided by the embodiments of the present disclosure.
The computer program, when executed by the processor 501, performs the above-described functions defined in the system of the embodiments of the present disclosure. The systems, apparatuses, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the present disclosure.
In one embodiment, the computer program may be hosted on a tangible storage medium such as an optical storage device, a magnetic storage device, or the like. In another embodiment, the computer program may also be transmitted, distributed in the form of a signal on a network medium, downloaded and installed through the communication section 509, and/or installed from the removable medium 511. The computer program containing program code may be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
In accordance with embodiments of the present disclosure, program code for executing computer programs provided by embodiments of the present disclosure may be written in any combination of one or more programming languages, and in particular, these computer programs may be implemented using high level procedural and/or object oriented programming languages, and/or assembly/machine languages. The programming language includes, but is not limited to, programming languages such as Java, C + +, python, the "C" language, or the like. The program code may execute entirely on the user computing device, partly on the user device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user 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).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems that perform the specified functions or acts, or combinations of special purpose hardware and computer instructions. Those skilled in the art will appreciate that various combinations and/or combinations of features recited in the various embodiments and/or claims of the present disclosure can be made, even if such combinations or combinations are not expressly recited in the present disclosure. In particular, various combinations and/or combinations of the features recited in the various embodiments and/or claims of the present disclosure may be made without departing from the spirit or teaching of the present disclosure. All such combinations and/or associations are within the scope of the present disclosure.
The embodiments of the present disclosure have been described above. However, these examples are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although the embodiments are described separately above, this does not mean that the measures in the embodiments cannot be used in advantageous combination. The scope of the disclosure is defined by the appended claims and equivalents thereof. Various alternatives and modifications can be devised by those skilled in the art without departing from the scope of the disclosure, and these alternatives and modifications are intended to fall within the scope of the disclosure.

Claims (8)

1. An automated task management and log management method, comprising:
receiving a task script and a task list written by a user, and storing the task script and the task list into a first database;
under the condition that the task script needs to be executed according to the current time, analyzing the task script; and
recording log information generated in the execution process of the task script, storing the log information into a second database, and displaying the log information in the second database;
the task list at least comprises a task script starting execution time, task parameter information and a script name of a task script required by executing the task;
under the condition that the task script needs to be executed according to the current time, analyzing the task script comprises the following steps:
polling a task script in the task list to start execution time, when the start execution time of the task script is the same as the current time, extracting the task parameter information corresponding to the start execution time of the task script and the script name of the task script from the task list in the first database, and extracting the task script from the first database according to the script name of the task script;
encapsulating the task script into a coroutine function, and processing the coroutine function to obtain a processed coroutine function;
executing a code corresponding to the processed coroutine function by using an execution function based on the task parameter information;
encapsulating the task script into a coroutine function, and processing the coroutine function to obtain a processed coroutine function, wherein the task script comprises the following steps:
adding function definition at the head of the task script content, and taking the content of the task script as a function body to obtain the coroutine function;
and converting the function source code of the coroutine function into an abstract syntax tree, traversing the abstract syntax tree, and removing the import statement in the coroutine function to obtain the processed coroutine function.
2. The method of claim 1, wherein storing the task script and the task list in a first database comprises:
and storing the task script into the first database under the condition that the script name of the task script is different from the script name of the existing task script in the first database.
3. The method of claim 1, wherein the execution function comprises an exec function.
4. The method of claim 1, wherein the import statement comprises an import syntax and an import function.
5. The method of claim 1, wherein the log information includes state switch information, attribute change information, inter-component instruction information, and custom log information.
6. An automated task management and log management system, comprising:
the task management module is used for receiving a task script and a task list written by a user and storing the task script and the task list into a first database;
the task execution module is used for analyzing the task script under the condition that the task script needs to be executed according to the current time; and
the log management module is used for recording log information generated in the execution process of the task script, storing the log information into a second database and displaying the log information in the second database;
the task list at least comprises a task script starting execution time, task parameter information and a script name of a task script required by executing the task;
the task execution module comprises a polling unit, a preprocessing unit and an execution unit;
the polling unit is used for polling the start execution time of the task script in the task list, extracting the task parameter information corresponding to the start execution time of the task script and the script name of the task script from the task list in the first database when the start execution time of the task script is the same as the current time, and extracting the task script from the first database according to the script name of the task script;
the preprocessing unit is used for encapsulating the task script into a coroutine function and processing the coroutine function to obtain a processed coroutine function;
the execution unit is used for executing a code corresponding to the processed coroutine function by using an execution function based on the task parameter information;
wherein the preprocessing unit is specifically configured to:
adding function definition at the head of the task script content, and taking the content of the task script as a function body to obtain the coroutine function;
and converting the function source code of the coroutine function into an abstract syntax tree, traversing the abstract syntax tree, and removing the import statement in the coroutine function to obtain the processed coroutine function.
7. An electronic device, comprising:
one or more processors; and
a memory for storing one or more programs;
wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method of any of claims 1-5.
8. A medium having stored thereon computer-executable instructions which, when executed by a processor, cause the processor to carry out the method of any one of claims 1 to 5.
CN202011500581.7A 2020-12-17 2020-12-17 Automated task management and log management method, system, electronic device and medium Active CN112506871B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011500581.7A CN112506871B (en) 2020-12-17 2020-12-17 Automated task management and log management method, system, electronic device and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011500581.7A CN112506871B (en) 2020-12-17 2020-12-17 Automated task management and log management method, system, electronic device and medium

Publications (2)

Publication Number Publication Date
CN112506871A CN112506871A (en) 2021-03-16
CN112506871B true CN112506871B (en) 2022-09-09

Family

ID=74922278

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011500581.7A Active CN112506871B (en) 2020-12-17 2020-12-17 Automated task management and log management method, system, electronic device and medium

Country Status (1)

Country Link
CN (1) CN112506871B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114661685B (en) * 2022-03-25 2023-01-10 机科发展科技股份有限公司 Method and apparatus for generating log record component, log recording method, and medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011065739A2 (en) * 2009-11-27 2011-06-03 주식회사 로그 System and method for providing log information
CN103973486A (en) * 2014-04-29 2014-08-06 上海上讯信息技术股份有限公司 Log management system based on B/S structure

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011065739A2 (en) * 2009-11-27 2011-06-03 주식회사 로그 System and method for providing log information
CN103973486A (en) * 2014-04-29 2014-08-06 上海上讯信息技术股份有限公司 Log management system based on B/S structure

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
"Analysis of Scheduling Strategies for Spacecraft On-Board Control Procedure:Lua Coroutine vs. VxWorks Task";Su-Hyun Park等;《2018 18th International Conference on Control, Automation and Systems (ICCAS)》;20181213;第1-5页 *
"编程语言Julia并行计算实现模式探讨";庞双玉等;《电脑知识与技术》;20200531;第242-243页 *

Also Published As

Publication number Publication date
CN112506871A (en) 2021-03-16

Similar Documents

Publication Publication Date Title
US11321122B2 (en) Method, apparatus, device and medium for processing topological relation of tasks
CN109302522B (en) Test method, test device, computer system, and computer medium
CN107506300B (en) User interface testing method, device, server and storage medium
US9819758B2 (en) Remote debugging into mobile web applications across devices
US9367427B2 (en) Embedding and executing trace functions in code to gather trace data
US20150248343A1 (en) Method and apparatus for implementing instrumentation code
CN104536398B (en) Frequency converter monitoring method and system
CN110659210A (en) Information acquisition method and device, electronic equipment and storage medium
CN111026400A (en) Method and device for analyzing service data stream
CN111913889A (en) Test system building method and test system
CN114077430A (en) Interface generation method and device, electronic equipment and storage medium
CN112506871B (en) Automated task management and log management method, system, electronic device and medium
CN110597704B (en) Pressure test method, device, server and medium for application program
CN111078217A (en) Brain graph generation method, apparatus and computer-readable storage medium
CN113127050A (en) Application resource packaging process monitoring method, device, equipment and medium
CN112729868A (en) Vehicle diagnosis method, device, equipment and medium
CN114791885A (en) Interface test method, device, equipment and medium
CN115080113A (en) Item code detection method and device, readable storage medium and electronic equipment
CN111158645B (en) System and method for providing an integrated development environment
CN108536586B (en) Information acquisition method, equipment and system of Android mobile terminal
CN111309583B (en) Interface overdrawing detection method, device, medium and computing equipment
CN110727457A (en) Component management method, device, storage medium and electronic equipment
US9942331B2 (en) Utilization of computing services
US11772681B2 (en) Method and apparatus for processing autonomous driving simulation data, and electronic device
CN113793058A (en) Factory production line monitoring method and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant