CN110458468A - A kind of task processing method, device, electronic equipment and storage medium - Google Patents

A kind of task processing method, device, electronic equipment and storage medium Download PDF

Info

Publication number
CN110458468A
CN110458468A CN201910762893.6A CN201910762893A CN110458468A CN 110458468 A CN110458468 A CN 110458468A CN 201910762893 A CN201910762893 A CN 201910762893A CN 110458468 A CN110458468 A CN 110458468A
Authority
CN
China
Prior art keywords
subtask
processed
node server
task
calculate 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
Application number
CN201910762893.6A
Other languages
Chinese (zh)
Inventor
刘振兴
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN201910762893.6A priority Critical patent/CN110458468A/en
Publication of CN110458468A publication Critical patent/CN110458468A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation 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/5038Allocation 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/06Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
    • G06Q10/063Operations research, analysis or management
    • G06Q10/0631Resource planning, allocation, distributing or scheduling for enterprises or organisations
    • G06Q10/06311Scheduling, planning or task assignment for a person or group
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/08Logistics, e.g. warehousing, loading or distribution; Inventory or stock management
    • G06Q10/083Shipping

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Human Resources & Organizations (AREA)
  • Economics (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Strategic Management (AREA)
  • General Physics & Mathematics (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Operations Research (AREA)
  • Development Economics (AREA)
  • Marketing (AREA)
  • Software Systems (AREA)
  • Quality & Reliability (AREA)
  • Tourism & Hospitality (AREA)
  • General Business, Economics & Management (AREA)
  • Educational Administration (AREA)
  • Game Theory and Decision Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer And Data Communications (AREA)

Abstract

This application discloses a kind of task processing method, device, electronic equipment and storage mediums, are related to field of cloud computer technology.Specific implementation are as follows: determine the corresponding multiple subtasks to be processed of waiting task, obtain the query rate per second for the corresponding service providing server of external service for needing to request when executing subtask to be processed;It is that each calculate node server distributes subtask to be processed based on query rate per second;Wherein the quantity summation for the subtask to be processed of each calculate node server distribution is no more than query rate per second;Role assignment message is sent to each calculate node server respectively according to the subtask to be processed distributed for each calculate node server, so that each calculate node server executes corresponding subtask to be processed according to received task assignment messages, by access service providing server.The technical solution of the application reduces the number of task processing failure, reduces task and distributes the time cost of investment repeatedly, and then improves task treatment effeciency.

Description

A kind of task processing method, device, electronic equipment and storage medium
Technical field
This application involves technical field of data processing more particularly to field of cloud computer technology.
Background technique
Cloud service system is exactly the system platform constructed using cloud computing technology and thought, by providing based on data The service such as calculation and data storage.
When providing service using cloud service system, cloud service system can receive waiting task, and by be processed Business is distributed to corresponding service providing server.Since service providing server is limited in the ability of same time-triggered protocol task, So the case where going out current task processing failure often.
For example, intelligent logistics system (Intelligent Logistics System, ILS) is drawn with Baidu map It holds up with based on geographical big data, grinds Intelligent logistics cloud service system of the dispatching algorithm as core certainly using high performance, be a variety of The worksheet processing winding displacement for transporting scene provides solution.
It, can be based on the road pre-established after the server in intelligent dispatching system receives the purpose site of user's input Net matrix carries out path planning, and exports the free Distribution path planned.However when executing road network matrix building task, lead to It is commonly present the case where calling road network matrix building server process mission failure, needs to carry out issuing and handling again for task, Task treatment effeciency is reduced, poor usage experience is brought to user.
Apply for content
The application provides a kind of task processing method, device, electronic equipment and storage medium, when reducing task processing Between, improve task treatment effeciency.
In a first aspect, the embodiment of the present application provides a kind of task processing method, it is applied to host node server, comprising:
It determines the corresponding multiple subtasks to be processed of waiting task, and obtains needs when executing the subtask to be processed The query rate per second of service providing server corresponding to the external service of request;
It is that each calculate node server corresponding to the host node server is distributed wait locate based on the query rate per second Manage subtask;Wherein, the quantity summation for the subtask to be processed distributed by each calculate node server is no more than described per second Query rate;
It is sent out respectively to corresponding calculate node server according to the subtask to be processed distributed for each calculate node server Role assignment message is sent, so that each calculate node server passes through the access service according to received task assignment messages Server is provided and executes corresponding subtask to be processed.
One embodiment in above-mentioned application, which has the following beneficial effects:, can reduce the task processing time, improve task Treatment effeciency.To be processed is carried out by the acquisition of the query rate per second to service providing server, and based on query rate per second It is engaged in the task distribution of corresponding multiple subtasks to be processed, enables service providing server significant response calculate node service Device corresponding access operation when executing subtask to be processed, not only ensure that the treatment effeciency of subtask to be processed, but also take into account The processing capacity of service providing server, so overcoming service providing server leads to task due to that can not handle in time task The technical issues of processing failure, reduces the time that task distributes investment repeatedly to reduce the number of task processing failure Cost, and then improve task treatment effeciency.
Optionally, the waiting task is road network task to be processed, includes multiple in the road network task to be processed Site;
Correspondingly, the corresponding multiple subtasks to be processed of the determining waiting task, comprising:
It is determined according to the multiple site and needs to obtain the site pair of road network information, by determining each site to making respectively For a subtask to be processed;
Correspondingly, the external service that the needs are requested includes the clothes for the road network information being used to provide the described between site pair Business.
Query rate per second based on service providing server can be carried out road network task pair to be processed by above-mentioned optional way The distribution for the multiple sites pair answered and the transmission of role assignment message, enable service providing server task based on the received The road network information that information is provided between site pair is distributed to mention to reduce the time spent when providing road network information service High service provides efficiency.
Optionally, in the subtask to be processed that basis is the distribution of each calculate node server respectively to corresponding calculate node Server is sent after role assignment message, further includes:
Unassigned subtask to be processed if it exists then returns and executes subtask batch operation to be processed, until all Subtask to be processed, which is assigned, completes.
Above-mentioned optional way can continue to trigger son times to be processed in the case where subtask to be processed is not assigned completely The batch operation of business ensure that the assigned integrity degree of waiting task.
Optionally, after institute subtask to be handled is assigned completion, further includes:
The database for storing subtask implementing result is inquired, whether is successfully held with each subtask to be processed of determination Row, and store definitive result;
When inquiring the definitive result, and there is the subtask to be processed not being successfully executed in the definitive result, It returns and executes subtask batch operation to be processed, until each subtask to be processed is successfully executed or meets in the definitive result Task distributes stop condition.
Above-mentioned optional way is by during subtask to be processed is performed, to each subtask implementing result to be processed Inquiry determines, when there is the subtask to be processed not being successfully executed, to re-start the distribution behaviour of the subtask to be processed Make, guarantees the validity of each subtask treatment process to be processed in waiting task.
It optionally, is each calculate node server distribution corresponding to the node server based on the query rate per second Subtask to be processed, comprising:
Determine the quantity of the calculate node server, and true according to the ratio of the query rate per second and institute quantification Determine the corresponding subtask quantity allotted of each calculate node server;
Respectively each calculate node server chooses the subtask quantity allotted from the multiple subtask to be processed Subtask to be processed, carry out task distribution.
Above-mentioned optional way passes through the quantity of calculate node server, determines the corresponding subtask of each calculate node server Quantity allotted, and then the selection of subtask to be processed is carried out for each calculate node server according to subtask quantity allotted and is divided Match, realize the task balance of the corresponding each calculate node server of host node server, avoids since calculate node takes The task of business device is unbalanced to cause a certain calculate node server delay machine bring to influence, to improve task processing effect indirectly Rate.
Optionally, respectively each calculate node server chooses the subtask point from the multiple subtask to be processed Subtask to be processed with quantity, comprising:
If the quantity of the waiting task be it is multiple, according to polling mechanism or task priority, be determined as each calculating Node server chooses waiting task corresponding when subtask to be processed.
Above-mentioned optional way carries out the selection of waiting task by way of training in rotation mechanism or task priority, perfect There are the distribution mechanisms of the subtask to be processed when multiple waiting tasks, ensure that the orderly distribution of waiting task.
Optionally, it is taken respectively to corresponding calculate node according to the subtask to be processed distributed for each calculate node server Business device sends role assignment message, comprising:
Central node according to the subtask to be processed distributed for each calculate node server, into message queue MQ cluster The role assignment message for being directed to each calculate node server is sent, so that each calculate node server is from the central node ActiveMQ reads the role assignment message of itself;Alternatively,
According to the subtask to be processed distributed for each calculate node server, zeroMQ mechanism is respectively adopted to corresponding meter Operator node server sends role assignment message.
Above-mentioned optional way carries out the transmission of role assignment message by setting message queue, is improved by asynchronous process System performance and peak clipping, the coupling for reducing host node server and the constituted system of calculate node server.
Optionally, it is taken respectively to corresponding calculate node according to the subtask to be processed distributed for each calculate node server Business device sends role assignment message, comprising:
According to the subtask to be processed distributed for each calculate node server, respectively according to setting rate to corresponding calculating Node server sends role assignment message.
Transmission rate when above-mentioned optional way is by carrying out role assignment message transmission to host node server is set It is fixed, the generation that role assignment message sends too fast caused message blocking phenomenon is avoided, to improve task allocative efficiency.
Second aspect, the embodiment of the present application also provides a kind of task processing methods, are applied to calculate node server, packet It includes:
Host node server is obtained to be appointed according to transmitted by the subtask to be processed distributed for the calculate node server Business assignment messages;Wherein, the subtask to be processed comes from same waiting task, the quantity of the subtask to be processed and institute The summation for stating the quantity for the subtask to be processed that host node server is the distribution of other calculate node servers, is no more than and executes institute The query rate per second of service providing server corresponding to the external service for needing to request when stating subtask to be processed;
According to the role assignment message, the service providing server is accessed, to execute the role assignment message pair The subtask to be processed answered.
Optionally, the waiting task is road network task to be processed, includes multiple in the road network task to be processed Site, each subtask to be processed are a site pair for needing to obtain road network information.
Optionally, before according to the role assignment message, accessing the service providing server, further includes:
If the quantity of the corresponding subtask to be processed of received role assignment message per second is greater than the query rate per second, At least one subtask to be processed is abandoned according to preset rules.
Optionally, host node server is obtained to be sent out according to the subtask to be processed distributed by the calculate node server The role assignment message sent, comprising:
It is read from the ActiveMQ in the central node of message queue MQ cluster corresponding with the calculate node server Role assignment message;Wherein the role assignment message is to be distributed by host node server according to for the calculate node server Subtask to be processed send;Alternatively,
Host node server is received according to the subtask to be processed distributed for the calculate node server, and is used Role assignment message transmitted by zeroMQ mechanism.
The third aspect, the embodiment of the present application also provides a kind of Task Processing Units, are configured at host node server, packet It includes:
Query rate obtains module, for determining the corresponding multiple subtasks to be processed of waiting task, and obtains and executes institute The query rate per second of service providing server corresponding to the external service for needing to request when stating subtask to be processed;
Subtask distribution module, for being each calculating corresponding to the host node server based on the query rate per second Node server distributes subtask to be processed;Wherein, the quantity for the subtask to be processed distributed by each calculate node server Summation is no more than the query rate per second;
Assignment messages sending module, for according to be each calculate node server distribution subtask to be processed respectively to right The calculate node server answered sends role assignment message, so that each calculate node server disappears according to received task distribution Breath executes corresponding subtask to be processed by accessing the service providing server.
Fourth aspect, the embodiment of the present application also provides a kind of Task Processing Units, are configured at calculate node server, packet It includes:
Assignment messages obtain module, for obtain host node server according to for the calculate node server distribute to Handle role assignment message transmitted by subtask;Wherein, the subtask to be processed come from same waiting task, it is described to The quantity and the host node server that handle subtask are the number of the subtask to be processed of other calculate node servers distribution The summation of amount, no more than service providing server corresponding to the external service for needing to request when executing the subtask to be processed Query rate per second;
Subtask processing module, for accessing the service providing server according to the role assignment message, to execute The corresponding subtask to be processed of the role assignment message.
5th aspect, the embodiment of the present application also provides a kind of electronic equipment, comprising:
At least one processor;And
The memory being connect at least one described processor communication;Wherein,
The memory is stored with the instruction that can be executed by least one described processor, and described instruction is by described at least one A processor executes, so that at least one described processor is able to carry out a kind of task processing provided by first aspect embodiment Method.
6th aspect, the embodiment of the present application also provides a kind of electronic equipment, comprising:
At least one processor;And
The memory being connect at least one described processor communication;Wherein,
The memory is stored with the instruction that can be executed by least one described processor, and described instruction is by described at least one A processor executes, so that at least one described processor is able to carry out a kind of task processing provided by second aspect embodiment Method.
7th aspect is stored with the non-instantaneous of computer instruction and computer-readable deposits the embodiment of the present application also provides a kind of Storage media, the computer instruction is for making the computer execute a kind of task processing side provided by first aspect embodiment Method.
Eighth aspect is stored with the non-instantaneous of computer instruction and computer-readable deposits the embodiment of the present application also provides a kind of Storage media, the computer instruction is for making the computer execute a kind of task processing side provided by second aspect embodiment Method.
Other effects possessed by above-mentioned optional way are illustrated hereinafter in conjunction with specific embodiment.
Detailed description of the invention
Attached drawing does not constitute the restriction to the application for more fully understanding this programme.Wherein:
Figure 1A is a kind of configuration diagram of task processing system provided by the embodiments of the present application;
Figure 1B is the flow chart of one of the embodiment of the present application one task processing method;
Fig. 2 is the flow chart of one of the embodiment of the present application two task processing method;
Fig. 3 is the flow chart of one of the embodiment of the present application three task processing method;
Fig. 4 A is the flow chart of one of the embodiment of the present application four task processing method;
Fig. 4 B is the configuration diagram of one of the embodiment of the present application four task processing system;
Fig. 5 is the structure chart of one of the embodiment of the present application five Task Processing Unit;
Fig. 6 is the structure chart of one of the embodiment of the present application six Task Processing Unit;
Fig. 7 is the frame of the server of the task processing method for being used to realize the embodiment of the present application in the embodiment of the present application seven Figure.
Specific embodiment
It explains below in conjunction with exemplary embodiment of the attached drawing to the application, including the various of the embodiment of the present application Details should think them only exemplary to help understanding.Therefore, those of ordinary skill in the art should recognize It arrives, it can be with various changes and modifications are made to the embodiments described herein, without departing from the scope and spirit of the present application.Together Sample, for clarity and conciseness, descriptions of well-known functions and structures are omitted from the following description.
In order to clearly introduce each technical solution of the embodiment of the present application, first to a kind of system tray involved in the application Structure is described in detail.
Referring to a kind of structural schematic diagram of system architecture shown in figure 1A, which uses principal and subordinate (Master- Slave) equipment mode, the system include host node server 10, calculate node server 20 and service providing server 30.
Wherein, the main equipment in the corresponding master-slave equipment of host node server 10, the corresponding principal and subordinate of calculate node server 20 set Slave equipment in standby.
One ancestral task is become different subtasks by host node server 10, and calculate node is distributed in subtask Server, and the subtask implementing result of conformity calculation node server feedback, are calculated final result.
Calculate node server 20 carries out subtask processing by access service providing server, and to host node server Feed back the implementing result of each subtask.
When service providing server 30 is each calculate node server subtasking, required service is provided.
Embodiment one
Figure 1B is the flow chart of one of the embodiment of the present application one task processing method, and the embodiment of the present application is suitable for After host node server receives the waiting tasks such as road network information acquisition in system architecture shown in figure 1A, to be processed The case where task is allocated, this method are executed by Task Processing Unit, which is had by software and or hardware realization Body configuration is on the host node server in server cluster.
A kind of task processing method as shown in Figure 1B is applied to host node server, comprising:
S101, the corresponding multiple subtasks to be processed of waiting task are determined, and obtains and executes the subtask to be processed When need the query rate per second of service providing server corresponding to the external service requested.
Wherein, waiting task can be stored in advance in host node server local, and need to handle this to be processed The acquisition of waiting task and its determination of subtask to be processed are carried out when business;It can also be stored in advance in and host node server It is associated in its other electronic equipment or cloud, such as in message queue, and carry out when needing to handle waiting task wait locate The acquisition of reason task and its determination of subtask to be processed;Or can also directly be connect with the terminal equipment in communication of user, and The real-time transmission of waiting task is carried out when setting regions in user's triggering terminal equipment to host node server, accordingly Host node server receives the waiting task and carries out the determination of subtask to be processed corresponding with waiting task.
Wherein, query rate per second is used to measure server flow handled at the appointed time, the data with server Processing capacity is associated.
Illustratively, it obtains service corresponding to the external service for needing to request when executing subtask to be processed and service is provided The query rate per second of device, can be searched directly from the server performance list locally prestored by host node server processing to The corresponding query rate per second of service providing server that processing subtask needs to request;It can also lead to from service providing server Believe and carries out the corresponding query rate per second of service providing server in each calculate node server of connection;It can also be directly from clothes Business provides the acquisition that query rate per second is carried out in server;Or a database can also be additionally set in systems and carry out system In each server performance index storage, and carry out the query rate per second of service providing server in the database when needed It obtains.
In a kind of optional embodiment of the embodiment of the present application, waiting task can be road network task to be processed, should It include multiple sites in road network task to be processed;Correspondingly, determine the corresponding multiple subtasks to be processed of waiting task, it can To be to be determined to need to obtain the site pair of road network information according to multiple sites, using determining each site to as one to Handle subtask.Correspondingly, the external service that the needs are requested includes the road network information being used to provide the described between site pair Service.
Wherein, road network task to be processed can be understood as the road network matrix for needing to carry out in advance when Intelligent logistics dispense Building task can be based on the road constructed in advance after receiving the dispatching purpose site that user inputs so as to intelligent distribution system Net matrix carries out path planning, and exports the optimal Distribution path cooked up.Wherein, each element in road network matrix includes pair Starting site should be dispensed and dispense dispatching distance, distribution time and the distribution route etc. between target site.Correspondingly, site Pair road network information can be understood as in the distance between two sites of site pair information, temporal information and route information It is at least one.
It S102, is that each calculate node server corresponding to the host node server is distributed based on the query rate per second Subtask to be processed;Wherein, the quantity summation for the subtask to be processed distributed by each calculate node server is no more than described Query rate per second.
It optionally, is that each calculate node server distribution corresponding to main node server is to be processed based on query rate per second Subtask can be the quantity for determining the calculate node server, and according to the query rate per second and institute's quantification Ratio determines the corresponding subtask quantity allotted of each calculate node server;Respectively each calculate node server is from the multiple The subtask to be processed of the subtask quantity allotted is chosen in subtask to be processed, carries out task distribution.
Or it is optional, based on query rate per second be each calculate node server distribution corresponding to main node server to Subtask is handled, can also be determining each calculate node server distributes task quantity;According to query rate per second and each meter Operator node server distributes task quantity, determines the corresponding subtask quantity allotted of each calculate node server;Respectively Each calculate node server chooses the subtask to be processed of the subtask quantity allotted from the multiple subtask to be processed, Carry out task distribution.
Illustratively, determine each calculate node server distributes task quantity, can be and directly acquires each calculating section Point server current time is corresponding to distribute task quantity;The maximum task distribution of each calculate node server can also be obtained Quantity and currently allocated task quantity, and it is poor according to maximum task quantity allotted and currently allocated task quantity work, it obtains Each calculate node server is corresponding to distribute task quantity.
Illustratively, task quantity is distributed according to query rate per second and each calculate node server, determines each calculating The corresponding subtask quantity allotted of node server, can be determining each calculate node server distributes the total of task quantity With;According to the corresponding ratio for distributing task quantity and task quantity summation being distributed of calculate node server, determine respectively The corresponding task distribution ratio of each calculate node server;According to the product of query rate per second and task distribution ratio, determine respectively each Calculate node server is corresponding to distribute task quantity, and can distribute task quantity as subtask quantity allotted.
It is understood that passing through the determination of the corresponding subtask quantity allotted of calculate node server, and appointed according to son Business quantity allotted is the selection and distribution that each calculate node server carries out subtask to be processed, realizes host node server pair The task balance for each calculate node server answered, avoid cause since the task of calculate node server is unbalanced it is a certain Calculate node server delay machine bring influences, to improve task treatment effeciency indirectly.
In a kind of optional embodiment of the embodiment of the present application, when waiting task quantity is multiple, in order to guarantee The preferred orderly distribution of each waiting task, and then guarantee being effectively treated for each waiting task, respectively each calculate node clothes Business device chooses the subtask to be processed of the subtask quantity allotted from the multiple subtask to be processed, carries out task point Match, it is right can be determined as institute when each calculate node server selection subtask to be processed according to polling mechanism or task priority The waiting task answered, and from the determining corresponding subtask to be processed of waiting task, choose subtask quantity allotted Subtask to be processed carries out task distribution.
S103, basis are the subtask to be processed of each calculate node server distribution respectively to corresponding calculate node service Device sends role assignment message, so that each calculate node server is according to received task assignment messages, by described in access Service providing server executes corresponding subtask to be processed.
It illustratively, can be according to the subtask to be processed distributed for each node server respectively to corresponding calculate node Server directly carries out the transmission of role assignment message.It is understood that reducing main section to improve system performance and peak clipping The coupling of point server and each calculate node server, can also be between host node server and each calculate node server Message queue is set, and carries out the transmission of role assignment message to each calculate node server by message queue.
Correspondingly, calculate node server receives role assignment message, and according to received task assignment messages, pass through It accesses service providing server and executes corresponding subtask to be processed.
It is to be processed according to being distributed for each calculate node server in a kind of optional embodiment of the embodiment of the present application Subtask sends role assignment message to corresponding calculate node server respectively, and can be basis is each calculate node server The subtask to be processed of distribution, the central node into message queue (Message Queue, MQ) cluster, which is sent, is directed to each calculating The role assignment message of node server, so that each calculate node server is read from from the ActiveMQ in the central node The role assignment message of body.
Specifically, host node server is as message generator, it is to be processed according to being distributed for each calculate node server Subtask generates the role assignment message for being directed to each calculate node server, and role assignment message is transferred to central node; Each calculate node server reads task distribution corresponding with itself as message consumer, from the ActiveMQ in central node Message.
It is to be processed according to being distributed for each calculate node server in another optional embodiment of the embodiment of the present application Subtask sends role assignment message to corresponding calculate node server respectively, and can be basis is each calculate node server The subtask to be processed of distribution is respectively adopted zeroMQ mechanism to corresponding calculate node server and sends role assignment message.
It is understood that in order to avoid the generation that role assignment message sends too fast caused message blocking phenomenon, from And task allocative efficiency is improved, it is saved respectively to corresponding calculating according to the subtask to be processed distributed for each calculate node server Point server sends role assignment message, can also be according to the subtask to be processed for being the distribution of each calculate node server, point Role assignment message is not sent to corresponding calculate node server according to setting rate.By the hair for setting role assignment message Transmission rate, the number and magnitude send to the message of host node server is limited, to avoid message blocking existing from source The generation of elephant.
The technical solution of the embodiment of the present application passes through the acquisition of the query rate per second of service providing server, and based on per second Query rate carries out the task distribution of the corresponding multiple subtasks to be processed of waiting task, and service providing server is had Response computation node server corresponding access operation when executing subtask to be processed is imitated, both ensure that subtask to be processed Treatment effeciency, and taken into account the processing capacity of service providing server, thus overcome service providing server due to can not and When processing task the technical issues of leading to task processing failure, to reduce the number of task processing failure, reduce task The time cost of investment is distributed repeatedly, and then improves task treatment effeciency.
Embodiment two
Fig. 2 is the flow chart of one of the embodiment of the present application two task processing method, and the embodiment of the present application is above-mentioned each Improvement is optimized on the basis of the technical solution of embodiment.
Further, in operation " according to the subtask to be processed distributed for each calculate node server respectively to corresponding Calculate node server sends role assignment message " after, it is additional that " unassigned subtask to be processed if it exists, then return Subtask batch operation to be processed is executed, until institute subtask to be handled is assigned and completes ", to improve task processor system.
A kind of task processing method as shown in Figure 2 is applied to host node server, comprising:
S201, the corresponding multiple subtasks to be processed of waiting task are determined, and obtains and executes the subtask to be processed When need the query rate per second of service providing server corresponding to the external service requested.
It S202, is that each calculate node server corresponding to the host node server is distributed based on the query rate per second Subtask to be processed;Wherein, the quantity summation for the subtask to be processed distributed by each calculate node server is no more than described Query rate per second.
S203, basis are the subtask to be processed of each calculate node server distribution respectively to corresponding calculate node service Device sends role assignment message, so that each calculate node server is according to received task assignment messages, by described in access Service providing server executes corresponding subtask to be processed.
S204, if it exists unassigned subtask to be processed then return and execute subtask batch operation to be processed, until Institute subtask to be handled, which is assigned, completes.
Since waiting task is at least one, a waiting task corresponds to multiple subtasks to be processed, accordingly, it is possible to A case where institute subtask to be handled can not being assigned is distributed in the presence of a subtask is only carried out, it is therefore desirable to unassigned Subtask to be processed inquired, when there are still unassigned subtask to be processed, continue subtask to be processed Assignment operation, until complete subtask to be handled distribution.
Optionally, when carrying out subtask to be processed and distributing, subtask to be processed can be marked, when storing wait locate Manage subtask region (such as can be host node server local, with host node server it is associated other storage equipment or Cloud) in subtask to be processed when further including not labeled subtask to be processed, show that subtask to be processed is not yet complete Full distribution.
It, optionally, can be with when carrying out subtask to be processed and distributing it is understood that in order to save storage resource Directly allocated subtask to be processed is deleted, when the region for storing subtask to be processed (such as can be host node Server local, with host node server it is associated other storage equipment or cloud) there is also when subtask to be processed, show to Processing subtask is not yet fully allocated.
It should be noted that after an institute subtask to be handled is assigned and completes, however it remains due to calculate environment or The interference of other factors fails and the entire waiting task of image so that subtask to be processed exists to execute during being performed Implementing result the case where.In order to avoid the generation of above situation can in a kind of optional embodiment of the embodiment of the present application To preset a database, the implementing result of each subtask to be processed is stored;Correspondingly, host node server passes through The database for storing subtask implementing result is inquired, determines whether each subtask to be processed is successfully executed.For convenience The inquiry of implementing result, host node server can also store definitive result.
Illustratively, it for the ease of the subsequent inquiry to definitive result, can be determined using data structures such as bitmaps As a result storage.
In order to guarantee to execute the smooth execution of the subtask to fail, during executing waiting task, host node clothes Be engaged in device in real time or timing inquiry definitive result, and in definitive result exist be not successfully executed subtask to be processed when, It returns and executes subtask batch operation to be processed, until each subtask to be processed is successfully executed or meets in the definitive result Task distributes stop condition.
Wherein, task distribution stop condition can be the subtask to be processed for executing and failing and be duplicatedly distributed and execute setting It is still failed after number, or task termination request for receiving task initiator transmission etc..
The embodiment of the present application by according to be each calculate node server distribution subtask to be processed respectively to correspondence Calculate node server send role assignment message after, additional unassigned subtask to be processed if it exists then returns Subtask batch operation to be processed is executed, until institute subtask to be handled is assigned the operation completed, so that under automatic realization The batch operation of primary subtask to be processed ensure that waiting task quilt until institute subtask to be handled is assigned and completes The integrity degree of distribution lays the foundation for performing effectively for each waiting task.
Embodiment three
Fig. 3 is the flow chart of one of the embodiment of the present application three task processing method, and the embodiment of the present application is suitable for figure After calculate node server shown in 1A receives the waiting tasks such as road network matrix building, at waiting task The case where reason, this method are executed by Task Processing Unit, and the device is by software and or hardware realization, and concrete configuration is taking It is engaged on the calculate node server in device cluster.
A kind of task processing method as shown in Figure 3 is applied to calculate node server, comprising:
S301, host node server is obtained according to transmitted by the subtask to be processed distributed for the calculate node server Role assignment message.
Wherein, the subtask to be processed come from same waiting task, the quantity of the subtask to be processed with it is described Host node server is the summation of the quantity of the subtask to be processed of other calculate node servers distribution, is no more than described in executing The query rate per second of service providing server corresponding to the external service for needing to request when subtask to be processed.
Wherein, waiting task can be stored in advance in host node server local, and need to handle this to be processed The acquisition of waiting task and its determination of subtask to be processed are carried out when business;It can also be stored in advance in and host node server It is associated in its other electronic equipment or cloud, such as in message queue, and carry out when needing to handle waiting task wait locate The acquisition of reason task and its determination of subtask to be processed;Or can also directly be connect with the terminal equipment in communication of user, and The real-time transmission of waiting task is carried out when setting regions in user's triggering terminal equipment to host node server, accordingly Host node server receives the waiting task and carries out the determination of subtask to be processed corresponding with waiting task.
Wherein, query rate per second is used to measure server flow handled at the appointed time, the data with server Processing capacity is associated.
Illustratively, host node server determines the corresponding multiple subtasks to be processed of waiting task, and obtains execution The query rate per second of service providing server corresponding to the external service for needing to request when the subtask to be processed;Based on institute Stating query rate per second is that each calculate node server corresponding to the host node server distributes subtask to be processed;Wherein, The quantity summation for the subtask to be processed distributed by each calculate node server is no more than the query rate per second;According to being each The subtask to be processed of calculate node server distribution sends role assignment message to corresponding calculate node server respectively.
Correspondingly, calculate node server acquisition host node server is to be processed according to distributing for calculate node server Role assignment message transmitted by subtask.
It is understood that due to the quantity and host node server of the received subtask to be processed of calculate node server It is per second no more than service providing server for the summation of the quantity of the subtask to be processed of other calculate node servers distribution Query rate enables service providing server significant response calculate node server when executing subtask to be processed to service The access operation of server is provided, not only ensure that the treatment effeciency of subtask to be processed, but also taken into account service providing server Processing capacity.
In a kind of optional embodiment of the embodiment of the present application, waiting task can be road network task to be processed, should It include multiple sites in road network task to be processed;Correspondingly, each subtask to be processed is one for needing to obtain road network information Site pair.
Wherein, road network task to be processed can be understood as the road network matrix for needing to carry out in advance when Intelligent logistics dispense Building task can be based on the road constructed in advance after receiving the dispatching purpose site that user inputs so as to intelligent distribution system Net matrix carries out path planning, and exports the optimal Distribution path cooked up.Wherein, each element in road network matrix includes pair Starting site should be dispensed and dispense dispatching distance, distribution time and the distribution route etc. between target site.Correspondingly, site Pair road network information can be understood as in the distance between two sites of site pair information, temporal information and route information It is at least one.
In a kind of optional embodiment of the embodiment of the present application, host node server is obtained according to for the calculate node Role assignment message transmitted by the subtask to be processed of server distribution, can be the central node from message queue MQ cluster In ActiveMQ read corresponding with calculate node server role assignment message;Wherein the role assignment message is It is sent by host node server according to the subtask to be processed distributed for the calculate node server.
Specifically, host node server is as message generator, it is to be processed according to being distributed for each calculate node server Subtask generates the role assignment message for being directed to each calculate node server, and role assignment message is transferred to central node. Correspondingly, calculate node server reads corresponding with itself as message consumer, from the ActiveMQ in central node Business assignment messages.
In another optional embodiment of the embodiment of the present application, host node server is obtained according to for the calculate node Server distribution subtask to be processed transmitted by role assignment message, can be receive host node server according to be described in The subtask to be processed of calculate node server distribution, and using role assignment message transmitted by zeroMQ mechanism.
S302, according to the role assignment message, access the service providing server, disappeared with executing task distribution Cease corresponding subtask to be processed.
Specifically, calculate node server is when executing subtask to be processed, or according to role assignment message, access is provided Service providing server corresponding to the external service for needing to request when executing subtask to be processed, service providing server carry out The offer of respective service, to assist calculate node server to execute subtask to be processed.
The technical solution of the embodiment of the present application is by the query rate per second of service providing server to distribution to calculate node The quantity of the subtask to be processed of server is limited, so that the quantity of the received subtask to be processed of calculate node server It is sent to the summation of the quantity of the subtask to be processed of other calculate node servers with host node server, is mentioned no more than service For the query rate per second of server, enable service providing server significant response calculate node server to be processed in execution Corresponding access operation when subtask, not only ensure that the treatment effeciency of subtask to be processed, but also take into account service providing server Processing capacity, so overcoming service providing server leads to the technology of task processing failure due to that can not handle task in time Problem reduces task and distributes the time cost of investment repeatedly, and then improve to reduce the number of task processing failure Task treatment effeciency.
On the basis of the technical solution of the various embodiments described above, when calculate node server single obtains excessive task point When with message, exist can not subtask to be processed corresponding to role assignment message the case where being effectively treated, and then can be right The task action result of waiting task has an impact.In order to avoid the generation of above situation, disappear according to task distribution Breath before accessing the service providing server, can also determine calculate node server itself received task distribution per second The quantity of message;If the quantity of the corresponding subtask to be processed of received role assignment message per second is greater than the inquiry per second Rate then abandons at least one subtask to be processed according to preset rules.
Example IV
Fig. 4 A is the flow chart of one of the embodiment of the present application four task processing method, and the embodiment of the present application is above-mentioned each A kind of preferred embodiment is provided on the basis of the technical solution of embodiment.
A kind of architecture diagram of road network task processing system in conjunction with shown in Fig. 4 B, at task provided by the embodiments of the present application Reason method is described in detail.
Wherein, road network task processing system shown in Fig. 4 B uses principal and subordinate (Master-Slave) equipment mode, including master Node server 40 is used as main equipment, and calculate node server is used as from equipment.The road network task processing system further includes message Queue 60, map server 70 and database 80.
A kind of task processing method as shown in Figure 4 A, comprising:
S401, host node server initiation road network snapshot corresponding with road network task.
It wherein, include multiple sites in road network task, any two of them site can be formed a little to data, and road network task is For the obtaining the road network information between each site pair of the task.Road network information includes dispatching distance, distribution time and distribution route.
Wherein, road network information can be by requesting map server to be obtained, and therefore, the point in road network task is to data Quantity it is equal with needing to request the number of map server.Since point needs to carry out down by being assembled into task packet to data It sends out, therefore issues the quantity of task packet and put also equal to the quantity of data.
When in road network task including 6 sites, the corresponding point of road network task has 6* (6-1)=30 to data, accordingly , task packet 30 can be formed, the number of map server is requested to be similarly 30 times.
Road network snapshot refers to through the point of a series of bitmap (bitMap) storage to the execution state informations of data.
S402, the point not being successfully executed is searched in road network snapshot to data.
Host node server knows the quantity for the task packet (namely putting to data) for needing to issue in total, when host node perceives After the task packet of current road network task is sent, can wait for a period of time (the time * 8 that task coating executes), when having waited Cheng Houhui removes in database to check each point to the execution state information of data, and then with bitMap, (each byte can be deposited Store up 8 each states, can little memory significantly service condition) be locally stored.
S403, by the point not being successfully executed to data assembling task packet.
Which point host node server can perceive to the execution state information of data according to the point recorded in road network snapshot Data are successfully executed not yet, during the point not being successfully executed is then returned to assembling task packet to data, The task packet not being successfully executed as caused by response timeout or map interface mistake etc. is continued searching, by what is searched Task packet is sent again, and the point not being performed once before searching in the database after being sent completely is to data.
S404, the map server per second query rate open for road network task processing system is obtained.
S405, the ratio based on query rate per second Yu calculate node server are determined and are distributed to each calculate node server Task packet quantity.
S406, corresponding determining task packet quantity, respectively respective numbers by way of message queue or certainly communication Task packet is sent to each calculate node server.
For example, the ActiveMQ that can use the central node in message queue cluster carries out the mission dispatching of message;Or Person carries out message end to end using zeroMQ and issues.
Since issuing for task packet is realized by message queue, dynamic regulation or fixed setting message queue can be passed through It is per second issue number, control host node server issues the number and magnitude of task processing message, such as limitation activeMQ Or the rate of zeroMQ, the production energy of the producer's (host node server) is controlled in the source of task processing system in this way Power.
Since consumer is the carrier of execution task packet, generated in calculate node server (consumer) in order to prevent big The message of amount is accumulated, and the maximum quantity that each calculate node server reception task packet per second can also be arranged is map server Query rate per second.Certainly, when having more calculate node servers in cluster, even if being provided with maximum value, because the producer Throughput rate is certain, so final entire cluster can return to the period of shared entire query rate per second, without will cause The waste of map resource.
When the point of the message received when calculate node is per second is to magnitude query rate per second greatly, partial task packet will do it It abandons.The task packet of discarding can be re-issued execution when lower subtask snapshot is collected.
S407, calculate node server are unpacked after receiving task message packet.
S408, it is executed after unpacking by the fragment that access map server carries out task.
S409, data are written in database in point.
What S410, host node the server increment type after having sent task packet went query point pair in database is performed shape State.
There is the point of value, to data, the corresponding state that is performed in road network snapshot is marked after the completion of S411, inquiry Note.
Such as the point that site A and site B is formed is coated with successfully data " A-B " when putting to the corresponding task of data " A-B " After execution, the state that is performed that can modify " A-B " in the database is successful execution.If database carries out quilt using bitMap When the storage of execution state, if being designated as 23 under the point being successfully executed bit corresponding to data, it is arranged in the bitMap 23 The value set is " true ", characterizes the point and is coated with successful execution to the corresponding task of data.
S412, host node server periodically search for database, until the corresponding road network information of all-pair data is all It obtains until completing.
The point not being successfully executed carries out data it is understood that needing to preset one and repeating number Limitation, when reaching maximum attempts, but not being successfully executed yet, using it is preset reveal all the details computation rule to the task packet into Row processing.
Embodiment five
Fig. 5 is the structure chart of one of the embodiment of the present application five Task Processing Unit, and the embodiment of the present application is suitable for After host node server receives the waiting tasks such as road network matrix building in system architecture shown in figure 1A, to be processed Task is allocated the case where processing, and the device is by software and or hardware realization, and master of the concrete configuration in server cluster On node server.
A kind of Task Processing Unit 500 as shown in Figure 5, comprising: query rate obtains module 501, subtask distribution module 502 and assignment messages sending module 503.
Query rate obtains module 501, for determining the corresponding multiple subtasks to be processed of waiting task, and obtains execution The query rate per second of service providing server corresponding to the external service for needing to request when the subtask to be processed;
Subtask distribution module 502, for being each corresponding to the host node server based on the query rate per second Calculate node server distributes subtask to be processed;Wherein, the subtask to be processed distributed by each calculate node server Quantity summation is no more than the query rate per second;
Assignment messages sending module 503, for according to the subtask to be processed difference for being the distribution of each calculate node server Role assignment message is sent to corresponding calculate node server, so that each calculate node server is according to received task point With message, corresponding subtask to be processed is executed by accessing the service providing server.
The technical solution of the embodiment of the present application obtains the inquiry per second that module carries out service providing server by query rate The acquisition of rate, and query rate per second is based on by subtask distribution module and assignment messages sending module and carries out waiting task pair The task for the multiple subtasks to be processed answered is distributed, and service providing server significant response calculate node server is existed Corresponding access operation when subtask to be processed is executed, not only ensure that the treatment effeciency of subtask to be processed, but also has taken into account service The processing capacity of server is provided, so overcome service providing server causes task to handle due to that can not handle in time task The technical issues of failure, to reduce the number of task processing failure, reduce the time cost that task distributes investment repeatedly, And then improve task treatment effeciency.
Further, the waiting task is road network task to be processed, includes more in the road network task to be processed A site;
Correspondingly, query rate obtains module 501 at the corresponding multiple subtasks to be processed of the determining waiting task of execution, It is specifically used for:
It is determined according to the multiple site and needs to obtain the site pair of road network information, by determining each site to making respectively For a subtask to be processed;
Correspondingly, the external service that the needs are requested includes the clothes for the road network information being used to provide the described between site pair Business.
Further, which further includes that subtask distribution circulation module is used for:
In the subtask to be processed that basis is the distribution of each calculate node server respectively to corresponding calculate node server After sending role assignment message, unassigned subtask to be processed, then return and execute subtask distribution to be processed if it exists Operation, until institute subtask to be handled is assigned and completes.
Further, which further includes that implementing result determining module is used for:
After institute subtask to be handled is assigned completion, the database for storing subtask implementing result is inquired, Whether it is successfully executed with each subtask to be processed of determination, and stores definitive result;
Correspondingly, subtask distribution circulation module, is also used to:
When inquiring the definitive result, and there is the subtask to be processed not being successfully executed in the definitive result, It returns and executes subtask batch operation to be processed, until each subtask to be processed is successfully executed or meets in the definitive result Task distributes stop condition.
Further, subtask distribution module 502, comprising:
Quantity allotted determination unit, for determining the quantity of the calculate node server, and according to the inquiry per second Rate and the ratio of institute quantification determine the corresponding subtask quantity allotted of each calculate node server;
Task distributes subelement, chooses from the multiple subtask to be processed for respectively each calculate node server The subtask to be processed of the subtask quantity allotted carries out task distribution.
Further, task distributes subelement, is respectively each calculate node server from the multiple to be processed executing When choosing the subtask to be processed of the subtask quantity allotted in subtask, it is specifically used for:
If the quantity of the waiting task be it is multiple, according to polling mechanism or task priority, be determined as each calculating Node server chooses waiting task corresponding when subtask to be processed.
Further, assignment messages sending module 503, is specifically used for:
Central node according to the subtask to be processed distributed for each calculate node server, into message queue MQ cluster The role assignment message for being directed to each calculate node server is sent, so that each calculate node server is from the central node ActiveMQ reads the role assignment message of itself;Alternatively,
According to the subtask to be processed distributed for each calculate node server, zeroMQ mechanism is respectively adopted to corresponding meter Operator node server sends role assignment message.
Further, assignment messages sending module 503, is specifically used for:
According to the subtask to be processed distributed for each calculate node server, respectively according to setting rate to corresponding calculating Node server sends role assignment message.
Task processing method provided by the application any embodiment can be performed in above-mentioned Task Processing Unit, has execution and appoints The corresponding functional module of processing method of being engaged in and beneficial effect.
Embodiment six
Fig. 6 is the structure chart of one of the embodiment of the present application six Task Processing Unit, and the embodiment of the present application is suitable for figure After calculate node server shown in 1A receives the waiting tasks such as road network matrix building, at waiting task The case where reason, the device is by software and or hardware realization, and calculate node server of the concrete configuration in server cluster On.
A kind of Task Processing Unit 600 as shown in FIG. 6, comprising: assignment messages obtain module 601 and subtask handles mould Block 602.
Assignment messages obtain module 601, distribute for obtaining host node server according to for the calculate node server Subtask to be processed transmitted by role assignment message;Wherein, the subtask to be processed comes from same waiting task, institute The quantity and the host node server of stating subtask to be processed are the subtask to be processed of other calculate node servers distribution Quantity summation, need service corresponding to the external service requested to provide clothes no more than when executing the subtask to be processed The query rate per second of business device;
Subtask processing module 602, for accessing the service providing server according to the role assignment message, with Execute the corresponding subtask to be processed of the role assignment message.
The technical solution of the embodiment of the present application is obtained module by assignment messages and is looked into based on the per second of service providing server Quantity of the inquiry rate to distribution to the subtask to be processed of calculate node server is limited, so that calculate node is received wait locate The quantity of reason subtask is sent to the total of the quantity of the subtask to be processed of other calculate node servers with host node server With no more than the query rate per second of service providing server, service providing server significant response calculate node is taken Business device corresponding access operation when executing subtask to be processed, not only ensure that the treatment effeciency of subtask to be processed, but also take into account The processing capacity of service providing server, so overcome service providing server causes to appoint due to that can not handle task in time The technical issues of processing failure of being engaged in, to reduce the number of task processing failure, reduce task distribute repeatedly investment when Between cost, and then improve task treatment effeciency.
Further, waiting task is road network task to be processed, includes multiple nets in the road network task to be processed Point, each subtask to be processed are a site pair for needing to obtain road network information.
Further, which further includes that task discard module is used for:
According to the role assignment message, before accessing the service providing server, if received task per second point Quantity with the corresponding subtask to be processed of message is greater than the query rate per second, then abandons at least one according to preset rules and wait for Handle subtask.
Further, assignment messages obtain module 601, are specifically used for:
It is read from the ActiveMQ in the central node of message queue MQ cluster corresponding with the calculate node server Role assignment message;Wherein the role assignment message is to be distributed by host node server according to for the calculate node server Subtask to be processed send;Alternatively,
Host node server is received according to the subtask to be processed distributed for the calculate node server, and is used Role assignment message transmitted by zeroMQ mechanism.
Task processing method provided by the application any embodiment can be performed in above-mentioned Task Processing Unit, has execution and appoints The corresponding functional module of processing method of being engaged in and beneficial effect.
Embodiment seven
According to an embodiment of the present application, present invention also provides a kind of electronic equipment and a kind of readable storage medium storing program for executing.
As shown in fig. 7, being the block diagram according to the electronic equipment of the task processing method of the embodiment of the present application.Electronic equipment purport Indicating various forms of digital computers, such as, laptop computer, desktop computer, workbench, personal digital assistant, Server, blade server, mainframe computer and other suitable computer.Electronic equipment also may indicate that various forms Mobile device, such as, personal digital assistant, cellular phone, smart phone, wearable device and other similar calculating dresses It sets.Component, their connection and relationship shown in this article and their function are merely exemplary, and are not intended to limit The realization of described herein and/or requirement the application.
As shown in fig. 7, the electronic equipment includes: one or more processors 701, memory 702, and each for connecting The interface of component, including high-speed interface and low-speed interface.All parts are interconnected using different buses, and can be pacified It installs in other ways on public mainboard or as needed.Processor can to the instruction executed in electronic equipment into Row processing, including storage in memory or on memory (such as, to be coupled to interface in external input/output device Display equipment) on show GUI graphical information instruction.In other embodiments, if desired, can be by multiple processors And/or multiple bus is used together with multiple memories with multiple memories.It is also possible to multiple electronic equipments are connected, it is each Equipment provides the necessary operation in part (for example, as server array, one group of blade server or multiprocessor system System).In Fig. 7 by taking a processor 701 as an example.
Memory 702 is non-transitory computer-readable storage medium provided herein.Wherein, the memory is deposited The instruction that can be executed by least one processor is contained, so that at least one described processor executes task provided herein Processing method.The non-transitory computer-readable storage medium of the application stores computer instruction, and the computer instruction is based on making Calculation machine executes task processing method provided herein.
Memory 702 is used as a kind of non-transitory computer-readable storage medium, can be used for storing non-instantaneous software program, non- Instantaneous computer executable program and module, such as the corresponding program instruction/mould of the task processing method in the embodiment of the present application Block is (for example, attached shown in fig. 5 including query rate acquisition module 501, subtask distribution module 502 and assignment messages sending module 503 Task Processing Unit 500;Or it is attached shown in fig. 6 including assignment messages acquisition module 601 and subtask processing module 602 Task Processing Unit 600).Processor 701 is by running the non-instantaneous software program being stored in memory 702, instruction And module, thereby executing the various function application and data processing of server, i.e. appointing in realization above method embodiment Business processing method.
Memory 702 may include storing program area and storage data area, wherein storing program area can store operation system Application program required for system, at least one function;Storage data area can be stored to be set according to the electronics for executing task processing method Standby uses created data etc..In addition, memory 702 may include high-speed random access memory, it can also include non- Volatile storage, for example, at least a disk memory, flush memory device or other non-instantaneous solid-state memories.Some In embodiment, it includes the memory remotely located relative to processor 701 that memory 702 is optional, these remote memories can be with By being connected to the network to the electronic equipment for executing task processing method.The example of above-mentioned network includes but is not limited to internet, enterprise Industry intranet, local area network, mobile radio communication and combinations thereof.
The electronic equipment for executing task processing method can also include: input unit 703 and output device 704.Processor 701, memory 702, input unit 703 and output device 704 can be connected by bus or other modes, with logical in Fig. 7 It crosses for bus connection.
Input unit 703 can receive the number or character information of input, and generate the electricity with execution task processing method The related key signals input of the user setting and function control of sub- equipment, such as touch screen, keypad, mouse, track pad, touching The input units such as template, indicating arm, one or more mouse button, trace ball, control stick.Output device 704 may include Show equipment, auxiliary lighting apparatus (for example, LED) and haptic feedback devices (for example, vibrating motor) etc..The display equipment can be with Including but not limited to, liquid crystal display (LCD), light emitting diode (LED) display and plasma scope.In some implementations In mode, display equipment can be touch screen.
The various embodiments of system and technology described herein can be in digital electronic circuitry, integrated circuit system It is realized in system, dedicated ASIC (specific integrated circuit), computer hardware, firmware, software, and/or their combination.These are various Embodiment may include: to implement in one or more computer program, which can be It executes and/or explains in programmable system containing at least one programmable processor, which can be dedicated Or general purpose programmable processors, number can be received from storage system, at least one input unit and at least one output device According to and instruction, and data and instruction is transmitted to the storage system, at least one input unit and this at least one output Device.
These calculation procedures (also referred to as program, software, software application or code) include the machine of programmable processor Instruction, and can use programming language, and/or the compilation/machine language of level process and/or object-oriented to implement these Calculation procedure.As used herein, term " machine readable media " and " computer-readable medium " are referred to for referring to machine It enables and/or data is supplied to any computer program product, equipment, and/or the device of programmable processor (for example, disk, light Disk, memory, programmable logic device (PLD)), including, receive the machine readable of the machine instruction as machine-readable signal Medium.Term " machine-readable signal " is referred to for machine instruction and/or data to be supplied to any of programmable processor Signal.
In order to provide the interaction with user, system and technology described herein, the computer can be implemented on computers The display device for showing information to user is included (for example, CRT (cathode-ray tube) or LCD (liquid crystal display) monitoring Device);And keyboard and indicator device (for example, mouse or trace ball), user can by the keyboard and the indicator device come Provide input to computer.The device of other types can be also used for providing the interaction with user;For example, being supplied to user's Feedback may be any type of sensory feedback (for example, visual feedback, audio feedback or touch feedback);And it can use Any form (including vocal input, voice input or tactile input) receives input from the user.
System described herein and technology can be implemented including the computing system of background component (for example, as data Server) or the computing system (for example, application server) including middleware component or the calculating including front end component System is (for example, the subscriber computer with graphic user interface or web browser, user can pass through graphical user circle Face or the web browser to interact with the embodiment of system described herein and technology) or including this backstage portion In any combination of computing system of part, middleware component or front end component.Any form or the number of medium can be passed through Digital data communicates (for example, communication network) and is connected with each other the component of system.The example of communication network includes: local area network (LAN), wide area network (WAN) and internet.
Computer system may include client and server.Client and server is generally off-site from each other and usually logical Communication network is crossed to interact.By being run on corresponding computer and each other with the meter of client-server relation Calculation machine program generates the relationship of client and server.
According to the technical solution of the embodiment of the present application, server can pass through during executing task processing method Acquisition to the query rate per second of service providing server, and based on query rate per second carry out waiting task it is corresponding it is multiple to The task distribution for handling subtask, enables service providing server significant response calculate node server to be processed in execution Corresponding access operation when subtask, not only ensure that the treatment effeciency of subtask to be processed, but also take into account service providing server Processing capacity, so overcoming service providing server leads to the technology of task processing failure due to that can not handle task in time Problem reduces task and distributes the time cost of investment repeatedly, and then improve to reduce the number of task processing failure Task treatment effeciency.
It should be understood that various forms of processes illustrated above can be used, rearrangement increases or deletes step.Example Such as, each step recorded in the application of this hair can be performed in parallel or be sequentially performed the order that can also be different and execute, As long as it is desired as a result, being not limited herein to can be realized technical solution disclosed in the present application.
Above-mentioned specific embodiment does not constitute the limitation to the application protection scope.Those skilled in the art should be bright White, according to design requirement and other factors, various modifications can be carried out, combination, sub-portfolio and substitution.It is any in the application Spirit and principle within made modifications, equivalent substitutions and improvements etc., should be included within the application protection scope.

Claims (19)

1. a kind of method of task processing, is applied to host node server characterized by comprising
It determines the corresponding multiple subtasks to be processed of waiting task, and obtains and need to request when executing the subtask to be processed External service corresponding to service providing server query rate per second;
It is that each calculate node server corresponding to the host node server distributes son to be processed based on the query rate per second Task;Wherein, the quantity summation for the subtask to be processed distributed by each calculate node server is no more than the inquiry per second Rate;
It is sent and is appointed to corresponding calculate node server respectively according to the subtask to be processed distributed for each calculate node server Business assignment messages, so that each calculate node server, which according to received task assignment messages, passes through, accesses the service offer Server executes corresponding subtask to be processed.
2. the method according to claim 1, wherein the waiting task be road network task to be processed, it is described It include multiple sites in road network task to be processed;
Correspondingly, the corresponding multiple subtasks to be processed of the determining waiting task, comprising:
It is determined according to the multiple site and needs to obtain the site pair of road network information, using determining each site to as one A subtask to be processed;
Correspondingly, the external service that the needs are requested includes the service for the road network information being used to provide the described between site pair.
3. the method according to claim 1, wherein to be processed according to being distributed for each calculate node server After subtask sends role assignment message to corresponding calculate node server respectively, further includes:
Unassigned subtask to be processed if it exists then returns and executes subtask batch operation to be processed, until needing to be located It manages subtask and is assigned completion.
4. according to the method described in claim 3, it is characterized in that, being gone back after institute subtask to be handled is assigned completion Include:
The database for storing subtask implementing result is inquired, whether is successfully executed with each subtask to be processed of determination, and Store definitive result;
When inquiring the definitive result, and there is the subtask to be processed not being successfully executed in the definitive result, return Subtask batch operation to be processed is executed, until each subtask to be processed is successfully executed or meets task in the definitive result Distribute stop condition.
5. the method according to claim 1, wherein described be based on the query rate per second as the node serve Each calculate node server corresponding to device distributes subtask to be processed, comprising:
It determines the quantity of the calculate node server, and is determined respectively according to the ratio of the query rate per second and institute's quantification The corresponding subtask quantity allotted of calculate node server;
Respectively each calculate node server chosen from the multiple subtask to be processed the subtask quantity allotted to Subtask is handled, task distribution is carried out.
6. according to the method described in claim 5, it is characterized in that, described is respectively each calculate node server from the multiple The subtask to be processed of the subtask quantity allotted is chosen in subtask to be processed, comprising:
If the quantity of the waiting task be it is multiple, according to polling mechanism or task priority, be determined as each calculate node Server chooses waiting task corresponding when subtask to be processed.
7. the method according to claim 1, wherein the basis is the distribution of each calculate node server wait locate It manages subtask and sends role assignment message to corresponding calculate node server respectively, comprising:
According to the subtask to be processed distributed for each calculate node server, the central node into message queue MQ cluster is sent For the role assignment message of each calculate node server, so that each calculate node server is from the central node ActiveMQ reads the role assignment message of itself;Alternatively,
According to the subtask to be processed distributed for each calculate node server, zeroMQ mechanism is respectively adopted and is saved to corresponding calculating Point server sends role assignment message.
8. method according to claim 1-7, which is characterized in that the basis is each calculate node server point The subtask to be processed matched sends role assignment message to corresponding calculate node server respectively, comprising:
According to the subtask to be processed distributed for each calculate node server, respectively according to setting rate to corresponding calculate node Server sends role assignment message.
9. a kind of task processing method, which is characterized in that be applied to calculate node server, comprising:
Obtain host node server task according to transmitted by the subtask to be processed distributed for the calculate node server point With message;Wherein, the subtask to be processed comes from same waiting task, the quantity of the subtask to be processed and the master Node server is the summation of the quantity of the subtask to be processed of other calculate node servers distribution, be no more than execute it is described to The query rate per second of service providing server corresponding to the external service for needing to request when handling subtask;
According to the role assignment message, the service providing server is accessed, it is corresponding to execute the role assignment message Subtask to be processed.
10. according to the method described in claim 9, it is characterized in that, the waiting task be road network task to be processed, it is described It include multiple sites in road network task to be processed, each subtask to be processed is a site pair for needing to obtain road network information.
11. according to the method described in claim 9, it is characterized in that, accessing the service according to the role assignment message Before offer server, further includes:
If the quantity of the corresponding subtask to be processed of received role assignment message per second is greater than the query rate per second, according to Preset rules abandon at least one subtask to be processed.
12. according to the described in any item methods of claim 9-11, which is characterized in that the acquisition host node server according to for Role assignment message transmitted by the subtask to be processed of the calculate node server distribution, comprising:
Task corresponding with the calculate node server is read from the ActiveMQ in the central node of message queue MQ cluster Assignment messages;Wherein the role assignment message be by host node server according to for the calculate node server distribute to Handle what subtask was sent;Alternatively,
Host node server is received according to the subtask to be processed distributed for the calculate node server, and uses zeroMQ machine The transmitted role assignment message of system.
13. a kind of device of task processing, is configured at host node server characterized by comprising
Query rate obtains module, for determining the corresponding multiple subtasks to be processed of waiting task, and obtain execution it is described to The query rate per second of service providing server corresponding to the external service for needing to request when handling subtask;
Subtask distribution module, for being each calculate node corresponding to the host node server based on the query rate per second Server distributes subtask to be processed;Wherein, the quantity summation for the subtask to be processed distributed by each calculate node server No more than the query rate per second;
Assignment messages sending module, for according to be each calculate node server distribution subtask to be processed respectively to corresponding Calculate node server sends role assignment message, so that each calculate node server is according to received task assignment messages, Corresponding subtask to be processed is executed by accessing the service providing server.
14. a kind of Task Processing Unit, which is characterized in that be configured at calculate node server, comprising:
Assignment messages obtain module, to be processed according to distributing for the calculate node server for obtaining host node server Role assignment message transmitted by subtask;Wherein, the subtask to be processed comes from same waiting task, described to be processed The quantity of subtask and the host node server are the quantity of the subtask to be processed of other calculate node servers distribution Summation, it is every no more than service providing server corresponding to the external service for needing to request when executing the subtask to be processed Second query rate;
Subtask processing module, for accessing the service providing server according to the role assignment message, described in executing The corresponding subtask to be processed of role assignment message.
15. a kind of electronic equipment characterized by comprising
At least one processor;And
The memory being connect at least one described processor communication;Wherein,
The memory is stored with the instruction that can be executed by least one described processor, and described instruction is by described at least one It manages device to execute, so that at least one described processor is able to carry out a kind of task processing of any of claims 1-8 Method.
16. a kind of electronic equipment characterized by comprising
At least one processor;And
The memory being connect at least one described processor communication;Wherein,
The memory is stored with the instruction that can be executed by least one described processor, and described instruction is by described at least one It manages device to execute, so that at least one described processor is able to carry out a kind of task processing described in any one of claim 9-12 Method.
17. a kind of non-transitory computer-readable storage medium for being stored with computer instruction, which is characterized in that the computer refers to It enables for making the computer perform claim require a kind of task processing method described in any one of 1-8.
18. a kind of non-transitory computer-readable storage medium for being stored with computer instruction, which is characterized in that the computer refers to It enables for making the computer perform claim require a kind of task processing method described in any one of 9-11.
19. a kind of task processing method characterized by comprising
Determine the corresponding multiple subtasks to be processed of waiting task;
According to the query rate per second for the service providing server for needing to access when executing the subtask to be processed, to the service Server is provided and sends at least one role assignment message, is distributed so that the service providing server is executed with each task The corresponding subtask to be processed of message.
CN201910762893.6A 2019-08-16 2019-08-16 A kind of task processing method, device, electronic equipment and storage medium Pending CN110458468A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910762893.6A CN110458468A (en) 2019-08-16 2019-08-16 A kind of task processing method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910762893.6A CN110458468A (en) 2019-08-16 2019-08-16 A kind of task processing method, device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN110458468A true CN110458468A (en) 2019-11-15

Family

ID=68487383

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910762893.6A Pending CN110458468A (en) 2019-08-16 2019-08-16 A kind of task processing method, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110458468A (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111045811A (en) * 2019-12-23 2020-04-21 五八有限公司 Task allocation method and device, electronic equipment and storage medium
CN111338797A (en) * 2020-02-19 2020-06-26 望海康信(北京)科技股份公司 Task processing method and device, electronic equipment and computer readable storage medium
CN111708627A (en) * 2020-06-22 2020-09-25 中国平安财产保险股份有限公司 Task scheduling method and device based on distributed scheduling framework
CN111736965A (en) * 2019-12-11 2020-10-02 西安宇视信息科技有限公司 Task scheduling method and device, scheduling server and machine-readable storage medium
CN111949387A (en) * 2020-07-17 2020-11-17 上海淇馥信息技术有限公司 Method and device for processing service task and electronic equipment
CN112181662A (en) * 2020-10-13 2021-01-05 深圳壹账通智能科技有限公司 Task scheduling method and device, electronic equipment and storage medium
CN112799799A (en) * 2020-12-29 2021-05-14 杭州涂鸦信息技术有限公司 Data consumption method and device
CN112861024A (en) * 2021-02-03 2021-05-28 北京百度网讯科技有限公司 Method and device for determining road network matrix, electronic equipment and storage medium
CN113760940A (en) * 2020-09-24 2021-12-07 北京沃东天骏信息技术有限公司 Quota management method, device, equipment and medium applied to distributed system

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111736965A (en) * 2019-12-11 2020-10-02 西安宇视信息科技有限公司 Task scheduling method and device, scheduling server and machine-readable storage medium
CN111045811A (en) * 2019-12-23 2020-04-21 五八有限公司 Task allocation method and device, electronic equipment and storage medium
CN111338797A (en) * 2020-02-19 2020-06-26 望海康信(北京)科技股份公司 Task processing method and device, electronic equipment and computer readable storage medium
CN111338797B (en) * 2020-02-19 2023-09-05 望海康信(北京)科技股份公司 Task processing method, device, electronic equipment and computer readable storage medium
CN111708627A (en) * 2020-06-22 2020-09-25 中国平安财产保险股份有限公司 Task scheduling method and device based on distributed scheduling framework
CN111708627B (en) * 2020-06-22 2023-06-20 中国平安财产保险股份有限公司 Task scheduling method and device based on distributed scheduling framework
CN111949387B (en) * 2020-07-17 2022-08-23 上海淇馥信息技术有限公司 Method and device for processing service task and electronic equipment
CN111949387A (en) * 2020-07-17 2020-11-17 上海淇馥信息技术有限公司 Method and device for processing service task and electronic equipment
CN113760940A (en) * 2020-09-24 2021-12-07 北京沃东天骏信息技术有限公司 Quota management method, device, equipment and medium applied to distributed system
CN112181662A (en) * 2020-10-13 2021-01-05 深圳壹账通智能科技有限公司 Task scheduling method and device, electronic equipment and storage medium
CN112799799A (en) * 2020-12-29 2021-05-14 杭州涂鸦信息技术有限公司 Data consumption method and device
CN112861024A (en) * 2021-02-03 2021-05-28 北京百度网讯科技有限公司 Method and device for determining road network matrix, electronic equipment and storage medium
CN112861024B (en) * 2021-02-03 2023-08-01 北京百度网讯科技有限公司 Method and device for determining road network matrix, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN110458468A (en) A kind of task processing method, device, electronic equipment and storage medium
CN111741026B (en) Cross-chain transaction request processing method, device, equipment and storage medium
US10592280B2 (en) Resource allocation and scheduling for batch jobs
US20140289286A1 (en) System and method for performance tuning of garbage collection algorithms
CN108182111A (en) Task scheduling system, method and apparatus
KR102546060B1 (en) Blockchain network transaction processing method, apparatus, device, and storage medium
US10817327B2 (en) Network-accessible volume creation and leasing
CN104981781B (en) Distributed computing system and the method for operating distributed computing system
CN107370796A (en) A kind of intelligent learning system based on Hyper TF
US20130152101A1 (en) Preparing parallel tasks to use a synchronization register
CN107704310B (en) Method, device and equipment for realizing container cluster management
CN112087332B (en) Virtual network performance optimization system under cloud edge cooperation
WO2021159831A1 (en) Programming platform user code running method, platform, node, device and medium
CN109117252A (en) Method, system and the container cluster management system of task processing based on container
US20220179711A1 (en) Method For Platform-Based Scheduling Of Job Flow
CN110300188A (en) Data transmission system, method and apparatus
CN113821506A (en) Task execution method, device, system, server and medium for task system
CN108028806A (en) The method and apparatus that virtual resource is distributed in network function virtualization NFV networks
CN116325705A (en) Managing task flows in an edge computing environment
CN109284190A (en) A kind of task processing method and device
CN113391925A (en) Cloud resource management method, system, medium, and computer device
CN107454137B (en) Method, device and equipment for on-line business on-demand service
CN110019456A (en) Data lead-in method, device and system
CN115576684A (en) Task processing method and device, electronic equipment and storage medium
CN115098269A (en) Resource allocation method, device, electronic equipment 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