Fuzzy query method, system and device

By setting a preset data index in the target query server and forwarding the fuzzy query request to the server, the problem of LDAP's inefficiency in fuzzy queries is solved, and a faster fuzzy query speed is achieved.

CN120067169APending Publication Date: 2025-05-30KYLIN CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510069585.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-16
Publication Date
2025-05-30

AI Technical Summary

Technical Problem

LDAP needs to scan the entire directory tree in fuzzy queries, resulting in low query efficiency, especially when the amount of data is large.

Method used

By setting a preset data index in the target query server, the fuzzy query request is forwarded to the target query server instead of the fuzzy query by the LDAP server. The target query server quickly locates and finds data based on preset data index.

Benefits of technology

The speed of fuzzy queries is improved, which is better than the query speed of LDAP servers. By replacing the original slow method with faster and more efficient fuzzy queries, the fuzzy queries on the server are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120067169A_ABST
    Figure CN120067169A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of data processing, in particular to a fuzzy query method, system and device. The fuzzy query method comprises the following steps: when it is detected that a client sends a fuzzy query request, sending the fuzzy query request to a target query server, so that the target query server queries target data according to the fuzzy query request and a preset data index; receiving target data returned by the target query server; feeding back the target data to the client to complete data query; wherein the fuzzy query request is sent when the client requests to search target data stored in the LDAP server; storage data in the LDAP server is stored in the target query server, and the preset data index is set by the target query server based on the storage data. The fuzzy query method provided by the invention can improve the fuzzy query speed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing, and in particular, to a fuzzy query method, system and device. Background Art

[0002] Fuzzy query refers to a query method for finding data items that partially match a keyword. For example: when the user does not fully know the complete content of the data item, by inputting partial information to find the data item that matches the partial information. This query method belongs to fuzzy query.

[0003] LDAP (Lightweight Directory Access Protocol) is a protocol for accessing and maintaining a distributed directory information service, and is often used for centralized management and query of directory information. For example, users can store data through LDAP and use LDAP to query the stored data.

[0004] LDAP usually stores data in a tree structure to form a directory tree. That is, the directory tree is equivalent to a set of stored data. When the user uses LDAP for fuzzy query, LDAP needs to scan the entire directory tree according to the information input by the user to find the matching data.

[0005] However, the inventor found that LDAP needs to scan the entire directory tree in fuzzy query, resulting in low query efficiency. Especially when the data volume is large and the directory tree is very large, scanning the entire directory tree takes a long time and the fuzzy query speed is slow. Summary of the Invention

[0006] The present application aims to provide a fuzzy query method, system and device.

[0007] According to one aspect of the present application, a fuzzy query method is proposed. The fuzzy query method includes: when detecting that the client sends a fuzzy query request, sending the fuzzy query request to the target query server, so that the target query server queries the target data according to the fuzzy query request and a preset data index; receiving the target data returned by the target query server; and feeding back the target data to the client to complete the data query; wherein, the fuzzy query request is sent by the client to request to find the target data stored in the LDAP server; the target query server stores the stored data in the LDAP server, and the preset data index is set by the target query server based on the stored data.

[0008] According to some embodiments, when detecting that the client sends a fuzzy query request, sending the fuzzy query request to a target query server includes: when receiving the fuzzy query request forwarded by a distribution server, sending the fuzzy query request to the target query server; wherein, the distribution server is used to receive the fuzzy query request sent by the client and forward the fuzzy query request.

[0009] According to some embodiments, when detecting that the client sends a fuzzy query request, sending the fuzzy query request to a target query server includes: when detecting that the client sends a fuzzy query request, converting the fuzzy query request into a fuzzy query statement, wherein the fuzzy query statement is a statement recognizable by the target query server; sending the fuzzy query statement to the target query server.

[0010] According to some embodiments, feeding back target data to the client to complete data query includes: performing formatting processing on the target data to obtain the formatted target data; feeding back the formatted target data to the client to complete data query.

[0011] According to another aspect of the present application, the present application also provides another fuzzy query method, which is executed by a target query server. The fuzzy query method includes: when receiving a fuzzy query request sent by an intermediate server, searching for target data based on the fuzzy query request and a preset data index; feeding back the target data to the intermediate server so that the intermediate server feeds back the target data to the client to complete data query; wherein, the fuzzy query request is sent by the intermediate server to the target query server when detecting that the client sends a fuzzy query request; the fuzzy query request is sent by the client to request to search for target data stored in an LDAP server; the target query server stores the stored data in the LDAP server, and the preset data index is set based on the stored data.

[0012] According to some embodiments, the fuzzy query method further includes: obtaining the stored data in the LDAP server from the LDAP server, wherein each stored data includes at least two data fields; integrating the respective data fields of the stored data to obtain the integrated stored data; storing the integrated stored data so that when the target query server queries the target data, it searches from each of the integrated stored data.

[0013] According to some embodiments, when receiving a fuzzy query request sent by an intermediate server, finding target data based on the fuzzy query request and a preset data index includes: when receiving a fuzzy query request sent by the intermediate server, judging, based on the fuzzy query request, whether the data queried by the fuzzy query request belongs to hot data; if it belongs to hot data, finding the target data from the cache; if it does not belong to hot data, finding the target data based on the fuzzy query request and the preset data index; wherein, the stored data belonging to hot data is stored in the cache of the target query server.

[0014] According to another aspect of the present application, the present application provides a fuzzy query system, which includes: an LDAP server storing stored data; an intermediate server that, when detecting a fuzzy query request sent by a client, sends the fuzzy query request, wherein the fuzzy query request is sent by the client to request to find target data stored in the LDAP server; a target query server storing the stored data in the LDAP server and having a preset data index set based on the stored data; the target query server is configured to receive the fuzzy query request sent by the intermediate server, find the target data based on the fuzzy query request and the preset data index, and send the target data to the intermediate server; the intermediate server is configured to, when receiving the target data, feedback the target data to the client to complete the data query.

[0015] According to another aspect of the present application, the present application provides a fuzzy query device, which includes: a query request sending module configured to, when detecting a fuzzy query request sent by a client, send the fuzzy query request to a target query server so that the target query server queries the target data according to the fuzzy query request and the preset data index; a data receiving module configured to receive the target data returned by the target query server; a data sending module configured to feedback the target data to the client to complete the data query; wherein, the fuzzy query request is sent by the client to request to find target data stored in the LDAP server; the target query server stores the stored data in the LDAP server, and the preset data index is set by the target query server based on the stored data.

[0016] According to another aspect of the present application, the present application also provides another fuzzy query device. The fuzzy query device includes: a data query module, configured to, when receiving a fuzzy query request sent by an intermediate server, search for target data based on the fuzzy query request and a preset data index; a data feedback module, configured to feedback the target data to the intermediate server, so that the intermediate server feedbacks the target data to the client to complete the data query; wherein, the fuzzy query request is sent by the intermediate server to a target query server when the intermediate server detects that the client sends a fuzzy query request; the fuzzy query request is sent by the client for requesting to search for target data stored in an LDAP server; the target query server stores the stored data in the LDAP server, and the preset data index is set based on the stored data.

[0017] In summary, the present application at least has the following beneficial effects: When the client sends a fuzzy query request, the fuzzy query request is forwarded to the target query server, and the target query server performs the fuzzy query, rather than the LDAP server performing the fuzzy query. Since a preset data index is set for the stored data in the target query server, the target query server can quickly locate and search for data according to the preset data index, without having to traverse the entire data set like the LDAP server. This can enable the target query server to perform the fuzzy query faster than the query speed of the LDAP server. That is, in the present application, a faster and more efficient fuzzy query method used by the target query server replaces the slow fuzzy query method used by the original LDAP server, thereby improving the fuzzy query speed of the server side. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0019] Figure 1 It is a schematic diagram of the system architecture of the fuzzy query system according to the embodiment of the present application; Figure 2 It is an example diagram of the processing flow of the fuzzy query method according to the embodiment of the present application; Figure 3 It is a block diagram of the structure of a fuzzy query device according to the embodiment of the present application; Figure 4 It is a block diagram of the structure of another fuzzy query device according to the embodiment of the present application.

[0020] Description of the reference numerals: 1001. Query request sending module; 1002. Data receiving module; 1003. Data sending module; 1101. Data query module; 1102. Data feedback module; 1201. Processor; 1202. Bus; 1203. Memory; 1204. Transceiver. Detailed implementation manners

[0021] Example embodiments will now be described more fully with reference to the accompanying drawings. However, the example embodiments can be implemented in various forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that this application will be thorough and complete, and will fully convey the concept of the example embodiments to those skilled in the art. Like reference numerals in the figures denote like or similar parts, and thus their repetitive description will be omitted.

[0022] The features, structures, or characteristics described may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of the embodiments of the present disclosure. However, those skilled in the art will realize that the technical solutions of the present disclosure can be practiced without one or more of these specific details, or can be implemented in other ways, components, materials, devices, etc. In these cases, well-known structures, methods, devices, implementations, materials, or operations will not be shown or described in detail.

[0023] Furthermore, the terms "including" and "having", and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but optionally further includes steps or units not listed, or optionally further includes other steps or units inherent to these processes, methods, products, or devices.

[0024] The terms "first", "second", etc. in the description and claims of this application and the above drawings are used to distinguish different objects, rather than to describe a specific order.

[0025] Next, with reference to the accompanying drawings in the embodiments of the present application, the technical solutions of the present application will be clearly and completely described. Obviously, the described embodiments are part of the embodiments of the present application, rather than all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative efforts fall within the scope of protection of the present application.

[0026] According to one aspect of the present application, an embodiment of the present application provides a fuzzy query method. The fuzzy query method is applied to a fuzzy query system. Refer to Figure 1, the fuzzy query system includes an intermediate server, an LDAP server, and a target query server. The intermediate server, the LDAP server, and the target query server are all deployed on the server side. The server side interacts with the client side.

[0027] It should be noted that the intermediate server, the LDAP server, and the target query server can be the same server or different servers, which is not limited here.

[0028] In the embodiment of the present application, the fuzzy query method specifically includes step S210, step S220, and step S230.

[0029] In step S210, when detecting that the client sends a fuzzy query request, the intermediate server sends the fuzzy query request to the target query server so that the target query server queries the target data according to the fuzzy query request and the preset data index.

[0030] Among them, the fuzzy query request is sent by the client to request to find the target data stored in the LDAP server.

[0031] According to the example embodiment, the user can send a fuzzy query request in the client, the client sends the fuzzy query request to the server side, and the intermediate server in the server side receives the fuzzy query request.

[0032] When the intermediate server receives the fuzzy query request, it sends the fuzzy query request to the target query server and does not send it to the LDAP server. In this way, the intermediate server sends the fuzzy query request to the target query server instead of the LDAP server, so that the target query server can perform the fuzzy query, and the LDAP server will not perform the fuzzy query operation.

[0033] According to the example embodiment, the target query server stores the stored data in the LDAP server, and the preset data index is set by the target query server based on the stored data. The stored data is the data stored in the LDAP server, such as the relevant data of all contacts in the address book.

[0034] In this way, when the target query server receives the fuzzy query request, it can quickly determine the storage location of the target data targeted by the fuzzy query request in the target query server according to the fuzzy query request and the preset data index, and then find the target data from the corresponding storage location. The target query server then sends the found target data to the intermediate server.

[0035] In step S220, the intermediate server receives the target data returned by the target query server.

[0036] In step S230, the intermediate server feeds back the target data to the client to complete the data query.

[0037] According to the exemplary embodiment, when the intermediate server receives the target data returned by the target query server, it can feed back the target data to the client, thereby completing the data query.

[0038] Since the LDAP server stores data in the form of files, and LDAP can only traverse the entire directory tree for fuzzy queries during fuzzy queries, the directory tree is a file tree in a tree structure formed by each data, which is equivalent to querying in a way of traversing the entire data set.

[0039] The target query server stores all the stored data in the LDAP server, and a preset data index is set for the stored data, and fuzzy queries are performed according to the preset data index.

[0040] An index is a data structure used to improve the speed of data retrieval in the fields of databases and information systems. It is similar to the table of contents of a book and can help users quickly find the information they need without traversing the entire data set. The index organizes one or more columns of data in a database table in a specific order by creating additional data structures (such as B-trees, hash tables, etc.) and stores the physical addresses of these data.

[0041] Therefore, the fuzzy query speed of the target query server is better than that of the LDAP server. In this way, when the user sends a fuzzy query request, the server side can use the target query server for proxy queries, instead of the LDAP server for fuzzy queries, that is, it is equivalent to using a faster and more efficient fuzzy query method to replace the original slow fuzzy query method, so as to improve the fuzzy query speed of the server side.

[0042] In the embodiment of the present application, when the user sends a fuzzy query request, the fuzzy query request is forwarded to the target query server, and the target query server performs the fuzzy query, rather than the LDAP server performing the fuzzy query. Since a preset data index is set for the stored data in the target query server, and the data can be quickly located and found according to the preset data index, without having to traverse the entire data set like the LDAP server, the speed of using the target query server for fuzzy queries is better than that of the LDAP server. That is, in the embodiment of the present application, a faster and more efficient fuzzy query method used by the target query server replaces the original slow fuzzy query method used by the LDAP server, thereby improving the fuzzy query speed of the server side.

[0043] According to some embodiments, in order to synchronously store the stored data in the LDAP server to the target query server, in the embodiments of the present application, the server can listen for operations such as addition, deletion, and editing of data entries in the LDAP server through a synchronization script, and use the synchronization script to synchronize the changed data to the target query server.

[0044] According to some embodiments, when the target query server stores the stored data in the LDAP server, it can directly store the stored data, or filter out the key stored data fields from the stored data and only store the key stored data fields. Each stored data includes at least two data fields. For example, the LDAP server contains the stored data corresponding to each contact. The stored data corresponding to each contact includes data fields such as name, email address, company name, company address, and job title.

[0045] The key stored data fields are important data fields of the stored data in the LDAP server. For example, contact name, email address, company, and unique path, etc.

[0046] According to some embodiments, when the target query server stores the stored data in the LDAP server, it will also integrate the respective data fields of the stored data and store the integrated stored data. This can enable the target query server to search from the integrated stored data when querying the target data.

[0047] For example, among the data stored in the LDAP server, the stored data corresponding to Zhang San involves 12 data fields. The target query server can merge the 12 data fields into one data field and then store it.

[0048] Through the above embodiments, the target query server integrates the respective data fields of the stored data into one field and then stores it. This reduces the amount of data stored in the server and further improves the query speed. For example, Zhang San in the LDAP server corresponds to 12 data fields, and when performing a fuzzy query, it is necessary to traverse 12 data fields. For the target query server, the reduction in data volume results in a reduction in the index volume, which is more conducive to improving the data query speed.

[0049] According to some embodiments, when the target query server integrates the respective data fields of the stored data, it can also only integrate the important data fields in the filtered stored data. For example, the target query server can filter out important data fields such as the contact name, email address, and company name of each contact, and integrate the filtered data fields into one data field and then store it in the target query server.

[0050] According to some embodiments, the preset data index set for the stored data in the target query server may specifically be an index with a B-Tree structure. B-Tree is a balanced tree structure widely used in database indexes. It can effectively support range queries and fuzzy queries while maintaining data balance, making the query performance stable.

[0051] According to some embodiments, the intermediate server may specifically be a web server.

[0052] According to some embodiments, in step S210 above, before the client sends a fuzzy query request to the server, it should perform a connection operation with the LDAP server; at the same time, when the intermediate server sends the fuzzy query request to the target query server, it also needs to perform an authentication connection with the target query server. After the authentication is passed and the connection is established, the fuzzy query request is sent to the target query server.

[0053] The specific ways for the client to perform the connection operation with the LDAP server may include: configuring the IP address, connection port, username, and password of the LDAP server in the client.

[0054] The specific ways for the intermediate server to perform an authentication connection with the target query server may include: encapsulating the IP address, connection port, username, password, etc. of the client that sends the fuzzy query request to obtain an encapsulated class. Then, the encapsulated class is connected to the target query server for authentication.

[0055] According to some embodiments, the fuzzy query system further includes a distribution server. The distribution server is deployed on the server side and is used to receive the fuzzy query requests sent by the client and forward the fuzzy query requests.

[0056] Therefore, in step S210 above, when the intermediate server detects that the client sends a fuzzy query request, the specific implementation of sending the fuzzy query request to the target query server may be: when receiving the fuzzy query request forwarded by the distribution server, the intermediate server sends the fuzzy query request to the target query server.

[0057] Exemplarily, the distribution server may specifically be Nginx. Nginx is a server software that can be used as an HTTP server for static and dynamic web pages, efficiently process HTTP requests from clients, and send responses to clients. In the embodiments of the present application, as a reverse proxy server, Nginx can forward the requests of clients to one or more servers at the back end.

[0058] According to an example embodiment, the distribution server can receive the fuzzy query request sent by the client by monitoring the server connection port. The server connection port is specifically the port through which the client is connected to the server. For example, the server connection port is 389.

[0059] Through the above embodiments, the present application utilizes a distribution server to forward fuzzy query requests, and forwards the fuzzy query requests to an intermediate server, so as to further send the fuzzy query requests to a target query server instead of forwarding them to an LDAP server, thereby achieving distribution of fuzzy query requests, so that the target query server performs fuzzy query, and thus improving the fuzzy query speed.

[0060] As mentioned above, before the client sends a fuzzy query request, the client configures the LDAP server's IP address (e.g. 192.168.1.10), connection port (specifically, it can be the default TCP port of the LDAP service, such as 389), user name and password, etc. to generate a connection request and send it to the LDAP server on the server side, and the server side listens to the connection port (i.e. 389) through the distribution server to receive the connection request. After that, the distribution server can send the connection request to the LDAP server for authentication by the LDAP server. After the authentication is passed, the connection between the LDAP server and the client can be established.

[0061] According to some embodiments, in the above step S210, when it is detected that the client sends a fuzzy query request, the fuzzy query request is sent to the target query server, which can be specifically implemented through steps S211 and S212.

[0062] In step S211, when detecting that the client sends a fuzzy query request, the intermediate server converts the fuzzy query request into a fuzzy query statement.

[0063] The fuzzy query statement is a statement that can be recognized by the target query server.

[0064] According to an example embodiment, the target query server cannot directly identify the fuzzy query request, so the intermediate server can convert the fuzzy query request into a query statement that can be directly identified by the target query server, that is, a fuzzy query statement.

[0065] Exemplarily, when a user initiates a fuzzy query request of "searching for contacts whose username contains zhang", the fuzzy query statement converted by the intermediate server may be: $data=$model->like('search_key','zhang')->get().

[0066] In step S212, the intermediate server sends the fuzzy query statement to the target query server.

[0067] According to the exemplary embodiment, when the intermediate server detects that the client sends a fuzzy query request, it converts the fuzzy query request into a fuzzy query statement and then sends the fuzzy query statement to the target query server. In this way, the target query server can directly recognize the fuzzy query statement to search for the target data.

[0068] According to some embodiments, the implementation manner of the target query server to search for the target data according to the fuzzy query statement may specifically include: the driver of the target query server parses the fuzzy query statement to determine the data and conditions to be queried, and then the query optimizer of the target query server analyzes the query data and conditions to generate an optimized query plan. Then, the target query server accesses the storage engine to search for data according to the optimized query plan to find the target data.

[0069] Among them, the query optimizer is one of the core components in the database management system. It can generate (or reuse) an efficient execution plan according to the user's query request, table structure, index and other information, and transmit it to the storage engine to operate the data, and finally return the result to the user.

[0070] According to some embodiments, in the above step S220, the intermediate server feeds back the target data to the client to complete the data query, which can be specifically implemented through step S221 and step S222.

[0071] In step S221, the intermediate server performs formatting processing on the target data to obtain the formatted target data.

[0072] In step S222, the intermediate server feeds back the formatted target data to the client to complete the data query.

[0073] According to the exemplary embodiment, when the intermediate server receives the target data returned by the target query server, it can perform formatting processing on the target data to process it into the target data in a standard format. Then, the intermediate server feeds back the formatted target data to the client, thereby completing the process of fuzzy query.

[0074] Through the above embodiments, the intermediate server first performs formatting processing on the target data and then feeds it back to the client. In this way, the target data returned to the client is the target data in a standard format, which is beneficial to improving the user's perception.

[0075] According to some embodiments, in step S222, the intermediate server feeding the processed target data back to the client may specifically include: the intermediate server feeding the processed target data back to the distribution server. Then the distribution server forwards the processed target data to the client.

[0076] According to some embodiments, when the target query server receives the fuzzy query request sent by the intermediate server, it searches for the target data based on the fuzzy query request and the preset data index, which can be specifically implemented through step Sa1, step Sa2, and step Sa3.

[0077] In step Sa1, when receiving the fuzzy query request sent by the intermediate server, the target query server determines whether the data queried by the fuzzy query request belongs to hot data based on the fuzzy query request.

[0078] Exemplarily, the target query server filters out the hot data from each stored data in its internal storage and stores the hot data separately in the cache.

[0079] The hot data is determined according to the user's historical query requests and refers to the data that is often queried by the user. For example, within a preset period, if the number of queries by the user for "contacts whose names contain zhang" exceeds the preset quantity threshold, then the data of the contacts whose names contain zhang stored in the target query server is hot data.

[0080] The hot data can specifically be the data filtered out by the target query server from the historical query records using machine learning algorithms.

[0081] According to the exemplary embodiment, when the target query server receives the fuzzy query request, it first determines whether the data targeted by the fuzzy query request belongs to hot data. For example, the target query server can determine whether the fuzzy query request belongs to a hot query request. If the fuzzy query request belongs to a hot query request, it is determined that the data targeted by the fuzzy query request belongs to hot data.

[0082] In step Sa2, if it belongs to hot data, the target query server searches for the target data in the cache.

[0083] In step Sa3, if it does not belong to hot data, the target query server searches for the target data based on the fuzzy query request and the preset data index.

[0084] Among them, the stored data belonging to hot data is stored not only in the memory of the target query server but also in the cache of the target query server.

[0085] In the case where the fuzzy query request does not belong to a hot query request, it is determined that the data targeted by the fuzzy query request does not belong to hot data.

[0086] According to the exemplary embodiment, in the case where the data targeted by the fuzzy query request belongs to hot data, the target query server can directly obtain the target data from the cache.

[0087] In the case where the data targeted by the fuzzy query request does not belong to hot data, the target query server then searches for the target data from the memory based on the fuzzy query request and the preset data index.

[0088] Through the above embodiments, the target query server caches hot data in a caching manner, which is beneficial for directly obtaining hot data from the cache when a user queries hot data, thereby further improving the fuzzy query speed.

[0089] Exemplarily, an example is provided here to illustrate the processing flow of the fuzzy query method.

[0090] Refer to Figure 2 , the server is configured with a distribution server, an intermediate server, an LDAP server, and a target query server.

[0091] The target query server synchronizes all the data in the LDAP server to the target query server through a listening script. After that, the server can provide LDAP services to the client.

[0092] Specifically, the client sends a connection request to the distribution server of the server. The distribution server forwards the connection request to the LDAP server, and the LDAP server authenticates the client according to the connection request. After the authentication is passed, the distribution server establishes a TCP (Transmission Control Protocol) / IP (Internet Protocol) connection with the client.

[0093] The client sends a fuzzy query request to the server. For example, a fuzzy query request of "query contacts whose names contain zhang".

[0094] The distribution server receives the fuzzy query request and forwards the fuzzy query request to the intermediate server. The intermediate server parses the received query condition into a fuzzy query statement that can be recognized by the target query server.

[0095] After that, the intermediate server connects to the target query server and sends the query statement to the target query server for query operations.

[0096] After receiving the fuzzy query statement, the target query server parses each part of the fuzzy query statement to determine the data conditions to be queried. The target query server also uses a query optimizer to analyze the query conditions, generate the most suitable query plan for the query, and after the query is completed, returns the query result, that is, the target data queried, to the intermediate server.

[0097] After that, the intermediate server formats the target data and sends it to the distribution server. The distribution server sends the formatted target data to the client to complete the fuzzy query.

[0098] Exemplarily: After the LDAP system is initialized, use a listening script to synchronize all data in LDAP to the target query server (QFTCS, Query find the cache system, lightweight fast search cache system), and then LDAP services can be provided for the client. The following is the entire query process: ①. Establish a connection: The client sends a connection request to the LDAP server.

[0099] The server accepts the connection request and establishes a TCP / IP connection.

[0100] ②. Authentication: The client sends an authentication request, including the username (cn=user1,dc=local) and password (123456). The server verifies the user identity and returns an authentication success response after success.

[0101] ③. Send a query request: The client constructs and sends an LDAP query request, for example (cn=zhang ) to query contacts whose cn contains zhang.

[0102] ④. Process the query request and return: Nginx (distribution server) forwards the query request to the web server, that is, forwards it to the intermediate server (written in PHP code). The web service parses the received query conditions into a query statement that QFTCS can recognize, then connects to the QFTCS service for query operations. After QFTCS receives the query request, it parses each part of the request, determines the query data and conditions, and uses a query optimizer to analyze the query conditions, generates the most suitable query plan for the query, and returns the result to the web service after the query is completed. The result example (in the format of an array of 2 items): Array( 'cn'=>'zhangsan', / / Name ​'mail' => 'zhangsan@a.com', / / Email address 'company' => 'BAG', / / Company name 'dn' => 'uid=zhangsan,dc=test' / / Unique path , 'cn' => 'zhangxiaoyi', / / Name 'mail' => 'zhangxiaoyi@a.com', / / Email address 'company' => 'BAG', / / Company name 'dn' => 'uid=zhangxiaoyi,dc=test' / / Unique path ) The web service formats the result and then returns it to the client through Nginx.

[0103] It should be clearly understood that this application describes how to form and use specific examples, but this application is not limited to any details of these examples. Instead, based on the teachings disclosed in this application, these principles can be applied to many other embodiments.

[0104] Those skilled in the art can understand that all or part of the steps to implement the above embodiments are realized as a computer program executed by the CPU. When this computer program is executed by the CPU, it executes the above functions defined by the above method provided in this application.

[0105] According to another aspect of this application, an embodiment of this application further provides a fuzzy query system. This fuzzy query system is deployed on the server side. Referring to Figure 1 , this fuzzy query system includes an LDAP server, an intermediate server, and a target query server.

[0106] The LDAP server stores stored data. When the intermediate server detects a fuzzy query request sent by the client, it sends the fuzzy query request, where the fuzzy query request is sent by the client to request to find the target data stored in the LDAP server.

[0107] The target query server stores the stored data in the LDAP server and sets a preset data index based on the stored data.

[0108] The target query server is used to receive the fuzzy query request sent by the intermediate server, find the target data based on the fuzzy query request and the preset data index, and send the target data to the intermediate server. ​​

[0109] The intermediate server is used to feed back the target data to the client when receiving the target data, so as to complete the data query.

[0110] According to some embodiments, the fuzzy query system may further include a distribution server. The distribution server is used to receive the fuzzy query request and connection request sent by the client, and forward the fuzzy query request and connection request sent by the client.

[0111] Specifically, the distribution server can be connected between the LDAP server and the client, and monitor the connection port (specifically, the default TCP port of the LDAP service connected by the client, such as 389). In this way, when the client sends a fuzzy query request and a connection request to the LDAP server of the server side, the server side listens to this connection port through the distribution server. Then the distribution server can forward the fuzzy query request to the intermediate server and forward the connection request to the LDAP server. When the intermediate server receives the fuzzy query request forwarded by the distribution server, it sends the fuzzy query request to the target query server for fuzzy query by the target query server.

[0112] According to some embodiments, the specific manner in which the intermediate server feeds back the target data to the client may include: the intermediate server may send the target data to the distribution server, and the distribution server forwards the target data to the client.

[0113] According to another aspect of the present application, embodiments of the present application further provide a fuzzy query device. Referring to Figure 3 , the fuzzy query device includes a query request sending module 1001, a data receiving module 1002, and a data sending module 1003.

[0114] The query request sending module 1001 is used to send the fuzzy query request to the target query server when detecting that the client sends a fuzzy query request, so that the target query server queries the target data according to the fuzzy query request and the preset data index. The data receiving module 1002 is used to receive the target data returned by the target query server. The data sending module 1003 is used to feed back the target data to the client to complete the data query.

[0115] Among them, the fuzzy query request is sent by the client to request to find the target data stored in the LDAP server. The target query server stores the stored data in the LDAP server, and the preset data index is set by the target query server based on the stored data.

[0116] According to some embodiments, when the query request sending module 1001 detects that the client sends a fuzzy query request and sends the fuzzy query request to the target query server, it is specifically configured to: when receiving the fuzzy query request forwarded by the distribution server, send the fuzzy query request to the target query server.

[0117] Wherein, the distribution server is used to receive the fuzzy query request sent by the client and forward the fuzzy query request.

[0118] According to some embodiments, when the query request sending module 1001 sends the fuzzy query request to the target query server after detecting that the client sends a fuzzy query request, it is specifically configured to: when detecting that the client sends a fuzzy query request, convert the fuzzy query request into a fuzzy query statement, where the fuzzy query statement is a statement recognizable by the target query server. Send the fuzzy query statement to the target query server.

[0119] According to some embodiments, when the data sending module 1003 feeds back the target data to the client to complete the data query, it is specifically configured to: perform formatting processing on the target data to obtain the formatted target data. Feed back the formatted target data to the client to complete the data query.

[0120] It should be noted that the device performs functions similar to the methods provided above. For other functions, please refer to the previous description and will not be elaborated here.

[0121] According to another aspect of the present application, an embodiment of the present application further provides another fuzzy query device. Referring to Figure 4 , the fuzzy query device includes a data query module 1101 and a data feedback module 1102.

[0122] The data query module 1101 is configured to, when receiving the fuzzy query request sent by the intermediate server, search for target data based on the fuzzy query request with a preset data index. The data feedback module 1102 is configured to feed back the target data to the intermediate server, so that the intermediate server feeds back the target data to the client to complete the data query.

[0123] Wherein, the fuzzy query request is sent by the intermediate server to the target query server after the intermediate server detects that the client sends a fuzzy query request. The fuzzy query request is sent by the client to request to search for the target data stored in the LDAP server. The target query server stores the stored data in the LDAP server, and the preset data index is set based on the stored data.

[0124] According to some embodiments, the fuzzy query device further includes a data acquisition module, a field integration module, and a data storage module.

[0125] The data acquisition module is used to acquire the stored data in the LDAP server from the LDAP server. Each stored data includes at least two data fields. The field integration module is used to integrate each data field of the stored data to obtain the integrated stored data. The data storage module is used to store the integrated stored data so that the target query server can search for the target data from each integrated stored data when querying the target data.

[0126] According to some embodiments, when receiving the fuzzy query request sent by the intermediate server, when the data query module 1101 searches for the target data based on the fuzzy query request and the preset data index, it is specifically used for: when receiving the fuzzy query request sent by the intermediate server, based on the fuzzy query request, determine whether the data queried by the fuzzy query request belongs to the hot data. If it belongs to the hot data, search for the target data in the cache. If it does not belong to the hot data, search for the target data based on the fuzzy query request and the preset data index. Among them, the stored data belonging to the hot data is stored in the cache of the target query server.

[0127] It should be noted that the device executes functions similar to the methods provided above. For other functions, please refer to the previous description and will not be elaborated here.

[0128] Finally, it should be noted that the above are only the preferred embodiments of the present application and are not used to limit the present application. Although the present application has been described in detail with reference to the foregoing embodiments, for those skilled in the art, they can still modify the technical solutions of the foregoing embodiments, or perform equivalent replacements for some of the technical features. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A fuzzy query method, characterized in that: The fuzzy query method comprises: When detecting that the client sends a fuzzy query request, sending the fuzzy query request to a target query server, so that the target query server queries the target data according to the fuzzy query request and a preset data index; Receiving target data returned by the target query server; Feeding back the target data to the client to complete the data query; Wherein, the fuzzy query request is issued by the client to request to search for target data stored in the LDAP server; The target query server stores the storage data in the LDAP server, and the preset data index is set by the target query server based on the storage data.

2. The fuzzy query method according to claim 1, characterized in that: When detecting that the client sends a fuzzy query request, sending the fuzzy query request to the target query server includes: When receiving the fuzzy query request forwarded by the distribution server, sending the fuzzy query request to the target query server; The distribution server is used to receive the fuzzy query request sent by the client and forward the fuzzy query request.

3. The fuzzy query method according to claim 1 or 2, characterized in that: The step of sending the fuzzy query request to the target query server upon detecting that the client sends the fuzzy query request comprises: In the case of detecting that the client sends a fuzzy query request, converting the fuzzy query request into a fuzzy query statement, wherein the fuzzy query statement is a statement that can be recognized by the target query server; The fuzzy query statement is sent to a target query server.

4. The fuzzy query method according to claim 1, characterized in that: Feeding back the target data to the client to complete the data query includes: Formatting the target data to obtain formatted target data; The formatted target data is fed back to the client to complete the data query.

5. A fuzzy query method, characterized in that: The fuzzy query method is executed by a target query server, wherein the fuzzy query method includes: When receiving a fuzzy query request sent by the intermediate server, searching for target data based on the fuzzy query request and a preset data index; Feeding back the target data to the intermediate server, so that the intermediate server feeds back the target data to the client to complete the data query; Wherein, the fuzzy query request is sent by the intermediate server to the target query server when the intermediate server detects that the client sends a fuzzy query request; The fuzzy query request is issued by the client to request to search for target data stored in the LDAP server; The target query server stores the storage data in the LDAP server, and the preset data index is set based on the storage data.

6. The fuzzy query method according to claim 5, characterized in that: The method further comprises: Acquire the stored data in the LDAP server from the LDAP server, wherein each of the stored data includes at least two data fields; Integrate each data field of the stored data to obtain integrated stored data; The integrated storage data are stored so that the target query server searches from each integrated storage data when querying the target data.

7. The fuzzy query method according to claim 5, characterized in that: When receiving the fuzzy query request sent by the intermediate server, searching for target data based on the fuzzy query request and a preset data index includes: In the case of receiving a fuzzy query request sent by the intermediate server, judging whether the data queried by the fuzzy query request belongs to hot data based on the fuzzy query request; In the case of hot data, search for target data from the cache; In the case of not belonging to hot data, searching for target data based on the fuzzy query request and the preset data index; The storage data belonging to the hot data is stored in the cache of the target query server.

8. A fuzzy query system, characterized in that: The fuzzy query system comprises: LDAP server, which stores storage data; The intermediate server sends the fuzzy query request when detecting that the client sends the fuzzy query request, wherein the fuzzy query request is sent by the client to request to search for target data stored in the LDAP server; A target query server stores the storage data in the LDAP server and is provided with a preset data index based on the storage data; The target query server is used to receive the fuzzy query request sent by the intermediate server, search for target data based on the fuzzy query request and the preset data index, and send the target data to the intermediate server; The intermediate server is used to feed back the target data to the client upon receiving the target data, so as to complete the data query.

9. A fuzzy query device, characterized in that: The fuzzy query device comprises: A query request sending module, configured to send the fuzzy query request to a target query server when detecting that the client sends a fuzzy query request, so that the target query server queries the target data according to the fuzzy query request and a preset data index; A data receiving module, used for receiving the target data returned by the target query server; A data sending module, used for feeding back the target data to the client to complete the data query; Wherein, the fuzzy query request is issued by the client to request to search for target data stored in the LDAP server; The target query server stores the storage data in the LDAP server, and the preset data index is set by the target query server based on the storage data.

10. A fuzzy query device, characterized in that: The fuzzy query device comprises: A data query module, configured to search for target data based on a preset data index based on the fuzzy query request when receiving the fuzzy query request sent by the intermediate server; A data feedback module, used for feeding back the target data to the intermediate server, so that the intermediate server feeds back the target data to the client to complete the data query; Wherein, the fuzzy query request is sent by the intermediate server to the target query server when the intermediate server detects that the client sends a fuzzy query request; The fuzzy query request is issued by the client to request to search for target data stored in the LDAP server; The target query server stores the storage data in the LDAP server, and the preset data index is set based on the storage data.