CN114238391A - Data paging query method and device, electronic equipment and storage medium - Google Patents

Data paging query method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114238391A
CN114238391A CN202111552181.5A CN202111552181A CN114238391A CN 114238391 A CN114238391 A CN 114238391A CN 202111552181 A CN202111552181 A CN 202111552181A CN 114238391 A CN114238391 A CN 114238391A
Authority
CN
China
Prior art keywords
query
paging
data
request
target
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
CN202111552181.5A
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.)
Guahao Net Hangzhou Technology Co Ltd
Original Assignee
Guahao Net Hangzhou 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 Guahao Net Hangzhou Technology Co Ltd filed Critical Guahao Net Hangzhou Technology Co Ltd
Priority to CN202111552181.5A priority Critical patent/CN114238391A/en
Publication of CN114238391A publication Critical patent/CN114238391A/en
Pending legal-status Critical Current

Links

Images

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/2455Query execution
    • 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

Abstract

The embodiment of the invention discloses a data paging query method, a data paging query device, electronic equipment and a storage medium. The method comprises the following steps: when a data query request is received, determining request parameters in the data query request; if the request parameters contain the paging request parameters, creating a data query object based on the paging request parameters, and generating a database query instruction to be used corresponding to the paging request parameters; when determining that the data query object comprises the paging request parameter based on the interceptor, determining a target paging query instruction corresponding to the to-be-used database query instruction; and based on the target paging query instruction, target data matched with the paging request parameters are displayed from the target database. The problems that in the prior art, the development workload is large and the system memory consumption is wasted due to the fact that codes related to paging are embedded in the position of each paging query are solved, and the effects of reducing the development workload and reducing the system memory consumption are achieved while the data paging query efficiency is improved.

Description

Data paging query method and device, electronic equipment and storage medium
Technical Field
The embodiment of the invention relates to a computer processing technology, in particular to a data paging query method, a data paging query device, electronic equipment and a storage medium.
Background
With the development of time and business, more and more data tables and more data in the data tables are available in a database system, when data is queried in the database system, if all data is queried at one time, the system performance is reduced, and the system is likely to crash, so that the function of paging query is realized, only a small part of data is queried at one time, so that the system efficiency is improved, and the data utilization rate is also improved. Therefore, how to efficiently perform paging query on massive data becomes an increasingly concerned issue.
The existing paging query method usually embeds paging-related codes into each place needing paging query in the development process, and the method has the problems of strong code dependency, large development workload and waste of system memory consumption.
Disclosure of Invention
Embodiments of the present invention provide a data paging query method, an apparatus, an electronic device, and a storage medium, so as to achieve the technical effects of reducing development workload and reducing system memory consumption while improving data paging query efficiency.
In a first aspect, an embodiment of the present invention provides a data paging query method, where the method includes:
when a data query request is received, determining request parameters in the data query request;
if the request parameters contain paging request parameters, creating a data query object based on the paging request parameters, and generating a database query instruction to be used corresponding to the paging request parameters;
when determining that the data query object comprises a paging request parameter based on an interceptor, determining a target paging query instruction corresponding to the to-be-used database query instruction;
and based on the target paging query instruction, target data matched with the paging request parameters are displayed from a target database.
In a second aspect, an embodiment of the present invention further provides a data paging query apparatus, where the apparatus includes:
the request parameter determining module is used for determining request parameters in the data query request when the data query request is received;
the to-be-used database query instruction generation module is used for creating a data query object based on the paging request parameter and generating a to-be-used database query instruction corresponding to the paging request parameter if the request parameter comprises the paging request parameter;
the target paging query instruction determining module is used for determining a target paging query instruction corresponding to the to-be-used database query instruction when determining that the data query object comprises paging request parameters based on an interceptor;
and the target data searching module is used for displaying target data matched with the paging request parameters from a target database based on the target paging query instruction.
In a third aspect, an embodiment of the present invention further provides an electronic device, where the electronic device includes:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement a data paging query method as in any one of the embodiments of the present invention.
In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the data paging query method according to any of the embodiments of the present invention.
The technical scheme of the embodiment of the invention determines the request parameter in the data query request when receiving the data query request, if the request parameter contains the paging request parameter, creates the data query object based on the paging request parameter, constructs the query instruction of the database to be used based on the database, determines the target paging query instruction corresponding to the query instruction of the database to be used when determining that the data query object comprises the paging request parameter based on the interceptor, and displays the target data matched with the paging request parameter from the target database based on the target paging query instruction, thereby solving the problems of large development workload and waste of system memory consumption caused by embedding paging related codes in each paging query place in the prior art, and realizing the purpose of judging whether the request parameter in the data query request contains the paging request parameter, if so, creating a data query object and paging request parameters based on the Java tool class, and further judging whether the data query object exists by using an interceptor after a database to be used is built and a database query instruction is to be used so as to determine whether the database query instruction needs paging query. Meanwhile, based on the paging request parameters in the data query object, the paging function is added to the query instruction to generate a paging query instruction, so that data paging query is performed, decoupling operation of condition query and paging query is realized, dependency on codes is reduced, and paging related codes do not need to be additionally embedded into a paging query place during development, so that the technical effects of reducing development workload and reducing system memory consumption are achieved.
Drawings
In order to more clearly illustrate the technical solutions of the exemplary embodiments of the present invention, a brief description is given below of the drawings used in describing the embodiments. It should be clear that the described figures are only views of some of the embodiments of the invention to be described, not all, and that for a person skilled in the art, other figures can be derived from these figures without inventive effort.
Fig. 1 is a flowchart of a data paging query method according to an embodiment of the present invention;
fig. 2 is a flowchart of a data paging query method according to a second embodiment of the present invention;
fig. 3 is a block diagram of a data paging query apparatus according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Fig. 1 is a flowchart of a data paging query method according to an embodiment of the present invention, where this embodiment is applicable to a data paging query situation, and the method may be executed by a data paging query apparatus according to an embodiment of the present invention, where the apparatus may be implemented in a software and/or hardware manner, and optionally, the method is implemented by an electronic device, and the electronic device may be a mobile terminal, a PC end, a server end, or the like. The device can be configured in a computing device, and the data paging query method provided by the embodiment specifically includes the following steps:
s110, when a data query request is received, determining request parameters in the data query request.
It should be noted that the technical solution can be applied to the situation of paging query of data in the internet field, and can also be applied to any situation that data needs to be paged and queried. It should be further noted that, a corresponding paging query system may be developed based on the present technical solution, and then a corresponding task is processed based on the system, so as to perform paging query. For example, in an actual data query scenario, often due to a browsing behavior of a user at a front end, the internet may automatically perform paging display for data with an excessive data volume, at this time, the system needs to detect whether a data query request transmitted from the front end needs to open paging query, and then determine whether a paging parameter object needs to be established for a query object based on whether a paging query condition exists, so that a subsequent database query instruction may implement a paging function based on the paging parameter object to perform paging query.
Specifically, in practical application, when a user behavior triggers a certain query button in the platform, it may be considered that a data query request is triggered, and then the server may receive the data query request corresponding to the triggering operation by using the data interface, where the data query request carries request parameter information, where the request parameter information may include, but is not limited to, information such as a database name, a table name, a query number, a query start page number, and a total number of pages. Furthermore, the data parameters in the data query request can be subjected to traversal detection by using an algorithm to obtain the request parameters.
It should be noted that the request parameter information carried in the data query request may be data information input by the target user through an input device, and the input device may include a physical keyboard, a virtual keyboard, a sound collection device, a handwriting device, a touch screen, and the like. The front-end page system may also be a query request parameter allocated to the data, for example, the front-end page presets how many pieces of data need to be displayed in each page, for example, 50 pieces, and at this time, 50 pieces may be used as a request parameter.
It should be further noted that, when a data query request is received, request parameters in the data query request are determined, and the data query request may also be analyzed by using an algorithm to determine request parameter information carried in the data query request.
Optionally, when a data query request is received, determining a request parameter in the data query request includes: receiving a data query request sent by a client; wherein the data query request is generated based on a trigger operation at a front-end page; and analyzing the data query request, and determining request parameters in the data query request.
In this embodiment, a client user may trigger a certain button in the front-end platform by using an input device, and further send a data query request to the server, where the data query request is a get request generated based on a trigger operation of the user on a front-end page. The client can include, but is not limited to, a mobile communication terminal device, such as a mobile phone, a notebook, a desktop computer, an iPad, and the like. When the server receives a data query request sent by the client through the interface, the data query request can be analyzed through an algorithm, and then request parameters carried in the data query request can be obtained, so that whether the data query request is a paging query request can be determined subsequently based on the request parameters.
And S120, if the request parameters comprise paging request parameters, creating a data query object based on the paging request parameters, and generating a database query instruction to be used corresponding to the paging request parameters.
The paging request parameter refers to how paging should be performed on the paging query result, for example, the paging request parameter may include several pieces of query data (query number), a query start page number, and the like for each page. The data query object may be understood as data that the user wants to query. For example, the data query object may be "an expert for treating heart disease", or "a hospital for treating heart disease", or the like. The database Query instruction to be used may be an SQL (Structured Query Language) instruction for instructing to Query data in the database. SQL is a special purpose programming language, a programming language for database queries, for accessing data and querying, updating, and managing relational database systems.
It should be noted that, in practical applications, if the purpose of the data query request includes a paging query, the corresponding request parameter includes corresponding paging request parameter information.
Specifically, the request parameters may be traversed by using an algorithm to determine whether the request parameters include a paging request parameter, and if so, it indicates that the data query request is for paging query, and then a data query object may be created by using the algorithm, for example, the query object may be a Java object Page. When the data query request is received, the database end may use an algorithm to construct a database query instruction corresponding to the data query request, that is, a to-be-used database query instruction corresponding to the paging request parameter is generated, for example, the query instruction may be Select from table.
It should be noted that, if the request parameter includes a paging request parameter, a corresponding paging data query object may be created based on the paging request parameter, so that the data query object carries paging request parameter information, and then a paging function may be added to the database query instruction based on the paging parameter in the data query object, so as to implement data paging query.
Optionally, if the request parameter includes a paging request parameter, creating a data query object based on the paging request parameter, including: if the data query request is determined to be a paging query request based on the request parameters, determining the paging request parameters; and creating a data query object corresponding to the paging request parameter based on the number of query pages and the query quantity in the paging request parameter.
Specifically, traversal detection processing may be performed on the request parameter by using an algorithm, whether the request parameter includes a paging request parameter is determined, if so, the data query request may be a paging query request, and then the paging request parameter may be screened by using the algorithm, and accordingly, parameters such as the number of query pages and the number of queries in the paging request parameter may be extracted, and then a data query object, for example, a Page object, may be created by using the algorithm, and core parameters such as the number of query pages and the number of queries, for example, offset (query start Page number), limit (query number), and the like may be set for the Page object. Correspondingly, a data query object carrying the paging request parameter is obtained.
It should be noted that, in practical applications, multiple users may query the same paging data at the same time, and in order to improve the security, reliability, and efficiency of data processing, a data query object corresponding to a data query request generated by each user trigger operation may be stored in a corresponding thread, so that subsequent threads may share all data resources in the same process and execute different tasks in parallel.
Optionally, the data query object is stored in a thread corresponding to the data query request, so that when data is queried from a database, a target paging query instruction is generated based on the data query object stored in the thread.
Wherein, a thread refers to a basic unit which is independently scheduled and dispatched in an operating system. It should be noted that, in this embodiment, each data query request may correspond to one thread. The target paging query instruction is used for indicating an SQL instruction for paging query data in the database.
Specifically, the data query object may be stored in a thread corresponding to the data query request by using an algorithm, and for example, for each thread information, a set method of a Java tool class thread may be used to store the data query object Page in the current thread information, that is, thread. So that when data query is subsequently performed from the database, SQL instructions for paging query, i.e. target paging query instructions, can be generated based on the data query objects stored in the threads.
S130, when the data query object comprises the paging request parameter based on the interceptor, determining a target paging query instruction corresponding to the to-be-used database query instruction.
Wherein, the Interceptor may be a MyBatis Interceptor (Executor Interceptor). MyBatis is a persistent layer framework in Java application, and a MyBatis Interceptor (Executor Interreceptor) is a custom extension mode facing to a section and provided by the MyBatis framework and used for enhancing database management and control operation. Such as in a database query application. The interception action can be executed based on the interceptor, and the interception action can be query instruction permission check, query statement check and the like.
Specifically, when the query instruction of the database to be used passes through the interceptor, the interceptor can be used for intercepting the data query object, and then the parameter information in the data query object can be detected and processed by using the algorithm, and whether the data query object contains the paging request parameter is judged, if yes, the algorithm can be used for additionally executing the paging query function for the query instruction of the database to be used, so as to generate the paging query instruction, namely the target paging query instruction, and complete paging query based on the target paging query instruction.
It should be noted that, when it is determined that the data query object includes the paging request parameter based on the interceptor, the target paging query instruction corresponding to the to-be-used database query instruction is determined, and a function method in the interceptor may also be utilized to perform parsing processing on the parameter in the data query object, which is used to determine whether the parameter in the data query object includes the paging request parameter, so as to additionally execute the paging query function for the to-be-used database query instruction based on the paging request parameter.
Optionally, when it is determined that the data query object includes a paging request parameter based on an interceptor, determining a target paging query instruction corresponding to the to-be-used database query instruction includes: determining whether a data query object in a thread corresponding to the data query request comprises a paging request parameter or not based on a target acquisition function in an interceptor; and if so, generating the target paging query instruction based on a preset splicing statement and the query instruction of the database to be used.
The preset concatenation statement may be a preset paging query function statement.
In this embodiment, in order to implement the paging query function for the database query instruction, after the database receives the to-be-used database query instruction, an interceptor may be used to intercept the execution of the to-be-used database query instruction, furthermore, the interceptor can be used to call a target acquiring function method to acquire the data query object in the thread corresponding to the data query request, meanwhile, an algorithm can be used to detect whether the data query object includes the paging request parameter, if so, the paging request parameter and the to-be-used database query instruction may be bound based on a preset stitching statement algorithm, the paging request parameter is bound to the database query instruction to be used, and accordingly the database query instruction has a paging function, so that a query instruction with an additional paging function, namely a target paging query instruction, is obtained. Illustratively, the interceptor obtains a data query object Page in a thread corresponding to the data query request by calling a tool class thread () method, and determines whether the query object Page exists, if not, the interceptor indicates that the data query request does not need to be subjected to paging query, and can directly execute an instruction to query the database. If so, it indicates that the data query request needs to be subjected to paging query, and then the interceptor can be used to obtain information such as paging request parameters offset (query start Page number) and limit (query number) stored in the Page, and further perform paging function enrichment processing on the to-be-used database query instruction based on the paging request parameters, that is, add a paging query function statement, for example, Select from table limit offset, limit. The query statement may be used as a target paging query instruction, so that data paging query is performed based on the target paging query instruction with paging query function.
And S140, inquiring and displaying target data matched with the paging request parameters from a target database based on the target paging inquiry command.
Specifically, after the database receives the target paging query instruction, the database may query data corresponding to the paging request parameter carried in the target paging query instruction, that is, a query result, where the query result is the target data matched with the paging request parameter, and then the database may return the target data to the client by using the interface, and then may display the queried target data at the client.
It should be noted that the paging request parameter carried in the target paging query instruction may include at least two paging parameter information, and accordingly, the query data may be sequentially obtained based on each paging parameter information. For example, in practical applications, a user wants to query 1000 pieces of data, the internet can automatically page the data, for example, the data is divided into five pages, and each page can display 200 pieces of data, so that a data query request carries a paging parameter, where the number of query pages 5 and the number of query pages 200 are both paging parameters, so that data corresponding to the number of query pages and the number of query pages can be accurately and orderly queried from a database based on a target paging query instruction bound with each paging parameter in the follow-up process.
Optionally, the displaying, based on the target paging query instruction, target data matched with the paging request parameter from a target database includes: searching target data from a database based on the number of the query pages and the query quantity in the target paging query instruction; and sequentially displaying the target data on a target display interface according to the display sequence in the query quantity.
The target display interface may be a display interface of the terminal device corresponding to the query request when the query request is uploaded.
Specifically, the target paging query instruction can be transmitted to the database by using the interface, after the database receives the paging query instruction, the target data can be searched from the database based on the number of query pages and the query number in the target paging query instruction, and then the target data can be sequentially displayed on the target display interface according to the display sequence in the query number.
The technical solution of this embodiment is to determine a request parameter in a data query request when the data query request is received, create a data query object based on the paging request parameter if the request parameter includes the paging request parameter, and generate a database query instruction to be used corresponding to the paging request parameter, determine a target paging query instruction corresponding to the database query instruction to be used when the data query object includes the paging request parameter based on an interceptor, and display target data matched with the paging request parameter from the target database based on the target paging query instruction, thereby solving the problems of large development workload and wasted system memory consumption caused by embedding paging-related codes in each paging query location in the prior art, and realizing that by determining whether the request parameter in the data query request includes the paging request parameter, if so, a data query object and a paging request parameter are created based on Java tool class Threadlocal, and then after a database query instruction to be used is constructed in the database, whether the data query object exists is judged by using an interceptor, so that whether the database query instruction needs paging query is determined. Meanwhile, based on the paging request parameters in the data query object, the paging query instruction is generated in a mode of adding a paging function of the query instruction, so that decoupling operation of condition query and paging query is realized, dependency on codes is reduced, and paging-related codes do not need to be additionally embedded into a paging query place during development, so that the technical effects of reducing development workload and reducing system memory consumption are achieved.
Example two
As an alternative embodiment of the foregoing embodiment, fig. 2 is a schematic diagram of a data paging query method according to a second embodiment of the present invention. Specifically, the following details can be referred to.
For example, as shown in fig. 2, when a data query request is received, a query is started, and if a request parameter in the data query request is a paging request parameter, it indicates that a user needs to open a paging query, a Java object Page, that is, a data query object, such as thread < Page >, may be created, and then a paging request parameter of the Page may be set, where the paging request parameter may be offset (query start Page number), limit (query number), and the like. The Page object Page can be saved to the current thread information, i.e. thread Page set (Page parameter), using the set method of the Java tool class thread. It should be noted that an intercept point interface (Interceptor), that is, an Interceptor, of an SQL Executor (Executor) may be reserved in MyBatis. When a data query request is received at the back end, a database query instruction to be used can be constructed, the database query is started through an SQL Executor (Executor), and then the database query instruction to be used can pass through a MyBatis Interceptor (Executor Interreceptor), and the Interceptor performs enrichment inspection on the query instruction. For example, the interceptor may call a tool class thread.get () method, obtain a data query object, i.e., an object Page, bound by the current thread, and determine whether the data query object Page exists. If the data query object Page does not exist, the Page query is not needed, and the instruction is directly executed to query the database. If the data query object Page exists, it indicates that paging query is required, and an interceptor may be used to obtain information such as a paging request parameter offset (query start Page number) limit (query number) in the object Page. Further, the interceptor may perform the paging function enrichment on the to-be-used database query instruction according to the paging request parameter, that is, add a paging query function statement, such as Select from table limit offset, limit. And obtaining the enriched instruction, namely the target paging query instruction, and further querying a database based on the target paging query instruction to obtain the target data.
The technical solution of this embodiment is to determine a request parameter in a data query request when the data query request is received, create a data query object based on the paging request parameter if the request parameter includes the paging request parameter, and generate a database query instruction to be used corresponding to the paging request parameter, determine a target paging query instruction corresponding to the database query instruction to be used when the data query object includes the paging request parameter based on an interceptor, and display target data matched with the paging request parameter from the target database based on the target paging query instruction, thereby solving the problems of large development workload and wasted system memory consumption caused by embedding paging-related codes in each paging query location in the prior art, and realizing that by determining whether the request parameter in the data query request includes the paging request parameter, if so, a data query object and a paging request parameter are created based on Java tool class Threadlocal, and then after a database query instruction to be used is constructed in the database, whether the data query object exists is judged by using an interceptor, so that whether the database query instruction needs paging query is determined. Meanwhile, based on the paging request parameters in the data query object, the paging query instruction is generated in a mode of adding a paging function of the query instruction, so that decoupling operation of condition query and paging query is realized, dependency on codes is reduced, and paging-related codes do not need to be additionally embedded into a paging query place during development, so that the technical effects of reducing development workload and reducing system memory consumption are achieved.
EXAMPLE III
Fig. 3 is a block diagram of a data paging query apparatus according to a third embodiment of the present invention. The device includes: a request parameter determining module 310, a to-be-used database query generation module 320, a target paging query determining module 330, and a target data lookup module 340.
The request parameter determining module 310 is configured to determine a request parameter in a data query request when the data query request is received; a to-be-used database query instruction generating module 320, configured to create a data query object based on the paging request parameter if the request parameter includes the paging request parameter, and generate a to-be-used database query instruction corresponding to the paging request parameter; a target paging query instruction determining module 330, configured to determine a target paging query instruction corresponding to the to-be-used database query instruction when it is determined, based on the interceptor, that the data query object includes a paging request parameter; and the target data searching module 340 is configured to display target data matched with the paging request parameter from a target database based on the target paging query instruction.
The technical solution of this embodiment is to determine a request parameter in a data query request when the data query request is received, create a data query object based on the paging request parameter if the request parameter includes the paging request parameter, and generate a database query instruction to be used corresponding to the paging request parameter, determine a target paging query instruction corresponding to the database query instruction to be used when the data query object includes the paging request parameter based on an interceptor, and display target data matched with the paging request parameter from the target database based on the target paging query instruction, thereby solving the problems of large development workload and wasted system memory consumption caused by embedding paging-related codes in each paging query location in the prior art, and realizing that by determining whether the request parameter in the data query request includes the paging request parameter, if so, establishing a data query object and paging request parameters, and further utilizing an interceptor to judge whether the data query object exists after a database constructs a to-be-used database query instruction so as to determine whether the database query instruction needs paging query. Meanwhile, based on the paging request parameters in the data query object, the paging query instruction is generated in a mode of adding a paging function of the query instruction, so that decoupling operation of condition query and paging query is realized, dependency on codes is reduced, and paging-related codes do not need to be additionally embedded into a paging query place during development, so that the technical effects of reducing development workload and reducing system memory consumption are achieved.
On the basis of the above device, optionally, the request parameter determining module 310 includes a data query requesting unit and a request parameter determining unit.
The data query request unit is used for receiving a data query request sent by a client; wherein the data query request is generated based on a trigger operation at a front-end page;
and the request parameter determining unit is used for analyzing the data query request and determining the request parameters in the data query request.
On the basis of the above device, optionally, the to-be-used database query instruction generating module 320 includes a paging request parameter determining unit and a data query object creating unit.
A paging request parameter determining unit, configured to determine a paging request parameter if the data query request is determined to be a paging query request based on the request parameter;
and the data query object creating unit is used for creating the data query object corresponding to the paging request parameter based on the number of query pages and the query quantity in the paging request parameter.
On the basis of the above device, optionally, the to-be-used database query instruction generating module 320 further includes a data query object storage unit.
The data query object storage unit is specifically configured to store the data query object into a thread corresponding to the data query request, so as to generate a target paging query instruction based on the data query object stored in the thread when querying data from a database.
On the basis of the foregoing apparatus, optionally, the target paging query instruction determining module 330 includes a data query object determining unit and a target paging query instruction generating unit.
A data query object determining unit, configured to determine whether a thread corresponding to the data query request includes a data query object based on a target obtaining function in an interceptor;
and the target paging query instruction generating unit is used for generating the target paging query instruction based on a preset splicing statement and the to-be-used database query instruction if the target paging query instruction is generated.
On the basis of the above device, optionally, the target data searching module 340 includes a target data searching unit and a target data displaying unit.
The target data searching unit is used for searching target data from a database based on the number of the query pages and the query quantity in the target paging query instruction;
and the target data display unit is used for sequentially displaying the target data on a target display interface according to the display sequence in the query quantity.
The data paging query device provided by the embodiment of the invention can execute the data paging query method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
It should be noted that, the units and modules included in the apparatus are merely divided according to functional logic, but are not limited to the above division as long as the corresponding functions can be implemented; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the embodiment of the invention.
Example four
Fig. 4 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention. FIG. 4 illustrates a block diagram of an exemplary electronic device 40 suitable for use in implementing embodiments of the present invention. The electronic device 40 shown in fig. 4 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiment of the present invention.
As shown in fig. 4, electronic device 40 is embodied in the form of a general purpose computing device. The components of electronic device 40 may include, but are not limited to: one or more processors or processing units 401, a system memory 402, and a bus 403 that couples the various system components (including the system memory 402 and the processing unit 401).
Bus 403 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Electronic device 40 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by electronic device 40 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 402 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)404 and/or cache memory 405. The electronic device 40 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 406 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 4, and commonly referred to as a "hard drive"). Although not shown in FIG. 4, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 403 by one or more data media interfaces. Memory 402 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 408 having a set (at least one) of program modules 407 may be stored, for example, in memory 402, such program modules 407 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. Program modules 407 generally perform the functions and/or methods of the described embodiments of the invention.
The electronic device 40 may also communicate with one or more external devices 409 (e.g., keyboard, pointing device, display 410, etc.), with one or more devices that enable a user to interact with the electronic device 40, and/or with any devices (e.g., network card, modem, etc.) that enable the electronic device 40 to communicate with one or more other computing devices. Such communication may be through input/output (I/O) interface 411. Also, the electronic device 40 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the internet) via the network adapter 412. As shown, the network adapter 412 communicates with the other modules of the electronic device 40 over the bus 403. It should be appreciated that although not shown in FIG. 4, other hardware and/or software modules may be used in conjunction with electronic device 40, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processing unit 401 executes various functional applications and data processing by executing programs stored in the system memory 402, for example, implementing the data paging query method provided by the embodiment of the present invention.
EXAMPLE five
The fifth embodiment of the present invention further provides a storage medium containing computer-executable instructions, which are used for executing a data paging query method when being executed by a computer processor. The method comprises the following steps:
when a data query request is received, determining request parameters in the data query request;
if the request parameters contain paging request parameters, creating a data query object based on the paging request parameters, and generating a database query instruction to be used corresponding to the paging request parameters;
when determining that the data query object comprises a paging request parameter based on an interceptor, determining a target paging query instruction corresponding to the to-be-used database query instruction;
and based on the target paging query instruction, target data matched with the paging request parameters are displayed from a target database.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: 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.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. 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, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for embodiments of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. A data paging query method is characterized by comprising the following steps:
when a data query request is received, determining request parameters in the data query request;
if the request parameters contain paging request parameters, creating a data query object based on the paging request parameters, and generating a database query instruction to be used corresponding to the paging request parameters;
when determining that the data query object comprises a paging request parameter based on an interceptor, determining a target paging query instruction corresponding to the to-be-used database query instruction;
and inquiring target data matched with the paging request parameters from a target database based on the target paging inquiry instruction and displaying the target data.
2. The method of claim 1, wherein determining the request parameter in the data query request when the data query request is received comprises:
receiving a data query request sent by a client; wherein the data query request is generated based on a trigger operation at a front-end page;
and analyzing the data query request, and determining request parameters in the data query request.
3. The method of claim 1, wherein if the request parameter includes a paging request parameter, creating a data query object based on the paging request parameter comprises:
if the data query request is determined to be a paging query request based on the request parameters, determining the paging request parameters;
and creating a data query object corresponding to the paging request parameter based on the number of query pages and the query quantity in the paging request parameter.
4. The method of claim 3, further comprising:
and storing the data query object into a thread corresponding to the data query request, so that when data is queried from a database, a target paging query instruction is generated based on the data query object stored in the thread.
5. The method of claim 1, wherein determining a target paging query corresponding to the to-be-used database query when determining that a paging request parameter is included in the data query object based on an interceptor comprises:
determining whether a thread corresponding to the data query request comprises a data query object or not based on a target acquisition function in the interceptor;
and if so, generating the target paging query instruction based on a preset splicing statement and the query instruction of the database to be used.
6. The method of claim 1, wherein the presenting target data matching the paging request parameter from a target database based on the target paging query comprises:
searching target data from a database based on the number of the query pages and the query quantity in the target paging query instruction;
and sequentially displaying the target data on a target display interface according to the display sequence in the query quantity.
7. A data paging query apparatus, comprising:
the request parameter determining module is used for determining request parameters in the data query request when the data query request is received;
the to-be-used database query instruction generation module is used for creating a data query object based on the paging request parameter and generating a to-be-used database query instruction corresponding to the paging request parameter if the request parameter comprises the paging request parameter;
the target paging query instruction determining module is used for determining a target paging query instruction corresponding to the to-be-used database query instruction when determining that the data query object comprises paging request parameters based on an interceptor;
and the target data searching module is used for displaying target data matched with the paging request parameters from a target database based on the target paging query instruction.
8. The apparatus of claim 7, wherein the request parameter determination module comprises:
the data query request unit is used for receiving a data query request sent by a client; wherein the data query request is generated based on a trigger operation at a front-end page;
and the request parameter determining unit is used for analyzing the data query request and determining the request parameters in the data query request.
9. An electronic device, characterized in that the device comprises:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the data paging query method of any one of claims 1-6.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out a method for paging data according to any one of claims 1 to 6.
CN202111552181.5A 2021-12-17 2021-12-17 Data paging query method and device, electronic equipment and storage medium Pending CN114238391A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111552181.5A CN114238391A (en) 2021-12-17 2021-12-17 Data paging query method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111552181.5A CN114238391A (en) 2021-12-17 2021-12-17 Data paging query method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114238391A true CN114238391A (en) 2022-03-25

Family

ID=80758006

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111552181.5A Pending CN114238391A (en) 2021-12-17 2021-12-17 Data paging query method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114238391A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116644090A (en) * 2023-07-27 2023-08-25 天津神舟通用数据技术有限公司 Data query method, device, equipment and medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116644090A (en) * 2023-07-27 2023-08-25 天津神舟通用数据技术有限公司 Data query method, device, equipment and medium
CN116644090B (en) * 2023-07-27 2023-11-10 天津神舟通用数据技术有限公司 Data query method, device, equipment and medium

Similar Documents

Publication Publication Date Title
WO2019140828A1 (en) Electronic apparatus, method for querying logs in distributed system, and storage medium
CN105550206B (en) The edition control method and device of structured query sentence
CN110975293A (en) Method, device, server and medium for establishing resource reference relation table
CN110704476A (en) Data processing method, device, equipment and storage medium
CN113051514B (en) Element positioning method and device, electronic equipment and storage medium
CN112559095A (en) Target service execution method, system, server and storage medium
CN114416667A (en) Method and device for rapidly sharing network disk file, network disk and storage medium
CN111694866A (en) Data searching and storing method, data searching system, data searching device, data searching equipment and data searching medium
CN113204345A (en) Page generation method and device, electronic equipment and storage medium
CN115150261B (en) Alarm analysis method, device, electronic equipment and storage medium
CN114168616A (en) Data acquisition method and device, electronic equipment and storage medium
CN109033456B (en) Condition query method and device, electronic equipment and storage medium
CN114238391A (en) Data paging query method and device, electronic equipment and storage medium
CN113962597A (en) Data analysis method and device, electronic equipment and storage medium
CN112948396A (en) Data storage method and device, electronic equipment and storage medium
WO2019071907A1 (en) Method for identifying help information based on operation page, and application server
CN112039975A (en) Method, device, equipment and storage medium for processing message field
US9201937B2 (en) Rapid provisioning of information for business analytics
CN115576978A (en) Method, device, system and medium for responding service processing request
CN115794583A (en) Kernel analysis method and device
CN114817990A (en) Sensitive data management method and device, electronic equipment and storage medium
CN114205156A (en) Message detection method and device for tangent plane technology, electronic equipment and medium
CN113625998A (en) Request processing method and device
CN112364268A (en) Resource acquisition method and device, electronic equipment and storage medium
CN112307021A (en) Data processing method, device, equipment and storage medium

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