Job processing method, job processing apparatus, electronic device, and storage medium

文档序号:1378965 发布日期:2020-08-14 浏览:12次 中文

阅读说明:本技术 作业处理方法、装置、电子设备及存储介质 (Job processing method, job processing apparatus, electronic device, and storage medium ) 是由 易存道 于 2020-04-14 设计创作,主要内容包括:本发明实施例公开了一种作业处理方法、装置、电子设备及存储介质,该作业处理方法包括:确定待处理作业,所述待处理作业的作业结构是可扩展标记语言XML作业结构;对所述XML作业结构进行解析,得到一个或多个待执行步骤、以及每个待执行步骤下的待执行动作;执行所述待执行步骤和所述待执行动作。因此,本发明实施例使用XML极大提高了作业处理的灵活性,还提升了作业处理的可适配性。(The embodiment of the invention discloses a job processing method, a job processing device, electronic equipment and a storage medium, wherein the job processing method comprises the following steps: determining a job to be processed, wherein the job structure of the job to be processed is an extensible markup language (XML) job structure; analyzing the XML operation structure to obtain one or more steps to be executed and actions to be executed under each step to be executed; and executing the step to be executed and the action to be executed. Therefore, the embodiment of the invention greatly improves the flexibility of job processing by using the XML and also improves the adaptability of job processing.)

1. A job processing method, comprising:

determining a job to be processed, wherein the job structure of the job to be processed is an extensible markup language (XML) job structure;

analyzing the XML operation structure to obtain one or more steps to be executed and actions to be executed under each step to be executed;

and executing the step to be executed and the action to be executed.

2. The job processing method according to claim 1, further comprising:

and using a plain text format for the operation to be processed, and organizing through XML to obtain the XML operation structure.

3. The job processing method according to claim 1 or 2, wherein the XML job structure includes:

a job ticket, the job ticket for characterizing a job;

a step mark for characterizing a step under a job;

a logic label, which is used for characterizing the relation of the actions at each step is a parallel relation;

action markers for characterizing one action under each logical marker;

a display name attribute for characterizing a display name of each action;

a failure policy attribute for characterizing a failure policy for each action;

a pause policy attribute for characterizing a pause policy for each action.

4. The job processing method according to claim 3, wherein the failure policy includes:

the first failure identification is used for representing direct ending and recording as failure;

a second failure identifier, wherein the first failure identifier is used for representing continuous execution and is marked as failure;

and the first failure identification is used for representing the waiting of the user for processing, and the job enters a waiting state until the user inputs an action.

5. The job processing method according to claim 4, wherein the executing the step to be executed and the action to be executed includes:

for the execution failure, if the action to be executed is configured with the first failure identifier, the execution is directly finished, and the next action is not executed; if the second failure identification is configured in the action to be executed, continuing to execute the next action; and if the action to be executed is configured with the third failure identifier, waiting for the user until the user confirms to continue executing, and then continuing to execute the next action, otherwise, ending directly.

6. The job processing method according to claim 3, wherein the pause policy includes a pre-pause and a post-pause.

7. The job processing method according to claim 6, wherein the executing the step to be executed and the action to be executed includes:

aiming at the preposed pause, if the preposed pause is configured in the action to be executed, waiting for the user before executing the action until the user confirms to continue executing, and then executing the action;

aiming at the post pause, if the post pause is configured in the action to be executed, waiting for the user after the action is executed until the user confirms, finishing the action, and continuing to prepare to execute the next action; if the to-be-executed action is not configured and then is suspended, after the action is executed, a user is waited, and then the next action is directly executed.

8. A job processing apparatus, comprising:

the system comprises a determining module, a processing module and a processing module, wherein the determining module is used for determining a job to be processed, and the job structure of the job to be processed is an extensible markup language (XML) job structure;

the analysis module is used for analyzing the XML operation structure to obtain one or more steps to be executed and actions to be executed under each step to be executed;

and the execution module is used for executing the step to be executed and the action to be executed.

9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the steps of the job processing method according to any one of claims 1 to 7 are implemented when the program is executed by the processor.

10. A non-transitory computer-readable storage medium on which a computer program is stored, the computer program, when being executed by a processor, implementing the steps of the job processing method according to any one of claims 1 to 7.

Technical Field

The invention relates to the field of automatic control, in particular to a job processing method and device, electronic equipment and a storage medium.

Background

With the continuous progress of society, manufacturers and units face increasingly large machine groups, need to execute a large number of actions on each machine, and all need to use an operating system to arrange and typeset the actions, and a general operating system uses a specified back-end language such as Java, C + +, and the like, and a front-end Web project for the structures and configurations of the structures, pause strategies and failure strategies of the operations, and then uses a client or a browser matched with the operating system to edit and check the information after the system is successfully started.

However, once a problem occurs in the system, such as when the operating system executes a job, the job configuration has a problem, resulting in a system crash, and if the job is viewed to be in a problem, the service must be restarted, and if the service cannot be started, the content of the job cannot be viewed at all, which can be a very bad and dangerous state.

Disclosure of Invention

Because the existing methods have the above problems, embodiments of the present invention provide a job processing method, an apparatus, an electronic device, and a storage medium.

In a first aspect, an embodiment of the present invention provides a job processing method, including:

determining a job to be processed, wherein the job structure of the job to be processed is an extensible markup language (XML) job structure;

analyzing the XML operation structure to obtain one or more steps to be executed and actions to be executed under each step to be executed;

and executing the step to be executed and the action to be executed.

Optionally, the method further comprises:

and using a plain text format for the operation to be processed, and organizing through XML to obtain the XML operation structure.

Optionally, the XML job structure includes:

a job ticket, the job ticket for characterizing a job;

a step mark for characterizing a step under a job;

a logic label, which is used for characterizing the relation of the actions at each step is a parallel relation;

action markers for characterizing one action under each logical marker;

a display name attribute for characterizing a display name of each action;

a failure policy attribute for characterizing a failure policy for each action;

a pause policy attribute for characterizing a pause policy for each action.

Optionally, the failure policy includes:

the first failure identification is used for representing direct ending and recording as failure;

a second failure identifier, wherein the first failure identifier is used for representing continuous execution and is marked as failure;

and the first failure identification is used for representing the waiting of the user for processing, and the job enters a waiting state until the user inputs an action.

Optionally, the executing the step to be executed and the action to be executed include:

for the execution failure, if the action to be executed is configured with the first failure identifier, the execution is directly finished, and the next action is not executed; if the second failure identification is configured in the action to be executed, continuing to execute the next action; and if the action to be executed is configured with the third failure identifier, waiting for the user until the user confirms to continue executing, and then continuing to execute the next action, otherwise, ending directly.

Optionally, the pause policy comprises pre-pause and post-pause.

Optionally, the executing the step to be executed and the action to be executed include:

aiming at the preposed pause, if the preposed pause is configured in the action to be executed, waiting for the user before executing the action until the user confirms to continue executing, and then executing the action;

aiming at the post pause, if the post pause is configured in the action to be executed, waiting for the user after the action is executed until the user confirms, finishing the action, and continuing to prepare to execute the next action; if the to-be-executed action is not configured and then is suspended, after the action is executed, a user is waited, and then the next action is directly executed.

In a second aspect, an embodiment of the present invention provides a job processing apparatus, including:

the system comprises a determining module, a processing module and a processing module, wherein the determining module is used for determining a job to be processed, and the job structure of the job to be processed is an extensible markup language (XML) job structure;

the analysis module is used for analyzing the XML operation structure to obtain one or more steps to be executed and actions to be executed under each step to be executed;

and the execution module is used for executing the step to be executed and the action to be executed.

In a third aspect, an embodiment of the present invention provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the job processing method according to the first aspect when executing the program.

In a fourth aspect, a non-transitory computer-readable storage medium, on which a computer program is stored, the computer program, when executed by a processor, implementing the steps of the job processing method of the first aspect.

According to the technical scheme, after the to-be-processed operation is determined, the XML operation structure of the to-be-processed operation can be analyzed to obtain one or more to-be-executed steps and to-be-executed actions in each to-be-executed step, and the to-be-executed steps and the to-be-executed actions are executed, so that the flexibility of operation processing is greatly improved by using the XML, and the adaptability of operation processing is improved.

Drawings

In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.

Fig. 1 is a schematic flow chart illustrating a job processing method according to an embodiment of the present invention;

FIG. 2 is a diagram illustrating an XML job structure according to an embodiment of the present invention;

FIG. 3 is a schematic diagram of a job processing apparatus according to an embodiment of the present invention;

fig. 4 is a schematic physical structure diagram of an electronic device according to an embodiment of the present invention.

Detailed Description

In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.

For the convenience of clearly describing the technical solutions of the embodiments of the present invention, in each embodiment of the present invention, if words such as "first" and "second" are used to distinguish the same items or similar items with basically the same functions and actions, those skilled in the art can understand that the words such as "first" and "second" do not limit the quantity and execution order.

Fig. 1 is a schematic flow chart illustrating a job processing method according to an embodiment of the present invention; the method can be used for electronic equipment for realizing the job processing function; as shown in fig. 1, the job processing method may include:

s110, determining a job to be processed, wherein the job structure of the job to be processed is an XML (Extensible markup language) job structure.

Specifically, the XML job structure is a job structure described in a plain text manner, can be opened by using any tool, can be identified and supported by any programming language (such as Java, C + +, and the like), and realizes complete programming language decoupling.

S120, analyzing the XML operation structure to obtain one or more steps to be executed and actions to be executed under each step to be executed.

Specifically, when the operating system runs the job, the structure of the XML is parsed first, and then the steps and the actions are executed in sequence.

And S130, executing the step to be executed and the action to be executed.

As can be seen from the above embodiments, after determining a job to be processed, the XML job structure of the job to be processed may be parsed to obtain one or more steps to be executed and an action to be executed in each step to be executed, and the steps to be executed and the actions to be executed are executed, thereby greatly improving the flexibility of job processing by using XML and also improving the adaptability of job processing.

Further, based on the method shown in fig. 1, the job processing method may further include:

(1-1) the to-be-processed operation is organized through XML by using a plain text format to obtain the XML operation structure.

Specifically, a set of complex jobs is configured in a flexible and extremely high-readability plain text manner and organized in XML (extensible markup language, standard text format published by W3C), steps of the jobs can be configured at will, a pause policy and a failure policy can be configured, and even if tools such as a Web browser are not available, the structure of one job and all configurations can be clearly seen in the plain text manner even if an operating system is not started.

It can be seen from the above embodiments that the job to be processed uses a plain text format and is organized by XML to obtain an XML job structure, so that when the job is processed, the XML job structure of the job to be processed can be parsed to obtain one or more steps to be executed and actions to be executed in each step to be executed, and the steps to be executed and the actions to be executed are executed, thereby achieving the purpose of using the plain text format and organizing the job in XML when the job is processed, and the manner is completely independent of any programming language, achieves complete programming language decoupling, and greatly improves the flexibility of the job and the adaptability to new technologies in the future.

Further, based on the above-mentioned method, the XML job structure includes:

a job ticket, the job ticket for characterizing a job;

a step mark for characterizing a step under a job;

a logic label, which is used for characterizing the relation of the actions at each step is a parallel relation;

action markers for characterizing one action under each logical marker;

a display name attribute for characterizing a display name of each action;

a failure policy attribute for characterizing a failure policy for each action;

a pause policy attribute for characterizing a pause policy for each action.

Further, based on the method shown above, the failure policy includes:

the first failure identification is used for representing direct ending and recording as failure;

a second failure identifier, wherein the first failure identifier is used for representing continuous execution and is marked as failure;

and the first failure identification is used for representing the waiting of the user for processing, and the job enters a waiting state until the user inputs an action.

Further, the pause strategy comprises a front pause and a rear pause based on the method.

Fig. 2 is a schematic diagram of an XML job structure provided in an embodiment of the present invention, as shown in fig. 2:

a < jobtag represents a job;

under one job, there may be N < step > tags ordered randomly, each < step > tag representing a step;

at each step, there may be 1 < and > tag, which is a logical tag used only to indicate that the relationship between actions is "and";

under each logical marker, there can be N < action > markers ordered randomly, each < action > marker representing an action;

for each action, a displayName attribute can be configured to represent the display name of the action;

for each action, a failuretracegy attribute may be configured, representing a failure policy, for which definition:

0-end directly and record as failure;

1-continue execution, but mark as failed;

2-waiting for user processing, and enabling the job to enter a waiting state until the user inputs an action;

each action, hangBefore, can be configured to indicate a pre-pause (one of the pause policies);

each action, hangAfter, can be configured to indicate post-pause (one of the pause policies);

the XML job structure shown in fig. 2 is described below in a specific format example:

the head line is a statement sentence of XML specification, which represents that the XML version is 1.0 and the coding format is UTF-8;

a < jobrepresents a job;

under < job >, there are two < step >, meaning that this job has two steps;

in < and > under the first < step >, there are two < actions >, which means there are two actions under this step, displayName is Action1 and Action2, respectively;

in < and > under the second < step >, two < actions > indicate that there are two actions under this step, displayName is Action3 and Action4, respectively;

displayName is the Action of Action1, the failure policy is 0 (direct end), there is a pre-pause, there is no post-pause;

displayName is the Action of Action2, the failure policy is 0 (direct end), there is no pre-pause, there is post-pause;

displayName is Action of Action3, failure policy is 1 (continue execution), no pre-pause, no post-pause;

displayName is the Action of Action4, failure policy is 2 (wait for user), no pre-pause, no post-pause.

Further, based on the method shown above, the failure policy includes: the first failure identification is used for representing direct ending and recording as failure; a second failure identifier, wherein the first failure identifier is used for representing continuous execution and is marked as failure; and the first failure identification is used for representing the waiting of the user for processing, and the job enters a waiting state until the user inputs an action. Correspondingly, when S130 is executed, the method may include:

for the execution failure, if the action to be executed is configured with the first failure identifier, the execution is directly finished, and the next action is not executed; if the second failure identification is configured in the action to be executed, continuing to execute the next action; and if the action to be executed is configured with the third failure identifier, waiting for the user until the user confirms to continue executing, and then continuing to execute the next action, otherwise, ending directly.

As can be seen from the above embodiments, each action may be configured with a failure policy, different failure identifiers represent different failure policies, and if the action to be executed is configured with the first failure identifier, the process is directly ended without executing the next action; if the second failure identification is configured in the action to be executed, continuing to execute the next action; and if the action to be executed is configured with the third failure identifier, waiting for the user, continuing to execute the next action after the user confirms to continue execution, and otherwise, directly ending the execution, thereby improving the flexibility and the accuracy of job processing.

Further, the pause strategy comprises a front pause and a rear pause based on the method. Correspondingly, when S130 is executed, the method may include:

aiming at the preposed pause, if the preposed pause is configured in the action to be executed, waiting for the user before executing the action until the user confirms to continue executing, and then executing the action;

aiming at the post pause, if the post pause is configured in the action to be executed, waiting for the user after the action is executed until the user confirms, finishing the action, and continuing to prepare to execute the next action; if the to-be-executed action is not configured and then is suspended, after the action is executed, a user is waited, and then the next action is directly executed.

As can be seen from the above embodiments, each action may be configured with a pause policy, different pause policies correspond to different execution flows, and if a post pause is configured in the action to be executed, the user waits after the action is executed until the user confirms, the action is ended, and the next action is continuously prepared to be executed; if the post-pause is not configured in the action to be executed, the user is waited after the action is executed, and then the next action is directly executed, so that the reliability of job processing is improved.

Fig. 3 is a flowchart illustrating a job processing apparatus according to an embodiment of the present invention, where the job processing apparatus may be used in an electronic device that implements a job processing function; as shown in fig. 3, the job processing apparatus may include:

a determining module 31, configured to determine a job to be processed, where a job structure of the job to be processed is an extensible markup language XML job structure;

the analysis module 32 is configured to analyze the XML job structure to obtain one or more steps to be executed and an action to be executed in each step to be executed;

an executing module 33, configured to execute the step to be executed and the action to be executed.

Further, based on the above-described illustrated apparatus, the job processing apparatus may further include:

and the configuration module is used for using a plain text format for the operation to be processed and organizing the operation through XML to obtain the XML operation structure.

Further, based on the above-mentioned apparatus, the XML job structure includes:

a job ticket, the job ticket for characterizing a job;

a step mark for characterizing a step under a job;

a logic label, which is used for characterizing the relation of the actions at each step is a parallel relation;

action markers for characterizing one action under each logical marker;

a display name attribute for characterizing a display name of each action;

a failure policy attribute for characterizing a failure policy for each action;

a pause policy attribute for characterizing a pause policy for each action.

Further, based on the above-mentioned apparatus, the failure policy includes:

the first failure identification is used for representing direct ending and recording as failure;

a second failure identifier, wherein the first failure identifier is used for representing continuous execution and is marked as failure;

and the first failure identification is used for representing the waiting of the user for processing, and the job enters a waiting state until the user inputs an action.

Further, based on the above-mentioned apparatus, the executing module 33 may include:

the first execution submodule is used for directly ending the execution failure and not executing the next action if the to-be-executed action is configured with the first failure identifier; if the second failure identification is configured in the action to be executed, continuing to execute the next action; and if the action to be executed is configured with the third failure identifier, waiting for the user until the user confirms to continue executing, and then continuing to execute the next action, otherwise, ending directly.

Further, the pause strategy comprises a front pause and a rear pause based on the device.

Further, based on the above-mentioned apparatus, the executing module 33 may include:

the second execution submodule is used for aiming at the preposed pause, if the preposed pause is configured in the action to be executed, the second execution submodule waits for the user before executing the action until the user confirms to continue executing the action, and then executes the action;

a third execution submodule, configured to, for the post-pause, wait for the user after the action is executed if the post-pause is configured in the action to be executed, and end the action until the user confirms the action, and continue to prepare for executing a next action; if the to-be-executed action is not configured and then is suspended, after the action is executed, a user is waited, and then the next action is directly executed.

The job processing apparatus according to the embodiment of the present invention may be configured to execute the method embodiments described above, and the principle and technical effect are similar, which are not described herein again.

The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the embodiment of the present invention. One of ordinary skill in the art can understand and implement it without inventive effort.

Fig. 4 is a schematic entity structure diagram of an electronic device according to an embodiment of the present invention, and as shown in fig. 4, the electronic device may include: a processor (processor)401, a communication Interface (communication Interface)402, a memory (memory)403 and a communication bus 404, wherein the processor 401, the communication Interface 402 and the memory 403 complete communication with each other through the communication bus 404. Processor 401 may call logic instructions in memory 403 to perform the following method:

determining a job to be processed, wherein the job structure of the job to be processed is an extensible markup language (XML) job structure;

analyzing the XML operation structure to obtain one or more steps to be executed and actions to be executed under each step to be executed;

and executing the step to be executed and the action to be executed.

In addition, the logic instructions in the memory 403 may be implemented in the form of software functional units and stored in a computer readable storage medium when the software functional units are sold or used as independent products. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.

Further, embodiments of the present invention disclose a computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions, which when executed by a computer, the computer is capable of performing the methods provided by the above-mentioned method embodiments, for example, comprising:

determining a job to be processed, wherein the job structure of the job to be processed is an extensible markup language (XML) job structure;

analyzing the XML operation structure to obtain one or more steps to be executed and actions to be executed under each step to be executed;

and executing the step to be executed and the action to be executed.

In another aspect, an embodiment of the present invention further provides a non-transitory computer-readable storage medium, on which a computer program is stored, where the computer program is implemented by a processor to perform the method provided by the foregoing embodiments, for example, including:

determining a job to be processed, wherein the job structure of the job to be processed is an extensible markup language (XML) job structure;

analyzing the XML operation structure to obtain one or more steps to be executed and actions to be executed under each step to be executed;

and executing the step to be executed and the action to be executed.

Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.

Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

12页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种应用于HTML5的大数据树组件实现方法及系统

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!