Data query method and device, computer device, and storage medium

By classifying and storing data in different types of databases, leveraging the advantages of both non-relational and relational databases, the system can quickly match the first data and find the second data using identification information, thus solving the problem of low query efficiency and achieving efficient data retrieval.

CN116610703BActive Publication Date: 2026-02-10IND BANK CO +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310627529.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-30
Publication Date
2026-02-10
Estimated Expiration
2043-05-30

AI Technical Summary

Technical Problem

When multiple fields in the query conditions are dynamically combined according to the logical relationship of the input, the existing technology cannot effectively utilize the pre-compiled query statement, resulting in low server query efficiency and difficulty in meeting the query needs of the client.

Method used

The data to be queried is classified into first data and second data, and stored in different types of databases respectively. The first data is quickly matched in the first database, and the second data is quickly found in the second database using the identification information. By combining the advantages of non-relational and relational databases, the query process is optimized.

Benefits of technology

It improves query efficiency while ensuring data integrity and accuracy, thus meeting the query needs of clients.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116610703B_ABST
    Figure CN116610703B_ABST
Patent Text Reader

Abstract

The application relates to a data query method and device, computer equipment and a storage medium. The method comprises the following steps: obtaining a query condition corresponding to to-be-queried data; data in the to-be-queried data is classified as first data and second data; first data matched with the query condition and identification information of the to-be-queried data are queried in a first database; an association relationship between the first data and the identification information is pre-stored in the first database; second data is queried in a second database according to the identification information; and an association relationship between the second data and the identification information is pre-stored in the second database. Therefore, the disclosed embodiment improves the query efficiency while ensuring the integrity of the data.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer, in particular to a data query method and device, computer equipment, storage medium and computer program product. BACKGROUND

[0002] With the development of computer technology, information query technology appears. A user inputs a query condition on a client, and a server side retrieves a query result matched with the query condition. However, when a plurality of fields in the query condition are dynamically combined according to an input logical relationship, the input logical relationship and field content are unpredictable, so that a database cannot use a query statement corresponding to a precompiled query condition, and therefore, server query efficiency is low, and it is difficult to meet client query requirements. SUMMARY

[0003] Therefore, it is necessary to provide a data query method, device, computer equipment, storage medium and computer program product aiming at the above technical problems.

[0004] In a first aspect, the present application provides a data query method. The method comprises:

[0005] The method is applied to a server, and comprises:

[0006] obtaining a query condition corresponding to to-be-queried data; wherein the query condition comprises a combination of a plurality of query fields; data in the to-be-queried data is classified into first data and second data;

[0007] querying, in a first database, first data matched with the query condition and identification information of the to-be-queried data; wherein an association relationship between the first data and the identification information is pre-stored in the first database;

[0008] querying, in a second database, second data according to the identification information; wherein an association relationship between the second data and the identification information is pre-stored in the second database.

[0009] In a possible implementation manner, the first database comprises a non-relational database, and the querying, in the first database, of the first data matched with the query condition comprises:

[0010] extracting, from the query condition, a query field related to the first data;

[0011] determining, according to a pre-set association relationship between the query field and the first data, the first data corresponding to the query field related to the first data.

[0012] In a possible implementation, the second database comprises a relational database, and the obtaining of the query condition corresponding to the to-be-queried data further comprises:

[0013] obtaining a data source;

[0014] classifying the data source into first data and second data according to preset weights of data contents of the data source, wherein the weight of the first data is less than that of the second data;

[0015] storing the first data in the first database and storing the second data in the second database.

[0016] In a possible implementation, the method further comprises:

[0017] obtaining, according to a preset hot spot statistical rule, hot spot data with a query frequency greater than a preset threshold from the data source;

[0018] storing the hot spot data in a cache database;

[0019] The obtaining of the query condition corresponding to the to-be-queried data further comprises:

[0020] in a case where the query condition meets a preset hot spot query condition, determining the to-be-queried data from the cache database;

[0021] in a case where the query condition does not meet the preset hot spot query condition, querying, in the first database, the first data matching the query condition and the identification information of the to-be-queried data.

[0022] In a possible implementation, the method further comprises:

[0023] obtaining a plurality of preset query conditions;

[0024] querying corresponding first data according to the plurality of preset query conditions to obtain a plurality of first data;

[0025] determining an optimal preset number of query conditions according to the plurality of first data and a Pareto rule;

[0026] sending the preset number of query conditions to a client to instruct the client to display the preset number of query conditions on a data query page.

[0027] In a possible implementation, the to-be-queried data comprises interview data of a candidate, and the obtaining of the query condition corresponding to the to-be-queried data further comprises:

[0028] establishing a metadata model corresponding to the to-be-queried data;

[0029] According to the metadata model and the first data, a preset association relationship between the query fields and the first data is established;

[0030] According to the metadata model, a storage field and a data storage structure of the second data in the second database are determined; wherein, an attribute of the storage field is set as extensible.

[0031] In a second aspect, the application further provides a data query device. The device comprises:

[0032] A first obtaining module is configured to obtain a query condition corresponding to to-be-queried data; wherein, the query condition comprises a combination of a plurality of query fields; data in the to-be-queried data is classified as first data and second data;

[0033] A first query module is configured to query, in a first database, first data matched with the query condition and identification information of the to-be-queried data; wherein, an association relationship between the first data and the identification information is pre-stored in the first database;

[0034] A second query module is configured to query, according to the identification information, second data in a second database; wherein, an association relationship between the second data and the identification information is pre-stored in the second database.

[0035] In a possible implementation manner, the first database comprises a non-relational database, and the first query module comprises:

[0036] An extracting submodule is configured to extract, from the query condition, a query field related to the first data;

[0037] A determining submodule is configured to determine, according to a preset association relationship between the query field and the first data, the first data corresponding to the query field related to the first data.

[0038] In a possible implementation manner, the second database comprises a relational database, and the device further comprises:

[0039] A second obtaining module is configured to obtain a data source;

[0040] A classifying module is configured to classify, according to a preset weight of data content of the data source, the data source as the first data and the second data; wherein, the weight of the first data is less than that of the second data;

[0041] A first storage module is configured to store the first data in the first database and the second data in the second database.

[0042] In a possible implementation manner, the device further comprises:

[0043] The third obtaining module is configured to obtain, according to a preset hot spot statistical rule, hot spot data with a query frequency greater than a preset threshold from the data source.

[0044] The second storage module is configured to store the hot spot data in a cache database.

[0045] The third query module is configured to determine the to-be-queried data from the cache database when the query condition meets a preset hot spot query condition.

[0046] The first query module is configured to query first data and identification information of the to-be-queried data that match the query condition in a first database when the query condition does not meet the preset hot spot query condition.

[0047] In a possible implementation, the apparatus further includes:

[0048] The fourth obtaining module is configured to obtain a plurality of preset query conditions.

[0049] The fourth query module is configured to query corresponding first data according to the plurality of preset query conditions, to obtain a plurality of first data.

[0050] The first determining module is configured to determine an optimal preset number of query conditions according to the plurality of first data and a Pareto rule.

[0051] The sending module is configured to send the preset number of query conditions to a client, to instruct the client to display the preset number of query conditions on a data query page.

[0052] In a possible implementation, the apparatus further includes:

[0053] The first establishing module is configured to establish a metadata model corresponding to the to-be-queried data.

[0054] The second establishing module is configured to establish a preset association relationship between a query field and first data according to the metadata model and the first data.

[0055] The second determining module is configured to determine a storage field and a data storage structure of second data in a second database according to the metadata model, wherein an attribute of the storage field is set as extensible.

[0056] In a third aspect, the present application also provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the data query method according to any one of the embodiments of the present application when executing the computer program.

[0057] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, implements the data query method as described in any one of the embodiments of this disclosure.

[0058] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the data query method as described in any of the embodiments of this disclosure.

[0059] The aforementioned data query method, apparatus, computer equipment, storage medium, and computer program product classify the data to be queried into first data and second data, and store them in two databases with different indexing mechanisms. In the first database, by establishing a preset association between the query field and the first data, the first data matching the query conditions can be quickly matched. Furthermore, by determining the correspondence between the identification information, the first data, and the second data, the identification information matching the first data is identified. Using this identification information, the second data can be quickly found in the second database. Therefore, this embodiment of the present disclosure can quickly query first data that meets preset requirements (e.g., low importance, small data volume) from the first database, and use the identification information corresponding to the first data to quickly find second data that meets preset requirements (high importance, large data volume, etc.) in the second database. This improves query efficiency while ensuring data integrity. Attached Figure Description

[0060] Figure 1 This is a diagram illustrating the application environment of a data query method in one embodiment.

[0061] Figure 2 This is a schematic diagram of the first process of a data query method in one embodiment;

[0062] Figure 3 This is a schematic diagram of the second process of the data query method in another embodiment;

[0063] Figure 4 This is a structural block diagram of a data query device in one embodiment;

[0064] Figure 5 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0065] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0066] It should also be noted that the candidate information (including but not limited to candidate device information, candidate personal information, etc.) and data (including but not limited to data used for querying, displaying, and analyzing, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties. The acquisition, storage, use, and processing of data in the technical solution of this application all comply with the relevant provisions of national laws and regulations.

[0067] The data query method provided in this application embodiment can be applied to, for example... Figure 1 In the application environment shown, terminal 102 communicates with server 104 via a network. A first database stores the first data that server 104 needs to query; a second database stores the second data that server 104 needs to query; and a cache database stores frequently accessed data that server 104 needs to query. The data storage system can be integrated onto server 104 or hosted on the cloud or other network servers. Terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, and smart in-vehicle devices. Portable wearable devices can include smartwatches, smart bracelets, and head-mounted devices. Server 104 can be implemented using a standalone server or a server cluster consisting of multiple servers.

[0068] In one embodiment, such as Figure 2 As shown, a data query method is provided, which can be applied to... Figure 1 Taking the server in the example, the following steps are included:

[0069] Step S201: Obtain the query conditions corresponding to the data to be queried; wherein, the query conditions include a combination of multiple query fields; the data in the data to be queried is classified into a first data type and a second data type.

[0070] Specifically, the query conditions may include keywords, classification numbers, and time periods used in the query data. These conditions can include combinations of multiple query fields, such as a combination of keyword 'a' and keyword 'b', or a combination of keywords and classification numbers. The combination methods can include those based on Boolean logic such as "AND," "OR," and "NOT," or custom combinations based on preset scenarios.

[0071] The data to be queried can be classified into first data and second data. In an exemplary embodiment, the data to be queried includes candidate interview data. On the one hand, candidate resume information and records of successful or unsuccessful interviews can serve as first data; on the other hand, candidate browsing history of resume information and login frequency can serve as second data. In another exemplary embodiment, the data to be queried includes product data. On the one hand, product attribute information can serve as first data, and product exposure frequency can serve as second data. In this embodiment of the disclosure, data can be classified into first data type and second data type according to preset weights, where different weights can represent different dimensions, such as data importance, data storage format, storage capacity, etc.

[0072] Step S203: Query the first data that matches the query conditions and the identification information of the data to be queried in the first database; wherein the association between the first data and the identification information is pre-stored in the first database.

[0073] Specifically, the first database and the second database may include databases with different query logics. The first database may include preset associations between query fields and first data, such as: Education experience - first data containing education experience; Work experience - first data containing work experience; Expected salary - first data containing expected salary, etc. After retrieving the first data that satisfies the above query fields in the first database, the first data corresponding to different query fields may come from different identification information. For example, the identification information corresponding to the first data containing education experience may include identification information A, identification information G, identification information H, etc.; the identification information corresponding to the first data containing work experience may include identification information C, identification information J, identification information A, identification information F, etc.; the identification information corresponding to the first data containing expected salary may include identification information G, identification information H, identification information K, etc.

[0074] In this embodiment of the disclosure, the association between the first data and the identification information is pre-stored in the first database, so the corresponding identification information can be found through the first data.

[0075] Step S205: Based on the identification information, query the second data of the second data type in the second database; wherein the association between the second data and the identification information is pre-stored in the second database.

[0076] Specifically, the second database stores the association between the second data and the identification information. The second data can be identified through the identification information.

[0077] In this embodiment, the data to be queried is categorized into first data and second data, and stored in two databases with different indexing mechanisms. In the first database, by establishing a preset association between the query field and the first data, the first data matching the query conditions can be quickly matched. Furthermore, by identifying the correspondence between the identifier information, the first data, and the second data, the identifier information matching the first data is determined. Using this identifier information, the second data can be quickly found in the second database. Therefore, this embodiment can quickly retrieve first data that meets preset requirements (e.g., low importance, small data volume) from the first database, and use the identifier information corresponding to the first data to quickly find second data that meets preset requirements (high importance, large data volume) in the second database. This improves query efficiency while ensuring data integrity.

[0078] In one possible implementation, the first database includes a non-relational database, and the step of querying the first database for first data that matches the query conditions includes:

[0079] Step S301: Extract the query fields related to the first data from the query conditions;

[0080] Step S303: Determine the first data corresponding to the query field related to the first data based on the preset association relationship between the preset query field and the first data.

[0081] Specifically, the first database may include a non-relational database, such as Elasticsearch, Apache CouchDB, MarkLogic, etc. Non-relational databases offer more flexible data storage formats, allowing storage via key-value pairs, wide columns, and graphs, avoiding complex SQL join operations and thus increasing efficiency. The non-relational database stores preset associations between predefined query fields and the first data. Specifically, query fields related to the first data are defined from the query conditions. For example, query conditions may include multiple query fields, such as work experience, education experience, expected salary, number of views, number of logins, click-through rate, etc. View counts, login counts, click-through rate, etc., can be predefined as being related to the first data; work experience, education experience, expected salary, etc., can be predefined as being related to the second data. In an exemplary embodiment, query fields related to the first data are extracted from the query conditions, i.e., work experience, education experience, and expected salary in the example above. Based on the preset associations between the query fields and the first data, the first data corresponding to the query fields related to the first data is determined.

[0082] In this embodiment, a preset association can be established between the first data, the second data, and the identification information. Therefore, based on the determined first data, the identification information corresponding to the first data can be determined, and further, based on the identification information, initial second data can be determined in the second database. In an exemplary embodiment, the initial second data can also be filtered based on query fields related to the second data in the query conditions, such as work experience, education experience, and expected salary in the above example, to obtain the second data.

[0083] The above embodiments utilize the flexible storage format of non-relational databases, which can store data through key-value pairs, wide columns, and graphs, avoiding complex data query statements (SQL) join operations, thus achieving higher efficiency. The second data is stored, along with the relationships between the second data and the query fields related to it. This allows for convenient and quick retrieval of the second data. Based on the identification information corresponding to the second data, the first data is searched in the first database. The first data can then be filtered using query fields related to it, resulting in a stronger correlation between the filtered data and the query conditions.

[0084] In one possible implementation, the second database includes a relational database, and the step of obtaining the query conditions corresponding to the data to be queried further includes:

[0085] Obtain the data source;

[0086] Based on the preset weights of the data content in the data source, the data source is classified into first data and second data; wherein the weight of the first data is less than that of the second data.

[0087] The first data is stored in the first database, and the second data is stored in the second database.

[0088] Specifically, the relational database may include a database that uses a relational model to organize data, stores data in a structured manner, defines each field in each data table, and then stores data according to the table structure. It has the advantages of stable storage and high integrity.

[0089] In this embodiment of the disclosure, the data source may include all data to be queried. In an exemplary embodiment, weights may be assigned to the data content of the data source; for example, the weight corresponding to data related to work experience and education experience may be higher than the weight corresponding to data related to page views, logins, and click-through rates. In an exemplary embodiment, data with lower weights may be used as first data, and data with higher weights may be used as second data. The first data is stored in a first database, and the second data is stored in a second database.

[0090] In this embodiment of the disclosure, since the data is distributed and stored in different databases, in an exemplary embodiment, the second data with a larger weight can be digested using the SM3 algorithm to ensure data integrity.

[0091] In the above embodiments, the first database has a flexible storage structure, allowing for pre-setting the association between query fields and first data, thus enabling quick matching of the first data through the query fields. The second database uses a relational database, which has the advantages of stable storage and high integrity. Therefore, by using the first database to store first data with lower weight and the second database to store data with higher weight, which is more important and core (the definition of important or core data can be set according to specific application scenarios), query efficiency can be guaranteed while ensuring data integrity.

[0092] One possible implementation also includes:

[0093] According to the preset hotspot statistics rules, hotspot data with a query frequency greater than a preset threshold are obtained from the data source;

[0094] The hot data is stored in a cache database;

[0095] The process of obtaining the query conditions corresponding to the data to be queried further includes:

[0096] If the query conditions meet the preset hot query conditions, the data to be queried is determined from the cache database;

[0097] If the query conditions do not meet the preset hot search conditions, the system queries the first database for first data that matches the query conditions and the identification information of the data to be queried.

[0098] Specifically, the hotspot statistics rules may include identifying data whose access frequency reaches a preset threshold within a preset time period as hotspot data, such as the query rate per second. Hotspot data is obtained from a data source. In an exemplary embodiment, the hotspot data is stored in a cache database, which may include a Redis database. During a query, the query conditions can first be checked against preset hotspot query conditions. If they are met, it indicates that the data to be queried is stored in the cache database, and the hotspot data can be directly queried from the cache database.

[0099] In this embodiment of the disclosure, hot data is stored separately in a cache database. Under high concurrency, this can reduce the query pressure on the first and second databases and improve data query efficiency.

[0100] In one possible implementation, multiple preset query conditions are obtained;

[0101] Based on multiple preset query conditions, query the corresponding first data to obtain multiple first data;

[0102] Based on multiple sets of the first data and the Pareto principle, determine the optimal preset number of query conditions;

[0103] Send the preset number of query conditions to the client to instruct the client to display the preset number of query conditions on the data query page.

[0104] Specifically, multiple preset query conditions can include combinations of different fields. For example, query condition a retrieves the first data 'a'; query condition b retrieves the first data 'b'; query condition c retrieves the first data 'c', and so on. Multiple optimization objectives can be set, such as data accuracy, data integrity, and data query efficiency. Based on the Pareto principle or other optimization algorithms, the optimal preset number of query conditions is determined. The preset number of query conditions is sent to the client, instructing the client to display these conditions on the data query page, thereby prompting the user to query the data according to the suggested conditions to obtain more accurate query results.

[0105] In one possible implementation, the data to be queried includes candidate interview data, and before obtaining the query conditions corresponding to the data to be queried, the following steps are included:

[0106] Establish a metadata model corresponding to the data to be queried;

[0107] Based on the metadata model and the first data, establish a preset association relationship between the query fields and the first data;

[0108] Based on the metadata model, the storage fields and data storage structure of the second data in the second database are determined; wherein, the attributes of the storage fields are set to be extensible.

[0109] Specifically, the metadata model is used to describe the attribute information of the data. Different metadata models can be set according to specific application scenarios. For example, in the application scenario of querying interview candidates, work experience, education experience, professional certificates, etc., can be used as field information in the metadata model to establish a structured data storage model. As another example, in the application scenario of product querying, product name, product price, product performance, etc., can be used as field information in the metadata model to establish a structured data storage model. In the first database, based on the metadata model and the first data, a preset association relationship between the query fields and the first data is established. In the second database, based on the metadata model, the storage fields and data storage structure of the second data in the second database are determined. The attribute of the storage fields is set to be extensible.

[0110] In this embodiment, collaboration with third-party systems can be achieved to complete standard data integration. When collecting data from the data source, a web client is used to collect candidate metadata. This client is based on the Vue framework and uses dynamic code rendering during collection. The dynamic code includes HTML, JS, and CSS, and filters are added to screen sensitive and dangerous dynamic code to prevent script injection attacks and other security risks. In other embodiments, this disclosure can also handle data integrity and consistency by introducing the Quarz batch processing framework to periodically synchronize relational and non-relational databases according to different strategy time points and verify the consistency of the SM3 algorithm digest.

[0111] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0112] Based on the same inventive concept, this application also provides a data query apparatus for implementing the data query method described above. The solution provided by this apparatus is similar to the implementation scheme described in the above method; therefore, the specific limitations in one or more data query apparatus embodiments provided below can be found in the limitations of the data query method described above, and will not be repeated here.

[0113] In one embodiment, such as Figure 4 As shown, a data query device is provided, comprising:

[0114] The first acquisition module 401 is used to acquire the query conditions corresponding to the data to be queried; wherein, the query conditions include a combination of multiple query fields; the data in the data to be queried is classified into first data and second data;

[0115] The first query module 403 is used to query the first data that matches the query conditions and the identification information of the data to be queried in the first database; wherein the association between the first data and the identification information is pre-stored in the first database;

[0116] The second query module 405 is used to query the second data in the second database based on the identification information; wherein the association between the second data and the identification information is pre-stored in the second database.

[0117] In one possible implementation, the first database includes a non-relational database, and the first query module includes:

[0118] An extraction submodule is used to extract query fields related to the first data from the query conditions;

[0119] The determination submodule is used to determine the first data corresponding to the query fields related to the first data based on the preset association relationship between the query fields and the first data.

[0120] In one possible implementation, the second database includes a relational database, and the apparatus further includes:

[0121] The second acquisition module is used to acquire the data source;

[0122] The classification module is used to classify the data source into first data and second data according to the preset weights of the data content of the data source; wherein the weight of the first data is less than that of the second data.

[0123] A first storage module is configured to store the first data in the first database and store the second data in the second database.

[0124] In one possible implementation, the device further includes:

[0125] The third acquisition module is used to acquire hot data with a query frequency greater than a preset threshold from the data source according to preset hot data statistics rules.

[0126] The second storage module is used to store the hot data in the cache database;

[0127] The third query module is used to determine the data to be queried from the cache database when the query conditions meet the preset hot query conditions;

[0128] The first query module is used to query the first data that matches the query conditions and the identification information of the data to be queried in the first database when the query conditions do not meet the preset hot spot query conditions.

[0129] In one possible implementation, the device further includes:

[0130] The fourth acquisition module is used to acquire multiple preset query conditions;

[0131] The fourth query module is used to query the corresponding first data according to multiple preset query conditions to obtain multiple first data.

[0132] The first determining module is used to determine the optimal preset number of query conditions based on multiple sets of the first data and the Pareto principle.

[0133] The sending module is used to send the preset number of query conditions to the client, so as to instruct the client to display the preset number of query conditions on the data query page.

[0134] In one possible implementation, the device further includes:

[0135] The first module is used to establish the metadata model corresponding to the data to be queried.

[0136] The second module is used to establish a preset association between the query field and the first data based on the metadata model and the first data.

[0137] The second determining module is used to determine the storage fields and data storage structure of the second data in the second database based on the metadata model; wherein the attributes of the storage fields are set to be extensible.

[0138] Each module in the aforementioned data query device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.

[0139] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 5 As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database stores data for data retrieval. The network interface communicates with external terminals via a network connection. When executed by the processor, the computer program implements a data retrieval method.

[0140] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0141] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0142] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0143] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A data query method, characterized in that, Applied to a server, the method includes: Obtain the data source; According to the preset hotspot statistics rules, hotspot data with a query frequency greater than a preset threshold are obtained from the data source; The hot data is stored in a cache database; Based on the preset weights of the data content in the data source, the data source is classified into first data and second data; wherein the weight of the first data is less than that of the second data. The first data is stored in a first database, and the second data is stored in a second database; wherein the second database includes a relational database; Obtain the query conditions corresponding to the data to be queried; wherein, the query conditions include a combination of multiple query fields; the data in the data to be queried is classified into first data and second data; If the query conditions meet the preset hot query conditions, the data to be queried is determined from the cache database; If the query conditions do not meet the preset hot search conditions, the system queries the first database for first data that matches the query conditions and the identification information of the data to be queried. The system queries a first database for first data that matches the query criteria and for the identification information of the data to be queried; wherein the association between the first data and the identification information is pre-stored in the first database. Based on the identification information, query the second data in the second database; wherein the association between the second data and the identification information is pre-stored in the second database.

2. The method according to claim 1, characterized in that, The first database includes a non-relational database, and querying the first data in the first database that matches the query conditions includes: Extract the query fields related to the first data from the query conditions; Based on the preset association between the query fields and the first data, determine the first data corresponding to the query fields related to the first data.

3. The method according to claim 1, characterized in that, Also includes: Retrieve multiple preset query conditions; Based on multiple preset query conditions, query the corresponding first data to obtain multiple first data; Based on multiple sets of the first data and the Pareto principle, determine the optimal preset number of query conditions; Send the preset number of query conditions to the client to instruct the client to display the preset number of query conditions on the data query page.

4. The method according to claim 1, characterized in that, The data to be queried includes the candidate's interview data. Before obtaining the query conditions corresponding to the data to be queried, the following steps are also included: Establish a metadata model corresponding to the data to be queried; Based on the metadata model and the first data, establish a preset association relationship between the query fields and the first data; Based on the metadata model, the storage fields and data storage structure of the second data in the second database are determined; wherein, the attributes of the storage fields are set to be extensible.

5. A data query device, characterized in that, Applied to a server, the device includes: The second acquisition module is used to acquire the data source; The classification module is used to classify the data source into first data and second data according to the preset weights of the data content of the data source; wherein the weight of the first data is less than that of the second data. A first storage module is configured to store the first data in a first database and store the second data in a second database; The first acquisition module is used to acquire the query conditions corresponding to the data to be queried; wherein, the query conditions include a combination of multiple query fields; the data in the data to be queried is classified into first data and second data; The third acquisition module is used to acquire hot data with a query frequency greater than a preset threshold from the data source according to preset hot data statistics rules. The second storage module is used to store the hot data in the cache database; The third query module is used to determine the data to be queried from the cache database when the query conditions meet the preset hot query conditions; The first query module is used to query the first data that matches the query conditions and the identification information of the data to be queried in the first database when the query conditions do not meet the preset hot spot query conditions. The first query module is further configured to query the first data that matches the query conditions and the identification information of the data to be queried in the first database; wherein the association between the first data and the identification information is pre-stored in the first database; The second query module is used to query the second data in the second database based on the identification information; wherein the association between the second data and the identification information is pre-stored in the second database.

6. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the data query method according to any one of claims 1 to 4.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the data query method according to any one of claims 1 to 4.

8. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the data query method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Data inquiry method and apparatus

    CN105589864A

  • Data query method and device, computer equipment, storage medium and program product

    CN115630196A