Specific embodiment
In order to make those skilled in the art more fully understand the technical solution in the disclosure, below in conjunction with disclosure reality
The attached drawing in example is applied, the technical solution in the embodiment of the present disclosure is clearly and completely described, it is clear that described implementation
Example is only disclosure a part of the embodiment, instead of all the embodiments.Based on the embodiment in the disclosure, this field is common
Disclosure protection all should belong in technical staff's every other embodiment obtained without creative efforts
Range.
Unless otherwise defined, the technical term or scientific term that the present invention uses should be tool in fields of the present invention
The ordinary meaning for thering is the personage of general technical ability to be understood." first ", " second " used in the present invention and similar word are simultaneously
Any sequence, quantity or importance are not indicated, and are used only to distinguish different component parts." comprising " or "comprising" etc.
Similar word means that the element or object before the word occur covers the element or object for appearing in the word presented hereinafter
And its it is equivalent, and it is not excluded for other elements or object.The similar word such as " connection " or " connected " is not limited to physics
Or mechanical connection, but may include electrical connection, it is either direct or indirectly."upper", "lower",
"left", "right" etc. is only used for indicating relative positional relationship, and after the absolute position for being described object changes, then the relative position is closed
System may also correspondingly change.
In order to keep the following explanation of the embodiment of the present invention to understand and simplicity, present invention omits known functions and known portion
The detailed description of part.
Fig. 1 is the method flow diagram of the method for updating pages one embodiment of the disclosure based on current limiter.Although the disclosure
It provides as the following examples or method operating procedure shown in the drawings or apparatus structure, but based on conventional or without creativeness
Labour may include more or less operating procedure or modular unit in the method or device.In logicality not
In the step of there are necessary causalities or structure, the execution sequence of these steps or the modular structure of device are not limited to the disclosure
Embodiment description and execution shown in the drawings sequence or modular structure.The device in practice of the method or modular structure
Or end product in application, can according to embodiment or method shown in the drawings or modular structure connection the execution of carry out sequence or
Person executes (such as environment or even distributed processing environment of parallel processor or multiple threads) parallel.
Specifically, may include as shown in Figure 1, provide a kind of method for updating pages based on current limiter in this example
Following steps:
Step 101: current limiter is collected to obtain multiple tasks;
For example, the data source of task 1, task 2, task 3 is different, therefore, the time that data arrive also is different, in reality
When existing, current limliting is carried out to them by the same current limiter, then the time of task execution is just synchronized, task 1 is appointed
Business 2 and all nodes at the same time of task 3, using newest data in the periods of events as data according to execution task.
For being needed to be implemented in system for task, so that it may be collected by the collector in current limiter, that is, collect system
Being needed to be implemented in system for task, such as be carrying out there are five task, then this five tasks can be collected.
Step 102: the multiple task is mounted on a current limiter;
For the multiple tasks being collected into, it can be mounted on a current limiter and (be mounted to current limliting specifically, can be
In the task queue of device), current limliting processing can be carried out to multiple tasks by the current limiter, for example, there are five tasks, then can
This five tasks to be all mounted on a current limiter, because this current limiter has a unified execution node, only exist
The execution node can just execute task, then being exactly to execute node at this, this multiple tasks be executed, so that multiple tasks
It can be all performed in similarly execution node.
Step 103: in delay period, current limiter acquires the latest data of each task in the multiple task;
When actually realizing, in order to realize the real-time synchronization of data and the validity of data, only latest data is only
Effectively, it for example, on the display interface of stock market, needs to be shown to be exactly newest data, because of the data of previous change, nothing
Reference of the method as operation.Therefore, for each task, all should when corresponding execution node in each delay period
Using newest data execution task, wherein executing node can be understood as in delay period segmentum intercalaris at the end of each period
Point.
For example, in a delay period, task 1 has multiple data, for example, first receive data 1, then receive again
Data 2, then data 3 are received, before the execution node of the delay period, data 1, data 2 and data 3 are had received, because only
Newest data are needed, therefore, only data 3 are the data for effectively needing to obtain, and other data can all be given up.
Step 104: executing at node, the latest data based on each task executes the multiple task, and shows and appoint
Business result.
For implementing result, can be shown.Specifically, can be shown on a display screen, it can also use and push away
The mode for being sent to terminal display interface show etc., wherein terminal can include but is not limited to: mobile phone, computer, movement hand
Table etc..It can specifically be selected according to actual needs using which type of terminal, the disclosure is not construed as limiting this.
In upper example, provide the method for updating pages based on current limiter, a current limiter be set, by the current limiter come
Collection obtains multiple tasks, and delay period is then arranged, and in delay period, current limiter acquires each task in multiple tasks
Latest data is executing at node, and the latest data based on each task executes the multiple task, and shows task result.
Make multiple tasks through the above way based on delay period set by same current limiter and execute node progress task execution,
So that end interface is shown the result is that synchronous, and can be updated to avoid data it is too fast caused by Caton problem,
Realize the interface current limliting purpose synchronous with interface.
Specifically, because to guarantee every time when task execution, be all using the corresponding latest data of task, because
This, can only save newest data for current limiter, in order to reduce the amount of storage of current limiter, actually realize when
It waits, it can be by the way of data cover, for example, current limiter acquires each task in the multiple task in delay period
Latest data, may include: the data that current limiter acquires each task in the multiple task;Old number is covered by new data
According to mode (that is, in a delay period, only using within the period newest data as the data for executing required by task,
Its data can be all capped), current limiter obtains the latest data of each task in the multiple task.That is, being obtained with new
To data replace legacy data, certainly using sequentially in time, sequential storage data are also possible, but resource consumption
It is bigger, resource occupation amount can be effectively reduced by the way of covering.
In view of for current limiter, be by the way of loop cycle control task execute node execute, because
This can empty the data of a cycle when entering a new cycle period, re-start data acquisition.For example,
The multiple task is executed in the latest data based on each task, and after showing task result, each task can be emptied
Latest data;The delayer controlled in current limiter enters next period, and acquires each task in the multiple task and working as
The latest data in preceding period.
Above-mentioned delay period can be to be arranged at equal intervals, for example, setting execute node be 100ms, 200ms,
300ms ... that is, it is every cross 100ms execute it is primary, using each whole hundred ms as execution node, then between whole hundred ms when
Between, it can collect, when whole hundred ms, carry out task execution using the newest data of each task, all tasks all exist
Whole hundred ms is executed, to realize the interface current limliting purpose synchronous with interface, 100ms is exactly delay period.
For current limiter, it can be marked using current limliting to show current limiter currently whether in limited current state, that is, really
Whether in running order determine current limiter, if in running order, continues collection task, carry task obtains newest number
According in task of the execution node based on latest data execution institute's carry, if current limiter is not at working condition, just by it
Current limliting label is set as in current limliting, in running order to control current limiter.For example, can indicate to be not in current limliting shape using 0
State, use 1 show in limited current state etc. that the specific mode disclosure is not construed as limiting, can according to actual needs and situation
Selection.
The above method is illustrated below with reference to a specific embodiment, it is important to note, however, that the specific implementation
Example does not constitute the improper restriction to the disclosure merely to the disclosure is better described.
In order to solve the problems, such as existing interface current limliting and general current limiter that is synchronous, designing in this example, Ke Yirang
Interface current limliting and synchronous working are more simple and effective.It is specific:
1) interface current limliting, regardless of Refresh Data how soon, interface, which is refreshed, reads current latest data always and is refreshed;
As shown in Fig. 2, task is very high in the frequency that time shaft is likely to occur, but by the way that after current limiter, meeting is in current limliting
Each timing node of device executes nearest task.In the timing node of second vertical line, task 3 is executed, in third vertical line
Timing node execute task 4, execute task 7 in the timing node of the 4th vertical line, that is, execute in the period most in timing node
New task.
2) interface is synchronous, therefore, can be with by interface synchronization because the refreshing opportunity of disparate modules is likely to be different
It allows each module rhythmically while being refreshed.
As shown in figure 3, the data source of task 1, task 2, task 3 is different, therefore, the time that data arrive is also different
, when realizing, current limliting is carried out to them by the same current limiter, then the time of task execution is just synchronized,
Task 1, task 2 and task 3 all nodes at the same time, using newest data in the periods of events as data according to holding
Row task.
During realization, current limiter can be as shown in Figure 4, comprising:
1) task collector, for the task of collecting, being immediately performed in module for task is gone to execute and (be used with collector
Block is realized);For example, being collected into task 1, task 2, task 3.
Wherein, block is code block, by the code wrap wished to carry out in code block, is gone again when needing
Calling.
2) task carry device is mounted to a current limiter for saving task collected by task collector
On, to be executed in the execution node of current limiter, to realize the synchronization of being collected into for task.
3) whether current limliting marks, for marking current limiter currently in current limliting, that is, determine whether current limiter is currently prolonging
The end time point (that is, executing node) in slow period executes task, if be carrying out, return, which continues to collect, appoints
Business, if not executing node, i.e. it is then in current limliting, corresponding by current limliting traffic sign placement that current limliting mark, which is not in current limliting,
Then if in current limliting, carry task returns immediately.Current limliting label can be realized with Bool type.
For example, current limliting label can be by a binary representation, if current limliting shows just in current limliting labeled as 1, such as
Fruit current limliting is labeled as 0, then shows not in current limliting.
It should be noted, however, that the presentation mode of above-mentioned cited current limliting label is only a kind of exemplary description,
When practical realization, it can also be marked using other types of current limliting, such as text importing etc., the disclosure not limit this
It is fixed, it can select to set according to actual needs.
4) delayer, for keeping the time interval of current current limiter, wherein delayer can use asyncAfter
(delay function) or Timer (delayer) are realized.
5) task performer executes the task in carry device when executing node for after delayer, that is, reaching.
Above-mentioned current limiter can be executed according to process as shown in Figure 5, may include:
S1: task is collected;
For being needed to be implemented in system for task, so that it may be collected by the collector in current limiter, that is, collect system
Being needed to be implemented in system for task, such as be carrying out there are five task, then this five tasks can be collected.
S2: judge current limiter at present whether in current limliting, that is, to judge current limiter target whether in working condition, if really
It is scheduled on working condition (that is, in current limliting), then returns and continues collection task, if not state at work, executes S3, is controlled
Current limiter enters working condition.
S3: setting current limiter is labeled as just in current limliting;
For example, current limliting label can be by a binary representation, if current limliting shows just in current limliting labeled as 1, such as
Fruit current limliting is labeled as 0, then shows not in current limliting.
It should be noted, however, that the presentation mode of above-mentioned cited current limliting label is only a kind of exemplary description,
When practical realization, it can also be marked using other types of current limliting, such as text importing etc., the disclosure not limit this
It is fixed, it can select to set according to actual needs.
S4: the task in task carry device is executed;
S5: emptying the data of the task of institute's carry in carry device, carries out the acquisition of new delay period task data;
In view of for current limiter, be by the way of loop cycle control task execute node execute, because
This can empty the data of a cycle when entering a new cycle period, re-start data acquisition.For example,
The multiple task is executed in the latest data based on each task, and after showing task result, each task can be emptied
Latest data;The delayer controlled in current limiter enters next period, and acquires each task in the multiple task and working as
The latest data in preceding period.
S6: start delay collects data during delay, and data are associated with corresponding task;
S7: determining in carry device whether there is task, executes S4 if so, then returning.
Node is executed as 100ms, 200ms, 300ms ... that is, every 100ms that crosses is executed once, with each whole for example, being arranged
Hundred ms when whole hundred ms, utilize each task then the time between whole hundred ms, can collect as execution node
Newest data carry out task execution, and all tasks are all executed in whole hundred ms, so that it is synchronous with interface to realize interface current limliting
Purpose.
Embodiment of the method provided by the embodiment of the present disclosure can be in mobile terminal, terminal or similar operation
It is executed in device.By run on computer terminals for, Fig. 6 be a kind of page based on current limiter of the embodiment of the present invention more
The hardware block diagram of the terminal of new method.As shown in fig. 6, terminal 20 may include one or more (figures
In only show one) (processor 202 can include but is not limited to Micro-processor MCV or programmable logic device to processor 202
The processing unit of FPGA etc.), memory 204 for storing data and the transmission module 206 for communication function.Ability
Domain those of ordinary skill is appreciated that structure shown in fig. 6 is only to illustrate, and does not cause to limit to the structure of above-mentioned electronic device
It is fixed.For example, terminal 20 may also include than shown in Fig. 6 more perhaps less component or have with shown in Fig. 6 not
Same configuration.
Memory 204 can be used for storing the software program and module of application software, as in the embodiment of the present invention based on
Corresponding program instruction/the module of the method for updating pages of current limiter, processor 202 are stored in memory 204 by operation
Software program and module, thereby executing various function application and data processing, that is, realize above-mentioned application program based on
The method for updating pages of current limiter.Memory 204 may include high speed random access memory, may also include nonvolatile memory, such as
One or more magnetic storage device, flash memory or other non-volatile solid state memories.In some instances, memory
204 can further comprise the memory remotely located relative to processor 202, these remote memories can pass through network connection
To terminal 20.The example of above-mentioned network includes but is not limited to internet, intranet, local area network, mobile radio communication
And combinations thereof.
Transmission module 206 is used to that data to be received or sent via a network.Above-mentioned network specific example may include
The wireless network that the communication providers of terminal 20 provide.In an example, transmission module 206 includes that a network is suitable
Orchestration (Network Interface Controller, NIC), can be connected by base station with other network equipments so as to
Internet is communicated.In an example, transmission module 206 can be radio frequency (Radio Frequency, RF) module,
For wirelessly being communicated with internet.
In software view, the above-mentioned renewal of the page device based on current limiter, which can be, to be set in current limiter, such as Fig. 7 institute
Show, may include:
Collection module 701 obtains multiple tasks for collecting;
For example, the data source of task 1, task 2, task 3 is different, therefore, the time that data arrive also is different, in reality
When existing, current limliting is carried out to them by the same current limiter, then the time of task execution is just synchronized, task 1 is appointed
Business 2 and all nodes at the same time of task 3, using newest data in the periods of events as data according to execution task.
For being needed to be implemented in system for task, so that it may be collected by the collector in current limiter, that is, collect system
Being needed to be implemented in system for task, such as be carrying out there are five task, then this five tasks can be collected.
Carry module 702, for the multiple task to be mounted to a current limiter;
For the multiple tasks being collected into, can be mounted on a current limiter, it can be to multiple by the current limiter
Task carries out current limliting processing, for example, there are five tasks, then this five tasks can be all mounted on a current limiter, because
There is a unified execution node for this current limiter, only task can be just executed in the execution node, then being exactly at this
Node is executed, this multiple tasks is executed, so that multiple tasks can be all performed in similarly execution node.
Acquisition module 703, for acquiring the latest data of each task in the multiple task in delay period;
When actually realizing, in order to realize the real-time synchronization of data and the validity of data, only latest data is only
Effectively, it for example, on the display interface of stock market, needs to be shown to be exactly newest data, because of the data of previous change, nothing
Reference of the method as operation.Therefore, for each task, all should when corresponding execution node in each delay period
Using newest data.
For example, in a delay period, task 1 has multiple data, for example, first receive data 1, then receive again
Data 2, then data 3 are received, before the execution node of the delay period, data 1, data 2 and data 3 are had received, because only
Newest data are needed, therefore, only data 3 are the data for effectively needing to obtain, and other data can all be given up.
Display module 704 is executed, for executing at node, the latest data based on each task executes the multiple
Business, and show task result.
In one embodiment, acquisition module 703 may include: acquisition unit, for acquiring institute in delay period
State the data of each task in multiple tasks;Capping unit, for taking the multiple in the way of new data covering legacy data
The latest data of each task in task.
In one embodiment, the above-mentioned renewal of the page device based on current limiter can also include: to empty module, be used for
The multiple task is executed in the latest data based on each task, and after showing task result, empties each task most
New data;Control module for controlling the delayer in current limiter into next period, and acquires each in the multiple task
Latest data of the task in current period.
In one embodiment, above-mentioned delay period can be the duplicate period at equal intervals.Above-mentioned delay period can
To be arranged at equal intervals, for example, it is 100ms, 200ms, 300ms ... that is, every 100ms that crosses executes one that setting, which executes node,
It is secondary, using each whole hundred ms as execution node, then the time between whole hundred ms, can collect, and when whole hundred ms, benefit
Task execution is carried out with the newest data of each task, all tasks are all executed in whole hundred ms, to realize interface current limliting
The purpose synchronous with interface, 100ms are exactly delay period.
In upper example, provide the method for updating pages based on current limiter, a current limiter be set, by the current limiter come
Collection obtains multiple tasks, and delay period is then arranged, and in delay period, current limiter acquires each task in multiple tasks
Latest data is executing at node, and the latest data based on each task executes the multiple task, and shows task result.
Make multiple tasks through the above way based on delay period set by same current limiter and execute node progress task execution,
So that end interface is shown the result is that synchronous, and can be updated to avoid data it is too fast caused by Caton problem,
Realize the interface current limliting purpose synchronous with interface.
Although present disclose provides the method operating procedure as described in embodiment or flow chart, based on conventional or noninvasive
The labour for the property made may include more or less operating procedure.The step of enumerating in embodiment sequence is only numerous steps
One of execution sequence mode, does not represent and unique executes sequence.It, can when device or client production in practice executes
To execute or parallel execute (such as at parallel processor or multithreading according to embodiment or method shown in the drawings sequence
The environment of reason).
The device or module that above-described embodiment illustrates can specifically realize by computer chip or entity, or by having
The product of certain function is realized.For convenience of description, it is divided into various modules when description apparatus above with function to describe respectively.
The function of each module can be realized in the same or multiple software and or hardware when implementing the disclosure.It is of course also possible to
Realization the module for realizing certain function is combined by multiple submodule or subelement.
Method, apparatus described in the disclosure or module can realize that controller is pressed in a manner of computer readable program code
Any mode appropriate is realized, for example, controller can take such as microprocessor or processor and storage can be by (micro-)
The computer-readable medium of computer readable program code (such as software or firmware) that processor executes, logic gate, switch, specially
With integrated circuit (Application Specific Integrated Circuit, ASIC), programmable logic controller (PLC) and embedding
Enter the form of microcontroller, the example of controller includes but is not limited to following microcontroller: ARC 625D, Atmel AT91SAM,
Microchip PIC18F26K20 and Silicone Labs C8051F320, Memory Controller are also implemented as depositing
A part of the control logic of reservoir.It is also known in the art that in addition to real in a manner of pure computer readable program code
Other than existing controller, completely can by by method and step carry out programming in logic come so that controller with logic gate, switch, dedicated
The form of integrated circuit, programmable logic controller (PLC) and insertion microcontroller etc. realizes identical function.Therefore this controller
It is considered a kind of hardware component, and hardware can also be considered as to the device for realizing various functions that its inside includes
Structure in component.Or even, it can will be considered as the software either implementation method for realizing the device of various functions
Module can be the structure in hardware component again.
Part of module in disclosure described device can be in the general of computer executable instructions
Upper and lower described in the text, such as program module.Generally, program module includes executing particular task or realization specific abstract data class
The routine of type, programs, objects, component, data structure, class etc..The disclosure can also be practiced in a distributed computing environment,
In these distributed computing environment, by executing task by the connected remote processing devices of communication network.In distribution
It calculates in environment, program module can be located in the local and remote computer storage media including storage equipment.
As seen through the above description of the embodiments, those skilled in the art can be understood that the disclosure can
It is realized by the mode of software plus required hardware.Based on this understanding, the technical solution of the disclosure is substantially in other words
The part that contributes to existing technology can be embodied in the form of software products, and can also pass through the implementation of Data Migration
It embodies in the process.The computer software product can store in storage medium, such as ROM/RAM, magnetic disk, CD, packet
Some instructions are included to use so that a computer equipment (can be personal computer, mobile terminal, server or network are set
It is standby etc.) execute method described in certain parts of each embodiment of the disclosure or embodiment.
Each embodiment in this specification is described in a progressive manner, the same or similar portion between each embodiment
Dividing may refer to each other, and each embodiment focuses on the differences from other embodiments.The whole of the disclosure or
Person part can be used in numerous general or special purpose computing system environments or configuration.Such as: personal computer, server calculate
Machine, handheld device or portable device, mobile communication terminal, multicomputer system, based on microprocessor are at laptop device
System, programmable electronic equipment, network PC, minicomputer, mainframe computer, the distribution including any of the above system or equipment
Formula calculates environment etc..
Although depicting the disclosure by embodiment, it will be appreciated by the skilled addressee that the disclosure there are many deformation and
The spirit changed without departing from the disclosure, it is desirable to which the attached claims include these deformations and change without departing from the disclosure
Spirit.