Data query method, data query device, equipment and storage medium

By introducing a caching terminal into the data query system, filtering and validating cached data, the problem of long response time in the data query system was solved, and more efficient data querying was achieved.

CN115203261BActive Publication Date: 2026-01-06CHINA PING AN LIFE INSURANCE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210867841.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-21
Publication Date
2026-01-06
Estimated Expiration
2042-07-21

AI Technical Summary

Technical Problem

As the amount of data increases and parallel query tasks increase, the response time of traditional data query systems becomes longer, leading to a decrease in data query efficiency.

Method used

A cache terminal is set up between the search terminal and the application terminal to store the queried data. The target certificate is filtered from the stored certificate in the cache terminal through the data query information, and the initial data is extracted for verification. If it is not an empty set, it is sent to the application terminal to extract the data from the cache terminal, thereby reducing the number of queries to the search terminal.

Benefits of technology

By leveraging the caching features of the caching terminal, the system's concurrency can be improved, the number of data queries on the search terminal can be reduced, and data query efficiency can be increased.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115203261B_ABST
    Figure CN115203261B_ABST
Patent Text Reader

Abstract

The embodiment of the application provides a kind of data query method, data query device, equipment and storage medium, belong to artificial intelligence technical field.The method comprises: obtaining data query information;According to the data query information, target credential is filtered from the storage credential of cache terminal;According to the target credential, initial data is extracted from the cache data of the cache terminal;The initial data is checked, and the check result is obtained;If the check result indicates that the initial data is non-empty set, the target credential is sent to application terminal, so that the application terminal extracts the cache data from the cache terminal.The embodiment of the application can utilize the cache feature of cache terminal to improve the concurrency of system while reducing the number of search terminal original data extraction, so as to improve the efficiency of data query.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and in particular to a data query method, data query device, equipment and storage medium. Background Technology

[0002] Data queries typically involve retrieving data from a database using a data query system. However, as the amount of data increases and parallel query tasks increase, the response time of the data query system becomes longer, which reduces the efficiency of data queries. Summary of the Invention

[0003] The main objective of this application is to provide a data query method, data query device, equipment, and storage medium, which aims to reduce the response time of data queries and improve the efficiency of data queries.

[0004] To achieve the above objectives, a first aspect of this application proposes a data query method applied to a search terminal, the method comprising:

[0005] Retrieve data query information;

[0006] The target credentials are filtered from the stored credentials of the cache terminal based on the data query information;

[0007] Initial data is extracted from the cached data of the cache terminal based on the target credential;

[0008] The initial data is validated to obtain the validation result;

[0009] If the verification result indicates that the initial data is a non-empty set, the target credential is sent to the application terminal so that the application terminal can retrieve the cached data from the cache terminal.

[0010] In some embodiments, the step of filtering the target credential from the stored credentials of the cache terminal based on the data query information includes:

[0011] The target storage information is filtered from the preset data storage information based on the data query information; wherein, the data storage information is used to record the log information of the cached data stored in the cache terminal;

[0012] The target credential is selected from the storage credential of the cache terminal based on the target storage information.

[0013] In some embodiments, the step of filtering the target credential from the storage credential of the cache terminal based on the target storage information includes:

[0014] Target tags are selected from preset storage tags based on the target storage information;

[0015] The target credential is selected from the storage credential of the cache terminal based on the target tag.

[0016] In some embodiments, before filtering the target credential from the stored credentials of the cache terminal based on the data query information, the method further includes:

[0017] The preset storage mapping table is queried based on the data query information to obtain the query results;

[0018] If the query result indicates that the cached data does not exist in the cache terminal, the original data is extracted from the preset database according to the data query information;

[0019] The original data is stored in the cache terminal to obtain the cached data.

[0020] In some embodiments, after storing the original data in the cache terminal to obtain the cached data, the method further includes:

[0021] Generating the storage tag specifically includes:

[0022] Obtain the storage credential of the cached data stored in the cache terminal;

[0023] The storage tag is generated based on the storage certificate.

[0024] In some embodiments, before performing an information query on a preset storage mapping table based on the data storage information to obtain the query result, the method further includes:

[0025] Constructing the storage mapping table specifically includes:

[0026] The data storage information and the storage tag are obtained based on the data query information;

[0027] The data storage information and the storage tag are mapped to obtain the storage mapping table.

[0028] In some embodiments, after performing data validation on the initial data and obtaining the validation result, the method further includes:

[0029] Updating the cached data specifically includes:

[0030] If the verification result indicates that the initial data is an empty set, the original data is extracted from the preset database according to the data query information;

[0031] The cached data of the cache terminal is updated based on the original data.

[0032] To achieve the above objectives, a second aspect of this application provides a data query apparatus, the apparatus comprising:

[0033] The acquisition module is used to retrieve data query information;

[0034] The filtering module is used to filter target credentials from the stored credentials of the cache terminal based on the data query information;

[0035] The extraction module is used to extract initial data from the cached data of the cache terminal based on the target credential;

[0036] The verification module is used to verify the initial data and obtain the verification result.

[0037] The sending module is configured to send the target credential to the application terminal if the verification result indicates that the initial data is a non-empty set, so that the application terminal can retrieve the cached data from the cache terminal.

[0038] To achieve the above objectives, a third aspect of this application provides an electronic device, which includes a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for enabling communication between the processor and the memory. When the program is executed by the processor, it implements the method described in the first aspect above.

[0039] To achieve the above objectives, a fourth aspect of the present application provides a storage medium, which is a computer-readable storage medium for computer-readable storage, wherein the storage medium stores one or more programs that can be executed by one or more processors to implement the method described in the first aspect.

[0040] The data query method, device, equipment, and storage medium proposed in this application filter target credentials from the stored credentials of the cache terminal using data query information, extract initial data based on the target credentials, perform data verification on the initial data to obtain a verification result, and if the verification result indicates that the initial data is a non-empty set, send the target credentials to the application terminal. The application terminal then extracts cached data from the cache terminal based on the target credentials. Therefore, for cached data that has already been queried and is stored in the cache terminal, after determining the target credentials and verifying that the initial data is not empty, a response is sent to the application terminal to extract cached data based on the target credentials. This leverages the caching characteristics of the cache terminal to improve system concurrency, while reducing the number of times the search terminal extracts original data. It eliminates the need for a separate data query from the search terminal for each data query, thus reducing the number of data queries and improving data query efficiency. Attached Figure Description

[0041] Figure 1 This is a system architecture diagram of the data query method provided in the embodiments of this application;

[0042] Figure 2 This is a flowchart of the data query method provided in the embodiments of this application;

[0043] Figure 3 yes Figure 2 The flowchart of step S202 in the document;

[0044] Figure 4 yes Figure 3 The flowchart of step S302 in the document;

[0045] Figure 5 This is a flowchart of a data query method provided in another embodiment of this application;

[0046] Figure 6 This is a flowchart of a data query method provided in another embodiment of this application;

[0047] Figure 7 This is a flowchart of a data query method provided in another embodiment of this application;

[0048] Figure 8 This is a flowchart of a data query method provided in another embodiment of this application;

[0049] Figure 9 This is a schematic diagram of the structure of the data query device provided in the embodiments of this application;

[0050] Figure 10 This is a schematic diagram of the hardware structure of the electronic device provided in the embodiments of this application. Detailed Implementation

[0051] 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.

[0052] It should be noted that although functional modules are divided in the device schematic diagram and a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first," "second," etc., in the specification, claims, and the aforementioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.

[0053] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.

[0054] First, let's analyze some of the terms used in this application:

[0055] Artificial intelligence (AI) is a new branch of computer science that studies, develops, and applies theories, methods, technologies, and systems to simulate, extend, and expand human intelligence. It aims to understand the essence of intelligence and produce intelligent machines that can react in a way similar to human intelligence. Research in this field includes robotics, speech recognition, image recognition, natural language processing, and expert systems. AI can simulate the information processes of human consciousness and thought. Furthermore, AI utilizes digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceiving the environment, acquiring knowledge, and using that knowledge to achieve optimal results.

[0056] Natural Language Processing (NLP): NLP uses computers to process, understand, and utilize human language (such as Chinese and English). NLP is a branch of artificial intelligence and an interdisciplinary field of computer science and linguistics, often referred to as computational linguistics. NLP includes syntactic analysis, semantic analysis, and discourse understanding. It is commonly used in machine translation, handwritten and printed character recognition, speech recognition and text-to-speech conversion, intent recognition, information extraction and filtering, text classification and clustering, sentiment analysis, and opinion mining. It involves data mining, machine learning, knowledge acquisition, knowledge engineering, artificial intelligence research, and linguistic research related to language computation.

[0057] ClickHouse is a columnar database management system for Online Analytical Processing (OLAP), primarily used in the OLAP field. ClickHouse is an open-source MPP architecture analytics engine, its most notable feature being its high-performance vectorized execution engine, along with rich functionality and high reliability. Key features of ClickHouse include: columnar storage, LSM-Tree storage engine, vectorized execution engine, asynchronous merge and mutation mechanisms, and concurrent MPP+SMP.

[0058] `system.query_log`: `system.query_log` is ClickHouse's log table, containing information about executed queries. This includes start time, processing duration, and error messages. The `system.query_log` table records two types of queries: ① Initial queries run directly by the client. Subqueries initiated by other queries (used for distributed query execution). ② For these types of queries, information about the parent query is displayed in the `initial_*` columns.

[0059] Structured Query Language (SQL): SQL is a special-purpose programming language, a database query and programming language used to access, query, update, and manage relational database systems; it is also the file extension for database script files. SQL is a high-level, non-procedural programming language that allows users to work on high-level data structures. It does not require users to specify how data is stored, nor does it require users to understand the specific data storage methods. Therefore, different database systems with completely different underlying structures can use the same SQL as an interface for data input and management.

[0060] Ignite: Ignite is a memory-centric distributed database, caching, and processing platform for transactional, analytical, and streaming workloads, delivering petabyte-scale in-memory speeds. Ignite provides a high-performance, distributed, in-memory framework for organizing and managing data across applications and diverse data sources. As a distributed in-memory database, Ignite supports ACID transactions and APIs for SQL statements, key-value pairs, calculators, machine learning, and other data processing.

[0061] Result set: A result set is an object that returns the results of a query. You can say that a result set is an object that stores query results. However, a result set does not only have the function of storage, but also the function of manipulating data, such as updating data.

[0062] Traditional data querying processes extract corresponding data from the server based on the query information provided by the user. To improve the efficiency of data querying, related technologies use the ClickHouse system for data analysis. Although the ClickHouse system has a high-performance vectorized execution engine, as the concurrency of data queries increases, the response time of data queries through the ClickHouse system will also be delayed, thereby reducing the efficiency of data querying.

[0063] Based on this, embodiments of this application provide a data query method, data query apparatus, device, and storage medium. By setting up a cache terminal between the search terminal and the application terminal, the queried data is stored in the cache terminal. When data needs to be queried, the target certificate is filtered from the stored certificate in the cache terminal using data query information. Then, the initial data is extracted from the cached data in the cache terminal based on the target certificate, and the initial data is validated to obtain a validation result. If the validation result is a non-empty set, the target certificate is sent to the application terminal. The application terminal then extracts the cached data from the cache terminal based on the target certificate, eliminating the need to extract data from the search terminal every time, reducing the number of queries by the search terminal, and thus improving the efficiency of data query.

[0064] The data query method, data query device, equipment, and storage medium provided in this application are specifically described through the following embodiments. First, the data query method in this application is described.

[0065] The embodiments of this application can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence (AI) refers to the theories, methods, technologies, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results.

[0066] Foundational artificial intelligence technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies mainly encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.

[0067] The data query method provided in this application relates to the field of artificial intelligence technology. The data query method provided in this application can be applied to a terminal, a server, or software running on either a terminal or a server. In some embodiments, the terminal can be a smartphone, tablet, laptop, desktop computer, etc.; the server can be configured as an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application implementing the data query method, but is not limited to the above forms.

[0068] This application can be used in a wide variety of general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices. This application can be described in the general context of a computer-executable credential executed by a computer, such as a program module. Generally, a program module includes routines, programs, objects, components, data structures, etc., that perform a specific task or implement a specific abstract data type. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In a distributed computing environment, program modules can reside in local and remote computer storage media, including storage devices.

[0069] It should be noted that in all specific embodiments of this application, when processing data related to user identity or characteristics, such as user information, user behavior data, user historical data, and user location information, user permission or consent is obtained first. Furthermore, the collection, use, and processing of this data comply with relevant laws, regulations, and standards of the relevant countries and regions. In addition, when embodiments of this application require access to sensitive personal information of users, separate permission or consent from the user is obtained through pop-ups or redirects to confirmation pages. Only after obtaining the user's separate permission or consent is the necessary user-related data for the proper functioning of the embodiments of this application obtained.

[0070] Figure 1 This is a system architecture diagram of the data query method provided in the embodiments of this application. Figure 1 In this example, the system architecture includes an application terminal, a cache terminal, and a search terminal.

[0071] In this system, the application terminal acts as the initiator of the data query and is connected to the cache terminal. The application terminal is also connected to the search terminal to send the data query information to the search terminal and receive the target credentials from the search terminal based on the data query information. Based on the target credentials, the application terminal retrieves cached data from the cache terminal.

[0072] The search terminal acts as the queryer of data queries. It communicates with both the application terminal and the cache terminal. After initially extracting raw data based on the query information sent by the application terminal, the search terminal stores the raw data in the cache terminal to obtain cached data. Upon receiving further query information from the application terminal, the search terminal retrieves the target credential from the cache terminal's storage credential based on the query information. Then, it extracts initial data from the cache terminal based on the target credential and performs data verification to obtain the verification result. If the verification result is a non-empty set, it indicates that the data stored in the cache terminal that matches the query information is not empty. The search terminal then sends the target credential to the application terminal, allowing it to directly extract cached data based on the target credential. This eliminates the need for repeated data queries and extractions from the search terminal. For data that has already been queried, it directly extracts data from the cache terminal, reducing the number of data extractions by the search terminal and thus improving the efficiency of data queries.

[0073] The caching terminal acts as a storer of cached data, which consists of data that has already been queried. The caching terminal communicates with both the search terminal and the application terminal. Each time raw data is retrieved from the search terminal, it is stored in the caching terminal to obtain cached data. Furthermore, the application terminal can retrieve cached data from the caching terminal based on the target credentials, eliminating the need for a separate data query from the search terminal each time. Data that has already been queried can be directly retrieved, thus improving data retrieval time.

[0074] It will be understood by those skilled in the art that Figure 1 The system architecture shown does not constitute a limitation on the embodiments of this application. It may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0075] exist Figure 1 In the system architecture shown, each terminal can call its stored data query program to perform data queries.

[0076] Please refer to Figure 2 , Figure 2 This is an optional flowchart of the data query method provided in the embodiments of this application. Figure 2 The method may include, but is not limited to, steps S201 to S205.

[0077] Step S201: Obtain data query information;

[0078] Step S202: Filter the target credentials from the stored credentials of the cache terminal based on the data query information;

[0079] Step S203: Extract initial data from the cached data of the cache terminal based on the target credential;

[0080] Step S204: Perform data verification on the initial data and obtain the verification result;

[0081] Step S205: If the verification result indicates that the initial data is a non-empty set, the target credential is sent to the application terminal so that the application terminal can retrieve the cached data from the cache terminal.

[0082] Steps S201 to S205 of this embodiment involve obtaining data query information and filtering target credentials from the storage credentials of the cache terminal based on the data query information. If a target credential can be filtered from the storage credentials, it indicates that the cache terminal stores cached data that matches the data query information, meaning that the data corresponding to the data query information has been queried. Then, initial data is extracted from the cache terminal based on the target credential, and the initial data is validated to determine if it is an empty set. If the validation result indicates that the initial data is not an empty set, it means that the initial data is not empty, and the target credential is sent to the application terminal so that the application terminal can extract cached data from the cache terminal. Therefore, for cached data that has already been queried and stored in the cache terminal, after determining the target credential and confirming that the initial data is not an empty set, a response is sent to the application terminal so that the application terminal can extract cached data based on the target credential. This utilizes the caching characteristics of the cache terminal to improve system concurrency while reducing the number of times the search terminal extracts original data, thereby improving the efficiency of data querying. Therefore, it is not necessary to perform a data query from the search terminal every time a data query is performed, thus reducing the number of data queries by the search terminal and improving the efficiency of data querying.

[0083] In step S201 of some embodiments, a data query request is sent through the application terminal, and the data query request includes data query information. The data query information is extracted from the data query request. The data type of the data query request includes at least one of the following: voice, text, and image. If voice information is received, it is converted to text to obtain voice content, and semantic understanding is performed on the voice content to obtain the data query information. If text information is received, semantic understanding is performed on the text information to obtain the data query information. If an image is received, content recognition is performed on the image to obtain image content, and semantic understanding is performed on the image content to obtain the data query information.

[0084] In step S202 of some embodiments, the caching terminal stores cached data, and each cached data corresponds to a storage credential. Upon initial data query, the original data is stored in the caching terminal, and a corresponding storage credential is generated. Therefore, target credentials are filtered from the storage credentials using the data query information, thus identifying target credentials that match the data query information.

[0085] In step S203 of some embodiments, by filtering the target credential from the stored credentials, that is, determining that the cached data stored in the cache terminal is data that has already been queried, the initial data is extracted from the cache terminal based on the target credential. Here, the initial data is a result set, which serves as the object of the data query result feedback. Therefore, the initial data is not cached data, but rather a result feedback object generated after the cached data is found in the cache terminal based on the target credential. Furthermore, the size of the result set is much smaller than the cached data, so the search terminal does not need to consume excessive resources to extract the result set, thereby maintaining the efficiency of data querying.

[0086] In step S204 of some embodiments, the initial data is validated, that is, the result set is checked for emptiness to obtain a validation result. If the result set is empty, the validation result indicates that the initial data is empty; if the result set is not empty, the validation result indicates that the initial data is not empty. By validating the initial data to determine whether it is empty, if the initial data is empty, it means that the cached data stored in the cache terminal has expired; if the initial data is not empty, it means that the cached data stored in the cache terminal is still valid. Therefore, by validating the initial data to obtain a validation result, valid cached data can be accurately extracted.

[0087] In step S205 of some embodiments, if the verification result is that the initial data is a non-empty set, it means that the cached data stored in the cache terminal is still effective. Then the target credential is sent to the application terminal. The application terminal can then directly extract the cached data from the cache terminal based on the target credential, without having to query the data from the search terminal each time, thus reducing the number of data queries from the search terminal. For data that has already been queried, it can be directly extracted from the cache terminal, thereby improving the efficiency of data query.

[0088] It should be noted that the target credentials are sent to the application terminal, which then filters the target file from the storage files of the cache terminal based on the target credentials and extracts cached data from the target file to achieve fast data retrieval.

[0089] Please see Figure 2 In some embodiments, step S202 may include, but is not limited to, steps S301 to S302:

[0090] Step S301: Target storage information is selected from preset data storage information based on data query information; wherein, data storage information is used to record log information of cached data stored in the cache terminal;

[0091] Step S302: Filter the target credentials from the storage credentials of the cache terminal according to the target storage information.

[0092] In step S301 of some embodiments, data storage information needs to be constructed in advance before data querying. The ClickHouse system runs on the search terminal, and the ClickHouse system starts a data query information recording engine. Each time data query information is received, the system records the data query information to obtain historical query information. It also monitors the process of the search terminal retrieving original data based on the data query information and caching it to the cache terminal to obtain cached data, thus obtaining log information. Data storage information is generated based on the log information. The log information includes: historical query information, query time, storage memory usage, data storage location, and query user information. Therefore, by comparing the data query information with the historical query information of the data storage information, the target storage information is filtered out. The target storage information clearly shows the location, size, and storage credentials of the cached data stored on the cache terminal.

[0093] In step S302 of some embodiments, the target credential is filtered from the storage credentials of the cache terminal according to the target storage information, making the target credential acquisition operation simpler, and the cached data can be quickly found through the target credential.

[0094] Please see Figure 4 In some embodiments, step S302 may include, but is not limited to, steps S401 to S402:

[0095] Step S401: Filter out target tags from preset storage tags based on target storage information;

[0096] Step S402: Filter the target credentials from the storage credentials of the cache terminal according to the target tag.

[0097] In step S401 of some embodiments, the ClickHouse system has a log table, which is system.query_log. The log table records the mapping relationship between data storage information and storage tags. The storage tags and storage credentials correspond to each other. The storage credentials serve as credentials for the cache terminal to store cached data. The matching storage tag is found from the log table based on the target storage information as the target tag. Then, the matching storage credentials are obtained based on the target tag as the target credentials, making it easy to obtain the target credentials.

[0098] For example, if a matching storage tag is found in the log table based on the target storage information, it means that the data corresponding to the data query information has already been queried. Therefore, the storage tag can be extracted from the log table based on the target storage information. If the storage tag is query_id, the mapping relationship between the data storage information and the storage tag recorded in the log table is as follows: information A matches query_id a, information B matches query_id b, and information C matches query_id c. If the received target storage information is information B, query_id b can be found based on the mapping relationship in the log table, making the search for the target credential simple.

[0099] In step S402 of some embodiments, after determining the target tag, a matching storage credential is obtained as the target credential based on the target tag, making the acquisition of the target credential simple. Specifically, after storing cached data in the cache terminal, a storage credential is generated, and the storage credential and the storage tag are mapped to obtain a credential mapping table. When the target tag is received, the corresponding storage credential is found from the credential mapping table based on the target tag, making the acquisition of the target credential simple.

[0100] For example, if the storage tag is query_id and the storage credential is key, a credential mapping table is obtained by mapping the storage credential key of the caching terminal and the storage tag query_id of the search terminal. When data query information is received, the search terminal filters out the target storage information, and then finds the target tag from the log table based on the target storage information. The target credential can then be found from the credential mapping table based on the target tag, which means the target credential is filtered out from the storage credential of the caching terminal, making the search for the target credential simple.

[0101] Please see Figure 5 In some embodiments, prior to step S202, the data query method may include, but is not limited to, steps S501 to S503:

[0102] Step S501: Perform an information query on the preset storage mapping table based on the data query information to obtain the query result;

[0103] Step S502: If the query result indicates that there is no cached data in the cache terminal, the original data is extracted from the preset database according to the data query information;

[0104] Step S503: Store the original data in the cache terminal to obtain cached data.

[0105] In step S501 of some embodiments, the storage mapping table includes a mapping relationship between data storage information and storage tags. The storage mapping table is queried based on the data query information to find data storage information that matches the data query information, thus obtaining a query result. If no data storage information matching the data query information is found in the storage mapping table, it means that the cache terminal does not store cached data. If data storage information matching the data query information is found in the storage mapping table, it is obtained as the target storage information. The corresponding storage tag is then found in the storage mapping table based on the target storage information to obtain the target tag. The target credential is then found in the credential mapping table using the target tag. The query result indicates that the cache terminal has cached data, and the cached data can be directly extracted from the cache terminal.

[0106] In step S502 of some embodiments, if no matching data storage information is found in the storage mapping table based on the data query result, the query result indicates that the cache terminal does not have cached data, and the data corresponding to the data query information can be considered as the first query. Then, the original data is extracted from the preset database based on the data query information, to extract the original data matching the data query information from the preset database. Therefore, while retaining historically queried data, it directly extracts cached data from the cache terminal, and it can also directly extract the original data matching the data query information from the preset database when the cache terminal does not have corresponding cached data. This improves data query efficiency and ensures a fast response time for data queries.

[0107] In step S503 of some embodiments, for the data searched for the first time, after extracting the original data, the original data is stored in the cache terminal to obtain cached data. At the same time, after storing it in the cache terminal, a corresponding storage certificate is generated, that is, the certificate for determining that the cached data is stored in the cache terminal.

[0108] Please see Figure 6 In some embodiments, after step S503, the data query method further includes:

[0109] Generate storage tags.

[0110] If the storage mapping table does not have data storage information matching the data query information, the query result indicates that the cache terminal does not have cached data. In this case, the original data matching the data query information is extracted from the preset database and stored in the cache terminal to obtain the cached data. At the same time, after the cache terminal stores the cached data, it generates a storage certificate. A new storage tag needs to be generated based on the storage certificate. The cached data can be retrieved based on the storage tag the next time a data query is performed, thereby improving the efficiency of data query.

[0111] Generating storage tags includes, but is not limited to, steps S601 to S602:

[0112] Step S601: Obtain the storage certificate for cached data stored in the cache terminal;

[0113] Step S602: Generate a storage tag based on the storage credential.

[0114] In step S601 of some embodiments, the original data is stored in the cache terminal to obtain cached data, and the cache terminal generates a storage certificate based on the cached data, then the storage certificate of the cached data stored in the cache terminal is obtained.

[0115] In step S602 of some embodiments, after obtaining the storage certificate of the cached data stored in the cache terminal, a storage tag is generated according to the storage certificate to update the storage tag on the preset storage mapping table. Then, the storage tag can be extracted from the storage mapping table according to the data query information the next time data is queried.

[0116] For example, if the storage credential is p1, a storage tag a1 is generated based on the storage credential. If the storage credential is p2, a storage tag a2 is generated based on the storage credential. The storage credential and storage tag are stored in a key-value data structure to obtain a credential mapping table, with the storage credential as the key and the storage tag as the value. Then p1 and a1 match, and p2 and a2 match. Therefore, by generating storage tags from storage credentials, the storage credential can be determined using the storage tags, allowing cached data to be retrieved from the cache terminal based on the storage credential, making cached data retrieval simpler.

[0117] In some embodiments, prior to step S501, the data query method further includes:

[0118] Construct a storage mapping table.

[0119] It should be noted that by constructing a storage mapping table, upon receiving data query information, the corresponding data storage information can be retrieved from the storage mapping table to obtain the target storage information. Then, based on the target storage information, a target tag is selected from the storage tags. Finally, based on the target tag, the target credential is selected from the storage credentials of the cache terminal. Finally, the cached data can be retrieved from the cache terminal based on the target credential. Therefore, by constructing a mapping table, the target credential for cached data can be directly determined for data that has already been queried, enabling rapid retrieval of the cached data and thus improving data query efficiency.

[0120] Please see Figure 7 In some embodiments, constructing the storage mapping table may include, but is not limited to, steps S701 to S702:

[0121] Step S701: Obtain data storage information and storage tags based on data query information;

[0122] Step S702: Map the data storage information and storage tags to obtain a storage mapping table.

[0123] In step S701 of some embodiments, after extracting raw data from a preset database based on data query information, the raw data is stored in a cache terminal to obtain cached data. Log information is obtained by monitoring data queries and storage in the cache terminal, and data storage information is generated based on the log information. Simultaneously, after storing the cached data, the cache terminal generates a storage credential. A storage tag is then generated based on the storage credential. Data storage information and the storage tag that match the data query information are obtained, so that the storage location and data information of the cached data initially cached in the cache terminal can be determined through the data storage information and the storage tag.

[0124] In step S702 of some embodiments, after obtaining the data storage information and storage tag corresponding to the data query information, the data storage information and storage tag are mapped to establish a mapping relationship and add it to the storage mapping table. Therefore, after each data query, data storage information and storage tag are generated, and a mapping relationship is generated by mapping the data storage information and storage tag, and the new mapping relationship is added to the storage mapping table. Thus, by constructing a storage mapping table, each time a data query is performed, the information is first queried from the storage mapping table based on the data query information to determine if the query has already occurred. If it has, the storage tag can be directly extracted from the storage mapping table as the target tag. Based on the target tag, the target credential is filtered from the storage credential of the cache terminal, and the cached data is extracted based on the target credential, thereby reducing the number of queries on the original data of the search terminal and improving data query efficiency.

[0125] In some embodiments, after step S204, the data query method further includes:

[0126] Update cached data.

[0127] It should be noted that since the cached data of the cache terminal may become invalid, if the test result indicates that the initial data is an empty set and the cached data is invalid, then the cached data of the cache terminal needs to be updated to ensure that the cached data of the cache terminal can be extracted for analysis.

[0128] Please refer to Figure 8 Updating cached data may include, but is not limited to, steps S801 and S802:

[0129] Step S801: If the verification result indicates that the initial data is an empty set, extract the original data from the preset database according to the data query information;

[0130] Step S802: Update the cached data of the cache terminal according to the original data.

[0131] In step S801 of some embodiments, if the verification result indicates that the initial data is an empty set, meaning that the cached data in the result set feedback cache terminal has expired, then the original data matching the data query information is extracted from the preset database. That is, the ClickHouse system then queries the data query information to obtain the original data. Therefore, for expired cached data, the original data is extracted from the preset database to update the cached data, thereby reducing the response time of the data query.

[0132] In step S802 of some embodiments, the cached data of the cache terminal is updated according to the original data, that is, the original data is re-stored to the cache terminal to obtain cached data. The cache terminal is equipped with an Ignite system to re-store the original data into the Ignite system, so that valid cached data can be retrieved from the cache terminal subsequently, thereby improving data query efficiency.

[0133] When this application embodiment receives data query information for the first time, it queries the corresponding data storage information in the preset storage mapping table according to the data query information to obtain the query result. If the query result indicates that the cache terminal does not have cached data, that is, it means that the storage mapping table does not have data storage information that matches the data query information, then the original data is extracted from the preset database according to the data query information and stored in the cache terminal to obtain cached data. After the cached data is stored in the cache terminal, a storage certificate is generated, and a storage tag is generated according to the storage certificate. At the same time, the process of querying and storing the original data is recorded to obtain log information, and data storage information is generated according to the log information. The data storage information and storage tag are mapped to obtain a mapping relationship, and the mapping relationship is added to the storage mapping table. When data is queried again, the target storage information is filtered from the data storage information in the storage mapping table according to the data query information, and the target tag is filtered from the storage tag according to the target storage information. The target certificate is then extracted from the storage certificate according to the target tag. If the initial data is retrieved from the cache terminal based on the target credential, and this initial data is the feedback result set of the cached data from the cache terminal, then the initial data is validated to obtain a validation result. If the validation result indicates that the initial data is not empty, the target credential is sent to the application terminal, allowing the application terminal to retrieve cached data from the cache terminal based on the target credential, thereby reducing the number of queries by the search terminal and improving data query efficiency. If the validation result indicates that the initial data is empty, it means that the cached data from the cache terminal has expired. In this case, the original data is retrieved from the preset database based on the data query information and stored in the cache terminal to update the expired cached data. Therefore, after querying the storage mapping table to find matching data storage information and confirming that the data has been queried, the result set is read from the cache terminal, and it is determined whether the result set is empty to decide whether to retrieve cached data from the cache terminal or retrieve original data from the preset database and send it back to the application terminal. This improves the concurrent data query effect without increasing the data query response time. Therefore, by utilizing the caching characteristics of the cache terminal, the system's concurrency is improved while reducing the number of times the search terminal retrieves original data, thereby improving data query efficiency. It eliminates the need to perform a data query from the search terminal every time a data query is made, thereby reducing the number of data queries and improving the efficiency of data retrieval.

[0134] Please see Figure 9 This application also provides a data query device that can implement the above-described data query method. The device includes:

[0135] Module 901 is used to obtain data query information;

[0136] The filtering module 902 is used to filter target credentials from the stored credentials of the cache terminal based on data query information;

[0137] Extraction module 903 is used to extract initial data from the cached data of the cache terminal based on the target credential;

[0138] The verification module 904 is used to verify the initial data and obtain the verification result.

[0139] The sending module 905 is used to send the target credential to the application terminal if the verification result indicates that the initial data is not an empty set, so that the application terminal can retrieve the cached data from the cache terminal.

[0140] The specific implementation of this data query device is basically the same as the specific implementation of the data query method described above, and will not be repeated here.

[0141] By filtering target credentials from the storage credentials of the cache terminal based on data query information, initial data is retrieved from the cache terminal based on the target credential, and the initial data is validated to determine if it is an empty set. If the validation result shows that the initial data is not empty, it means that the initial data is not empty, and the target credential is sent to the application terminal so that the application terminal can retrieve the cached data from the cache terminal. Therefore, for cached data that has already been queried and stored in the cache terminal, after determining the target credential and verifying that the initial data is not empty, a response is sent to the application terminal so that the application terminal can retrieve the cached data based on the target credential. This leverages the caching characteristics of the cache terminal to improve system concurrency while reducing the number of times the search terminal retrieves the original data, thereby improving the efficiency of data query. It eliminates the need to perform a data query from the search terminal for every data query, thus reducing the number of data queries performed by the search terminal and improving the efficiency of data query.

[0142] This application also provides an electronic device, which includes: a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for communication between the processor and the memory. When the program is executed by the processor, it implements the aforementioned data query method. This electronic device can be any smart terminal, including tablet computers, in-vehicle computers, etc.

[0143] Please see Figure 10 , Figure 10 The hardware structure of an electronic device according to another embodiment is illustrated. The electronic device includes:

[0144] The processor 101 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this application.

[0145] The memory 102 can be implemented as a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 102 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 102 and is called and executed by the processor 101 using the data query method of the embodiments of this application.

[0146] Input / output interface 103 is used to implement information input and output;

[0147] The communication interface 104 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).

[0148] Bus 105 transmits information between various components of the device (e.g., processor 101, memory 102, input / output interface 103, and communication interface 104);

[0149] The processor 101, memory 102, input / output interface 103 and communication interface 104 are connected to each other within the device via bus 105.

[0150] This application embodiment also provides a storage medium, which is a computer-readable storage medium for computer-readable storage. The storage medium stores one or more programs, which can be executed by one or more processors to implement the above-described data query method.

[0151] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0152] The data query method, data query apparatus, device, and storage medium provided in this application retrieve a target credential from a storage credential on a cache terminal based on data query information. Then, initial data is retrieved from the cache terminal based on the target credential. The initial data is then validated to obtain a validation result. If the validation result indicates that the initial data is a non-empty set, the target credential is sent to the application terminal. The application terminal then retrieves cached data from the cache terminal based on the target credential. Therefore, data that has already been queried can be directly retrieved from the cache terminal, reducing the number of data queries required by the search terminal, thereby reducing the response time of data queries and improving the efficiency of data queries.

[0153] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.

[0154] It will be understood by those skilled in the art that Figure 2-8 The technical solutions shown do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.

[0155] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0156] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.

[0157] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0158] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.

[0159] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0160] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0161] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0162] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple credentials to enable a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0163] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.

Claims

1. A data query method, characterized by, The method applied to a search terminal comprises: acquiring data query information; screening a target credential from storage credentials of a cache terminal according to the data query information; extracting initial data from cache data of the cache terminal according to the target credential; performing data verification on the initial data to obtain a verification result; if the verification result indicates that the initial data is a non-empty set, sending the target credential to an application terminal to enable the application terminal to extract the cache data from the cache terminal; the screening of the target credential from the storage credentials of the cache terminal according to the data query information comprises: screening target storage information from preset data storage information according to the data query information; wherein the data storage information is used to record log information of storage of the cache data in the cache terminal; screening the target credential from the storage credentials of the cache terminal according to the target storage information; the screening of the target credential from the storage credentials of the cache terminal according to the target storage information comprises: screening a target label from preset storage labels according to the target storage information; screening the target credential from the storage credentials of the cache terminal according to the target label.

2. The method of claim 1, wherein, Before the screening of the target credential from the storage credentials of the cache terminal according to the data query information, the method further comprises: performing information query on a preset storage mapping table according to the data query information to obtain a query result; if the query result indicates that the cache terminal does not have the cache data, extracting original data from a preset database according to the data query information; storing the original data in the cache terminal to obtain the cache data.

3. The method of claim 2, wherein, After the storing of the original data in the cache terminal to obtain the cache data, the method further comprises: generating the storage label, specifically comprising: acquiring the storage credentials of the storage of the cache data in the cache terminal; generating the storage label according to the storage credentials.

4. The method of claim 3, wherein, Before the information query on the preset storage mapping table according to the data storage information to obtain a query result, the method further comprises: constructing the storage mapping table, specifically comprising: acquiring the data storage information and the storage label according to the data query information; performing mapping processing on the data storage information and the storage label to obtain the storage mapping table.

5. The method according to any one of claims 1 to 4, characterized in that, After the data verification on the initial data to obtain a verification result, the method further comprises: updating the cache data, specifically comprising: if the verification result indicates that the initial data is an empty set, extracting original data from a preset database according to the data query information; updating the cache data of the cache terminal according to the original data.

6. A data query apparatus, characterized by comprising: The device applied to a search terminal comprises: an acquisition module for acquiring data query information; a screening module for screening a target credential from storage credentials of a cache terminal according to the data query information; an extraction module for extracting initial data from cache data of the cache terminal according to the target credential; a verification module for performing data verification on the initial data to obtain a verification result; The sending module is configured to send the target credential to the application terminal, so that the application terminal extracts the cache data from the cache terminal, if the check result indicates that the initial data is a non-empty set. The target credential is filtered from the storage credentials of the cache terminal according to the data query information, and the method comprises the steps of: Filtering target storage information from preset data storage information according to the data query information, wherein the data storage information is used to record log information of the cache data stored in the cache terminal; Filtering the target credential from the storage credentials of the cache terminal according to the target storage information; The target credential is filtered from the storage credentials of the cache terminal according to the target storage information, and the method comprises the steps of: Filtering a target label from a preset storage label according to the target storage information; Filtering the target credential from the storage credentials of the cache terminal according to the target label.

7. An electronic device, comprising: The electronic device comprises a memory, a processor, a program stored on the memory and executable on the processor, and a data bus for realizing connection communication between the processor and the memory, and the program is executed by the processor to realize the steps of the method according to any one of claims 1 to 5.

8. A storage medium, the storage medium being a computer-readable storage medium for computer-readable storage, characterized in that, The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to realize the steps of the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Method for synchronizing incremental certificate information between SAP ECC end and SAP BW end

    CN103970854A

  • Certificate data searching method based on SAP (service access point) business information warehouse

    CN103984712A