CN106528295A - System task scheduling method and device - Google Patents
System task scheduling method and device Download PDFInfo
- Publication number
- CN106528295A CN106528295A CN201610978425.9A CN201610978425A CN106528295A CN 106528295 A CN106528295 A CN 106528295A CN 201610978425 A CN201610978425 A CN 201610978425A CN 106528295 A CN106528295 A CN 106528295A
- Authority
- CN
- China
- Prior art keywords
- queue
- task
- user
- nodes
- node
- 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.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
- G06F9/5038—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the execution order of a plurality of tasks, e.g. taking priority or time dependency constraints into consideration
Abstract
The invention discloses a system task scheduling method and device. The system task scheduling method comprises the following steps of: circularly traversing a first-level user queue which is used for storing system tasks, in each circulation, executing a system task stored by a first node of a second-level task queue pointed by a queue node corresponding to each user in the first-level user queue, correspondingly taking the next node of the second-level task queue as the first node in the next circulation so as to eliminate the executed system task until all the stored system tasks are executed; and in response to a task request instruction of a user, positioning the second task queue of the user in the first-level user queue, and creating a system task corresponding to the task request instruction at the tail of the second-level task queue. According to the system task scheduling method, a favorable system task arrangement mechanism and a processing mechanism are constructed, so that the time in response to the system task corresponding to each user is effectively balanced and then the user experience is improved.
Description
Technical field
The present invention relates to data resource dispatching technique field, more particularly, to a kind of system task dispatching method and dress
Put.
Background technology
With the development of science and technology, the life of people increasingly be unable to do without various internet products, internet product
The function which can be provided can meet people's demand in different situations.For an internet product, often deposit
Use in the same time period in substantial amounts of user.The task requests sent in the function using internet product by user refer to
Order, typically, needs using queue the request stacking of user is got up, and these task requests is instructed corresponding system
System task is arranged, then is processed one by one.
When a certain user continually sends task requests instruction to server at short notice, will cause should before queue
Multiple requests of user are occupied, and are dealt with needs and are spent more times.And and then another user sends task requests and refers to
After order, then may need to wait, cannot get server and timely respond.The response of this delay, can stay to user and such as take
The not all right impression of business device, affects the experience of user.
Therefore, industry needs a kind of technical scheme of solution energy the problems referred to above badly.
The content of the invention
To solve the problems, such as in terms of above-mentioned at least one, the present invention proposes a kind of system task dispatching method and device.
The system task dispatching method have adjusted the logic that the structure of queue and task are processed, and the task requests instruction to user is corresponding
System task carries out efficient scheduling, balances the response time of the system task between each user so that the operation of user
Can meet with a response within the shorter time, improve the experience of user.
In order to realize the purpose of the present invention, adopt the following technical scheme that:
A kind of first aspect, there is provided system task dispatching method.The system task dispatching method includes:Searching loop is used
In the primary user queue for storing the system task, in circulating every time, each user's phase in the primary user queue is performed
The system task stored by the first node of the second task queue pointed by the queue nodes answered, accordingly by the second task
First node of the next node of queue as which in subsequent cycle, to remove the system task being performed, until institute
There is the system task for having stored to be performed;
Instruct in response to the task requests of user, the second task queue of the user is positioned in primary user queue,
The tail of the queue of the second task queue is created and the task requests corresponding system task of instruction.
Specifically, the searching loop is used for the step of storing the primary user queue of the system task and the response
It is parallel the step of the task requests of user are instructed.
Specifically, perform the second task queue pointed by the corresponding queue nodes of each user in the primary user queue
The system task that stored of first node, specifically include:
It is pre-created primary user queue, the queue nodes and the queue section of each user is characterized in primary user queue
The second task queue that point is pointed to;
The system task is added in its corresponding second task queue;
In circulating each time, the system task stored by the second task queue first node is performed.
Specifically, the first node using the next node in the second task queue as which in subsequent cycle is concrete to wrap
Include:
Change the data stored by the queue nodes of the primary user queue corresponding to second task queue;
The queue nodes are pointed to into the next node of the second task queue, to realize that the node is made in the subsequent cycle
For the first node of the second task queue.
Specifically, instruct in response to the task requests of user, the second task of the user is positioned in primary user queue
Queue, specifically includes:
Receive the task requests instruction of the user in a period of time;
Instruct in response to the task requests of user, inquire about the user its corresponding queue nodes in primary user queue;
Position the second task queue pointed by the queue nodes.
Specifically, inquiring about the user after its corresponding queue nodes, also includes in primary user queue:
When there are the queue nodes that characterize the user in the primary user queue, it is the user in primary user team
Corresponding queue nodes and the second task queue pointed by the queue nodes are created in the tail of the queue of row.
Preferably, after all system tasks in a second task queue has been performed, also include:
Delete the second task queue and the queue nodes in the primary user queue corresponding to which.
A kind of second aspect, there is provided device.The device includes:Searching loop module, is used to store for searching loop
The primary user queue of the system task, in circulating every time, performs the corresponding team of each user in the primary user queue
The system task stored by the first node of the second task queue pointed by row node, accordingly by the second task queue
First node of the next node as which in subsequent cycle, to remove the system task being performed, is deposited until all
The system task of storage is performed;
Creation module, instructs for the task requests in response to user, the two of the user is positioned in primary user queue
Level task queue, creates and the task requests corresponding system task of instruction in the tail of the queue of the second task queue.
Specifically, the searching loop module and the creation module are parallel.
Specifically, perform the second task queue pointed by the corresponding queue nodes of each user in the primary user queue
The system task that stored of first node, specifically include:
It is pre-created primary user queue, the queue nodes and the queue section of each user is characterized in primary user queue
The second task queue that point is pointed to;
The system task is added in its corresponding second task queue;
In circulating each time, the system task stored by the second task queue first node is performed.
Specifically, the first node using the next node in the second task queue as which in subsequent cycle is concrete to wrap
Include:
Change the data stored by the queue nodes of the primary user queue corresponding to second task queue;
The queue nodes are pointed to into the next node of the second task queue, to realize that the node is made in the subsequent cycle
For the first node of the second task queue.
Specifically, instruct in response to the task requests of user, the second task of the user is positioned in primary user queue
Queue, specifically includes:
Receive the task requests instruction of the user in a period of time;
Instruct in response to the task requests of user, inquire about the user its corresponding queue nodes in primary user queue;
Position the second task queue pointed by the queue nodes.
Specifically, inquiring about the user after its corresponding queue nodes, also includes in primary user queue:
When there are the queue nodes that characterize the user in the primary user queue, it is the user in primary user team
Corresponding queue nodes and the second task queue pointed by the queue nodes are created in the tail of the queue of row.
Preferably, after all system tasks in a second task queue has been performed, also include:
Delete the second task queue and the queue nodes in the primary user queue corresponding to which.
Compared to existing technology, the solution of the present invention has advantages below:
The system task dispatching method of the present invention is by establishment primary user queue and the queue section of primary user queue
The pointed second task queue of point, have adjusted the structure of queue queue, and adjustment wall scroll queue is changed to two-stage queue, is once following
In ring, the system task stored by the first node of the second task queue pointed by the queue nodes of primary user queue is performed,
The process logic of queue task adjusted, the stand-by period of the system task between active balance each user, is carried
The high experience of user.
The additional aspect of the present invention and advantage will be set forth in part in the description, and these will become from the following description
Obtain substantially, or recognized by the practice of the present invention.
Description of the drawings
For the technical scheme being illustrated more clearly that in the embodiment of the present invention, below will be to making needed for embodiment description
Accompanying drawing is briefly described, it should be apparent that, drawings in the following description are only some embodiments of the present invention, for
For those skilled in the art, on the premise of not paying creative work, can be attached to obtain others according to these accompanying drawings
Figure.
Fig. 1 is a kind of schematic flow sheet of a kind of embodiment of system task dispatching method in the present invention;
Fig. 2 is a kind of structural representation of a kind of embodiment of system task dispatching device in the present invention;
Specific embodiment
In order that those skilled in the art more fully understand the present invention program, below in conjunction with the embodiment of the present invention
Accompanying drawing, is clearly and completely described to the technical scheme in the embodiment of the present invention.
In some flow processs of description in description and claims of this specification and above-mentioned accompanying drawing, contain according to
Multiple operations that particular order occurs, but it should be clearly understood that these operations can not be according to the suitable of its appearance herein
Performing or executed in parallel, sequence number such as 101,102 of operation etc. is only used for distinguishing each different operation, sequence number sequence
Any execution sequence is not represented itself.In addition, these flow processs can include more or less of operation, and these operations can
To perform in order or executed in parallel.It should be noted that the description such as " first ", " second " herein, is for distinguishing not
Message together, equipment, module etc., do not represent sequencing, and it is different types also not limit " first " and " second ".
It will appreciated by the skilled person that unless expressly stated, singulative " " used herein, " one
It is individual ", " described " and " being somebody's turn to do " may also comprise plural form.It is to be further understood that arranging used in the specification of the present invention
Diction " including " refers to there is the feature, integer, step, operation, element and/or component, but it is not excluded that existing or adding
One or more other features, integer, step, operation, element, component and/or their group.It should be understood that when we claim unit
Part is " connected " or during " coupled " to another element, and it can be directly connected or coupled to other elements, or can also exist
Intermediary element.Additionally, " connection " used herein or " coupling " can include wireless connection or wireless coupling.It is used herein to arrange
Diction "and/or" includes the one or more associated wholes or any cell of listing item and all combinations.
It will appreciated by the skilled person that unless otherwise defined, all terms used herein (include technology art
Language and scientific terminology), with art of the present invention in those of ordinary skill general understanding identical meaning.Should also
It is understood by, those terms defined in such as general dictionary, it should be understood that with the context with prior art
The consistent meaning of meaning, and unless by specific definitions as here, will not otherwise use idealization or excessively formal implication
To explain.
It will appreciated by the skilled person that the implication of noun involved in the present invention at least includes:
Traversal (Traversal):Refer to along certain search pattern, successively each node in tree is done once and only done
Once access.The operation made by access node depends on specific application problem.Traversal be on binary tree most important computing it
One, it is the basis that other computings are carried out on binary tree.Certainly the concept of traversal is also suitable for the situation of multielement set, in full
Group.
Queue (Queue):Be a kind of linear list, be characterized in that it only allows deletion action to be carried out in the front end of table,
And insertion operation is carried out in the rear end of table.As stack, queue is a kind of restricted linear list of operation.Carry out insertion operation
End is referred to as tail of the queue, and the end for carrying out deletion action is referred to as team's head.In queue during no element, referred to as empty queue.The data element of queue
Element is also called queue element (QE).A queue element (QE) is inserted in queue, is referred to as joining the team;A queue element (QE) is deleted from queue,
It is referred to as team.Because beep row only allow to insert at one end, delete in the other end, so only entering the element ability of enqueue earliest
Delete from queue, therefore queue is also called first in first out linear list.
Parallel (Parallel):Refer to " walking side by side " or " while being practiced or carried out ".Refer in an operating system, one group
Program is performed by independent asynchronous speed, and (the same moment occurs to be not equal to temporal overlap.
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete
Site preparation is described, it is clear that described embodiment is only a part of embodiment of the invention, rather than the embodiment of whole.It is based on
Embodiment in the present invention, the every other enforcement obtained under the premise of creative work is not made by those skilled in the art
Example, belongs to the scope of protection of the invention.
Such as Fig. 1, a kind of one embodiment of system task dispatching method in the present invention is shown.The system task dispatching party
Method includes step S11 and step S12.Wherein, step S11 and step S12 are parallel, effectively can be operated simultaneously, be carried
High being given using the system task instruction sent by intelligent terminal to user is timely replied, and improves the efficiency of process.
Step S11:Searching loop is used for the primary user queue for storing the system task, in circulating every time, performs
The institute stored by the first node of the second task queue in the primary user queue pointed by the corresponding queue nodes of each user
System task is stated, accordingly the first node using the next node of the second task queue as which in subsequent cycle, to remove
The system task being performed, until all system tasks for having stored are performed.
When using internet product, user can send related task requests instruction to server, with request server
Corresponding function is provided, to meet the needs under oneself present case.For example, a user gets lost in big city, and he is
Pick up one's own road, accurately arrive at, he need to know oneself be in where, nearby have anything to build
Build, and the route map that arrives at.He positions the position of oneself by using map software application program, checks
The environment of surrounding, and plan the line map of origin and terminal ground.In the mistake of the function services provided using the map software
Cheng Zhong, the intelligent terminal used by he can constantly to server request multiple tasks, so as to obtain the information of correlation.Described intelligence
When related operation requests are sent to server, the operation requests can be generated corresponding system and be appointed energy terminal by the server
Business, and by the system task store in corresponding queue, with etc. it is to be performed.
In embodiments of the invention, the system task is stored in the corresponding queue section of each user in primary user queue
The pointed second task queue of point.When server execution system task, the queue section of meeting searching loop primary user queue
Point.In circulating each time, the second task pointed by the corresponding queue nodes of each user in the primary user queue is performed
The system task stored by the first node of queue.The structure of the queue queue of system task is adjusted, by task
Arrangement and processing structure two-stage queue (include primary user queue and second task queue) is changed to by wall scroll queue, effectively
The stand-by period of system task is balanced, the response problem of the system task to different user is optimized, the body of user is improve
Test.
Further, perform the second task team pointed by the corresponding queue nodes of each user in the primary user queue
The system task stored by the first node of row, specifically includes:
It is pre-created primary user queue, the queue nodes and the queue section of each user is characterized in primary user queue
The second task queue that point is pointed to;
The system task is added in its corresponding second task queue;
In circulating each time, the system task stored by the second task queue first node is performed.
In a kind of preferred version of the present embodiment, the primary user queue is pre-created by server, team thereon
Second task queue pointed by row node and the queue nodes is then according to received system task dynamic creation.Should
There is two kinds of implementations, the first in the mode that dynamic is set up:The primary user queue its corresponding length is to determine, if should
Queue less than when, then the task requests instruction in response to user is created pointed by corresponding queue nodes and the queue nodes
Second task queue, otherwise, then the task requests instruction of user can be delayed by response, during wait, until described
Primary user queue less than;Which two is:The primary user queue its corresponding length is not limited, but its dynamic creation
Queue nodes follow certain condition, and for example, primary user queue described in searching loop performs corresponding system task after 1 second,
The user task request instruction in waiting list is received, corresponding system task is created, and is used for storage system task
Second task queue pointed by the queue nodes and the queue nodes of the primary user queue of information.Complete accordingly in establishment
Primary user queue queue nodes and the queue nodes pointed by second task queue after, add corresponding system and appoint
Business.In traversal loop each time, second task queue pointed by the queue nodes of each primary user queue is performed
First node.
For example, in a primary user queue, successively exist and characterize Xiao Zhao, Xiao Zhang, the queue section of three users of stiver
Point A, B, C.In second task queue wherein pointed by queue nodes A have be stored with system task A1, A2, A3, A4 this four
Individual queue nodes, have these three teams of system task B1, B2, B3 that are stored with the second task queue pointed by queue nodes B
Row node, has system task C1, C2 the two queue nodes of being stored with the second task queue pointed by queue nodes C.
Wherein, A1, B1, C1 are the first node of corresponding second task queue respectively.In the queue section for once traveling through primary user queue
Point, performs in the circulation of corresponding system task, successively performs A1, B1, C1, effectively scheduled the corresponding system of each user and appoints
The sequencing of the execution of business, and all system tasks of a user need not have been performed in the system for performing another user
Task, balances the response time of the system request instruction sent by each user, reduces the wait-for-response of certain customers
Time, it is favorably improved the experience of user.
In the queue nodes of searching loop primary user queue again and again, and perform pointed by the queue nodes
During second task queue, need stored in the first node for having performed a second task queue system task it is same
When, the queue nodes of the second task queue corresponding primary user queue are pointed to the next section in the second task queue
Point, using the next node as its under with the first node in circulation, to complete in upper searching loop operation once
Correct tasks carrying operation, it is to avoid because the mistake mapping in queue nodes and second task queue in primary user queue
Relation and cause the error of system.
Further, the first node using the next node in the second task queue as which in subsequent cycle, specifically
Including:
Change the data stored by the queue nodes of the primary user queue corresponding to second task queue;
The queue nodes are pointed to into the next node of the second task queue, to realize that the node is made in the subsequent cycle
For the first node of the second task queue.
In the present embodiment, after the system task stored by the first node for having performed a second task queue, one
Parallel modification program, changes the data stored by the queue nodes of the primary user queue corresponding to second task queue,
Originally the mapping relations of the first node being just performed are pointed to, is changed to point to the next node of the first node.Due to adopting
It is parallel form, the data stored by the queue nodes of the change primary user queue performed by modification program, again
The mapping relations of the node set up in the queue nodes and the second task queue pointed by which of primary user queue, can't shadow
Ring to current step 11, that is, have no effect on the execution of the system task stored by first node in next second task queue.
And further ensure correct mapping relations, using the next node as second task queue first node, in server
Circulation next time in, effectively scheduled the execution of system task, balance the response time of the system task of each user,
Avoid the system task stand-by period long, cause the experience of user bad.For example, in one cycle, perform primary user team
First node F of the second task queue pointed by queue nodes E in row, in the second task queue, first node F it is next
Individual node is G, then, when the system task stored by first node F has been performed, modification queue nodes E is reflected with second task queue
Relation is penetrated, queue nodes E is pointed to into the next node G in second task queue, by changing mapping relations, effectively be scheduled
The execution of system task.Additionally, after the system task in a second task queue has been performed, clearly storing this is
The node of system task, until all system tasks that all second task queues are stored are performed.
Step S12:Instruct in response to the task requests of user, the second task of the user is positioned in primary user queue
Queue, creates and the task requests corresponding system task of instruction in the tail of the queue of the second task queue.
Specifically, instruct in response to the task requests of user, the second task of the user is positioned in primary user queue
Queue, specifically includes:
Receive the task requests instruction of the user in a period of time;
Instruct in response to the task requests of user, inquire about the user its corresponding queue nodes in primary user queue;
Position the second task queue pointed by the queue nodes.
In the middle of a kind of preferred version of the present embodiment, user sends task requests to server using intelligent terminal and refers to
Order, to meet the demand of itself.System receives the task requests instruction of the user in a period of time.For example, in 1 second, have
First, second, the third three people have issued task requests instruction L1, L2, L3 respectively.System is received in this 1 second, and first, second, the third three people are sent
Task requests instruction L1, L2, L3 after, instruct in response to the task requests, each characterize in inquiry primary user queue first,
Second, third queue nodes, so as to navigate to first, second, third respective second task queue V1, V2, V3, and by system task L1,
L2, L3 are respectively added to the tail of the queue of second task queue V1, V2, V3, complete the addition of system task.In circulation each time
In, server can perform the system stored by the first node of the second task queue pointed by the queue nodes of primary user queue
Task.
Specifically, inquiring about the user after its corresponding queue nodes, also includes in primary user queue:
When there are the queue nodes that characterize the user in the primary user queue, it is the user in primary user team
Corresponding queue nodes and the second task queue pointed by the queue nodes are created in the tail of the queue of row.
Certainly, when inquiring about queue nodes of the user in primary user queue, it is also possible to which inquiry is less than the user couple
The queue nodes of the primary user queue answered.When a user is not recorded by existing primary user queue, i.e., not in one-level
The queue nodes for characterizing the user are created in Subscriber Queue, need corresponding queue nodes and the queue section to be created to the user
The pointed second task queue of point, and created system task will be instructed according to the task requests of the received user
It is added in second task queue.According to the characteristics of queue, the queue nodes for characterizing a user are created in primary user
The tail of the queue of queue.
Preferably, after all system tasks in a second task queue has been performed, also include:
Delete the second task queue and the queue nodes in the primary user queue corresponding to which.
After the system task stored by a second task queue has been performed, will delete the second task queue with
And the queue nodes in the corresponding primary user queue of the second task queue, contribute to releasing memory, release queue resource, enter
System task of the one step addition in waiting processing state, accelerates the process to system task.
A kind of second aspect, there is provided device.As shown in Fig. 2 the device includes searching loop module S101 and creates mould
Block S102.Wherein, searching loop module S101 and creation module S102 are parallel, effectively can be operated simultaneously, be improved
User is given using the system task instruction sent by intelligent terminal and is timely replied, improve the efficiency of process.
Searching loop module S101, is used for storing the primary user queue of the system task for searching loop, every
In secondary circulation, the first section of the second task queue in the primary user queue pointed by the corresponding queue nodes of each user is performed
The system task for being stored is put, accordingly the first section using the next node of the second task queue as which in subsequent cycle
Point, to remove the system task being performed, until all system tasks for having stored are performed.
When using internet product, user can send related task requests instruction to server, with request server
Corresponding function is provided, to meet the needs under oneself present case.For example, a user gets lost in big city, and he is
Pick up one's own road, accurately arrive at, he need to know oneself be in where, nearby have anything to build
Build, and the route map that arrives at.He positions the position of oneself by using map software application program, checks
The environment of surrounding, and plan the line map of origin and terminal ground.In the mistake of the function services provided using the map software
Cheng Zhong, the intelligent terminal used by he can constantly to server request multiple tasks, so as to obtain the information of correlation.Described intelligence
When related operation requests are sent to server, the operation requests can be generated corresponding system and be appointed energy terminal by the server
Business, and by the system task store in corresponding queue, with etc. it is to be performed.
In embodiments of the invention, the system task is stored in the corresponding queue section of each user in primary user queue
The pointed second task queue of point.When server execution system task, the queue section of meeting searching loop primary user queue
Point.In circulating each time, the second task pointed by the corresponding queue nodes of each user in the primary user queue is performed
The system task stored by the first node of queue.The structure of the queue queue of system task is adjusted, by task
Arrangement and processing structure two-stage queue (include primary user queue and second task queue) is changed to by wall scroll queue, effectively
The stand-by period of system task is balanced, the response problem of the system task to different user is optimized, the body of user is improve
Test.
Further, perform the second task team pointed by the corresponding queue nodes of each user in the primary user queue
The system task stored by the first node of row, specifically includes:
It is pre-created primary user queue, the queue nodes and the queue section of each user is characterized in primary user queue
The second task queue that point is pointed to;
The system task is added in its corresponding second task queue;
In circulating each time, the system task stored by the second task queue first node is performed.
In a kind of preferred version of the present embodiment, the primary user queue is pre-created by server, team thereon
Second task queue pointed by row node and the queue nodes is then according to received system task dynamic creation.Should
There is two kinds of implementations, the first in the mode that dynamic is set up:The primary user queue its corresponding length is to determine, if should
Queue less than when, then the task requests instruction in response to user is created pointed by corresponding queue nodes and the queue nodes
Second task queue, otherwise, then the task requests instruction of user can be delayed by response, during wait, until described
Primary user queue less than;Which two is:The primary user queue its corresponding length is not limited, but its dynamic creation
Queue nodes follow certain condition, and for example, primary user queue described in searching loop performs corresponding system task after 1 second,
The user task request instruction in waiting list is received, corresponding system task is created, and is used for storage system task
Second task queue pointed by the queue nodes and the queue nodes of the primary user queue of information.Complete accordingly in establishment
Primary user queue queue nodes and the queue nodes pointed by second task queue after, add corresponding system and appoint
Business.In traversal loop each time, second task queue pointed by the queue nodes of each primary user queue is performed
First node.
For example, in a primary user queue, successively exist and characterize Xiao Zhao, Xiao Zhang, the queue section of three users of stiver
Point A, B, C.In second task queue wherein pointed by queue nodes A have be stored with system task A1, A2, A3, A4 this four
Individual queue nodes, have these three teams of system task B1, B2, B3 that are stored with the second task queue pointed by queue nodes B
Row node, has system task C1, C2 the two queue nodes of being stored with the second task queue pointed by queue nodes C.
Wherein, A1, B1, C1 are the first node of corresponding second task queue respectively.In the queue section for once traveling through primary user queue
Point, performs in the circulation of corresponding system task, successively performs A1, B1, C1, effectively scheduled the corresponding system of each user and appoints
The sequencing of the execution of business, and all system tasks of a user need not have been performed in the system for performing another user
Task, balances the response time of the system request instruction sent by each user, reduces the wait-for-response of certain customers
Time, it is favorably improved the experience of user.
In the queue nodes of searching loop primary user queue again and again, and perform pointed by the queue nodes
During second task queue, need stored in the first node for having performed a second task queue system task it is same
When, the queue nodes of the second task queue corresponding primary user queue are pointed to the next section in the second task queue
Point, using the next node as its under with the first node in circulation, to complete in upper searching loop operation once
Correct tasks carrying operation, it is to avoid because the mistake mapping in queue nodes and second task queue in primary user queue
Relation and cause the error of system.
Further, the first node using the next node in the second task queue as which in subsequent cycle, specifically
Including:
Change the data stored by the queue nodes of the primary user queue corresponding to second task queue;
The queue nodes are pointed to into the next node of the second task queue, to realize that the node is made in the subsequent cycle
For the first node of the second task queue.
In the present embodiment, after the system task stored by the first node for having performed a second task queue, one
Parallel modification program, changes the data stored by the queue nodes of the primary user queue corresponding to second task queue,
Originally the mapping relations of the first node being just performed are pointed to, is changed to point to the next node of the first node.Due to adopting
It is parallel form, the data stored by the queue nodes of the change primary user queue performed by modification program, again
The mapping relations of the node set up in the queue nodes and the second task queue pointed by which of primary user queue, can't shadow
Ring to current step 11, i.e., do not affect the execution of the system task stored by first node in next second task queue.And
And further ensure correct mapping relations, using the next node as second task queue first node, in server
In circulating next time, the execution of system task is effectively scheduled, the response time of the system task of each user is balanced, is kept away
Exempt from that the system task stand-by period is long, cause the experience of user bad.For example, in one cycle, perform primary user queue
In queue nodes E pointed by second task queue first node F, in the second task queue, the next one of first node F
Node is G, then when the system task stored by first node F has been performed, change the mapping of queue nodes E and second task queue
Queue nodes E is pointed to the next node G in second task queue by relation, by changing mapping relations, effectively be scheduled and is
The execution of system task.Additionally, after the system task in a second task queue has been performed, clearly storing the system
The node of task, until all system tasks that all second task queues are stored are performed.
Creation module S102, instructs for the task requests in response to user, the user is positioned in primary user queue
Second task queue, the second task queue tail of the queue create and the task requests corresponding system task of instruction.
Specifically, instruct in response to the task requests of user, the second task of the user is positioned in primary user queue
Queue, specifically includes:
Receive the task requests instruction of the user in a period of time;
Instruct in response to the task requests of user, inquire about the user its corresponding queue nodes in primary user queue;
Position the second task queue pointed by the queue nodes.
In the middle of a kind of preferred version of the present embodiment, user sends task requests to server using intelligent terminal and refers to
Order, to meet the demand of itself.System receives the task requests instruction of the user in a period of time.For example, in 1 second, have
First, second, the third three people have issued task requests instruction L1, L2, L3 respectively.System is received in this 1 second, and first, second, the third three people are sent
Task requests instruction L1, L2, L3 after, instruct in response to the task requests, each characterize in inquiry primary user queue first,
Second, third queue nodes, so as to navigate to first, second, third respective second task queue V1, V2, V3, and by system task L1,
L2, L3 are respectively added to the tail of the queue of second task queue V1, V2, V3, complete the addition of system task.In circulation each time
In, server can perform the system stored by the first node of the second task queue pointed by the queue nodes of primary user queue
Task.
Specifically, inquiring about the user after its corresponding queue nodes, also includes in primary user queue:
When there are the queue nodes that characterize the user in the primary user queue, it is the user in primary user team
Corresponding queue nodes and the second task queue pointed by the queue nodes are created in the tail of the queue of row.
Certainly, when inquiring about queue nodes of the user in primary user queue, it is also possible to which inquiry is less than the user couple
The queue nodes of the primary user queue answered.When a user is not recorded by existing primary user queue, i.e., not in one-level
The queue nodes for characterizing the user are created in Subscriber Queue, need corresponding queue nodes and the queue section to be created to the user
The pointed second task queue of point, and created system task will be instructed according to the task requests of the received user
It is added in second task queue.According to the characteristics of queue, the queue nodes for characterizing a user are created in primary user
The tail of the queue of queue.
Preferably, after all system tasks in a second task queue has been performed, also include:
Delete the second task queue and the queue nodes in the primary user queue corresponding to which.
After the system task stored by a second task queue has been performed, will delete the second task queue with
And the queue nodes in the corresponding primary user queue of the second task queue, contribute to releasing memory, release queue resource, enter
System task of the one step addition in waiting processing state, accelerates the process to system task.
Above a kind of system task dispatching method provided by the present invention and device are described in detail, for ability
The those skilled in the art in domain, according to the thought of the embodiment of the present invention, have change in specific embodiments and applications
Part, in sum, this specification content should not be construed as limiting the invention.
Claims (14)
1. a kind of system task dispatching method, it is characterised in that include:
Searching loop is used for the primary user queue for storing the system task, in circulating every time, performs the primary user team
The system task stored by the first node of the second task queue in row pointed by the corresponding queue nodes of each user, phase
First node that should be using the next node of the second task queue as which in subsequent cycle, to remove the system being performed
System task, until all system tasks for having stored are performed;
In response to user task requests instruct, the second task queue of the user is positioned in primary user queue, this two
The tail of the queue of level task queue is created and the task requests corresponding system task of instruction.
2. system task dispatching method according to claim 1, it is characterised in that the searching loop is used to store described
The step of the step of primary user queue of system task is instructed with the task requests in response to user is parallel.
3. system task dispatching method according to claim 1, it is characterised in that perform each in the primary user queue
The system task stored by the first node of the second task queue pointed by the corresponding queue nodes of user, specifically includes:
The queue nodes and the queue nodes for be pre-created primary user queue, characterizing each user in primary user queue refer to
To second task queue;
The system task is added in its corresponding second task queue;
In circulating each time, the system task stored by the second task queue first node is performed.
4. system task dispatching method according to claim 1, it is characterised in that will be next in the second task queue
First node of the node as which in subsequent cycle, specifically includes:
Change the data stored by the queue nodes of the primary user queue corresponding to second task queue;
The queue nodes are pointed to into the next node of the second task queue, to realize that the node is used as this in the subsequent cycle
The first node of second task queue.
5. system task dispatching method according to claim 1, it is characterised in that refer in response to the task requests of user
Order, positions the second task queue of the user in primary user queue, specifically includes:
Receive the task requests instruction of the user in a period of time;
Instruct in response to the task requests of user, inquire about the user its corresponding queue nodes in primary user queue;
Position the second task queue pointed by the queue nodes.
6. system task dispatching method according to claim 5, it is characterised in that inquire about the user in primary user queue
In after its corresponding queue nodes, also include:
When there are the queue nodes that characterize the user in the primary user queue, it is the user in primary user queue
Corresponding queue nodes and the second task queue pointed by the queue nodes are created in tail of the queue.
7. system task dispatching method according to claim 1, it is characterised in that when having performed a second task queue
In all system tasks after, also include:
Delete the second task queue and the queue nodes in the primary user queue corresponding to which.
8. a kind of device, it is characterised in that include:
Searching loop module, is used for storing the primary user queue of the system task for searching loop, in circulating every time,
The first node for performing the second task queue in the primary user queue pointed by the corresponding queue nodes of each user is stored
The system task, the corresponding first node using the next node of the second task queue as which in subsequent cycle, with clear
Except the system task being performed, until all system tasks for having stored are performed;
Creation module, instructs for the task requests in response to user, and two that the user is positioned in primary user queue are in charge of a grade
Business queue, creates and the task requests corresponding system task of instruction in the tail of the queue of the second task queue.
9. device according to claim 8, it is characterised in that the searching loop module and the creation module are parallel
's.
10. device according to claim 8, it is characterised in that each user is corresponding in performing the primary user queue
The system task stored by the first node of the second task queue pointed by queue nodes, specifically includes:
The queue nodes and the queue nodes for be pre-created primary user queue, characterizing each user in primary user queue refer to
To second task queue;
The system task is added in its corresponding second task queue;
In circulating each time, the system task stored by the second task queue first node is performed.
11. devices according to claim 8, it is characterised in that using the next node in the second task queue as which
First node in subsequent cycle, specifically includes:
Change the data stored by the queue nodes of the primary user queue corresponding to second task queue;
The queue nodes are pointed to into the next node of the second task queue, to realize that the node is used as this in the subsequent cycle
The first node of second task queue.
12. devices according to claim 8, it is characterised in that instruct in response to the task requests of user, in primary user
The second task queue of the user is positioned in queue, is specifically included:
Receive the task requests instruction of the user in a period of time;
Instruct in response to the task requests of user, inquire about the user its corresponding queue nodes in primary user queue;
Position the second task queue pointed by the queue nodes.
13. devices according to claim 12, it is characterised in which is corresponding in primary user queue to inquire about the user
After queue nodes, also include:
When there are the queue nodes that characterize the user in the primary user queue, it is the user in primary user queue
Corresponding queue nodes and the second task queue pointed by the queue nodes are created in tail of the queue.
14. devices according to claim 8, it is characterised in that all systems in a second task queue has been performed
After system task, also include:
Delete the second task queue and the queue nodes in the primary user queue corresponding to which.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610978425.9A CN106528295A (en) | 2016-11-07 | 2016-11-07 | System task scheduling method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610978425.9A CN106528295A (en) | 2016-11-07 | 2016-11-07 | System task scheduling method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN106528295A true CN106528295A (en) | 2017-03-22 |
Family
ID=58349623
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610978425.9A Pending CN106528295A (en) | 2016-11-07 | 2016-11-07 | System task scheduling method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106528295A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111061458A (en) * | 2019-10-10 | 2020-04-24 | 武汉烽火信息集成技术有限公司 | Application creation system with open pipeline architecture |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102110022A (en) * | 2011-03-22 | 2011-06-29 | 上海交通大学 | Sensor network embedded operation system based on priority scheduling |
CN102455934A (en) * | 2010-10-25 | 2012-05-16 | 北大方正集团有限公司 | Workflow scheduling method and device |
CN103019810A (en) * | 2011-09-19 | 2013-04-03 | 辉达公司 | Scheduling and management of compute tasks with different execution priority levels |
CN103414761A (en) * | 2013-07-23 | 2013-11-27 | 北京工业大学 | Mobile terminal cloud resource scheduling method based on Hadoop framework |
US20140215185A1 (en) * | 2013-01-29 | 2014-07-31 | Atmel Norway | Fetching instructions of a loop routine |
CN104079502A (en) * | 2014-06-27 | 2014-10-01 | 国家计算机网络与信息安全管理中心 | Multi-user multi-queue scheduling method |
-
2016
- 2016-11-07 CN CN201610978425.9A patent/CN106528295A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102455934A (en) * | 2010-10-25 | 2012-05-16 | 北大方正集团有限公司 | Workflow scheduling method and device |
CN102110022A (en) * | 2011-03-22 | 2011-06-29 | 上海交通大学 | Sensor network embedded operation system based on priority scheduling |
CN103019810A (en) * | 2011-09-19 | 2013-04-03 | 辉达公司 | Scheduling and management of compute tasks with different execution priority levels |
US20140215185A1 (en) * | 2013-01-29 | 2014-07-31 | Atmel Norway | Fetching instructions of a loop routine |
CN103414761A (en) * | 2013-07-23 | 2013-11-27 | 北京工业大学 | Mobile terminal cloud resource scheduling method based on Hadoop framework |
CN104079502A (en) * | 2014-06-27 | 2014-10-01 | 国家计算机网络与信息安全管理中心 | Multi-user multi-queue scheduling method |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111061458A (en) * | 2019-10-10 | 2020-04-24 | 武汉烽火信息集成技术有限公司 | Application creation system with open pipeline architecture |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8806498B2 (en) | Method and system for resolving dependency among the enqueued works and/or finished works and scheduling the dependency-resolved works | |
CN103207785B (en) | The processing method of data download request, Apparatus and system | |
CN106649630A (en) | Data query method and device | |
CN110535813A (en) | Kernel state protocol stack and User space protocol stack simultaneously deposit treating method and apparatus | |
CN109669768A (en) | A kind of resource allocation and method for scheduling task towards side cloud combination framework | |
CN109547580A (en) | A kind of method and apparatus handling data message | |
CN105511954A (en) | Method and device for message processing | |
CN107798108A (en) | A kind of asynchronous task querying method and equipment | |
CN108063813B (en) | Method and system for parallelizing password service network in cluster environment | |
CN102752198A (en) | Multi-core message forwarding method, multi-core processor and network equipment | |
CN110428124A (en) | Method for allocating tasks, task allocation apparatus, storage medium and computer equipment | |
CN102591726A (en) | Multiprocess communication method | |
CN105282128B (en) | A kind of two-way call method and system based on long connection | |
CN108776897A (en) | Data processing method, device, server and computer readable storage medium | |
CN105045632A (en) | Method and device for implementing lock free queue in multi-core environment | |
CN106503058A (en) | A kind of data load method, terminal and computing cluster | |
CN110020043B (en) | Page crawling method, device, storage medium and processor | |
CN105635083A (en) | Service processing method and service processing system based on server and client architecture | |
WO2022033290A1 (en) | Strong consistency storage system, strong consistency data storage method, server, and medium | |
CN108229771A (en) | Distribute the method and device of order | |
CN107870982A (en) | Data processing method, system and computer-readable recording medium | |
Liu et al. | Formal analysis and verification of DDS in ROS2 | |
CN106487569A (en) | A kind of service message processing method and device | |
CN107666474A (en) | A kind of network message processing method, device and the webserver | |
CN106488055B (en) | Calling list rearrangement method, back end equipment and routing node device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20170322 |
|
RJ01 | Rejection of invention patent application after publication |