CN106970838A - The dispatching method and device of thread during a kind of search engine calling interface - Google Patents
The dispatching method and device of thread during a kind of search engine calling interface Download PDFInfo
- Publication number
- CN106970838A CN106970838A CN201710338321.6A CN201710338321A CN106970838A CN 106970838 A CN106970838 A CN 106970838A CN 201710338321 A CN201710338321 A CN 201710338321A CN 106970838 A CN106970838 A CN 106970838A
- Authority
- CN
- China
- Prior art keywords
- thread
- interface
- return value
- search engine
- calling
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4843—Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
- G06F9/4881—Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/951—Indexing; Web crawling techniques
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Databases & Information Systems (AREA)
- Data Mining & Analysis (AREA)
- Exchange Systems With Centralized Control (AREA)
Abstract
The invention discloses the dispatching method and device of thread during a kind of search engine calling interface, what this method was performed concretely comprises the following steps, and receives call request of the search engine to n interface, and start n thread with while calling the n interface;When the interface gets return value, data processing is carried out to the return value according to the thread that the quantity of the return value starts respective numbers, and obtain result;Each result is assembled to obtain the corresponding search result of the search engine;Wherein, n is the positive integer more than or equal to 1.Multiple threads are opened due to this method to go while handling search engine needs to call the request of multiple interfaces, so largely reducing search RT, to reduce unnecessary time overhead, improve the search speed of search engine.In addition, the dispatching device of thread equally has the effect above during search engine calling interface.
Description
Technical field
The present invention relates to the dispatching method of thread during a kind of searching engine field, more particularly to search engine calling interface
And device.
Background technology
With the arrival in big data epoch, search engine can be wide with the reliable tools of quick obtaining information as people
General application.For example, electric business is using a kind of search engine that upper commercial articles searching engine is exactly that people often use, as search business
During product, system performs inquiry by calling search engine to querying condition, take carried out again after result operational data parsing,
Assembling etc. operates and then obtains search result.
The execution method of traditional search engine performs to be synchronous, i.e., system opens main thread and is used for calling search to draw successively
The multiple interfaces held up, and block the main thread after calling interface every time, until the master after the interface returned data called
Thread can just be recovered by blocked state, and obtained the returned data and handled, and the thread continues to call after data processing terminates
Next interface, until institute the interface in need called be called after, carry out continue executing with the step of follow-up data is assembled.Fig. 1
A kind of execution method of the search engine provided for prior art is the synchronous schematic diagram performed.As shown in figure 1, system opens master
Thread is used for calling interface A, and main thread blocks after calling, until after the interface returned data called, and main thread is from resistance
Plug-like state is recovered and obtains the returned data to be handled, and the main thread continues calling interface B after processing terminates, and with same
Step continues up to all interfaces that need to be called and is called.As can be seen here, when system QPS (inquiry times per second) very
Gao Shi, can cause system load too high, influence search efficiency.And when search engine needs to call multiple interfaces, main thread
Need to wait called interface one by one in certain sequence, wait the time waiting to consume longer.
The execution method of another search engine is that asynchronous execution, i.e. system open main thread to call search to draw successively
The multiple interfaces held up, and current main thread is discharged after calling interface every time, the system after interface returned data called
Reactivate new thread and obtain the returned data and handled, the thread continues to call next interface after data processing terminates,
Until after institute's interface in need called is called, continuing executing with the step of follow-up data is assembled.Fig. 2 provides for prior art
A kind of search engine execution method be asynchronous execution schematic diagram.It is used for calling connecing as shown in Fig. 2 system opens main thread
Mouth A, main thread is released after calling, until after the interface returned data called, the new main thread of unlatching obtains this and returned
Return data to be handled, after processing terminates, the main thread continues calling interface B and completes subsequent calls.It will be apparent that this method
Middle main thread is still that the total time-consuming used in calling interface is to call the time of total interface according to certain order calling interface one by one
Summation.But not having dependence between the data that many calling interfaces are returned in practical situations both, it is seen that this search is drawn
The execution method held up adds search RT (response time of application interface), causes unnecessary time overhead.
As can be seen here, to reach reduction, it searches for RT to the dispatching method of thread when providing a kind of calling interface for search engine
Purpose, be those skilled in the art's urgent problem to be solved.
The content of the invention
It is an object of the invention to provide the dispatching method and device of thread during a kind of search engine calling interface, by a plurality of
Thread is called and return value processing to the interface needed for search engine simultaneously, is reduced search RT, is improved search engine
Processing speed.
In order to solve the above technical problems, the present invention provide a kind of search engine calling interface when thread dispatching method, bag
Include following steps:
Call request of the search engine to n interface is received, and starts n thread with while calling the n to connect
Mouthful;
When the interface gets return value, the thread of respective numbers is started to described according to the quantity of the return value
Return value carries out data processing, and obtains result;
Each result is assembled to obtain the corresponding search result of the search engine;
Wherein, n is the positive integer more than or equal to 1.
It is preferred that, n thread of the startup with after while calling the n interface, in addition to:Discharge the n lines
Journey is to thread pool.
It is preferred that, n thread of the startup with after while calling the n interface, in addition to:Judge current system
Whether QPS exceedes threshold value;
If it is, n threads of release are to thread pool, otherwise, n threads of control are in blocked state.
It is preferred that, it is after the n thread to the thread pools are discharged, then described to be started according to the quantity of the return value
The thread of respective numbers carries out data processing to the return value:
According to the quantity of presently described return value, respective numbers are redistributed in the idle thread in the thread pool
Thread, and start the thread after redistributing to carry out data processing to the return value.
It is preferred that, it is after controlling the n threads to be in blocked state, then described to be started according to the quantity of the return value
The thread of respective numbers carries out data processing to the return value:
The thread in blocked state of respective numbers is again started up with to described according to the quantity of presently described return value
Return value carries out data processing.
It is preferred that, it is described redistribute after the quantity of thread be n.
It is preferred that, the interface is specifically included:Two side's interfaces.
In addition, a kind of dispatching device of present invention thread when search engine calling interface is also provided, including:
Start calling module, for receiving call request of the search engine to n interface, and start n thread with
Call the n interface simultaneously;
Receiving processing module, for when the interface gets return value, phase to be started according to the quantity of the return value
Answer the thread of quantity to carry out data processing to the return value, and obtain result;
As a result module is assembled, for being assembled to each result to obtain the corresponding search of the search engine
As a result;
Wherein, n is the positive integer more than or equal to 1.
It is preferred that, in addition to:
Release module, for after the startup calling module starts n thread to call the n interface simultaneously, releasing
The n threads are put to thread pool.
It is preferred that, in addition to:
Judge module, for it is described startup calling module start n thread with and meanwhile call the n interface it
Afterwards, judge whether the QPS of current system exceedes threshold value;
If it is, triggering release module, otherwise, trigger control module,
The release module, for discharging the n threads to thread pool;
The control module, for controlling the n threads to be in blocked state.
The dispatching method of thread during a kind of search engine calling interface provided by the present invention, it is same by opening multiple threads
When call multiple interfaces, go the method for calling multiple interfaces compared to a thread order is opened, opening multiple threads can make
Thread calls parallel progress to multiple interfaces, and multiple threads difference are changed into calling for multiple interfaces equivalent to a thread
Each interface is called, the interface that each needs is called has an independent thread to correspond to therewith, each thread
Between be independent of each other.So when the overall time that calling interface is spent is only calling interface used in the interface of used time at most when
Between, and the method for going to call multiple interfaces of a thread order is only opened, the overall time of required cost is total interface
The summation of called time.And because in a search engine, dependence is often not present in calling for docking port, so this
The there is provided method of invention can't be called because of the docking port of thread parallel and cause result mistake occur.Obviously, originally
The method that invention is provided largely reduces search RT, improves search efficiency.Searched in addition, the present invention also provides one kind
The dispatching device of thread when index holds up calling interface, beneficial effect is as described above.
Brief description of the drawings
In order to illustrate the embodiments of the present invention more clearly, the required accompanying drawing used in embodiment will be done simply below
Introduce, it should be apparent that, drawings in the following description are only some embodiments of the present invention, for ordinary skill people
For member, on the premise of not paying creative work, other accompanying drawings can also be obtained according to these accompanying drawings.
A kind of execution method for search engine that Fig. 1 provides for prior art is the synchronous schematic diagram performed;
A kind of execution method for search engine that Fig. 2 provides for prior art is the schematic diagram of asynchronous execution;
The flow chart of the dispatching method of thread when Fig. 3 is a kind of search engine calling interface provided in an embodiment of the present invention;
The flow of the dispatching method of thread when Fig. 4 is another search engine calling interface provided in an embodiment of the present invention
Figure;
The flow of the dispatching method of thread when Fig. 5 is another search engine calling interface provided in an embodiment of the present invention
Figure;
The structure chart of the dispatching device of thread when Fig. 6 is a kind of search engine calling interface provided in an embodiment of the present invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete
Site preparation is described, it is clear that described embodiment is only a part of embodiment of the invention, rather than whole embodiments.Based on this
Embodiment in invention, those of ordinary skill in the art are not under the premise of creative work is made, and what is obtained is every other
Embodiment, belongs to the scope of the present invention.
A kind of dispatching method of thread when the core of the present invention is to provide search engine calling interface, the dispatching method is being searched
Index is held up when needing to call multiple interfaces, and each interface is carried out respectively using the consistent thread of the interface quantity with that need to call
Call, and enter the processing of line interface returned data respectively using multiple threads, assembling finally is carried out to result and searched for
As a result.
In order that those skilled in the art more fully understand the present invention program, with reference to the accompanying drawings and detailed description
The present invention is described in further detail.
Embodiment one
The flow chart of the dispatching method of thread when Fig. 3 is a kind of search engine calling interface provided in an embodiment of the present invention.
Fig. 3 is refer to, the dispatching method specific steps of thread include during search engine calling interface:
Step S10:Call request of the search engine to n interface is received, and starts n thread with while calling n to connect
Mouthful.
This step by open multiple threads go and meanwhile handle search engine need to call the request of multiple interfaces, unlatching
Each thread goes to call its corresponding interface simultaneously.
Wherein, due to the number of ports that n is called required for search engine, therefore n is the positive integer more than or equal to 1.
Preferably embodiment, interface can be two side's interfaces or the 3rd of intra-company oneself exploitation
Tripartite's interface that Fang companies provide etc., is not limited herein.
, may be not enough or other because of the number of threads in current thread pond when opening thread in specific implementation
Multiple threads required for odjective cause causes calling interface can not be while be unlocked, it may appear that a part of thread is first unlocked,
Another part thread slightly postpones.But it is understood that before not influenceing whole concept of the present invention and holistic approach to perform
Put, this delay is acceptable.
Step S11:When interface gets return value, the thread of respective numbers is started to returning according to the quantity of return value
Value carries out data processing, and obtains result.
In this step, because each interface obtains the time of return value and differs, so whenever there is interface to be returned
A thread corresponding with the interface is switched on when returning value, the equal independent process of thread oneself that each is activated is equivalent to right
The return value of interface is answered, and obtains result.
Wherein, data processing can be data parsing etc., or the volume of data operation carried out according to specific needs,
It is not specifically limited herein.It should be noted that in this step, the thread for starting respective numbers can be according to it is initial when thread
With the corresponding relation of interface, it is again started up corresponding thread or distributes new thread, this implementation in thread pool again
Example is not construed as limiting, and corresponding embodiment is described in more detail below.In addition, being initially engaged in those threads of interface interchange
It can be controlled to block, can also discharged to thread pool, specifically how to operate can be common according to other parameters such as current system QPS
With determining, it is not limited thereto.Certainly, when interface obtains return value, can just it divide when each interface obtains return value
With a thread corresponding with the interface.Can certainly wait n whole interfaces to obtain after return value while being each interface
Distribute corresponding thread.
Step S12:Each result is assembled to obtain the corresponding search result of search engine.
It is to be assembled the result of all return values by tune interface in this step, obtains being user's displaying
Search result.It is understood that for obtained each result, how to carry out being assembled into prior art, the present embodiment
Repeat no more.
The dispatching method of thread during the search engine calling interface that the present embodiment is provided, it uses multiple threads while going to adjust
The interface called with needs, each thread only needs to call oneself corresponding interface.This have the advantage that, open many
Individual thread, can to the interface that call of needs while be called, without because some interface acquisition return value speed compared with
Slowly influence to call the progress of other interfaces, need are called one by one in order so as to avoid and only open a thread in the prior art
The interface to be called bring the time it is cumulative the problem of.Similarly, it is also many using opening when Processing Interface return value
The method of individual thread, the return value of each thread alignment processing institute calling interface.It is understood that the side provided in the present invention
In method, the overall time that calling interface is spent is only that the time used in return value is obtained in the interface called at most, and is only opened
The method for going to call multiple interfaces of a thread order is opened, when the overall time of required cost is that total interface is called
Between summation.And search engine needs that dependence is often not present between the interface that calls, thus will not relate to due to
Non-sequential call and cause result occur mistake situation.
It will be apparent that because method provided by the present invention is that multiple threads are jointly processed by calling and handling for docking port
Interface return value, so largely reducing search RT, reduces unnecessary time overhead, improves search engine
Search speed.
Embodiment two
Because the number of threads in thread pool is limited, or may occur a large amount of occupancy thread resources when calling multiple interfaces
Situation, and then cause QPS (inquiry times per second) very high, the problems such as search efficiency is reduced.
In the case of in view of above mentioned problem, the method for the present embodiment further comprises:N thread is discharged to thread
Pond.
Correspondence step is as follows:
Fig. 4 is refer to, is step flow chart of the present invention under embodiment two as depicted, specifically includes:
Step S10:Call request of the search engine to n interface is received, and starts n thread with while calling n to connect
Mouthful.
Step S20:N thread is discharged to thread pool.
In this step, the thread that calling interface terminates is released back into thread pool.Because interface is obtaining this section of return value
Time, thread also can be only in blocked state in the case where not being released, and wait interface to be reopened after obtaining return value
With the return value of Processing Interface.Other systems are handled because the thread in blocked state can not be called as available resources
System task, so thread, which is blocked, is equivalent to the available resources for occupying system, and the thread resources in system thread pool are past
Past limited, the whole work efficiency of system can be influenceed by crossing multithreading and being blocked.It is understood that after calling interface terminates horse
Thread used in upper release, it is advantageous in that the occupancy degree that can mitigate thread Pooled resources, and then reduce system load and
QPS, improves the search efficiency of search engine.
Step S21:According to the quantity of current return value, respective numbers are redistributed in the idle thread in thread pool
Thread, and start the thread after redistributing to carry out data processing to return value.
In this step, again for obtain return value interface assignment thread with the return value of Processing Interface.Due to each
The time that interface obtains return value is all uncertain, so distributing the benefit of thread for it again again when interface has return value
It is, thread can performed real work as far as possible rather than be in wait interface to obtain return value and wait or block
State, though can thus reduce appearance takes thread pool thread, the idle situation of the thread.The load of low system and
QPS, improves the search efficiency of search engine.
Step S12:Each result is assembled to obtain the corresponding search result of search engine.
On the basis of the present embodiment, as a preferred embodiment, the quantity of the thread after redistributing is n
It is individual.
It is understood that in the present embodiment, when system is thread of being reallocated after waiting total interface to have return value
Implementation status under, the number of the thread redistributed can by preceding release thread therewith quantity identical n.Certainly,
The number for the thread redistributed can also be less than called number of ports, because it is possible that the data quilt of some interface
After thread process terminates, another interface just obtains return value, does not need the new thread of resource pool reallocation then in this case,
But the return value of another interface is continued with using the thread.
In the present embodiment, thread is released back into thread pool at once after calling interface, when interface has return value, then weighs
New distribution thread goes the return value of Processing Interface, and this largely improves the service efficiency of thread, and is also other tasks
Under interface interchange work provide enough thread resources.
Embodiment three
Go to can be potentially encountered the line in current thread pond in the case of handling interface return value in view of redistributing thread
Journey is not enough distributed, or when redistributing thread due to reasons such as systems it is possible that delay, and then influence overall search
Efficiency.The present embodiment is as follows for a kind of improved method for above-mentioned situation:
Fig. 5 is refer to, is step flow chart of the present invention under embodiment three as depicted, specifically includes:
Step S10:Call request of the search engine to n interface is received, and starts n thread with while calling n to connect
Mouthful.
Step S30:Judge whether the QPS of current system exceedes threshold value.
The purpose of this step is to judge whether the thread resources amount in current system can reach threshold value, and then to determine
Whether current system conditions allow to make thread block after thread calling interface to wait interface to obtain return value.Certainly, here
Though using QPS as Rule of judgment, can be used for the parameter judged can also be utilization rate of thread pool thread etc., herein simultaneously
Do not limit.In addition, the selection of threshold value can be according to the value of the current integral status dynamic change of system or according to
The fixed value that artificial experience or other manner are determined.
If so, then performing step S20, otherwise, step S31 is performed.
Step S20:N thread is discharged to thread pool.
Step S21:According to the quantity of current return value, respective numbers are redistributed in the idle thread in thread pool
Thread, and start the thread after redistributing to carry out data processing to return value.
Step S12:Each result is assembled to obtain the corresponding search result of search engine.
Step S31:N thread of control is in blocked state.
Step S32:The thread in blocked state of number of responses is again started up with right according to the quantity of current return value
Return value carries out data processing.
In this step, because being related to the time length difference that each interface obtains return value, the line being blocked
Journey is not while being again started up, but its corresponding thread is again started up when certain interface obtains return value.
Step S12:Each result is assembled to obtain the corresponding search result of search engine.
In the present embodiment, according to the current thread resources situation of system, it is determined whether hinder it after thread calling interface
Plug, and wait interface to obtain after return value, the thread of blocked state is reopened with Processing Interface return value.The benefit so done
It is, saves the time redistributed for interface required for thread, but this method can the relative QPS for improving system.Can
With understanding, the method QPS current in system preferably that the present embodiment is provided is very low, or user search it is less but
It is to need to be applied when faster search response speed.
In the above-described embodiments, the dispatching method of thread is corresponding when search engine calling interface is described in detail implements
Example, the dispatching device of thread, specific embodiment party when the present invention also provides a kind of search engine calling interface corresponding with this method
Formula is as follows.
Example IV
The structure chart of the dispatching device of thread when Fig. 6 is a kind of search engine calling interface provided in an embodiment of the present invention.
The dispatching device of thread, is specifically included during a kind of search engine calling interface provided in an embodiment of the present invention:
Start calling module 10, for receiving call request of the search engine to n interface, and start n thread with same
When call n interface.
Receiving processing module 11, for when interface gets return value, respective numbers to be started according to the quantity of return value
Thread data processing is carried out to return value, and obtain result;
As a result module 12 is assembled, for being assembled to each result to obtain the corresponding search result of search engine.
The dispatching device of thread during a kind of search engine calling interface provided by the present invention, it is same by opening multiple threads
When call multiple interfaces, remove to call multiple interfaces compared to a thread order is opened, thread pair can be made by opening multiple threads
Multiple interfaces call parallel progress, equivalent to a thread are changed into multiple threads respectively to each to calling for multiple interfaces
Individual interface is called, and the interface that each needs is called has an independent thread to correspond to therewith, between each thread mutually
Do not influence.So time when the overall time that calling interface is spent is only calling interface used in the interface of used time at most, and
Only open thread order go call multiple interfaces, the overall time of required cost is the total interface called time
Summation.And because in a search engine, dependence is often not present in calling for docking port, so provided by the present invention
Device can't be called because of the docking port of thread parallel and cause result mistake occur.Obviously, the dress that the present invention is provided
Put and largely reduce search RT, improve search efficiency.
On the basis of example IV, the device also includes:
Release module, for after calling module n thread of startup is transferred to call n interface simultaneously, discharging n thread
To thread pool.
On the basis of example IV, the device also includes:Judge module, for judging whether the QPS of current system surpasses
Threshold value is crossed, if it is, triggering release module;Otherwise, trigger control module.
Release module, for discharging n thread to thread pool;
Control module, for controlling n thread to be in blocked state.
Because the embodiment of device part and the embodiment of method part are mutually corresponding, therefore the embodiment of device part please
Referring to the description of the embodiment of method part, it wouldn't repeat here.
The dispatching method and device of thread are carried out when above to a kind of search engine calling interface provided by the present invention
It is discussed in detail.The embodiment of each in specification is described by the way of progressive, and what each embodiment was stressed is and other
Between the difference of embodiment, each embodiment identical similar portion mutually referring to.For device disclosed in embodiment
For, because it is corresponded to the method disclosed in Example, so description is fairly simple, related part is said referring to method part
It is bright.It should be pointed out that for those skilled in the art, under the premise without departing from the principles of the invention,
Some improvement and modification can also be carried out to the present invention, these are improved and modification also falls into the protection domain of the claims in the present invention
It is interior.
It should also be noted that, in this manual, such as first and second or the like relational terms be used merely to by
One entity or operation make a distinction with another entity or operation, and not necessarily require or imply these entities or operation
Between there is any this actual relation or order.Moreover, term " comprising ", "comprising" or its any other variant meaning
Covering including for nonexcludability, so that process, method, article or equipment including a series of key elements not only include that
A little key elements, but also other key elements including being not expressly set out, or also include be this process, method, article or
The intrinsic key element of equipment.In the absence of more restrictions, the key element limited by sentence "including a ...", is not arranged
Except also there is other identical element in the process including the key element, method, article or equipment.
Claims (10)
1. the dispatching method of thread during a kind of search engine calling interface, it is characterised in that comprise the following steps:
Call request of the search engine to n interface is received, and starts n thread with while calling the n interface;
When the interface gets return value, returned according to the thread that the quantity of the return value starts respective numbers to described
Value carries out data processing, and obtains result;
Each result is assembled to obtain the corresponding search result of the search engine;
Wherein, n is the positive integer more than or equal to 1.
2. according to the method described in claim 1, it is characterised in that n thread of the startup is with while call the n interface
Afterwards, in addition to:
The n threads are discharged to thread pool.
3. according to the method described in claim 1, it is characterised in that n thread of the startup is with while call the n interface
Afterwards, in addition to:
Judge whether the QPS of current system exceedes threshold value;
If it is, n threads of release are to thread pool, otherwise, n threads of control are in blocked state.
4. according to the method in claim 2 or 3, it is characterised in that after the n thread to the thread pools are discharged,
Then the thread according to the quantity of return value startup respective numbers is specially to return value progress data processing:
According to the quantity of presently described return value, the line of respective numbers is redistributed in the idle thread in the thread pool
Journey, and start the thread after redistributing to carry out data processing to the return value.
5. method according to claim 3, it is characterised in that after controlling the n threads to be in blocked state, then institute
State the thread for starting respective numbers according to the quantity of the return value is specially to return value progress data processing:
It is again started up the thread in blocked state of respective numbers to return to described according to the quantity of presently described return value
Value carries out data processing.
6. method according to claim 4, it is characterised in that it is described redistribute after the quantity of thread be n.
7. the method according to claim 1-3 any one, it is characterised in that the interface is specifically included:Two side's interfaces.
8. the dispatching device of thread during a kind of search engine calling interface, it is characterised in that including:
Start calling module, for receiving call request of the search engine to n interface, and start n thread with simultaneously
Call the n interface;
Receiving processing module, for when the interface gets return value, respective counts to be started according to the quantity of the return value
The thread of amount carries out data processing to the return value, and obtains result;
As a result module is assembled, is tied for being assembled to each result with obtaining the corresponding search of the search engine
Really;
Wherein, n is the positive integer more than or equal to 1.
9. device according to claim 8, it is characterised in that also include:
Release module, for after the startup calling module starts n thread to call the n interface simultaneously, release n to be individual
The thread is to thread pool.
10. device according to claim 8, it is characterised in that also include:
Judge module, for after n thread is started with while calling the n interface, sentencing in the startup calling module
Whether the QPS of disconnected current system exceedes threshold value;
If it is, triggering release module, otherwise, trigger control module,
The release module, for discharging the n threads to thread pool;
The control module, for controlling the n threads to be in blocked state.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201710338321.6A CN106970838A (en) | 2017-05-15 | 2017-05-15 | The dispatching method and device of thread during a kind of search engine calling interface |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201710338321.6A CN106970838A (en) | 2017-05-15 | 2017-05-15 | The dispatching method and device of thread during a kind of search engine calling interface |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN106970838A true CN106970838A (en) | 2017-07-21 |
Family
ID=59331636
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201710338321.6A Pending CN106970838A (en) | 2017-05-15 | 2017-05-15 | The dispatching method and device of thread during a kind of search engine calling interface |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN106970838A (en) |
Cited By (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN108009026A (en) * | 2017-10-27 | 2018-05-08 | 深圳市买买提乐购金融服务有限公司 | Interface call method, third party's data access platform and computer-readable medium |
| CN108121815A (en) * | 2017-12-28 | 2018-06-05 | 深圳开思时代科技有限公司 | Auto parts machinery querying method, apparatus and system, electronic equipment and medium |
| CN108279985A (en) * | 2017-12-22 | 2018-07-13 | 努比亚技术有限公司 | A kind of interface requests agreement remodeling method, equipment and computer readable storage medium |
| CN110413317A (en) * | 2019-08-02 | 2019-11-05 | 四川新网银行股份有限公司 | Process interface call method based on configurationization |
| CN115065672A (en) * | 2022-04-29 | 2022-09-16 | 武汉斗鱼鱼乐网络科技有限公司 | SFU system data transmission method and related equipment |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20120222021A1 (en) * | 2008-01-09 | 2012-08-30 | Kan Zhao | Method and System for presenting and analyzing software source code through intermediate representation |
| CN102968510A (en) * | 2012-12-21 | 2013-03-13 | 厦门市美亚柏科信息股份有限公司 | Method and system for searching internet character information |
| CN103246496A (en) * | 2012-02-10 | 2013-08-14 | 上海算芯微电子有限公司 | Non-blocking coprocessor interface method and non-blocking coprocessor interface system |
| US20140344783A1 (en) * | 2011-09-29 | 2014-11-20 | Accenture Global Services Limited | Systems and methods for finding project-related information by clustering applications into related concept categories |
| CN105447067A (en) * | 2014-09-30 | 2016-03-30 | 华东师范大学 | Adaptive sampling method for hot spot microblog data in social media |
-
2017
- 2017-05-15 CN CN201710338321.6A patent/CN106970838A/en active Pending
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20120222021A1 (en) * | 2008-01-09 | 2012-08-30 | Kan Zhao | Method and System for presenting and analyzing software source code through intermediate representation |
| US20140344783A1 (en) * | 2011-09-29 | 2014-11-20 | Accenture Global Services Limited | Systems and methods for finding project-related information by clustering applications into related concept categories |
| CN103246496A (en) * | 2012-02-10 | 2013-08-14 | 上海算芯微电子有限公司 | Non-blocking coprocessor interface method and non-blocking coprocessor interface system |
| CN102968510A (en) * | 2012-12-21 | 2013-03-13 | 厦门市美亚柏科信息股份有限公司 | Method and system for searching internet character information |
| CN105447067A (en) * | 2014-09-30 | 2016-03-30 | 华东师范大学 | Adaptive sampling method for hot spot microblog data in social media |
Cited By (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN108009026A (en) * | 2017-10-27 | 2018-05-08 | 深圳市买买提乐购金融服务有限公司 | Interface call method, third party's data access platform and computer-readable medium |
| CN108279985A (en) * | 2017-12-22 | 2018-07-13 | 努比亚技术有限公司 | A kind of interface requests agreement remodeling method, equipment and computer readable storage medium |
| CN108279985B (en) * | 2017-12-22 | 2021-11-19 | 努比亚技术有限公司 | Interface request protocol transformation method, equipment and computer readable storage medium |
| CN108121815A (en) * | 2017-12-28 | 2018-06-05 | 深圳开思时代科技有限公司 | Auto parts machinery querying method, apparatus and system, electronic equipment and medium |
| CN110413317A (en) * | 2019-08-02 | 2019-11-05 | 四川新网银行股份有限公司 | Process interface call method based on configurationization |
| CN115065672A (en) * | 2022-04-29 | 2022-09-16 | 武汉斗鱼鱼乐网络科技有限公司 | SFU system data transmission method and related equipment |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN106970838A (en) | The dispatching method and device of thread during a kind of search engine calling interface | |
| CN102346767B (en) | Database connection method based on double connection pools | |
| Grosof et al. | SRPT for multiserver systems | |
| CN101645987B (en) | Routing system and routing method for call center | |
| CN103853610B (en) | Method for optimizing resources and device | |
| CN104699542B (en) | Task processing method and system | |
| CN101694631B (en) | Real time job dispatching patcher and method | |
| CN109783229A (en) | The method and device of thread resources distribution | |
| CN111163238A (en) | An intelligent scheduling method for online customer service system | |
| CN106293950B (en) | A kind of resource optimization management method towards group system | |
| CN103634485B (en) | Automatic call distributor and realization method thereof | |
| CN104408169B (en) | Dimension querying method and device based on Multidimensional Expressions language | |
| CN106227782A (en) | A kind of method being inserted into data base based on multi-data source | |
| CN110162388A (en) | A kind of method for scheduling task, system and terminal device | |
| CN102929961A (en) | Data processing method and device thereof based on building quick data staging channel | |
| CN106790022B (en) | Communication means and its system based on more inquiry threads | |
| CN105117283A (en) | Task splitting method and system | |
| CN106453977A (en) | Comprehensive queuing method for multimedia comprehensive customer service representatives | |
| CN112449061B (en) | Outbound call task assignment method, device, computer equipment and readable storage medium | |
| CN108628671A (en) | Method for scheduling task and device | |
| CN108681481A (en) | The processing method and processing device of service request | |
| CN104052677B (en) | The soft load-balancing method and device of data mapping | |
| CN107493336A (en) | Realize method and apparatus, computer-readable recording medium and the storage control of client plug-in | |
| CN100349149C (en) | Process Scheduling Method of Embedded Real-time Operating System | |
| CN105207856A (en) | Load balancing system and method based on SDN virtual switch |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| RJ01 | Rejection of invention patent application after publication | ||
| RJ01 | Rejection of invention patent application after publication |
Application publication date: 20170721 |