A data classification and retrieval method and apparatus

By classifying and parallel searching of search fields in the search formula, the problem of inefficient search in the prior art is solved, and efficient data retrieval is achieved.

CN114791923BActive Publication Date: 2025-05-27BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210452948.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-27
Publication Date
2025-05-27
Estimated Expiration
2042-04-27

AI Technical Summary

Technical Problem

In the prior art, data retrieval needs to be traversed according to the search relationship between data, resulting in low retrieval efficiency and the search process can only be performed serially.

Method used

By extracting multiple search fields in the search formula, classifying the search data, multiple target data classes are obtained, and the search results are determined based on the order of these target data classes, the keywords of the first search field and the search fields.

Benefits of technology

Parallel retrieval is realized, retrieval efficiency is improved, the need to traverse the entire database is avoided, and the available space of the database is increased.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114791923B_ABST
    Figure CN114791923B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of big data technology, and in particular, to a data classification and retrieval method and apparatus. The method includes: obtaining a retrieval formula for data to be retrieved; extracting a plurality of retrieval fields in the retrieval formula, wherein the retrieval formula includes a keyword of a first retrieval field; classifying the data to be retrieved according to the plurality of retrieval fields to obtain a plurality of target data classes, and each of the target data classes includes a plurality of records corresponding to the retrieval field to which the target data class belongs; determining a retrieval result corresponding to the retrieval formula according to the plurality of target data classes, the keyword of the first retrieval field, and the order of each retrieval field in the retrieval formula. Through the embodiments of the present invention, the data to be retrieved is classified according to the retrieval fields in the retrieval formula. When retrieving, it is only necessary to retrieve in each target data class, avoiding traversing all the contents of the database, and the retrieval can be performed in parallel in each target data class, improving the retrieval efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of big data technology, and in particular to a data classification retrieval method and device. Background Art

[0002] This section is intended to provide a background or context to the embodiments of the invention recited in the claims. No admission is made that the description herein is prior art by inclusion in this section.

[0003] With the rapid development of big data technology, the scale of data is getting larger and larger. In the prior art, in addition to recording data in the database, the retrieval relationship between data and data needs to be recorded separately when creating a database. When searching, the data corresponding to the data to be searched needs to be determined according to the retrieval relationship between data and data. If the search formula includes multiple search fields, it is necessary to wait until the search of the previous search field is completed before the search of the next field can be performed. That is, the search process of the search formula can only be executed serially, and because the entire database needs to be traversed during the search, the search time for each search field is long, resulting in low search efficiency.

[0004] There is an urgent need for a data classification retrieval method to solve the problem that the retrieval process of the retrieval formula in the prior art can only be executed serially, and since the entire database needs to be traversed during the retrieval, the retrieval time for each retrieval field is long, resulting in low retrieval efficiency. Summary of the invention

[0005] In order to solve the problems existing in the prior art, the embodiments of the present invention provide a data classification retrieval method and device, which abandons the method of separately recording the retrieval relationship between data and data in the database, and solves the problem that when searching in the prior art, it is necessary to determine the data corresponding to the data to be retrieved based on the retrieval relationship between data and data. If the retrieval formula includes multiple retrieval fields, it is necessary to wait until the retrieval of the previous retrieval field is completed before the retrieval of the next field can be performed, resulting in low retrieval efficiency.

[0006] In order to solve the above technical problems, the specific technical solutions of this article are as follows:

[0007] In one aspect, an embodiment of the present invention provides a data classification retrieval method, the method comprising:

[0008] Obtaining a search formula for the data to be retrieved;

[0009] Extracting multiple search fields in the search formula, wherein the search formula includes a keyword of a first search field;

[0010] Classifying the data to be searched according to the plurality of search fields to obtain a plurality of target data classes, each of the target data classes including a plurality of records corresponding to the search field to which it belongs;

[0011] The search result corresponding to the search formula is determined according to the plurality of target data types, the keywords of the first search field, and the order of the search fields in the search formula.

[0012] Furthermore, the search fields in the search formula other than the first search field do not contain keywords;

[0013] Determining the search result corresponding to the search formula according to the plurality of target data types, the keywords of the first search field and the order of the search fields in the search formula further includes:

[0014] Step 1: searching in the target data class corresponding to the first search field according to the keyword of the first search field to obtain a first set of the first search field, wherein the first set of the first search field includes a plurality of records corresponding to the keyword of the first search field;

[0015] Step 2: according to the order of the search fields in the search formula, the first set of the first search field is used as the search condition of the target data class corresponding to the second search field in the search formula to obtain the first set of the second search field, wherein the first set of the second search field includes a plurality of records corresponding to the plurality of records in the first set of the first search field;

[0016] Step 3: Use the second search field as the first search field, repeat step 2, and search the target data classes corresponding to the remaining search fields in the search formula respectively, until the target data class corresponding to the last search field in the search formula is searched and the first set of the last search field is obtained, and use multiple records in the first set of the last search field as the search results corresponding to the search formula.

[0017] Furthermore, all search fields in the search formula contain keywords;

[0018] Determining the search result corresponding to the search formula according to the plurality of target data types, the keywords of the first search field and the order of the search fields in the search formula further includes:

[0019] Step 1: Search the target data class corresponding to each search field according to the keyword of each search field, and obtain the first set of each search field, each first set including multiple records corresponding to the keyword of each search field;

[0020] Step 2: according to the order of the search fields in the search formula, the first set of the first search field is used as the search condition of the first set corresponding to the second search field in the search formula to obtain the second set of the second search field, wherein the second set of the second search field includes a plurality of records corresponding to the plurality of records in the first set of the first search field;

[0021] Step 3: Use the second search field as the first search field, repeat step 2, and search the first sets corresponding to the remaining search fields in the search formula respectively, until the first set corresponding to the last search field in the search formula is retrieved and the second set of the last search field is obtained, and use multiple records in the second set of the last search field as the search results corresponding to the search formula.

[0022] Furthermore, some search fields in the search formula contain keywords;

[0023] Determining the search result corresponding to the search formula according to the plurality of target data types, the keywords of the first search field and the order of the search fields in the search formula further includes:

[0024] Step 1: for search fields with keywords, search the target data class in each search field with keywords according to each keyword, and obtain a first set of search fields with keywords, wherein the first set includes multiple records corresponding to the keywords of the search fields with keywords;

[0025] Step 2: According to the order of the search fields in the search formula, if the second search field in the search formula contains keywords, the first set of the first search field is used as the search condition of the first set corresponding to the second search field in the search formula to obtain the second set of the second search field, wherein the second set of the second search field includes multiple records corresponding to the multiple records in the first set of the first search field; if the second search field in the search formula does not contain keywords, the first set of the first search field is used as the search condition of the target data class corresponding to the second search field in the search formula to obtain the first set of the second search field, wherein the first set of the second search field includes multiple records corresponding to the multiple records in the first set of the first search field;

[0026] Step 3: Use the second search field as the first search field, repeat step 2, and search the first sets or target data classes corresponding to the remaining search fields in the search formula respectively, until the first set or target data class corresponding to the last search field in the search formula is searched and the first set or second set of the last search field is obtained, and use multiple records in the first set or second set of the last search field as the search results corresponding to the search formula.

[0027] Further, the step of determining the keywords of the search field includes,

[0028] Extracting the first keyword of the search field from the search formula;

[0029] Determine whether there are conjunctions before and after the first keyword;

[0030] If yes, the first keyword is divided according to the connecting words to obtain a plurality of second keywords, and the plurality of second keywords are used as the keywords;

[0031] If not, the first keyword is used as the keyword.

[0032] Furthermore, the process of classifying the data to be retrieved according to the plurality of search fields is performed in parallel.

[0033] On the other hand, an embodiment of the present invention further provides a data and classification retrieval device, including:

[0034] A search formula acquisition unit, used to acquire a search formula for the data to be searched;

[0035] A search field extraction unit, used to extract multiple search fields in the search formula, wherein the search formula includes a keyword of a first search field;

[0036] A classification unit, used for classifying the data to be searched according to the plurality of search fields to obtain a plurality of target data classes, each of the target data classes including a plurality of records corresponding to the search field to which it belongs;

[0037] The search unit is used to determine the search result corresponding to the search formula according to the multiple target data types, the keywords of the first search field and the order of the search fields in the search formula.

[0038] On the other hand, an embodiment of the present invention further provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned dynamic access method when executing the computer program.

[0039] On the other hand, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned dynamic access method is implemented.

[0040] Finally, an embodiment of the present invention further provides a computer program product, wherein the computer program product includes a computer program, and when the computer program is executed by a processor, the above-mentioned dynamic access method is implemented.

[0041] In the embodiment of the present invention, multiple search fields in the retrieved search formula are extracted, and then the data to be retrieved are classified according to the search fields to obtain multiple target data classes, each of which includes multiple records, that is, each of which includes multiple data, and each record or each data in the target data class corresponds to the search field described in the target data class. Finally, the result corresponding to the search formula is determined according to the multiple target data classes, the keywords corresponding to the first search section in the search formula, and the order of the search fields in the search formula. The data to be retrieved is classified according to the search fields in the search formula. When searching, it is only necessary to search in each target data class, avoiding traversing the entire content of the database, and the search can be performed in each target data class in parallel, which improves the search efficiency. In addition, it is also realized that the search result corresponding to the search formula is determined according to the order of the search fields in the search formula, and it is no longer necessary to search according to the corresponding relationship between the data stored in the database. Therefore, when the data is stored in the database, it is no longer necessary to record the corresponding relationship between the data, which increases the available space of the database to a certain extent. The invention solves the problem that the retrieval process of the retrieval formula in the prior art can only be executed serially, and since the entire database needs to be traversed during the retrieval, the retrieval time of each retrieval field is long, resulting in low retrieval efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0043] Figure 1 A schematic diagram of an implementation system of a data classification retrieval method in an embodiment of the present invention;

[0044] Figure 2 A schematic diagram of a data classification retrieval method according to an embodiment of the present invention;

[0045] Figure 3The process of determining the search result corresponding to the search formula according to the multiple target data classes, the keywords of the first search field and the order of the search fields in the search formula in some embodiments of the present invention;

[0046] Figure 4 The process of determining keywords of the search field in the embodiment of the present invention;

[0047] Figure 5 A schematic diagram of the structure of a data classification retrieval device in an embodiment of the present invention;

[0048] Figure 6 The figure is a schematic diagram of the structure of a computer device according to an embodiment of the present invention.

[0049] Description of the accompanying symbols:

[0050] 101. Terminal;

[0051] 102. Server;

[0052] 501, search-based acquisition unit;

[0053] 502. Search field extraction unit;

[0054] 503, taxonomic unit;

[0055] 504, retrieval unit;

[0056] 602. Computer equipment;

[0057] 604, processor;

[0058] 606. Memory;

[0059] 608, driving mechanism;

[0060] 610, input / output module;

[0061] 612. Input devices;

[0062] 614. Output device;

[0063] 616. Presentation equipment;

[0064] 618. Graphical user interface;

[0065] 620, network interface;

[0066] 622, communication link;

[0067] 624. Communication bus. DETAILED DESCRIPTION

[0068] To make the purpose, technical solution and advantages of the embodiments of the present invention more clear, the embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings. Here, the exemplary embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.

[0069] It should be noted that the terms "first", "second", etc. in the specification and claims of this article and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of this article described here can be implemented in an order other than those illustrated or described here. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, device, product or equipment that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or equipment.

[0070] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0071] like Figure 1 The diagram is a schematic diagram of a system for implementing a data classification retrieval method according to an embodiment of the present invention, which may include: a terminal 101 and a server 102. The terminal 101 and the server 102 communicate with each other through a network. The network may include a local area network (LAN), a wide area network (WAN), the Internet or a combination thereof, and is connected to a website, a user device (such as a computing device) and a back-end system. When performing data retrieval, the terminal 101 may send a search formula to the server 102. The server 102 searches the data to be searched stored in the server according to the search formula, obtains the search result corresponding to the search formula, and sends the search result to the terminal 101. The processor of the server 102 may respond to the search formula of the terminal 101, and the processor may operate the database stored in the server 102 and obtain the search result. Optionally, the processor may be a node of a cloud computing system (not shown in the figure), or each processor may be a separate cloud computing system, including multiple computers interconnected by a network and working as a distributed processing system.

[0072] In addition, it should be noted that Figure 1 What is shown is only an application environment provided by the present disclosure. In actual application, multiple terminals 101 may be included, and this specification does not limit this.

[0073] At present, when creating a database in the server 102, in addition to recording the data in the database, it is also necessary to separately record the retrieval relationship between the data. When the server 102 receives the search formula sent by the terminal 101 and performs a search, it is necessary to determine the data corresponding to the data to be searched based on the retrieval relationship between the data. If the search formula includes multiple search fields, it is necessary to wait until the previous search field is searched before the next field can be searched. That is, the search process of the search formula can only be executed serially, and because the entire database needs to be traversed during the search, the search time for each search field is relatively long, resulting in low search efficiency.

[0074] In order to solve the problems existing in the prior art, an embodiment of the present invention provides a data classification retrieval method, which abandons the method of separately recording the retrieval relationship between data and data in the database, classifies the data to be retrieved through the retrieval fields in the retrieval formula to obtain multiple target data classes, and then retrieves multiple records in the multiple target data classes to obtain the retrieval results corresponding to the retrieval formula. Figure 2 The figure shows a flow chart of a data classification retrieval method according to an embodiment of the present invention. The process of data classification retrieval is described in this figure, but more or fewer operation steps may be included based on conventional or non-creative work. The order of steps listed in the embodiment is only one way of executing the steps among many orders, and does not represent the only order of execution. When the actual system or device product is executed, it can be executed in the order or in parallel according to the method shown in the embodiment or the accompanying drawings. Specifically, Figure 2 As shown, the method executed by the server may include:

[0075] Step 201: Obtain a search formula for the data to be searched;

[0076] Step 202: extracting multiple search fields in the search formula, wherein the search formula includes a keyword of the first search field;

[0077] Step 203: classifying the data to be searched according to the multiple search fields to obtain multiple target data classes, each of which includes multiple records corresponding to the search field to which it belongs;

[0078] Step 204: Determine the search result corresponding to the search formula according to the plurality of target data types, the keywords of the first search field, and the order of the search fields in the search formula.

[0079] Through the method of the embodiment of the present invention, multiple search fields in the retrieved search formula are extracted, and then the data to be retrieved are classified according to the search fields to obtain multiple target data classes, each of which includes multiple records, that is, each of which includes multiple data, and each record or each data in the target data class corresponds to the search field described in the target data class. Finally, the result corresponding to the search formula is determined according to the multiple target data classes, the keywords corresponding to the first search section in the search formula, and the order of the search fields in the search formula. It is realized that the data to be retrieved is classified according to the search fields in the search formula. When searching, it is only necessary to search in each target data class, avoiding traversing the entire content of the database, and it is possible to search in each target data class in parallel, thereby improving the search efficiency. In addition, it is also realized that the search result corresponding to the search formula is determined according to the order of the search fields in the search formula, and it is no longer necessary to search according to the corresponding relationship between the data stored in the database. Furthermore, when the data is stored in the database, it is no longer necessary to record the corresponding relationship between the data, thereby increasing the available space of the database to a certain extent. The invention solves the problem that the retrieval process of the retrieval formula in the prior art can only be executed serially, and since the entire database needs to be traversed during the retrieval, the retrieval time of each retrieval field is long, resulting in low retrieval efficiency.

[0080] In an embodiment of the present invention, data is stored in a database according to a hierarchical relationship. The hierarchical relationship may be a gradient relationship of different data. It can be understood that each level corresponds to a search field. When the data is stored, the data corresponding to each search field only stores the basic information of the search field, but it should be noted that according to the hierarchical relationship of the data, the basic information of the upper-level data may not include the identifier of the lower-level data (that is, the upper-level data may not store the corresponding relationship with the lower-level data), and the basic information of the lower-level data needs to include the identifier of the upper-level data. Exemplarily, information such as enterprises, products, and components is stored in the database. The hierarchical relationship of enterprises, products, and components is that components belong to products, and products belong to enterprises. The search field corresponding to the enterprise level is the enterprise, the search field corresponding to the product level is the product, and the search field corresponding to the component level is the component. When the data is stored, the basic information stored at the enterprise level may include unique identifiers such as the enterprise name, address, and telephone number, but does not need to include information on all products of the enterprise; the basic information stored at the product level may include unique identifiers such as product name and date, and also includes the enterprise to which the product belongs, but does not need to include information on all components of the product. The basic information stored at the component level may include unique identifiers such as component name, and also needs to include the product to which the component belongs. Through the above data storage method, the occupancy rate of data storage space can be reduced, and when adding, deleting or modifying data, it is only necessary to add, delete or modify data at each level, thereby improving the convenience of data storage.

[0081] In the embodiment of the present invention, multiple search fields in the search formula need to be sorted according to the hierarchical relationship of the data storage, and the search fields of the previous level are before the search fields of the next level. For example, if the component information of product 1 of enterprise A needs to be searched, then according to the hierarchical relationship of enterprise, product, and component, the order of the search fields in the search formula is: enterprise, product, component, and the search formula can be: search for the component information of product 1 of enterprise A. The order of the search fields is determined in the above manner, which reduces the difficulty of users in constructing search formulas.

[0082] In an embodiment of the present invention, a search formula for the data to be retrieved is first obtained, the search formula includes multiple search fields, the first search field of the search formula carries a keyword, and the keyword can represent the search condition of the search field. For example, the search formula is: to find the component information of product 1 of enterprise A, the search fields are enterprise, product, and component, the first search field is enterprise, and the keyword carried by the first search field is A. The data to be retrieved is classified according to each search field to obtain multiple target data classes. It can be understood that each of the target data classes includes multiple records corresponding to the search field to which it belongs. Finally, the search result corresponding to the search formula is determined according to the multiple target data classes, the keyword of the first search field, and the order of the search fields in the search formula.

[0083] According to an embodiment of the present invention, the search fields other than the first search field in the search formula do not contain keywords;

[0084] like Figure 3 As shown, step 204 determines the search result corresponding to the search formula according to the plurality of target data types, the keywords of the first search field and the order of the search fields in the search formula, further comprising:

[0085] Step 301: searching in the target data class corresponding to the first search field according to the keyword of the first search field to obtain a first set of the first search field, wherein the first set of the first search field includes a plurality of records corresponding to the keyword of the first search field;

[0086] Step 302: according to the order of the search fields in the search formula, the first set of the first search field is used as the search condition of the target data class corresponding to the second search field in the search formula to obtain the first set of the second search field, wherein the first set of the second search field includes a plurality of records corresponding to the plurality of records in the first set of the first search field;

[0087] Step 303: Use the second search field as the first search field, repeat step 302, and search the target data classes corresponding to the remaining search fields in the search formula respectively, until the target data class corresponding to the last search field in the search formula is searched and the first set of the last search field is obtained, and use multiple records in the first set of the last search field as the search results corresponding to the search formula.

[0088] For example, when the search fields except the first search field in the search formula do not contain keywords, the search formula may be: find the component information of the products of enterprise A. The target data classes are enterprise target data class, product target data class and component target data class. Then, according to the keyword "A" of the first search field "enterprise", a search is performed in the enterprise target data class to obtain the first set of the search field "enterprise", which includes multiple records of enterprise A, such as the unique identifier of enterprise A, such as the name, address, telephone number, etc.

[0089] Then, according to the order of the search fields in the search formula, the first set of the first search field "Enterprise" "Unique identifiers of Enterprise A, such as name, address, and telephone number" is used as the search condition for the target data class of the second search field "Product", and the first set of the second search field "Product" is obtained. The first set includes multiple products corresponding to the unique identifiers of Enterprise A, such as name, address, and telephone number.

[0090] Then, the first set of the second search field "product" is used as the search condition of the target data class of the third search field (that is, the last search field in the search formula) "component", and the first set of the third search field "component" is obtained. The first set includes the components corresponding to the first set of the second search field "product" "multiple products corresponding to the unique identifiers such as the name, address, and telephone number of enterprise A", that is, the component information of the products of enterprise A. The multiple records in the first set of the third search field "component" are used as the search results of the search formula "find the component information of the products of enterprise A".

[0091] Since the target data class of the first search field "enterprise", the target data class of the second search field "product" or the target data class of the third search field "part" includes multiple records corresponding to the corresponding search fields and all the data to be retrieved, the retrieval speed is improved compared to the method of searching all the data to be retrieved in the prior art.

[0092] In some other embodiments of the present invention, all search fields in the search formula contain keywords;

[0093] Step 204 further includes determining the search result corresponding to the search formula according to the plurality of target data types, the keywords of the first search field and the order of the search fields in the search formula,

[0094] Step 10: Search the target data class corresponding to each search field according to the keyword of each search field, and obtain the first set of each search field, each first set including multiple records corresponding to the keyword of each search field;

[0095] Step 20: according to the order of the search fields in the search formula, the first set of the first search field is used as the search condition of the first set corresponding to the second search field in the search formula, to obtain the second set of the second search field, wherein the second set of the second search field includes a plurality of records corresponding to the plurality of records in the first set of the first search field;

[0096] Step 30: Use the second search field as the first search field, repeat step 20, and search the first sets corresponding to the remaining search fields in the search formula respectively, until the first set corresponding to the last search field in the search formula is retrieved and the second set of the last search field is obtained, and use multiple records in the second set of the last search field as the search results corresponding to the search formula.

[0097] Exemplarily, when all search fields in the search formula contain keywords, the search formula may be: search for information on component 1 of product 1 of enterprise A. The target data classes are enterprise target data class, product target data class and component target data class. Then, according to the keyword "A" of the first search field "enterprise", a search is performed in the enterprise target data class to obtain a first set of the search field "enterprise", which includes multiple records of enterprise A, such as the name, address, telephone number and other unique identifiers of enterprise A; according to the keyword "1" of the second search field "product", a search is performed in the product target data class to obtain a first set of the search field "product", which includes multiple records of product 1, such as product 1 of multiple enterprises, product names, dates and other unique identifiers of multiple product 1; according to the keyword "1" of the third search field "component", a search is performed in the component target data class to obtain a first set of the search field "component", which includes multiple records of component 1, such as component 1 of multiple products, component names and other unique identifiers of multiple component 1.

[0098] Then, according to the order of the search fields in the search formula, the records of the first set of the target data class corresponding to the first search field are used as the search conditions for the records of the first set of the target data class corresponding to the second search field, and the records of the first set of the second target data class are searched to obtain the second set of the second target data class. The second set of the second target data class includes multiple records. It can be understood that the multiple records in the second set of the second target data class are the records in the first set of the second target data class that match the records of the first set of the first target data class.

[0099] Then, the records of the second set of the second target data class are used as the search conditions of the records of the first set of the target data class corresponding to the third search field, and the records of the first set of the third target data class are searched to obtain the second set of the third target data class, and the second set of the third target data class includes multiple records. It can be understood that the multiple records in the second set of the third target data class are the records in the first set of the third target data class that match the records of the second set of the second target data class.

[0100] And so on, until the first set of the target data class corresponding to the last search field is searched and the second set is obtained, the records of the second set of the target data class corresponding to the last search field are used as the search results of the search formula.

[0101] For example, the search formula is: search for information about component 1 in product 1 of enterprise A. The search fields in the search formula are enterprise, product, component, and the search conditions corresponding to each search field are A, 1, 1.

[0102] First, according to the search formula "find the information of component 1 in product 1 of enterprise A", the search fields are determined to be enterprise, product, and component, and the keywords corresponding to each search field are A, 1, 1. When searching, the data to be searched is first classified according to the search fields enterprise, product, and component to obtain the enterprise target data class corresponding to the enterprise field, the product target data class corresponding to the product field, and the component target data class corresponding to the component field, and each data class includes multiple records.

[0103] Then, the first set corresponding to each keyword is searched in each target data class, that is, enterprise A is searched in the records of the enterprise target data class, and the first set of the enterprise target data class obtained includes the record of enterprise A. Product 1 is searched in the records of the product target data class, and the first set of the product target data class obtained includes multiple records of product 1, and the multiple records of product 1 correspond to multiple enterprises. Component 1 is searched in the records of the component target data class, and the first set of the component target data class obtained includes multiple records of component 1, and the multiple records of component 1 correspond to multiple products. It should be noted that since there is no dependency between the processes of generating each target data class and searching for records corresponding to the keywords in each target data class, the processes of generating each target data class and searching for records corresponding to the keywords in each target data class can be executed in parallel, thereby improving the parallelism of the retrieval and reducing the retrieval time.

[0104] Then, according to the order of the search fields "enterprise", "product", and "part" in the search formula "find information about component 1 in product 1 of enterprise A", the first set of enterprise target data class corresponding to the first search field "enterprise" "records of enterprise A" is used as the search condition for the first set of product target data class corresponding to the second search field "product" "records of multiple products 1", and the second set of product target data class is obtained. That is, the records of product 1 corresponding to the first set of enterprise target data class "records of enterprise A" are searched in the first set of product target data class "records of multiple products 1" as the records of the second set of product target data class.

[0105] Then, the second set of the product target data class "records of product 1 of enterprise A" is used as the search condition of the first set of component target data class "records of multiple component 1s" corresponding to the third search field (that is, the last search field in the search formula) "components", and the second set corresponding to the component target data class is obtained, that is, the information of component 1 corresponding to the second set of product target data class "records of product 1 of enterprise A" is searched in the first set of target component data class "records of multiple component 1s". The multiple records in the second set of the third search field "components" are used as the search results of the search formula "find information of component 1 of product 1 of enterprise A".

[0106] In some other embodiments of the present invention, some search fields in the search formula contain keywords;

[0107] Step 204 further includes determining the search result corresponding to the search formula according to the plurality of target data types, the keywords of the first search field and the order of the search fields in the search formula,

[0108] Step 100: for search fields with keywords, search the target data class in each search field with keywords according to each keyword, and obtain a first set of search fields with keywords, wherein the first set includes multiple records corresponding to the keywords of the search fields with keywords;

[0109] Step 200: According to the order of the search fields in the search formula, if the second search field in the search formula contains keywords, the first set of the first search field is used as the search condition of the first set corresponding to the second search field in the search formula to obtain the second set of the second search field, wherein the second set of the second search field includes a plurality of records corresponding to the plurality of records in the first set of the first search field; if the second search field in the search formula does not contain keywords, the first set of the first search field is used as the search condition of the target data class corresponding to the second search field in the search formula to obtain the first set of the second search field, wherein the first set of the second search field includes a plurality of records corresponding to the plurality of records in the first set of the first search field;

[0110] Step 300: Use the second search field as the first search field, repeat step 200, and search the first sets or target data classes corresponding to the remaining search fields in the search formula respectively, until the first set or target data class corresponding to the last search field in the search formula is searched and the first set or second set of the last search field is obtained, and use multiple records in the first set or second set of the last search field as the search results corresponding to the search formula.

[0111] Exemplarily, when some search fields in the search formula contain keywords, the search formula may be: search for information on component 1 of the product of enterprise A. The target data classes are enterprise target data class, product target data class and component target data class. Then, according to the keyword "A" of the first search field "enterprise", a search is performed in the enterprise target data class to obtain a first set of the search field "enterprise", which includes multiple records of enterprise A, such as the name, address, telephone number and other unique identifiers of enterprise A; according to the keyword "1" of the third search field "component", a search is performed in the component target data class to obtain a first set of the search field "component", which includes multiple records of component 1, such as component 1 of multiple products, component names of multiple components 1 and other unique identifiers.

[0112] For example, the search formula is: search for information on component 1 of the product of enterprise A. The search fields in the search formula are enterprise, product, and component. The search condition corresponding to the search field "enterprise" is A, and the search condition corresponding to the search field "component" is 1.

[0113] When searching, first classify the data to be searched according to the search fields enterprise, product, and component to obtain the enterprise target data class corresponding to the enterprise field, the product target data class corresponding to the product field, and the component target data class corresponding to the component field. Each data class includes multiple records.

[0114] Then, the first set corresponding to each keyword is searched in each target data class, that is, enterprise A is searched in the records of the enterprise target data class, and the first set of the enterprise target data class obtained includes the records of enterprise A. Component 1 is searched in the records of the component target data class, and the first set of the component target data class obtained includes multiple records of component 1, and the multiple records of component 1 correspond to multiple products.

[0115] Then, according to the order of the search fields "enterprise", "product", and "part" in the search formula "search for information on component 1 of enterprise A's product", the first set of the enterprise target data class corresponding to the first search field "enterprise" "records of enterprise A" is used as the search condition for the "records of multiple products" of the product target data class corresponding to the second search field "product", and the first set of the product target data class is obtained. That is, the records of the products corresponding to the first set of the enterprise target data class "records of enterprise A" are searched in the "records of multiple products" of the product target data class as the records of the first set of the product target data class.

[0116] Then, the first set of the product target data class "records of company A's products" is used as the search condition for the first set of the component target data class "records of multiple component 1s" corresponding to the third search field (that is, the last search field in the search formula) "components", and the second set corresponding to the component target data class is obtained, that is, the information of component 1 corresponding to the first set of the product target data class "records of company A's products" is searched in the first set of the target component data class "records of multiple component 1s". The multiple records in the second set of the third search field "components" are used as the search results of the search formula "find information on component 1 of company A's products".

[0117] Through the method of the embodiment of this article, since there is no dependency between the process of generating each target data class and searching for records corresponding to the keyword in each target data class, compared with the method in the prior art that can only perform serial retrieval, the present invention can execute the process of generating each target data class and searching for records corresponding to the keyword in each target data class in parallel, thereby improving the parallel degree of retrieval and reducing the retrieval time. In addition, since each target data class only includes records corresponding to the retrieval field of the target data class, rather than all records in the database, the time required for searching in multiple records of the target data class is also much less than the time for searching in all records in the database, further improving the efficiency of retrieval.

[0118] According to an embodiment of the present invention, a search field may include multiple keywords. Figure 4 As shown, the step of determining the keywords of the search field includes:

[0119] Step 401: extracting the first keyword of the search field from the search formula;

[0120] In this step, a keyword extraction algorithm based on Word2Vec word clustering may be used to extract the first keyword of the search field from the search formula.

[0121] Step 402: Determine whether there are conjunctions before and after the first keyword;

[0122] In this step, the conjunctions may include "or", "and", "-", etc. Specifically, the character recognition method may be used to determine whether the above conjunctions exist before and after the first keyword. If so, execute step 403; if not, execute step 404.

[0123] Step 403: Divide the first keyword according to the connecting words to obtain a plurality of second keywords, and use the plurality of second keywords as the keywords;

[0124] Step 404: Use the first keyword as the keyword.

[0125] pass Figure 4 The method shown realizes determining whether there are multiple keywords in the same search field. If so, the multiple keywords in the search field are extracted, and the target data class corresponding to the search field is searched based on the multiple keywords to obtain multiple records corresponding to the multiple keywords, thereby avoiding missed detection.

[0126] The embodiment of the present invention also provides a data classification retrieval device, such as Figure 5 As shown, including,

[0127] A search formula obtaining unit 501 is used to obtain a search formula for the data to be searched;

[0128] A search field extraction unit 502, used to extract multiple search fields in the search formula, wherein the search formula includes a keyword of a first search field;

[0129] A classification unit 503, configured to classify the data to be searched according to the plurality of search fields to obtain a plurality of target data classes, each of which includes a plurality of records corresponding to the search field to which it belongs;

[0130] The search unit 504 is used to determine the search result corresponding to the search formula according to the multiple target data types, the keywords of the first search field and the order of the search fields in the search formula.

[0131] Since the principle of solving the problem by the above device is similar to that of the above method, the implementation of the above device can refer to the implementation of the above method, and the repeated parts will not be repeated.

[0132] like Figure 6 As shown, a computer device provided in an embodiment of the present invention, the apparatus in this article can be a computer device in this embodiment, executing the above method in this article, the computer device 602 may include one or more processors 604, such as one or more central processing units (CPUs), each processing unit can implement one or more hardware threads. The computer device 602 may also include any memory 606, which is used to store any kind of information such as code, settings, data, etc. Non-limiting, for example, the memory 606 may include any one or more combinations of the following: any type of RAM, any type of ROM, flash memory device, hard disk, optical disk, etc. More generally, any memory can use any technology to store information. Further, any memory can provide volatile or non-volatile retention of information. Further, any memory can represent a fixed or removable component of the computer device 602. In one case, when the processor 604 executes an associated instruction stored in any memory or a combination of memories, the computer device 602 can perform any operation of the associated instruction. The computer device 602 also includes one or more drive mechanisms 608 for interacting with any memory, such as a hard disk drive mechanism, an optical disk drive mechanism, etc.

[0133] The computer device 602 may also include an input / output module 610 (I / O) for receiving various inputs (via input devices 612) and for providing various outputs (via output devices 614). A specific output mechanism may include a presentation device 616 and an associated graphical user interface (GUI) 618. In other embodiments, the input / output module 610 (I / O), the input device 612, and the output device 614 may not be included, and the computer device 602 may be used as a computer device in a network. The computer device 602 may also include one or more network interfaces 620 for exchanging data with other devices via one or more communication links 622. One or more communication buses 624 couple the components described above together.

[0134] The communication link 622 may be implemented in any manner, for example, through a local area network, a wide area network (e.g., the Internet), a point-to-point connection, etc., or any combination thereof. The communication link 622 may include any combination of hardwired links, wireless links, routers, gateway functions, name servers, etc. governed by any protocol or combination of protocols.

[0135] An embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned data classification retrieval method is implemented.

[0136] An embodiment of the present invention further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the above-mentioned data classification retrieval method is implemented.

[0137] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0138] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0139] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0140] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0141] The specific embodiments described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A data classification and retrieval method, characterized in that, the method includes, obtaining a retrieval formula for the data to be retrieved; extracting multiple retrieval fields from the retrieval formula, wherein the retrieval formula includes keywords of a first retrieval field; classifying the data to be retrieved according to the multiple retrieval fields to obtain multiple target data classes, and each target data class includes multiple records corresponding to the retrieval field to which it belongs; determining the retrieval result corresponding to the retrieval formula according to the multiple target data classes, the keywords of the first retrieval field, and the order of each retrieval field in the retrieval formula; some retrieval fields in the retrieval formula carry keywords; determining the retrieval result corresponding to the retrieval formula according to the multiple target data classes, the keywords of the first retrieval field, and the order of each retrieval field in the retrieval formula further includes, Step 1: For the retrieval fields with keywords, respectively search in the target data classes according to each keyword in each retrieval field with a keyword to obtain a first set of the retrieval fields with keywords, and the first set includes multiple records corresponding to the keywords of the retrieval fields with keywords; Step 2: According to the order of each retrieval field in the retrieval formula, if the second retrieval field in the retrieval formula carries a keyword, then use the first set of the first retrieval field as the retrieval condition for the first set corresponding to the second retrieval field in the retrieval formula to obtain a second set of the second retrieval field, and the second set of the second retrieval field includes multiple records corresponding to the multiple records in the first set of the first retrieval field; if the second retrieval field in the retrieval formula does not carry a keyword, then use the first set of the first retrieval field as the retrieval condition for the target data class corresponding to the second retrieval field in the retrieval formula to obtain a first set of the second retrieval field, and the first set of the second retrieval field includes multiple records corresponding to the multiple records in the first set of the first retrieval field; Step 3: Take the second retrieval field as the first retrieval field, repeat Step 2, and respectively retrieve the first set or the target data class corresponding to the remaining retrieval fields in the retrieval formula until the first set or the second set of the last retrieval field in the retrieval formula is retrieved and obtained, and use the multiple records in the first set or the second set of the last retrieval field as the retrieval result corresponding to the retrieval formula.

2. The data classification and retrieval method according to any one of claims 1, characterized in that, the steps of determining the keywords of the retrieval field include, extracting the first keyword of the retrieval field from the retrieval formula; judging whether there are connecting words before and after the first keyword; if so, dividing the first keyword according to the connecting words to obtain multiple second keywords, and using the multiple second keywords as the keywords; if not, using the first keyword as the keyword.

3. The data classification and retrieval method according to claim 1, Characterized in that, The process of classifying the data to be retrieved according to multiple said retrieval fields is executed in parallel.

4. A data classification and retrieval device, Characterized in that, Comprising, A retrieval formula acquisition unit, configured to acquire a retrieval formula for data to be retrieved; A retrieval field extraction unit, configured to extract multiple retrieval fields in the retrieval formula, wherein, the retrieval formula includes the keyword of the first retrieval field; A classification unit, configured to classify the data to be retrieved according to multiple said retrieval fields to obtain multiple target data classes, and each said target data class includes multiple records corresponding to the retrieval field to which it belongs; A retrieval unit, configured to determine the retrieval result corresponding to the retrieval formula according to multiple said target data classes, the keyword of the first retrieval field, and the order of each retrieval field in the retrieval formula; Some retrieval fields in the retrieval formula carry keywords; Determining the retrieval result corresponding to the retrieval formula according to multiple said target data classes, the keyword of the first retrieval field, and the order of each retrieval field in the retrieval formula further includes, Step 1: For the retrieval fields with keywords, respectively search in the target data classes according to each keyword in each retrieval field with a keyword to obtain a first set of the retrieval fields with keywords, and the first set includes multiple records corresponding to the keywords of the retrieval fields with keywords; Step 2: According to the order of each retrieval field in the retrieval formula, if the second retrieval field in the retrieval formula carries a keyword, then use the first set of the first retrieval field as the retrieval condition for the first set corresponding to the second retrieval field in the retrieval formula to obtain a second set of the second retrieval field, and the second set of the second retrieval field includes multiple records corresponding to the multiple records in the first set of the first retrieval field; if the second retrieval field in the retrieval formula does not carry a keyword, then use the first set of the first retrieval field as the retrieval condition for the target data class corresponding to the second retrieval field in the retrieval formula to obtain a first set of the second retrieval field, and the first set of the second retrieval field includes multiple records corresponding to the multiple records in the first set of the first retrieval field; Step 3: Use the second retrieval field as the first retrieval field, repeat Step 2, and respectively retrieve the first set or target data class corresponding to the remaining retrieval fields in the retrieval formula until the retrieval of the first set or target data class corresponding to the last retrieval field in the retrieval formula is completed and the first set or second set of the last retrieval field is obtained, and use the multiple records in the first set or second set of the last retrieval field as the retrieval result corresponding to the retrieval formula.

5. A computer device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, Characterized in that, When the processor executes the computer program, it implements the method according to any one of claims 1 to 3.

6. A computer-readable storage medium, Characterized in that, The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 3 is implemented.

7. A computer program product, characterized in that the computer program product includes a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 3 is implemented.

Citation Information

Patent Citations

  • Governmental information retrieval method and system and terminal equipment

    CN108038229A

  • Data processing method and system based on distributed storage system

    CN113407785A