Storage data retrieval method and device, computer readable medium and electronic equipment

By receiving query requests in multi-table queries, retrieving partial records from multiple storage tables in sequence, and displaying them in pages, the problem of low performance and accuracy of multi-table queries is solved, achieving efficient and reliable data retrieval.

CN118897849APending Publication Date: 2024-11-05TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310505026.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-05-05
Publication Date
2024-11-05

AI Technical Summary

Technical Problem

In multi-table queries, existing technologies suffer from low performance and accuracy, especially when fetching massive amounts of data at once, which may lead to a decline in database storage and query performance, or even database crashes.

Method used

After receiving a query request and determining the data query range information corresponding to multiple storage tables, partial records are queried from the multiple storage tables in sequence, and the current page is returned. The page displays partial records and entry points for triggering other query requests, so as to achieve segmented query and orderly display.

Benefits of technology

It improves the performance and accuracy of multi-table queries, reduces the possibility of database downtime, ensures the reliability of storage and querying, and reduces the amount of data at one time through pagination queries, ensuring the orderliness and reliability of queries.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118897849A_ABST
    Figure CN118897849A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a storage data retrieval method and device, a computer readable medium and electronic equipment. The method comprises the steps that a query request requesting to query data in data query range information is received; if it is determined that the data query range information corresponds to a plurality of storage tables, querying a part of records located in the data query range information from the plurality of storage tables according to the query request; and returning to the current paging page to display the partial record through the current paging page and to trigger at least one other query request to turn to an entry of the corresponding other paging page, the other query request being used for requesting to query data in the data query range information, and the other query request being used for requesting to query data in the data query range information. The other paging pages are used for displaying other partial records which are queried according to the other query requests and are located in the data query range information. According to the embodiment of the invention, the performance and accuracy of multi-table query can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of data retrieval, and in particular to a method and device for storing data retrieval, a computer-readable medium, and an electronic device. Background Art

[0002] With the development of information technology, a common way to store and manage data is to use storage tables. When data in a storage table needs to be obtained, the storage table can be queried.

[0003] However, when data queries need to be performed on multiple storage tables simultaneously, the performance and accuracy of multi-table queries are relatively low. Summary of the invention

[0004] The embodiments of the present application provide a method, device, computer-readable medium and electronic device for storing and retrieving data, thereby improving the performance and accuracy of multi-table queries at least to a certain extent.

[0005] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.

[0006] According to one aspect of an embodiment of the present application, a method for storing data retrieval is provided, the method comprising: receiving a query request for querying data within data query range information; if it is determined that the data query range information corresponds to multiple storage tables, querying partial records located within the data query range information from the multiple storage tables according to the query request; returning to the current paging page to display the partial records and an entry for triggering at least one other query request to jump to the corresponding other paging page through the current paging page, the other query request being used to request querying data within the data query range information, and the other paging page being used to display other partial records located within the data query range information queried according to the other query request.

[0007] According to one aspect of an embodiment of the present application, a storage data retrieval device is provided, the device comprising: a receiving unit, configured to receive a query request for querying data within data query range information; a query unit, configured to query partial records within the data query range information from the multiple storage tables according to the query request if it is determined that the data query range information corresponds to multiple storage tables; a returning unit, configured to return a current paging page, so as to display the partial records through the current paging page and to trigger at least one other query request to jump to a corresponding other paging page, the other query request being used to request querying data within the data query range information, and the other paging page being used to display other partial records within the data query range information queried according to the other query request.

[0008] In some embodiments of the present application, based on the aforementioned scheme, the query unit is configured as follows: if it is determined that the data query range information corresponds to multiple storage tables, then multiple target storage tables that need to be queried in a sequence are determined according to the data query range information; the multiple target storage tables are queried in sequence in order to obtain partial records located within the data query range information queried according to the query request.

[0009] In some embodiments of the present application, based on the aforementioned scheme, the device further includes a determination unit, the query request carries an original offset and an original truncation amount, and before querying the multiple target storage tables in sequence according to the sequence, the determination unit is used to: determine the number of records hit in each of the target storage tables according to the data query range information; the query unit is configured to: start from the first target storage table that needs to be queried among the multiple target storage tables, and execute a variable acquisition step and a query step on each target storage table in sequence according to the sequence to obtain the records queried according to the query request; the variable acquisition step includes: when the current target storage table is the first target storage table, using the original offset as the offset of the first target storage table amount, and use the original truncation amount as the truncation amount of the first target storage table; or, in the case that the current target storage table is not the first target storage table, determine the offset of the current target storage table according to the comparison result of the offset of the previous target storage table and the number of records hit in the previous target storage table, and determine the truncation amount of the current target storage table according to the comparison result of the truncation amount of the previous target storage table and the number of records queried in the previous target storage table; the query step includes: for the current target storage table, determine the starting position of the records to be taken out from the current target storage table according to the offset of the current target storage table, and obtain the queried records from the current target storage table according to the starting position and the truncation amount of the current target storage table.

[0010] In some embodiments of the present application, based on the aforementioned scheme, the device also includes other request receiving units and other request query units. After obtaining the partial records located within the data query range information queried according to the query request, the other request receiving unit is used to receive other query requests requesting to query data within the data query range information. The other request query unit is used to start from the first target storage table and, based on other original offsets and other original truncation amounts carried in the other query requests, sequentially execute the variable acquisition step and the query step on each target storage table in the order described, to obtain the records queried according to the other query requests.

[0011] In some embodiments of the present application, based on the aforementioned scheme, the other original truncation amount is equal to the original truncation amount, the other original offset is equal to the sum of the original offset and the original truncation amount, and the other query request is generated by the entry trigger in the current paging page for triggering the other query request to transfer to the corresponding other paging page.

[0012] In some embodiments of the present application, based on the aforementioned scheme, the device also includes a query ending unit, and after obtaining the records queried according to the other query request, the query ending unit is used to: end the query if the sum of the other original truncation amount and the other original offset is greater than the sum of the number of records hit in the multiple storage tables.

[0013] In some embodiments of the present application, based on the aforementioned scheme, the other original truncation amount is not equal to the original truncation amount, and the other original truncation amount is determined from multiple different truncation amounts according to a selection instruction triggered by a user, and the multiple different truncation amounts include the other original truncation amount and the original truncation amount.

[0014] In some embodiments of the present application, based on the aforementioned scheme, before determining that the data query range information corresponds to multiple storage tables, the determination unit is also used to: generate identification information of the storage table based on the data query range information; and determine whether the data query range information corresponds to multiple storage tables based on the number of identification information of the storage table.

[0015] In some embodiments of the present application, based on the aforementioned scheme, the query unit is configured to: determine the hit records in the multiple storage tables according to the data query range information; sort the hit records in the multiple storage tables in a specified manner to obtain multiple target storage tables that need to be queried in sequence.

[0016] According to one aspect of an embodiment of the present application, a computer-readable medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the storage data retrieval method as described in the above embodiment is implemented.

[0017] According to one aspect of an embodiment of the present application, an electronic device is provided, comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the storage data retrieval method as described in the above embodiments.

[0018] According to one aspect of an embodiment of the present application, a computer program product is provided, which includes computer instructions, wherein the computer instructions are stored in a computer-readable storage medium, a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the storage data retrieval method described in the above embodiment.

[0019] In the technical solutions provided by some embodiments of the present application, when the data query range information of a query request corresponds to multiple storage tables, that is, when the query request involves queries of multiple storage tables, only some records within the data query range information are queried from the multiple storage tables, and the current paging page is returned to display the part of the records through the current paging page. The current paging page also displays an entry for triggering at least one other query request that also requests to query data within the data query range information to jump to the corresponding other paging pages. The other paging pages are also used to display other partial records within the data query range information queried according to other query requests. Therefore, the scheme of the embodiment of the present application realizes segmented query of records in multiple storage tables in the cross-table query scenario, and can query all data within the data query range information respectively through multiple query requests, and display the partial records corresponding to each query request respectively through multiple paging pages, and divide all data involved in the cross-table query according to the query request. Each query request is only used to query the partial records within the data query range information. There is no need to return a large amount of data involved in the data query range information at one time, thereby ensuring storage and query performance; in addition, the embodiment of the present application triggers a query request at the entrance of a certain paging page to jump to the corresponding paging page to display the queried records, thereby realizing orderly and reliable query, thereby ensuring the accuracy of multi-table query.

[0020] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0022] Figure 1 A schematic diagram showing an exemplary system architecture to which the technical solution of the embodiments of the present application can be applied;

[0023] Figure 2A flow chart of a storage data retrieval method according to an embodiment of the present application is shown;

[0024] Figure 3 A schematic diagram of a Key generation algorithm according to an embodiment of the present application is shown;

[0025] Figure 4 A schematic diagram of a cross-year query according to an embodiment of the present application is shown;

[0026] Figure 5 A schematic diagram of an interface for paging design according to an embodiment of the present application is shown;

[0027] Figure 6 An embodiment according to the present application is shown Figure 2 Flowchart of steps before step 240 in the embodiment;

[0028] Figure 7 A schematic diagram showing an array storing key values ​​of two storage tables according to an embodiment of the present application is shown;

[0029] Figure 8 An embodiment according to the present application is shown Figure 2 A flowchart of the details of step 240 in an embodiment;

[0030] Fig. 9 An embodiment according to the present application is shown Figure 8 A flowchart of the details of step 241 in the embodiment;

[0031] Fig.10 An embodiment according to the present application is shown Fig. 9 A flowchart of the steps before step 243 and details of step 243 in the embodiment;

[0032] Fig.11 A schematic diagram showing the principle of the first query of the front end according to an embodiment of the present application is shown;

[0033] Fig.12 An embodiment according to the present application is shown Fig.10 Flow chart of the steps after step 243 in the embodiment;

[0034] Fig.13 A schematic diagram showing the principle of the second query of the front end according to an embodiment of the present application is shown;

[0035] Fig.14 A schematic diagram showing the principle of the third query of the front end according to an embodiment of the present application is shown;

[0036] Fig.15 A schematic diagram showing the principle of the fourth query of the front end according to an embodiment of the present application is shown;

[0037] Fig.16 A schematic diagram of an interface for modifying a cutoff amount according to an embodiment of the present application is shown;

[0038] Fig.17 A schematic diagram of an overall process according to an embodiment of the present application is shown;

[0039] Fig.18 A block diagram of a storage data retrieval device according to an embodiment of the present application is shown;

[0040] Fig.19 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown. DETAILED DESCRIPTION

[0041] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be more comprehensive and complete and fully convey the concept of the example embodiments to those skilled in the art.

[0042] In addition, described feature, structure or characteristic can be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present application. However, those skilled in the art will appreciate that the technical scheme of the present application can be put into practice without one or more of the specific details, or other methods, components, devices, steps, etc. can be adopted. In other cases, known methods, devices, realizations or operations are not shown or described in detail to avoid blurring the various aspects of the application.

[0043] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0044] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.

[0045] Relational database management systems such as MySQL use storage tables to organize, store, and manage data. Storage tables can also be called data tables. Tables are matrices of data, and a table in a database looks like a simple spreadsheet.

[0046] Currently, a data query request may involve multiple tables. In related technologies, the query method for these tables is to pull out all the data matching the data query request from all tables at once and return all the data to the requester.

[0047] The inventors discovered that the defect of the related technology is that since the data requested for query involves multiple tables, the amount of data requested for query is often massive. At this time, if a large amount of data is pulled at one time, the storage performance and query performance of the database will reach a bottleneck, resulting in a significant decrease in the storage performance and query performance of the database, and may even cause the database to crash, and may also cause the query accuracy to decrease.

[0048] To this end, the present application first provides a storage data retrieval method. The storage data retrieval method provided based on the embodiment of the present application can overcome the above-mentioned defects, not only can it ensure that the storage performance and query performance are not reduced in the case of multi-table query, but also can ensure the accuracy of the query, can greatly reduce the possibility of database downtime, and ensure the reliability of the database.

[0049] Figure 1 A schematic diagram of an exemplary system architecture to which the technical solution of the embodiment of the present application can be applied is shown. Figure 1 As shown, the system architecture 100 may include a database server 110, a web server 120, and a plurality of user terminals, wherein the plurality of user terminals specifically include a first user terminal 131, a second user terminal 132, and a third user terminal 133. A communication link is established between each user terminal and the web server 120, and between the database server 110 and the web server 120. The two parties that have established the communication link can send and receive data. A database is deployed on the database server 110, and the database includes a plurality of data tables. A web server is deployed on the web server 120. A browser is deployed on each user terminal, and the web server 120 is the execution subject of the embodiment of the present application. When a storage data retrieval method provided by the present application is applied to Figure 1In the system architecture shown in FIG. 1 , a process may be as follows: first, a user of a first user terminal 131 uses a browser on the first user terminal 131 to send a first query request to the web server 120, thereby accessing the web service end on the web server 120, wherein the first query request carries data query range information, an offset, and a truncation amount; then, the web service end obtains the data query range information, an offset, and a truncation amount from the first query request, and determines whether the data query range information corresponds to multiple data tables in the database. If so, a sorting instruction is sent to the database server 110 to sort the hit records in the multiple data tables in the database, thereby obtaining to multiple target storage tables; then, the web server queries the multiple target storage tables in sequence according to the offset and the truncation amount, and the web server can determine which records need to be obtained from the target storage table according to the offset and the truncation amount, thereby obtaining the records queried according to the first query request; next, the web server returns a first paging page to the first user terminal 131, and the first paging page includes the records queried according to the first query request and the entrance to other paging pages. The number of records included in the first paging page is equal to the truncation amount. In each paging page, the page number of the first paging page is 1; then, when the user of the first user terminal 131 uses the first user terminal The browser on the terminal 131 triggers the entrance to the second page page to go to the second page page, and sends a second query request carrying data query range information, offset and truncation amount to the web server 120. The data query range information and truncation amount in the second query request are respectively the same as the data query range information and truncation amount in the first query request, and the offset in the second query request is equal to the sum of the offset and truncation amount in the first query request; then, the web server queries the multiple target storage tables in sequence according to the offset and truncation amount in the second query request, so as to obtain the records queried according to the second query request; next, the web server returns the query result to the first user terminal 131. Returning to the second paging page, the first paging page includes the records queried according to the second query request and the entrance to other paging pages. The number of records included in the second paging page is equal to the truncation amount. In each paging page, the page sequence number of the second paging page is 2, that is, the second paging page is adjacent to the first paging page and the display order is after the first paging page; when the user of the first user terminal 131 triggers the entrance to other paging pages through the browser, a corresponding query request will also be sent to the web server 120, and the web server will also display the corresponding paging page according to the query request, and the paging page includes the records queried according to the query request.

[0050] In some embodiments of the present application, the entries of other paginated pages include at least one of the following: an entry of a paginated page before the current paginated page, an entry of a paginated page after the current paginated page.

[0051] In an embodiment of the present application, the entrances to other paging pages can be switch buttons for adjacent paging pages, for example, they can include a forward switch button and a backward switch button. The forward switch button is only available when the current paging page is not the first paging page, and the backward switch button is only available when the current paging page is not the last paging page.

[0052] In some embodiments of the present application, the entries of other paginated pages include the entries of all paginated pages.

[0053] For example, the access buttons corresponding to each paginated page can be listed in the paginated page, and the page number of the corresponding paginated page can be displayed on the access button; for another example, a secondary menu can be set in the paginated page, and the secondary menu includes options corresponding to each paginated page.

[0054] In some embodiments of the present application, the first query request is the first query request sent to the web server 120 that carries the data query range information.

[0055] In some embodiments of the present application, the database deployed by the database server 110 is Mysql.

[0056] It should be understood that Figure 1 The numbers of database servers, web servers, and user terminals are merely illustrative. Any number of database servers, web servers, and user terminals may be provided as required, i.e., there may be multiple database servers, and the number of user terminals may be less than 3 or more than 3. In addition, the web server may be a server cluster composed of multiple servers.

[0057] It should be noted that Figure 1 The embodiment shown is only one embodiment of the present application. Figure 1 In the solution of the embodiment, each user terminal is a desktop computer, but in other embodiments of the present application, the user terminal can also be a notebook computer, a workstation, a tablet computer, a vehicle-mounted terminal and other types of terminal devices, and each user terminal can be of different types; although in Figure 1In the scheme of the embodiment, the query requests received in sequence correspond to adjacent paging pages. For example, a second paging page adjacent to and following the first paging page is returned according to a second query request following a first query request corresponding to the first paging page. However, in other embodiments of the present application, the paging pages corresponding to two adjacent query requests received may not be adjacent. For example, a first query request is used to return data of the first paging page, and a second query request first received after the first query request is used to return data of the second paging page. However, the second paging page is not adjacent to the first paging page, that is, the second paging page is not adjacent to the first paging page in terms of sequence number and order of records contained therein. Although in Figure 1 The database in the solution of the embodiment is Mysql, but in other embodiments of the present application, the database can also be other various relational databases. The embodiment of the present application does not make any limitation to this, and the protection scope of the present application should not be limited by this.

[0058] It is easy to understand that the storage data retrieval method provided in the embodiment of the present application is generally executed by a server, and accordingly, the storage data retrieval device is generally arranged in the server. However, in other embodiments of the present application, the terminal device may also have similar functions as the server, so as to execute the storage data retrieval scheme provided in the embodiment of the present application.

[0059] Therefore, the embodiments of the present application can be applied to a terminal or a server. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited to this. The terminal and the server can be directly or indirectly connected via wired or wireless communication, and this application is not limited here.

[0060] The implementation details of the technical solution of the embodiment of the present application are described in detail below:

[0061] Figure 2 The flowchart of the storage data retrieval method according to an embodiment of the present application is shown. The storage data retrieval method can be executed by various devices capable of computing and processing, such as user terminals or cloud servers. User terminals include but are not limited to mobile phones, computers, intelligent voice interaction devices, smart home appliances, vehicle terminals, aircraft, etc. Please refer to Figure 2 As shown, the storage data retrieval method comprises at least the following steps:

[0062] In step 210, a query request for searching data within the data query range information is received.

[0063] The embodiment of the present application is used to retrieve data stored in a database, and can be specifically used to retrieve data in a relational database such as a MySQL database. The database may contain multiple storage tables, i.e., data tables; each storage table contains one or more records, and a record is a row in the storage table; each record usually contains multiple fields. The data query range information is used to limit the values ​​of the two endpoints of the data range, so the data query range information is used to query records within the data range whose fields are between two values. The value here can be a date, or various numerical values ​​such as age, height, and weight.

[0064] In order to prevent the amount of data in a single data table from being too large, in the embodiment of the present application, the table is divided according to the year and the business identification information (business ID), that is, different years and different business identification information correspond to different storage tables. In the same year, for each business identification information, a corresponding storage table is set, and the storage table is used to store records matching the year and the business identification information.

[0065] Figure 3 A schematic diagram of a Key generation algorithm according to an embodiment of the present application is shown. Figure 3 As shown, in the embodiment of the present application, a key generation algorithm is used to generate the key of the storage table. Specifically, the generated key is 64 bits, wherein the upper 16 bits are the year and the lower 48 bits are the corporate ID, which is the aforementioned business ID. The generated key can be used as the primary key of the storage table. Therefore, for each enterprise, the embodiment of the present application will establish a storage table for each key of the enterprise. The generated key can be a field recorded in the storage table, or it can be multiple fields recorded in the storage table. For example, the upper 16 bits and the lower 48 bits of the key can be two different fields recorded in the storage table, respectively.

[0066] The query request may only carry the original offset and the original truncation, or it may carry the data query range information, the original offset, and the original truncation at the same time. The query request may be generated based on the user's trigger operation on the front-end page. For example, when the user clicks the query button on the browser page, the query request may be triggered.

[0067] In one embodiment of the present application, the query request includes data query range information, the multiple storage tables are divided according to different years, and the data query range information is a date range spanning different years.

[0068] The solution of the embodiment of the present application is described in detail below by using the solution of the embodiment of the present application to query the records corresponding to the employees who have resigned from the company according to the resignation date.

[0069] Figure 4 FIG. 1 shows a schematic diagram of a cross-year query according to an embodiment of the present application. Figure 4 As shown in the figure, when the user needs to query the records of employees who resigned from the company between December 1, 2022 and February 9, 2023, through Figure 4 The drop-down menu provided in the interface shown can be used to select the resignation date range. When the user has completed the selection of the resignation date range and requests a query, the data query range information in the generated query request is the resignation date range. Therefore, in this scenario, the records corresponding to the employees who have resigned from the company in the storage table may include the resignation date field, and of course may also include other fields such as the resignation employee ID and the resignation employee name. The data query range information may include begin_time and end_time for limiting the date range, begin_time is the starting date, and end_time is the ending date. As mentioned above, since each year corresponds to a storage table, the embodiment of the present application involves the query of multiple tables across the year.

[0070] In the embodiment of the present application, the offset is offset and the truncation is limit. The offset and truncation are used to constrain which data needs to be displayed on which paging page.

[0071] Figure 5 FIG. 1 shows a schematic diagram of a paging interface design according to an embodiment of the present application. Figure 5 As shown, the page returned according to the query request initiated by the user can be as follows Figure 5 As shown, each line is a data item. It can be seen that each page contains at most 10 data items. Each data item corresponds to a record. Each data item is generated based on the corresponding record. Each data item can include part or all of the data of the corresponding record. This query request is the first query request to query data within the data query range information. Therefore, Figure 5 The 10 data items in the first pagination page are displayed. These 10 data items are returned to the user based on the query request containing "offset=0, limit=10". Offset=0 represents the position of the first record to be pulled, and limit=10 represents pulling 10 data items corresponding to 10 records. Each query request corresponds to the display of a pagination page. The truncation amount of the query request determines the upper limit of the number of data items corresponding to the records displayed on each pagination page. Unless the number of records that can be queried by the query request does not reach the truncation amount, the number of data items corresponding to the records displayed in the pagination page displayed by the query request is equal to the truncation amount of the query request.

[0072] In step 240, if it is determined that the data query range information corresponds to multiple storage tables, partial records within the data query range information are queried from the multiple storage tables according to the query request.

[0073] The multiple storage tables are multiple storage tables from the target data closest to the lower limit of the data query range information to the target data closest to the upper limit of the data query range information. Since the data query range information involves multiple storage tables, each query request can only be used to query a portion of the records within the data query range information.

[0074] Before determining whether the data query range information corresponds to multiple storage tables, it is firstly determined whether the data query range information corresponds to multiple storage tables. Figure 6 An embodiment according to the present application is shown Figure 2 Flowchart of steps before step 240 in the embodiment. Figure 6 As shown, before determining that the data query range information corresponds to multiple storage tables, the stored data retrieval method may further include the following steps:

[0075] In step 220, identification information of the storage table is generated according to the data query range information.

[0076] In one embodiment of the present application, generating identification information of the storage table according to the data query range information includes: generating identification information of the storage table according to the year to which the start date and the year to which the end date in the data query range information belong respectively.

[0077] For example, the data query range information includes the starting date begin_time and the end date end_time, begin_time is December 1, 2022, and end_time is February 9, 2023. Then, according to begin_time, it can be obtained that the year is 2022, and according to end_time, it can be obtained that the year is 2023. Since each year corresponds to a storage table in the embodiment of the present application, the identification information of two different storage tables can be obtained according to two different years. The identification information of the storage table is the primary key of the storage table. As mentioned above, since the primary key includes the year and the company ID, after determining the year, the identification information of the storage table can be generated according to the company ID and the year. For example, the identification information of the storage table is generated as follows: a first string of high 16 bits is generated according to the year, and a second string of low 48 bits is generated according to the company ID; the first string and the second string are connected to obtain the identification information of the storage table. A specific method for generating the first character string of the upper 16 bits according to the year is to represent each bit of the year with a four-bit binary number. For example, the year 2022 can be represented as 0010000000100010. Of course, other methods can also be used to generate the first character string. When the enterprise ID is 48 bits, the enterprise ID can be directly used as the second character string. Of course, regardless of whether the enterprise ID is 48 bits, the enterprise ID can be converted into the second character string of the lower 48 bits according to the specified conversion method.

[0078] In step 230, it is determined whether the data query range information corresponds to a plurality of storage tables according to the number of identification information of the storage tables.

[0079] If the number of identification information of the storage tables is greater than 1, for example, identification information of two or more different storage tables is obtained, it can be determined that the data query range information corresponds to multiple storage tables, that is, it is determined that cross-table query is involved; otherwise, it can be determined that the data query range information does not correspond to multiple storage tables.

[0080] Figure 7 A schematic diagram of an array storing key values ​​of two storage tables according to an embodiment of the present application is shown. Figure 7 As shown, an array can be established and the key values ​​of two cross-year storage tables can be stored in the array, where key1 can be the primary key of storage table 1 corresponding to a certain enterprise in 2022, and key2 can be the primary key of storage table 2 corresponding to a certain enterprise in 2023. Figure 7In the embodiment, the high 16 bits of the key of storage table 1 and storage table 2 represent the year, and the low 48 bits represent the enterprise ID. Each storage table may include several records, and each record may include several fields, which may include fields corresponding to the primary key, fields corresponding to basic information, and fields corresponding to store data. Figure 7 In the embodiment, both the storage table 1 and the storage table 2 contain N records, but it is easy to understand that the number of records contained in the storage table 1 and the storage table 2 may be the same or different.

[0081] Figure 8 An embodiment according to the present application is shown Figure 2 Flow chart of details of step 240 in the embodiment. Figure 8 As shown, if it is determined that the data query range information corresponds to multiple storage tables, querying some records within the data query range information from the multiple storage tables according to the query request may specifically include the following steps:

[0082] In step 241, if it is determined that the data query range information corresponds to multiple storage tables, multiple target storage tables that need to be queried in sequence are determined according to the data query range information.

[0083] Fig. 9 An embodiment according to the present application is shown Figure 8 Flow chart of details of step 241 in the embodiment. Please refer to Fig. 9 As shown, determining multiple target storage tables that need to be queried in sequence according to the data query range information may include the following steps:

[0084] In step 2411, hit records are determined in multiple storage tables according to the data query range information.

[0085] According to the data query range information, it can be determined which records in the storage table are hit, that is, which records contain the specified field within the range defined by the data query range information, that is, which records match the data query range information. For example, if the data query range information is the resignation date interval, it can be determined which records in each storage table contain the resignation date field within the resignation date interval. These records are hit records. Each storage table can contain one or more hit records, and some or all records in a storage table can be hit records.

[0086] In step 2412, the hit records in the multiple storage tables are sorted in a specified manner to obtain multiple target storage tables that need to be queried in sequence.

[0087] The specified method may be a pre-set method, may be randomly selected from a number of set methods, or may be a method specified by the query request (for example, the query request may further carry the specified method). The specified method may be, for example, sorting by the size of a field of the record, for example, sorting by the resignation date contained in the record from small to large.

[0088] All hit records are sorted, and the storage table formed after sorting is the target storage table.

[0089] Please continue to see Figure 8 In step 243, multiple target storage tables are queried in sequence to obtain partial records within the data query range information queried according to the query request.

[0090] Since multiple target storage tables are established by sorting records, it is necessary to query each target storage table in sequence to achieve an orderly query.

[0091] Fig.10 An embodiment according to the present application is shown Fig. 9 Flow chart of the steps before step 243 and details of step 243 in the embodiment. Fig.10 As shown, before querying multiple target storage tables in sequence, the following steps may be included:

[0092] In step 242, the number of hit records in each target storage table is determined according to the data query range information.

[0093] For each target storage table, it is possible to determine which records are hit in the target storage table according to the data query range information, thereby determining the number of hit records in each target storage table.

[0094] The multiple target storage tables are queried in sequence to obtain partial records within the data query range information queried according to the query request, which may specifically include the following steps:

[0095] In step 243', starting from the first target storage table that needs to be queried among the multiple target storage tables, the variable acquisition step and the query step are sequentially executed on each target storage table in order to obtain the records queried according to the query request.

[0096] Among them, the variable acquisition step includes: when the current target storage table is the first target storage table, using the original offset as the offset of the first target storage table, and using the original truncation amount as the truncation amount of the first target storage table; or, when the current target storage table is not the first target storage table, determining the offset of the current target storage table based on the comparison result of the offset of the previous target storage table and the number of records hit in the previous target storage table, and determining the truncation amount of the current target storage table based on the comparison result of the truncation amount of the previous target storage table and the number of records queried in the previous target storage table.

[0097] The query step includes: for the current target storage table, determining the starting position of the record to be retrieved from the current target storage table according to the offset of the current target storage table, and obtaining the queried record from the current target storage table according to the starting position and the truncation amount of the current target storage table.

[0098] In one embodiment of the present application, the offset of the current target storage table is determined based on a comparison result of the offset of the previous target storage table and the number of records hit in the previous target storage table, including: if the offset of the previous target storage table exceeds the number of records hit in the previous target storage table, the difference between the offset of the previous target storage table and the number of records hit in the previous target storage table is used as the offset of the current target storage table; if the offset of the previous target storage table does not exceed the number of records hit in the previous target storage table, 0 is used as the offset of the current target storage table.

[0099] If the offset of the previous target storage table exceeds the number of records hit in the previous target storage table, it means that the current query request cannot query records from the previous target storage table. Therefore, by using the difference between the offset of the previous target storage table and the number of records hit in the previous target storage table as the offset of the current target storage table, data can be continued to be acquired from the current target storage table; if the offset of the previous target storage table does not exceed the number of records hit in the previous target storage table, it means that the current query request can still query records from the previous target storage table. Therefore, by using 0 as the offset of the current target storage table, data can be continued to be acquired from the previous target storage table.

[0100] In one embodiment of the present application, the truncation amount of the current target storage table is determined based on a comparison result of the truncation amount of the previous target storage table and the number of records queried in the previous target storage table, including: if the truncation amount of the previous target storage table exceeds the number of records queried in the previous target storage table, the difference between the truncation amount of the previous target storage table and the number of records queried in the previous target storage table is used as the truncation amount of the current target storage table; if the truncation amount of the previous target storage table does not exceed the number of records queried in the previous target storage table, 0 is used as the truncation amount of the current target storage table.

[0101] If the truncation amount of the previous target storage table exceeds the number of records queried in the previous target storage table, it means that all records cannot be obtained from the previous target storage table. Therefore, by taking the difference between the truncation amount of the previous target storage table and the number of records queried in the previous target storage table as the truncation amount of the current target storage table, data can continue to be obtained from the truncation amount of the current target storage table; if the truncation amount of the previous target storage table does not exceed the number of records queried in the previous target storage table, it means that all records can be queried from the previous target storage table. Therefore, there is no need to obtain data from the current target storage table.

[0102] For each target storage table, a variable acquisition step needs to be performed once, and a query step needs to be performed once after the variable acquisition step is performed. Below, the solution of the embodiment of the present application is described by taking the solution of the embodiment of the present application used for querying two target storage tables as an example.

[0103] The pseudo code of the variable acquisition step and query step involved in the above content is as follows: for (traversing two tables)

[0104] {

[0105] Select(table 1, offset, limit, &hit, &select_data_size);

[0106] offset_update=offset>hit? offset-hit:0;

[0107] limit_update=limit>select_data_size? limit-select_data_size:0;

[0108] set_offset_and_limit(offset_update, limit_update);

[0109] }

[0110] Among them, Table 1 is storage table 1, which is the first target storage table, offset is the offset of the first target storage table, limit is the truncation amount of the first target storage table, hit is the number of records hit in the first target storage table, select_data_size is the number of records queried in the first target storage table according to offset and limit, offset_update is the offset of the second target storage table, limit_update is the truncation amount of the second target storage table, the second target storage table (storage table 2) is the first target storage table that needs to be queried after the first target storage table, for is a loop statement, Select is used to select data from the database, and set_offset_and_limit is used to use offset_update and limit_update as the offset and limit of the current target storage table.

[0111] In the above pseudo code, the calculation of offset_update and limit_update uses the conditional operator (ternary operator), and its expression is "expression1?expression2:expression3". During the operation, expression1 is solved first. If its value is true (non-0), the value of expression2 is used as the value of the entire expression. Otherwise (the value of expression1 is 0), the value of expression3 is used as the value of the entire expression.

[0112] Fig.11 FIG. 1 shows a schematic diagram of the principle of the first query of the front end according to an embodiment of the present application. Fig.11 As shown, the first query of the front end is the query request received for the first time by the front end. Assuming that storage table 1 and storage table 2 are two target storage tables determined according to the data query range information, then data1 to data5 in storage table 1 are 5 records hit in storage table 1, and these records may be part or all of the records in storage table 1. Data1 to data5 in storage table 2 are 5 records hit in storage table 2, and these records may be part or all of the records in storage table 2. After receiving the query request for the first time, the following operations will be performed on storage table 1 and storage table 2 in sequence: for storage table 1, determine hit=5, that is, there are 5 hit records in storage table 1; determine the corresponding offset=0, limit=3, that is, the starting position of the records pulled from storage table 1 is 0, and pull the data corresponding to the 3 records from storage table 1 (such as Fig.11As shown in the cursor of storage table 1 in the table, therefore, according to offset=0 and limit=3, data corresponding to the three records of data1, data2, and data3 can be pulled from storage table 1, so that select_data_size=3 of storage table 1 can be obtained. The reason why all data of all records are not pulled here is that only part of the data of the record may be pulled and displayed, so the data corresponding to the record may be part of the data of the record or all of the data; then it is necessary to query storage table 2, and determine hit=5 for storage table 2, that is, there are 5 hit records in storage table 2. Since offset=0, limit=3, hit=5, and select_data_size=3 corresponding to storage table 1, therefore, since offset=0<hit=5, the offset of storage table 2 can be determined according to the above pseudo code, that is, offset_update=0; since the condition of "limit=3>select_data_size=3" does not hold, therefore, the limit of storage table 2 can be determined according to the above pseudo code, that is, limit_update=0 (as shown in the table Fig.11 As shown in the cursor of storage table 2 in the table, data will not be taken out from storage table 2.

[0113] Similarly, if the data query range information corresponds to more storage tables, the corresponding offset and truncation amount will continue to be determined for the other storage tables, and the query will be performed based on the offset and truncation amount.

[0114] It is easy to understand that the aforementioned variable acquisition step involves the number of records queried in the previous target storage table and the number of records hit in the previous target storage table, that is, Fig.11 The hit and select_data_size corresponding to the storage table 1 shown, therefore, when the variable acquisition step is actually executed, the number of records queried in the current target storage table and the number of records hit in the current target storage table can also be obtained. Of course, since the number of records queried and the number of records hit in the last target storage table do not need to be calculated, therefore, when the current target storage table is the target storage table that needs to be queried last, the number of records queried and the number of records hit do not need to be calculated.

[0115] Please continue to see Figure 2 In step 250, the current paging page is returned to display partial records through the current paging page and an entry for triggering at least one other query request to jump to the corresponding other paging page, the other query request is used to request to query data within the data query range information, and the other paging page is used to display other partial records located within the data query range information queried according to the other query request.

[0116] The current pagination page can be Figure 5 The pagination page shown. Figure 5 The forward switch button and the backward switch button shown are the entrances for triggering at least one other query request to switch to the corresponding other paginated pages. For example, when the user triggers the backward switch button, a query request will be triggered, and the query request contains "offset=10, limit=10". The query request will request to return the next paginated page, which contains the subsequent 10 items of data. When the user triggers the backward switch button multiple times, multiple query requests will be triggered in turn, and after each query request is triggered, the paginated page corresponding to the query request can be obtained.

[0117] Although in Figure 5 In the embodiment, the first paginated page is shown, that is, the query request requesting the return of the first paginated page is the first query request requesting information within the data query range, but the query request in the embodiment of the present application can be either the first query request requesting information within the data query range or a subsequent query request requesting information within the data query range. These query requests are used to request the return of other paginated pages, and these query requests may carry the data query range information or may not carry the data query range information.

[0118] In one embodiment of the present application, before returning the current paging page, the method further includes: performing format conversion on at least a portion of data in the partial records retrieved according to the query request.

[0119] The current paging page presents the data after format conversion. The data format in the record cannot be directly displayed on the front-end page under normal circumstances. Therefore, by performing format conversion before displaying the page, the converted data can be directly displayed on the front-end page, ensuring that the retrieved data can be displayed correctly.

[0120] Fig.12 An embodiment according to the present application is shown Fig.10 Flow chart of the steps after step 243 in the embodiment. Fig.12 As shown, after obtaining the partial records located within the data query range information queried according to the query request, the method further includes the following steps:

[0121] In step 260, other query requests for searching data within the data query range information are received.

[0122] In step 270, based on other original offsets and other original truncation amounts carried in other query requests, starting from the first target storage table, the variable acquisition step and the query step are sequentially executed on each target storage table in order to obtain the records queried according to other query requests.

[0123] In one embodiment of the present application, other query requests are generated by triggering an entry in the current paginated page for triggering other query requests to transfer to corresponding other paginated pages.

[0124] Other query requests are different from the aforementioned query requests. The aforementioned query request can be used to query the data of the first paginated page, and other query requests can be used to query the data of the second paginated page. In this case, other query requests and the aforementioned query request are used to query data that are adjacent in order and have corresponding paginated pages. Of course, other query requests and the aforementioned query request can also be used to query data that are not adjacent in order and have corresponding paginated pages that are adjacent. For example, the aforementioned query request is used to display the first paginated page, and other query requests are used to display the third paginated page.

[0125] As mentioned above, a query request can only query a part of the data within the data query range information, so other query requests can continue to be received to query other data.

[0126] Figure 13-Figure 15 Shown in Fig.11 Based on this, how to perform data query when receiving subsequent query requests. Fig.13 FIG. 1 shows a schematic diagram of the principle of the second query of the front end according to an embodiment of the present application. Fig.13 As shown in the figure, after receiving the query request for the second time, the following operations will be performed on storage table 1 and storage table 2 in sequence: for storage table 1, it is determined that hit=5, that is, there are 5 hit records in storage table 1; it is determined that offset=3 and limit=3 corresponding to storage table 1, that is, the starting position of the records pulled from storage table 1 is 3, and data corresponding to 3 records need to be pulled from storage table 1 (such as Fig.13As shown in the cursor of storage table 1 in the table, therefore, according to offset=0 and limit=3, the data corresponding to the two records data4 and data5 can be pulled from storage table 1, so that select_data_size=2 of storage table 1 can be obtained; then it is necessary to query storage table 2, and determine hit=5 for storage table 2, that is, there are 5 hit records in storage table 2. Since offset=3, limit=3, hit=5, and select_data_size=2 corresponding to storage table 1, therefore, since offset=3<hit=5, the offset of storage table 2 can be determined according to the above pseudo code, that is, offset_update=0; since the condition "limit=3>select_data_size=2" is established, therefore, the limit of storage table 2 can be determined according to the above pseudo code, that is, limit_update=3-2=1 (as shown in the cursor of storage table 1 in the table, therefore, the data corresponding to the two records data4 and data5 can be pulled from storage table 1, that is, select_data_size=2; then it is necessary to determine the data corresponding to the two records data4 and data5 according to the cursor of storage table 1 in the table, that is, offset_update=0; since the condition "limit=3>select_data_size=2" is established, therefore, the limit of storage table 2 can be determined according to the above pseudo code, that is, limit_update=3-2=1 (as shown in the cursor of storage table 1 in the table, Fig.13 As shown in the cursor of storage table 2 in the table, the data corresponding to the record data1 can be retrieved from storage table 2 according to offset_update=0 and limit_update=1. Finally, according to the second query request received, the data corresponding to the two records data4 in storage table 1, data5 in storage table 1, and data1 in storage table 2 are retrieved.

[0127] Fig.14 FIG. 1 shows a schematic diagram of the principle of the third query of the front end according to an embodiment of the present application. Fig.14As shown, after receiving the query request for the third time, the following operations will be performed on storage table 1 and storage table 2 in sequence: for storage table 1, determine hit=5, that is, there are 5 hit records in storage table 1; determine offset=6 and limit=3 corresponding to storage table 1, that is, the starting position of the records pulled from storage table 1 is 6, and it is necessary to pull data corresponding to 3 records from storage table 1. Therefore, according to offset=6 and limit=3, it is determined that the range is exceeded, and no data is pulled from storage table 1, so select_data_size=0 of storage table 1 can be obtained; then it is necessary to query storage table 2, and determine hi for storage table 2 t=5, that is, there are 5 hit records in storage table 2. Since offset=6, limit=3, hit=5, and select_data_size=0 corresponding to storage table 1, since offset=6>hit=5, at this time, the offset of storage table 2 can be determined according to the above pseudo code, that is, offset_update=offset-hit=1; since the condition "limit=3>select_data_size=0" is established, the limit of storage table 2 can be determined according to the above pseudo code, that is, limit_update=3-0=3 (such as Fig.14 Therefore, according to offset_update=1 and limit_update=3, the data corresponding to the three records data2, data3, and data4 can be retrieved from storage table 2.

[0128] Fig.15 FIG. 4 is a schematic diagram showing the principle of the fourth query of the front end according to an embodiment of the present application. Fig.15As shown, after receiving the query request for the fourth time, the following operations will be performed on storage table 1 and storage table 2 in sequence: for storage table 1, determine hit=5, that is, there are 5 hit records in storage table 1; determine offset=9 and limit=3 corresponding to storage table 1, that is, the starting position of the records pulled from storage table 1 is 9, and it is necessary to pull data corresponding to 3 records from storage table 1. Therefore, according to offset=9 and limit=3, it is determined that the range is exceeded, and no data is pulled from storage table 1, so select_data_size=0 of storage table 1 can be obtained; then it is necessary to query storage table 2, and determine hi for storage table 2 t=5, that is, there are 5 hit records in storage table 2. Since offset=9, limit=3, hit=5, and select_data_size=0 corresponding to storage table 1, since offset=9>hit=5, at this time, the offset of storage table 2 can be determined according to the above pseudo code, that is, offset_update=offset-hit=4; since the condition "limit=3>select_data_size=0" is established, the limit of storage table 2 can be determined according to the above pseudo code, that is, limit_update=3-0=3 (such as Fig.15 Therefore, according to offset_update=4 and limit_update=3, the data corresponding to the record data5 can be retrieved from storage table 2.

[0129] It is easy to understand that since the embodiments of the present application are particularly suitable for querying a large number of records across storage tables, under normal circumstances, the truncation amount corresponding to the storage table is smaller than the number of records hit in the storage table.

[0130] In one embodiment of the present application, the other original truncation amount is equal to the original truncation amount, and the other original offset is equal to the sum of the original offset and the original truncation amount.

[0131] As mentioned above, the limit corresponding to storage table 1 in each query request received is 3, which means that the paging page returned by each query request received is used to display data corresponding to the same number of records, that is, data corresponding to 3 records; the offset corresponding to storage table 1 in the next query request received is equal to the sum of the offset corresponding to storage table 1 in the previous query request received and the limit corresponding to storage table 1 in the previous query request received, which means that the offset corresponding to storage table 1 in the next query request received is obtained by performing cursor offset on the basis of the offset and limit corresponding to storage table 1 in the previous query request received.

[0132] In an embodiment of the present application, by making other original truncation amounts equal to the original truncation amounts, and making other original offsets equal to the sum of the original offsets and the original truncation amounts, it is possible to display the data corresponding to the records in the data query range information in segments through the corresponding paging pages in turn according to each query request.

[0133] In one embodiment of the present application, the other original truncation amounts are not equal to the original truncation amounts, and the other original truncation amounts are determined from a plurality of different truncation amounts according to a selection instruction triggered by a user, and the plurality of different truncation amounts include the other original truncation amounts and the original truncation amounts.

[0134] Fig.16 A schematic diagram of an interface for modifying a cutoff amount according to an embodiment of the present application is shown.

[0135] See also Fig.16 As shown, the user can modify the truncation amount through the menu shown on the page. The current truncation amount is 10 items / page. The menu also displays other truncation amounts such as 20 items / page, 30 items / page, and 40 items / page. After the user triggers a selection instruction for another truncation amount, other query requests containing other truncation amounts are generated according to the truncation amount selected by the selection instruction.

[0136] In one embodiment of the present application, after obtaining the records queried according to other query requests, the stored data retrieval method may further include the following steps:

[0137] If the sum of other original truncation amounts and other original offsets is greater than the sum of the number of records hit in multiple storage tables, the query ends.

[0138] Please continue to see Fig.15 As shown, the offset corresponding to storage table 1 is 9, and the limit is 3, that is, offset+limit=12. The two storage tables contain a total of 10 hit records, that is, the sum of offset and limit is greater than the sum of the number of hit records contained in storage table 1 and storage table 2. In this way, it can be determined that all the required data has been obtained from the two storage tables, and the query is terminated at this time.

[0139] It is easy to understand that before the step of receiving other query requests for querying data within the data query range information in the aforementioned embodiment, it is also possible to first determine whether the original offset and the original truncation amount carried in the query request are greater than the sum of the number of records hit in multiple storage tables. If so, receiving other query requests for querying data within the data query range information is allowed, otherwise the query is terminated.

[0140] As described above, the embodiment of the present application can allow a user to jump from a first pagination page to a second pagination page that is not adjacent to the first pagination page. During this process, the data that needs to be displayed in other pagination pages between the two pagination pages can be queried based on the method provided in the embodiment of the present application; of course, it is also possible to directly retrieve the data that needs to be displayed in the second pagination page without retrieving the data that needs to be displayed in other pagination pages between the two pagination pages.

[0141] Next, combine Fig.17 The overall solution of the embodiment of the present application is further introduced. Fig.17 FIG. 2 shows a schematic diagram of an overall process according to an embodiment of the present application. Fig.17 As shown, it includes the following processes:

[0142] Step 1710, the front end carries the offset query data.

[0143] The offset query data carried by the query request from the front end may include begin_time, end_time, offset, and limit. The meanings of these offset query data have been introduced in the previous embodiments and will not be repeated here. Among them, begin_time and end_time remain unchanged in multiple query requests from the front end.

[0144] Step 1720, set basic filter parameters.

[0145] A filter is a unit used to query data. Basic parameters may include corpid, begin_time, end_time, and order, where order is the way to sort records.

[0146] Step 1730, generate a storage key.

[0147] By generating the primary key of the storage table according to begin_time and end_time, the primary keys corresponding to the two storage tables can be obtained.

[0148] Step 1740, query storage table 1.

[0149] Start querying storage table 1.

[0150] Step 1750, has the number of queries reached the upper limit?

[0151] It is determined whether the number of records found has reached the upper limit of the number of records that should be found according to the current query request. If yes, step 1760 is executed; if not, step 1770 is executed.

[0152] Step 1760, the data is returned to the front end and the query is initiated again.

[0153] The data queried this time is displayed through the paginated pages, and the user can initiate a query again and restart the execution of step 1710 and subsequent steps.

[0154] Step 1770, reset the cursor offset.

[0155] Re-determine the offset and truncation amount corresponding to storage table 2 according to the algorithm provided by the above pseudo code.

[0156] Step 1780, query storage table 2.

[0157] According to the offset and truncation amount corresponding to storage table 2, storage table 2 is queried.

[0158] Step 1790, has the number of queries reached the upper limit?

[0159] It is determined again whether the number of records that can be queried has reached the upper limit of the number that should be queried according to the current query request. If yes, execute step 1760; if not, execute step 17100.

[0160] Step 17100, the data is returned to the front end, and the query ends.

[0161] If the number of records queried from storage table 2 does not reach the upper limit of the number that should be queried according to the current query request, it means that all records have been queried, the data queried this time is displayed through the paging page, and the query is ended.

[0162] To summarize, the storage data retrieval method provided in the embodiment of the present application can be applied to various scenarios of simultaneous query of multiple tables, can accurately calculate the offset and truncation amount, and can ensure the correct sorting and display of the query data. At the same time, the embodiment of the present application does not involve a large amount of data in a single data query range information, but performs multiple rounds of queries in succession according to multiple query requests, and determines and limits the data queried and returned each time through paging pages, offsets and truncation amounts, effectively ensuring storage and query performance.

[0163] The following describes an apparatus embodiment of the present application, which can be used to execute the storage data retrieval method in the above-mentioned embodiment of the present application. For details not disclosed in the apparatus embodiment of the present application, please refer to the above-mentioned embodiment of the storage data retrieval method of the present application.

[0164] Fig.18 A block diagram of a storage data retrieval device according to an embodiment of the present application is shown.

[0165] Reference Fig.18As shown, according to an embodiment of the present application, a storage data retrieval device 1800 includes: a receiving unit 1810, a query unit 1820, and a return unit 1830. The receiving unit 1810 is used to receive a query request for querying data within the data query range information; the query unit 1820 is used to query the partial records within the data query range information from the multiple storage tables according to the query request if it is determined that the data query range information corresponds to multiple storage tables; the return unit 1830 is used to return the current paging page, so as to display the partial records through the current paging page and to trigger at least one other query request to go to the corresponding other paging page, the other query request is used to request to query data within the data query range information, and the other paging page is used to display other partial records within the data query range information queried according to the other query request.

[0166] In some embodiments of the present application, based on the aforementioned scheme, the query unit 1820 is configured as follows: if it is determined that the data query range information corresponds to multiple storage tables, then multiple target storage tables that need to be queried in a sequence are determined according to the data query range information; the multiple target storage tables are queried in sequence in the sequence to obtain partial records located within the data query range information queried according to the query request.

[0167] In some embodiments of the present application, based on the aforementioned scheme, the device further includes a determination unit, the query request carries an original offset and an original truncation amount, and before querying the multiple target storage tables in sequence according to the sequence, the determination unit is used to: determine the number of records hit in each of the target storage tables according to the data query range information; the query unit 1820 is configured to: start from the first target storage table that needs to be queried among the multiple target storage tables, and execute a variable acquisition step and a query step on each target storage table in sequence according to the sequence to obtain the records queried according to the query request; the variable acquisition step includes: when the current target storage table is the first target storage table, using the original offset as the offset of the first target storage table; The method further comprises: determining an offset of the previous target storage table and taking the original truncation amount as the truncation amount of the first target storage table; or, in the case where the current target storage table is not the first target storage table, determining an offset of the current target storage table according to a comparison result of an offset of the previous target storage table and the number of records hit in the previous target storage table, and determining a truncation amount of the current target storage table according to a comparison result of the truncation amount of the previous target storage table and the number of records queried in the previous target storage table; the query step comprises: for the current target storage table, determining a starting position of records to be retrieved from the current target storage table according to the offset of the current target storage table, and obtaining queried records from the current target storage table according to the starting position and the truncation amount of the current target storage table.

[0168] In some embodiments of the present application, based on the aforementioned scheme, the device also includes other request receiving units and other request query units. After obtaining the partial records located within the data query range information queried according to the query request, the other request receiving unit is used to receive other query requests requesting to query data within the data query range information. The other request query unit is used to start from the first target storage table and, based on other original offsets and other original truncation amounts carried in the other query requests, sequentially execute the variable acquisition step and the query step on each target storage table in the order described, to obtain the records queried according to the other query requests.

[0169] In some embodiments of the present application, based on the aforementioned scheme, the other original truncation amount is equal to the original truncation amount, the other original offset is equal to the sum of the original offset and the original truncation amount, and the other query request is generated by the entry trigger in the current paging page for triggering the other query request to transfer to the corresponding other paging page.

[0170] In some embodiments of the present application, based on the aforementioned scheme, the device also includes a query ending unit, and after obtaining the records queried according to the other query request, the query ending unit is used to: end the query if the sum of the other original truncation amount and the other original offset is greater than the sum of the number of records hit in the multiple storage tables.

[0171] In some embodiments of the present application, based on the aforementioned scheme, the other original truncation amount is not equal to the original truncation amount, and the other original truncation amount is determined from multiple different truncation amounts according to a selection instruction triggered by a user, and the multiple different truncation amounts include the other original truncation amount and the original truncation amount.

[0172] In some embodiments of the present application, based on the aforementioned scheme, before determining that the data query range information corresponds to multiple storage tables, the determination unit is also used to: generate identification information of the storage table based on the data query range information; and determine whether the data query range information corresponds to multiple storage tables based on the number of identification information of the storage table.

[0173] In some embodiments of the present application, based on the aforementioned scheme, the query unit 1820 is configured to: determine the hit records in the multiple storage tables according to the data query range information; sort the hit records in the multiple storage tables in a specified manner to obtain multiple target storage tables that need to be queried in sequence.

[0174] Fig.19 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown.

[0175] It should be noted that Fig.19 The computer system 1900 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0176] like Fig.19As shown, the computer system 1900 includes a central processing unit (CPU) 1901, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1902 or the program loaded from the storage part 1908 to the random access memory (RAM) 1903, such as executing the method described in the above embodiment. In RAM 1903, various programs and data required for system operation are also stored. CPU 1901, ROM 1902 and RAM 1903 are connected to each other through bus 1904. Input / output (I / O) interface 1905 is also connected to bus 1904.

[0177] The following components are connected to the I / O interface 1905: an input section 1906 including a keyboard, a mouse, etc.; an output section 1907 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1908 including a hard disk, etc.; and a communication section 1909 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 1909 performs communication processing via a network such as the Internet. A drive 1910 is also connected to the I / O interface 1905 as needed. A removable medium 1911, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1910 as needed so that a computer program read therefrom is installed into the storage section 1908 as needed.

[0178] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 1909, and / or installed from a removable medium 1911. When the computer program is executed by a central processing unit (CPU) 1901, various functions defined in the system of the present application are executed.

[0179] It should be noted that the computer-readable medium shown in the embodiment of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, - but not limited to - an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by an instruction execution system, device or device or used in combination with it. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0180] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0181] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.

[0182] As one aspect, the present application also provides a computer-readable medium, which may be included in the electronic device described in the above embodiment; or may exist independently without being assembled into the electronic device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by an electronic device, the electronic device implements the method described in the above embodiment.

[0183] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.

[0184] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation methods of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the implementation methods of the present application.

[0185] It is understandable that in the specific implementation of the present application, data related to storage data retrieval is involved. When the above embodiments of the present application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.

[0186] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the embodiments disclosed herein. The present application is intended to cover any variations, uses or adaptations of the present application, which follow the general principles of the present application and include common knowledge or customary technical means in the art that are not disclosed in the present application.

[0187] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. A method for retrieving stored data, characterized in that: The method comprises: receiving a query request for querying data within the data query range information; If it is determined that the data query range information corresponds to multiple storage tables, querying some records within the data query range information from the multiple storage tables according to the query request; Return to the current paging page to display the partial records and the entrance for triggering at least one other query request to jump to the corresponding other paging page through the current paging page, the other query request is used to request to query data within the data query range information, and the other paging page is used to display other partial records located within the data query range information queried according to the other query request.

2. The method for retrieving stored data according to claim 1, characterized in that: If it is determined that the data query range information corresponds to a plurality of storage tables, querying a portion of the records within the data query range information from the plurality of storage tables according to the query request includes: If it is determined that the data query range information corresponds to multiple storage tables, then determining multiple target storage tables that need to be queried in sequence according to the data query range information; The multiple target storage tables are queried in sequence according to the sequence to obtain partial records located within the data query range information queried according to the query request.

3. The method for retrieving stored data according to claim 2, characterized in that: The query request carries an original offset and an original truncation amount. Before querying the multiple target storage tables in sequence according to the sequence, the method further includes: Determine the number of hit records in each of the target storage tables according to the data query range information; The querying of the plurality of target storage tables in sequence in the order of precedence to obtain partial records located within the data query range information queried according to the query request includes: Starting from a first target storage table that needs to be queried among the multiple target storage tables, the variable acquisition step and the query step are sequentially performed on each target storage table in the sequence to obtain records queried according to the query request; The variable acquisition step includes: when the current target storage table is the first target storage table, using the original offset as the offset of the first target storage table, and using the original truncation amount as the truncation amount of the first target storage table; or, when the current target storage table is not the first target storage table, determining the offset of the current target storage table according to a comparison result of the offset of the previous target storage table and the number of records hit in the previous target storage table, and determining the truncation amount of the current target storage table according to a comparison result of the truncation amount of the previous target storage table and the number of records queried in the previous target storage table; The query step includes: for the current target storage table, determining the starting position of the record to be retrieved from the current target storage table according to the offset of the current target storage table, and obtaining the queried record from the current target storage table according to the starting position and the truncation amount of the current target storage table.

4. The method for retrieving stored data according to claim 3, characterized in that: After obtaining the partial records located within the data query range information queried according to the query request, the method further includes: receiving other query requests for querying data within the data query range information; According to other original offsets and other original truncation amounts carried in the other query requests, starting from the first target storage table, the variable acquisition step and the query step are sequentially executed on each target storage table in the sequence to obtain records queried according to the other query requests.

5. The method for retrieving stored data according to claim 4, characterized in that: The other original truncation amount is equal to the original truncation amount, the other original offset is equal to the sum of the original offset and the original truncation amount, and the other query request is generated by the entry in the current paging page that is used to trigger the other query request to transfer to the corresponding other paging page.

6. The method for retrieving stored data according to claim 5, characterized in that: After obtaining the records queried according to the other query request, the method further includes: If the sum of the other original truncation amount and the other original offset is greater than the sum of the number of records hit in the multiple storage tables, the query is terminated.

7. The method for retrieving stored data according to claim 4, characterized in that: The other original truncation amount is not equal to the original truncation amount, and the other original truncation amount is determined from a plurality of different truncation amounts according to a selection instruction triggered by a user, and the plurality of different truncation amounts include the other original truncation amount and the original truncation amount.

8. The method for retrieving stored data according to claim 1, characterized in that: Before determining that the data query range information corresponds to a plurality of storage tables, the method further includes: Generate identification information of a storage table according to the data query range information; According to the quantity of the identification information of the storage table, it is determined whether the data query range information corresponds to a plurality of storage tables.

9. The method for retrieving stored data according to claim 2, characterized in that: The determining, according to the data query range information, a plurality of target storage tables that need to be queried in sequence includes: Determine hit records in the multiple storage tables according to the data query range information; The hit records in the multiple storage tables are sorted in a specified manner to obtain multiple target storage tables that need to be queried in sequence.

10. A storage data retrieval device, characterized in that: The device comprises: A receiving unit, configured to receive a query request for querying data within the data query range information; A query unit, configured to query some records within the data query range information from the multiple storage tables according to the query request if it is determined that the data query range information corresponds to multiple storage tables; A return unit is used to return the current paging page so as to display the partial records through the current paging page and to trigger at least one other query request to jump to the entrance of the corresponding other paging page, wherein the other query request is used to request to query data within the data query range information, and the other paging page is used to display other partial records located within the data query range information queried according to the other query request.

11. A computer readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the storage data retrieval method according to any one of claims 1 to 9 is implemented.

12. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, enables the one or more processors to implement the storage data retrieval method according to any one of claims 1 to 9.

13. A computer program product, characterized in that The computer program product includes computer instructions, which are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the storage data retrieval method according to any one of claims 1 to 9.