CN110471749A - Task processing method, device, computer readable storage medium and computer equipment - Google Patents
Task processing method, device, computer readable storage medium and computer equipment Download PDFInfo
- Publication number
- CN110471749A CN110471749A CN201910629505.7A CN201910629505A CN110471749A CN 110471749 A CN110471749 A CN 110471749A CN 201910629505 A CN201910629505 A CN 201910629505A CN 110471749 A CN110471749 A CN 110471749A
- Authority
- CN
- China
- Prior art keywords
- task
- value
- goal
- stand
- receiving
- 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
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/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4843—Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
- G06F9/4881—Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer And Data Communications (AREA)
- Telephonic Communication Services (AREA)
Abstract
This application involves big datas, a kind of task processing method is provided, device, computer readable storage medium and computer equipment, the described method includes: receiving the goal task that terminal is sent handles request, goal task type is carried in goal task processing request, obtain duty mapping relation table, determine that target corresponding with goal task type presets stand-by value in task mapping table, preset task receiving value is calculated according to the processed in units value that target presets stand-by value and task processing region, obtain the candidate tasks quantity in task queue, when candidate tasks quantity is more than preset task receiving value, goal task corresponding with goal task processing request is placed in task area of isolation, Task Progress message corresponding with goal task is generated in task processing region, Task Progress message is sent to terminal, it can be improved clothes Stability of the business device when carrying out task processing.
Description
Technical field
This application involves field of computer technology, more particularly to a kind of task processing method, device, computer-readable deposit
Storage media and computer equipment.
Background technique
With the high speed development of field of computer technology, server all needs to handle a large amount of various types of tasks daily,
But server also has certain task to accommodate limit in the task of processing, when task quantity to be treated is greater than appointing for server
When business accommodates limit, situations such as server is easy to appear collapse, delay machine.
Traditionally prevent be because of the excessive method for leading to server delay machine of task concurrency using more distributed hosts come
Decentralized processing task does the distribution of task by load-balanced server, but if task concurrent in the short time is excessive, according to
It so will cause the delay machine of each load-balanced server, and each load-balanced server is easy under attack, leads to server
Stability when carrying out task processing is poor.
Summary of the invention
Based on this, it is necessary in view of the above technical problems, provide a kind of task processing method, device, computer equipment and
Storage medium can be improved stability of the server in carry out task processing.
A kind of task processing method, which comprises
It receives the goal task that terminal is sent and handles request, carry goal task class in the goal task processing request
Type;
Duty mapping relation table is obtained, determination is corresponding with the goal task type in the duty mapping relation table
Target presets stand-by value;
Preset task receiving is calculated according to the processed in units value that the target presets stand-by value and task processing region
Value;
The candidate tasks quantity in task queue is obtained, when the candidate tasks quantity is more than the preset task receiving value
When, goal task corresponding with goal task processing request is placed in task area of isolation;
Corresponding with goal task Task Progress message is generated in the task processing region, by the task into
Degree message is sent to the terminal.
In one of the embodiments, the method also includes:
Default stand-by value corresponding with each task type is obtained, according to each task type and the default waiting
Value establishes duty mapping relation table;
Determine that target corresponding with the goal task type presets stand-by value in the duty mapping relation table.
In one of the embodiments, the method also includes:
When the candidate tasks quantity is less than the preset task receiving value, will be requested with goal task processing
Corresponding goal task is placed in the task queue;
The task receiving time for obtaining each task in the task queue, according to the task receiving time to described each
A task is ranked up, and generates task ranking list;
The task in the task queue is sequentially handled according to the task ranking list.
In one of the embodiments, the method also includes:
Goal task corresponding with the goal task, which is obtained, in the task area of isolation stops interval;
It obtains task corresponding with the goal task type and destroys interval, be greater than institute when the goal task stops interval
When stating task destruction interval, the goal task is removed from the task area of isolation.
In one of the embodiments, the method also includes:
Candidate tasks type corresponding with each candidate tasks is obtained, calling is corresponding with the candidate tasks type
Task filter algorithm;
The candidate tasks in the task queue are filtered according to the task filter algorithm, after obtaining filtering
Candidate tasks;
Filtration duty quantity corresponding with the filtered candidate tasks is obtained, when the filtration duty quantity is less than
When the preset task receiving value, corresponding goal task is requested to be placed in the task queue goal task processing
In.
A kind of Task Processing Unit, described device include:
Request receiving module, for receiving the goal task processing request of terminal transmission, the goal task processing request
Middle carrying goal task type;
Relationship determination module, for obtaining duty mapping relation table, in the duty mapping relation table determine with it is described
The corresponding target of goal task type presets stand-by value;
Receiving value computing module, by being preset based on stand-by value and the processed in units value of task processing region according to the target
Calculation obtains preset task receiving value;
Task placement module, for obtaining the candidate tasks quantity in task queue, when the candidate tasks quantity is more than
When the preset task receiving value, goal task corresponding with goal task processing request is placed in task isolated area
Domain;
Message transmission module, for generating Task Progress corresponding with the goal task in the task processing region
The Task Progress message is sent to the terminal by message.
Described device in one of the embodiments, further include:
Relation table establishes module, for obtaining default stand-by value corresponding with each task type, according to described each
Service type and the default stand-by value establish duty mapping relation table;
Stand-by value determining module, for determining corresponding with the goal task type in the duty mapping relation table
Target presets stand-by value.
Described device in one of the embodiments, further include:
Task judgment module will be with institute for when the candidate tasks quantity is less than the preset task receiving value
Stating goal task processing requests corresponding goal task to be placed in the task queue;
List Generating Module, for obtaining the task receiving time of each task in the task queue, according to described
Business receiving time is ranked up each task, generates task ranking list;
Task processing module, for sequentially handling the task in the task queue according to the task ranking list.
A kind of computer equipment can be run on a memory and on a processor including memory, processor and storage
The step of computer program, the processor realizes the above method when executing described program.
A kind of computer readable storage medium, is stored thereon with computer program, realization when which is executed by processor
The step of above method.
Above-mentioned task processing method, device, computer readable storage medium and computer equipment, server is by receiving eventually
The goal task that end is sent handles request, and determines that target presets stand-by value according to goal task type, further according to task processing
The maximum task amount that task processing region is capable of handling during target presets stand-by value is calculated in the processed in units value in region,
That is preset task receiving value needs to handle due to that may have considerable task in the short time in task queue, obtains and appoints
Goal task is sent to and appoints when candidate tasks quantity is more than preset task receiving value by the candidate tasks quantity being engaged in queue
Business processing region, task processing region is the region of carry out task isolation, which can be effectively prevented since task is concurrent
The excessive caused attack to server is measured, the case where further increasing the stability of server, avoid the occurrence of delay machine, and it is in office
It is engaged in sending Task Progress message in processing region to terminal, the progress for enabling to terminal to receive current task processing in time disappears
Breath, server are obtained by calculation the preset task receiving value of server, are to goal task according to the preset task receiving value
No addition queue is further judged and goal task is sent to task processing region to pass through between multiple processing steps
Cooperation, can be improved stability of the server in carry out task processing.
Detailed description of the invention
Fig. 1 is the applied environment figure of task processing method in one embodiment;
Fig. 2 is the flow diagram of task processing method in one embodiment;
Fig. 3 is the flow diagram of task processing method in another embodiment;
Fig. 4 is the flow diagram of task processing method in further embodiment;
Fig. 5 is the structural block diagram of Task Processing Unit in one embodiment;
Fig. 6 is the structural block diagram of computer equipment in one embodiment.
Specific embodiment
It is with reference to the accompanying drawings and embodiments, right in order to which the objects, technical solutions and advantages of the application are more clearly understood
The application is further elaborated.It should be appreciated that specific embodiment described herein is only used to explain the application, not
For limiting the application.
Task processing method provided in the embodiment of the present invention can be applied in application environment as shown in Figure 1, should
Task processing method is applied to task processing system.The task processing system includes terminal 110, server 120.110 He of terminal
Server 120 specifically can be terminal console or mobile terminal by network connection, terminal 110, and mobile terminal specifically can be
At least one of mobile phone, tablet computer, laptop etc..Server 120 can be either multiple with independent server
The server cluster of server composition is realized.
Based on above-mentioned task processing system, server 120 receives the goal task that terminal 110 is sent and handles request, target
Goal task type is carried in task processing request, server 120 obtains duty mapping relation table, and server 120 is reflected in task
It penetrates in relation table and determines that target corresponding with goal task type presets stand-by value, server 120 presets stand-by value according to target
Preset task receiving value is calculated with the processed in units value of task processing region, server 120 obtains the time in task queue
Business quantity is selected for a post, when candidate tasks quantity is more than preset task receiving value, server 120 will be with goal task processing request pair
The goal task answered is placed in task area of isolation, and server 120 generates corresponding with goal task in task processing region
Task Progress message is sent to terminal 110 by Task Progress message, server 120.
In one embodiment, as shown in Fig. 2, providing a kind of task processing method.The present embodiment is mainly in this way
It is illustrated applied to the server 120 in above-mentioned Fig. 1.Referring to Fig. 2, which specifically comprises the following steps:
S202 receives the goal task that terminal is sent and handles request, carries goal task class in goal task processing request
Type.
Wherein, goal task processing request refers to the request of terminal request server process goal task, goal task class
Type refers to the type of goal task corresponding with goal task processing request.In one embodiment, goal task type includes
But it is not limited to data processing generic task, data parsing generic task, data and generates generic task etc., data processing generic task refers to clothes
Business device handles the information carried in request according to goal task and carries out corresponding data processing, and data parsing generic task refers to service
Device handles the information carried in request according to goal task and carries out corresponding data parsing, such as audio parsing, video parsing etc..
Data generate generic task and refer to that server handles the information carried in request according to goal task and generates corresponding data.
S204 obtains duty mapping relation table, and mesh corresponding with goal task type is determined in task mapping table
Mark default stand-by value.
Wherein, duty mapping relation table refers to the mapping relations of each task type Yu default stand-by value, each task class
Type corresponds to identical or different default stand-by value, it is to be understood that there are at least one tasks in duty mapping relation table
Type, thus in task mapping table default stand-by value corresponding with task type be at least one, duty mapping relationship
Table obtains corresponding target according to goal task type for server and presets stand-by value.Default stand-by value refers to pre-set
For the duration information that task type user can wait, target presets stand-by value and refers to server according to goal task type
The duration information that determining user can wait.
In one embodiment, duty mapping relation table, which can be, is stored in advance to terminal, is also possible to server reception
When the goal task that terminal is sent handles request, the duty mapping relation table obtained in real time from terminal, server is in duty mapping
Determine that target corresponding with goal task type presets stand-by value in relation table.
In one embodiment, target presets stand-by value and can be customized by terminal and be sent to server, server according to
Goal task type and target preset stand-by value and establish mapping table, it is to be understood that target presets stand-by value can also be with
By the default stand-by value corresponding with the goal task type of server retrospect history, using the default stand-by value of the history as mesh
Mark default stand-by value.
In one embodiment, when mesh corresponding with goal task type can not be directly determined in task mapping table
When marking default stand-by value, server will generate default stand-by value corresponding with goal task type and request, and by default stand-by value
Request is sent to terminal, so that terminal is sent according to the request of default stand-by value, target corresponding with goal task type is default to be waited
Value, it is to be understood that default stand-by value request obtains the target that terminal is sent for server and presets stand-by value, by real-time
The targets of acquisition terminal definitions preset stand-by value, server during this period of time pre- further can accurately be calculated
It is accurate due to preset task receiving value if task receiving value, so that whether server by goal task to being placed in and appoint
The judgement of business area of isolation is more accurate, improves accuracy of the server in carry out task processing.
Preset task receiving is calculated according to the processed in units value that target presets stand-by value and task processing region in S206
Value.
Wherein, preset task receiving value refers to the quantity for being capable of handling task during target presets stand-by value in server
Information.Task processing region refers to that, for carrying out the region of task processing in server, processed in units value refers to server in list
The task quantity information of each type is capable of handling in the time of position, server presets stand-by value and task processing region according to target
Processed in units value preset task receiving value is calculated.
In one embodiment, server is in the processed in units value meter for presetting stand-by value and task processing region according to target
When calculation obtains preset task receiving value, target can be preset stand-by value by server and processed in units value is converted to identical metering list
Position.For example, for example, when the processed in units value of the task processing region in server be each second handle 500 tasks when,
When the default stand-by value of the target that user can wait is 5 minutes, processed in units value and target further can be preset into stand-by value and turned
It is changed to identical measurement unit, it can it is that preset stand-by value be 300 seconds to the target that can wait of user, server root in this example
Preset stand-by value according to target and processed in units value the preset task receiving value of task processing region is calculated is 150000.
Specifically, server is calculated default according to the processed in units value that target presets stand-by value and task processing region
Task receiving value, traditionally server usually obtains the task in current time server when excessive in face of task concurrency
The task receiving value of processing region abandons task if task processing region has reached maximum, but in the method sufficiently
Consider the duration information that user can wait, i.e. target presets stand-by value, and server is preset at stand-by value and task by target
Preset task receiving value is calculated in the processed in units value in reason region, further judges whether the goal task should be placed in and appoints
It is engaged in processing region, enables server more orderly when carrying out task processing, when improving server progress task processing
Stability.
S208 obtains the candidate tasks quantity in task queue, when candidate tasks quantity is more than preset task receiving value,
Goal task corresponding with goal task processing request is placed in task area of isolation.
Wherein, task queue refers to queuing message composed by the medium task to be processed of task processing region, and candidate appoints
Business quantity refers to the quantity of the waiting task in task queue, and candidate tasks are to be processed in task processing region
Business, task area of isolation are present in server, for appointing target when candidate tasks quantity is more than candidate tasks receiving value
Business be placed in the area of isolation, which is the area of isolation in server, can when task concurrency is excessive,
It effectively prevents the attack information to server and prevents the collapse of server, delay machine, improve server at the task of progress
Stability when reason.
Specifically, server obtains the candidate tasks quantity in task queue, when candidate tasks quantity is more than preset task
When receiving value, i.e., the waiting task in current task queue has reached task processing within default this period of stand-by value
To greatest extent, goal task corresponding with goal task processing request is placed in task area of isolation by server in region.
In one embodiment, can effectively to resist concurrency attack, server delay machine is prevented, is appointed when there is high concurrent
When business request, beyond server can received task requests connection amount when, can the big data of storage section request amount, and be arranged
The expired time of second unit, the specific time sets according to business scenario, with the pressure for reducing data server.Further
Ground, it is not high for updating frequency in the indeclinable situation of high concurrent request data, and data allow prolonging in the short time
It late, can be by the way that data inactivityization effectively to be resisted to concurrency attack, it is to be understood that data inactivity refers to dynamic
Page static.
In one embodiment, when occurring a large amount of same requests in a certain period of time, the mode of queue, team can be used
Column play the role of cutting down peak flow.Specifically, it by building queue server, before being set to server, bears a large amount of
Number of request, then qualified preceding how many requests are sent to server, it can also can guarantee service when task amount is excessive
The stability of device prevents server delay machine.Further, it for updating the not high data of frequency, data cached can arrive locally,
Then when each request interface upload current cache data version number, server-side receive version number judge version number and
Whether latest data version number is consistent, and the inquiry of latest data is carried out if inconsistent and returns to latest data and latest edition
Number, if be equally returned to status code inform data be it is newest, server stress, resource and band can be further decreased
It is wide.
S210 generates Task Progress message corresponding with goal task, by Task Progress message in task processing region
It is sent to terminal.
Wherein, Task Progress message is the message for characterizing goal task progress, and Task Progress message includes but unlimited
Message and task refuse information are received in task.In one embodiment, when the candidate tasks quantity in task queue is more than pre-
If when task receiving value, Task Progress message is task refuse information, which is sent to terminal by server, is appointed
Business refuse information can be the prompting frame message including " please trying again later ".In one embodiment, when the time in task queue
Business quantity is selected for a post when being less than preset task receiving value, Task Progress message is that task receives message, and task receives message can be with
It is the prompting frame message for including " being successfully accessed ".
Specifically, server generates corresponding with goal task Task Progress message in task processing region, and by task
Progress message is sent to terminal, enables to terminal to understand the progress message of current task in real time, no matter task is successfully accessed
Or task access failure can receive corresponding Task Progress message.In one embodiment, terminal receives server and sends
Task Progress message, and show the Task Progress message, when Task Progress message is task refuse information, can be refused in task
Request control is retransmitted in insertion in exhausted message, and terminal requests control by triggering the repeating transmission in task refuse information, again to clothes
Business device sends goal task processing request, and server will handle according to the goal task and request further judge candidate tasks quantity
Whether be more than task processing region preset task receiving value.
In the present embodiment, server handles request by receiving the goal task that terminal is sent, and according to goal task class
Type determines that target presets stand-by value, and task processing region is calculated in target further according to the processed in units value of task processing region
The maximum task amount being capable of handling during default stand-by value, i.e. preset task receiving value, due to can in task queue in the short time
Can there can be considerable task to need to handle, therefore obtain the candidate tasks quantity in task queue, when candidate tasks quantity is more than
When preset task receiving value, goal task is sent to task processing region, task processing region is the area of carry out task isolation
Domain, the region can be effectively prevented due to task concurrency it is excessive caused by attack to server, further increase service
The stability of device, the case where avoiding the occurrence of delay machine, and Task Progress message is sent to terminal in task processing region, it can make
The progress message that terminal receives current task processing in time is obtained, the preset task that server is obtained by calculation in server accommodates
Value is further judged to whether goal task is added queue according to the preset task receiving value and is sent out goal task
It send to task processing region through the cooperation between multiple processing steps, can be improved stabilization of the server in carry out task processing
Property.
In one embodiment, step 204 includes: to obtain default stand-by value corresponding with each task type, according to each
A task type and default stand-by value establish mapping table, and determination is corresponding with goal task type in task mapping table
Target preset stand-by value.
Wherein, default stand-by value refers to the pre-set duration information that can be waited for task type user, appoints
Business mapping table refers to the mapping relations of task type Yu default stand-by value, and each task type corresponds to identical or different
Default stand-by value.
Specifically, server can obtain default stand-by value corresponding with each task type from terminal, can also be from other clothes
It is engaged in obtaining default stand-by value corresponding with each task type in device, and is established and appointed according to each task type and default stand-by value
It is engaged in mapping table, it is to be understood that each task type and default stand-by value are to correspond.In one embodiment,
Server stores duty mapping relation table to local, when the goal task that server receiving terminal is sent handles request, leads to
It crosses and obtains the default stand-by value of the determining target corresponding with goal task type of the duty mapping relation table.
In the present embodiment, server, can by the mapping table established between each task type and default stand-by value
It is convenient and accurately determine target corresponding with goal task type preset stand-by value, due to target with presetting stand-by value accuracy
It improves, accurate preset task receiving value can be further calculated out, so that server is according to the preset task receiving value to being
The judgement of no access goal task is more accurate, so as to improve stability of the server when carrying out task processing.
In one embodiment, as shown in figure 3, this method further include:
It is corresponding will to handle request with goal task when candidate tasks quantity is less than preset task receiving value by S302
Goal task is placed in task queue.
S304 obtains the task receiving time of each task in task queue, according to task receiving time to each task
It is ranked up, generates task ranking list.
Specifically, task receiving time refers to server corresponding temporal information, task when receiving each task requests
Sorted lists refer to the list information obtained after server is ranked up each task according to task receiving time, it is possible to understand that
, server is ranked up including but not limited to progress ascending sort to each task according to task receiving time and descending is arranged
Sequence, server generate task ranking list according to task receiving time.
S306 sequentially handles the task in task queue according to task ranking list.
Wherein, when candidate tasks quantity is less than preset task receiving value, server will be requested with goal task processing
Corresponding goal task is placed in task queue, and obtains the task receiving time of each task in task queue, according to appoint
Business receiving time is ranked up each task, generates task ranking list, and server is sequentially located according to the task ranking list
Manage task queue in task, ensure that the sequentially execution of all tasks, enable to server for task processing more
Orderly.
In the present embodiment, when candidate tasks quantity is less than preset task receiving value, server will at goal task
Reason requests corresponding goal task to be placed in task queue, and obtains the task receiving time of each task in task queue,
Further each task is ranked up according to task receiving time, task ranking list is generated, further according to task ranking list
The task in task queue is sequentially handled, server is enabled to handle according to certain sequence task, when task is submitted
When can be inserted into task queue in order, when execution, takes out task from queue head or tail portion and is handled, and enables to server
It is more orderly for the processing of task.
In one embodiment, this method further include: obtain target corresponding with goal task in task area of isolation and appoint
Business stops interval, obtains task corresponding with goal task type and destroys interval, is greater than task pin when goal task stops interval
When ruining interval, goal task is removed from task area of isolation.
Wherein, goal task, which stops to be spaced, refers to that goal task is placed in the residence time of task area of isolation by server
Information, task destroy interval refer to reach certain time interval after server will meet the task pin in task area of isolation automatically
The goal task for ruining interval is removed, and task area of isolation is enabled to have enough receiving limits to go to receive when candidate tasks number
Amount corresponding goal task when being more than preset task receiving value.
In one embodiment, when goal task can be placed in task area of isolation by server, it is fixed that starting task is destroyed
When device, if being more than that the task destroys temporal information defined in timer, server is by the goal task from task area of isolation
Middle removal.
In the present embodiment, server obtains goal task corresponding with goal task in task area of isolation and stops interval,
And obtain task corresponding with goal task type and destroy interval, when goal task stop interval, which is greater than task, destroys interval,
Goal task is removed from task area of isolation, server stress, resource and bandwidth can be further decreased.
In one embodiment, as shown in figure 4, step 208 further include:
S208A obtains candidate tasks type corresponding with each candidate tasks, calls corresponding with candidate tasks type
Business filter algorithm.
S208B is filtered the candidate tasks in task queue according to task filter algorithm, obtains filtered candidate
Task.
Wherein, task processing item is unsatisfactory for due to that there may be part candidate tasks in the candidate tasks in task queue
Part, therefore server obtains candidate tasks type corresponding with each candidate tasks, and calls corresponding with candidate tasks type
Task filter algorithm is filtered candidate tasks, it is to be understood that candidate tasks type includes but is not limited to data processing
Generic task, data parsing generic task, data generate generic task etc..Task filter algorithm refers to for appointing in task queue
The algorithm that business is filtered, task filter algorithm includes filtering information corresponding with each task type, mistake in the task queue
Filter information can be user account information, network safety information etc..
Specifically, server is filtered the candidate tasks in task queue according to task filter algorithm, is filtered
Candidate tasks afterwards, filtered candidate tasks refer to that server will be remaining after the task filtering for being unsatisfactory for task filter algorithm
Candidate tasks.For example, being the next morning nine at the beginning of configuration when administrative staff are configured with a score inquiry page
Point, name specified number are 2000 people.To second day 9 points, owner one gathers around and enters, have 5000 people while coming in inquire achievement,
If directly accessing server, system may be allowed to can't stand so high concurrent direct server crash delay machine, but task
Filter algorithm can be filtered this 5000 people, collect their information, then server will handle it is qualified before
The request of 2000 people, to have the function that cut down concurrent peak and screening.
S208C obtains corresponding with filtered candidate tasks filtration duty quantity, when filter number of tasks amount be less than it is pre-
If when task receiving value, requesting corresponding goal task to be placed in task queue goal task processing.
Specifically, filtration duty quantity refers to the quantity letter of the remaining candidate tasks after task filter algorithm filters
Goal task processing is requested corresponding goal task to be put by breath when filtering number of tasks amount is less than preset task receiving value
It is placed in task queue, server further will handle corresponding task according to the task queue.
In the present embodiment, server further discharges task by being unsatisfactory for condition of the task in filtration duty queue
Pressure, resource and the bandwidth of queue judge whether filtration duty quantity is more than preset task receiving value again, when filtering number of tasks
When amount is less than preset task receiving value, corresponding goal task is requested to be placed in task queue goal task processing, from
And have the function that cut down concurrent peak and screening.
As shown in figure 5, for the schematic diagram of the Task Processing Unit in an embodiment, which includes:
Request receiving module 402, for receiving the goal task processing request of terminal transmission, goal task is handled in request
Carry goal task type;
Relationship determination module 404, it is determining in task mapping table to appoint with target for obtaining duty mapping relation table
The corresponding target of service type presets stand-by value;
Receiving value computing module 406, based on the processed in units value for presetting stand-by value and task processing region according to target
Calculation obtains preset task receiving value;
Task placement module 408, for obtaining the candidate tasks quantity in task queue, when candidate tasks quantity is more than pre-
If when task receiving value, goal task corresponding with goal task processing request is placed in task area of isolation;
Message transmission module 410, for generating Task Progress message corresponding with goal task in task processing region,
Task Progress message is sent to terminal.
In one embodiment, device further include: relation table establishes module, corresponding with each task type for obtaining
Default stand-by value, duty mapping relation table is established according to each task type and default stand-by value, stand-by value determining module is used
Stand-by value is preset in target corresponding with goal task type determining in task mapping table.
In one embodiment, the device further include: task judgment module, for when candidate tasks quantity be less than it is default
When task receiving value, goal task corresponding with goal task processing request is placed in task queue;List Generating Module,
For obtaining the task receiving time of each task in task queue, each task is ranked up according to task receiving time,
Generate task ranking list;Task processing module, for sequentially handling the task in task queue according to task ranking list.
In one embodiment, device further include: obtain target corresponding with goal task in task area of isolation and appoint
Business stops interval;It obtains task corresponding with goal task type and destroys interval, be greater than task pin when goal task stops interval
When ruining interval, goal task is removed from task area of isolation.
In one embodiment, task placement module is used to obtain candidate tasks type corresponding with each candidate tasks,
Call corresponding with candidate tasks type task filter algorithm, according to task filter algorithm to the candidate tasks in task queue into
Row filtering, obtains filtered candidate tasks, obtains filtration duty quantity corresponding with filtered candidate tasks, when filtering is appointed
When business quantity is less than preset task receiving value, corresponding goal task is requested to be placed in task queue goal task processing
In.
Specific about Task Processing Unit limits the restriction that may refer to above for task processing method, herein not
It repeats again.Modules in above-mentioned Task Processing Unit can be realized fully or partially through software, hardware and combinations thereof.On
Stating each module can be embedded in the form of hardware or independently of in the processor in computer equipment, can also store in a software form
In memory in computer equipment, the corresponding operation of the above modules is executed in order to which processor calls.The processor
It can be central processing unit (CPU), microprocessor, single-chip microcontroller etc..Above-mentioned Task Processing Unit can be implemented as a kind of calculating
The form of machine program.
In one embodiment, a kind of computer equipment is provided, which can be server, be also possible to
Terminal.When the computer equipment is server, internal structure chart can be as shown in Figure 6.When the computer equipment is terminal
When, internal structure includes display screen, input unit, camera, voice collection device and loudspeaker etc..The computer equipment packet
Include processor, memory and the network interface connected by system bus.Wherein, the processor of the computer equipment is for providing
Calculating and control ability.The memory of the computer equipment includes non-volatile memory medium, built-in storage.This is non-volatile to deposit
Storage media is stored with operating system and computer program.The built-in storage is operating system and meter in non-volatile memory medium
The operation of calculation machine program provides environment.The network interface of the computer equipment is used for logical by network connection with external terminal
Letter.To realize a kind of task processing method when the computer program is executed by processor.It will be understood by those skilled in the art that figure
Structure shown in 6, only the block diagram of part-structure relevant to application scheme, does not constitute and is answered application scheme
With the restriction of computer equipment thereon, specific computer equipment may include than more or fewer portions as shown in the figure
Part perhaps combines certain components or with different component layouts.
Wherein, it is performed the steps of when processor executes program and receives the goal task processing request that terminal is sent, target
Goal task type is carried in task processing request, obtains duty mapping relation table, the determining and mesh in task mapping table
It marks the corresponding target of task type and presets stand-by value, the processed in units value meter of stand-by value and task processing region is preset according to target
Calculation obtains preset task receiving value, obtains the candidate tasks quantity in task queue, when candidate tasks quantity is more than preset task
When receiving value, goal task corresponding with goal task processing request is placed in task area of isolation, in task processing region
It is middle to generate Task Progress message corresponding with goal task, Task Progress message is sent to terminal.
The above-mentioned restriction for computer equipment may refer to the specific restriction above for task processing method, herein
It repeats no more.
Please continue to refer to Fig. 6, a kind of computer readable storage medium is also provided, is stored thereon with computer program, such as Fig. 6
Shown in non-volatile memory medium, wherein the program performed the steps of when being executed by processor receive terminal send
Goal task processing request, goal task, which is handled, carries goal task type in request, duty mapping relation table is obtained, in task
Determine that target corresponding with goal task type presets stand-by value, presets at stand-by value and task according to target in mapping table
Preset task receiving value is calculated in the processed in units value in reason region, obtains the candidate tasks quantity in task queue, works as candidate
When task quantity is more than preset task receiving value, goal task corresponding with goal task processing request is placed in task isolation
Region generates Task Progress message corresponding with goal task in task processing region, Task Progress message is sent to end
End.
The above-mentioned restriction for computer readable storage medium may refer to above for the specific of task processing method
It limits, details are not described herein.
Those of ordinary skill in the art will appreciate that realizing all or part of the process in above-described embodiment method, being can be with
Relevant hardware is instructed to complete by computer program, the program can be stored in a non-volatile computer and can be read
In storage medium, the program is when being executed, it may include such as the process of the embodiment of above-mentioned each method.Wherein, the storage is situated between
Matter can be magnetic disk, CD, read-only memory (Read-OnlyMemory, ROM) etc..
Each technical characteristic of embodiment described above can be combined arbitrarily, for simplicity of description, not to above-mentioned reality
It applies all possible combination of each technical characteristic in example to be all described, as long as however, the combination of these technical characteristics is not deposited
In contradiction, all should be considered as described in this specification.
The embodiments described above only express several embodiments of the present invention, and the description thereof is more specific and detailed, but simultaneously
It cannot therefore be construed as limiting the scope of the patent.It should be pointed out that coming for those of ordinary skill in the art
It says, without departing from the inventive concept of the premise, various modifications and improvements can be made, these belong to protection of the invention
Range.Therefore, the scope of protection of the patent of the invention shall be subject to the appended claims.
Claims (10)
1. a kind of task processing method, which comprises
It receives the goal task that terminal is sent and handles request, carry goal task type in the goal task processing request;
Duty mapping relation table is obtained, target corresponding with the goal task type is determined in the duty mapping relation table
Default stand-by value;
Preset task receiving value is calculated according to the processed in units value that the target presets stand-by value and task processing region;
The candidate tasks quantity in task queue is obtained, when the candidate tasks quantity is more than the preset task receiving value,
Goal task corresponding with goal task processing request is placed in task area of isolation;
Task Progress message corresponding with the goal task is generated in the task processing region, and the Task Progress is disappeared
Breath is sent to the terminal.
2. the method according to claim 1, wherein the acquisition duty mapping relation table, reflects in the task
It penetrates in relation table and determines that target corresponding with the goal task type presets stand-by value, comprising:
Default stand-by value corresponding with each task type is obtained, is built according to each task type and the default stand-by value
Vertical duty mapping relation table;
Determine that target corresponding with the goal task type presets stand-by value in the duty mapping relation table.
3. the method according to claim 1, wherein the method also includes:
When the candidate tasks quantity is less than the preset task receiving value, it is corresponding request will to be handled with the goal task
Goal task be placed in the task queue;
The task receiving time for obtaining each task in the task queue, according to the task receiving time to described each
Business is ranked up, and generates task ranking list;
The task in the task queue is sequentially handled according to the task ranking list.
4. the method according to claim 1, wherein the method also includes:
Goal task corresponding with the goal task, which is obtained, in the task area of isolation stops interval;
It obtains task corresponding with the goal task type and destroys interval, be greater than described appoint when the goal task stops interval
When interval is destroyed in business, the goal task is removed from the task area of isolation.
5. the method according to claim 1, wherein it is described obtain task queue in candidate tasks quantity, when
When the candidate tasks quantity is more than the preset task receiving value, target corresponding with goal task processing request is appointed
Business is placed in task area of isolation, comprising:
Obtain candidate tasks type corresponding with each candidate tasks, calling task corresponding with the candidate tasks type
Filter algorithm;
The candidate tasks in the task queue are filtered according to the task filter algorithm, obtain filtered time
Select for a post business;
Obtain filtration duty quantity corresponding with the filtered candidate tasks, be less than when the filtration duty quantity described in
When preset task receiving value, corresponding goal task is requested to be placed in the task queue goal task processing.
6. a kind of Task Processing Unit, which is characterized in that described device includes:
Request receiving module is taken in the goal task processing request for receiving the goal task processing request of terminal transmission
Band goal task type;
Relationship determination module, for obtaining duty mapping relation table, the determining and target in the duty mapping relation table
The corresponding target of task type presets stand-by value;
Receiving value computing module, the processed in units value for presetting stand-by value and task processing region according to the target calculate
To preset task receiving value;
Task placement module, for obtaining the candidate tasks quantity in task queue, when the candidate tasks quantity is more than described
When preset task receiving value, goal task corresponding with goal task processing request is placed in task area of isolation;
Message transmission module disappears for generating Task Progress corresponding with the goal task in the task processing region
Breath, is sent to the terminal for the Task Progress message.
7. device according to claim 6, which is characterized in that the relationship determination module includes:
Relation table establishes module, for obtaining default stand-by value corresponding with each task type, according to each task class
Type and the default stand-by value establish duty mapping relation table;
Stand-by value determining module, for determining target corresponding with the goal task type in the duty mapping relation table
Default stand-by value.
8. device according to claim 6, which is characterized in that described device includes:
Task judgment module will be with the mesh for when the candidate tasks quantity is less than the preset task receiving value
The processing of mark task requests corresponding goal task to be placed in the task queue;
List Generating Module connects for obtaining the task receiving time of each task in the task queue according to the task
Each task is ranked up between time receiving, generates task ranking list;
Task processing module, for sequentially handling the task in the task queue according to the task ranking list.
9. a kind of computer readable storage medium, be stored with computer program makes when the computer program is executed by processor
The processor is obtained to execute such as the step of any one of claims 1 to 5 the method.
10. a kind of computer equipment, including memory and processor, the memory is stored with computer program, the calculating
When machine program is executed by the processor, so that the processor executes the step such as any one of claims 1 to 5 the method
Suddenly.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910629505.7A CN110471749B (en) | 2019-07-12 | 2019-07-12 | Task processing method, device, computer readable storage medium and computer equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910629505.7A CN110471749B (en) | 2019-07-12 | 2019-07-12 | Task processing method, device, computer readable storage medium and computer equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110471749A true CN110471749A (en) | 2019-11-19 |
CN110471749B CN110471749B (en) | 2023-04-25 |
Family
ID=68508463
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910629505.7A Active CN110471749B (en) | 2019-07-12 | 2019-07-12 | Task processing method, device, computer readable storage medium and computer equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110471749B (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111160831A (en) * | 2019-12-26 | 2020-05-15 | 北京旷视机器人技术有限公司 | Intensive storage task generation method and device and electronic equipment |
CN111158843A (en) * | 2020-01-02 | 2020-05-15 | 广州虎牙科技有限公司 | Panel control method and device, electronic equipment and storage medium |
CN111221789A (en) * | 2019-12-27 | 2020-06-02 | 中国人民财产保险股份有限公司深圳市分公司 | Processing method and device for querying big data by group users |
CN112486644A (en) * | 2020-11-27 | 2021-03-12 | 北京百度网讯科技有限公司 | Method, apparatus, device and storage medium for generating information |
CN113344375A (en) * | 2021-06-01 | 2021-09-03 | 北京十一贝科技有限公司 | Task management method, device, electronic equipment and medium in insurance service process |
CN113780812A (en) * | 2021-09-13 | 2021-12-10 | 深圳一信泰质量技术有限公司 | Management method, device, equipment and storage medium for product test |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105577772A (en) * | 2015-12-17 | 2016-05-11 | 腾讯科技(北京)有限公司 | Material receiving method, material uploading method and device |
CN106412091A (en) * | 2016-10-25 | 2017-02-15 | 广东欧珀移动通信有限公司 | Method, device and system for controlling data transmission |
US20170109203A1 (en) * | 2015-10-15 | 2017-04-20 | International Business Machines Corporation | Task scheduling |
US20190068751A1 (en) * | 2017-08-25 | 2019-02-28 | International Business Machines Corporation | Server request management |
CN109872036A (en) * | 2019-01-10 | 2019-06-11 | 平安科技(深圳)有限公司 | Method for allocating tasks, device and computer equipment based on sorting algorithm |
-
2019
- 2019-07-12 CN CN201910629505.7A patent/CN110471749B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20170109203A1 (en) * | 2015-10-15 | 2017-04-20 | International Business Machines Corporation | Task scheduling |
CN105577772A (en) * | 2015-12-17 | 2016-05-11 | 腾讯科技(北京)有限公司 | Material receiving method, material uploading method and device |
CN106412091A (en) * | 2016-10-25 | 2017-02-15 | 广东欧珀移动通信有限公司 | Method, device and system for controlling data transmission |
WO2018076861A1 (en) * | 2016-10-25 | 2018-05-03 | 广东欧珀移动通信有限公司 | Data transmission control method, apparatus, storage medium, server and system |
US20190068751A1 (en) * | 2017-08-25 | 2019-02-28 | International Business Machines Corporation | Server request management |
CN109872036A (en) * | 2019-01-10 | 2019-06-11 | 平安科技(深圳)有限公司 | Method for allocating tasks, device and computer equipment based on sorting algorithm |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111160831A (en) * | 2019-12-26 | 2020-05-15 | 北京旷视机器人技术有限公司 | Intensive storage task generation method and device and electronic equipment |
CN111160831B (en) * | 2019-12-26 | 2024-01-23 | 北京旷视机器人技术有限公司 | Task generation method and device for intensive warehouse and electronic equipment |
CN111221789A (en) * | 2019-12-27 | 2020-06-02 | 中国人民财产保险股份有限公司深圳市分公司 | Processing method and device for querying big data by group users |
CN111221789B (en) * | 2019-12-27 | 2023-09-12 | 中国人民财产保险股份有限公司深圳市分公司 | Method and device for processing big data of group user query |
CN111158843A (en) * | 2020-01-02 | 2020-05-15 | 广州虎牙科技有限公司 | Panel control method and device, electronic equipment and storage medium |
CN112486644A (en) * | 2020-11-27 | 2021-03-12 | 北京百度网讯科技有限公司 | Method, apparatus, device and storage medium for generating information |
CN113344375A (en) * | 2021-06-01 | 2021-09-03 | 北京十一贝科技有限公司 | Task management method, device, electronic equipment and medium in insurance service process |
CN113780812A (en) * | 2021-09-13 | 2021-12-10 | 深圳一信泰质量技术有限公司 | Management method, device, equipment and storage medium for product test |
Also Published As
Publication number | Publication date |
---|---|
CN110471749B (en) | 2023-04-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110471749A (en) | Task processing method, device, computer readable storage medium and computer equipment | |
CN108494703B (en) | Access frequency control method, device and storage medium | |
US8719297B2 (en) | System for managing data collection processes | |
CN109104336A (en) | Service request processing method, device, computer equipment and storage medium | |
CN111263409B (en) | Method, system and related equipment for providing metadata information of network function service | |
US10063601B2 (en) | Client identification for enforcing computer resource quotas | |
US10277529B2 (en) | Visualization of computer resource quotas | |
JP2002324047A (en) | Method and system for automated session resources cleanup in distributed client/server environment | |
CN112016030B (en) | Message pushing method, device, server and computer storage medium | |
US20170272541A1 (en) | Local enforcement of computer resource quotas | |
CN106649856A (en) | Database access device, system and method | |
US20070265976A1 (en) | License distribution in a packet data network | |
JP3487425B2 (en) | Congestion control method and method | |
CN109981715A (en) | A kind of method and device of session management | |
CN111176577B (en) | Distributed block storage service command processing method, device, equipment and medium | |
CN110311963B (en) | Message pushing method and device, computer equipment and computer readable storage medium | |
CN111737027A (en) | Lookup processing method, system, terminal and storage medium of distributed storage system | |
CN113037851B (en) | Method for cloud mobile phone system super-resolution based on storage implementation | |
CN114048033A (en) | Load balancing method and device for batch running task and computer equipment | |
CN115694699A (en) | Time delay parameter acquisition method and device, electronic equipment and storage medium | |
CN110046319B (en) | Social media information acquisition method, device, system, equipment and storage medium | |
CN112286930A (en) | Method, device, storage medium and electronic equipment for resource sharing of redis business side | |
CN110401708B (en) | Session processing system and method based on server load state | |
CN111143177B (en) | Method, system, device and storage medium for collecting RMF III data of IBM host | |
CN111193760B (en) | Information sending method, device and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |