CN107515883A - A kind of method and apparatus of operation task - Google Patents

A kind of method and apparatus of operation task Download PDF

Info

Publication number
CN107515883A
CN107515883A CN201610439675.5A CN201610439675A CN107515883A CN 107515883 A CN107515883 A CN 107515883A CN 201610439675 A CN201610439675 A CN 201610439675A CN 107515883 A CN107515883 A CN 107515883A
Authority
CN
China
Prior art keywords
configuration
task
snapshot
configuration parameter
configuration snapshot
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.)
Granted
Application number
CN201610439675.5A
Other languages
Chinese (zh)
Other versions
CN107515883B (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.)
Alibaba Singapore Holdings Pte Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201610439675.5A priority Critical patent/CN107515883B/en
Publication of CN107515883A publication Critical patent/CN107515883A/en
Application granted granted Critical
Publication of CN107515883B publication Critical patent/CN107515883B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking

Abstract

The invention relates to field of computer technology, more particularly to a kind of method and apparatus of operation task, to solve the problems, such as to modify to configuration parameter corresponding to task after task is out of service present in prior art.The embodiment of the present application generates configuration snapshot according to configuration parameter, in operation task according to configuration snapshot operation task, configuration parameter can be so changed at any time, without the influenceing to be currently running of the task, the artificial monitor task that need not be carried out because of modification configuration parameter, reduce the cost of modification configuration parameter.

Description

A kind of method and apparatus of operation task
Technical field
The application is related to field of computer technology, more particularly to a kind of method and apparatus of operation task.
Background technology
The task of many types in web station system be present, such as:For notifying user website operation rule change Task;For the task dispatching for the information issued in the recent period to user recommended website.
Configuration parameter corresponding to the task typically can be loaded when performing some task, the task is run so as to realize.When When one task is currently running, if the configuration parameter that modification uses, will cause data or logical miss.
But in daily operation, the demand of modification task configuration is relatively more, for example changes notice channel etc., at this moment Just need configuration parameter corresponding to modification task.
At present after task run, in order to avoid causing data or logical miss needs freeze modification to configuration parameter. So the mode of configuration parameter is corresponding to the task of adjustment at present:After task is out of service, to configuration parameter corresponding to task Modify.
The modification of configuration parameter is needed to carry out at any time, but this modification mode can only be supervised manually to task Control, and configuration parameter corresponding to task is modified after task is out of service, if the task start time is very long, manually Need to be monitored for a long time, add the cost of modification configuration parameter.
In summary, configuration parameter corresponding to task can only be modified after task is out of service at present.
The content of the invention
The application provides a kind of method and apparatus of operation task, to solve can only be in task present in prior art To the problem of configuration parameter is modified corresponding to task after out of service.
A kind of method for operation task that the embodiment of the present application provides, this method include:
It is determined that the configuration snapshot that the configuration parameter as corresponding to the task generates;
According to the configuration snapshot, the task is run.
The embodiment of the present application generates configuration snapshot according to configuration parameter, is appointed in operation task according to configuration snapshot operation Business, can so change configuration parameter at any time, without the influenceing to be currently running of the task, it is not necessary to because of modification configuration parameter The artificial monitor task carried out, reduce the cost of modification configuration parameter.
Optionally, before the configuration snapshot that determination configuration parameter as corresponding to the task generates, in addition to:
Configuration parameter corresponding to task generates configuration snapshot according to database, and stores the configuration snapshot;
The configuration snapshot that determination configuration parameter as corresponding to task generates, including:
The configuration snapshot that the configuration parameter as corresponding to the task generates is determined from all configuration snapshots of storage.
Optionally, the storage configuration snapshot, including:
The configuration snapshot is stored to part or all of in the internal memory of disk buffering, memory cache and task host In.
Different places arrive into configuration snapshot storage, it is different the characteristics of due to different places data storage, so as to expire The requirement of sufficient different scenes.
Optionally, the configuration snapshot is stored in the internal memory of the disk buffering, memory cache and task host;
The configuration snapshot that the configuration parameter as corresponding to the task generates is determined in all configuration snapshots from storage, Including:
Determine to configure ginseng as corresponding to the task from all configuration snapshots of the memory storage of the task host The configuration snapshot of number generation;
If configuration snapshot can not be determined from the internal memory of the task host, determined from the memory cache by institute State the configuration snapshot that configuration parameter corresponding to task generates;
If configuration snapshot can not be determined from the memory cache, determined from the disk buffering by the task pair The configuration snapshot for the configuration parameter generation answered.
Optionally, in all configuration snapshots from storage determine as corresponding to the task configuration parameter generate match somebody with somebody After putting snapshot, in addition to:
, will be from institute if determining the configuration snapshot that the configuration parameter as corresponding to the task generates from the memory cache The configuration snapshot determined in memory cache is stated to store into the internal memory of the task host;Or
, will be from magnetic if determining the configuration snapshot that the configuration parameter as corresponding to the task generates from the disk buffering The configuration snapshot determined in disk caching is respectively stored into the internal memory of the memory cache and the task host.
Optionally, in all configuration snapshots from storage determine as corresponding to the task configuration parameter generate match somebody with somebody Snapshot is put, including:
All configuration snapshots corresponding to the mark of the task are selected from all configuration snapshots of storage;
Task start time and the configuration of current time match are fast corresponding to selection from all configuration snapshots of selection According to.
Optionally, this method also includes:
During the task run, when needing to change configuration parameter corresponding to the task, the task pair is changed The configuration parameter answered.
Optionally, it is described according to institute after the configuration snapshot that determination configuration parameter as corresponding to the task generates Configuration snapshot is stated, before running the task, in addition to:
Determine that the configuration parameter in the configuration snapshot is complete.
A kind of equipment for operation task that the embodiment of the present application provides, the equipment include:
Determining module is configured, the configuration snapshot generated for determining the configuration parameter as corresponding to the task;
Module is run, for according to the configuration snapshot, running the task.
Optionally, the equipment also includes:
Generation module is configured, generates configuration snapshot for configuration parameter corresponding to the task according to database, and deposit Store up the configuration snapshot;
The configuration determining module is specifically used for:
The configuration snapshot that the configuration parameter as corresponding to the task generates is determined from all configuration snapshots of storage.
Optionally, the configuration generation module is specifically used for:
The configuration snapshot is stored to part or all of in the internal memory of disk buffering, memory cache and task host In.
Optionally, the configuration snapshot is stored in the internal memory of the disk buffering, memory cache and task host;
The configuration determining module is specifically used for:
Determine to configure ginseng as corresponding to the task from all configuration snapshots of the memory storage of the task host The configuration snapshot of number generation;
If configuration snapshot can not be determined from the internal memory of the task host, determined from the memory cache by institute State the configuration snapshot that configuration parameter corresponding to task generates;
If configuration snapshot can not be determined from the memory cache, determined from the disk buffering by the task pair The configuration snapshot for the configuration parameter generation answered.
Optionally, the configuration determining module is additionally operable to:
, will be from institute if determining the configuration snapshot that the configuration parameter as corresponding to the task generates from the memory cache The configuration snapshot determined in memory cache is stated to store into the internal memory of the task host;Or
, will be from magnetic if determining the configuration snapshot that the configuration parameter as corresponding to the task generates from the disk buffering The configuration snapshot determined in disk caching is respectively stored into the internal memory of the memory cache and the task host.
Optionally, the configuration determining module is specifically used for:
All configuration snapshots corresponding to the mark of the task are selected from all configuration snapshots of storage;
Task start time and the configuration of current time match are fast corresponding to selection from all configuration snapshots of selection According to.
Optionally, the configuration determining module is additionally operable to:
During the task run, when needing to change configuration parameter corresponding to the task, the task pair is changed The configuration parameter answered.
Optionally, the operation module is specifically additionally operable to:
After it is determined that configuration parameter in the configuration snapshot is complete, the task is run.
Configuration parameter is generated configuration snapshot by the embodiment of the present application, in operation task according to configuration snapshot operation task, Configuration parameter can be so changed at any time, without the influenceing to be currently running of the task, it is not necessary to enter because of modification configuration parameter Capable artificial monitor task, reduce the cost of modification configuration parameter.
Brief description of the drawings
In order to illustrate more clearly of the technical scheme in the embodiment of the present application, make required in being described below to embodiment Accompanying drawing is briefly introduced, it should be apparent that, drawings in the following description are only some embodiments of the present application, for this For the those of ordinary skill in field, without having to pay creative labor, it can also be obtained according to these accompanying drawings His accompanying drawing.
Fig. 1 is the method flow schematic diagram of the embodiment of the present application operation task;
Fig. 2 is the embodiment of the present application storage location and the relation schematic diagram of configuration snapshot;
Fig. 3 is the complete method schematic flow sheet of the embodiment of the present application operation task;
Fig. 4 is the device structure schematic diagram of the embodiment of the present application operation task;
Fig. 5 is the equipment complete structure schematic diagram of the embodiment of the present application operation task.
Embodiment
In order that the purpose, technical scheme and advantage of the application are clearer, the application is made below in conjunction with accompanying drawing into One step it is described in detail, it is clear that described embodiment is only the application some embodiments, rather than whole implementation Example.Based on the embodiment in the application, what those of ordinary skill in the art were obtained under the premise of creative work is not made All other embodiment, belong to the scope of the application protection.
As described in Figure 1, the method for the embodiment of the present application operation task includes:
Step 100, start task;
Step 101, determine the configuration snapshot that the configuration parameter as corresponding to the task generates;
Step 102, according to the configuration snapshot, run the task.
The configuration snapshot of the embodiment of the present application be similar to shopping online goods orders snapshot (goods orders snapshot saves The price of commodity was bought at that time, sent address etc.), it is a kind of logical description, this logical description can switch to the table being embodied State.
The configuration snapshot of the embodiment of the present application includes the relevant information of corresponding task, for example, the channel configured be mail or App ends;Need to send is message or short message;Sent if necessary by mail, be which content template, use It is which official documents and correspondence variable;If it is which service number by short message sending;If sent by App ends, which is The App of individual version, it is Android operation system or iOS etc..Task start time, the user of configuration task can also be included Deng.
The embodiment of the present application checks whether the entry condition for meeting setting, than such as whether receiving the startup letter of external equipment Number, start the time whether reach.If meet the startup of setting, it is determined that it is real to start task in task start, i.e. step 100 Border is to determine the entry condition for meeting setting.
In force, configuration snapshot can be the configuration snapshot page.Such as an ordinary pages, there is one in this page Form, each table entries have recorded the different information of this configuration snapshot respectively, and such as App 1.1 versions, configuration is iOS And Android, and related official documents and correspondence variate-value.
The task of the embodiment of the present application can send the task of notice, for example be sent out by the APP (application) of user installation Send notice etc.;Can also be the task of device interior, for example primary processor gives other processors distribution processing task dispatching.
Optionally, the configuration parameter of the embodiment of the present application include but is not limited to it is following in it is part or all of:
Transmission frequency, transmission content, sending method, sending object.
The implication of different task configuration parameters is also different.Exemplified by sending the task of notice:
The interval time that transmission frequency notifies for transmission, for example send once for 3 hours, then each 3 cell is sent once;
Transmission content is specific content of announcement, than if desired for the particular content that merchandise news, then commodity are sent to user It is exactly content of announcement;
Sending method is notice channel, i.e., is notified using which kind of form, for example, by mail notification, by SMS notification, Pass through applicative notifications etc.;
Sending object is to be notified to which user, for example notifies user's merchandise news, can to bought the commodity and/or User's notice of similar clause.
The embodiment of the present application generates configuration snapshot according to configuration parameter, is appointed in operation task according to configuration snapshot operation Business, can so change configuration parameter at any time, without the influenceing to be currently running of the task, it is not necessary to because of modification configuration parameter The artificial monitor task carried out, reduce the cost of modification configuration parameter.
By taking task A as an example, when needing operation task A, configuration snapshot is generated according to current task A configuration parameter, can With the configuration snapshot operation task A according to corresponding to task A.
If necessary to change task A configuration parameter, can directly it modify, when needing operation task A, according to repairing Configuration parameter after changing generates new configuration snapshot, and according to new configuration snapshot operation task A.
It is of course also possible in task A of modification configuration parameter, just generated newly according to amended configuration parameter Configuration snapshot, but because configuration parameter may be required for changing at any time, if so generating configuration parameter quilt after configuration snapshot Modification, it is also necessary to continue to generate configuration snapshot, so when needing operation task A, generated according to amended configuration parameter new Configuration snapshot, can save generation configuration snapshot number, improve efficiency.
The embodiment of the present application is when the new configuration snapshot of generation is stored, the configuration snapshot before can replacing it;Also may be used With the configuration snapshot before reservation, it is introduced separately below.
Configuration snapshot before mode one, reservation.
The scene that the configuration snapshot used before being applied to for mode one will also use during other, for example need The scene of desk checking is carried out to the configuration snapshot used.
For mode one in storage configuration snapshot, it is necessary to record the mark of task corresponding to configuration snapshot and configure fast According to the task start time.
Establish the binding relationship of task identification, task start time and configuration snapshot three.
When requiring to look up configuration snapshot corresponding to task, the mark of the task is selected from all configuration snapshots of storage All configuration snapshots corresponding to knowledge;
Task start time and the configuration of current time match are fast corresponding to selection from all configuration snapshots of selection According to.
For example 123 are identified as corresponding to task A, then select corresponding to be identified as 123 all and match somebody with somebody from all configuration snapshots Put snapshot.
Because the task start time is different, one is identified with that multiple configuration snapshots may be corresponded to.
Then according to the task start time of each configuration snapshot of selection, the configuration found with current time matches is fast According to.
For example there are 30 minutes Mays 3 day 7 point in 2016,8 points of May 4 day in 2016 the task start time of the configuration snapshot selected It is whole.
Current time is 58 minutes Mays 4 day 7 point in 2016, then the nearest task start time is 8 points of May 4 day in 2016 It is whole.
Mode two, replace it before configuration snapshot.
The corresponding configuration snapshot of the mark of each task of which, so for mode two in storage configuration snapshot, Need the mark of task corresponding to record configuration snapshot.
Establish the binding relationship of task identification and configuration snapshot.
When requiring to look up configuration snapshot corresponding to task, the mark of the task is selected from all configuration snapshots of storage Configuration snapshot corresponding to knowledge.
For example 123 are identified as corresponding to task A, then select corresponding to be identified as 123 all and match somebody with somebody from all configuration snapshots Put snapshot.
Because task is operationally realized by operation task snapshot, so during the task run, needing When changing configuration parameter corresponding to the task, changing configuration parameter corresponding to the task will not be to being currently running of the task Impact.
Configuration parameter corresponding to the task of startup can be stored in database by the embodiment of the present application, such as MySQL numbers According to storehouse.Configuration parameter in needing directly change database during modification.When needing to generate configuration snapshot, according to data Configuration parameter corresponding to task generates configuration snapshot described in storehouse, and stores the configuration snapshot.It is determined that as corresponding to task During the configuration snapshot of configuration parameter generation, determine that configuration parameter is given birth to as corresponding to the task from all configuration snapshots of storage Into configuration snapshot
Optionally, configuration parameter corresponding to task generates configuration snapshot according to database, and stores the configuration Snapshot;
It is described when needing operation task, from all configuration snapshots of storage determine as corresponding to the task configure ginseng The configuration snapshot of number generation.
Optionally, configuration snapshot can be stored in part or all of in lower column position by the embodiment of the present application:
Disk buffering, such as Tair-Ldb (persistence disk buffering);
Memory cache, such as Tair-Mdb (efficiently read-write and not persistence disk buffering);
The internal memory of task host, such as LRU (Least Recently Used, the master at least distributed in the recent period using algorithm Machine internal memory).
Wherein, the disk buffering of the embodiment of the present application can be the disk buffering that single server cluster provides, and pass through Network access server cluster, such as Tair-Ldb can be single server clusters;
The embodiment of the present application memory cache can be the memory cache that single server cluster provides, and pass through network access Server cluster, such as Tair-Mdb can be single server clusters;
The task of the embodiment of the present application is operated in above task host, and task host can be server.
There is the characteristics of respective three positions:
The characteristics of disk buffering is that data persistence stores but data reading speed is not quickly;
The characteristics of memory cache be internal memory efficiently read data but power down can lose can data;
The internal memory of task host is unit memory object database, compared to disk buffering, unit memory read data Few network overhead, so reading efficiency is higher, but it is limited compared to disk buffering, unit memory size;
So in implementation process, can select which configuration snapshot is stored according to application scenarios, demand etc. Or in which position.For example read if having taken into account data using Tair-Ldb and Tair-Mdb simultaneously and not lost with data efficient The characteristics of.
It should be noted that above three position is merely illustrative, the position that other are capable of storage configuration snapshot is all suitable Use the embodiment of the present application.
Assuming that above three position is required for storage configuration snapshot, then the configuration snapshot of generation can first be stored disk Caching, store into memory cache by the configuration snapshot in disk buffering, finally store the configuration snapshot in memory cache Into the internal memory of task host.
It is a kind of optional if storing the configuration snapshot in the internal memory of the disk buffering, memory cache and task host Reading order be:
Determine to configure ginseng as corresponding to the task from all configuration snapshots of the memory storage of the task host The configuration snapshot of number generation;
If configuration snapshot can not be determined from the internal memory of the task host, determined from the memory cache by institute State the configuration snapshot that configuration parameter corresponding to task generates;
If configuration snapshot can not be determined from the memory cache, determined from the disk buffering by the task pair The configuration snapshot for the configuration parameter generation answered.
Above-mentioned reading order is a kind of feasible mode, and other reading orders are equally applicable the embodiment of the present application.
For example Fig. 2 is a kind of reading order.In Fig. 2, operation personnel increases newly on backstage and/or stored after changing configuration parameter Into database.Wherein, only database is read and write when operation personnel is newly-increased and/or changes task configuration, does not operate disk and delays Deposit data.
Task on startup, inquires the configuration parameter of current task from database, will be configured and joined using Java language Configuration snapshot is obtained after number object serialization, and is stored in disk buffering;It is loaded into from the configuration snapshot in disk buffering interior Deposit in caching, then the configuration snapshot in memory cache is loaded into the internal memory of task host.In task run, by appointing The configuration snapshot being engaged in the internal memory of host runs the task.
If storage configuration snapshot in the internal memory of the disk buffering, memory cache and task host, but due to by In some reasons, such as failure, power-off etc., the configuration snapshot of some positions is lost, can also storage configuration snapshot again.
Optionally, if storing the configuration snapshot in the internal memory of the disk buffering, memory cache and task host, and Reading order is the order of the example above, then the configuration as corresponding to the task is determined in all configuration snapshots from storage After the configuration snapshot of parameter generation:
, will be from institute if determining the configuration snapshot that the configuration parameter as corresponding to the task generates from the memory cache The configuration snapshot determined in memory cache is stated to store into the internal memory of the task host;Or
, will be from magnetic if determining the configuration snapshot that the configuration parameter as corresponding to the task generates from the disk buffering The configuration snapshot determined in disk caching is respectively stored into the internal memory of the memory cache and the task host.
It should be noted that different reading orders, the order stored again after loss can be with identical, can also be different. Such as the internal memory that reading order is disk buffering -- memory cache -- task host;Again the order stored can be task place Internal memory -- memory cache -- disk buffering of main frame;Can also be other orders.
Because the configuration snapshot of generation is possible to malfunction, thus determine as corresponding to the task configuration parameter generate match somebody with somebody It is described according to the configuration snapshot after putting snapshot, the configuration snapshot of generation can also be tested before running the task Card, and it is determined that according to the configuration snapshot after being verified, run the task.
The time of checking can be verified before generation configuration snapshot does not store also;Can also first it store, and Verified between operation task.
The content of checking can be whether the configuration parameter in configuration snapshot is completely verified, if completely, really Surely it is verified;Otherwise, it determines checking does not pass through.
As shown in figure 3, the complete method of the embodiment of the present application operation task includes:
Step 300, start task;
Step 301, inquire about from database startup task configuration parameter.
The configuration parameter generation configuration snapshot that step 302, basis inquire.
Step 303, the configuration snapshot of generation is stored in disk buffering, and from the configuration snapshot loading in disk buffering It is loaded into memory cache, then by the configuration snapshot in memory cache in the internal memory of task host.
Step 304, judge whether to search configuration corresponding to the task of startup from the internal memory of task host soon According to;If it is, perform step 307;Otherwise, step 305 is performed.
Step 305, judge whether that configuration snapshot corresponding to the task of startup can be searched from memory cache;If It is then to perform step 307;Otherwise, step 306 is performed.
Step 306, judge whether that configuration snapshot corresponding to the task of startup can be searched from disk buffering;If It is then to perform step 307;Otherwise, task out of service.
The configuration snapshot that step 307, basis search runs the task.
Based on same inventive concept, additionally provided in the embodiment of the present application in a kind of long-term evolution multi-carrier upgrade-system Base station equipment, user equipment and long-term evolution multi-carrier upgrade-system, due to these equipment solve the principle of problem with it is long-term The method of dynamically distributes reserved resources of uplink control channel is similar in evolution multi-carrier updating system, therefore the implementation of these equipment The implementation of method is may refer to, part is repeated and repeats no more.
As shown in figure 4, the equipment of the embodiment of the present application operation task includes:
Task start module 400, for starting task;
Determining module 401 is configured, the configuration snapshot generated for determining the configuration parameter as corresponding to the task;
Module 402 is run, for according to the configuration snapshot, running the task.
The task of the embodiment of the present application can send the task of notice, for example be sent out by the APP (application) of user installation Send notice etc.;Can also be the task of device interior, for example primary processor gives other processors distribution processing task dispatching.
Optionally, the configuration parameter of the embodiment of the present application include but is not limited to it is following in it is part or all of:
Transmission frequency, transmission content, sending method, sending object.
The implication of different task configuration parameters is also different.Exemplified by sending the task of notice:
The interval time that transmission frequency notifies for transmission, for example send once for 3 hours, then each 3 cell is sent once;
Transmission content is specific content of announcement, than if desired for the particular content that merchandise news, then commodity are sent to user It is exactly content of announcement;
Sending method is notice channel, i.e., is notified using which kind of form, for example, by mail notification, by SMS notification, Pass through applicative notifications etc.;
Sending object is to be notified to which user, for example notifies user's merchandise news, can to bought the commodity and/or User's notice of similar clause.
The embodiment of the present application generates configuration snapshot according to configuration parameter, is appointed in operation task according to configuration snapshot operation Business, can so change configuration parameter at any time, without the influenceing to be currently running of the task, it is not necessary to because of modification configuration parameter The artificial monitor task carried out, reduce the cost of modification configuration parameter.
By taking task A as an example, when needing operation task A, configuration snapshot is generated according to current task A configuration parameter, can With the configuration snapshot operation task A according to corresponding to task A.
If necessary to change task A configuration parameter, can directly it modify, when needing operation task A, according to repairing Configuration parameter after changing generates new configuration snapshot, and according to new configuration snapshot operation task A.
It is of course also possible in task A of modification configuration parameter, just generated newly according to amended configuration parameter Configuration snapshot, but because configuration parameter may be required for changing at any time, if so generating configuration parameter quilt after configuration snapshot Modification, it is also necessary to continue to generate configuration snapshot, so when needing operation task A, generated according to amended configuration parameter new Configuration snapshot, can save generation configuration snapshot number, improve efficiency.
The equipment of the embodiment of the present application also includes configuration generation module 403, as shown in Figure 5.
Configuration generation module 403 is used to generate configuration snapshot and be stored, and in storage configuration snapshot, can replace it Preceding configuration snapshot;Configuration snapshot before can also retaining, is introduced separately below.
Configuration snapshot before mode one, reservation.
The scene that the configuration snapshot used before being applied to for mode one will also use during other, for example need The scene of desk checking is carried out to the configuration snapshot used.
Generation module 403 is configured in storage configuration snapshot, it is necessary to record task corresponding to configuration snapshot for mode one Mark and configuration snapshot the task start time.
Establish the binding relationship of task identification, task start time and configuration snapshot three.
Determining module 401 is configured when requiring to look up configuration snapshot corresponding to task, from all configuration snapshots of storage Select all configuration snapshots corresponding to the mark of the task;
Task start time and the configuration of current time match are fast corresponding to selection from all configuration snapshots of selection According to.
For example 123 are identified as corresponding to task A, then select corresponding to be identified as 123 all and match somebody with somebody from all configuration snapshots Put snapshot.
Because the task start time is different, one is identified with that multiple configuration snapshots may be corresponded to.
Then according to the task start time of each configuration snapshot of selection, the configuration found with current time matches is fast According to.
For example there are 30 minutes Mays 3 day 7 point in 2016,8 points of May 4 day in 2016 the task start time of the configuration snapshot selected It is whole.
Current time is 58 minutes Mays 4 day 7 point in 2016, then the nearest task start time is 8 points of May 4 day in 2016 It is whole.
Mode two, replace it before configuration snapshot.
The corresponding configuration snapshot of the mark of each task of which, exists so configuring generation module 403 for mode two , it is necessary to record the mark of task corresponding to configuration snapshot during storage configuration snapshot.
Establish the binding relationship of task identification and configuration snapshot.
Determining module 401 is configured when requiring to look up configuration snapshot corresponding to task, from all configuration snapshots of storage Select configuration snapshot corresponding to the mark of the task.
For example 123 are identified as corresponding to task A, then select corresponding to be identified as 123 all and match somebody with somebody from all configuration snapshots Put snapshot.
Because task is operationally realized by operation task snapshot, so during the task run, needing When changing configuration parameter corresponding to the task, changing configuration parameter corresponding to the task will not be to being currently running of the task Impact.
Configuration parameter corresponding to the task of startup can be stored in database by the embodiment of the present application, such as MySQL numbers According to storehouse.
It is described configuration determining module 401 when it is determined that user needs to change configuration parameter corresponding to the task, according to The configuration parameter of family input changes configuration parameter corresponding to the task.
When needing to generate configuration snapshot, configuration generation module 403 configures according to corresponding to starting in database for task Parameter generates configuration snapshot, and stores the configuration snapshot.
It is described configuration determining module 401 it is determined that as corresponding to task configuration parameter generate configuration snapshot when, from storage All configuration snapshots in determine as corresponding to the task configuration parameter generate configuration snapshot.
Optionally, configuration snapshot can be stored in lower column position by generation module 403 being configured described in the embodiment of the present application It is part or all of in:
Persistence disk buffering, such as Tair-Ldb;
Efficiently read-write and not persistence disk buffering, such as Tair-Mdb;
The internal memory of task host, such as LRU.
There is the characteristics of respective three positions:
The characteristics of disk buffering is that data persistence stores but data reading speed is not quickly;
The characteristics of memory cache be internal memory efficiently read data but power down can lose can data;
The internal memory of task host is unit memory object database, compared to disk buffering, unit memory read data Few network overhead, so reading efficiency is higher, but it is limited compared to disk buffering, unit memory size;
So in implementation process, can select which configuration snapshot is stored according to application scenarios, demand etc. Or in which position.For example read if having taken into account data using Tair-Ldb and Tair-Mdb simultaneously and not lost with data efficient The characteristics of.
It should be noted that above three position is merely illustrative, the position that other are capable of storage configuration snapshot is all suitable Use the embodiment of the present application.
Assuming that above three position is required for storage configuration snapshot, then the configuration snapshot of generation can first be stored disk Caching, store into memory cache by the configuration snapshot in disk buffering, finally store the configuration snapshot in memory cache Into the internal memory of task host.
It is a kind of optional if storing the configuration snapshot in the internal memory of the disk buffering, memory cache and task host Reading order be:
Determined in all configuration snapshots of memory storage of the configuration determining module 401 from the task host by institute State the configuration snapshot that configuration parameter corresponding to task generates;
If configuration snapshot can not be determined from the internal memory of the task host, determined from the memory cache by institute State the configuration snapshot that configuration parameter corresponding to task generates;
If configuration snapshot can not be determined from the memory cache, determined from the disk buffering by the task pair The configuration snapshot for the configuration parameter generation answered.
Above-mentioned reading order is a kind of feasible mode, and other reading orders are equally applicable the embodiment of the present application.
For example Fig. 2 is a kind of reading order.In Fig. 2, operation personnel increases newly on backstage and/or stored after changing configuration parameter Into MySQL database.Wherein, only MySQL database is read and write when operation personnel is newly-increased and/or changes task configuration, no Operate disk buffering data.
Task on startup, inquires the configuration parameter of current task from database, will be configured and joined using Java language Configuration snapshot is obtained after number object serialization, and is stored in disk buffering;It is loaded into from the configuration snapshot in disk buffering interior Deposit in caching, then the configuration snapshot in memory cache is loaded into the internal memory of task host.In task run, by appointing The configuration snapshot being engaged in the internal memory of host runs the task.
If storage configuration snapshot in the internal memory of the disk buffering, memory cache and task host, but due to by In some reasons, such as failure, power-off etc., the configuration snapshot of some positions is lost, can also storage configuration snapshot again.
Optionally, if storing the configuration snapshot in the internal memory of the disk buffering, memory cache and task host, and Reading order is the order of the example above, then the configuration determining module is determined by described from all configuration snapshots of storage After the configuration snapshot that configuration parameter corresponding to business generates:
, will be from institute if determining the configuration snapshot that the configuration parameter as corresponding to the task generates from the memory cache The configuration snapshot determined in memory cache is stated to store into the internal memory of the task host;Or
, will be from magnetic if determining the configuration snapshot that the configuration parameter as corresponding to the task generates from the disk buffering The configuration snapshot determined in disk caching is respectively stored into the internal memory of the memory cache and the task host.
It should be noted that different reading orders, the order stored again after loss can be with identical, can also be different. Such as the internal memory that reading order is disk buffering -- memory cache -- task host;Again the order stored can be task place Internal memory -- memory cache -- disk buffering of main frame;Can also be other orders.
Because the configuration snapshot of generation is possible to malfunction, so the generation module 402 may be used also before running the task Verified with the configuration snapshot to generation, and it is determined that according to the configuration snapshot after being verified, run the task.
The time of checking can be verified before generation configuration snapshot does not store also;Can also first it store, and Verified between operation task.
The content of checking can be whether the configuration parameter in configuration snapshot is completely verified, if completely, really Surely it is verified;Otherwise, it determines checking does not pass through.
Above by reference to showing according to the method, apparatus (system) of the embodiment of the present application and/or the frame of computer program product Figure and/or flow chart describe the application.It should be understood that it can realize that block diagram and/or flow illustrate by computer program instructions One block of figure and the combination of block diagram and/or the block of flowchart illustration.These computer program instructions can be supplied to logical With computer, the processor of special-purpose computer and/or other programmable data processing units, to produce machine so that via meter The instruction that calculation machine processor and/or other programmable data processing units perform is created for realizing block diagram and/or flow chart block In specified function/action method.
Correspondingly, the application can also be implemented with hardware and/or software (including firmware, resident software, microcode etc.).More Further, the application can take computer to can be used or the shape of computer program product on computer-readable recording medium Formula, it has the computer realized in media as well usable or computer readable program code, to be made by instruction execution system With or combined command execution system and use.In the present context, computer can be used or computer-readable medium can be with It is arbitrary medium, it can include, store, communicate, transmit or transmit program, to be made by instruction execution system, device or equipment With, or combined command execution system, device or equipment use.
Obviously, those skilled in the art can carry out the essence of various changes and modification without departing from the application to the application God and scope.So, if these modifications and variations of the application belong to the scope of the application claim and its equivalent technologies Within, then the application is also intended to comprising including these changes and modification.

Claims (11)

  1. A kind of 1. method of operation task, it is characterised in that this method includes:
    Startup task;
    It is determined that the configuration snapshot that the configuration parameter as corresponding to the task generates;
    According to the configuration snapshot, the task is run.
  2. 2. the method as described in claim 1, it is characterised in that this method also includes:
    During the task run, when needing to change configuration parameter corresponding to the task, needing to change the task During corresponding configuration parameter, configuration parameter corresponding to the task is changed.
  3. 3. the method as described in claim 1, it is characterised in that determination configuration parameter as corresponding to the task generates Before configuration snapshot, in addition to:
    Configuration parameter corresponding to task generates configuration snapshot according to database, and stores the configuration snapshot;
    The configuration snapshot that determination configuration parameter as corresponding to task generates, including:
    The configuration snapshot that the configuration parameter as corresponding to the task generates is determined from all configuration snapshots of storage.
  4. 4. method as claimed in claim 3, it is characterised in that the storage configuration snapshot, including:
    By configuration snapshot storage into part or all of in the internal memory of disk buffering, memory cache and task host.
  5. 5. method as claimed in claim 4, it is characterised in that the disk buffering, memory cache and task host it is interior Deposit the middle storage configuration snapshot;
    The configuration snapshot that the configuration parameter as corresponding to the task generates, bag are determined in all configuration snapshots from storage Include:
    Determine that configuration parameter is given birth to as corresponding to the task from all configuration snapshots of the memory storage of the task host Into configuration snapshot;
    If configuration snapshot can not be determined from the internal memory of the task host, determined from the memory cache by described The configuration snapshot that configuration parameter corresponding to business generates;
    If configuration snapshot can not be determined from the memory cache, determined from the disk buffering as corresponding to the task The configuration snapshot of configuration parameter generation.
  6. 6. method as claimed in claim 5, it is characterised in that determined in all configuration snapshots from storage by described After the configuration snapshot that configuration parameter corresponding to business generates, in addition to:
    , will be from described interior if determining the configuration snapshot that the configuration parameter as corresponding to the task generates from the memory cache The configuration snapshot determined in caching is deposited to store into the internal memory of the task host;Or
    If determining the configuration snapshot that the configuration parameter as corresponding to the task generates from the disk buffering, will delay from disk The configuration snapshot for depositing determination is respectively stored into the internal memory of the memory cache and the task host.
  7. 7. method as claimed in claim 3, it is characterised in that determined in all configuration snapshots from storage by described The configuration snapshot that configuration parameter corresponding to business generates, including:
    All configuration snapshots corresponding to the mark of the task are selected from all configuration snapshots of storage;
    Task start time corresponding to selection and the configuration snapshot of current time match from all configuration snapshots of selection.
  8. 8. the method as described in claim 1~7 is any, it is characterised in that the determination configures ginseng as corresponding to the task It is described according to the configuration snapshot after the configuration snapshots of number generation, before running the task, in addition to:
    Determine that the configuration parameter in the configuration snapshot is complete.
  9. 9. a kind of equipment of operation task, it is characterised in that the equipment includes:
    Task start module, for starting task;
    Determining module is configured, the configuration snapshot generated for determining the configuration parameter as corresponding to the task;
    Module is run, for according to the configuration snapshot, running the task.
  10. 10. equipment as claimed in claim 9, it is characterised in that the configuration determining module is additionally operable to:
    During the task run, when needing to change configuration parameter corresponding to the task, change corresponding to the task Configuration parameter.
  11. 11. the equipment as described in claim 9 or 10, it is characterised in that the equipment also includes:
    Generation module is configured, generates configuration snapshot for configuration parameter corresponding to the task according to database, and store institute State configuration snapshot;
    The configuration determining module is specifically used for:
    The configuration snapshot that the configuration parameter as corresponding to the task generates is determined from all configuration snapshots of storage.
CN201610439675.5A 2016-06-17 2016-06-17 Method and equipment for running task Active CN107515883B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610439675.5A CN107515883B (en) 2016-06-17 2016-06-17 Method and equipment for running task

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610439675.5A CN107515883B (en) 2016-06-17 2016-06-17 Method and equipment for running task

Publications (2)

Publication Number Publication Date
CN107515883A true CN107515883A (en) 2017-12-26
CN107515883B CN107515883B (en) 2021-02-02

Family

ID=60719896

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610439675.5A Active CN107515883B (en) 2016-06-17 2016-06-17 Method and equipment for running task

Country Status (1)

Country Link
CN (1) CN107515883B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1866205A (en) * 2006-03-02 2006-11-22 华为技术有限公司 Smoothing updating method and apparatus for configuration information
CN101179437A (en) * 2007-11-29 2008-05-14 上海华为技术有限公司 Method and apparatus for implementing preactivation of batch configuration
CN101582908A (en) * 2009-06-30 2009-11-18 杭州华三通信技术有限公司 Parameter configuration method and equipment
CN102043687A (en) * 2009-10-20 2011-05-04 杭州华三通信技术有限公司 Copy on first write device for realizing data snapshot and control method
CN104636395A (en) * 2013-11-15 2015-05-20 北京信威通信技术股份有限公司 Count processing method and device
CN104980517A (en) * 2015-06-26 2015-10-14 深圳市腾讯计算机系统有限公司 Snapshot-based cluster sensing system, method and device
CN105446834A (en) * 2015-11-30 2016-03-30 华为技术有限公司 Virtual machine snapshot generation method and apparatus
WO2016048899A1 (en) * 2014-09-25 2016-03-31 Netapp, Inc. Synchronizing configuration of partner objects across distributed storage systems using transformations

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1866205A (en) * 2006-03-02 2006-11-22 华为技术有限公司 Smoothing updating method and apparatus for configuration information
CN101179437A (en) * 2007-11-29 2008-05-14 上海华为技术有限公司 Method and apparatus for implementing preactivation of batch configuration
CN101582908A (en) * 2009-06-30 2009-11-18 杭州华三通信技术有限公司 Parameter configuration method and equipment
CN102043687A (en) * 2009-10-20 2011-05-04 杭州华三通信技术有限公司 Copy on first write device for realizing data snapshot and control method
CN104636395A (en) * 2013-11-15 2015-05-20 北京信威通信技术股份有限公司 Count processing method and device
WO2016048899A1 (en) * 2014-09-25 2016-03-31 Netapp, Inc. Synchronizing configuration of partner objects across distributed storage systems using transformations
CN104980517A (en) * 2015-06-26 2015-10-14 深圳市腾讯计算机系统有限公司 Snapshot-based cluster sensing system, method and device
CN105446834A (en) * 2015-11-30 2016-03-30 华为技术有限公司 Virtual machine snapshot generation method and apparatus

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
刘虎球 等: ""面向驱动配置的自动日志插入方法研究"", 《计算机学报》 *
陈 星 等: ""基于运行时模型的多样化云资源管理方法"", 《软件学报》 *

Also Published As

Publication number Publication date
CN107515883B (en) 2021-02-02

Similar Documents

Publication Publication Date Title
CN102142006B (en) File processing method and device of distributed file system
US9590852B2 (en) Server maintenance system
CN105787077A (en) Data synchronizing method and device
CN105338078A (en) Data storage method and device used for storing system
CN110795503A (en) Multi-cluster data synchronization method and related device of distributed storage system
CN103164525B (en) WEB application dissemination method and device
CN103379159A (en) Distributed web site data synchronization method
CN107463613A (en) Page loading method and device
CN109492013A (en) Data processing method, device and system applied to data-base cluster
CN106878363A (en) A kind of information processing method, apparatus and system
CN102110316A (en) Method, device and system for realizing One-Card service
CN106874328A (en) A kind of data processing method and equipment
CN103281798A (en) Method, device and system for achieving modification synchronization
CN110740155B (en) Request processing method and device in distributed system
CN112380227A (en) Data synchronization method, device and equipment based on message queue and storage medium
CN110309156A (en) Database Systems, database update, expansion method and equipment
CN106575208A (en) Display operation system
US9111261B2 (en) Method and system for management of electronic mail communication
WO2020238860A1 (en) Distributed file batch processing method and apparatus, and readable storage medium
CN105022663B (en) Power system monitoring and control system
US9870234B2 (en) Automatic identification of returned merchandise in a data center
CN103809947B (en) A kind of method for automatically releasing of development requirement and system
CN107786650A (en) A kind of synchronous method, the apparatus and system of storage medium and management strategy
CN107515883A (en) A kind of method and apparatus of operation task
CN104219272A (en) Method, terminal and system for updating caches

Legal Events

Date Code Title Description
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
TR01 Transfer of patent right

Effective date of registration: 20240307

Address after: # 04-08, Lai Zanda Building 1, 51 Belarusian Road, Singapore

Patentee after: Alibaba Singapore Holdings Ltd.

Country or region after: Singapore

Address before: Cayman Islands Grand Cayman capital building, a four storey No. 847 mailbox

Patentee before: ALIBABA GROUP HOLDING Ltd.

Country or region before: Cayman Islands