CN106789170B - Task processing method and device - Google Patents

Task processing method and device Download PDF

Info

Publication number
CN106789170B
CN106789170B CN201611071691.XA CN201611071691A CN106789170B CN 106789170 B CN106789170 B CN 106789170B CN 201611071691 A CN201611071691 A CN 201611071691A CN 106789170 B CN106789170 B CN 106789170B
Authority
CN
China
Prior art keywords
task
updated
equipment
updating
determining
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
CN201611071691.XA
Other languages
Chinese (zh)
Other versions
CN106789170A (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.)
Beijing Qihoo Technology Co Ltd
Original Assignee
Beijing Qihoo Technology Co Ltd
Qizhi Software Beijing Co Ltd
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 Beijing Qihoo Technology Co Ltd, Qizhi Software Beijing Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201611071691.XA priority Critical patent/CN106789170B/en
Publication of CN106789170A publication Critical patent/CN106789170A/en
Application granted granted Critical
Publication of CN106789170B publication Critical patent/CN106789170B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/084Configuration by using pre-existing information, e.g. using templates or copying from other elements
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0876Aspects of the degree of configuration automation
    • H04L41/0886Fully automatic configuration

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Automation & Control Theory (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the invention provides a task processing method and a task processing device, wherein the method comprises the following steps: receiving an updating instruction aiming at a task, wherein the updating instruction comprises an updating parameter of the task to be updated; determining target equipment to be updated corresponding to the updating instruction; and remotely updating the task to be updated in the target equipment according to the updating parameters. The embodiment of the invention can automatically and remotely update the timing task to be updated in the target equipment, thereby improving the efficiency of updating the timing task.

Description

Task processing method and device
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a task processing method and apparatus.
Background
With the rapid development of information technology, the demand of scheduling is more and more extensive, such as that an enterprise needs to schedule daily logs or nighttime batch processing processes, a user needs to schedule alarm time according to an appointed schedule, and one project can execute a plurality of timing tasks, and the like.
The crontab command is used to set instructions in the linux system that are executed periodically. The user can customize his own timed task using the crontab command, and the sequence of instructions that need to be periodically executed is saved in the crontab file. Generally, the instructions stored in the crontab file are activated by a daemon process crond, the crond process runs in the background, and periodically checks whether there is a task to be executed in the crontab file, and if there is a task to be executed, the task is automatically executed.
When a user needs to modify the timing task, the user can log in the device for deploying the timing task through the crontab command, and the timing task is modified in the crontab configuration file of the device. However, when a timing task of a project is deployed on multiple devices, if the timing task needs to be modified, each device needs to be logged in one by one to modify the crontab configuration file, which results in low efficiency of modifying the timing task.
Disclosure of Invention
In view of the above, the present invention has been made to provide a task processing method and apparatus that overcomes or at least partially solves the above problems.
According to an aspect of the present invention, there is provided a task processing method including:
receiving an updating instruction aiming at a task, wherein the updating instruction comprises an updating parameter of the task to be updated;
determining target equipment to be updated corresponding to the updating instruction;
and remotely updating the task to be updated in the target equipment according to the updating parameters.
Optionally, the update instruction further includes a task identifier of the task to be updated; the step of determining the target device to be updated corresponding to the update instruction includes:
searching in a pre-stored first mapping relation according to the task identifier of the task to be updated to obtain an equipment identifier of equipment deploying the task to be updated; the first mapping relation is used for storing a corresponding relation between a task identifier of a task and an equipment identifier of equipment which deploys the task;
searching in a second mapping relation stored in advance according to the equipment identifier to obtain equipment information corresponding to the equipment identifier; the second mapping relation is used for storing the corresponding relation between the equipment identification and the equipment information;
and determining target equipment to be updated according to the equipment information corresponding to the equipment identification.
Optionally, the step of receiving an update instruction for a task includes:
displaying a task list corresponding to a project, wherein the task list comprises tasks in the project;
determining a task to be updated according to selection operation triggered by aiming at the task in the displayed task list;
receiving an updating instruction triggered by a task to be updated selected from the displayed task list; the updating instruction comprises an updating parameter of the task to be updated.
Optionally, the method further comprises:
after determining a task to be updated according to selection operation triggered by the task in the displayed task list, displaying a device list of devices where the task to be updated is deployed;
the step of determining the target device to be updated corresponding to the update instruction includes:
and determining target equipment to be updated according to the selection operation of the user on the equipment in the equipment list.
Optionally, the step of remotely updating the task to be updated in the target device according to the update parameter includes:
establishing a transmission channel with the target equipment according to a preset protocol;
copying a task configuration file from the target equipment through the transmission channel to obtain a temporary configuration file;
updating the temporary configuration file according to the updating parameters;
copying the updated temporary configuration file to the target equipment through the transmission channel;
and updating the task configuration file in the target equipment according to the updated temporary configuration file through a preset command.
Optionally, the update instruction includes at least one of the following instructions: add instructions, delete instructions, and modify instructions.
According to another aspect of the present invention, there is provided a task processing apparatus including:
the system comprises a receiving module, a processing module and a processing module, wherein the receiving module is used for receiving an updating instruction aiming at a task, and the updating instruction comprises an updating parameter of the task to be updated;
the determining module is used for determining the target equipment to be updated corresponding to the updating instruction;
and the updating module is used for remotely updating the task to be updated in the target equipment according to the updating parameters.
Optionally, the update instruction further includes a task identifier of the task to be updated; the determining module includes:
the first searching submodule is used for searching in a pre-stored first mapping relation according to the task identifier of the task to be updated so as to obtain an equipment identifier of equipment for deploying the task to be updated; the first mapping relation is used for storing a corresponding relation between a task identifier of a task and an equipment identifier of equipment which deploys the task;
the second searching submodule is used for searching in a second mapping relation stored in advance according to the equipment identifier so as to obtain equipment information corresponding to the equipment identifier; the second mapping relation is used for storing the corresponding relation between the equipment identification and the equipment information;
and the first determining submodule is used for determining the target equipment to be updated according to the equipment information corresponding to the equipment identification.
Optionally, the receiving module includes:
the task display submodule is used for displaying a task list corresponding to a project, and the task list comprises tasks in the project;
the task selection submodule is used for determining a task to be updated according to selection operation triggered by aiming at the displayed task in the task list;
the instruction receiving submodule is used for receiving an updating instruction triggered by the task to be updated selected from the displayed task list; the updating instruction comprises an updating parameter of the task to be updated.
Optionally, the apparatus further comprises:
the equipment display module is used for displaying an equipment list of equipment which deploys the task to be updated after the task to be updated is determined according to selection operation triggered aiming at the task in the displayed task list;
the determining module includes:
and the second determining submodule is used for determining target equipment to be updated according to the selection operation of the user on the equipment in the equipment list.
Optionally, the update module includes:
the channel establishing submodule is used for establishing a transmission channel with the target equipment according to a preset protocol;
the first transmission submodule is used for copying a task configuration file from the target equipment through the transmission channel to obtain a temporary configuration file;
the first updating submodule is used for updating the temporary configuration file according to the updating parameters;
the second transmission submodule is used for copying the updated temporary configuration file to the target equipment through the transmission channel;
and the second updating submodule is used for updating the task configuration file in the target equipment according to the updated temporary configuration file through a preset command.
Optionally, the update instruction includes at least one of the following instructions: add instructions, delete instructions, and modify instructions.
According to the task processing method and device provided by the embodiment of the invention, after an update instruction for a task is received, target equipment to be updated corresponding to the update instruction is determined, and the task to be updated in the target equipment is remotely updated according to an update parameter in the update instruction. By the embodiment of the invention, when a task (such as a timing task) of a project is deployed on a plurality of devices, if the timing task needs to be updated, target devices corresponding to the updating instruction can be automatically determined without logging in each device one by one to modify a crontab configuration file, and the timing task to be updated in the target devices can be automatically updated remotely, so that the efficiency of updating the timing task can be improved.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the alternative embodiments. The drawings are only for purposes of illustrating alternative embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
FIG. 1 illustrates a flow diagram of steps of a method of task processing according to one embodiment of the invention;
fig. 2 is a block diagram showing a configuration of a task processing device according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
Referring to fig. 1, a flowchart illustrating steps of a task processing method according to an embodiment of the present invention may specifically include the following steps:
step 101, receiving an update instruction aiming at a task, wherein the update instruction comprises an update parameter of the task to be updated;
step 102, determining target equipment to be updated corresponding to the updating instruction;
and 103, remotely updating the task to be updated in the target equipment according to the updating parameters.
The embodiment of the invention can be used for managing various tasks in the project. The project may specifically be a product, a certain business system, or a certain service, and the like, and the project may include a plurality of tasks, and optionally, the tasks may specifically be timed tasks, and a same timed task may be periodically executed, that is, the same timed task is executed in different time periods or different environments to achieve the same purpose. For example, for an area server of a certain game, the area server needs to be turned on or off every morning, in order to avoid that an operator manually operates the area server for turning on or off the game every morning, a timing task needs to be set in an operation system of the game, and when the timing task expires, the operation system of the game executes the timing task to turn on or off the area server of the game; for another example, for a promotion system, it is desirable to switch an advertisement delivered on an advertisement platform at a certain time point to increase the exposure rate of different advertisements, a timing task needs to be set in the promotion system, and when the timing task expires, the promotion system executes the timing task to switch the advertisement delivered on the advertisement platform. It is to be understood that the embodiments of the invention are not limited to the specific tasks described. Moreover, the task in the embodiment of the present invention is attached to the project and is only an optional embodiment of the service scenario of the present invention, and actually, the embodiment of the present invention does not limit the specific application scenario.
In the existing scheme, when a timing task in a project is deployed on multiple devices, if the timing task needs to be modified, each device needs to be logged in one by one to modify a crontab configuration file, which results in low efficiency of modifying the timing task. The task management system can receive an update instruction aiming at the displayed task through the display interface, and the update instruction can comprise an update parameter of the task to be updated. The task management system may automatically determine the target device to be updated corresponding to the update instruction, and after determining the target device to be updated corresponding to the update instruction (for example, determining that there are 100 target devices), may automatically perform remote update on the tasks to be updated in the 100 target devices according to the update parameters, thereby saving the operation cost required by the user to log in the 100 devices one by one to modify the crontab configuration file, and thus may improve the efficiency of updating the tasks.
The task management system can be arranged on any server, and the server can communicate with the equipment for deploying the timing task so as to realize remote control of the timing task in the equipment. The timing tasks in the equipment can be uniformly managed by the task management system in the server, for example, the timing tasks in the equipment can be remotely updated, or the timing tasks in the equipment can be remotely controlled to be opened and closed, so that the labor cost and the time cost for managing the timing tasks can be further saved.
In an optional embodiment of the present invention, the step of receiving an update instruction for a task may specifically include:
step S11, displaying a task list corresponding to the project, wherein the task list comprises tasks in the project;
step S12, determining a task to be updated according to selection operation triggered by the task in the displayed task list;
step S13, receiving an updating instruction triggered by the task to be updated selected from the displayed task list; the updating instruction comprises an updating parameter of the task to be updated.
In order to facilitate a user to select a task to be updated, the embodiment of the invention can pre-establish a project table and a task table, wherein the project table can be used for storing information of a current existing project; the task table may be used to store information of tasks included in each item in the item table. When a user logs in the task management system, the task management system can know the current existing project and tasks included in the project by inquiring the stored project table and task table, so that the project list and the task list corresponding to the project can be displayed to the user in a display interface. In a specific application, the item list and the task list can be displayed in a hierarchical directory mode, so that the hierarchical relationship between items and sub-items and the hierarchical relationship between tasks and sub-tasks can be clearly displayed; alternatively, the presentation may be in the form of a folder, and so on. It is understood that the embodiment of the present invention does not limit the specific presentation forms of the item list and the task list.
The item table may specifically include items such as item identifiers, item names, and creation times. Referring to table 1, a detailed illustration of a project table of the present invention is shown.
TABLE 1
Item identification Name of item Creation time
1 Website navigation 2016-08-19 18:07:18
2 Television assistant 2016-08-20 13:20:05
The task table corresponds to the project, and may specifically include entries such as task identifier, task name, task description, belonging project, creation time, modification time, and the like. Referring to table 2, a specific illustration of a task table of the present invention is shown.
TABLE 2
Figure BDA0001164026090000071
Figure BDA0001164026090000081
It should be understood that the field contents in table 1 and table 2 are only an application example of the present invention, and a person skilled in the art may flexibly set the field contents of the project table or the task table according to actual needs, and the field contents in the project table and the task table are not limited in the embodiment of the present invention.
In a specific application, after a user logs in the task management system of the present invention, the task management system may display all items in table 1 in a list form in a display interface by querying the item table shown in table 1, for example, including item 1, item 2, and item …, item N; assuming that a user selects item 1, and the item identifier of item 1 is 1, querying is performed in the task table shown in table 2, so that related information of all tasks belonging to item 1 can be obtained, and further item 1 can be further expanded, and all tasks in item 1 are displayed in a list form, for example, task 1, task 2, and task N … are included; the user can select a task to be updated in the expanded task list, for example, the task to be updated is selected as task 1; finally, the user may trigger an update instruction for the selected task 1, for example, a determination button may be set on the task to be updated that has been selected by the user, and when the user clicks the determination button, the user is considered to trigger the update instruction for the task to be updated. It is to be understood that the above-mentioned triggering of the update instruction by the button is only an application example of the present invention, and the embodiment of the present invention does not limit the specific manner of triggering the update instruction.
In the embodiment of the present invention, after determining the task to be updated, an update parameter available for editing may be provided to the user, for example, after receiving a selection operation of the user on the task to be updated in the task list in the display interface, the update parameter editing interface of the task to be updated may be further presented to the user, and specifically, the update parameter may include: task name, execution time, execution script, etc. In the update parameter editing interface, a user can modify parameters such as a task name, an execution time and an execution script of a current task to be updated. After the modification is completed, the update instruction of the task to be updated can be triggered by clicking the determination button, and the update instruction comprises the update parameters of the task to be updated.
In another optional embodiment of the present invention, the update instruction may further include a task identifier of the task to be updated; the step of determining the target device to be updated corresponding to the update instruction may specifically include:
step S21, according to the task identifier of the task to be updated, searching in a first mapping relation stored in advance to obtain the equipment identifier of the equipment deploying the task to be updated; the first mapping relation is used for storing a corresponding relation between a task identifier of a task and an equipment identifier of equipment which deploys the task;
step S22, according to the device identification, searching in a second mapping relation stored in advance to obtain device information corresponding to the device identification; the second mapping relation is used for storing the corresponding relation between the equipment identification and the equipment information;
and step S23, determining the target equipment to be updated according to the equipment information corresponding to the equipment identification.
In the embodiment of the present invention, after receiving an update instruction for a task, a target device to be updated corresponding to the update instruction may be determined. For example, all devices that have deployed the task are determined to be target devices. Therefore, the embodiment of the present invention may further pre-store the first mapping relationship and the second mapping relationship for finding which devices have deployed the task to be updated corresponding to the task identifier.
The first mapping relationship may be used to store a corresponding relationship between a task identifier of a task and a device identifier of a device that has deployed the task, and a specific illustration of the first mapping relationship of the present invention is shown with reference to table 3. The second mapping relationship may be used to store a corresponding relationship between the device identifier and the device information, and the device information may specifically include: equipment name, equipment address, equipment room and the like. Referring to table 4, a specific illustration of a second mapping relationship of the present invention is shown.
TABLE 3
Figure BDA0001164026090000091
Figure BDA0001164026090000101
TABLE 4
Device identification 1
Device name haosync01v.add.bjsc.qihoo.net
Device address MAC1
Machine room where equipment is located bjsc
To which project 1
Creation time 2016-08-19 18:10:18
Device identification 2
Equipment labelSign board 3
It is understood that the field contents in table 3 and table 4 are only one application example of the present invention, and those skilled in the art can flexibly set the field contents according to actual needs, and the field contents in the first mapping relationship and the second mapping relationship are not limited in the embodiment of the present invention.
In an application example of the present invention, after receiving an update instruction for a task, a first mapping relationship shown in table 3 is searched according to a task identifier (for example, the task identifier is 10) of the task to be updated in the update instruction, and it is assumed that a query obtains corresponding device identifiers including 1, 2, and 3, that is, a task corresponding to the task identifier 10 is deployed on devices corresponding to the device identifiers; then, the second mapping relationship shown in table 4 is searched according to the device identifiers 1, 2, and 3, and device information, such as device names, device addresses, and the like, corresponding to the device identifiers 1, 2, and 3, respectively, can be obtained. And finally, determining the devices corresponding to the device identifiers 1, 2 and 3 as target devices to be updated, finding the target devices according to the address information of the target devices, and remotely updating the tasks to be updated in the target devices.
Therefore, the embodiment of the invention can automatically execute remote updating on all the devices which are deployed with the tasks to be updated, and the user does not need to log in each device one by one to modify the crontab configuration file, thereby improving the updating efficiency. However, in practical applications, there may be a case where the user only needs to update the tasks in a part of the devices. Therefore, in a further alternative embodiment of the present invention, the method may further comprise the steps of:
after determining a task to be updated according to selection operation triggered by the task in the displayed task list, displaying a device list of devices where the task to be updated is deployed;
the step of determining the target device to be updated corresponding to the update instruction includes:
and determining target equipment to be updated according to the selection operation of the user on the equipment in the equipment list.
In a specific application, after a task to be updated is selected from a task list expanded under a current project in a display interface by a user, a device list of devices where the task to be updated is deployed can be further displayed to the user. Specifically, when a user selects a task to be updated, a task identifier of the task to be updated may be obtained, an equipment identifier corresponding to the task identifier may be obtained by querying a first mapping relationship, equipment information corresponding to the equipment identifier may be obtained by querying a second mapping relationship, and an equipment list may be further displayed under the task to be updated, where the equipment list may include the equipment information obtained by querying, and the user may know which equipment has deployed the currently selected task to be updated. A check box button can be arranged in front of each piece of equipment information in the equipment list, so that a user can select target equipment needing to update a task by clicking the check box button, the task in the target equipment selected by the user can be remotely updated, instead of remotely updating all equipment with the task to be updated, the flexibility of updating the task can be improved, and different requirements of the user can be met.
After the target device to be updated corresponding to the update instruction is determined, the task to be updated in the target device can be remotely updated according to the update parameters. Specifically, the step of remotely updating the task to be updated in the target device according to the update parameter may specifically include:
step S31, establishing a transmission channel with the target equipment according to a preset protocol;
step S32, copying a task configuration file from the target equipment through the transmission channel to obtain a temporary configuration file;
step S33, updating the temporary configuration file according to the updating parameters;
step S34, copying the updated temporary configuration file to the target device through the transmission channel;
and step S35, updating the task configuration file in the target device according to the updated temporary configuration file through a preset command.
In the embodiment of the present invention, after determining the target device to be updated corresponding to the update instruction, the above steps S31 to S35 may be performed for each target device in turn. Specifically, a transmission channel between a server where a task management system is located and a target device may be established according to a preset protocol, for example, an ssh (Secure Shell, Secure Shell protocol) channel may be established between the server and the target device, and a task crontab configuration file is copied from the target device through the ssh channel to obtain a temporary configuration file, which is stored in the server; then, updating the temporary configuration file according to the updating parameters, and copying the updated temporary configuration file to the target device through the ssh channel; and finally, updating the task crontab configuration file in the target equipment according to the updated temporary configuration file through a preset command (such as a crontab file command).
The server where the task management system is located and the target device can communicate through a standard protocol or a private protocol, wherein the private protocol has the advantages of being closed and high in safety; it is to be understood that the embodiment of the present invention does not limit the specific communication manner between the task management system and the target device.
In yet another optional embodiment of the present invention, the update instruction may comprise at least one of the following instructions: add instructions, delete instructions, and modify instructions.
In the embodiment of the present invention, an existing task may be modified, for example, a task name, an execution script, a task state, an execution time, and the like may be modified, and in addition, a task may be added to or deleted from a selected project. After the task to be updated in the target device is remotely updated according to the update parameter, the related content in the task table, the first mapping relation and the second mapping relation also needs to be updated. For example, related tasks are added/modified/deleted in the task table, related correspondences are added/modified/deleted in the first mapping, and related correspondences are added/modified/deleted in the second mapping.
Application example
In order to describe the implementation process of the present invention more clearly, the following describes the steps of the task processing method of the present invention with reference to a specific application example, and specifically may include:
step S41, displaying the item list in the display interface, and determining the target item to be updated according to the selection operation of the user on the item in the item list, for example, determining the item name of the target item to be updated as "website navigation";
step S42, displaying a task list under the target item to be updated, where the task list includes all timing tasks of the target item, and determining the timing task to be updated according to a selection operation of a user for the timing tasks in the task list, for example, determining a task name of the timing task to be updated, which is "gen _ address _ tpl _ release";
step S43, editing the updating parameters of the timing task to be updated, for example, modifying the execution script of the timing task to be updated from a script A to a script B;
step S44, receiving an updating instruction aiming at the timing task to be updated, wherein the updating instruction comprises an updating parameter of the timing task to be updated, such as a script B;
step S45, displaying a device list, wherein the device list comprises device names of all devices which have deployed the timing task to be updated;
step S46, determining target equipment to be updated according to the selection operation of the user for the equipment names in the equipment list;
step S47, updating the timed task crottab configuration file in the target device according to the update parameter, specifically, sequentially executing the following steps for each target device:
step S51, establishing ssh channel with the target device, copying the crontab configuration file in the target device system to the backup directory of the target device by using the crontab-l > file command to obtain a crontab backup file;
step S52, copying the crontab backup file in the target device to the local to obtain a crontab temporary configuration file;
step S53, reading the temporarily configured file copied to the local crontab, updating the temporarily configured file according to the updating parameters, for example, modifying the script A into a script B, and saving the updated temporarily configured file;
and step S54, copying the updated temporary configuration file of the crontab generated in the step B3 to the backup directory of the target device, and writing the updated information into the crontab configuration file of the target device system by using a crontab file command.
To sum up, after receiving an update instruction for a timing task, the embodiment of the present invention determines a target device to be updated corresponding to the update instruction, and remotely updates the timing task to be updated in the target device according to an update parameter in the update instruction. By the embodiment of the invention, when the timing task of a project is deployed on a plurality of devices, if the timing task needs to be updated, the target device corresponding to the updating instruction can be automatically determined without logging in each device one by one to modify the crontab configuration file, and the timing task to be updated in the target device can be automatically updated remotely, so that the efficiency of updating the timing task can be improved.
Referring to fig. 2, a block diagram of a task processing device according to an embodiment of the present invention is shown, which may specifically include the following modules:
a receiving module 201, configured to receive an update instruction for a task, where the update instruction includes an update parameter of the task to be updated;
a determining module 202, configured to determine a target device to be updated corresponding to the update instruction;
and the updating module 203 is configured to remotely update the task to be updated in the target device according to the update parameter.
In an optional embodiment of the present invention, the update instruction may further include a task identifier of the task to be updated; the determining module 202 may specifically include:
the first searching submodule is used for searching in a pre-stored first mapping relation according to the task identifier of the task to be updated so as to obtain an equipment identifier of equipment for deploying the task to be updated; the first mapping relation is used for storing a corresponding relation between a task identifier of a task and an equipment identifier of equipment which deploys the task;
the second searching submodule is used for searching in a second mapping relation stored in advance according to the equipment identifier so as to obtain equipment information corresponding to the equipment identifier; the second mapping relation is used for storing the corresponding relation between the equipment identification and the equipment information;
and the first determining submodule is used for determining the target equipment to be updated according to the equipment information corresponding to the equipment identification.
In another optional embodiment of the present invention, the receiving module 201 may specifically include:
the task display submodule is used for displaying a task list corresponding to a project, and the task list comprises tasks in the project;
the task selection submodule is used for determining a task to be updated according to selection operation triggered by aiming at the displayed task in the task list;
the instruction receiving submodule is used for receiving an updating instruction triggered by the task to be updated selected from the displayed task list; the updating instruction comprises an updating parameter of the task to be updated.
In yet another optional embodiment of the present invention, the apparatus may further comprise:
the equipment display module is used for displaying an equipment list of equipment which deploys the task to be updated after the task to be updated is determined according to selection operation triggered aiming at the task in the displayed task list;
the determining module 202 may specifically include:
and the second determining submodule is used for determining target equipment to be updated according to the selection operation of the user on the equipment in the equipment list.
In yet another optional embodiment of the present invention, the updating module 203 may specifically include:
the channel establishing submodule is used for establishing a transmission channel with the target equipment according to a preset protocol;
the first transmission submodule is used for copying a task configuration file from the target equipment through the transmission channel to obtain a temporary configuration file;
the first updating submodule is used for updating the temporary configuration file according to the updating parameters;
the second transmission submodule is used for copying the updated temporary configuration file to the target equipment through the transmission channel;
and the second updating submodule is used for updating the task configuration file in the target equipment according to the updated temporary configuration file through a preset command.
In yet another optional embodiment of the present invention, the update instruction may comprise at least one of the following instructions: add instructions, delete instructions, and modify instructions.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
The algorithms and displays presented herein are not inherently related to any particular computer, virtual machine, or other apparatus. Various general purpose systems may also be used with the teachings herein. The required structure for constructing such a system will be apparent from the description above. Moreover, the present invention is not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments described herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.
The various component embodiments of the invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that a microprocessor or Digital Signal Processor (DSP) may be used in practice to implement some or all of the functions of some or all of the components of the task processing method and apparatus according to embodiments of the present invention. The present invention may also be embodied as apparatus or device programs (e.g., computer programs and computer program products) for performing a portion or all of the methods described herein. Such programs implementing the present invention may be stored on computer-readable media or may be in the form of one or more signals. Such a signal may be downloaded from an internet platform or provided on a carrier signal or in any other form.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.
The invention discloses a1 and a task processing method, which comprises the following steps:
receiving an updating instruction aiming at a task, wherein the updating instruction comprises an updating parameter of the task to be updated;
determining target equipment to be updated corresponding to the updating instruction;
and remotely updating the task to be updated in the target equipment according to the updating parameters.
A2, the method according to claim A1, wherein the updating instruction further includes task identification of the task to be updated; the step of determining the target device to be updated corresponding to the update instruction includes:
searching in a pre-stored first mapping relation according to the task identifier of the task to be updated to obtain an equipment identifier of equipment deploying the task to be updated; the first mapping relation is used for storing a corresponding relation between a task identifier of a task and an equipment identifier of equipment which deploys the task;
searching in a second mapping relation stored in advance according to the equipment identifier to obtain equipment information corresponding to the equipment identifier; the second mapping relation is used for storing the corresponding relation between the equipment identification and the equipment information;
and determining target equipment to be updated according to the equipment information corresponding to the equipment identification.
A3, the method of claim A1, wherein the step of receiving update instructions for a task includes:
displaying a task list corresponding to a project, wherein the task list comprises tasks in the project;
determining a task to be updated according to selection operation triggered by aiming at the task in the displayed task list;
receiving an updating instruction triggered by a task to be updated selected from the displayed task list; the updating instruction comprises an updating parameter of the task to be updated.
A4, the method of claim A3, wherein the method further comprises:
after determining a task to be updated according to selection operation triggered by the task in the displayed task list, displaying a device list of devices where the task to be updated is deployed;
the step of determining the target device to be updated corresponding to the update instruction includes:
and determining target equipment to be updated according to the selection operation of the user on the equipment in the equipment list.
A5, the method of claim A1, wherein the step of remotely updating the task to be updated in the target device according to the update parameters includes:
establishing a transmission channel with the target equipment according to a preset protocol;
copying a task configuration file from the target equipment through the transmission channel to obtain a temporary configuration file;
updating the temporary configuration file according to the updating parameters;
copying the updated temporary configuration file to the target equipment through the transmission channel;
and updating the task configuration file in the target equipment according to the updated temporary configuration file through a preset command.
A6, the method according to any of claims a1 to a5, wherein the update command comprises at least one of the following commands: add instructions, delete instructions, and modify instructions.
The invention discloses B7, a task processing device, comprising:
the system comprises a receiving module, a processing module and a processing module, wherein the receiving module is used for receiving an updating instruction aiming at a task, and the updating instruction comprises an updating parameter of the task to be updated;
the determining module is used for determining the target equipment to be updated corresponding to the updating instruction;
and the updating module is used for remotely updating the task to be updated in the target equipment according to the updating parameters.
B8, the apparatus according to claim B7, wherein the update instruction further includes task identification of the task to be updated; the determining module includes:
the first searching submodule is used for searching in a pre-stored first mapping relation according to the task identifier of the task to be updated so as to obtain an equipment identifier of equipment for deploying the task to be updated; the first mapping relation is used for storing a corresponding relation between a task identifier of a task and an equipment identifier of equipment which deploys the task;
the second searching submodule is used for searching in a second mapping relation stored in advance according to the equipment identifier so as to obtain equipment information corresponding to the equipment identifier; the second mapping relation is used for storing the corresponding relation between the equipment identification and the equipment information;
and the first determining submodule is used for determining the target equipment to be updated according to the equipment information corresponding to the equipment identification.
B9, the apparatus of claim B7, wherein the receiving module comprises:
the task display submodule is used for displaying a task list corresponding to a project, and the task list comprises tasks in the project;
the task selection submodule is used for determining a task to be updated according to selection operation triggered by aiming at the displayed task in the task list;
the instruction receiving submodule is used for receiving an updating instruction triggered by the task to be updated selected from the displayed task list; the updating instruction comprises an updating parameter of the task to be updated.
B10, the device according to claim B9, further comprising:
the equipment display module is used for displaying an equipment list of equipment which deploys the task to be updated after the task to be updated is determined according to selection operation triggered aiming at the task in the displayed task list;
the determining module includes:
and the second determining submodule is used for determining target equipment to be updated according to the selection operation of the user on the equipment in the equipment list.
B11, the apparatus of claim B7, wherein the update module comprises:
the channel establishing submodule is used for establishing a transmission channel with the target equipment according to a preset protocol;
the first transmission submodule is used for copying a task configuration file from the target equipment through the transmission channel to obtain a temporary configuration file;
the first updating submodule is used for updating the temporary configuration file according to the updating parameters;
the second transmission submodule is used for copying the updated temporary configuration file to the target equipment through the transmission channel;
and the second updating submodule is used for updating the task configuration file in the target equipment according to the updated temporary configuration file through a preset command.
B12, the apparatus according to any of claims B7 to B11, wherein the update command comprises at least one of the following commands: add instructions, delete instructions, and modify instructions.

Claims (10)

1. A method for processing a task, the method comprising:
receiving an updating instruction aiming at a task, wherein the updating instruction comprises an updating parameter of the task to be updated;
determining target equipment to be updated corresponding to the updating instruction, wherein the target equipment is equipment with the task to be updated;
remotely updating the task to be updated in the target equipment according to the updating parameters;
the task is a timing task in a project, and the timing task is deployed on a plurality of devices;
the step of remotely updating the task to be updated in the target device according to the update parameters comprises the following steps:
establishing a transmission channel with the target equipment according to a preset protocol;
copying a task configuration file from the target equipment through the transmission channel to obtain a temporary configuration file;
updating the temporary configuration file according to the updating parameters;
copying the updated temporary configuration file to the target equipment through the transmission channel;
and updating the task configuration file in the target equipment according to the updated temporary configuration file through a preset command.
2. The method of claim 1, wherein the update instruction further includes a task identifier of the task to be updated; the step of determining the target device to be updated corresponding to the update instruction includes:
searching in a pre-stored first mapping relation according to the task identifier of the task to be updated to obtain an equipment identifier of equipment deploying the task to be updated; the first mapping relation is used for storing a corresponding relation between a task identifier of a task and an equipment identifier of equipment which deploys the task;
searching in a second mapping relation stored in advance according to the equipment identifier to obtain equipment information corresponding to the equipment identifier; the second mapping relation is used for storing the corresponding relation between the equipment identification and the equipment information;
and determining target equipment to be updated according to the equipment information corresponding to the equipment identification.
3. The method of claim 1, wherein the step of receiving update instructions for a task comprises:
displaying a task list corresponding to a project, wherein the task list comprises tasks in the project;
determining a task to be updated according to selection operation triggered by aiming at the task in the displayed task list;
receiving an updating instruction triggered by a task to be updated selected from the displayed task list; the updating instruction comprises an updating parameter of the task to be updated.
4. The method of claim 3, further comprising:
after determining a task to be updated according to selection operation triggered by the task in the displayed task list, displaying a device list of devices where the task to be updated is deployed;
the step of determining the target device to be updated corresponding to the update instruction includes:
and determining target equipment to be updated according to the selection operation of the user on the equipment in the equipment list.
5. The method of any of claims 1 to 4, wherein the update instruction comprises at least one of: add instructions, delete instructions, and modify instructions.
6. A task processing apparatus, characterized in that the apparatus comprises:
the system comprises a receiving module, a processing module and a processing module, wherein the receiving module is used for receiving an updating instruction aiming at a task, and the updating instruction comprises an updating parameter of the task to be updated;
a determining module, configured to determine a target device to be updated corresponding to the update instruction, where the target device is a device to which the task to be updated is deployed;
the updating module is used for remotely updating the task to be updated in the target equipment according to the updating parameters;
the task is a timing task in a project, and the timing task is deployed on a plurality of devices;
the update module includes:
the channel establishing submodule is used for establishing a transmission channel with the target equipment according to a preset protocol;
the first transmission submodule is used for copying a task configuration file from the target equipment through the transmission channel to obtain a temporary configuration file;
the first updating submodule is used for updating the temporary configuration file according to the updating parameters;
the second transmission submodule is used for copying the updated temporary configuration file to the target equipment through the transmission channel;
and the second updating submodule is used for updating the task configuration file in the target equipment according to the updated temporary configuration file through a preset command.
7. The apparatus of claim 6, wherein the update instruction further comprises a task identifier of the task to be updated; the determining module includes:
the first searching submodule is used for searching in a pre-stored first mapping relation according to the task identifier of the task to be updated so as to obtain an equipment identifier of equipment for deploying the task to be updated; the first mapping relation is used for storing a corresponding relation between a task identifier of a task and an equipment identifier of equipment which deploys the task;
the second searching submodule is used for searching in a second mapping relation stored in advance according to the equipment identifier so as to obtain equipment information corresponding to the equipment identifier; the second mapping relation is used for storing the corresponding relation between the equipment identification and the equipment information;
and the first determining submodule is used for determining the target equipment to be updated according to the equipment information corresponding to the equipment identification.
8. The apparatus of claim 6, wherein the receiving module comprises:
the task display submodule is used for displaying a task list corresponding to a project, and the task list comprises tasks in the project;
the task selection submodule is used for determining a task to be updated according to selection operation triggered by aiming at the displayed task in the task list;
the instruction receiving submodule is used for receiving an updating instruction triggered by the task to be updated selected from the displayed task list; the updating instruction comprises an updating parameter of the task to be updated.
9. The apparatus of claim 8, further comprising:
the equipment display module is used for displaying an equipment list of equipment which deploys the task to be updated after the task to be updated is determined according to selection operation triggered aiming at the task in the displayed task list;
the determining module includes:
and the second determining submodule is used for determining target equipment to be updated according to the selection operation of the user on the equipment in the equipment list.
10. The apparatus of any of claims 6 to 9, wherein the update instructions comprise at least one of: add instructions, delete instructions, and modify instructions.
CN201611071691.XA 2016-11-28 2016-11-28 Task processing method and device Active CN106789170B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611071691.XA CN106789170B (en) 2016-11-28 2016-11-28 Task processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611071691.XA CN106789170B (en) 2016-11-28 2016-11-28 Task processing method and device

Publications (2)

Publication Number Publication Date
CN106789170A CN106789170A (en) 2017-05-31
CN106789170B true CN106789170B (en) 2021-04-23

Family

ID=58905394

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611071691.XA Active CN106789170B (en) 2016-11-28 2016-11-28 Task processing method and device

Country Status (1)

Country Link
CN (1) CN106789170B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107909998B (en) * 2017-10-18 2021-06-15 成都市共维科技有限公司 Voice instruction processing method and device, computer equipment and storage medium
CN110955443A (en) * 2019-11-22 2020-04-03 浪潮电子信息产业股份有限公司 Method, device, equipment and medium for updating cluster crontab in batch
CN111416998A (en) * 2020-03-16 2020-07-14 上海晶曦微电子科技有限公司 Information updating system and method for traffic equipment
CN113760936B (en) * 2021-09-10 2024-04-05 杭州网易云音乐科技有限公司 Timing updating method, medium, device and electronic equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102981942A (en) * 2012-10-26 2013-03-20 北京奇虎科技有限公司 Method and system for task processing
CN103577402A (en) * 2012-07-18 2014-02-12 上海斐讯数据通信技术有限公司 Task adding, modifying and management method and task management system
CN105515860A (en) * 2015-12-07 2016-04-20 浪潮通信信息系统有限公司 Method and device for changing device property

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8285460B2 (en) * 2010-01-06 2012-10-09 Deere & Company Varying irrigation scheduling based on height of vegetation
CN103164262B (en) * 2011-12-15 2016-03-30 阿里巴巴集团控股有限公司 A kind of task management method and device
CN104850791B (en) * 2012-10-26 2018-06-22 北京奇安信科技有限公司 The method and system of processing task
CN103677973A (en) * 2013-09-01 2014-03-26 西安重装渭南光电科技有限公司 Distributed multi-task scheduling management system
CN105224351B (en) * 2014-06-17 2020-09-22 中兴通讯股份有限公司 Rapid configuration implementation method and rapid configuration server
CN104216785B (en) * 2014-08-26 2017-10-10 烽火通信科技股份有限公司 General policies task system and its implementation
CN104536809B (en) * 2014-11-26 2018-01-19 上海瀚之友信息技术服务有限公司 A kind of distributed timing task scheduling system based on client, server system
CN104765639A (en) * 2015-04-30 2015-07-08 北京奇虎科技有限公司 Timed task scheduling system and method
CN104991821B (en) * 2015-06-29 2019-12-06 北京奇虎科技有限公司 method and device for processing monitoring tasks in batches
CN105224401A (en) * 2015-09-08 2016-01-06 深圳市永兴元科技有限公司 Scheduled task control method and device
CN105955811A (en) * 2016-05-05 2016-09-21 北京思特奇信息技术股份有限公司 System and method for achieving task scheduling based on remote invoking mode

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103577402A (en) * 2012-07-18 2014-02-12 上海斐讯数据通信技术有限公司 Task adding, modifying and management method and task management system
CN102981942A (en) * 2012-10-26 2013-03-20 北京奇虎科技有限公司 Method and system for task processing
CN105515860A (en) * 2015-12-07 2016-04-20 浪潮通信信息系统有限公司 Method and device for changing device property

Also Published As

Publication number Publication date
CN106789170A (en) 2017-05-31

Similar Documents

Publication Publication Date Title
CN108259643B (en) Binding method and device of intelligent device and user operation terminal, and electronic device
CN106789170B (en) Task processing method and device
CN107367949B (en) Obtain the methods, devices and systems of product identification
CN109542529B (en) Function name-based point burying method and device, computer equipment and storage medium
CN103823700A (en) Method and device for upgrading application software of client
CN104021016B (en) Method and browser for loading browser plug-in icons
CN103973682A (en) Method and device for having access to webpage
CN105765533A (en) Method and apparatus for firmware virtualization
CN105447092A (en) Caching method and apparatus
CN109213536A (en) Resource exhibition method, resource show configuration method, device and the equipment of class control
CN110362585B (en) Data analysis method and device, storage medium and electronic equipment
CN105338065A (en) Terminal equipment position information protection method and device
CN105450718A (en) Interface updating method and client end
CN113609401A (en) Dynamic display method of book city channel page, electronic equipment and storage medium
CN110704122A (en) Plug-in loading method and device
US9395949B2 (en) Apparatus, method, and device for associating information with an object
CN106302639A (en) A kind of resource downloading method and device
CN111125205A (en) Signboard data display method, terminal and storage medium
CN104850553B (en) Replace the method, apparatus and system of background picture
US6944855B2 (en) System, method, and article of manufacture for creating and updating an application using software application elements
CN106897456B (en) Activity information publishing method, activity information driving method, related equipment and system
CN114546220A (en) Page configuration method and device, storage medium and computer equipment
CN108170391B (en) Page display method and device and electronic equipment
CN107506220B (en) Installation package decompression method and device based on software product
CN105468379A (en) Script file execution method and device

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
TR01 Transfer of patent right

Effective date of registration: 20220725

Address after: Room 801, 8th floor, No. 104, floors 1-19, building 2, yard 6, Jiuxianqiao Road, Chaoyang District, Beijing 100015

Patentee after: BEIJING QIHOO TECHNOLOGY Co.,Ltd.

Address before: Room 112, block D, No. 28, Xinjiekou outer street, Xicheng District, Beijing 100088 (Desheng Park)

Patentee before: BEIJING QIHOO TECHNOLOGY Co.,Ltd.

Patentee before: Qizhi software (Beijing) Co.,Ltd.

TR01 Transfer of patent right