CN116450674A - Data query method, device, electronic equipment and computer readable medium - Google Patents

Data query method, device, electronic equipment and computer readable medium Download PDF

Info

Publication number
CN116450674A
CN116450674A CN202310377375.9A CN202310377375A CN116450674A CN 116450674 A CN116450674 A CN 116450674A CN 202310377375 A CN202310377375 A CN 202310377375A CN 116450674 A CN116450674 A CN 116450674A
Authority
CN
China
Prior art keywords
data
request
identifier
data query
query
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310377375.9A
Other languages
Chinese (zh)
Inventor
吴东
刘丹
王海
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jingdong Technology Information Technology Co Ltd
Original Assignee
Jingdong Technology Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jingdong Technology Information Technology Co Ltd filed Critical Jingdong Technology Information Technology Co Ltd
Priority to CN202310377375.9A priority Critical patent/CN116450674A/en
Publication of CN116450674A publication Critical patent/CN116450674A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2453Query optimisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24552Database cache management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24553Query execution of query operations
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application discloses a data query method, a data query device, electronic equipment and a computer readable medium, and relates to the technical field of computers, wherein a specific implementation mode comprises the steps of receiving a data query request, acquiring corresponding page number identifiers and request data, and further determining corresponding request identifiers based on the request data; judging whether corresponding data exists in a preset container according to the page number identification and the request identification, and further obtaining judging result data; determining an acquisition mode of the data query starting identifier according to the judging result data, and further acquiring the data query starting identifier corresponding to the page number identifier based on the acquisition mode; based on the data query starting identification, executing the corresponding data query and returning the data obtained by the query. Therefore, the redundancy of the data query result is reduced, and the data query efficiency and the data query performance are improved.

Description

Data query method, device, electronic equipment and computer readable medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a data query method, a data query device, an electronic device, and a computer readable medium.
Background
At present, when deep paging inquiry is performed, for example, when inquiring page 2 data, the database bottom layer can inquire all data of pages 1 to 2 into a memory, and then the result data of page 2 is taken out in a cursor mode, so that the redundancy of data inquiry results is high, and the data inquiry efficiency is low.
Disclosure of Invention
In view of this, the embodiments of the present application provide a data query method, apparatus, electronic device, and computer readable medium, which can solve the problems of high redundancy of the existing data query result and low data query efficiency.
To achieve the above object, according to one aspect of the embodiments of the present application, there is provided a data query method, including:
receiving a data query request, acquiring a corresponding page number identifier and request data, and further determining a corresponding request identifier based on the request data;
judging whether corresponding data exists in a preset container according to the page number identification and the request identification, and further obtaining judging result data;
determining an acquisition mode of the data query starting identifier according to the judging result data, and further acquiring the data query starting identifier corresponding to the page number identifier based on the acquisition mode;
based on the data query starting identification, executing the corresponding data query and returning the data obtained by the query.
Optionally, based on the data query initiation identifier, executing the corresponding data query includes:
determining a sequence identification range based on the data query starting identification;
and querying corresponding data according to the sequence identification range.
Optionally, after executing the corresponding data query, the method further comprises:
determining a next page number identifier corresponding to the page number identifier;
based on the next page code identification, an asynchronous data loading process is performed.
Optionally, determining the corresponding request identifier based on the request data includes:
determining a request data type and a request parameter corresponding to the request data;
and calling an information abstract algorithm to calculate a corresponding request identifier based on the request data type and the request parameters.
Optionally, determining, according to the determination result data, an acquisition mode of the data query start identifier includes:
and responding to the judgment result data corresponding to the corresponding data existing in the preset container, and determining that the acquisition mode of the data query starting identifier is based on the mapping relation.
Optionally, acquiring the data query start identifier corresponding to the page number identifier based on the acquiring mode includes:
and responding to the acquisition mode based on the mapping relation, calculating the mapping relation between the page number identification and the data query starting identification according to the request parameter, and further determining the data query starting identification corresponding to the page number identification according to the mapping relation.
Optionally, determining, according to the determination result data, an acquisition mode of the data query start identifier includes:
and responding to the judgment result data corresponding to the absence of corresponding data in the preset container, and determining that the acquisition mode of the data query starting identifier is based on target data range query.
Optionally, acquiring the data query start identifier corresponding to the page number identifier based on the acquiring mode includes:
responding to the acquisition mode based on the target data range inquiry, and determining a corresponding target data range according to the request identifier and the page number identifier;
and determining a corresponding data query starting identification based on the target data range.
In addition, the application also provides a data query device, which comprises:
the receiving unit is configured to receive a data query request, acquire a corresponding page number identifier and request data, and further determine a corresponding request identifier based on the request data;
the judging unit is configured to judge whether corresponding data exists in the preset container according to the page number identification and the request identification, and further obtain judging result data;
the acquisition unit is configured to determine an acquisition mode of the data query starting identifier according to the judging result data, and further acquire the data query starting identifier corresponding to the page number identifier based on the acquisition mode;
and the execution unit is configured to execute corresponding data query based on the data query starting identification and return the data obtained by the query.
Optionally, the execution unit is further configured to:
determining a sequence identification range based on the data query starting identification;
and querying corresponding data according to the sequence identification range.
Optionally, the data query device further comprises an asynchronous data loading unit configured to:
determining a next page number identifier corresponding to the page number identifier;
based on the next page code identification, an asynchronous data loading process is performed.
Optionally, the receiving unit is further configured to:
determining a request data type and a request parameter corresponding to the request data;
and calling an information abstract algorithm to calculate a corresponding request identifier based on the request data type and the request parameters.
Optionally, the acquisition unit is further configured to:
and responding to the judgment result data corresponding to the corresponding data existing in the preset container, and determining that the acquisition mode of the data query starting identifier is based on the mapping relation.
Optionally, the acquisition unit is further configured to:
and responding to the acquisition mode based on the mapping relation, calculating the mapping relation between the page number identification and the data query starting identification according to the request parameter, and further determining the data query starting identification corresponding to the page number identification according to the mapping relation.
Optionally, the acquisition unit is further configured to:
and responding to the judgment result data corresponding to the absence of corresponding data in the preset container, and determining that the acquisition mode of the data query starting identifier is based on target data range query.
Optionally, the acquisition unit is further configured to:
responding to the acquisition mode based on the target data range inquiry, and determining a corresponding target data range according to the request identifier and the page number identifier;
and determining a corresponding data query starting identification based on the target data range.
In addition, the application also provides a data query electronic device, which comprises: one or more processors; and a storage device for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement the data query method as described above.
In addition, the application also provides a computer readable medium, on which a computer program is stored, which when executed by a processor, implements the data query method as described above.
One embodiment of the above invention has the following advantages or benefits: the method comprises the steps of obtaining corresponding page number identifiers and request data by receiving a data query request, and further determining the corresponding request identifiers based on the request data; judging whether corresponding data exists in a preset container according to the page number identification and the request identification, and further obtaining judging result data; determining an acquisition mode of the data query starting identifier according to the judging result data, and further acquiring the data query starting identifier corresponding to the page number identifier based on the acquisition mode; based on the data query starting identification, executing the corresponding data query and returning the data obtained by the query. Therefore, the redundancy of the data query result is reduced, and the data query efficiency and the data query performance are improved.
Further effects of the above-described non-conventional alternatives are described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the present application and are not to be construed as unduly limiting the present application. Wherein:
FIG. 1 is a schematic diagram of the main flow of a data query method according to one embodiment of the present application;
FIG. 2 is a schematic diagram of the main flow of a data query method according to one embodiment of the present application;
fig. 3 is an application scenario schematic diagram of a data query method according to an embodiment of the present application;
FIG. 4 is a schematic flow chart of a data query method according to one embodiment of the present application;
FIG. 5 is a schematic diagram of an asynchronous loading flow of a data query method according to one embodiment of the present application;
FIG. 6 is a schematic diagram of the main units of a data querying device according to an embodiment of the present application;
FIG. 7 is an exemplary system architecture diagram in which embodiments of the present application may be applied;
fig. 8 is a schematic diagram of a computer system suitable for use in implementing the terminal device or server of the embodiments of the present application.
Detailed Description
Exemplary embodiments of the present application are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present application to facilitate understanding, and should be considered as merely exemplary. Accordingly, one of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present application. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness. It should be noted that, in the technical solution of the present disclosure, the related aspects of collecting, updating, analyzing, processing, using, transmitting, storing, etc. of the personal information of the user all conform to the rules of the related laws and regulations, and are used for legal purposes without violating the public order colloquial. Necessary measures are taken for the personal information of the user, illegal access to the personal information data of the user is prevented, and the personal information security, network security and national security of the user are maintained.
Fig. 1 is a schematic diagram of main flow of a data query method according to an embodiment of the present application, where, as shown in fig. 1, the data query method includes:
step S101, a data query request is received, corresponding page number identifiers and request data are obtained, and further corresponding request identifiers are determined based on the request data.
In this embodiment, the execution body (for example, may be a server) of the data query method may receive the data query request through a wired connection or a wireless connection. The data query request may be, for example, a request for deep paging queries in a database. Such as a request to query page 2 data. After receiving the data query request, the executing body can acquire the page number identification and the request data carried in the request. The page number identification is used to characterize which page number the corresponding data is to be acquired. The request data may include a request data type, for example, request query stream data, request query volume data, request query price data, and the like, and the request data type is not specifically limited in the embodiments of the present application.
Specifically, determining the corresponding request identifier based on the request data includes: determining a request data type and a request parameter corresponding to the request data; an information summarization algorithm, such as an MD5 algorithm, is invoked to calculate a corresponding request identification based on the request data type and request parameters.
The request data type, such as request query stream data, request query volume data, request query price data, etc., is not particularly limited in the embodiments of the present application. The request parameter does not include a page number, may include a link address of the requested data, the number of copies of the requested data, and the like, and the request parameter is not specifically limited in the embodiment of the present application.
A message digest algorithm, such as the MD5 algorithm, is invoked to calculate a corresponding request identification, such as a unique request ID, based on the request data type and request parameters.
Step S102, judging whether corresponding data exists in the preset container according to the page number identification and the request identification, and further obtaining judging result data.
The preset container may be, for example, a cache. The execution body may query a preset container according to the page number identifier and the request identifier, for example, whether corresponding data exists in the cache, so as to obtain the judgment result data. The judging result data may be data corresponding to the page number identifier and the request identifier contained in a preset container, for example, a cache. The judgment result data may also be data corresponding to the page number identifier and the request identifier not included in a preset container, for example, a cache.
Step S103, according to the judging result data, determining the acquisition mode of the data query starting identification, and further acquiring the data query starting identification corresponding to the page number identification based on the acquisition mode.
Specifically, determining, according to the judgment result data, an acquisition mode of the data query start identifier includes: and responding to the judgment result data corresponding to the corresponding data existing in the preset container, and determining that the acquisition mode of the data query starting identifier is based on the mapping relation.
When the execution main body determines that the judging result data corresponds to the data corresponding to the page number identifier and the request identifier in the preset container, for example, the cache contains the data corresponding to the page number identifier, it can be determined that the obtaining mode of the data query starting identifier is based on the mapping relation. The mapping relationship may be, for example, a mapping relationship between a request page number and a start ID, that is, a mapping relationship between a page number identifier and a data query start identifier.
Specifically, acquiring the data query starting identifier corresponding to the page number identifier based on the acquisition mode includes: and responding to the acquisition mode based on the mapping relation, calculating the mapping relation between the page number identification and the data query starting identification according to the request parameter, and further determining the data query starting identification corresponding to the page number identification according to the mapping relation.
For example, the execution body may call the mapping relation calculation engine to calculate the mapping relation between the request page number and the start ID according to the request parameter, and cache, and return the start ID, that is, return the data query start identifier.
Specifically, determining, according to the judgment result data, an acquisition mode of the data query start identifier includes: and responding to the judgment result data corresponding to the absence of corresponding data in the preset container, and determining that the acquisition mode of the data query starting identifier is based on target data range query.
For example, when the executing body determines that the data corresponding to the page number identifier and the request identifier is not included in the preset container, for example, the cache, the executing body may determine that the obtaining manner of the data query start identifier is based on the target data range query. For example, the start ID of the corresponding data range may be queried based on the request ID, page number.
Specifically, acquiring the data query starting identifier corresponding to the page number identifier based on the acquisition mode includes: responding to the acquisition mode based on the target data range inquiry, and determining a corresponding target data range according to the request identifier and the page number identifier, wherein the target data range is 3-6; based on the target data range, a corresponding data query start identification is determined, e.g., 3, or ID >2.
Step S104, based on the data query starting identification, executing the corresponding data query and returning the data obtained by the query.
Specifically, after executing the corresponding data query, the method further comprises: determining a next page code identifier (e.g., page 3) corresponding to the page code identifier (e.g., page 2); based on the next page code identification (e.g., page 3), an asynchronous data loading process is performed.
Asynchronous data loading process, as shown in FIG. 5:
step A: the request next page start ID is acquired.
And (B) step (B): updating initial ID query conditions, and limiting data range to query database result data;
step C: writing database result data to a cache, such as a cache ID:5 to 6.
Step D: and ending the asynchronous data loading process.
After the current query is finished, the execution body actively loads the next page of data so as to improve the query performance of the system when the next page of data is requested.
According to the embodiment, through receiving a data query request, a corresponding page number identification and request data are obtained, and then the corresponding request identification is determined based on the request data; judging whether corresponding data exists in a preset container according to the page number identification and the request identification, and further obtaining judging result data; determining an acquisition mode of the data query starting identifier according to the judging result data, and further acquiring the data query starting identifier corresponding to the page number identifier based on the acquisition mode; based on the data query starting identification, executing the corresponding data query and returning the data obtained by the query. Therefore, the redundancy of the data query result is reduced, and the data query efficiency and the data query performance are improved.
Fig. 2 is a main flow diagram of a data query method according to an embodiment of the present application, where, as shown in fig. 2, the data query method includes:
step S201, a data query request is received, corresponding page number identifiers and request data are obtained, and further corresponding request identifiers are determined based on the request data.
The data query request may be a request for deep paging queries in a database. After receiving the data query request, the executing body can acquire the corresponding page number identification. The number of page number identifiers may be one or a plurality. When the number of the page number identifiers is a plurality of, the data corresponding to the plurality of page numbers is indicated to be queried. The request data may include a request data type, for example, request query stream data, request query volume data, request query price data, and the like, and the request data type is not specifically limited in the embodiments of the present application.
Step S202, judging whether corresponding data exists in a preset container according to the page number identification and the request identification, and further obtaining judging result data.
The preset container may be a memory or a cache. The preset container is not particularly limited in the embodiment of the present application.
The execution body can query a preset container, for example, whether corresponding data exists in a memory or a cache, according to the page number identification and the request identification, so as to obtain judging result data. The judging result data may be data corresponding to the page number identifier and the request identifier contained in a preset container, such as a memory or a cache. The judging result data may also be data corresponding to the page number identifier and the request identifier not included in a preset container, such as a memory or a cache.
Step S203, according to the judging result data, determining the obtaining mode of the data query starting identification, and further obtaining the data query starting identification corresponding to the page number identification based on the obtaining mode.
When the execution main body determines that the judging result data corresponds to the data corresponding to the page number identifier and the request identifier in the preset container, for example, the cache contains the data corresponding to the page number identifier, it can be determined that the obtaining mode of the data query starting identifier is based on the mapping relation. The mapping relationship may be, for example, a mapping relationship between a request page number and a start ID, that is, a mapping relationship between a page number identifier and a data query start identifier.
For example, the execution body may call the mapping relation calculation engine to calculate the mapping relation between the request page number and the start ID according to the request parameter, and cache, and return the start ID, that is, return the data query start identifier.
For example, when the executing body determines that the data corresponding to the page number identifier and the request identifier is not included in the preset container, for example, the cache, the executing body may determine that the obtaining manner of the data query start identifier is based on the target data range query. For example, the start ID of the corresponding data range may be queried based on the request ID, page number.
When the acquisition mode is based on the target data range query, the execution subject can determine a corresponding target data range according to the request identifier and the page number identifier, wherein the target data range is 3-6; based on the target data range, a corresponding data query start identification is determined, e.g., 3, or ID >2.
Step S204, determining a sequence identification range based on the data query starting identification.
The data query start identification, which may be 3 for example, determines a sequential identification range such as ID >2.
Step S205, inquiring corresponding data according to the sequence identification range.
Illustratively, the corresponding data is queried according to ID >2.
Step S206, returning the data obtained by query.
Therefore, the redundancy of the data query result is reduced, and the data query efficiency and the data query performance are improved.
Fig. 3 is an application scenario diagram of a data query method according to an embodiment of the present application. The data query method of the embodiment of the application can be applied to a scene of deep paging query in a database. The embodiment of the application comprises a data writing module and a data query module, wherein the data writing module firstly generates a unique sequence ID of data by using a snowflake algorithm (an algorithm for generating the sequence ID based on time) when writing in a database, then rewrites paging query (determining the data ID corresponding to the page number of the query) into the sequence ID range query by the data query module, and finally the asynchronous loading module asynchronously loads a plurality of pages (particularly a plurality of pages can be adjusted according to service requirements) of data according to the condition of query to improve the paging query performance. The data writing module generates unique sequence IDs for all data, the data query module converts paging query into ID condition range query, and finally the asynchronous loading module caches and loads subsequent page data.
As shown in fig. 3, the execution body may call the data writing module to generate a unique sequence ID for each piece of data using a snowflake algorithm and save the data: a snowflake algorithm is used to generate unique sequence IDs, and the replacement data IDs are written into the database. After generating the sequence ID for the data, the execution body limits the initial ID, for example, limits the data of only the 2 nd page to be queried, limits the ID to be more than 2, and takes 3 to 4 without the need of querying the data of the first 1 page, and asynchronously loads the data of the 3 rd page, namely, caches 5 to 6, so that the query performance is improved.
Fig. 4 is a schematic flow chart of a data query method according to an embodiment of the present application. The execution body may call the data query module to calculate a unique ID for identifying the request according to the request data, first query whether the request page cache exists, calculate a request page start ID if not, then perform a range query while triggering asynchronous loading, and then end the return. The program process flow chart is shown in fig. 4:
step A: the MD5 algorithm is used to generate a unique request ID based on the request data type, parameters (no page number).
And (B) step (B): and inquiring the cache according to the request ID and the page number.
Step C: if the result data exists in the cache, namely the cache data is not empty, the step H is entered.
Step D: and E, if the result data does not exist in the cache, namely the cache data is empty, entering a step E.
Step E: and inquiring the page number starting ID of the corresponding data range according to the request ID and the page number.
Step F: if the page number start ID exists, namely, is not empty, the step J is entered.
Step G: if the page number start ID does not exist, the page number start ID is empty, and the step H is entered.
Step H: and calculating the mapping relation between the requested page number and the page number start ID according to the request parameter, caching, and returning the page number start ID.
Step I: and adding a page number starting ID query condition, limiting a data range to query a database, and triggering asynchronous loading.
Step J: and returning the result data, and ending the flow.
The embodiment of the application calculates the page number starting ID limiting condition during inquiry and simultaneously caches the lower page data. The method has the advantages that the sequence unique ID is generated during data writing, the data limiting range condition is added during query, the lower page buffer is triggered to meet the page-skipping query requirement under the service deep paging scene, and the query performance is improved.
Fig. 6 is a schematic diagram of main units of a data query device according to an embodiment of the present application. As shown in fig. 6, the data query apparatus 600 includes a receiving unit 601, a judging unit 602, an acquiring unit 603, and an executing unit 604.
The receiving unit 601 is configured to receive a data query request, obtain a corresponding page number identifier and request data, and further determine a corresponding request identifier based on the request data.
The judging unit 602 is configured to judge whether corresponding data exists in the preset container according to the page number identifier and the request identifier, so as to obtain judgment result data.
The obtaining unit 603 is configured to determine, according to the determination result data, an obtaining manner of the data query start identifier, and further obtain, based on the obtaining manner, the data query start identifier corresponding to the page number identifier.
The execution unit 604 is configured to execute a corresponding data query based on the data query start identifier and return the data obtained by the query.
In some embodiments, the execution unit 604 is further configured to: determining a sequence identification range based on the data query starting identification; and querying corresponding data according to the sequence identification range.
In some embodiments, the data querying device further comprises an asynchronous data loading unit, not shown in fig. 6, configured to: determining a next page number identifier corresponding to the page number identifier; based on the next page code identification, an asynchronous data loading process is performed.
In some embodiments, the receiving unit 601 is further configured to: determining a request data type and a request parameter corresponding to the request data; and calling an information abstract algorithm to calculate a corresponding request identifier based on the request data type and the request parameters.
In some embodiments, the acquisition unit 603 is further configured to: and responding to the judgment result data corresponding to the corresponding data existing in the preset container, and determining that the acquisition mode of the data query starting identifier is based on the mapping relation.
In some embodiments, the acquisition unit 603 is further configured to: and responding to the acquisition mode based on the mapping relation, calculating the mapping relation between the page number identification and the data query starting identification according to the request parameter, and further determining the data query starting identification corresponding to the page number identification according to the mapping relation.
In some embodiments, the acquisition unit 603 is further configured to: and responding to the judgment result data corresponding to the absence of corresponding data in the preset container, and determining that the acquisition mode of the data query starting identifier is based on target data range query.
In some embodiments, the acquisition unit 603 is further configured to: responding to the acquisition mode based on the target data range inquiry, and determining a corresponding target data range according to the request identifier and the page number identifier; and determining a corresponding data query starting identification based on the target data range.
It should be noted that, the data query method and the data query device in the present application have a corresponding relationship in implementation content, so repeated content will not be described.
Fig. 7 illustrates an exemplary system architecture 700 in which the data query method or data query apparatus of embodiments of the present application may be applied.
As shown in fig. 7, a system architecture 700 may include terminal devices 701, 702, 703, a network 704, and a server 705. The network 704 is the medium used to provide communication links between the terminal devices 701, 702, 703 and the server 705. The network 704 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
A user may interact with the server 705 via the network 704 using the terminal devices 701, 702, 703 to receive or send messages or the like. Various communication client applications such as shopping class applications, web browser applications, search class applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only) may be installed on the terminal devices 701, 702, 703.
The terminal devices 701, 702, 703 may be a variety of electronic devices having a data query processing screen and supporting web browsing, including but not limited to smartphones, tablets, laptop and desktop computers, and the like.
The server 705 may be a server providing various services, such as a background management server (by way of example only) providing support for data query requests submitted by users using the terminal devices 701, 702, 703. The background management server can receive the data query request, acquire the corresponding page number identification and request data, and further determine the corresponding request identification based on the request data; judging whether corresponding data exists in a preset container according to the page number identification and the request identification, and further obtaining judging result data; determining an acquisition mode of the data query starting identifier according to the judging result data, and further acquiring the data query starting identifier corresponding to the page number identifier based on the acquisition mode; based on the data query starting identification, executing the corresponding data query and returning the data obtained by the query. Therefore, the redundancy of the data query result is reduced, and the data query efficiency and the data query performance are improved.
It should be noted that, the data query method provided in the embodiments of the present application is generally executed by the server 705, and accordingly, the data query device is generally disposed in the server 705.
It should be understood that the number of terminal devices, networks and servers in fig. 7 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 8, there is illustrated a schematic diagram of a computer system 800 suitable for use in implementing the terminal device of an embodiment of the present application. The terminal device shown in fig. 8 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiment of the present application.
As shown in fig. 8, the computer system 800 includes a Central Processing Unit (CPU) 801 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 802 or a program loaded from a storage section 808 into a Random Access Memory (RAM) 803. In the RAM803, various programs and data required for the operation of the computer system 800 are also stored. The CPU801, ROM802, and RAM803 are connected to each other by a bus 804. An input/output (I/O) interface 805 is also connected to the bus 804.
The following components are connected to the I/O interface 805: an input portion 806 including a keyboard, mouse, etc.; an output section 807 including a display such as a Cathode Ray Tube (CRT), a liquid crystal credit authorization query processor (LCD), and a speaker; a storage section 808 including a hard disk or the like; and a communication section 809 including a network interface card such as a LAN card, a modem, or the like. The communication section 809 performs communication processing via a network such as the internet. The drive 810 is also connected to the I/O interface 805 as needed. A removable medium 811 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 810 as needed so that a computer program read out therefrom is mounted into the storage section 808 as needed.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments disclosed herein include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network via the communication section 809, and/or installed from the removable media 811. The above-described functions defined in the system of the present application are performed when the computer program is executed by a Central Processing Unit (CPU) 801.
It should be noted that the computer readable medium shown in the present application may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium may include, for example, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present application, however, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units involved in the embodiments of the present application may be implemented by software, or may be implemented by hardware. The described units may also be provided in a processor, for example, described as: a processor includes a receiving unit, a judging unit, an acquiring unit, and an executing unit. Wherein the names of the units do not constitute a limitation of the units themselves in some cases.
As another aspect, the present application also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be present alone without being fitted into the device. The computer readable medium carries one or more programs, which when executed by the device, cause the device to receive a data query request, obtain a corresponding page number identifier and request data, and further determine a corresponding request identifier based on the request data; judging whether corresponding data exists in a preset container according to the page number identification and the request identification, and further obtaining judging result data; determining an acquisition mode of the data query starting identifier according to the judging result data, and further acquiring the data query starting identifier corresponding to the page number identifier based on the acquisition mode; based on the data query starting identification, executing the corresponding data query and returning the data obtained by the query.
According to the technical scheme of the embodiment of the application, the redundancy of the data query result can be reduced, and the data query efficiency and the data query performance are improved.
The above embodiments do not limit the scope of the application. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives can occur depending upon design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present application are intended to be included within the scope of the present application.

Claims (12)

1. A method of querying data, comprising:
receiving a data query request, acquiring a corresponding page number identifier and request data, and further determining a corresponding request identifier based on the request data;
judging whether corresponding data exists in a preset container according to the page number identification and the request identification, and further obtaining judging result data;
determining an acquisition mode of a data query starting identifier according to the judging result data, and further acquiring the data query starting identifier corresponding to the page number identifier based on the acquisition mode;
and executing corresponding data inquiry and returning the data obtained by inquiry based on the data inquiry starting identification.
2. The method of claim 1, wherein the executing the corresponding data query based on the data query initiation identification comprises:
determining a sequence identification range based on the data query starting identification;
and inquiring corresponding data according to the sequence identification range.
3. The method of claim 1, wherein after the executing the corresponding data query, the method further comprises:
determining a next page number identifier corresponding to the page number identifier;
and executing an asynchronous data loading process based on the next page code identification.
4. The method of claim 1, wherein the determining a corresponding request identification based on the request data comprises:
determining a request data type and a request parameter corresponding to the request data;
and calling an information abstract algorithm to calculate a corresponding request identifier based on the request data type and the request parameter.
5. The method of claim 4, wherein determining the acquisition mode of the data query start identifier according to the determination result data comprises:
and responding to the judgment result data corresponding to the corresponding data in the preset container, and determining that the acquisition mode of the data query starting identification is acquired based on the mapping relation.
6. The method of claim 5, wherein the obtaining, based on the obtaining manner, a data query start identifier corresponding to the page number identifier includes:
and responding to the acquisition mode based on the mapping relation, calculating the mapping relation between the page number identification and the data query starting identification according to the request parameter, and further determining the data query starting identification corresponding to the page number identification according to the mapping relation.
7. The method of claim 4, wherein determining the acquisition mode of the data query start identifier according to the determination result data comprises:
and responding to the judging result data corresponding to the fact that no corresponding data exists in the preset container, and determining that the acquisition mode of the data query starting identifier is based on target data range query.
8. The method of claim 7, wherein the obtaining, based on the obtaining manner, a data query start identifier corresponding to the page number identifier includes:
responding to the acquisition mode based on target data range inquiry, and determining a corresponding target data range according to the request identifier and the page number identifier;
and determining a corresponding data query starting identification based on the target data range.
9. A data query device, comprising:
the receiving unit is configured to receive a data query request, acquire a corresponding page number identifier and request data, and further determine a corresponding request identifier based on the request data;
the judging unit is configured to judge whether corresponding data exists in a preset container according to the page number identification and the request identification, and further obtain judging result data;
the acquisition unit is configured to determine an acquisition mode of a data query starting identifier according to the judging result data, and further acquire the data query starting identifier corresponding to the page number identifier based on the acquisition mode;
and the execution unit is configured to execute the corresponding data query and return the data obtained by the query based on the data query starting identification.
10. The apparatus of claim 9, wherein the execution unit is further configured to:
determining a sequence identification range based on the data query starting identification;
and inquiring corresponding data according to the sequence identification range.
11. A data querying electronic device, comprising:
one or more processors;
storage means for storing one or more programs,
when executed by the one or more processors, causes the one or more processors to implement the method of any of claims 1-8.
12. A computer readable medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the method according to any of claims 1-8.
CN202310377375.9A 2023-04-10 2023-04-10 Data query method, device, electronic equipment and computer readable medium Pending CN116450674A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310377375.9A CN116450674A (en) 2023-04-10 2023-04-10 Data query method, device, electronic equipment and computer readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310377375.9A CN116450674A (en) 2023-04-10 2023-04-10 Data query method, device, electronic equipment and computer readable medium

Publications (1)

Publication Number Publication Date
CN116450674A true CN116450674A (en) 2023-07-18

Family

ID=87135102

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310377375.9A Pending CN116450674A (en) 2023-04-10 2023-04-10 Data query method, device, electronic equipment and computer readable medium

Country Status (1)

Country Link
CN (1) CN116450674A (en)

Similar Documents

Publication Publication Date Title
CN108984553B (en) Caching method and device
CN112527649A (en) Test case generation method and device
CN110909022A (en) Data query method and device
CN110795315A (en) Method and device for monitoring service
CN113900907B (en) Mapping construction method and system
CN112445988A (en) Data loading method and device
CN113282589A (en) Data acquisition method and device
CN111949648B (en) Memory data caching system and data indexing method
CN116775167A (en) Service processing method, device, electronic equipment and computer readable medium
CN113761565A (en) Data desensitization method and apparatus
CN113641706A (en) Data query method and device
CN116450674A (en) Data query method, device, electronic equipment and computer readable medium
CN116861397A (en) Request processing method, device, electronic equipment and computer readable medium
CN109213815B (en) Method, device, server terminal and readable medium for controlling execution times
CN113722193A (en) Method and device for detecting page abnormity
CN113704222A (en) Method and device for processing service request
CN113282455A (en) Monitoring processing method and device
CN112784139A (en) Query method, query device, electronic equipment and computer readable medium
CN111737218A (en) File sharing method and device
CN113220981A (en) Method and device for optimizing cache
CN112783914A (en) Statement optimization method and device
CN113360528A (en) Data query method and device based on multi-level cache
CN113778909B (en) Method and device for caching data
CN110888939A (en) Data management method and device
CN112966008B (en) Data caching method, loading method, updating method and related devices

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination