Summary of the invention
The embodiment of the invention provides a kind of method and device of data processing, by using method provided by the invention,
Query result can be pushed in real time, so that the waiting for reducing user's request is time-consuming, improve search efficiency.
First aspect present invention discloses a kind of method of data processing, which comprises
Inquiry request is received, includes inquiry content in the inquiry request;
Determine grouping information corresponding to the inquiry content;
Search the address information of memory node corresponding to the grouping information;
If the corresponding memory node have it is multiple, according to each memory node address information carry out multithreading visit
It asks;Wherein, the corresponding memory node of per thread;
Per thread is traversed in the multithreading to determine whether there is first access result;
First described access is as a result, be then presented first described access result at default interface if it exists.
Wherein, the method also includes:
If it is described first access result be it is multiple, to first access result similarity be ranked up;
The access result of sequence first is sent to target mobile device, wherein the target mobile device refers to default model
Enclose interior mobile device.
Wherein, optionally, the method also includes:
After prefixed time interval if detect the presence of second batch access as a result, if described first be presented at default interface visit
Ask result and second batch access result.
Wherein, optionally, first described access result is presented at default interface and second batch accesses result, comprising:
First described access result and second batch access result are ranked up according to the similarity of inquiry, obtained
Ranking results;
The ranking results are presented at the default interface.
Wherein, optionally, the first access result and the second access result is presented at default interface, comprising:
The sequence of first described access result and second batch access result time is ranked up;
The ranking results are presented at the default interface.
Second aspect of the present invention discloses a kind of device of data processing, and described device includes:
Receiving unit includes inquiry content in the inquiry request for receiving inquiry request;
Determination unit, for determining grouping information corresponding to the inquiry content;
Searching unit, for searching the address information of memory node corresponding to the grouping information;
Access unit, if having for the corresponding memory node it is multiple, according to the address information of each memory node
Carry out multi-thread access;Wherein, the corresponding memory node of per thread;
Traversal Unit, for traversing in the multithreading per thread to determine whether there is first access result;
Display unit, for first described access if it exists as a result, first described access then is presented at default interface
As a result.
Wherein, optionally, the display unit, if detecting the presence of second batch access knot after being also used to prefixed time interval
Fruit is then presented first described access result at default interface and the second batch accesses result.
Wherein, a kind of mode of possible realization, the display unit, be specifically used for will first described access result and
The second batch access result is ranked up according to the similarity of inquiry, obtains ranking results;Institute is presented at the default interface
State ranking results.
Wherein, alternatively possible implementation, the display unit, for will first described access result and described
The sequence of second batch access result time is ranked up;The ranking results are presented at the default interface.
Optionally, described device further includes sequencing unit and transmission unit;
The sequencing unit, if for it is described first access result be it is multiple, to first access result it is similar
Degree is ranked up;
The transmission unit, for sending the access result of sequence first to target mobile device, wherein the target is moved
Dynamic equipment refers to the mobile device in preset range.
As can be seen that in the scheme of the embodiment of the present invention, which comprises receive inquiry request, the inquiry is asked
It include inquiry content in asking;Determine grouping information corresponding to the inquiry content;It searches and is deposited corresponding to the grouping information
Store up the Internet protocol address and port numbers of node;If the corresponding memory node have it is multiple, according to each storage save
The Internet protocol address and port numbers of point carry out multi-thread access;Wherein, the corresponding memory node of per thread;Traversal
Per thread is in the multithreading to determine whether there is first access result;First described access is as a result, then if it exists
First described access result is presented at default interface.The technical solution provided through the invention is deposited using multithreading to multiple
Storage node accesses simultaneously, and the efficiency concurrently inquired can be improved;If receive access as a result, if in time present be able to access that
As a result, time-consuming to reduce the waiting of user's request, further, if continue to receive access as a result, if all visits for will receiving
Ask result refreshed to show all access for currently being received as a result, so as to it is dynamic present in real time inquiry into
Exhibition.
Specific embodiment
In order to enable those skilled in the art to better understand the solution of the present invention, below in conjunction in the embodiment of the present invention
Attached drawing, technical solution in the embodiment of the present invention are explicitly described, it is clear that described embodiment is the present invention one
The embodiment divided, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art are not doing
Every other embodiment obtained under the premise of creative work out, should fall within the scope of the present invention.
The term " first " that occurs in description of the invention, claims and attached drawing, " second " and " third " etc. are to use
In the different object of difference, and it is not intended to describe specific sequence.In addition, term " includes " and " having " and they are any
Deformation, it is intended that cover and non-exclusive include.Such as contain the process, method, system, product of a series of steps or units
Or equipment is not limited to listed step or unit, but optionally further comprising the step of not listing or unit, or can
Selection of land further includes the other step or units intrinsic for these process, methods, product or equipment.
Referring to Fig. 1, Fig. 1 is a kind of flow diagram of the method for data processing provided by one embodiment of the present invention.
Wherein, as shown in Figure 1, a kind of method for data processing that one embodiment of the present of invention provides, the method includes following interior
Hold:
101, inquiry request is received, includes inquiry content in the inquiry request;
Wherein, executing subject of the invention can be server, this server has search engine functionality.Specifically it can wrap
It includes the various handheld devices with search engine functionality, mobile unit, wearable device, calculate equipment or other processing equipments,
And various forms of user equipmenies (User Equipment, UE), mobile station (Mobile Station, MS), terminal device
(terminal device) etc..Operating system involved by the embodiment of the present application is managed collectively to hardware resource,
And provide a user the software systems of business interface.
Wherein, it should be pointed out that the content of inquiry can be user's input, be also possible to the picture of user's selection.
Wherein, optionally, inquiry content may include the video clip that camera or monitor are sent, in the video clip
Including character image.
Wherein optional, inquiry content can be the personage's picture or keyword or voice that other equipment send over.
102, grouping information corresponding to the inquiry content is determined;
Wherein it is possible to understand, the corresponding grouping information of the determination inquiry content specifically includes: obtaining use
The picture attribute mark of picture to be checked in the inquiry request of family, determines user's figure to be checked according to picture attribute mark
The grouping information of piece.
For example, such as in search cluster memory node according to the difference of storage content is divided into portrait group and human body group.
When user carries out picture query, if the picture attribute of the picture to be checked of user's input is identified as dynamic human face image, really
The user query content is corresponding calmly is grouped into portrait group.
Optionally, the inquiry request of user may be text query request, when user query request to ask for text query
When asking, the text information that user inputs can be input in semantic model, to identify the semanteme of user, further according to the language of user
Justice determines grouping information corresponding to user query content.
Optionally, the inquiry request of user may be speech polling request, when the request of user query is speech polling
When request, the voice messaging of user can be split as to short sentence, then by the short sentence information input into semantics recognition model with
The semanteme for identifying user determines grouping information corresponding to user query content further according to the semanteme of user.
103, the address information of memory node corresponding to the grouping information is searched;
Wherein, it should be pointed out that there are multiple search nodes for search service, by the Internet protocol IP of all nodes
Location and port are registered to registration center (for example being known as zookeeper).When receiving inquiry request, obtained from zookeeper
IP and the port for taking search node corresponding to the grouping information are gone to request multiple search nodes using multithreading.It can manage
Search efficiency can be improved using multithreading request in solution.
Further it will be understood that registration service is in order to dynamically manage search node, when these search nodes are infused
When volume, it can be registered under the catalogue of corresponding grouping information.
For example, address information can be the Internet protocol address of memory node.Certainly, which can be with
It is the Internet protocol address and port numbers of memory node.
If 104, the corresponding memory node has multiple, according to each memory node Internet protocol address and
Port numbers carry out multi-thread access;Wherein, the corresponding memory node of per thread;
For example, for example the grouping corresponds to 10 memory nodes and then makes each line then being created that 10 threads
Journey accesses a memory node.It is understood that having a thread in such as 10 threads is A thread, then can basis
The IP and port numbers of one of node access the node.
Certainly, above-mentioned 10 memory nodes are merely illustrative, and a grouping also may include 20,30 storage sections
Point, herein with no restrictions.
Wherein, the process of access can be understood as the process of picture match.Target person picture can be carried when accessed node,
Each node can match the picture of itself storage to return to matching result with target person picture.
Wherein it is possible to understand, the process of picture match includes: to be matched the characteristic point of the picture of extraction to obtain
Take similarity (i.e. matching result).
105, per thread is traversed in the multithreading to determine whether there is first access result;
Wherein it is possible to understand, if there are many data stored in a node, the speed that accesses
It is just very slow;As soon as, whereas if node summarize storage data it is seldom if, then the speed accessed is quickly.Therefore, each
The access speed of thread is different.
Wherein, it should be pointed out that such as create 10 threads and remove 10 memory nodes of access;Traverse this 10 threads
Later, if there is 6 threads have access as a result, the access result of so this 6 threads is exactly first access result.
106, described first accesses as a result, first described access result then is presented at default interface if it exists.
It is understood that server can show first access knot at this time with foreground (such as user interface or webpage)
Fruit.
It is understood that first access result described in presenting at default interface includes: can be to first received
It criticizes access result to be ranked up according to similarity, the result of sequence is then presented at default interface.
For example, the format of presentation may is that first node there are A picture, and the similarity with Target Photo is 99%.
Certainly it can be attached to the thumbnail of A or the address of A picture below.
Optionally, after prefixed time interval, can traverse again last time do not feed back access result thread to determine whether
As a result it feeds back.The method also includes: after prefixed time interval if detect the presence of second batch access as a result, if at default interface
First described access result is presented and the second batch accesses result.
Wherein, prefixed time interval can be system default, be also possible to set by user.For example can be 0.1 second,
Or 0.2 second, herein with no restrictions.
It is understood that such as 10 threads, last time has 6 threads to have access as a result, this time traversing remaining 4
Thread, if there are two fed back access as a result, so the two access results are exactly second batch access result again.
So first access result and second batch access result can be shown on foreground.
Optionally, first described access result is presented at default interface and second batch accesses result, comprising:
First described access result and second batch access result are ranked up according to the similarity of inquiry;Institute
It states default interface and the ranking results is presented.
Optionally, the first access result and the second access result is presented at default interface, comprising:
The sequence of first described access result and second batch access result time is ranked up;Described default
The ranking results are presented in interface.That is, being needed when display since second batch accesses the later of result feedback
It comes behind first display result.
For example, just data are used if there is result returns by the request situation of the multiple threads of traversal queries
MQTT+WEBSOCKET is pushed to front end page, as long as later thread has detected result return, continues to push result
To the page.Wherein, MQTT (message queue telemetering transmission) is under iso standard (ISO/IEC PRF 20922) based on publish/subscribe
The messaging protocol of normal form.It works on TCP/IP (transmission control protocol/Internet Protocol) protocol suite, is for hardware
The publish/subscribe type messaging protocol designed in the case where remote equipment and Network status bad luck that can be low.Wherein,
WebSocket (webpage socket) is a kind of agreement that full-duplex communication is carried out in single TCP (transmission control protocol) connection.
WebSocket makes the data exchange between client and server become simpler, allows server-side actively to client
Propelling data.In WebSocket API (webpage socket application programming interfaces), browser and server only needs to be performed one
It is secondary to shake hands, persistent connection just can be directly created between the two, and carries out bidirectional data transfers.
Further it will be understood that due to front and back constantly push as a result, it is desirable to which front end web page will be returned constantly
As a result again according to the similarity of inquiry or time-sequencing.For example, the result that the same theme returns can be recorded in
It is constantly tired that the result newly added is added up and sorted in one global list set, then refresh the display data page in real time.
If it is described first access result be it is multiple, to first access result similarity be ranked up;To target
Mobile device sends the access result of sequence first, wherein the target mobile device refers to the mobile device in preset range.
For example, if having there is access as a result, so the access can be sent to nearest mobile device as a result, the such as visit
Ask to include information with the picture of Target Photo matched memory node storage in result, which can be personage in picture
Information, such as name, age, address etc..For example, in a kind of scene, camera constantly acquires portrait data, this hair
The server that bright embodiment provides can constantly compare blacklist library through the above technical solution, when discovery finds corresponding blacklist
In portrait record, then comparing result is sent to distance when the nearest mobile device of preceding camera, in this way based on MQTT in real time
Patrol can be allowed to be quickly found out counterpart personnel.
In addition, it is further alternative, the method also includes:
Certainly, if can also continue to push new letter after receiving second batch access result, third batch access result
Breath, for example the information of sequence first can be pushed every time, it can be and pushed to newest mobile device, is also possible to default
Equipment push in range.
It include in inquiry in the inquiry request as can be seen that receiving inquiry request in the scheme of the embodiment of the present invention
Hold;Determine grouping information corresponding to the inquiry content;Search the internet of memory node corresponding to the grouping information
Protocol address and port numbers;If the corresponding memory node have it is multiple, according to the Internet protocol of each memory node
Address and port numbers carry out multi-thread access;Wherein, the corresponding memory node of per thread;It traverses every in the multithreading
A thread is to determine whether there is first access result;First described access at default interface as a result, then present if it exists
First described access result.The technical solution provided through the invention can push query result in real time, to reduce user
The waiting of request is time-consuming.Since the present invention can push query result in real time, can prevent from leading because waiting whole query result
The case where causing request timed out.
Referring to Fig. 2, Fig. 2 be another embodiment of the present invention provides another data processing method flow signal
Figure.Wherein, as shown in Figure 2, which comprises
201, inquiry request is received, includes inquiry content in the inquiry request;
202, grouping information corresponding to the inquiry content is determined;
203, the Internet protocol address and port numbers of memory node corresponding to the grouping information are searched;
If 204, the corresponding memory node has multiple, according to each memory node Internet protocol address and
Port numbers carry out multi-thread access;Wherein, the corresponding memory node of per thread;
205, per thread is traversed in the multithreading to determine whether there is first access result;
206, described first accesses as a result, first described access result then is presented at default interface if it exists.
If 207, detecting the presence of second batch access after prefixed time interval as a result, will first described access result and institute
It states second batch access result to be ranked up according to the similarity of inquiry, obtains ranking results;
208, the ranking results are presented at the default interface.
As can be seen that can carry out continuous dynamic to the query result received in the scheme of the present embodiment and push, from
And improve user satisfaction.
As shown in figure 3, another embodiment of the present invention provides another data processing method flow schematic diagram.Its
In, as shown in Figure 3, which comprises
301, inquiry request is received, includes inquiry content in the inquiry request;
302, grouping information corresponding to the inquiry content is determined;
303, the Internet protocol address and port numbers of memory node corresponding to the grouping information are searched;
If 304, the corresponding memory node has multiple, according to each memory node Internet protocol address and
Port numbers carry out multi-thread access;Wherein, the corresponding memory node of per thread;
305, per thread is traversed in the multithreading to determine whether there is first access result;
306, if it exists first described access result and first described access result be it is multiple, then to first access
As a result similarity is ranked up, and obtains ranking results;
307, the access result of sequence first is sent to target mobile device, wherein the target mobile device refers to pre-
If the mobile device in range.
Wherein, it should be pointed out that the particular content of Fig. 3 described embodiment can refer to embodiment corresponding to Fig. 1
Explanation.
As can be seen that in the scheme of the present embodiment, it can be to the result inquired by multithreading dynamically to default model
Mobile terminal push in enclosing, so that the waiting for reducing user's request is time-consuming.
As shown in figure 4, a kind of data processing equipment 400 that one embodiment of the present of invention provides, wherein the device 400
Including with lower unit:
Receiving unit 401 includes inquiry content in the inquiry request for receiving inquiry request;
Determination unit 402, for determining grouping information corresponding to the inquiry content;
Searching unit 403, for searching the address information of memory node corresponding to the grouping information;
Access unit 404, if having for the corresponding memory node it is multiple, according to each memory node address believe
Breath carries out multi-thread access;Wherein, the corresponding memory node of per thread;
Traversal Unit 405, for traversing in the multithreading per thread to determine whether there is first access result;
Display unit 406, for first described access if it exists as a result, first described visit then is presented at default interface
Ask result.
Wherein, optionally, display unit 406, if detecting the presence of second batch access knot after being also used to prefixed time interval
Fruit is then presented first described access result at default interface and the second batch accesses result.
Wherein, display unit 406, be specifically used for will first described access result and second batch access result according to
The similarity of inquiry is ranked up, and obtains ranking results;The ranking results are presented at the default interface.
Alternatively, display unit 406, for described first to be accessed result and second batch access result time
Sequence be ranked up;The ranking results are presented at the default interface.
Optionally, device 400 further includes sequencing unit 407 and transmission unit 408;
Sequencing unit 407, if for it is described first access result be it is multiple, to first access result similarity
It is ranked up;
Transmission unit 408, for sending the access result of sequence first to target mobile device, wherein the target is moved
Dynamic equipment refers to the mobile device in preset range.
Wherein, receiving unit 401, determination unit 402, searching unit 403, access unit 404, Traversal Unit 405, presentation
Unit 406, sequencing unit 407 and transmission unit 408 can be used for executing method described in step 101-106 in embodiment 1,
Description of the detailed in Example 1 to the method is specifically described, details are not described herein.
As shown in figure 5, a kind of data processing equipment 500 that one embodiment of the present of invention provides, wherein the device 500
Including with lower unit:
Receiving unit 501 includes inquiry content in the inquiry request for receiving inquiry request;
Determination unit 502, for determining grouping information corresponding to the inquiry content;
Searching unit 503, for search memory node corresponding to the grouping information Internet protocol address and
Port numbers;
Access unit 504, if having for the corresponding memory node it is multiple, according to the internet of each memory node
Protocol address and port numbers carry out multi-thread access;Wherein, the corresponding memory node of per thread;
Traversal Unit 505, for traversing in the multithreading per thread to determine whether there is first access result;
Display unit 506, for first described access if it exists as a result, first described visit then is presented at default interface
Ask result.
Sequencing unit 507, if for second batch access is detected the presence of after prefixed time interval as a result, will it is described first
Access result and second batch access result are ranked up according to the similarity of inquiry, obtain ranking results;
Display unit 506, for the ranking results to be presented at the default interface.
Wherein, said units 501-507 can be used for executing method described in step 201-208 in embodiment 2, specifically retouch
Description of the detailed in Example 2 to the method is stated, details are not described herein.
As shown in fig. 6, a kind of data processing equipment 600 that one embodiment of the present of invention provides, wherein the device 600
Including with lower unit:
Receiving unit 601 includes inquiry content in the inquiry request for receiving inquiry request;
Determination unit 602, for determining grouping information corresponding to the inquiry content;
Searching unit 603, for search memory node corresponding to the grouping information Internet protocol address and
Port numbers;
Access unit 604, if having for the corresponding memory node it is multiple, according to the internet of each memory node
Protocol address and port numbers carry out multi-thread access;Wherein, the corresponding memory node of per thread;
Traversal Unit 605, for traversing in the multithreading per thread to determine whether there is first access result;
Sequencing unit 606, for first described access result if it exists and first described access result be it is multiple, then
The similarity of first access result is ranked up, ranking results are obtained;
Transmission unit 607, for sending the access result of sequence first to target mobile device, wherein the target is moved
Dynamic equipment refers to the mobile device in preset range.
Wherein, said units 601-607 can be used for executing method described in step 301-307 in embodiment 2, specifically retouch
Description of the detailed in Example 3 to the method is stated, details are not described herein.
Referring to Fig. 7, in another embodiment of the present invention, providing a kind of data processing equipment 700.Device 700 wraps
Include the hardware such as CPU 701, memory 702, bus 703, transceiver 704.Above-mentioned Fig. 4-logic unit shown in fig. 6 can pass through figure
Hardware device shown in 7 is realized.
Wherein, CPU 701 executes the server program being stored in advance in memory 702, which specifically includes:
Inquiry request is received, includes inquiry content in the inquiry request;
Determine grouping information corresponding to the inquiry content;
Search the address information of memory node corresponding to the grouping information;
If the corresponding memory node have it is multiple, according to each memory node address information carry out multithreading visit
It asks;Wherein, the corresponding memory node of per thread;
Per thread is traversed in the multithreading to determine whether there is first access result;
First described access is as a result, be then presented first described access result at default interface if it exists.
Wherein, the implementation procedure further include:
After prefixed time interval if detect the presence of second batch access as a result, if described first be presented at default interface visit
Ask result and second batch access result.
Specifically, first described access result and second batch access result is presented at default interface, comprising:
First described access result and second batch access result are ranked up according to the similarity of inquiry, obtained
Ranking results;
The ranking results are presented at the default interface.
Alternatively, the first access result and the second access result is presented at default interface, comprising:
The sequence of first described access result and second batch access result time is ranked up;
The ranking results are presented at the default interface.
Optionally, the implementation procedure further include:
If it is described first access result be it is multiple, to first access result similarity be ranked up;
The access result of sequence first is sent to target mobile device, wherein the target mobile device refers to default model
Enclose interior mobile device.
From the above it can be seen that receiving inquiry request in technical solution provided in an embodiment of the present invention, including in the inquiry request
Inquire content;Determine grouping information corresponding to the inquiry content;Search memory node corresponding to the grouping information
Internet protocol address and port numbers;If the corresponding memory node have it is multiple, according to the interconnection of each memory node
FidonetFido address and port numbers carry out multi-thread access;Wherein, the corresponding memory node of per thread;It traverses described multi-thread
Per thread is in journey to determine whether there is first access result;First described access is as a result, then on default boundary if it exists
First described access result is presented in face.The technical solution provided through the invention can push query result in real time, to drop
The waiting of low user's request is time-consuming.
In another embodiment of the present invention, a kind of computer program product, the computer program product are disclosed
In include program code;When said program code is run, the method in preceding method embodiment can be performed.
In another embodiment of the present invention, a kind of chip is disclosed, includes program code in the chip;Work as institute
When stating program code and being run, the method in preceding method embodiment can be performed.
In several embodiments provided herein, it should be understood that disclosed device, it can be by another way
It realizes.For example, the apparatus embodiments described above are merely exemplary, such as the division of the unit, it is only a kind of
Logical function partition, there may be another division manner in actual implementation, such as multiple units or components can combine or can
To be integrated into another system, or some features can be ignored or not executed.Another point, shown or discussed is mutual
Coupling, direct-coupling or communication connection can be through some interfaces, the indirect coupling or communication connection of device or unit,
It can be electrical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit
The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple
In network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme
's.
It, can also be in addition, the functional units in various embodiments of the present invention may be integrated into one processing unit
It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list
Member both can take the form of hardware realization, can also realize in the form of software functional units.
If the integrated unit is realized in the form of SFU software functional unit and sells or use as independent product
When, it can store in a computer readable storage medium.Based on this understanding, technical solution of the present invention is substantially
The all or part of the part that contributes to existing technology or the technical solution can be in the form of software products in other words
It embodies, which is stored in a storage medium, including some instructions are used so that a computer
Equipment (can for personal computer, server or network equipment etc.) execute each embodiment the method for the present invention whole or
Part steps.And storage medium above-mentioned includes: that USB flash disk, read-only memory (ROM, Read-Only Memory), arbitrary access are deposited
Reservoir (RAM, Random Access Memory), mobile hard disk, magnetic or disk etc. be various to can store program code
Medium.
The above, the above embodiments are merely illustrative of the technical solutions of the present invention, rather than its limitations;Although referring to before
Stating embodiment, invention is explained in detail, those skilled in the art should understand that: it still can be to preceding
Technical solution documented by each embodiment is stated to modify or equivalent replacement of some of the technical features;And these
It modifies or replaces, the range for technical solution of various embodiments of the present invention that it does not separate the essence of the corresponding technical solution.